Commit Graph

1773 Commits

Author SHA1 Message Date
Lukas Wöhrl f1371ec24c Don't transfer layout outputs to java for unset edges
Summary:
See facebook/yoga#483. We should not transfer the layout if the layout didn't change. (using ```hasNewLayout```). This also changes that the lock on the java node is only aquired if needed, and it holds the lock only for the time the values are set and not for the time all it's children are set.
Closes https://github.com/facebook/yoga/pull/484

Reviewed By: astreet

Differential Revision: D4802966

Pulled By: emilsjolander

fbshipit-source-id: e8a8f2280ad6b25b98fc68b07eac68e0ec80fe3e
2017-04-01 04:34:17 -07:00
Charles Dick 175e77d004 break dependency between JSPackagerClient.RequestHandler and WebSocketListener
Reviewed By: amnn

Differential Revision: D4810406

fbshipit-source-id: a447bc15c6619921edd7adf0b3d1d93ae04e2e43
2017-03-31 11:02:07 -07:00
Kirwan Lyster 01a0e10026 Make SystraceRequestListener extend BaseRequestListener
Summary: Instead of `SystraceRequestListener` implementing `RequestListener`, this diff instead extends the base implementation.

Reviewed By: massimocarli

Differential Revision: D4796679

fbshipit-source-id: 0c9a0b755f4beff69007688962682989e5af72e0
2017-03-31 03:03:06 -07:00
Marc Horowitz ec4b85467d Allow DeviceInfoModule to be instantiated with only an android Context
Reviewed By: javache

Differential Revision: D4772673

fbshipit-source-id: 80894faa076ccfddf0fe28bd4d7b6aaeba6c38a5
2017-03-31 01:00:52 -07:00
Marc Horowitz 1916b38a65 Support passing a collection of native modules to JSContext
Reviewed By: javache

Differential Revision: D4772649

fbshipit-source-id: dd9353edb0c2c013a3b7fe772231db12cdd8cdae
2017-03-31 01:00:52 -07:00
Marc Horowitz 0b2ac0ada8 Support narrower module dependencies
Reviewed By: javache

Differential Revision: D4772632

fbshipit-source-id: 615bf8998a3817364d0f8bd435c95c2c1f1bebed
2017-03-31 01:00:52 -07:00
Aaron Chiu 7773f25756 move us off AsyncTask
Reviewed By: achen1

Differential Revision: D4795134

fbshipit-source-id: 70979e3fae6dcd63d535290659c87de82f9617c3
2017-03-30 16:20:51 -07:00
Lukas Wöhrl 759b8ccf71 Don't transfer layout outputs to java for nodes which don't have a new layout
Summary:
As suggested in facebook/yoga#484. This is the PR which only adds the part of using a local bool field for storing the hasLayoutFlag, to be able to pass the layout only if it has really changed.
Closes https://github.com/facebook/yoga/pull/492

Reviewed By: astreet

Differential Revision: D4786961

Pulled By: emilsjolander

fbshipit-source-id: cf3d354b93f6dcc3ef817ef73a47bd29e37d1848
2017-03-29 16:45:37 -07:00
hoangpham95 c3110963f2 The width and height should be in the revsersed order.
Summary:
Inspired by #13191

Creating a test app with spannable `TextView`, and observe the text width/height
Closes https://github.com/facebook/react-native/pull/13203

Differential Revision: D4795809

Pulled By: hramos

fbshipit-source-id: a7c6845abe7472dc7ad2f1f978a20d02fe49eda8
2017-03-29 11:17:16 -07:00
Emil Sjolander 50a6c4933e Expose UseWebDefaults to java
Reviewed By: astreet

Differential Revision: D4779743

fbshipit-source-id: 65a4184af6fb959fefff5c2014522c551ca440d5
2017-03-29 03:17:25 -07:00
Kathy Gray f804af27c2 Make bridge load module lazy
Reviewed By: javache

Differential Revision: D4762575

fbshipit-source-id: fc3be786640b8c42664d7b357ab0fe197006b28b
2017-03-29 02:35:59 -07:00
Emil Sjolander 436a9a5bf7 Optimize ReactShadowNode by more manually converting between string and enums
Reviewed By: astreet

Differential Revision: D4778954

fbshipit-source-id: ee96415e6787ccfd8eb7a560d76d206db3eaee1d
2017-03-28 17:46:24 -07:00
Danny Liu 63035a4c08 replace string comparison with enum
Summary:
This change change the interface of reactmarker to use enum type and ReactMarker would still support logMarker(string, string) with addtional support for logMarker(ReactMarkerConstants, string).
Also moved some markers into the enum.

Reviewed By: fkgozali

Differential Revision: D4773600

