Summary:
I would like to believe it's some black magic code but no it's just a typo.
Closes https://github.com/facebook/react-native/pull/8712
Differential Revision: D3550809
fbshipit-source-id: 00a7ba1cbcd36e29af44cdefd5fc1148d11d26e3
Summary:
NavigationTransitioner prepares for transition within `componentWillReceiveProps`, using previously-saved state to determine how to properly handle new props. If a transition is to take place, the code saves new info in state, executes the transition, and cleans up scenes within `_onTransitionEnd`.
If the transition is a jump-to transition, or otherwise takes very little time, then it is possible for the setState call within `_onTransitionEnd` to use state which hasn't yet been set by the code within `componentWillReceiveProps`, resulting in a failed transition.
This fix ensures that the initial setState call is completed before executing the transition.
Closes https://github.com/facebook/react-native/pull/8709
Differential Revision: D3550872
fbshipit-source-id: 1364612048025f5f970b44cbfd0c31acc4a60f56
Summary: This prevents the `isUnbundle` check to read beyond the end of an `NSData` instance by using `getBytes:length:` instead of accessing the underlying buffer directly.
Reviewed By: javache
Differential Revision: D3548874
fbshipit-source-id: 7c93c66cc6abb4a2a321888ab394212f4d14a03e
Summary: Move all JS to a js/ subfolder so we get some overview of this folder again.
Reviewed By: bestander
Differential Revision: D3542598
fbshipit-source-id: 7637133fe4152f4d39e461b443b38510272d5bc8
Summary: The loader should be a utility that stands alone. The bridge uses the loader, not the other way around.
Reviewed By: bnham
Differential Revision: D3546157
fbshipit-source-id: 91016afb629df1f8c83c8fca6f42649be0b046b0
Summary:
This diff exposes a new experimental method `[RCTJavaScriptLoader +attemptSynchronousLoadOfBundleAtURL:sourceLength:error:]`. It may be used if you know that a specific call site must load its JavaScript synchronously, or else fail entirely.
This new API will succeed for file URLs that point to a RAM bundle. It will fail for non-RAM-bundle files and for HTTP URLs.
This also cleans up the error domain and codes for this class. This should be the only externally visible change from this diff if you don't use the new API: the codes and domains you receive from the API may change slightly. They were pretty sloppy and undocumented before, so I think this change is for the better.
Reviewed By: bnham
Differential Revision: D3545956
fbshipit-source-id: 30e65f4e8330d2d68f3f50ade077fdc1db4a435e
Summary:
The `initWithJSContextProvider:` API created a `RCTJSCExecutor` with a thread/context that already exists, but it did not solve the problem of loading an actual application script; the `executeApplicationScript:` API is also asynchronous.
Create a new merged API that allows you to pass in a pre-created thread/context pair and immediately receive an `RCTJSCExector` that has already executed a specified application script.
This also removes the `underlyingJSContext` API entirely, in favor of passing it back in a byref variable in the new API. This minimizes the surface area for API abuse.
Reviewed By: bnham
Differential Revision: D3545349
fbshipit-source-id: 1c564f44d2a5379b5e6f75640079a28fd7169f67
Summary: Provide RTL support in NavigationPager
Reviewed By: fkgozali
Differential Revision: D3536850
fbshipit-source-id: 29890a125dc5e001b4c10208cd53bfeca0d9b5c3
Summary: create new RCTI18nManager.js to warp-up native module I18nManager and fix current use of it.
Reviewed By: ericvicenti
Differential Revision: D3547427
fbshipit-source-id: 53a695c94ca6bba2f566d0725c553e58d60bf451
Summary:
We don't want to remove the last queue from the stack, it should just have no tasks in it.
Fixes issue reported here: https://www.facebook.com/groups/reactnativeoss/permalink/1569170356712926/
Reviewed By: yungsters
Differential Revision: D3539287
fbshipit-source-id: ea95673491fee0ea82f0f1b79b8f60e00cd3d035
Summary:
Instead of two separate dispatches to the JavaScript thread, only do one. Avoid the strongSelf dance entirely.
This refactor does mean that the cost of registering the nativeRequire hook on the context is not measured by the `RCTPLRAMBundleLoad` tag. However it should be almost zero-cost to construct and set a single block, so I'm OK with that change.
Reviewed By: bnham
Differential Revision: D3542940
fbshipit-source-id: d6bd26e478d0d33b56f8116d7efe6aac80c91711
Summary: We deprecated it a while back and nobody is using it internally.
Reviewed By: majak
Differential Revision: D3542602
fbshipit-source-id: dfe11a47b21d2f8a7c946c902f0ea427615ffc31
Summary: This makes the state it uses more explicit. It also makes a bug with performance measurement obvious: if we early return to error, we never mark stop for `RCTPLRAMStartupCodeSize`.
Reviewed By: javache
Differential Revision: D3542751
fbshipit-source-id: e6c1e3f3a76098ca37b8078f6e9abc805ad2d9da
Summary:
Fixes#8611.
Once this lands, we may want to cherry-pick it into 0.29 to fix the broken links.
Closes https://github.com/facebook/react-native/pull/8698
Differential Revision: D3544388
Pulled By: JoelMarcey
fbshipit-source-id: d5132b112e3079d1fd9ab6d84ff1a4328bee871f
Summary: Changes the time drift error into a warning that will only get logged once per debugging session.
Reviewed By: jingc
Differential Revision: D3539067
fbshipit-source-id: 357db15750d867a91c39b5fc5fd6ed4ae2852bc7
Summary: This is caused by receiving \u2028/2029 in callbacks/function calls. The correct solution is to not evaluate these strings as scripts but instead parse them as json and pass them through the JSC API.
Reviewed By: lexs
Differential Revision: D3543098
fbshipit-source-id: 4d8acce1d510bb17361d32103d4738fc0208b0a8
Summary:
By default we run the the JS display link, even if there are no modules listening. Given that most listeners will be lazily constructed, let's make it paused by default.
Since RCTTiming almost never unpauses due to some long-lived timers, implement a sleep timer that pauses the displaylink but uses an NSTimer to wake up in time.
Reviewed By: mhorowitz
Differential Revision: D3235044
fbshipit-source-id: 4a340fea552ada1bd8bc0d83b596a7df6f992387
Summary: Add a new interface to JSC that allows loading a file lazily from disk, i.e. using mmap, instead of loading the whole file upfront and copying into the VM.
Reviewed By: michalgr
Differential Revision: D3534042
fbshipit-source-id: 98b193cc7b7e33248073e2556ea94ce3391507c7
Summary:
Currently React Native codebase treats JS stack traces as array of dictionaries.
This diff switches the Red Box to use new `RCTJSStackFrame` for internal data representation, while keeping the exposed API unchanged. The next step would be to replace the rest of manual parsing and usage of dictionaries.
The new class has ability to parse the stack from raw strings or dictionaries.
Depends on D3429031
Reviewed By: javache
Differential Revision: D3473199
fbshipit-source-id: 90d2a4f5e8e054b75c99905f35c2ee54927bb311
Summary:
**motivation**
Currently when using a non-touchable visible row for a SwipeableRow, the scroll on list view is blocked.
**Test Plan**
```
<SwipeableListView
dataSource={dataSource}
renderRow={() => <View style={styles.row}/>}
renderQuickActions={() => <View style={styles.hiddenrow}/>}
/>
```
* Tested that when using non-touchable for renderRow allows scrolling on list view.
* Tested that when using touchable for renderRow allows scrolling on list view.
cc fred2028
Closes https://github.com/facebook/react-native/pull/8537
Differential Revision: D3542407
Pulled By: fred2028
fbshipit-source-id: b7ad7ff7c7dd1b717544746a85bb265414aa18f4
Summary:
Decreased the distance threshold so that the user doesn't need to swipe a large distance to
set the pan responder.
Also, set a threshold for the velocity so that a simple flick can be detected.
Reviewed By: hedgerwang
Differential Revision: D3540354
fbshipit-source-id: 251a4f14dc014bc32b3a83fa8de419f86ca40b84
Summary:
This PR tries to fix a minor bug in `react.gradle` due to which task that bundles JS into the assets folder of the APK is not run when separate build per CPU architecture is enabled and we are using different product flavors.
Closes https://github.com/facebook/react-native/pull/8675
Differential Revision: D3541348
fbshipit-source-id: 4c84f21a06a45046f84bdd8ae5c5d834ec080476
Summary:
The documentation was not updated after this change : Implemented automatic IP detection for iOS (8c29a52)
Fixes#8651.
Closes https://github.com/facebook/react-native/pull/8660
Differential Revision: D3539749
fbshipit-source-id: fe3b37c446a8c37941adbb08c4301284950a176a