Summary: A cell syntax load crept into RN. Remove it so it works with oss
Reviewed By: scottrice
Differential Revision: D9596187
fbshipit-source-id: 1f3138b760f63ae4b1fa23a034e6b9a86396ff50
Summary: Added `snapToStart` and `snapToEnd` props to ScrollView which work together with `snapToOffsets` and determine whether the beginning and end of the list automatically count as snap offsets or not. If not, the list is allowed to free-scroll between its start/end and the first/last snap offset.
Reviewed By: sahrens
Differential Revision: D9442386
fbshipit-source-id: 47a5fdb20f884542434b01b1f0a486ed2b478c6e
Summary:
* Added snapToOffsets prop to ScrollView. Allows snapping at arbitrary points.
* Fixed pagingEnabled not being overridden by snapToInterval on iOS.
* Fixed Android *requiring* pagingEnabled to be defined alongside snapToInterval.
* Added support for decelerationRate on Android.
* Fixed snapping implementation. It was not calculating end position correctly at all (velocity is not a linear offset).
* Resolves https://github.com/facebook/react-native/issues/20155
* Added support for new content being added during scroll (mirrors existing functionality in vertical ScrollView).
* Added support for snapToInterval.
* Resolves https://github.com/facebook/react-native/issues/19552
Reviewed By: yungsters
Differential Revision: D9405703
fbshipit-source-id: b3c367b8079e6810794b0165dfdbcff4abff2eda
Summary: Splitting this into a separate diff for OSS
Reviewed By: yungsters
Differential Revision: D9551085
fbshipit-source-id: 8ca08351c6b89cd0011aab3c47ef6cc28b763450
Summary: Exposes a bool in the config which will help log the yoga hierarchy. Also added a test case
Reviewed By: IanChilds
Differential Revision: D9560577
fbshipit-source-id: ef4998107ed51ea374853bab7cbe09e3232caa0c
Summary: This diff fixes a couple of edge cases that caused Metro to keep the process running when there were some specific errors (specially around the `dependencies` command and the transformer path).
Reviewed By: jrwats
Differential Revision: D9551834
fbshipit-source-id: 959cefcec9e2687dff89c94a871ae74c50d2dd77
Summary:
Makes a couple improvements to `ViewPropTypes`.
- Remove deprecated transform props. We are now using exact object types, so they are already disallowed.
- Remove garbage types for `accessibilityLabel`.
Reviewed By: TheSavior
Differential Revision: D9542088
fbshipit-source-id: f9128353e19cff22caf52c896c9c137f01aea276
Summary:
To be able to test out new approach for NativeModules, introduce a simple runtime flag to enable the new system (doesn't exist yet). In addition, each module should declare a static `+ (BOOL)allowJSIBinding` in the objc class to be considered for the new approach. Doing so skips the processing of the module during bridge startup.
Note: this doesn't do anything special for `- (NSArray *)extraModulesForBridge:(RCTBridge *)bridge` impl yet.
Differential Revision: D9554296
fbshipit-source-id: 3508db6589e9f72367f62aa7ca15fce3d3adda72
Summary: This diff reverts the changes in the name for AndroidHorizontalScrollView and AndroidHorizontalScrollContentView that caused a redbox for continuous OTA users
Reviewed By: fkgozali
Differential Revision: D9561972
fbshipit-source-id: 3d8e9ee8bb6081107bc8d315af16885bb003148e
Summary: And migrated ReactRootViewTestCase to use ReactNativeTestRule.
Reviewed By: mdvacca
Differential Revision: D9557362
fbshipit-source-id: 1469d0ad8c125b5ea729371d81956e61780c56cf
Summary: Now that babel7 is stable, we can upgrade Metro and fbsource to use it, yay!!!!!
Reviewed By: mjesun
Differential Revision: D9518571
fbshipit-source-id: c85569cb3058235f4f9310949897f7955ecf7324
Summary: It's unclear if this was a recent regression or not (too lazy to find out), but instrumentation tests are failing because FrescoModule is never initialized (see task for trace). Based on the initial introduction of this class (D2448321) it appears that FrescoModule was always intended to be initialized on startup. Let's eagerly init Fresco in that case.
Reviewed By: fkgozali
Differential Revision: D9556864
fbshipit-source-id: 0b670dec46f5087b3794330931ddf5d7782c8367
Summary: This diff updates the size of RootShadowNode and re-render RN views when the Size of the Android React View changes
Reviewed By: achen1
Differential Revision: D9173758
fbshipit-source-id: 7cc6bbfb646025c3ec1773ab041eb9207623af71
Summary: This diff implements the HorizontalScrollView component for Android Fabric C++, as part of this diff I also re-named the components AndroidHorizontalScrollContentView for RCTAndroidHorizontalScrollContentView and AndroidHorizontalScrollView for RCTAndroidHorizontalScrollView. This might sound against our plan of removing the RCT preffix, but it is to make it simpler to map components between current implementation of RN and Fabric (otherwise we don't know when to add the RCT preffix in Android side to find the right View Manager), later we can just remove the preffix from C++, Android, iOS and JS.
Reviewed By: shergin, achen1
Differential Revision: D9122729
fbshipit-source-id: e9299552857c6dd0c18abfa5fa49a3d50e221729
Summary: D9070810 introduced a breaking change, making the `--transformer` CLI argument able to override the generic transformer instead of `babelTransformer`. Since we still have some scripts that assume `--transformer` is being used for overriding the babelTransformer path, we cannot do this breaking change yet, so this diff reverts the CLI handling to the old behaviour.
Reviewed By: jrwats
Differential Revision: D9550157
fbshipit-source-id: 8b4e26fcb5bca6e4b2f63b1e1a014bce23a31452
Summary:
The full idea for eagerly creating Native Modules is articulated here https://fb.quip.com/vWcLAup3a6kR
TLDR:
1) Move lazy native module work from the mqt_js thread to the background thread which processes packages. This also moves it from post-network to pre-network.
2) For a quick test, decide which modules to eagerly create with a QE flag.
3) Eagerly create the modules by opting-out of the ReactModuleInfo pipeline which was built for lazy native modules.
Reviewed By: achen1
Differential Revision: D9503934
fbshipit-source-id: 0cd8337ad294cd0f8be692fecbf4292d204f3ec4
Summary:
@public
Now, one of the main purposes of `EventEmitter`s is to create RawEvent instances for all specific event invocations.
Reviewed By: mdvacca
Differential Revision: D8886226
fbshipit-source-id: 82a489174efcda097887e70650a2038dc986d149
Summary:
@public
Now, it's not just an abstract class, it's a regular class which unifies event delivery priorities using specific event beats and event pipe.
Reviewed By: mdvacca
Differential Revision: D8886232
fbshipit-source-id: c4360511e5fd477ca7407fc3ebbd99ca578e79cc
Summary:
@public
The existing code does not use that at all but we need that for testing things and we will need this in the future.
Reviewed By: mdvacca
Differential Revision: D8886236
fbshipit-source-id: 5ca33e4f4d4ca13a6be0f55cc04b59d5f9b27fa9
Summary:
@public
We need that to ensure that we will not deliver events to nodes with invalid state.
Reviewed By: mdvacca
Differential Revision: D8886234
fbshipit-source-id: 1d6ca129c97a5dca0411e85909aea48185f46c54
Summary:
@public
Instead of having two methods it's easier to have just one which can be abstracted as `EventPipe`.
Reviewed By: mdvacca
Differential Revision: D8886231
fbshipit-source-id: af9fd92dc4afa1219a11acce0aa021a85c94d232
Summary:
@public
EventQueue is a queue of events that synchronizing event dispatching with given Event Beat.
The only difference between UnbatchedEventQueue and BatchedEventQueue is that UnbatchedEventQueue `induce` an Event Beat right after enqueing an event.
Reviewed By: mdvacca
Differential Revision: D8886225
fbshipit-source-id: fedba6fdff2ecb6f3c615cea09b5fdaa58890479
Summary:
@public
MessageQueueEventBeat implements particular Event Beat synchronized with Message Queue and calling a callback on the JS thread (aka Message Queue thread). The actual beat is synchronized with the main run loop.
Reviewed By: mdvacca
Differential Revision: D8886230
fbshipit-source-id: 97ef7d10f705789b4b0cd3a12389db960159f289
Summary:
@public
EventBeat is an abstraction around proper event scheduling combining proper timing and proper threading. Event Queues use Event Beat to ensure that events are delivered on proper threads and in proper timing (probably batched). Consumers can `request` the next beat and `induce` immediatly beat.
MainRunLoopEventBeat implements particular Event Beat synchronized with the main event loop and calling a callback on the main thread.
Reviewed By: mdvacca
Differential Revision: D8886229
fbshipit-source-id: 1a42fcbf4cd61c6cb4c502890566c98b00226f31
Summary:
Currently, modifying a component that renders a FlatLists while Hot Reloading is enabled will trigger an invariant inside FlatList for changing viewabilityConfig on the fly. This happens because it checks object equality between the configs.
By checking equality of the config's *properties* instead, we maintain the efficacy of the invariant but keep it from falsely triggering during development.
Reviewed By: sahrens
Differential Revision: D9466129
fbshipit-source-id: 67149e9e70ad7b2e2584bb7ec03e2dea26ef45e8
Summary: Apparently different apps have different implementations of view managers that support different props. This is a problem that we will need to address. Unfortunately, this means we can't have a static config defined in JS. We will need to find another approach to this problem.
Reviewed By: sahrens
Differential Revision: D9500178
fbshipit-source-id: b591559164fcf29f5fd43e13a0f2da15011491c6
Summary: This adds a callback for <Text> to get metrics about the rendered text. It's divided by line but that could be changed to "fragments" (which makes more sense for multi-lingual). Right now by line is convenient as you frequently want to know where the first and last line end (though we could make this work with fragments I suppose).
Reviewed By: shergin
Differential Revision: D9440914
fbshipit-source-id: bb011bb7a52438380d3f604ffe7019b98c18d978
Summary:
Accessibility roles are enums that are looked up by matching a string accessibility role from JS to the enum's name using .toUpperCase(). .toUpperCase() causes issues in certain languages such as Turkish because the "i"s translate to "?".
D9402330 tried to address this by forcing the .toUpperCase to use Locale.US, but now it sometimes translates to "?"
Use .equalsIgnoreCase() instead to avoid translations.
Reviewed By: mdvacca, mmmulani
Differential Revision: D9497494
fbshipit-source-id: 0f8b7f2071b08ccb86655fee7bfd2d009ddde8eb
Summary:
Changes the Flow prop types for `Image`, `Text`, and `View` to be nullable and optional.
This makes these components easier to compose.
Reviewed By: sahrens
Differential Revision: D9494285
fbshipit-source-id: c3f17147f063b31217b239a3abc085d1850f8df9
Summary:
The font colors in the debugger-ui dark mode are not accessible. This PR ensures [Level AAA Conformance to Web Content Accessibility Guidelines 2.0](https://www.w3.org/WAI/WCAG2AAA-Conformance) which makes it better to read for everyone.
Pull Request resolved: https://github.com/facebook/react-native/pull/20559
Differential Revision: D9495584
Pulled By: hramos
fbshipit-source-id: 1a9bdd015935fb27e2d74d2399e687787282a987
Summary: Moving this config to native for android so we skip the native lookup for the config.
Reviewed By: yungsters
Differential Revision: D9485645
fbshipit-source-id: cc0a6e9f12dad0c08aac32ca210373c388d307d6
Summary:
The eslint bot has not been working since the migration to Circle 2.0.
Pull Request resolved: https://github.com/facebook/react-native/pull/20822
Differential Revision: D9492680
Pulled By: hramos
fbshipit-source-id: 7f2f9ac125b6cab1750902c485a6d27d6c3cf302
Summary:
This diff exposes the new more generic way to configure transformers in `Metro` via the config parameter `transformerPath`.
The new generic transformers can be used to transform any kind of file, since they don't call any JS-specific method and their API is generic. They only need to implement a single `transform` method:
```
async function transform(
absolutePath: string,
relativePath: string,
fileContents: Buffer,
options: TransformOptions, // very soon these will be configurable
): Promise<{
output: Array<mixed>,
dependencies: Array<{
name: string,
data: mixed, // very soon
}>,
}> {
// ...
}
```
Metro already had a `transformModulePath` config param, which was used to configure how babel was called in order to generate the AST. In order to avoid confusion, but keep the current open source transformer worker, I've renamed this param to `babelTransformerPath`. We can add a layer of compatibility and detect old config params in order to show a deprecation warning.
Reviewed By: pvdz
Differential Revision: D9070810
fbshipit-source-id: aebde879736026c09537f5d236eae24c06640abf
Summary:
This is the first step to make transformers fully customizable (and not be tied to JS, or RN). In order to do that, I'm changing the signature of the transformers, which currently is:
```
function transformCode(
filename: string,
localPath: LocalPath,
transformerPath: string,
options: WorkerOptions,
assetExts: $ReadOnlyArray<string>,
assetRegistryPath: string,
minifierPath: string,
asyncRequireModulePath: string,
dynamicDepsInPackages: DynamicRequiresBehavior,
)
```
to be:
```
async function transformCode(
filename: string,
localPath: LocalPath,
options: WorkerOptions,
)
```
(so basically, all the RN-custom properties are moved to `WorkerOptions`, which in the future will be a generic to allow anybody pass any random option to their transformers).
In order to make all this work, I've had to get rid of the logic that calculates the base cache key hash based on a subset of worker options (the ones that Metro knows that are not going to change between runs).
This could potentially cause a perf regression (since we're now making the hash calculation a bit more costly), and in fact I could measure a ~400ms regression on the worse case scenario (which happens when restarting Metro and re-transforming a Wilde from a warm local cache).
I've benchmarked this regression and could find that it's caused by the array of `assetExtensions` (which is potentially large). I have a followup diff to improve this, which is able to remove the regression completely.
Reviewed By: pvdz
Differential Revision: D8695766
fbshipit-source-id: eccd18a4cbc91854f34d5c9ba7f95088f19483a1
Summary:
There are some steps known to be failing on master. This pollutes checks for unrelated PRs.
This PR will make it so that PRs submitted by anyone other than myself will no-op on these steps.
Future work: Have an array of whitelisted contributors, and make it much easier to turn individual tests on and off.
Pull Request resolved: https://github.com/facebook/react-native/pull/20818
Differential Revision: D9484946
Pulled By: hramos
fbshipit-source-id: d6c187b341f13552b33d0f1d569b65f6c66ae48f
Summary:
While the original reason for this change was because of an issue #20780, with further investigation I concluded that the issue is till present for this combo of versions:
glog - 0.3.5
google-cast-sdk - 4.3.1
Downgrading google-cast-sdk to 4.3.0 fixed the build issue.
Release Notes:
--------------
Updated glog version from 0.3.4 to 0.3.5 for iOS
[IOS] [ENHANCEMENT] [GLOG]
Pull Request resolved: https://github.com/facebook/react-native/pull/20811
Differential Revision: D9485221
Pulled By: hramos
fbshipit-source-id: 65caf0839588384a5229a6165506dc6ef62e5fc5