Commit Graph

20 Commits

Author SHA1 Message Date
Eli White f68e04136c Move TypeForStyleKey from StyleSheetTypes to StyleSheet
Reviewed By: yungsters

Differential Revision: D7281362

fbshipit-source-id: 936d198e83dfbfc62449e82b5559a30bd57621c4
2018-03-20 19:16:46 -07:00
Eli White 4895c645ea Rename Style to DangerouslyImpreciseStyle
Reviewed By: yungsters

Differential Revision: D7190268

fbshipit-source-id: d652a95be7550d65cfbfc59f41d7bda92915bacf
2018-03-08 01:08:42 -08:00
Eli White a3c07c95ef StyleObj -> DangerouslyImpreciseStyleProp
Summary:
Migrating everything to import from StyleSheet instead of StyleSheetTypes.

Search and replaced
```
import type {StyleObj} from 'StyleSheetTypes';
```
to
```
import type {DangerouslyImpreciseStyleProp} from 'StyleSheet';
```

and then replacing `StyleObj` with `DangerouslyImpreciseStyleProp` and fixing up the remaining flow errors by hand.

Reviewed By: yungsters

Differential Revision: D7184077

fbshipit-source-id: b8dabb9d48038b5a997ab715687300bad57aa9d4
2018-03-07 13:24:20 -08:00
Eli White b58e377961 Remove Unused Exports from StyleSheetTypes
Summary: These types were barely used and unnecessary.

Reviewed By: yungsters

Differential Revision: D7177287

fbshipit-source-id: 63cb6d3aae4889a92b2c23f0df864b5657e6e1ee
2018-03-06 23:30:48 -08:00
Eli White b98bf1e097 Remove polymorphic types from StyleSheetTypes
Summary:
These types were polymorphic so that stricter types could be passed in for dimension or color. For example, color could be a union of allowed colors. However, since `rgb(0,0,0)` is a valid color, these would have to be allowed opaque types and every creator or caller of these colors would have to use a function.

This would require a massive change to every RN product in the world for negligable gain because StyleSheet values are validated at dev at runtime and cause redboxes for invalid uses.

Since we don't plan to adopt these widely, lets clean up the complexity of these types.

Reviewed By: sahrens

Differential Revision: D7158920

fbshipit-source-id: c58ae402c8248b0863c217c27153191a49c6b980
2018-03-05 18:57:30 -08:00
Eli White 70a3ececc3 Tightening type for flattenStyle
Reviewed By: yungsters

Differential Revision: D7131703

fbshipit-source-id: d8e37fcd0c743057e04760b1e50f8d879bd2826a
2018-03-03 15:38:26 -08:00
Sophie Alpert 1490ab12ef Update license headers for MIT license
Summary:
Includes React Native and its dependencies Fresco, Metro, and Yoga. Excludes samples/examples/docs.

