Commit Graph

13414 Commits

Author SHA1 Message Date
Jonathan Kim 255b97ddd1 Load and use fb_xplat_cxx_test
Reviewed By: mzlee

Differential Revision: D7854278

fbshipit-source-id: 2a4c4fc27fc665a192fc04a8c8fae19f7f221566
2018-05-03 16:04:29 -07:00
Maël Nison b63015d34e Bumps Jest to 23.0.0-charlie.1 [fbsource]
Differential Revision: D7859604

fbshipit-source-id: 6a2d74679f5eae3cb0102f461272b7cbd5716cba
2018-05-03 14:06:13 -07:00
Andrew Chen (Eng) 5a6147c4f8 Fix DevLoadingViewController
Reviewed By: mdvacca

Differential Revision: D7860219

fbshipit-source-id: 3770a2064808bf4ae4c61f15c6d68c3b93fe9f38
2018-05-03 13:03:53 -07:00
David Aurelio 786c1ecc2a Markers: add info about type of delta client
Summary: Adds information which type of delta client is used (if at all) to the `BundleInfo` object.

Reviewed By: fromcelticpark

Differential Revision: D7845139

fbshipit-source-id: e4bf6cda62c71a78aaff97aa69daec263e6d3cdf
2018-05-03 08:47:47 -07:00
David Aurelio dd036c2328 Hook up native delta client
Summary:
Adds support for native clients to `ReactAndroid`:
- `.devsupport.BundleDeltaClient` is now abstract with two implementations: the existing Java client, and a native client
- `BundleDeltaClient#processDelta(...)` can now return a native delta client object
- if that client object is non-null, the bridge is started up with that client rather than a script written to disk

Reviewed By: fromcelticpark

Differential Revision: D7845135

fbshipit-source-id: 379a9c6f9319c62eec3c370cda9ffa0969266a29
2018-05-03 08:47:47 -07:00
David Aurelio 8f85abdb14 `JSBundleLoader`: allow to load with delta client
Summary: Adds glue between `CatalystInstance` and `JSBundleLoader`: Adds the possibility to create a `JSBundleLoader` instance that calls into `CatalystInstanceImpl#loadScriptFromDeltaBundle(...)`.

Reviewed By: fromcelticpark

Differential Revision: D7845134

fbshipit-source-id: 9585b44a6e7c63245c9f634543642be55c928896
2018-05-03 08:47:47 -07:00
David Aurelio 3e730528ee Allow to not use native delta client
Summary:
Adds the possibility to disable native delta clients in `DevInternalSettings`

Depending on the bridge in use, there might not be support for native delta clients, but since the settings are shared app-wide, it can not be enabled individually.

Reviewed By: johnislarry

Differential Revision: D7845137

fbshipit-source-id: ab368e6fed0f4bec49032c4a20466e156d20fdae
2018-05-03 08:47:47 -07:00
David Aurelio 36f254aa75 `CatalystInstanceImpl`: Method for loading from delta client
Summary:
Adds `loadScriptFromDeltaBundle` / `jniLoadScriptFromDeltaBundle` methods to `CatalystInstanceImpl`.

These methods allow to run JS coming from a native delta client as RAM bundles, to leverage the RAM bundle mechanism for development / reload scenarios.

Reviewed By: fromcelticpark

Differential Revision: D7845140

fbshipit-source-id: b79b340f36c28939a31eb63a3c463d0792a208f7
2018-05-03 08:47:47 -07:00
David Aurelio 82b8a9221a Add hybrid class to hold native delta client
Summary:
Adds hybrid JNI wrapper class that can hold a native delta client.

This class allows Java code in the `devsupport` package to hold onto a native delta client across reloads.
It also takes care of passing `okhttp` response objects to native code, where we build a `std::string` to hold JSON messages coming from Metro, and parse them with `folly::parseJson`.

In a follow-up, we will switch to a streaming-friendly binary format that will make allocating memory for the whole message unnecessary.

Reviewed By: fromcelticpark

Differential Revision: D7845138

fbshipit-source-id: 7a29b30645331addf843097dd0d05c03b3143991
2018-05-03 08:47:47 -07:00
David Aurelio 4d931d529e Add native delta client for Metro
Summary:
Adds C++ delta client that keeps modules in memory, and can be used as a RAM bundle.

