Summary:
public
Map and Set are a standard JavaScript features, but are only supported in a subset of JSC versions that we target (e.g. iOS 7's JSC doesn't support Set).
The consequence of this is that failing to require('Set') before using it won't error during testing on a modern OS, but will fail on older OS versions. This diff makes the Map and Set polyfills available globally to all RN apps to avoid that problem.
Reviewed By: davidaurelio
Differential Revision: D2833997
fb-gh-sync-id: 713d8b69f6a1bce2472a1b2e6b84f69d75f30289
Summary:
Now packager only listen to "::", which is IPv6 "Any address".
It failed to run in IPv4 Environment.
defaults to undefined or empty string will fix this.
And I think it's necessary to let user define host by cli argument.
It's also for security reason. When working on a public network, it's much safer to listen with localhost instead of ::, which may let everyone in same network be able to get your code from debugger-ui.
recommit for #1918, fixes#2441
Closes https://github.com/facebook/react-native/pull/5377
Reviewed By: svcscm
Differential Revision: D2842594
Pulled By: martinbigio
fb-gh-sync-id: 575944c5469dac80e99136a7903ea99f5339dba1
Summary:
Adds back support for initial props in ReactAndroid while maintaining the abstraction benefits of having the details of ReactActivity abstracted from the end user's MainActivity. This does remove the need for ReactRootView's two paramater version of the overloaded startReactApplication as far as I can tell but I wasn't sure if anyone might be using that method internally.
Closes https://github.com/facebook/react-native/pull/5384
Reviewed By: svcscm
Differential Revision: D2841602
Pulled By: androidtrunkagent
fb-gh-sync-id: 07e0937bbbdb3ac1585aa252e2fd0f3736690898
Summary:
This solves https://github.com/facebook/react-native/issues/5090. Since 5b4e873c68 we had better reporting for when calls from native to JS fail. When trying to load an invalid bundle, this would now cause a stackoverflow, since RCTFatal would schedule a JS call to log, which would RCTFatal, which would ...
By invalidating the jsExecutor immediately after loading fails, we prevent any more attempts to log. We can't invalidate the whole bridge at this point since we still need the redbox module to actually display the error.
public
Reviewed By: majak
Differential Revision: D2834251
fb-gh-sync-id: a3e2ad425e40560beae4d3eacb93f66ace5341bf
Summary:
Didn't found someone that updated that, feel free to close if that is the case.
Closes https://github.com/facebook/react-native/pull/5415
Reviewed By: svcscm
Differential Revision: D2841576
Pulled By: androidtrunkagent
fb-gh-sync-id: 99b37fcb370453ce71fa83434f7c72b598375ef0
Summary:
public
Promises are coming. And as part of it, we are standardizing the error objects that will be returned. This puts the code in place on the Android side to always send the proper error format.
It will be an error object like this
{
code : "E_SOME_ERROR_CODE_DEFINED_BY_MODULE", // Meant to be machine parseable
message : "Human readable message",
nativeError : {} // Some representation of the underlying error (Exception or NSError) , still figuring out exactly, but hopefully something with stack info
}
Reviewed By: nicklockwood
Differential Revision: D2840128
fb-gh-sync-id: 174d620e2beb53e1fc14161a10fd0479218d98a6
Summary:
public
Promises are coming. And as part of it, we are standardizing the error objects that will be returned. This puts the code in place on the Android side to always send the proper error format.
It will be an error object like this
`{
code : "E_SOME_ERROR_CODE_DEFINED_BY_MODULE", // Meant to be machine parseable
message : "Human readable message",
nativeError : {} // Some representation of the underlying error (Exception or NSError) , still figuring out exactly, but hopefully something with stack info
}`
Reviewed By: davidaurelio
Differential Revision: D2839927
fb-gh-sync-id: 08f1ce79af24d70357b9957f14471a12627dcffa
Summary:
This caused issues for me when I tried to provide a native module on init that was also KVO'd (and dynamically subclassed)
On closer inspection, it also seems highly inconsistent to register these classes in DEBUG mode but have them fail silently in production. Reducing the difference between debug and release seems like a safer option.
public
Reviewed By: nicklockwood
Differential Revision: D2819838
fb-gh-sync-id: 79ab72b1152c89eae38c965ff7724aba59a00949
Summary:
In Android, when displaying an image with local uri, react-native seems to fail to rotate it according to Exif.
Images on iOS seem like they are being rotated, so this does not seem like a consistent behaviour.
For instance, when taking a picture on a Samsung Galaxy S6, and displaying it with code like below, image does not have a correct orientation.
```javascript
<Image source={{uri: "file:/storage/emulated/0/DCIM/Camera/20160106_171628.jpg"}} />
```
<img src="https://cloud.githubusercontent.com/assets/4534323/12403776/aa5075cc-be36-11e5-885a-7be8236a7fdd.jpg" width=200 />
As seen [here](http://frescolib.org/docs/resizing-rotating.html#auto-rotation), Fresco can do all the work for us (hence this very simple PR).
I tested it on Samsung Galaxy S6 (lollipop), Galaxy S4 (kitkat) and Moto X Style (marshmallow).
I have written an example that fetches images uri from the Java side and then display them in a list view.
[Here](https://github.com/Almouro/rn-camera-roll/tree/use-react-native-master
Closes https://github.com/facebook/react-native/pull/5386
Reviewed By: svcscm
Differential Revision: D2839551
Pulled By: androidtrunkagent
fb-gh-sync-id: 6f0f2f301f263fd142dfbeba6a53f8c482fb5cb0
Summary:
npm 3 is working fine especially if you use shrinkwrap at the end. we've been using it for a month+ and the dependency deduping works well.
Closes https://github.com/facebook/react-native/pull/5391
Reviewed By: svcscm
Differential Revision: D2839472
Pulled By: androidtrunkagent
fb-gh-sync-id: 33e551185236694ee5979da701312f12e2582f3c
Summary:
Opening this in a separate PR but the discussion can be viewed on #4832.
Basically, this is a native implementation and is a bit more elegant. The consensus on my previous PR was that it should be done natively rather than in JS.
There's now no maximum valid timeout value and a timeout of 0 will never time out.
ontimeout isn't implemented (yet) in this PR.
cc nicklockwood ide philikon
Closes https://github.com/facebook/react-native/pull/5038
Reviewed By: svcscm
Differential Revision: D2838743
Pulled By: nicklockwood
fb-gh-sync-id: 774f864ac35082bf522f7665f4311bd3affbe82c
Summary:
Related to #3999
There is an issue with the `preprocessor` script when using node >=5 as it uses npm 3. ~~There are (at least) two solutions, (I'm submitting the first one):~~
- ~~specify min required node version to 5.x and modify [this the preprocessor script](https://github.com/facebook/react-native/blob/0.16-stable/jestSupport/preprocessor.js#L29) to match npm 3 requirements~~
- ~~specifify node version >= 4.x and < 5.x and let the preprocessor script as it is~~
**EDIT**:
Using `require.resolve` will do the trick !
--
Thank you guys for this amazing project by the way ;)
Closes https://github.com/facebook/react-native/pull/4903
Reviewed By: svcscm
Differential Revision: D2838759
Pulled By: androidtrunkagent
fb-gh-sync-id: ebb12f225a519ea23afc4f013bb063a920193719