Summary: registering with systrace checks if the bridge is
initialized, which it's not yet in the ctor. Defer registration until
after the bridge is created, and only unregister in that case.
public
Reviewed By: astreet, dreiss
Differential Revision: D2651244
fb-gh-sync-id: 8da1108e9d15fddde48d06f4ed61ee0f787016ad
Summary: public
Dynamically profile events from RelayProfiler if available. This will expose time spent in Relay in the systraces.
Reviewed By: tadeuzagallo
Differential Revision: D2674215
fb-gh-sync-id: d5f9d529b86d267a80b0cda2223f6a28a08ac385
Summary: The recent commits for RecyclerViewBackedScrollView introduced a bunch of Flow errors.
Disable Flow for now in `ReactNativeViewPool` as it looks like that file doesn't use Flow :)
public
Reviewed By: gabelevi
Differential Revision: D2679974
fb-gh-sync-id: 71512f403e3fa271f6c0fa1a64e877ca1750f675
Summary: public
Native view recycling implementation based on limited pools of views.
In this diff I introduced new UIManager method: dropViews. Instead of removing views from tag->view maps when they are detached we keep them there until we get a call to dropViews with the appropriate tag. JS may keep a pool of object and selectively decide not to enqueue drop for certain views. Then instead of removing those views it may decide to reuse tag that has been previously allocated for a view that is no longer in use.
Special handling is required for layout-only nodes as they only can transition from layout-only to non-layout-only (reverse transition hasn't been implemented). Because of that we'd loose benefits of view flattening if we decide to recycle existing non-layout-only view as a layout-only one.
This diff provides only a simple and manual method for configuring pools by calling `ReactNativeViewPool.configure` with a dict from native view name to the view count. Note that we may not want recycle all the views (e.g. when we render mapview we don't want to keep it in memory after it's detached)
Reviewed By: davidaurelio
Differential Revision: D2677289
fb-gh-sync-id: 29f44ce5b01db3ec353522af051b6a50924614a2
Summary: Manually resolve all default Babel plugins. `babel.transform` will attempt to resolve all base plugins relative to the file it's compiling. This makes sure that we're using the plugins installed in the react-native package.
**NOTE:** Haven't tested this. Please don't merge until Travis has done CI.
Closes https://github.com/facebook/react-native/pull/4248
Reviewed By: svcscm
Differential Revision: D2679651
Pulled By: davidaurelio
fb-gh-sync-id: 0cdef1e738ba28c09c811432a71047f80540ed7b
Summary: public
Changed ListView to use onLayout and onContentSizeChange (new) events instead of measure. Updated ScrollView implementation to support contentSizeChange event with an implementation based on onLayout attached to the content view. For RecyclerViewBackedScrollView we need to generate that event directly as it doesn't have a concept of content view.
This greatly improves performance of ListView that uses RecyclerViewBackedScrollView
Reviewed By: mkonicek
Differential Revision: D2679460
fb-gh-sync-id: ba26462d9d3b071965cbe46314f89f0dcfd9db9f
For higher accuraccy (and less clowniness) it might be better
to have the question bot only label issues that are potentially
questions and then have people quickly go through those issues
and use this bookmarklet to comment on them.
Summary: public
I had previously assumed (based on past experience and common wisdom) that `[UIImage imageWithData:]` was safe to call concurrently and/or off the main thread, but it seems that may not be the case (see https://github.com/AFNetworking/AFNetworking/pull/2815).
This diff replaces `[UIImage imageWithData:]` with ImageIO-based decoding wherever possible, and ensures that it is called on the main thread wherever that's not possible/convenient.
I've also serialized access to the `NSURLCache` inside `RCTImageLoader`, which was causing a separate-but-similar crash when loading images.
Reviewed By: fkgozali
Differential Revision: D2678369
fb-gh-sync-id: 74d033dafcf6c412556e4c96f5ac5d3432298b18
Summary: public
In a previous diff I've removed a need for using View attributes in requireNativeComponent. Thanks to that we can now use requireNativeComponent in View module. In a follow up diff I'll be getting rid of ReactNativeViewAttributes.
Reviewed By: sahrens
Differential Revision: D2676088
fb-gh-sync-id: d5d6e50f4629bd7982b90f3496e1fd22078e96a8
Summary: I've added a subject property to the ActionSheetIOS.showShareActionSheetWithOptions options object. This will allow users to set a subject for things like emails when they are sharing to them through the ActionSheetIOS.
Options are now as follows:
```
{
url: 'https://code.facebook.com',
message: 'message to go with the shared url',
subject: 'a subject to go in the email heading',
}
```
Closes https://github.com/facebook/react-native/pull/4238
Reviewed By: svcscm
Differential Revision: D2674536
Pulled By: nicklockwood
fb-gh-sync-id: 3dfad39f94f19999233bf777253ef71b6e692a6d
Summary: Allow an html5 video to be played inline. (see #3112)
Closes https://github.com/facebook/react-native/pull/3137
Reviewed By: svcscm
Differential Revision: D2674318
Pulled By: nicklockwood
fb-gh-sync-id: cf71e4039c7027f1468370ae3ddef6eb3e2d2d4f
Summary: Was trying to remove the compass from the map and thought I would contribute to the project for everyone.
Closes https://github.com/facebook/react-native/pull/4225
Reviewed By: svcscm
Differential Revision: D2674060
Pulled By: nicklockwood
fb-gh-sync-id: 66f069dfc53fdeae8aaab76980146296cea1140f
Summary: Struggled for some time to figure out why CameraRoll could not (anymore, upgraded from RN 0.11 iirc) be used in a cocoapods setup. This was the cleanest way to make it work, is it a bad idea for some reason?
Closes https://github.com/facebook/react-native/pull/4230
Reviewed By: svcscm
Differential Revision: D2674063
Pulled By: nicklockwood
fb-gh-sync-id: 3d9e6a8ac1834d05ad807ff1fea1b89a724b9cc8
Summary: public
Recent refactoring of `XMLHttpRequestBase` made use of `abortRequest` instead of the existing `cancelRequest` in iOS. This will simply alias `abortRequest` to `cancelRequest`.
Reviewed By: nicklockwood
Differential Revision: D2671189
fb-gh-sync-id: 6987d004e5a54973c330e19a1baba19ee41170f0
Summary: Automatically starts loading the RN instance as soon as loadApp is called instead of waiting for the UI to be constructed and attached to the window. This saves ~75ms of cold start time on GN 2011 phones.
Also, updates the contract for createReactContextInBackground such that it is only called once (so that people don't accidentally initialize more than once).
See http://imgur.com/a/d7qVm for systrace visualization.
public
Reviewed By: kmagiera
Differential Revision: D2652279
fb-gh-sync-id: 6e7b1fa5dea091af0d568834e11ed23eb1a7860e
Summary: ```
* What went wrong:
Execution failed for task ':app:bundleReleaseJsAndAssets'.
> A problem occurred starting process 'command 'react-native''
```
Can be solved by this patch.
Closes https://github.com/facebook/react-native/pull/4209
Reviewed By: svcscm
Differential Revision: D2669661
Pulled By: foghina
fb-gh-sync-id: 951b7eb9dd3121de607cf5eb3dfb3af44cdf5994
Summary: public
Make sure some modules that are only available in dev mode are only
included in dev bundles.
Depends on: D2663838
Reviewed By: davidaurelio
Differential Revision: D2663889
fb-gh-sync-id: 42be40b865ef305828b3519556125af090ec61f4
Summary: public
Instead of using 0 as a default we should use UNDEFINED values. That is because setting 0 for left border in case when the property was deleted will interfere with horizontal border (or margin) value. Setting UNDEFINED makes CSSLayout nodes behave correctly in that case.
Reviewed By: andreicoman11
Differential Revision: D2668669
fb-gh-sync-id: 61ce62081583fc39864268333ac8c1409c276cad