For now, this client expects a `folly::dynamic` object as payload for patches, i.e. the JSON response retrieved from Metro needs to be parsed with `folly::parseJson` by the caller.

In the future, we will replace JSON with a streaming friendly binary format.

Reviewed By: fromcelticpark

Differential Revision: D7845136

fbshipit-source-id: f003f98a2607c8354c427a7e60e01e19e20295b1
2018-05-03 08:47:47 -07:00
David Aurelio e8662a2123 Add react dev menu setting for cpp deltas
Summary:
Adds a menu item to enable handling of JS module deltas in native code.
The check box is dependent on JS Deltas being activated in the first place.

Reviewed By: cpojer

Differential Revision: D7380167

fbshipit-source-id: 3001d12140542b4e52b1ce96be3c5f56e52a15f8
2018-05-03 08:47:46 -07:00
Jonathan Kim be379efc9b Minimize included defs by adding a level of indirection
Reviewed By: zertosh

Differential Revision: D7851714

fbshipit-source-id: aa14e003a612173c6f316cb76a26f7e78e7f15d4
2018-05-02 22:24:42 -07:00
Jacky Wijaya 56d48bd9ec Fix Android, DevServerHelper from calling okhttp3 response.body.string() twice
Summary:
Fixing from call response.body.string() twice in DevServerHelper.java.
https://github.com/square/okhttp/issues/1240#issuecomment-68142603

I'm getting error like this
```
05-01 21:16:47.080 22836-23064/com.my.company.bundle E/AndroidRuntime: FATAL EXCEPTION: OkHttp Dispatcher
                                                                               Process: com.my.company.bundle, PID: 22836
                                                                               java.lang.IllegalStateException: closed
                                                                                   at okio.RealBufferedSource.rangeEquals(RealBufferedSource.java:398)
                                                                                   at okio.RealBufferedSource.rangeEquals(RealBufferedSource.java:392)
                                                                                   at okhttp3.internal.c.a(Util.java:449)
                                                                                   at okhttp3.v.string(ResponseBody.java:174)
                                                                                   at com.facebook.react.devsupport.f$8.onResponse(DevServerHelper.java:487)
                                                                                   at com.newrelic.agent.android.instrumentation.okhttp3.CallbackExtension.onResponse(CallbackExtension.java:41)
                                                                                   at okhttp3.s$a.c(RealCall.java:153)
                                                                                   at okhttp3.internal.b.run(NamedRunnable.java:32)
                                                                                   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
                                                                                   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
                                                                                   at java.lang.Thread.run(Thread.java:764)
```

<!--
  Required: Write your motivation here.
  If this PR fixes an issue, type "Fixes #issueNumber" to automatically close the issue when the PR is merged.
-->

- In my case, My device is using a Proxy, and tried to connect the packager. When it failed from connecting packager through websocket, It crash by this line of code.
<!--
  Required: Write your test plan here. If you changed any code, please provide us with
  clear instructions on how you verified your changes work. Bonus points for screenshots and videos!
-->

<!--
  Does this PR require a documentation change?
  Create a PR at https://github.com/facebook/react-native-website and add a link to it here.
-->

<!--
  Required.
  Help reviewers and the release process by writing your own release notes. See below for an example.
-->

[ANDROID] [BUGFIX] [DevServerHelper] - fixing from calling body.string() twice.

<!--
  **INTERNAL and MINOR tagged notes will not be included in the next version's final release notes.**

    CATEGORY
  [----------]      TYPE
  [ CLI      ] [-------------]    LOCATION
  [ DOCS     ] [ BREAKING    ] [-------------]
  [ GENERAL  ] [ BUGFIX      ] [ {Component} ]
  [ INTERNAL ] [ ENHANCEMENT ] [ {Filename}  ]
  [ IOS      ] [ FEATURE     ] [ {Directory} ]   |-----------|
  [ ANDROID  ] [ MINOR       ] [ {Framework} ] - | {Message} |
  [----------] [-------------] [-------------]   |-----------|

 EXAMPLES:

 [IOS] [BREAKING] [FlatList] - Change a thing that breaks other things
 [ANDROID] [BUGFIX] [TextInput] - Did a thing to TextInput
 [CLI] [FEATURE] [local-cli/info/info.js] - CLI easier to do things with
 [DOCS] [BUGFIX] [GettingStarted.md] - Accidentally a thing/word
 [GENERAL] [ENHANCEMENT] [Yoga] - Added new yoga thing/position
 [INTERNAL] [FEATURE] [./scripts] - Added thing to script that nobody will see