fbshipit-source-id: 336ba79bb9514d3146bdda177861743ae51424ab
2017-03-28 16:24:44 -07:00
wenzhe.lv d2939eafbf Fix crash when move on the edge of some phones like HUAWEI P9
Summary:
The app crashes because of `TouchEventCoalescingKeyHelper.getCoalescingKey` throwing an exception when move on the edge of some phones like HUAWEI P9. It's caused by that the down time differs from `ACTION_DOWN` to `ACTION_MOVE` which belongs to the same gesture when I touched on the edge of my HUAWEI P9. It seems a native bug of manufacturer. Related issue #11302.
```
java.lang.RuntimeException: Tried to get non-existent cookie
    at com.facebook.react.uimanager.events.TouchEventCoalescingKeyHelper.getCoalescingKey(TouchEventCoalescingKeyHelper.java:75)
    at com.facebook.react.uimanager.events.TouchEvent.init(TouchEvent.java:93)
    at com.facebook.react.uimanager.events.TouchEvent.obtain(TouchEvent.java:46)
    at com.facebook.react.uimanager.JSTouchDispatcher.handleTouchEvent(JSTouchDispatcher.java:118)
    at com.facebook.react.ReactRootView.dispatchJSTouchEvent(ReactRootView.java:158)
    at com.facebook.react.ReactRootView.onInterceptTouchEvent(ReactRootView.java:130)
    at android.view.Vie
Closes https://github.com/facebook/react-native/pull/12063

Differential Revision: D4779060

Pulled By: astreet

fbshipit-source-id: 5cf20084ff9081f2535ff9cb3b99d1d52c443f03
2017-03-27 07:02:14 -07:00
Aaron Chiu e2204c5ccb measure delay of calling into UI thread when setting up ReactContext
Reviewed By: yungsters

Differential Revision: D4736627

fbshipit-source-id: 6d425ef0ad7bbd54296a619009136c929cb16030
2017-03-25 09:52:16 -07:00
dabit1 94d93f7d41 PositionError must be an object, not string
Summary:
As specifications says, the Position error must be an object with code and message attributes. Right now it is a string. If not, we can't know what kind of error is. Another issue is that the message must be exactly "No available location provider."

Specifications:
https://developer.mozilla.org/en/docs/Web/API/PositionError
Closes https://github.com/facebook/react-native/pull/13140

Differential Revision: D4774922

Pulled By: ericvicenti

fbshipit-source-id: f956af051461e9f8d6435496283e54b3c4dc8ef5
2017-03-24 18:30:59 -07:00
Andrew Y. Chen 820c8e2466 Instrumentation test for PokesDashboardApp
Reviewed By: AaaChiuuu

Differential Revision: D4758149

fbshipit-source-id: 17e448d44af4deccc288738d294146a612d5e9c3
2017-03-24 11:16:21 -07:00
Andrew Y. Chen 893689c82b Fix buck build
Reviewed By: AaaChiuuu

Differential Revision: D4768765

fbshipit-source-id: 91e34faa2fe864b9a9835e6dab07c8396477505f
2017-03-24 08:47:02 -07:00
Michael Lee dcf3cbeb31 Clean up some of the ReactNative Buck rules
Reviewed By: yangchi

Differential Revision: D4739284

fbshipit-source-id: 0ee335df0d114631e5fc60d5d6e51547e5312d39
2017-03-23 12:02:25 -07:00
Andrew Y. Chen 04ccbdd887 Move NetworkRecordingModuleMock into testing/network
Reviewed By: AaaChiuuu

Differential Revision: D4755904

fbshipit-source-id: 8a68530453b1d288da402f17e16fec9c57e5bb2a
2017-03-23 11:03:44 -07:00
Jonathan Lawlor 379b60d5e8 Fix ClassCastException in ReactModuleSpecProcessor
Reviewed By: AaaChiuuu

Differential Revision: D4752195

fbshipit-source-id: 7c01f9be4d82dbc605f1e6d3b217f0c83f177165
2017-03-22 11:17:48 -07:00
Aaron Chiu ba75d99033 don't call clearFrameCallback() if we don't have a ReactChoreographer to clear the frame callback on
Reviewed By: achen1

Differential Revision: D4741906

fbshipit-source-id: 2d5fabab6e04c08252513f77149c04e3b8314d2c
2017-03-21 16:17:50 -07:00
Andrew Y. Chen ee245b9be8 Fix instrumentation tests for api 22
Summary:
Bug in Android https://code.google.com/p/android/issues/detail?id=33868 causes the RN catalyst instrumentation test to fail with

```
java.lang.ArrayIndexOutOfBoundsException: length=253; index=-1
	at android.text.StaticLayout.calculateEllipsis(StaticLayout.java:667)
	at android.text.StaticLayout.out(StaticLayout.java:631)
	at android.text.StaticLayout.generate(StaticLayout.java:423)
	...
