Commit Graph

1900 Commits

Author SHA1 Message Date
Theo Yaung ac74d2a38b Refactor interfaces
Reviewed By: johnislarry

Differential Revision: D4844786

fbshipit-source-id: f348b8d5078643636343f6ea099b200f519fbc40
2017-05-02 21:31:41 -07:00
Janic Duplessis 6f092a4264 Fix touch target for views with z-index
Summary:
The new implementation of z-index did not handle touches properly. This fixes it by using the mapped child index like we do in `getChildDrawingOrder` in `TouchTargetHelper`.

**Test plan**
Tested that touchables work properly inside sticky headers (it uses z-index) on Android.
Closes https://github.com/facebook/react-native/pull/13705

Reviewed By: AaaChiuuu

Differential Revision: D4987964

Pulled By: sahrens

fbshipit-source-id: 165f98e23d2f304c4dc87f536c22b68a8923d806
2017-05-02 16:03:38 -07:00
Ravi Bhoraskar bf0a95d338 Backed out changeset 8841a5719494 (D4944482)
Reviewed By: sahrens

Differential Revision: D4981286

fbshipit-source-id: 5b17ba93ee43a0a46f98f47b6fb8a779180ab4b6
2017-05-02 12:16:00 -07:00
Daniel Friesen 41518caa3d Stop <Modal> from incorrectly darkening translucent status bars
Summary:
When using a translucent status bar using `<StatusBar />` and a `<Modal transparent />` the dialog layer applies its own translucent status bar color on top causing the status bar to darken.

This is especially problematic when the modal is a menu and nothing on the screen is supposed to darken.

I've collected screenshots of the status bar in various situations before and after this change to show the change and demonstrate that it doesn't have any bad side effects for the other status bar and modal types (non-translucent status bars / non-transparent modals).

* "**Before**" row: RN 0.43.1 unmodified
* "**After**" row: This modification applied
* **Translucent**: Translucent status bar `<StatusBar backgroundColor='rgba(0, 0, 0, 0.2)' translucent />` (modal closed)
* **Alpha Colored**: Coloured translucent status bar `<StatusBar backgroundColor='rgba(255, 0, 255, 0.2)' translucent />` (modal closed)
* **Not Translu...**: Non-translucent status bar `translucent={false}` (modal closed)
* **w/modal**: Same as image to the left but with the Modal opened
* **Opaque Modal**: Translucent status bar with open but opaque/dim modal (`<Modal transparent={false} />`)