-->
Closes https://github.com/facebook/react-native/pull/19088

Differential Revision: D7853822

Pulled By: mdvacca

fbshipit-source-id: c11a73ce2fa6d40b0a7bd8bc0fca7b07c6bc27ed
2018-05-02 19:24:08 -07:00
David Vacca 23d61b35fb Breaking change - Disable WebView geolocation by default
Reviewed By: yungsters

Differential Revision: D7846198

fbshipit-source-id: 8d6daff4b794d3569b5ddba2d8d62af8c7ff5b03
2018-05-02 15:59:06 -07:00
Eric Rozell ba88292130 Support platform-specific prop type overrides
Summary:
Moves `PlatformViewPropTypes` to the end of `ViewPropTypes` so platforms can override prop type values. An example of this is in `react-native-windows`, we want to support additional values for the `importantForAccessibility` prop type that are specific to Windows (more details in [this PR](https://github.com/Microsoft/react-native-windows/pull/1807)).

Thank you for sending the PR! We appreciate you spending the time to work on these changes.
Help us understand your motivation by explaining why you decided to make this change.

<!--
  Required: Write your motivation here.
  If this PR fixes an issue, type "Fixes #issueNumber" to automatically close the issue when the PR is merged.
-->

<!--
  Required: Write your test plan here. If you changed any code, please provide us with
  clear instructions on how you verified your changes work. Bonus points for screenshots and videos!
-->

Run jest tests, test RNTester on iOS and Android. Did not test tvOS, but this should not impact tvOS as the only props included from `PlatformViewPropTypes` are unique (i.e., are not overridden in this file).

<!--
  Does this PR require a documentation change?
  Create a PR at https://github.com/facebook/react-native-website and add a link to it here.
-->

https://github.com/Microsoft/react-native-windows/pull/1807

<!--
  Required.
  Help reviewers and the release process by writing your own release notes. See below for an example.
-->

[CATEGORY] [TYPE] [LOCATION] - Message

<!--
  **INTERNAL and MINOR tagged notes will not be included in the next version's final release notes.**

    CATEGORY
  [----------]      TYPE
  [ CLI      ] [-------------]    LOCATION
  [ DOCS     ] [ BREAKING    ] [-------------]
  [ GENERAL  ] [ BUGFIX      ] [ {Component} ]
  [ INTERNAL ] [ ENHANCEMENT ] [ {Filename}  ]
  [ IOS      ] [ FEATURE     ] [ {Directory} ]   |-----------|
  [ ANDROID  ] [ MINOR       ] [ {Framework} ] - | {Message} |
  [----------] [-------------] [-------------]   |-----------|

 EXAMPLES:

 [IOS] [BREAKING] [FlatList] - Change a thing that breaks other things
 [ANDROID] [BUGFIX] [TextInput] - Did a thing to TextInput
 [CLI] [FEATURE] [local-cli/info/info.js] - CLI easier to do things with
 [DOCS] [BUGFIX] [GettingStarted.md] - Accidentally a thing/word
 [GENERAL] [ENHANCEMENT] [Yoga] - Added new yoga thing/position
 [INTERNAL] [FEATURE] [./scripts] - Added thing to script that nobody will see
-->

[GENERAL][Enhancement][View] - Make `ViewPropTypes` more friendly to platform extensions.
Closes https://github.com/facebook/react-native/pull/19090

Differential Revision: D7846438

Pulled By: shergin

fbshipit-source-id: e51ee3256d1c21001b371bd07da21319f3ecd810
2018-05-02 11:21:51 -07:00
Peter van der Zee aa6f394c42 Enable `?.` plugins in RN
Summary: Enable the optional chaining operator plugins for React Native.

Reviewed By: rafeca

Differential Revision: D7828244

fbshipit-source-id: 659a8a82ff6d656a5cb2f33377d85b668b93a9ea
2018-05-02 07:41:50 -07:00
Rubén Norte 9927d20927 Set hasteImplModulePath in React Native Jest preset
Reviewed By: cpojer

Differential Revision: D7843566

fbshipit-source-id: 98be0d7286351475248f53b7c028e6c85d411a10
2018-05-02 03:52:39 -07:00
Spencer Ahrens fffae99640 deepDiffer: add maxDepth arg
Reviewed By: blairvanderhoof

Differential Revision: D7839729

fbshipit-source-id: fe9a06d2aaed9dfbfb3e52779ba4b1b98007b9ce
2018-05-01 22:01:52 -07:00
Spencer Ahrens 5b2a2bee7a PureComponentDebug
Summary:
Drop in replacement for `React.PureComponent` or can replace `React.PureComponent` for all components.

Logs out what exactly triggered a re-render of a `PureComponent` to make it easier to track down why a component is re-rendering. With some other changes we'll also get component stacks in the YellowBox to make it even easier.

I thought about logging the values, but it's too easy to render something gross or cyclical like react components, so I figured people could break in the debugger to get more detail as needed.

Special flow type should cause errors if people try to commit any usage of this - it should only be used for local debugging.

Reviewed By: yungsters

Differential Revision: D7826325

fbshipit-source-id: fdf7910336452ac1c7acd328c04d441dfb186b59
2018-05-01 19:47:52 -07:00
Jerry Horton 37c820f16e Fix for issue #19086 RCTHasFontHandlerSet(); This function definition…
Summary:
… is not a protoype #19086

Thank you for sending the PR! We appreciate you spending the time to work on these changes.
Help us understand your motivation by explaining why you decided to make this change.

<!--
  Required: Write your motivation here.
  If this PR fixes an issue, type "Fixes #issueNumber" to automatically close the issue when the PR is merged.
-->

Fixes #19086

Related to react-native-navigation issue #3019

<!--
  Required: Write your test plan here. If you changed any code, please provide us with
  clear instructions on how you verified your changes work. Bonus points for screenshots and videos!
-->

Created a fresh react native >= 0.55.2 project and only install React Native Navigation. The error "This function declaration is not a prototype" message occurs.

Downgrading to React Native 0.54.4 builds fine.

![screen shot 2018-05-01 at 3 17 51 pm](https://user-images.githubusercontent.com/5680239/39491718-ddfdd6a0-4d52-11e8-937f-7ed9702a2e30.png)

<!--
  Does this PR require a documentation change?
  Create a PR at https://github.com/facebook/react-native-website and add a link to it here.
-->

No documentation change

<!--
  Required.
  Help reviewers and the release process by writing your own release notes. See below for an example.
-->
[iOS] [BUGFIX] [react-native-navigation] - For compatibility with react-native-navigation >= 2.0.2237 https://github.com/facebook/react-native/issues/19086
<!--
  **INTERNAL and MINOR tagged notes will not be included in the next version's final release notes.**

    CATEGORY
  [----------]      TYPE
  [ CLI      ] [-------------]    LOCATION
  [ DOCS     ] [ BREAKING    ] [-------------]
  [ GENERAL  ] [ BUGFIX      ] [ {Component} ]
  [ INTERNAL ] [ ENHANCEMENT ] [ {Filename}  ]
  [ IOS      ] [ FEATURE     ] [ {Directory} ]   |-----------|
  [ ANDROID  ] [ MINOR       ] [ {Framework} ] - | {Message} |
  [----------] [-------------] [-------------]   |-----------|

 EXAMPLES:

 [IOS] [BREAKING] [FlatList] - Change a thing that breaks other things
 [ANDROID] [BUGFIX] [TextInput] - Did a thing to TextInput
 [CLI] [FEATURE] [local-cli/info/info.js] - CLI easier to do things with
 [DOCS] [BUGFIX] [GettingStarted.md] - Accidentally a thing/word
 [GENERAL] [ENHANCEMENT] [Yoga] - Added new yoga thing/position
 [INTERNAL] [FEATURE] [./scripts] - Added thing to script that nobody will see
-->
Closes https://github.com/facebook/react-native/pull/19089

Differential Revision: D7841198

Pulled By: shergin

fbshipit-source-id: 31638274055c3f143342d2d6dde6d4af7a2ac304
2018-05-01 19:32:07 -07:00
David Vacca 99a6c0af40 Fix NPE in ReactSliderManager.initMeasureFunction
Reviewed By: fkgozali

Differential Revision: D7825102

fbshipit-source-id: af7502a5e6ffa83965a66a0a099d729152d7627f
2018-05-01 19:32:07 -07:00
Eric Samelson bf83600996 Remove race condition in initial layout of ReactRootView
Summary:
There is a race condition stemming from `ReactRootView.onCreate` that occasionally causes the initial root layout calculation to never occur. In this method currently, `updateRootLayoutSpecs(...)` is called before `enableLayoutCalculation()`, meaning that it's possible for the native modules thread to reach `UIImplementation.updateViewHierarchy` before layout calculation has been enabled (i.e. before the rootViewTag is added to `UIImplementation.mMeasuredRootNodes` on the UI thread).

When this occurs, `UIImplementation.applyUpdatesRecursive` is never called. This causes the app to hang on the splash screen indefinitely, the JS never gets past the first call to `render`, and no layout events are ever sent to the JS.

This PR reverses the order of those two method calls to ensure that the rootViewTag is always added to `mMeasuredRootNodes` before `UIImplementation.updateViewHierarchy` expects it. We inspected all of the code paths of both `enableLayoutCalculation()` and `updateRootLayoutSpecs()` to ensure that in this new order, the rootViewTag will *always* be added to `mMeasuredRootNodes` before the call to `updateViewHierarchy` is dispatched, and that no other side effects would be introduced.

Tested with an app that reliably had this issue (hanging splash screen) on 1 out of every ~10 launches. Logged values to ensure that empty `mMeasuredRootNodes` was the difference between failed and successful launches. After this change, I launched the same app 50+ times without any issues.

[ANDROID][BUGFIX][ReactRootView] - remove race condition in initial layout of ReactRootView
Closes https://github.com/facebook/react-native/pull/19038

Differential Revision: D7834270

Pulled By: hramos

fbshipit-source-id: 6040da900f807dcacbc86ae2c36b4ca004f80178
2018-05-01 14:04:40 -07:00
David Aurelio fa25311d27 ReactInstanceManager: post executor name with `CREATE_REACT_CONTEXT_START` marker
Summary: Adds the name of the active JS executor when logging the `CREATE_REACT_CONTEXT_START` marker.

Reviewed By: fromcelticpark

Differential Revision: D7800760

fbshipit-source-id: d5090a9f90cf4b7bcfb7218e75621becebd70675
2018-05-01 13:16:31 -07:00
David Aurelio 8e3105dbce Add `getName()` method
Summary: adds a `getName()` method to all `JavaScriptExecutor` classes that can be used by `ReactInstanceManager` to identify the bridge type when logging markers.

Reviewed By: fromcelticpark

Differential Revision: D7790531

fbshipit-source-id: efe485588738a38936accc4a7956840784b2dd08
2018-05-01 13:16:31 -07:00
David Vacca 837d496ac8 Fix clone of MutableYogaValue inside LayoutShadowNode
Reviewed By: achen1

Differential Revision: D7815809

fbshipit-source-id: 833af43387895b0b5193d6bef54c99023da01c9c
2018-05-01 08:06:16 -07:00
John Shelley 2d9e2f30e1 Android - Fix Drawable v4 paths in Android Artifact Resources (Libraries)
Summary:
_Quick apologies for the lengthiness of this description. Want to make sure I'm clear and it is understood what is being altered._

Thanks for submitting a PR! Please read these instructions carefully:

- [x] Explain the **motivation** for making this change.
- [x] Provide a **test plan** demonstrating that the code is solid.
- [x] Match the **code formatting** of the rest of the codebase.
- [x] Target the `master` branch, NOT a "stable" branch.

https://github.com/facebook/react-native/issues/5787
```
Unknown source file : /home/tom/projects/blueprint-native/android/app/build/intermediates/res/merged/release/drawable-mdpi-v4/images_google.png: error: Duplicate file.

Unknown source file : /home/tom/projects/blueprint-native/android/app/build/intermediates/res/merged/release/drawable-mdpi/images_google.png: Original is here. The version qualifier may be implied.
```

At Hudl, we've been attempting to package our React Native code into Library Dependencies _(Cocoapods / Android Artifact Resource (aar))_. Recently in React Native 0.42.0, there was an upgrade to the Android Project's gradle plugin from 1.3.1 to 2.2.3. This update drastically effected the outcome of drawable resources in Android without anyone noticing.

**There are 4 outcomes to consider with this change:**
1. You are developing in an Android Application using Gradle 1.3.1 or lower
2. You are developing in an Android Application using Gradle 2.2.3 or higher
3. You are developing in an Android Library Module using Gradle 1.3.1 or lower
4. You are developing in an Android Library Module using Gradle 2.2.3 or higher

With the upgrade to 2.2.3, Android changed the way aapt builds its resources. Any Library created with 2.2.3, has its resources ending with a `v4` suffix. The reasoning behind this I'm not sure of but assume it deals with Vector support that was added around that time.

The change I've added checks if React Native is being ran in an Android Library vs an Application, and appends the v4 suffix to the merged asset folders.

Multiple test were performed.

1. I first started out validating my assumption about the asset merger by creating a new Android Project to verify my assumptions above.
   1. [Application +  >= 2.2.3](https://github.com/jpshelley/TestAndroidLibraryDrawables/tree/master/app/build/intermediates/res/merged/debug) -- `hdpi` contains my drawable. `hdpi-v4` contains dependency's drawables.
   2. [Application + <= 1.3.1](https://github.com/jpshelley/TestAndroidLibraryDrawables/tree/Android-LegacyVersion/app/build/intermediates/res/merged/debug) -- Same as above (I expect because deps are compiled against gradle 2.2.3+ themselves.
   3. [Library + >= 2.2.3](https://github.com/jpshelley/TestAndroidLibraryDrawables/tree/Android-UsingAndroidLibrary/library/build/intermediates/res/merged/debug) -- Only `-v4` folders found! Resources from the library are packages in the app's build output in similar `-v4` folder too.
   4. [Library + <= 1.3.1](https://github.com/jpshelley/TestAndroidLibraryDrawables/tree/Android-UsingAndroidLibraryLegacyVersion/library/build/intermediates/res/merged/debug) -- Same as ii. & iii. `-v4` contains other resources, but my resources are located in non -v4 folder.

2. I then wanted to validate against React Native itself. So I updated my react native code using this PR/Branch, and tested against my project locally. Unfortunately I cannot share that code as it is private, but before this change I was getting the same error as mentioned in #5787 and now my build runs as intended with the assets being placed where they should be.

Additional resources:
* https://github.com/facebook/react-native/issues/5787
* http://stackoverflow.com/questions/35700272/android-build-tool-adds-v4-qualifier-to-drawable-folders-by-default-in-generated
* https://github.com/facebook/react-native/issues/12710

Please let me know if more information is needed, further test plans, etc. With this change we should be able to upgrade to Gradle 2.3.0 as well to support the latest version of Android Studio.
Closes https://github.com/facebook/react-native/pull/13128

Differential Revision: D7828618

Pulled By: hramos

fbshipit-source-id: a7ad7b63b1b51cbfd2ea7656e4d77321306ce33a
2018-05-01 04:16:21 -07:00
Brent Erickson f99ca3c03f Fix a race condition in AppState that prevents listeners from being notified
Summary:
If someone has setup a subscription on AppState and we correct AppState via getCurrentAppState call, we need to notify all the subscribers of AppState.
1 ) Initial AppState.currentState = 'active'
2-start) Subscribe to AppState Changes
3-start) Fetch Current AppState
4 ) App Code subscribes to AppState module
5 ) App becomes backgrounded
2-finish) AppState listeners are setup (missing background event)
3-finish) AppState.currentState updated to background