find: ^(?:( *)|( *(?:[\*~#]|::))( )? *)?Copyright (?:\(c\) )?(\d{4})\b.+Facebook[\s\S]+?BSD[\s\S]+?(?:this source tree|the same directory)\.$
replace: $1$2$3Copyright (c) $4-present, Facebook, Inc.\n$2\n$1$2$3This source code is licensed under the MIT license found in the\n$1$2$3LICENSE file in the root directory of this source tree.

Reviewed By: TheSavior, yungsters

Differential Revision: D7007050

fbshipit-source-id: 37dd6bf0ffec0923bfc99c260bb330683f35553e
2018-02-16 18:31:53 -08:00
glevi@fb.com 6b95c4fb14 @allow-large-files [Flow] Upgrade xplat/js to flow v0.63
Reviewed By: samwgoldman

Differential Revision: D6675320

fbshipit-source-id: 85575a6f30a50a3c40c6b46ba36f8cd33c091b1d
2018-01-08 12:49:53 -08:00
Brian Vaughn 94c565a2c4 Flat ReactNative renderer bundle [WIP]
Reviewed By: trueadm

Differential Revision: D5013497

fbshipit-source-id: 1e23b08751b8b6e2dd570ff584c815c8a9b8f35f
2017-05-26 11:03:06 -07:00
David Aurelio 3683beb88a RN: Update React (2/2)
Reviewed By: kentaromiura

Differential Revision: D4026114

fbshipit-source-id: 67808af91454d95941fea01eef58a4d9086f46e1
2016-11-04 05:43:44 -07:00
David Aurelio bd60d828c5 Remove `node_modules/react` from the list of discoverable haste modules
Summary: This removes `node_modules/react` from the list of directories that are used for haste module resolutions. Modules required from React are now imported with `require('react/lib/…')`.

Reviewed By: astreet

Differential Revision: D3509863

fbshipit-source-id: 32cd34e2b8496f0a6676dbe6bb1eacc18124c01e
2016-07-05 06:44:33 -07:00
Manas 21c433d998 Caches array length in flattenStyles methods for loop
Summary:Gains minor perf improvement in the for loop by caching the array length
Closes https://github.com/facebook/react-native/pull/6671

Differential Revision: D3102064

fb-gh-sync-id: 2303d83f3672a2768c60d0e5dae999b1dda0d6bd
fbshipit-source-id: 2303d83f3672a2768c60d0e5dae999b1dda0d6bd
2016-03-26 06:54:18 -07:00
Sebastian Markbage 433fb336af Refactor Attribute Processing (Step 4)
Summary:This avoids flattening styles in most common cases. It diffs against the nested
arrays. The special case is when a property gets removed, it creates an object
that stores the removed keys which then gets resolved using a second pass
through the nested array.

You can conceptually think of this algorithm as:
1) Diff and store changes as you go
2) If something was removed, flatten as necessary

I also merged in another commit that renames the StyleSheetRegistry to ReactNativePropRegistry. There is nothing in here that makes it specific to styles anymore. That's just a decoupled view attribute configuration option. This registry can be used for any set of nested props, if we even want to keep this feature at all.

Reviewed By: vjeux

Differential Revision: D2492885

fb-gh-sync-id: c976ac28b7e63545132c36da0ee0c1c562e7c9e5
shipit-source-id: c976ac28b7e63545132c36da0ee0c1c562e7c9e5
2016-03-24 15:13:24 -07:00
David Aurelio ad8a335864 Remove knowledge of fbjs from the packager
Summary:Follow-up to https://github.com/facebook/react-native/pull/5084

This…
- changes all requires within RN to `require('fbjs/lib/…')`
- updates `.flowconfig`
- updates `packager/blacklist.js`
- adapts tests
- removes things from `Libraries/vendor/{core,emitter}` that are also in fbjs
- removes knowledge of `fbjs` from the packager

Closes https://github.com/facebook/react-native/pull/5084

Reviewed By: bestander

Differential Revision: D2926835

fb-gh-sync-id: 2095e22b2f38e032599d1f2601722b3560e8b6e9
shipit-source-id: 2095e22b2f38e032599d1f2601722b3560e8b6e9
2016-03-02 04:28:38 -08:00
Gabe Levi 874f39bf7f [Flow] Clean up react-native for Flow v0.15.0 2015-09-04 16:51:18 -08:00
Christopher Chedeau 1a12b95f7a [ReactNative] Revert D2134877 2015-06-08 13:49:28 -08:00
Christopher Chedeau c9e555f4b3 [ReactNative] Better error message when forgetting to wrap Animated 2015-06-08 12:44:32 -08:00
Christopher Chedeau ead3a740ca Second Update from Tue 24 Mar 2015-03-24 19:34:12 -07:00
Christopher Chedeau 5baffa03fd Second Updates from Mon 23 Mar
- [ReactNative] Use deprecated ix in TabBarExample | Amjad Masad
- [ReactNative] Expanded license on obj-c files | Christopher Chedeau
- [ReactNative] Expanded license on js files | Christopher Chedeau
- [ReactNative] Fix React Devtools integration | Alex Kotliarskyi
- [Text] Account for font leading so descenders are not clipped | James Ide
- [ReactNative] Expanded license on js packager files | Christopher Chedeau
- more UIExplorer flow | Basil Hosmer
- [react-packager] Pick up package changes while running | Amjad Masad
- Added a graph view and a ReactNative metric that displays current queue and execution time for the JS thread. | Bryce Redd
- [ReactNative] Add NativeModules and DeviceEventEmitter to react-native exports | Alex Kotliarskyi
2015-03-23 15:07:33 -07:00
Ben Alpert a15603d8f1 Initial commit 2015-01-29 17:10:49 -08:00