![Screenshot Matrix](https://cloud.githubusercontent.com/assets/53399/25305992/d4bca728-2739-11e7-8801-a31424e3bf50.png)
Closes https://github.com/facebook/react-native/pull/13629

Differential Revision: D4985349

Pulled By: astreet

fbshipit-source-id: 4d3614a07bb15cb52f220d9444b898d15be7b4dc
2017-05-02 04:07:59 -07:00
Valentin Shergin f73464851b Revert D4680300: [RN] BREAKING: Better TextInput: `contentSize` property was removed from `<TextInput>.onChange` event.
Differential Revision: D4680300

fbshipit-source-id: 20f7299c53cc54215fb333e97d7e11de087e303d
2017-05-01 21:15:44 -07:00
Valentin Shergin 99e24ecc67 BREAKING: Better TextInput: `contentSize` property was removed from `<TextInput>.onChange` event.
Summary:
`contentSize` was removed from both iOS and Android, tests was updated.
USE `onContentSizeChange` INSTEAD.

Why?
 * It always was a hack;
 * We already have dedicated event for it: `onContentSizeChange`;
 * `onChange` has nothing to do with layout actually;
 * We have to maintain `onChange` handler as fast and simple as possible, this feature complicates it a lot;
 * It was undocumented feature;
 * We already have native auto-expandable <TextInput>, so it illuminates 99% current use cases of this feature.

Reviewed By: mmmulani

Differential Revision: D4680300

fbshipit-source-id: 337836deef0767e5f26350f5a8ce73adb4146a02
2017-04-30 23:02:25 -07:00
Lukas Wöhrl 992e37c8bc Fix sizing of non strech items
Summary:
Fixes the sizing of items so that under most scenarios it calcultes its height by it's content for non exact measurings. This introduces a new useLegacyStretchBehaviour flag on the config to opt out of this change as it is breaking.

See facebook/yoga#505
Closes https://github.com/facebook/yoga/pull/506

Reviewed By: astreet

Differential Revision: D4954016

Pulled By: emilsjolander

fbshipit-source-id: d28bd5d174cd76951fb94df85e3b0cfab7f81ff7
2017-04-28 06:18:30 -07:00
Emil Sjolander 924b869f76 Expose print function to java
Reviewed By: astreet

Differential Revision: D4962456

fbshipit-source-id: 8f62ed6724490e621fbc11573b2a9b25c56e51f1
2017-04-27 16:32:36 -07:00
Seth Kirby c8bb422882 Fix Nodes not having correct view managers externally
Reviewed By: ahmedre

Differential Revision: D4927963

fbshipit-source-id: f4993aa45f6313e814d03141f828d37eafade059
2017-04-27 15:50:15 -07:00
Emil Sjolander 39f9e7a6b1 Disable yoga rounding for RN
Reviewed By: shergin

Differential Revision: D4964205

fbshipit-source-id: d3f709713d61f663245fd2208057dbc75aece049
2017-04-27 13:05:55 -07:00
Rene Weber c6614f117f Add explicit error message if e.getMessage is null
Summary:
In the NetworkingModule, if the http request failed, we send a `didCompleteNetworkResponse` event with the error message, which is used on JS side to determine if the request was erroring. Currently we get the error message from `e.getMessage()`, however, not all exceptions have a message and it might therefore return null and thus resulting in no error on JS side. This change checks if the message is null and if so uses a default message.

In android send a request using XMLHttpRequest with a timeout set to a server that has a delay larger than the timeout (so we force the timeout to happen).

```
const request =  new XMLHttpRequest();
request.open('GET', "http://localhost:3000/", true);
request.timeout = 1000;
request.ontimeout = () => { console.log('ontimeout'); };
request.send();
```

See the timeout callback being called correctly.

Fixes #11666
Closes https://github.com/facebook/react-native/pull/13407

Differential Revision: D4963764

Pulled By: hramos

fbshipit-source-id: 61ffcef9e0594fe9bface24fdb8bde1e6eec3990
2017-04-27 12:15:48 -07:00
Andrew Y. Chen 2d3a272e0e Don't complete requests if mock response wasn't provided
Reviewed By: jingc

Differential Revision: D4959691

fbshipit-source-id: 8a61c6fc559a2be4603b9d01dafa52f7441bd3a6
2017-04-27 11:47:58 -07:00
Aaron Chiu 8478767044 wrap CREATE_MODULE and INITIALIZE_MODULE markers with try/finally
Reviewed By: alexeylang

Differential Revision: D4961142

fbshipit-source-id: 7d25103b2839f15bb6a913eba7eb60ef0b07eb23
2017-04-27 11:47:57 -07:00
Gerald Monaco ee91eb7401 Add openStackFrameCall to DevServerHelper
Reviewed By: javache

Differential Revision: D4946709

fbshipit-source-id: 059aec70c4a0b230e9280b050601a3bde39f46df
2017-04-27 11:32:38 -07:00
Emil Sjolander 1a72d91cb2 Remove rounding from experimental features
Reviewed By: gkassabli

Differential Revision: D4953838

fbshipit-source-id: 3ee5f27d92f95b3ed4a01c98bc35e9157f2e91c5
2017-04-27 07:27:26 -07:00
Aaron Chiu 414f5c88ff fix lint
Reviewed By: javache

Differential Revision: D4953667

fbshipit-source-id: e27f9df072f2e89b541c9ef46c637987c27d1d99
2017-04-26 20:15:54 -07:00
Minjang Kim 39c73a842f A (better) fix for t17513908: IG(Android) crash when tapping "Comments" at Settings
Reviewed By: martinbigio

Differential Revision: D4956022

fbshipit-source-id: 0f9cc1c9ecf28c95fe192f41fd3e75cd7409dd27
2017-04-26 16:32:46 -07:00
Emil Sjolander 19e1ef9042 Expose setPointScaleFactor to java
Reviewed By: gkassabli

Differential Revision: D4953835

fbshipit-source-id: b1f97d9ec1bb78ccf7f53131fce87955fe66eb02
2017-04-26 12:31:08 -07:00
Emil Sjolander aaab0e9674 Call onDisconnected() not onConnected() when closing socket
Reviewed By: javache

Differential Revision: D4953631

fbshipit-source-id: 578d212b19f7364346ea2ae8f3e52438ffc378bd
2017-04-26 04:15:31 -07:00
Andrew Y. Chen 324018061b Fix NoSuchMethodError for Inspector#Page's constructor
Reviewed By: AaaChiuuu

Differential Revision: D4946388

fbshipit-source-id: 1c86e9701f26bc22af81050b300a2d6fd96a11a1
2017-04-25 18:15:32 -07:00
Aaron Chiu 513da6fcf2 enable the usage of the BGUI thread
Reviewed By: javache

Differential Revision: D4928729

fbshipit-source-id: 2a3baa01856cb7145d5f0155da0b959c330b7425
2017-04-25 16:17:05 -07:00
Andrew Y. Chen 86dd77f924 Fix copy paste
Reviewed By: andreicoman11

Differential Revision: D4944482

fbshipit-source-id: 8841a57194943ced489a2d8b0c634b3befcce1d7
2017-04-25 11:35:33 -07:00
Gerald Monaco 102f990861 Add symbolication support to DevServerHelper
Reviewed By: javache

Differential Revision: D4929829

fbshipit-source-id: 6babdb868d27c1b0da0332cc6aee38502f35704f
2017-04-25 11:15:37 -07:00
Michael Schneider 57b0039ce1 Add appProperty to ReactRootView
Summary:
To get on par with iOS this PR adds an `appProperty` to the `ReactRootView`. The documentation on the iOS side is here: [https://facebook.github.io/react-native/docs/communication-ios.html#properties.](https://facebook.github.io/react-native/docs/communication-ios.html#properties.)

You can pass in initial props with the `startReactApplication` method:
```java
…
Bundle initialProps = new Bundle();

bundle.putString(“initialKey”, “initialValue”);
mReactRootView.startReactApplication(mReactInstanceManager, "HelloWorld", initialProps);
setContentView(mReactRootView);
…
```

And later on properties can be updated this way:
```java
…
// Update props
Bundle updatedProps = mReactRootView.getAppProperties();

updatedProps.putString(“someOtherKey”, “someOtherValue”);

mReactRootView.setAppProperties(updatedProps);

// Replace props
Bundle newProps = new Bundle();

newProps.putString(“someKey”, “someValue”);

mReactRootView.setAppProperties(newProps);
…
Closes https://github.com/facebook/react-native/pull/13430

Reviewed By: AaaChiuuu

Differential Revision: D4896483

Pulled By: javache

fbshipit-source-id: 7c752d6bbf5dc500874b49dcff80db772e83915f
2017-04-25 10:19:40 -07:00
Daniel Wagner-Hall 3d2a9ebdda Remove project_config rules
Reviewed By: marcinkosiba

Differential Revision: D4939288

fbshipit-source-id: 53343a9a1a016db305de0293b6db5dc127940865
2017-04-25 07:21:03 -07:00
Pieter De Baets 34bc6bd2ae Drop support for webworkers
Reviewed By: AaaChiuuu

Differential Revision: D4916449

fbshipit-source-id: a447233d3b7cfee98db2ce00f1c0505d513e2429
2017-04-25 05:37:54 -07:00
Pieter De Baets a20882f62e Remove WebWorker support from Timers
Reviewed By: AaaChiuuu

Differential Revision: D4929245

fbshipit-source-id: 6eae128756a31f6063bf8fe39f0573c1c07ca8bb
2017-04-25 05:37:53 -07:00
Pieter De Baets ea93577ff2 Remove WebWorker support from NetworkingModule
Reviewed By: AaaChiuuu

Differential Revision: D4929251

fbshipit-source-id: fa07bfea64e6f79fd7b8c19889a26caec03cd421
2017-04-25 05:37:53 -07:00
Emil Sjolander 5bb1e4813b Move reset into yoga node and dont set overflow as it has no effect
Reviewed By: marco-cova

Differential Revision: D4938759

fbshipit-source-id: 4cd6bc478dd1f56340f23e8bfe95fe7bb1b5db2d
2017-04-25 03:31:57 -07:00
Alexey Lang 1bc9d448f5 Port perf metrics used in RCTBatchedBridge
Reviewed By: javache

Differential Revision: D4938279

fbshipit-source-id: c927261ff96c2eb07b7303ae96aae7600f2947f1
2017-04-25 02:32:25 -07:00
Emil Sjolander f1d5fdd468 connect / disconnect with websocket not when starting / stopping
Reviewed By: kittens

Differential Revision: D4937181

fbshipit-source-id: d1ec8144567809537fc7e321c255501bb130939b
2017-04-24 04:01:39 -07:00
Pieter De Baets f09fdcbd2b Throw when failing to load script
Reviewed By: AaaChiuuu

Differential Revision: D4929104

fbshipit-source-id: 115a44097b26bc11d20059c1667b9cf36fc47be9
2017-04-24 04:01:38 -07:00
Aaron Chiu 6138e20379 give us the ability to create a background UI thread
Reviewed By: javache

Differential Revision: D4928689

fbshipit-source-id: 94fa5f3f7c047ad816c7699dcc8bebf9e751b282
2017-04-21 05:30:22 -07:00
Pieter De Baets b4932082c7 List nested exception in Redbox
Reviewed By: AaaChiuuu

Differential Revision: D4928968

fbshipit-source-id: 3af8f4ad0f76f035d2167fbf4b4381b6503f6bd2
2017-04-21 05:30:22 -07:00
Aaron Chiu 3a3e5affc3 add flag to test running BG UI operation on a separate thread from the native modules thread
Reviewed By: achen1

Differential Revision: D4912045

fbshipit-source-id: b0b1aea24f8d463b95369636b7df2422a23aab22
2017-04-20 16:15:38 -07:00
Aaron Chiu 97a86634f7 lower thread priority of native module and JS thread
Reviewed By: achen1

Differential Revision: D4921012

fbshipit-source-id: 71df4ab0614f20f092b992c07e828eb5ad951159
2017-04-20 15:35:58 -07:00
Marc Horowitz 38f5b84734 Make ModuleHolder usable from C++
Reviewed By: AaaChiuuu

Differential Revision: D4924286

fbshipit-source-id: f4d86603cf241ab21f931fed4798acd805d0b5aa
2017-04-20 15:01:20 -07:00
Pieter De Baets 17020ff9af Add API to reset CxxModuleWrapper's module pointer
Reviewed By: mhorowitz

Differential Revision: D4914335

fbshipit-source-id: f28f57c2e74d590dacfb85d8027747837f768fdc
2017-04-20 11:00:33 -07:00
Pieter De Baets 366cb5a00a Remove unused PersistentDirectory JSC config
Reviewed By: amnn

Differential Revision: D4921075

fbshipit-source-id: 8e0a0caadc882a0e3ffb6f66c2bc7336c7d64849
2017-04-20 03:15:26 -07:00
Aaron Chiu 350b6c6d7f don't run setupReactContext() on UI thread
Reviewed By: achen1

Differential Revision: D4816125

fbshipit-source-id: e1da5de166bc29d635ffa22e8747a5b61eaf1491
2017-04-20 01:30:59 -07:00
Aaron Chiu 3e866e0380 launch conversion from ASyncTask to Thread
Reviewed By: achen1

Differential Revision: D4900998

fbshipit-source-id: af2283525b4e9856d7ff3466096226c4c1209f6b
2017-04-18 20:32:02 -07:00
Aaron Chiu 3fda6a9a2b clear DraweeControllerBuilder after usage
Reviewed By: achen1

Differential Revision: D4908279

fbshipit-source-id: 8de9930a2160f3201f8b7a8a66415310fa2f41de
2017-04-18 20:07:05 -07:00
Pieter De Baets 54d8d10a6b Construct ModuleHolder from ReactModuleInfo
Reviewed By: AaaChiuuu

Differential Revision: D4883331

fbshipit-source-id: c901051d0aa5993142104126bbec5d76bd605e0b
2017-04-18 06:48:04 -07:00
Aaron Chiu 035f076594 move calls that need to be on the UI thread out of setupReactContext()
Reviewed By: achen1

Differential Revision: D4890541

fbshipit-source-id: 7fc87d3341a1cefd474481dcc1b7b6d02d92f445
2017-04-18 04:15:34 -07:00
Aaron Chiu b9eeaef243 make ReactInstanceManager safer threading wise
Reviewed By: achen1

Differential Revision: D4883219

fbshipit-source-id: 45671a6d51357fd51ca824a59f7b200c3df66b89
2017-04-18 04:15:34 -07:00
Aaron Chiu ff056d22d9 update the infer-annotation jar for open source to unblock D4883219
Reviewed By: achen1

Differential Revision: D4890251

fbshipit-source-id: 3945c0e85fba15d588aa3b5760c64c5d81c6c516
2017-04-17 15:57:36 -07:00
Andrew Y. Chen 1dc0f7e994 Instrumentation tests for apps that provide a testPayload
Reviewed By: AaaChiuuu

Differential Revision: D4873849

fbshipit-source-id: b5235b952faea2e42fb4292fac4ca409e22ecb56
2017-04-17 15:00:44 -07:00
Aaron Chiu 9c44630866 make mReactChoreographer final in Timing.java
Reviewed By: achen1

Differential Revision: D4883119

fbshipit-source-id: 1adb57f333742fca9c5e1ece6355ee18881c48a4
2017-04-17 13:30:03 -07:00
Aaron Chiu 1c440dbcae clean up NativeAnimatedModule
Reviewed By: achen1

Differential Revision: D4883111

fbshipit-source-id: 63873d46db8d2736672a6d102e86dabfbf4f4610
2017-04-14 16:31:23 -07:00
Aaron Chiu b9b03435c4 loosen the ReactChoreographer UI thread assert
Reviewed By: achen1

Differential Revision: D4873553

fbshipit-source-id: 7dbf771e744f6b33e6edb3ad4c227c3a63c3e3e3
2017-04-14 02:45:33 -07:00
Aaron Chiu c9826ba4a9 make mHasDispatchScheduledCount in EventDispatcher atomic
Reviewed By: achen1

Differential Revision: D4882881

fbshipit-source-id: ac9a985287bd4720846ecde97ebb4935963c0d9f
2017-04-14 02:15:46 -07:00
Emil Sjolander 2030c78355 Remove references to CSSLayoutDEPRECATED
Reviewed By: marco-cova

Differential Revision: D4859822

fbshipit-source-id: 2588c1b3334f28332ae43e6c0bdec65934ca84c4
2017-04-13 12:52:38 -07:00
Kathy Gray 8e382fd006 Find hasConstant status via preprocessing
Reviewed By: javache

Differential Revision: D4867563

fbshipit-source-id: 66e4505d142fc4776cd727a025005b43d500b167
2017-04-13 05:30:14 -07:00
Aaron Chiu 625b4940ee FLog.w ==> Flog.d
Reviewed By: yungsters

Differential Revision: D4874628

fbshipit-source-id: ae39a7105145f11b749822f3c98db973cfe613eb
2017-04-12 00:42:57 -07:00
Andrew Y. Chen 8290cd7ce2 Fix ARTShape arc
Reviewed By: AaaChiuuu

Differential Revision: D4871406

fbshipit-source-id: 7f777048c6756399b309e34cf3341c4263467b0b
2017-04-11 19:35:09 -07:00
Andrew Y. Chen 6b900dc7fb Fix withCredentials test failure
Reviewed By: AaaChiuuu

Differential Revision: D4870817

fbshipit-source-id: d741eb21d4c7092f89d5a8461b9ec92e3df49120
2017-04-11 18:30:35 -07:00
Andrew Y. Chen 21819f1a99 Add support for async callbacks in ReactFindViewUtil
Reviewed By: AaaChiuuu

Differential Revision: D4841500

fbshipit-source-id: 16620d72bd636ad13085c15c38862e16da6c42d2
2017-04-11 10:45:35 -07:00
Pieter De Baets 3184f314ad Fix NPE in StackTraceHelper
Reviewed By: AaaChiuuu

Differential Revision: D4860056

fbshipit-source-id: 68865d8d8d1c2a678970f10e99d2ae5bc31ea5f8
2017-04-11 04:29:55 -07:00
Adam Comella e544563bd2 BREAKING: Android: Support withCredentials flag in XHRs
Summary:
Corresponding iOS PR: #12275

Respect the withCredentials XMLHttpRequest flag for sending cookies with requests. This can reduce payload sizes where large cookies are set for domains.

This should fix #5347.

This is a breaking change because it alters the default behavior of XHR. Prior to this change, XHR would send cookies by default. After this change, by default, XHR does not send cookies which is consistent with the default behavior of XHR on web for cross-site requests. Developers can restore the previous behavior by passing `true` for XHR's `withCredentials` argument.

**Test plan (required)**

Verified in a test app that XHR works properly when specifying `withCredentials` as `true`, `false`, and `undefined`. Also, my team uses this change in our app.

Adam Comella
Microsoft Corp.
Closes https://github.com/facebook/react-native/pull/12276

Differential Revision: D4673646

Pulled By: ericvicenti

fbshipit-source-id: 924c230c9df72071b3cf9151c3ac201905ac28a5
2017-04-10 22:46:12 -07:00
Kathy Gray 78ab4ee893 Delay module creation on call for constants when module has none
Reviewed By: AaaChiuuu

Differential Revision: D4810252

fbshipit-source-id: b2b98c3a8355dbb5775f254f25304a21f0bfee5b
2017-04-10 03:16:36 -07:00
Kathy Gray 678679e009 Separate findMethods from BaseJavaModule
Reviewed By: javache

Differential Revision: D4795087

fbshipit-source-id: 6d135a409d463940a5a0aabbc85682ed61420ae3
2017-04-10 03:16:36 -07:00
Faraz Sherwani 8591d8ae71 Webview disable save form prop
Summary:
Adds functionality to be able to disable saving of form data and thereby disabling autocomplete in webview on Android. Can be used as a workaround for #13241

Manual testing that autocomplete is disabled when the property is set to true, and still enabled when it is unset or set to false.
Closes https://github.com/facebook/react-native/pull/13271

Differential Revision: D4858899

Pulled By: ericvicenti

fbshipit-source-id: 62738b0685e4c1958c8a32e184fa2fe4f711b336
2017-04-09 21:45:45 -07:00
Andrew Y. Chen 909af08f24 Add a nativeID prop to allow native code to reference react managed views
Reviewed By: sahrens

Differential Revision: D4786713

fbshipit-source-id: af9cef0737c010b429d52d00181c00bd81f13f5b
2017-04-07 12:00:40 -07:00
Benjamin Jaeger e154117f37 Add proguard rules to bridge BUCK
Summary:
prevents reflected classes from being stripped/obfuscated
Depends on D4830910

Reviewed By: mhorowitz

Differential Revision: D4835688

fbshipit-source-id: 5b85668f92ed4ae5cebc9902ec60f6d5d6299bd4
2017-04-07 11:46:12 -07:00
Andrew Y. Chen b5327dd388 Set the enabled state on disabled button views
Reviewed By: AaaChiuuu

Differential Revision: D4722513

fbshipit-source-id: f4a4e6304594235b5da4e5be36358331e43bdbee
2017-04-06 21:32:05 -07:00
Martin Kralik 5f37483466 Revert D4840716: Refactor interfaces
Differential Revision: D4840716

fbshipit-source-id: 1b6a6050d78ccbbd3c817621df1c1c989594fdb1
2017-04-06 06:03:10 -07:00
Theo Yaung fd99330b6c Refactor interfaces
Reviewed By: johnislarry

Differential Revision: D4840716

fbshipit-source-id: 1a82437c81ce5b767efd39ab0716998bab4f5363
2017-04-06 00:04:06 -07:00
Andrew Y. Chen 3bf367cbb7 Use tag ids for testID
Summary: View tags are currently used for end-to-end test IDs. We'd like to overload the tag field with other information such as nativeID (for native refs) and transitionID (for shared element transitions) in the future. Added a key for testID's tag

Reviewed By: AaaChiuuu

Differential Revision: D4833045

fbshipit-source-id: c2f9371c9a3dbb2411e114f4f096f723ac3132c0
2017-04-05 12:39:29 -07:00
Janic Duplessis 9a51fa8e15 Improve z-index implementation on Android
Summary:
Use `getChildDrawingOrder` instead of reordering views. The old implementation didn't work properly when `removeClippedSubviews` was enabled and this one should have better performance since we don't play with the view hierarchy at all.

This fixes weird bugs with sticky headers in `SectionList` and allows removing the hack that disabled `removeClippedSubviews` when using sticky section headers.

**Test plan**
Tested using the SectionList and ListViewPaging examples that use sticky headers which uses z-index.
Closes https://github.com/facebook/react-native/pull/13105

Reviewed By: sahrens

Differential Revision: D4765869

Pulled By: achen1

fbshipit-source-id: be3c824658a3ce965b6e7324ad95c77cbd8a86ae
2017-04-05 09:17:46 -07:00
Marc Horowitz af533ac7f1 Remove the dependency of I18nManagerModule on ReactApplicationContext
Reviewed By: javache

Differential Revision: D4809492

fbshipit-source-id: 775c6b95aab734568ea4750804477c04d13502b6
2017-04-05 01:07:48 -07:00
Marc Horowitz a893d0bb23 Refactor CxxModuleWrapper to support different use cases
Reviewed By: javache

Differential Revision: D4807680

fbshipit-source-id: 48eccfb382814a0c4082f56617e0359e61345da7
2017-04-05 01:07:48 -07:00
Andrew Y. Chen 0ec9c93eeb Add comment about adding new resource directories
Reviewed By: ericvicenti

Differential Revision: D4833151

fbshipit-source-id: 64ad77e7c4d277f19d1c545dc1d75ab870ddd49e
2017-04-04 23:00:26 -07:00
daose 2b0282aa69 #11587 invoke error for getCurrentLocation
Summary:
It started with https://github.com/facebook/react-native/issues/11587, which reported that the error returned by `getCurrentLocation` did not match the spec.

This resulted in PR https://github.com/facebook/react-native/pull/11723, which did not get merged because it was said by ide and mkonicek that simply emitting the error will cause it to hang since the `error` callback was never invoked.

However, it seems like somewhere along the way PR https://github.com/facebook/react-native/pull/13140 got merged in which did exactly that.

Since it now matches the spec, turning off location services on Android then running the below example code from [Geolocation](https://developer.mozilla.org/en-US/docs/Web/API/Geolocation/getCurrentPosition) docs errors out correctly.

```javascript
var options = {
  enableHighAccuracy: true,
  timeout: 5000,
  maximumAge: 0
};

function success(pos) {
  var crd = pos.coords;

  console.log('Your current po
Closes https://github.com/facebook/react-native/pull/13306

Differential Revision: D4833377

Pulled By: ericvicenti

fbshipit-source-id: dbea5948790a3f521751a0cc0a25f0e323b30667
2017-04-04 22:18:58 -07:00
Andrew Y. Chen eb300b60f3 Revert D4770368: [rn] Use tag ids for testID
Differential Revision: D4770368

fbshipit-source-id: 4bf8131a2a2974c8db072f62e8fb26686faa100d
2017-04-04 15:09:51 -07:00
Aaron Chiu c0b64ce519 use Log.d instead of Log.w in CatalystInstanceImpl.java
Reviewed By: achen1

Differential Revision: D4829620

fbshipit-source-id: d3648b7b9afdaec30790995e59abe23805fb6b1e
2017-04-04 14:56:29 -07:00
Aaron Chiu f8e583b2d0 clean out the last used bitmap
Reviewed By: achen1

Differential Revision: D4828134

fbshipit-source-id: bf54f7c9f61016cc0735338f99de7b0378c1234b
2017-04-04 12:46:43 -07:00
Andrew Y. Chen 77c19ccf73 Use tag ids for testID
Summary: View tags are currently used for end-to-end test IDs. We'd like to overload the tag field with other information such as nativeID (for native refs) and transitionID (for shared element transitions) in the future. Added a key for testID's tag

Reviewed By: AaaChiuuu

Differential Revision: D4770368

fbshipit-source-id: b76c53a20520aac1b25d435b6d5eb809e8833675
2017-04-04 12:33:30 -07:00
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