At this point the subscription setup in 4) will never be called with the change.

AppState should always call subscribers on change

This is very difficult to formally test since it's due to a race condition. We've seen this condition via bug reports but have had no local repro.

[GENERAL][BUGFIX][AppState] - Fix a race condition that could prevent AppState subscription change listener from firing on initial launch
Closes https://github.com/facebook/react-native/pull/18236

Differential Revision: D7823370

Pulled By: hramos

fbshipit-source-id: 99b174df70262ceaf9da141d005131facd624594
2018-04-30 18:01:17 -07:00
Spencer Ahrens 0f6762ba50 improve console logging
Summary:
* Always log when PRINT_TO_CONSOLE true - o reason to also check DEV.
* Log when `clearExceptTimespans` is called.
* Type `PRINT_TO_CONSOLE: false` to prevent accidental commits setting it true.

Reviewed By: alexeylang

Differential Revision: D7816623

fbshipit-source-id: 47cf7e158133045e20b345139efb1a79e5e6553b
2018-04-30 11:52:57 -07:00
Spencer Ahrens 5b923e0eaf Add args to bridge function call systrace markers
Reviewed By: yungsters

Differential Revision: D7797728

fbshipit-source-id: 615affc57e658d4dd08a88f829d38be930804372
2018-04-30 09:55:49 -07:00
Jonathan Kim 62784f35d8 load in platform macros
Reviewed By: ttsugriy

