Summary:
**Motivation**
The prop validation was run on every render, even in prod which seems odd to me. This adds a dev check to make sure prod build skips the validation.
**Test plan (required)**
There are no changes to the ui.
Closes https://github.com/facebook/react-native/pull/8499
Differential Revision: D3508805
Pulled By: javache
fbshipit-source-id: 68c6a1224e33997f9df93481426daff790ef5bcd
Summary:
ReactTextView occasionally crashes when `setText` is called. Doing some cursory research, it looks like this could be a bug in Android. We also suspect it might be related to removeClippedSubviews though.
The LayoutParams don't actually matter because RN controls layout, but on occasion (haven't narrowed down what this is...) `mLayout` is non-null and triggers relayout during `setText`, which fails because the LayoutParams are null. jesseruder came up with this fix and it appears to be working well.
Stack trace: http://pastebin.com/P8VbxvPz
Closes https://github.com/facebook/react-native/pull/7011
Differential Revision: D3508097
fbshipit-source-id: 12b4aa11e42112c8ba19a1af325e3ee9a232d08f
Summary:
Its a minor Bug fix for rendering Title in NavigationHeader
Closes https://github.com/facebook/react-native/pull/8437
Differential Revision: D3507319
Pulled By: ericvicenti
fbshipit-source-id: ff4aa36be3c4991be11aabecbaad952c015a60e2
Summary:
(I swear this was working before...)
Right now, when passing an empty map to `toBundle` it returns null:
- It feels counter-intuitive to have the data modified without any good reason;
- It is different from what iOS does
This PR fixes this behavior by returning an empty `Bundle` instead of `null`.
It is a breaking change though, and I'm not sure where it goes with the new bridge.
Closes https://github.com/facebook/react-native/pull/7847
Differential Revision: D3504024
fbshipit-source-id: 97ca19259fdf3219e8237e44a313645503a695fd
Summary:
Add "Copy" and "Dismiss" button when the RN Android redbox is shown, consistent with that in RN iOS.
- "Copy" button copies all the messages shown in the redbox to the host system clipboard, the solution is posting redbox messages to packager and the the packager copies the messages onto the host clipboard.
- "Dismiss" button always exits the redbox dialog.
- Add shortcut as "Dismiss (ESC)" and "Reload (R, R).
Notice: Copy button is only supported on Mac OS by now (warning in packager on other platforms), because it's not easy for us to test on Windows or Linux. Will put the codes for other platforms on Github issues, hoping anyone could help test and add this feature, then send us a pull request.
Redbox Dialog in RN Android before:
{F61310489}
Redbox Dialog in RN Android now:
{F61659189}
Follow-up:
- We can adjust the button styles in redboxes.
- We can consider to add shortcut for "Copy" button.
Reviewed By: foghina
Differential Revision: D3392155
fbshipit-source-id: fc5dc2186718cac8706fb3c17d336160e61e3f4e
Summary: Make the behavior on a WebView allow pinch to zoom. This matches what iOS has by default. We may want to at some point put this behind a property but right now just make it work on Android.
Reviewed By: andreicoman11
Differential Revision: D3503429
fbshipit-source-id: adb2bb2c3de099aca08700786be7a132557a5e2a
Summary:
Currently the algorithm for calculating frames will not always have an correct value for the endframe making some natively driven animations stuck almost at the end. This PR ensures the animation ends at `1`.
**Test plan**
Tested with the code in `NativeAnimationsExample.js`.
Closes https://github.com/facebook/react-native/pull/8489
Differential Revision: D3502973
fbshipit-source-id: b9b114d3982341571ac6ff315620d3d2292d9266
Summary:
* Next version of Jest doesn't allow non test files in __tests__ folders.
* I'm trying to switch all tests off of jsdom on react-native. This should save 500ms of time when running a single test because jsdom is slow to load and react-native is also not supposed to run in a DOM environment, so let's not pretend we are providing the DOM in tests.
* Make the bridge config configurable so that when we disable automocking and we reset the registry we can redefine the value.
Oh also, stop using lodash in Server.js. First off, lodash 3 doesn't work in Jest's node env because it does some crazy stuff, second because we don't need to load all of lodash for debounce.
Reviewed By: davidaurelio
Differential Revision: D3502886
fbshipit-source-id: 1da1cfba9ed12264d81945b702e7a429d5f84424
Summary:
**Motivation**
This PR adds a subspec for the `NativeAnimation` iOS library which so one can use it with CocoaPods.
**Test plan (required)**
Tested with the code in `NativeAnimationsExample.js` and this:
```
pod 'React', :subspecs => ['Core', 'RCTAnimation'], :path => 'node_modules/react-native'
```
Closes https://github.com/facebook/react-native/pull/8487
Differential Revision: D3502970
fbshipit-source-id: 0958acdbe088da8b50a1e5e3661f27b64db329c1
Summary:
This follows up the PR https://github.com/facebook/react-native/pull/8306
= Changes
1. Provides the TransitionProps (current and previous) to the function
`configureTransition`.
2. Adds a new member `timing` to `NavigationTransitionSpec`.
= Why
1. Helps people to customize the animation between transitions
2. Helps people to migrate from the deprecated `applyAnimation` prop.
Reviewed By: ericvicenti
Differential Revision: D3470802
fbshipit-source-id: be49becccd53aed7bc57093da1c7dae20153febd
Summary:
Add an example for Pager built with NavigationTransitioner & Animated.View
This example demostrates how to apply pre-defined gesture handling and
animation styles to the <Animated.View /> to build a Pager navigator.
Reviewed By: ericvicenti
Differential Revision: D3495807
fbshipit-source-id: 08e275010888925bc9fd1840e7052f975c95ad63
Summary: In older versions of android, the main thread is given the same priority as all other threads (default). Instead, it should have a higher priority (DISPLAY) which will make sure it's scheduled instead of the background JS/native modules threads.
Reviewed By: majak
Differential Revision: D3497244
fbshipit-source-id: 15ab09f4ebcad2692ae1261f15aa2c6c39f72ee9
Summary:
Arrow functions do not have their own arguments. Fix EventEmitter#once to pass the correct arguments to the listener callback.
Closes https://github.com/facebook/react-native/pull/8479
Differential Revision: D3495086
Pulled By: javache
fbshipit-source-id: 4492d13bfb2cc255afdc41d39fbf2f35da6b7094
Summary: Add support inlining images into text inputs. For now this is only available on Android.
Reviewed By: andreicoman11
Differential Revision: D3470805
fbshipit-source-id: 14db05ec4d5af549bf314b903654314f39bf73ea
Summary: Found a couple of places where we were copy-pasting the logic `ResourceDrawableIdHelper` had. This class was only available on the image module and it had package visibility. I moved it to its own module so that we can easily use it from others.
Reviewed By: andreicoman11
Differential Revision: D3463697
fbshipit-source-id: 708058c5f2445e27b151d8a6f3b47fd23485bc88
Summary:
JS codes sometimes report exceptions with `null` details about stack traces, resulting in native `NullPointerException` crashes when parsing the stack traces.
Added null checking for the stack traces in `ExceptionsManager.js`, ensuring that we never call `updateExceptionMessage` with a null stack
Reviewed By: foghina
Differential Revision: D3455783
fbshipit-source-id: 027969afd8a5d6015e97fce0a26626730cfc83a4
Summary:
This updates the documentation for the `Text` component itself and the embedded `Text.md` that goes with it.
- React Native Web Player
- Document all props
- NOTE: I actually added a new prop to `Text` called `accessible` since it was set by default and thus shown in the Props list
in the original documentation (but with an empty description).
- Stylistic fixes
Closes https://github.com/facebook/react-native/pull/8445
Differential Revision: D3493112
Pulled By: JoelMarcey
fbshipit-source-id: b428d4eb09065db5c6cb1ae5524ad22084fd2a82
Summary:
RCTPhotoLibraryImageLoader was not using the scale argument so the image loaded wasn't always the right resolution.
**Test plan**
On my iPhone 6, which has `RCTScreenScale() === 2`, see that an `<Image>` rendered with a `ph://XXX` URI is rendered properly in 2x.
More thoroughly, I used `PHAsset.fetchAssetsWithMediaType(.Image, options: fetchOptions)` to fetch PHAssets to get a `asset.localIdentifier` to test. Then, I rendered a `<Image source={{uri: `ph://${localIdentifier}`}} style={{width: 375, height: 375}} />`.
Closes https://github.com/facebook/react-native/pull/8458
Differential Revision: D3492495
fbshipit-source-id: 34b2757f880edf6ff1751773f6e1a0f62c289f5a
Summary:
Not a big deal, I was just going through the tutorial trying to figure out which doc was the most boring, and improve it a bit. IMO now the example is slightly funnier, and it mentions onSubmitEditing which in practice is probably a more useful callback.
Closes https://github.com/facebook/react-native/pull/8447
Differential Revision: D3491938
Pulled By: JoelMarcey
fbshipit-source-id: 3bd0f5762dc4db4a85c9d5badb6c005f4b8c52f4
Summary:
Add note associating error message to "adb reverse" command. When I first ran a React Native app on my Android phone, I received a cryptic "bridge configuration isn't available" error. After some research, I discovered that the "adb reverse" command mentioned further down on the page resolved the problem.
Closes https://github.com/facebook/react-native/pull/7725
Differential Revision: D3491577
Pulled By: JoelMarcey
fbshipit-source-id: 34c580acd6bf3e7788b674bd0b41bc5a1023b010
Summary:
I used the reproducible steps as described in origin bug ticket #7987 as test plan.
This has the same contents as PR #8130 but then against master per janicduplessis request.
Closes https://github.com/facebook/react-native/pull/8134
Differential Revision: D3491126
fbshipit-source-id: a22669dc998f82b36fbe31d882d0a29f0912e2ee