Summary:
Fixes the sizing of items so that under most scenarios it calcultes its height by it's content for non exact measurings. This introduces a new useLegacyStretchBehaviour flag on the config to opt out of this change as it is breaking.
See facebook/yoga#505
Closes https://github.com/facebook/yoga/pull/506
Reviewed By: astreet
Differential Revision: D4954016
Pulled By: emilsjolander
fbshipit-source-id: d28bd5d174cd76951fb94df85e3b0cfab7f81ff7
Summary:
Mitigates the issue in https://github.com/facebook/react-native/issues/10471, by not trying to present
a modal or alert view if the presenting view controller is already being dismissed.
Reviewed By: shergin
Differential Revision: D4962169
fbshipit-source-id: 593e3f21096458651d16677a3e030552f809bf02
Summary:
React Native uses JSON to marshal the data across the bridge.
And because of this we have to avoid using NaN and INF values in events and other pieces of data that suppose to be transfered to/from JS side.
(We also don't want to introduce additional wrapping/escaping semantics for perfomance reasons.)
So, we have to gate all particular cases where there is a possibility of NaN or INF values, and replace these value with something meaningful for each particular case.
We are using `0` as NaN substitution here because:
* NaN in touch event is super rare case;
* Conversion to `0` is fast;
* `0` is okay value for product code in most cases;
* In all cases `0` is decent analog to "undefined position on screen" for touch event;
* Nobody will explicitly handle NaN case in product code, just because it is super rare case and actually indicates that something else went wrong.
Reviewed By: javache
Differential Revision: D4918669
fbshipit-source-id: e95fa29e59dcdc40b57519e307b74c1f293da188
Summary:
Apps commonly provide their own rage-shake menus or behaviors, including in dev builds where the dev menu is enabled on shake. Rather than try to override these settings via native code, it can be helpful to let the app define when to show the menu via the bridge.
See recent discussion in https://github.com/facebook/react-native/issues/1054
Closes https://github.com/facebook/react-native/pull/13563
Differential Revision: D4928745
Pulled By: javache
fbshipit-source-id: a5b30e1b198780bb560e1a6d528f727b3b7d4cb7
Summary:
In the Docs of `NSURLSession` ,
>IMPORTANT
>The session object keeps a strong reference to the delegate until your app exits or explicitly >invalidates the session. If you do not invalidate the session, your app leaks memory until it exits.
The RCTMultipartDataTask will cause memory leaks, it will make `RCTBatchedBridge` and ` RCTMultipartDataTask` will not release.
So call `[session finishTasksAndInvalidate];` at the end of `startTask` function.
Closes https://github.com/facebook/react-native/pull/12673
Reviewed By: shergin
Differential Revision: D4896497
Pulled By: javache
fbshipit-source-id: eb5f8761f67ad33a7de081a68a9a7e1d4329bfc0
Summary:
There was no easy way to pull up the dev menu in the tvOS simulator
Run the UIExplorer demo and press cmd+d to bring up the menu
Closes https://github.com/facebook/react-native/pull/13584
Differential Revision: D4916967
Pulled By: javache
fbshipit-source-id: 27f50031f65f35dad46ad5ade7b52c7d350b31a2
Summary:
Issue Fix: #13485
Yet another race condition that was found by XCode's Thread Sanitizer.
Happens because wasBatchActive is read/write from multiple threads at the same time
- opened UIExplorer and see it works
- npm run test pass
- tested on own project as well
Signed CLA
Closes https://github.com/facebook/react-native/pull/13505
Differential Revision: D4906096
Pulled By: javache
fbshipit-source-id: 5d4329aafcfe9491ce0188fa1e2dd71e09b31031
Summary:
Output the reason for the error when failing to load source code. This was a big help when trying to diagnose https://github.com/facebook/react-native/issues/13299.
~~Unfortunately there still seems to be no way to get the offending line number (because `loadError.userInfo[RCTJSStackTraceKey]` is empty), but this is good enough.~~
Before:
```
[warn][tid:com.facebook.react.JavaScript][RCTBatchedBridge.m:510] Failed to execute source code. Unhandled JS Exception: SyntaxError
```
After:
```
[warn][tid:com.facebook.react.JavaScript][RCTJSCErrorHandling.mm:30] Couldn't get stack trace for http://localhost:8081/index.ios.bundle?platform=ios&dev=true&minify=false:81886
[warn][tid:com.facebook.react.JavaScript][RCTBatchedBridge.m:510] Failed to execute source code. Unhandled JS Exception: SyntaxError Unexpected keyword 'var'
```
Closes https://github.com/facebook/react-native/pull/13561
Differential Revision: D4908501
Pulled By: javache
fbshipit-source-id: a316dc70739b917b3cc690309d0ff37a8bb5d412
Summary:
**Motivation**
Without this change, unit tests and integration tests won't build and run for Apple TV.
**Test plan**
Run `scripts/objc-test-tvos.sh` after uncommenting the TEST line.
Closes https://github.com/facebook/react-native/pull/13456
Differential Revision: D4875309
Pulled By: javache
fbshipit-source-id: 9b6fa3b7107924ba0346bf8be63bba5fe45acb53
Summary:
* It complicates Touch Handling mechanism.
* The same functionality can be (and should be) implemented via overriding standard `hitTest:` method.
* It was marked as deprecated a while ago.
Reviewed By: mmmulani
Differential Revision: D4667776
fbshipit-source-id: 2e047c3308563a2849ea351a242270f0800fead2
Summary:
Motivation: Similar to https://github.com/facebook/react-native/pull/13242 - the application will crash with `[NSNull lastPathComponent]: unrecognized selector sent to instance` if a stack frame with no filename makes it to RCTRedBox.
Closes https://github.com/facebook/react-native/pull/13360
Differential Revision: D4848980
Pulled By: javache
fbshipit-source-id: dc506f2ba39c2d4d68982b56a6e765a19dc048b0
Summary:
Thanks for submitting a PR! Please read these instructions carefully:
- [yes] Explain the **motivation** for making this change.
Using react-native library inside iOS app extension causes a compile error inside react native stating that usage of UIAlertView is not allowed inside iOS app extension and should use UIAlertController instead. I have updated the code to use UIAlertController based on the other instances of the UIAlertController usage in the react-native library
- [ partial ] Provide a **test plan** demonstrating that the code is solid.
This code should be launched when developers start the profiler from the React native debug menu. I am currently in process of upgrading my app from 0.34 to the latest react native ( aka app not in working state). Would appreciate if there is an alternative way for me to test this functionality out.
Just tried to create a new react-native project using "react-native init testproject" and upon running "react-native run-ios", I hit the following error a
Closes https://github.com/facebook/react-native/pull/13328
Differential Revision: D4844559
Pulled By: javache
fbshipit-source-id: e516ca57cb2abf2b09aa53abecb0fe60a40190b4
Summary:
**Motivation** Fix the Apple TV build, which is broken after a recent commit.
**Test plan** Travis tvOS test script should succeed.
Closes https://github.com/facebook/react-native/pull/13284
Differential Revision: D4827053
Pulled By: ericvicenti
fbshipit-source-id: 380e8f1b32adfeea844bedc11326e5a6a755066a
Summary:
Pair `reactWillMakeFirstResponder` and `reactDidMakeFirstResponder` was replaced with just `reactFocus` method
which is supposed to incapsulate all "focus" and "focus-later-if-needed" functionality.
Reviewed By: mmmulani
Differential Revision: D4664626
fbshipit-source-id: 8d3b7935ca26d32ba1d1826a585cce0396fcc885
Summary:
…th RCTSharedApplication()
Thanks for submitting a PR! Please read these instructions carefully:
- [ ] Explain the **motivation** for making this change.
Using React Native latest version with Cocoapods 1.2.0 causes the following error inside iOS app extensions
> /react-native/React/Modules/RCTAccessibilityManager.m:67:70: ‘sharedApplication’ is unavailable: not available on iOS (App Extension) — Use view controller based solutions where appropriate instead.
Moving the use of [UIApplication sharedApplication] to RCTSharedApplication() which is safe on app extension
- [ ] Provide a **test plan** demonstrating that the code is solid.
I am not sure how to test such that all the features which touch the modified code are tested.
- [ ] Match the **code formatting** of the rest of the codebase.
- [ ] Target the `master` branch, NOT a "stable" branch.
What existing problem does the pull request solve?
Using React Native latest v
Closes https://github.com/facebook/react-native/pull/13227
Differential Revision: D4816338
Pulled By: javache
fbshipit-source-id: e3e3c77882990ad1817b0b633521cff52571ecd0
Summary:
Motivation: When logging to RCTRedBox, if any of the stack frames lacks a line number or a column, the application will crash with `[NSNull integerValue]: unrecognized selector sent to instance`.
Closes https://github.com/facebook/react-native/pull/13242
Differential Revision: D4812185
Pulled By: hramos
fbshipit-source-id: 4b1c3c38f67cf59034a383c95d4280d1b6380300