Differential Revision: D7809673

fbshipit-source-id: aacff1a99ba50393ed8f74842afa59384b846e63
2018-04-29 16:01:17 -07:00
Mayank Patke d0822c3bcc v0.71.0 in xplat/js
Reviewed By: yungsters

Differential Revision: D7787035

fbshipit-source-id: 07defbbaa6fdc8f3016727fe6d6b1640efbf8ab6
2018-04-28 02:19:34 -07:00
Miguel Jimenez Esun c18d2a9669 Upgrade Jest to 23.0.0-beta.2
Reviewed By: davidaurelio

Differential Revision: D7789525

fbshipit-source-id: 0d0ebe30d66dbc5cd07c7517a513ac7be2c1e128
2018-04-27 20:23:16 -07:00
Nikolai Tillmann be32cbef00 Make UIManager prepackable
Reviewed By: sebmarkbage

Differential Revision: D7736403

fbshipit-source-id: 6154b76d9d948658394488fe4472d8b5bbcd3d9f
2018-04-27 19:16:53 -07:00
David Vacca 5fa9d78978 Fix viewflattening for views with on_layout props
Reviewed By: achen1

Differential Revision: D7796986

fbshipit-source-id: beb0725d4edc15ec23deba592e53b700abb3bcb5
2018-04-27 18:53:27 -07:00
Alex Dvornikov 333602b9f2 Introduce "Options" argument to "fetchSegment()" function
Reviewed By: jeanlauliac