```

The fix is to set singleLine to true when there is only one line of text

Reviewed By: AaaChiuuu

Differential Revision: D4562000

fbshipit-source-id: 84248e3982063b767e8b0465effe2321b54a7fa2
2017-03-21 14:46:34 -07:00
Aaron Chiu 2f69c5f46c exit out early and continue if no annotations are found
Differential Revision: D4742299

fbshipit-source-id: 8006c5c9b25c951aec12ad5c63fdaf03fe1f6e67
2017-03-21 05:16:08 -07:00
Andrew Y. Chen a4300dab67 Move idle detection classes to its own directory
Reviewed By: AaaChiuuu

Differential Revision: D4738755

fbshipit-source-id: df3b215991a45932283f6ba9d800aeff1c31d2e6
2017-03-20 17:31:18 -07:00
Petter Hesselberg 242a58ffe0 Fix NullPointerException in ReactShadowNode.toString()
Summary:
Fix `NullPointerException` in `ReactShadowNode.toString`
Simplified `ReactShadowNode.hasNewLayout` since I was already in there

It seems to me unlikely that this bug impacts anything but the debugging experience, so no biggie.
Closes https://github.com/facebook/react-native/pull/12953

Differential Revision: D4739215

fbshipit-source-id: 94955cc783216fdb8868fc8d08010e0d8a238052
2017-03-20 12:49:00 -07:00
Pieter De Baets 2f92ee8a9c Attempt to fix CircleCI tests
Summary:
Attempt to always call `mBridgeIdleListeners` on the native modules thread mBridgeIdleListeners
Closes https://github.com/facebook/react-native/pull/13004

Differential Revision: D4734342

Pulled By: mkonicek

fbshipit-source-id: f7054015a1d4517abab9bb8fc61402efabdd6ac1
2017-03-20 05:59:56 -07:00
Martin Konicek 7168ed2954 Revert D4676282: [rn] Move idle detection classes to its own directory
Differential Revision: D4676282

fbshipit-source-id: ad5ee4f2cdbe407f67cfed74af7ddec18dabff3d
2017-03-20 05:00:43 -07:00
Aaron Chiu 5328d952a8 kill bridge only after cleaning up NativeModules
Reviewed By: javache

Differential Revision: D4734634

fbshipit-source-id: c2d425485679454397d18b1a0c389714c0e3c484
2017-03-19 13:18:31 -07:00
Ashwin Bharambe 11814a5a81 Ensure `ResourceDrawableIdHelper` is thread-safe
Reviewed By: jaegs

Differential Revision: D4696625

fbshipit-source-id: e0aa7870ba02d8e6542c436d7f775bb251cf91ae
2017-03-17 17:02:04 -07:00
Ashwin Bharambe 95c1926193 Introduce `DeviceInfo` as a new native module
Summary:
The `UIManager` already has a lot of responsibilities and is deeply
tied with React Native's view architecture. This diff separates out a
`DeviceInfo` native module to provide information about screen dimensions and
font scale, etc.

Reviewed By: fkgozali

Differential Revision: D4713834

fbshipit-source-id: f2ee93acf876a4221c29a8c731f5abeffbb97974
2017-03-17 17:01:57 -07:00
Andrew Y. Chen 238fd4ad19 Move idle detection classes to its own directory
Reviewed By: AaaChiuuu

Differential Revision: D4676282

fbshipit-source-id: 1b07e66ba638d4293eec65cb4e336f21dfb78218
2017-03-17 16:46:17 -07:00
Emil Sjolander e69a80f7f9 Revert D4713847: [rn] Optimize ReactShadowNode by more manually converting between string and enums
Differential Revision: D4713847

fbshipit-source-id: c1a60ad133ec010556c0b4c6e5fd39cdc0eab337
2017-03-17 13:30:26 -07:00
Emil Sjolander b956c111d8 Revert D4716024: [yoga] Avoid transfering cached layout information to java
Differential Revision: D4716024

fbshipit-source-id: 7276b4bbf072aa444c5ae9fd1a3d62ea87a0cec1
2017-03-17 13:30:26 -07:00
Lukas Piatkowski 60142adc72 Extract PackagerConnectionSettings to ensure easier reusability of PackagerConnection module
Reviewed By: cwdick

Differential Revision: D4689535

fbshipit-source-id: f698837f407a03bf91521cc5e921c66f5755e6e0
2017-03-17 10:02:34 -07:00
Emil Sjolander 50ff7167cb Optimize ReactShadowNode by more manually converting between string and enums
Reviewed By: astreet

Differential Revision: D4713847

fbshipit-source-id: 5ef5b59f85bb26f0af9af0698c9fc1f36eb5f7bf
2017-03-17 09:32:24 -07:00
Emil Sjolander f0240e004a Avoid transfering cached layout information to java
Reviewed By: astreet

Differential Revision: D4716024

fbshipit-source-id: c30763a6fc7426d653c7a6ca129615cddb4140e9
2017-03-17 09:20:52 -07:00
Pieter De Baets 73e81b87d3 Remove unused onNativeException delegate method
Reviewed By: mhorowitz

Differential Revision: D4597914

fbshipit-source-id: 82a109d1e6d8b0c93380840c22ec74dc75ab1a45
2017-03-17 07:08:14 -07:00
Pieter De Baets d7b37c4050 Remove JsToNativeBridge's nativeQueue
Reviewed By: mhorowitz

Differential Revision: D4589737

fbshipit-source-id: 3b2730417d99c4f98cfaad386bc50328f2551592
2017-03-17 07:08:14 -07:00
Andrew Y. Chen 63fa621df1 Fix FrescoModule not initialized in Nodes
Reviewed By: AaaChiuuu

Differential Revision: D4687127

fbshipit-source-id: d387ff665374bd4ef40fc2e9c19543f2bacf4a66
2017-03-16 16:34:05 -07:00
Marc Horowitz 6eb9ee2652 Missing @DoNotStrip
Reviewed By: javache

Differential Revision: D4715719

fbshipit-source-id: c689ea68efafeb353382c8c3b72f5616932ad761
2017-03-15 13:46:45 -07:00
Andy Street 5873a228f4 Fix crash if native code tries to update the size of a modal view after JS has removed it
Summary:
See https://github.com/facebook/react-native/issues/10845

onSizeChanged is enqueueing a runnable from the ui thread that references a shadow view by id on the native modules thread. Since the shadow thread 'runs ahead' of the UI thread (e.g. it has a newer state of the world than the UI thread), this isn't safe. By the time that code block runs, it's possible that an update from JS has already removed that view from the shadow hierarchy (a change which would then propagate to the native hierarchy on the UI thread).

Reviewed By: AaaChiuuu

Differential Revision: D4706521

fbshipit-source-id: 0915f081068709b895f70b2edce12163b39e5456
2017-03-15 08:02:58 -07:00
Charles Dick 373eb61f1f Download files through RN packager connection
Differential Revision: D4650999

fbshipit-source-id: 298e3e65bfc13a3610a588c9bffb4808fb2135e3
2017-03-15 06:47:34 -07:00
Petter Hesselberg 957b55c769 Don't crash in StackTraceHelper.convertJsStackTrace
Summary:
Don't crash in `StackTraceHelper.convertJsStackTrace` on missing `lineNumber`

I've seen the native Android app crash upon displaying a stack trace because of this bug.

Incidental and unrelated change: Refactor `StackTraceHelper.formatFrameSource` to use `StringBuilder`
Closes https://github.com/facebook/react-native/pull/12920

Differential Revision: D4709273

fbshipit-source-id: 95b3eb303f259460e33d8ee32a2db652360c645d
2017-03-14 16:16:26 -07:00
Marc Horowitz 87137cadd7 rename javaModules -> nativeModules
Reviewed By: AaaChiuuu

Differential Revision: D4631758

fbshipit-source-id: 3b62ada1bf32467b67cd8529d4b7873b43898ee4
2017-03-14 15:35:01 -07:00
Marc Horowitz e622d51e20 Support ModuleHolder-based lazy init of C++ modules with C++ bridge on android
Reviewed By: AaaChiuuu

Differential Revision: D4614479

fbshipit-source-id: 109ac34b8688f0113675e4a4479d1ddcc6169ed4
2017-03-14 15:35:01 -07:00
Marc Horowitz 6410e256c5 Decouple module callback mechanism from CatalystInstance
Summary:
Create a JSInstance superinterface which doesn't include all
the lifecycle stuff.

Reviewed By: AaaChiuuu

Differential Revision: D4614410

fbshipit-source-id: 16047bbcb1bb69bf36a0a13ef68f3a6aa396a991
2017-03-14 15:35:01 -07:00
Jonathan Keljo 1ca41a56c6 Fix ReactNative build break
Reviewed By: asp2insp

Differential Revision: D4707219

fbshipit-source-id: a7da2aa50fa812bb63ac7697c022f7b770eeb479
2017-03-14 13:16:11 -07:00
Aaron Chiu 95b61925b3 measure time between building ReactInstanceManager and creating ReactContext
Reviewed By: alexeylang

Differential Revision: D4705021

fbshipit-source-id: 555ad512aed5b44165091a4bcc25a8a5564d55d3
2017-03-14 13:10:23 -07:00
Theo Yaung 3e528b1014 Remove Inspector Logic (cannot work on iOS / System JSC)
Reviewed By: javache

Differential Revision: D4620530

fbshipit-source-id: 52abc6178b1ad1b52ba1b1825702c9c254a04520
2017-03-14 11:45:38 -07:00