Differential Revision: D7791186

fbshipit-source-id: e3954a525e6e3b02a48ac19f78cc3716969dd6bf
2018-04-27 15:14:36 -07:00
David Aurelio 065b9991a9 Metro v0.36.1
Summary: contains fixes to `metro-babel-register` necessary for node 6 compat (as supported by React Native)

Reviewed By: mjesun

Differential Revision: D7788437

fbshipit-source-id: 805b185dd970bf376f11664aeabea0bb8ac94b8b
2018-04-27 07:31:21 -07:00
David Aurelio 5b0a5b9856 Remove shelljs(?) leftover
Summary:
`try-n-times` is used in some integration tests of React Native, but was using a non-existent `echo` function.
Here, we replace that with `console.warn`

Reviewed By: mjesun

Differential Revision: D7788436

fbshipit-source-id: 0f42a00b7be780ee31cbf397fdd12ad4ccd500b1
2018-04-27 07:31:21 -07:00
Miguel Jimenez Esun e2bea00c33 Remove TransformCaching.js
Reviewed By: jeanlauliac

Differential Revision: D7707146

fbshipit-source-id: 47f4c47b22cf65cfee05f63ad7dd81a5faf9c504
2018-04-27 06:47:26 -07:00
Chirag Shah 57774a4a98 Use app name from app.json for registering application
Summary:
Currently when we change the app name in `app.json`, run `react-native eject` and then run the application, we get the following error `Application HelloWorld2 has not been registered`

<img src="https://user-images.githubusercontent.com/6805530/34646396-9a68ccd0-f38c-11e7-9a49-9f985dc20f14.png" width="33%" />

This PR picks up the app name from app.json while registering the application, which prevents the additional step for the user to change the app name while registering in the `index.js`

Tested using sinopia. The new app generated with the `react-native init HelloWorld` contains the changes made.

[CLI] [ENHANCEMENT] [index.js] - App name picked from from app.json for registering application.
Closes https://github.com/facebook/react-native/pull/17472

Differential Revision: D7788652

Pulled By: hramos

fbshipit-source-id: bf23318ae1994b06e5d5908f53818040db1ad5af
2018-04-27 06:02:02 -07:00
David Aurelio 7b6dd2a661 Metro v0.36.0
Summary: bumps the version after cache updates.

Reviewed By: mjesun

Differential Revision: D7776561

fbshipit-source-id: 8afe97323544116f147b93b92e5aa42ec1124d3a
2018-04-27 00:35:29 -07:00
Valentin Shergin 6ce2823afe Fabric: Proper types and default arguments in ConcreteViewShadowNode
Summary: Trivial. Those are artefacts from copy-pasting from `ViewShadowNode`.

Reviewed By: mdvacca

Differential Revision: D7738576

fbshipit-source-id: 2d362cd0ff56420d54cdd0e339458ebe57049ddc
2018-04-26 18:03:07 -07:00
Valentin Shergin edc6cb5711 Fabric: New, much fancier, approach to parse dynamic props
Summary:
The new approach uses C++ overloading feature instead of specifying exact types in macros manually.
*Almost* macro-free!

Reviewed By: mdvacca

Differential Revision: D7738584

fbshipit-source-id: 85f8e4c1037b452df5e73b093dced9392cb2f73e
2018-04-26 18:03:07 -07:00
Valentin Shergin f8ab0e0b08 Fabric: YogaLayoutableShadowNode::enableMeasurement() enables custom measuring for Yoga based shadow nodes
Summary:
YogaLayoutableShadowNode::enableMeasurement() connects Yoga's measuring API and Fabric measuring API.
`enableMeasurement` should be called for leaf Yoga nodes with custom content which should be measured manually during layout.

Reviewed By: mdvacca

Differential Revision: D7738574

fbshipit-source-id: ffe883905c4809290d4d973ad29dc5f0e1ec7573
2018-04-26 18:03:07 -07:00
Valentin Shergin 6bbc2ec921 Fabric: Introcucing `ConcreteComponentDescriptor::adopt()`
Summary: Overriding `adopt` method allows subclasses to configure just created or cloned shadow nodes without overriding `create` and `clone` methods.

Reviewed By: mdvacca

Differential Revision: D7738581

fbshipit-source-id: bfe4e4e2d3d448591a3267b5ea7ca4e0800f5ba0
2018-04-26 18:03:07 -07:00
Valentin Shergin 9f46f425f4 Fabric: Managing `LocalData` instances in mounting pipeline
Summary: Managing and transmitting LocalData object to native views.

Reviewed By: mdvacca

Differential Revision: D7738580

fbshipit-source-id: c889da58d3afe7ac14f411576afe659bd079f641
2018-04-26 18:03:07 -07:00
Valentin Shergin 368388bfc8 Fabric: Introducing `LocalData` concept
Summary:
LocalData might be used to communicate some infomation between `ShadowNode`s
and native component views.

We will use it soon to store (and transmit to mounting layer) prepared for rendering attributed text in Text component.

Reviewed By: mdvacca

Differential Revision: D7738582

fbshipit-source-id: 1ead23ffd105cce0b3d9aeb9fc1d0df47673be50
2018-04-26 18:03:07 -07:00
Valentin Shergin 9d08e2afae Fabric: Using `ColorComponents` in `colorFromComponents` function
Summary: Trivial. We have a special data structure for it, why do not use it here?

Reviewed By: mdvacca

Differential Revision: D7738577

fbshipit-source-id: 750aa649b06f17d27906d44df07172a907cde2e5
2018-04-26 18:03:07 -07:00
Valentin Shergin 139db66a3e Fabric: More graphic values conversions from dynamic type
Summary: Trivial.

Reviewed By: mdvacca

Differential Revision: D7738578

fbshipit-source-id: 3112e523dd1cdceff90a8596033f9516aa2c8156
2018-04-26 18:03:07 -07:00
Valentin Shergin 6aa52f2684 Fabric: Using a proper Component Descriptor for node cloning
Summary: To clone a ShadowNode we must use node's ComponentDescriptot, not parent node's one.

Reviewed By: mdvacca

Differential Revision: D7738583

fbshipit-source-id: 83656f9a761530cdaedf65663ae28b3119af75f5
2018-04-26 18:03:07 -07:00
Valentin Shergin 3428808b97 Fabric: Using view name argument in `FabricUIManager.createNode()`
Summary: We are going to have not only <View> component soon!

Reviewed By: mdvacca

Differential Revision: D7738579

fbshipit-source-id: 5165762b98d94f74d40d016722be36a04d45f264
2018-04-26 18:03:07 -07:00