Commit Graph

2171 Commits

Author SHA1 Message Date
Wenjia Ma f954f3d9b6 Add velocity to onScrollEndDrag event
Reviewed By: achen1

Differential Revision: D5330215

fbshipit-source-id: e45a302b325c38294324f4f384a5604355dc05aa
2017-06-27 15:57:00 -07:00
Alex Kring bb832e1238 Akring integration tests fix
Summary:
Fix a bug that allows us to run integration tests in our android project, where RN is specified as a module to our project.

sdkHandler does not exist. The android documentation suggests that we should be using android.ndkDirectory instead.

http://tools.android.com/tech-docs/new-build-system/migrating-to-1-0-0

An alternative solution would be to set the environment variable ANDROID_NDK, but we do not want to rely on setting this environemnt variable at a system wide level.

We ran two tests.
1.) perform a gradle sync from within our Android studio project, and verify there is no error output.
2.) build android using ./gradleW, from command land. Verify there are no build errors.
Closes https://github.com/facebook/react-native/pull/14136

Differential Revision: D5327421

Pulled By: shergin

fbshipit-source-id: d9e18519a8ca318f2026eb409b90cb09e2adbda1
2017-06-26 21:01:17 -07:00
Pieter De Baets 83faa4b608 Simplify Catalyst handleMemoryPressure
Reviewed By: cwdick

Differential Revision: D5200555

fbshipit-source-id: 86f12acca33ece265d3482ba52de9afcc83173cd
2017-06-26 06:01:14 -07:00
Andrew Y. Chen 076eaec805 Revert D5238126: Add velocity to onScrollEndDrag event
Differential Revision: D5238126

fbshipit-source-id: a8b5f9445fa15a0ef0851303961dbf63b5d46623
2017-06-23 19:02:27 -07:00
Pieter De Baets e2628f93b5 Rename Executor to JSExecutor
Summary:
* Cleanup some header files so we use more forward declarations
* Rename Executor to JSExecutor.h
* Move some typedefs to more appropriate locations

Reviewed By: mhorowitz

Differential Revision: D5301913

fbshipit-source-id: e75154797eb3f531d2f42a5e95409f4062b85f91
2017-06-23 17:01:25 -07:00
Wenjia Ma d4cda7168f Add velocity to onScrollEndDrag event
Summary:
1. Calculated the fling slow down velocity using OnScrollDispatchHelper
2. Calculated the END_DRAG velocity using velocity tracker in VelocityHelper.
3. Change the interface of ReactScrollViewHelper to pass velocity on x & y.

Pending future work:
Calculate the velocity of BEGIN_DRAG, MOMENTUM_BEGIN and MOMENTUM_END
Add threshold in ScrollResponder.js instead of checking x & y velocity equal zero

Reviewed By: achen1

Differential Revision: D5238126

fbshipit-source-id: 35fb70dda8ab66cd152413cb9c1c041354f1c061
2017-06-23 14:00:57 -07:00
Andrew Y. Chen ecccd06662 API check for removeOnGlobalLayoutListener in ReactRootView
Reviewed By: AaaChiuuu

Differential Revision: D5308604

fbshipit-source-id: adf4abbdd59e54c18fcae946f2f7e3af89e7190c
2017-06-23 10:37:59 -07:00
Nick Eddy a6607968c4 Fixing drawing bug in ReactArt on Android
Summary: This change fixes rendering issues with arcs having an inner radius.  The root cause was a bug that lost the negative sign for counter-clockwise angles.  The previous code also incorrectly set the start angle to the end angle.

Differential Revision: D5298320

fbshipit-source-id: 4d11edfed5bdab0cf68313d22f94ef0e3711a1a8
2017-06-23 09:30:37 -07:00
Kathy Gray 2b89416ac0 Only load core modules once
Reviewed By: javache, AaaChiuuu

Differential Revision: D5303176

fbshipit-source-id: f00ecacaa695ce7a4f8b57c66cee38bb70883cae
2017-06-22 11:55:19 -07:00
Pieter De Baets d795fa1b2c Update native references to JSTimers
Reviewed By: AaaChiuuu

Differential Revision: D5294997

fbshipit-source-id: 3003d56f744af0c35b1ffef7bdd71617d4f948c3
2017-06-22 09:52:33 -07:00
Kathy Gray 4566f01fbd Fix package order on reactinstancemanager
Reviewed By: alexeylang

Differential Revision: D5296348

fbshipit-source-id: bfd859085758f1f78a927b2ad4464ed9aff82c58
2017-06-21 16:30:38 -07:00
Kathy Gray 5c5410459e Setting bridge up for sharing: allowing native modules to register after init
Reviewed By: javache

Differential Revision: D4945784

fbshipit-source-id: 80e7236e9ccd5d5c9a7fba7c96b98fc38b43a2fc
2017-06-21 12:08:45 -07:00
Nurzhan Bakibayev 1ae54b5108 Separate port constant for inspector proxy server.
Reviewed By: johnislarry

Differential Revision: D5282980

fbshipit-source-id: e714965e2bb4849e24138d326c757352b238aba6
2017-06-21 08:01:44 -07:00
Yu Wang 01adc71ade add cmd+opt+ctrl+D to globally invoke dev menu for Android
Reviewed By: frantic

Differential Revision: D5280788

fbshipit-source-id: ce11d122ee17a2ba8d8aa2e91fc6639610791577
2017-06-20 17:01:46 -07:00
Andrew Y. Chen 3c4057cbb4 Revert D5172643: [ReactImageView] Remove useless code from ReactImageView.RoundedCornerPostprocessor
Differential Revision: D5172643

fbshipit-source-id: d8d27586d81479c950fe3dd49b24ad5ee29861fc
2017-06-19 14:46:49 -07:00
Andrew Y. Chen e82ceb24eb Fix dev loading indicator
Reviewed By: AaaChiuuu

Differential Revision: D5277176

fbshipit-source-id: 04a8af068310490957e8bc1e690e2cdb927e4dff
2017-06-19 13:16:19 -07:00
Andrew Y. Chen 56969d51fa Don't crash if Window permission isn't granted for dev loading view
Reviewed By: AaaChiuuu

Differential Revision: D5263844

fbshipit-source-id: bf10375ddc43158ce77e09682605068e28f690ef
2017-06-19 08:22:23 -07:00
Pascal Hartig 2cc1195035 Fix license headers
Reviewed By: IanChilds

Differential Revision: D5255424

fbshipit-source-id: 23439ac035f74f2fd1c756b8185e39199e748e33
2017-06-15 07:45:46 -07:00
Aaron Chiu e48ad9609c tag INITIALIZE_MODULE marker with the non-zero instance key
Reviewed By: javache

Differential Revision: D5255044

fbshipit-source-id: 9bd72970488cfba4271562e83416f6515b9e77b3
2017-06-15 02:50:37 -07:00
Pieter De Baets 559805d0b0 Remove SetBuilder
Reviewed By: AaaChiuuu

Differential Revision: D5237184

fbshipit-source-id: dde09febd0d4a5a42a62c7c6fbda3e6713d26152
2017-06-14 16:48:26 -07:00
Aaron Chiu 7464d5e1a2 use .contains
Reviewed By: achen1

Differential Revision: D5242469

fbshipit-source-id: d666b1264e6e40bb2649ab91bc63ecb6decb1532
2017-06-14 16:31:10 -07:00
Pieter De Baets 534bbfac8f Report Java stack from errors from sync native module calls
Reviewed By: mhorowitz

Differential Revision: D5069794

fbshipit-source-id: ede314034a2eb6b063a22dbd6e5d13c8ad66e20c
2017-06-14 09:32:37 -07:00
Pieter De Baets ce6fb337a1 Breaking - remove unused registration of JS modules
Summary: It's now unnecessary to declare which JS modules you want to expose on your package. To upgrade, remove all overrides of `createJSModules` and keeping calling your JS modules as before.

Reviewed By: AaaChiuuu

Differential Revision: D5229259

fbshipit-source-id: 1160826c951433722f1fe0421c1200883ba1a348
2017-06-14 03:52:17 -07:00
Pieter De Baets 53d5504f40 Stop requiring registration of callable JS modules
Reviewed By: AaaChiuuu

Differential Revision: D5229073

fbshipit-source-id: d6d1967982ae379733a7e9667515ca9f074aadd4
2017-06-13 05:46:31 -07:00
Xin Lux Liu 947d77dab5 Revert D5176953: [rn] Remove DialogWhenLarge style from devsupport
Differential Revision: D5176953

fbshipit-source-id: 9e43fc71841dcd0edb43ed9de407bab9bb759f3a
2017-06-11 18:34:29 -07:00
Andrew Y. Chen ac19ddeea8 Revert D5176953: [rn] Remove DialogWhenLarge style from devsupport
Differential Revision: D5176953

fbshipit-source-id: 130e4180de02d4ad14a9c4c5d7a672741b8f40b7
2017-06-11 17:32:18 -07:00
Owen Auch e8df8d9fd5 Corrected spelling of the word "properties" in error message in ReactAndroid/build.gradle
Summary:
The misspelling in the error message bothered me.

N/A
Closes https://github.com/facebook/react-native/pull/14425

Differential Revision: D5225388

Pulled By: shergin

fbshipit-source-id: b20f31f0685099ae1d1c3dd2de74dfb33eadfd6e
2017-06-11 00:15:40 -07:00
Aaron Chiu a1321aedd7 add a bunch of debug log statements
Reviewed By: achen1

Differential Revision: D5216191

fbshipit-source-id: 8e8e05d4bcd8b2112fbd15b3809946f1caa0edbe
2017-06-09 15:49:57 -07:00
Ben Nham 2984628357 add marker surrounding entire native module creation
Reviewed By: javache

Differential Revision: D5200856

fbshipit-source-id: 35b0e627224d518126a1cfdd36d6af264dd186cf
2017-06-09 06:22:39 -07:00
Ben Nham 80bc07fd60 add support for multiple bridge listeners
Reviewed By: AaaChiuuu

Differential Revision: D5200830

fbshipit-source-id: 2a12267edddd2558146721e02a0b80d649755050
2017-06-09 06:22:39 -07:00
Aaron Chiu c639a1f802 fix dev reloading
Reviewed By: achen1

Differential Revision: D5187906

fbshipit-source-id: 8c35ee0747bdc0f6748ecdca54e223eafe37e105
2017-06-08 19:31:21 -07:00
Pieter De Baets a9e8b7bca5 Remove unused package_js.py
Reviewed By: AaaChiuuu

Differential Revision: D5200573

fbshipit-source-id: 5bc5cc66d3ce979a6ca2db9241e1de4eab45f234
2017-06-08 03:45:41 -07:00
Aaron Chiu f978109281 Ingore two other test of similar nature (and failure)
Reviewed By: javache

Differential Revision: D5208387

fbshipit-source-id: b32412c1591b2e3e461a3c2a3f99beb9ca7cd552
2017-06-08 02:30:03 -07:00
Pieter De Baets 81c2f3b189 Cleanup Platform
Reviewed By: dcaspi

Differential Revision: D5185504

fbshipit-source-id: 4f7e9f9068598418b346a7370f6be241a0784b60
2017-06-07 10:19:01 -07:00
Aaron Chiu ce52f404f2 remove some markers
Reviewed By: fkgozali

Differential Revision: D5196382

fbshipit-source-id: b12b56a7f7d1c4309ebcb61e840cc570d87acf3b
2017-06-06 20:45:33 -07:00
Andrew Y. Chen 37d4fd3ab6 Remove DialogWhenLarge style from devsupport
Reviewed By: AaaChiuuu

Differential Revision: D5176953

fbshipit-source-id: 52f426a0fbcdb07e1d250215342dceaeb6040261
2017-06-06 14:46:22 -07:00
Aaron Chiu 2dfcde4c7b Ignore CatalystNativeJSToJavaParametersTestCase for now
Reviewed By: javache

Differential Revision: D5189336

fbshipit-source-id: a9d9e6ff17bf85af5e0e6146b13e2f96022435ba
2017-06-06 13:17:32 -07:00
Michał Gregorczyk 46b3a89a70 Stop SystraceMessage markers with SystraceMessage.endSection
Reviewed By: javache

Differential Revision: D5182628

fbshipit-source-id: f5112a434cb7564410b0e2e69840e45a0777a184
2017-06-06 11:20:47 -07:00
Pieter De Baets 964c3a1b7a Don't include JNI dep in OSS build
Summary:
When circle is using Buck, it uses prebuilt native libraries. I added this dependency internally to avoid callers having to depend on it explicitly but it looks like that broken open-source.
Closes https://github.com/facebook/react-native/pull/14343

Differential Revision: D5191531

Pulled By: javache

fbshipit-source-id: 5397026daac085694b3320bf6d3e7b3f5d680691
2017-06-06 10:34:23 -07:00
Kathy Gray 3c89bafad5 Reducing lock contention in module creation
Reviewed By: javache

Differential Revision: D5147499

fbshipit-source-id: b420cc67ee97fd8cf4bb390098465f968478509f
2017-06-06 09:02:12 -07:00
Michał Gregorczyk e55583e59f Fix oss build
Reviewed By: javache

Differential Revision: D5189534

fbshipit-source-id: 6096754e3caaa88a3283b3773723fac154cf989d
2017-06-06 08:30:50 -07:00
Ognjen Dragoljevic e0bdb7cbcf Remove useless code from ReactImageView.RoundedCornerPostprocessor
Reviewed By: achen1

Differential Revision: D5172643

fbshipit-source-id: c2d89bdfde2c4f4ef51bf3f529fa58112fb65a2d
2017-06-06 05:15:51 -07:00
Summer Kitahara aeccbd6906 Updating shake handling for Android in ShakeDetector and DevSupportManagerImpl
Summary: If you use a ShakeDetector, you can specify the minimum number of shakes required to trigger a shake handler.  Otherwise, the minimum number of required shakes is set to 1 by default.

Reviewed By: achen1

Differential Revision: D5155604

fbshipit-source-id: 5073fa37d4c223eb18e85b5e850b95d37136e3d2
2017-06-05 21:35:33 -07:00
Aaron Chiu e9e2de0ca2 properly clean up ReactAppTestActivity
Reviewed By: achen1

Differential Revision: D5183260

fbshipit-source-id: 263a289ff2332b39693830f77e705544e10b18ff
2017-06-05 13:15:54 -07:00
Aaron Chiu 37536e93b7 properly clean up RN
Reviewed By: javache

Differential Revision: D5170608

fbshipit-source-id: 065cf4ba4244c26bf5fdf9f5183a6bb1295676ad
2017-06-02 23:47:37 -07:00
Aaron Chiu 888a1e63d5 remove unused var
Reviewed By: shergin

Differential Revision: D5175318

fbshipit-source-id: 61d75bb386918e297f26d8772a5463c257a1590a
2017-06-02 14:32:00 -07:00
Michał Gregorczyk 20217873d4 Prepare RN libs for so merging
Reviewed By: javache

Differential Revision: D5150741

fbshipit-source-id: 06e64ee1c4784e64307ef7a40003867ca0c8a8e2
2017-06-02 14:19:57 -07:00
xiaenlong 70b3f2aa7f Fix `InspectorPackagerConnection` creates too many Threads when WebSo…
Summary:
Thanks for submitting a PR! Please read these instructions carefully:

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

InspectorPackagerConnection now creates a new OkHttpClient when previous connection fails. If the failures occur frequently, many Threads are created in `WebSocketCall.enqueue()`. On my Pixel phone, I have seen up to 260 Threads named "OkHttp ConnectionPool" alive at the same time. So, why don't we consider reusing the existing OkHttpClient instance ?

N/A

Sign the [CLA][2], if you haven't already.

Small pull requests are much easier to review and more likely to get merged. Make sure the PR does only one thing, otherwise please split it.

Make sure all **tests pass** on both [Travis][3] and [Circle CI][4]. PRs that break tests are unlikely to be merged.

For more info, see the ["Pull Requests"][5] section of our "Contributing" guidelines.

[1]: https://medium.com/martinkonicek/what-is-a-test-plan-8bfc840ec171#.y9lcuqqi9
[2]: https://code.facebook.com/cla
[3]: https://travis-ci.org/facebook/react-native
[4]: http://circleci.com/gh/facebook/react-native
[5]: https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md#pull-requests
Closes https://github.com/facebook/react-native/pull/14301

Differential Revision: D5172277

Pulled By: javache

fbshipit-source-id: 7d417fa0675eb627f0b1ca41847b75686c8d1f3e
2017-06-02 09:16:41 -07:00
Pieter De Baets 79500f81a9 Fix Travis CI runs
Summary: Closes https://github.com/facebook/react-native/pull/14286

Differential Revision: D5164925

Pulled By: javache

fbshipit-source-id: 0ebe028ab58f37a9afc8b615fe346d7af9180040
2017-06-02 09:03:18 -07:00
Pieter De Baets 53169b0de3 Minimize time holding lock in UIViewOperationQueue
Reviewed By: AaaChiuuu

Differential Revision: D5154725

fbshipit-source-id: 06a113c4235ee63030f240f43a83aac074a23909
2017-06-02 08:31:00 -07:00
Aaron Chiu c57d7eaf43 remove unused file
Reviewed By: fkgozali

Differential Revision: D5168258

fbshipit-source-id: 2535aa5592d5cf49e94fd6999e8121ef97e42d39
2017-06-02 08:17:06 -07:00
Pieter De Baets 220ff2321a Avoid calls to ReactBridge.staticInit being stripped
Reviewed By: michalgr

Differential Revision: D5166720

fbshipit-source-id: 15ce78b2bbafa9506e9023d7d931092ebd963eea
2017-06-01 13:47:40 -07:00
Pieter De Baets bd5051adeb Move xreact/jni to react/jni
Reviewed By: mhorowitz

Differential Revision: D5155612

fbshipit-source-id: 871a23916c0069498691dc0dd3c94fd2e404cec9
2017-06-01 05:53:25 -07:00
Aaron Chiu 8394f9b553 add Systrace to render logic
Reviewed By: achen1

Differential Revision: D5153246

fbshipit-source-id: 4f6f6c7117734552682995fc74a3a926a63feb28
2017-05-31 21:47:04 -07:00
Seth Kirby 5db26380dd Avoid using path for normal border cases
Reviewed By: ahmedre

Differential Revision: D5111224

fbshipit-source-id: c188f83339ed011272f80b4fac35f47f8d72d30b
2017-05-31 15:52:26 -07:00
Seth Kirby 2143df8cb6 Minor refactor and fix before changes
Reviewed By: ahmedre

Differential Revision: D5111225

fbshipit-source-id: 466272026224b67d6291a295efad9e3def35e0e9
2017-05-31 15:52:26 -07:00
Seth Kirby 02856938ea Avoid using path for normal border cases
Reviewed By: achen1

Differential Revision: D5111223

fbshipit-source-id: d85da53a9409efc2edb1ca6ecb040a30a35266b8
2017-05-31 15:52:26 -07:00
xiatian c2eb9f4689 Update CatalystInstanceImpl.java
Summary:
This change is very simple, fix a wrong spelling.
Closes https://github.com/facebook/react-native/pull/14268

Differential Revision: D5153788

Pulled By: javache

fbshipit-source-id: a163e1032661f54a802b3bfcbdf802a80b88545d
2017-05-31 02:46:24 -07:00
Aaron Chiu 8125ce520d don't block attaching ReactRootView on measuring
Reviewed By: achen1

Differential Revision: D5117394

fbshipit-source-id: 00f65a59247a75d4b42240fe25935aa9bd8948b1
2017-05-31 02:25:31 -07:00
Jonas Lundberg adaf2bf277 Android: Make lineHeight accept decimal values
Summary:
Make android-version accept a decimal
number as lineHeight.

Credits where due, solution was given in this
issue: facebook/react-native#10607

According to the w3 spec the property
line-height should accept decimal values
(and it does on iOS) but the android
version has the wrong data-type for the
shadowed method, resulting in a stacktrace
saying:
com.facebook.react.bridge.UnexpectedNativeTypeException: TypeError:
expected dynamic type `int64', but had type `double'

Setting it to a float makes it accept
decmial values as it should.

* Create an app without this commit and create the same app with this commit:
In both apps:
- Leave line-height undefined. Behavior is unaffected by this commit.
- Set lineHeight to a integer number. Behavior is unaffected by this commit.
- Set lineHeight to a decimal number. Line height is now rendered with decimals in the app with this fix.

* Run android integration tests to see nothing
  else broke.

Sign the [CLA][2], if you haven't already.

Small pull requests are much easier to review and more likely to get merged. Make sure the PR does only one thing, otherwise please split it.

Make sure all **tests pass** on both [Travis][3] and [Circle CI][4]. PRs that break tests are unlikely to be merged.

For more info, see the ["Pull Requests"][5] section of our "Contributing" guidelines.

[1]: https://medium.com/martinkonicek/what-is-a-test-plan-8bfc840ec171#.y9lcuqqi9
[2]: https://code.facebook.com/cla
[3]: https://travis-ci.org/facebook/react-native
[4]: http://circleci.com/gh/facebook/react-native
[5]: https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md#pull-requests
Closes https://github.com/facebook/react-native/pull/13843

Differential Revision: D5152982

Pulled By: shergin

fbshipit-source-id: cda3b72497a6c27d6948b31ec846640a8913775a
2017-05-30 19:01:34 -07:00
Pieter De Baets f0e4a6cd2c Add missing Java files to RN fbjni sync
Reviewed By: mhorowitz

Differential Revision: D5129224

fbshipit-source-id: d9fb5f95505f6be7d3d87ead67dbfaa951c03434
2017-05-30 03:19:04 -07:00
Saleel Salam 7807247905 Add 'thirdPartyCookiesEnabled' prop on WebView to enable third party …
Summary:
…cookies on Android Lollipop or later versions.

Third party cookies in WebView are [disabled by default](https://developer.android.com/reference/android/webkit/CookieManager.html#setAcceptFileSchemeCookies(boolean)) on Android Lollipop or later versions. This prevented users from logging in by using _Login by Facebook_ method (in redirect mode) in Android Webview.

This PR exposes a prop `thirdPartyCookiesEnabled` which will enable third party cookies in Android Webview. This setting is ignored on versions below Android Lollipop and on iOS as third party cookies are enabled in them by default.

Appropriate documentation was added in code and they were reflected in the website.
Closes https://github.com/facebook/react-native/pull/14013

Differential Revision: D5145059

Pulled By: shergin

fbshipit-source-id: 67bcb3a497a9c6f6db1d12e8d16197d2facd157e
2017-05-28 21:30:20 -07:00
Valentin Shergin bac84ce207 BREAKING: Better TextInput: `contentSize` property was removed from `<TextInput>.onChange` event (Second attempt)
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: D4989881

fbshipit-source-id: 674bb98c89ada1fca7b3b20b304736b2a3b8304e
2017-05-28 20:16:04 -07:00
Emil Sjolander 3af9be52b2 Downgrade okhttp in open source
Reviewed By: yungsters

Differential Revision: D5144011

fbshipit-source-id: ef897bf7e03b84e4e60ec6607027666608a460cb
2017-05-27 09:15:20 -07:00
Adam Comella 26ee9b94d4 Android: Allow WebView to handle about:blank
Summary:
On some devices, we saw many Chrome windows open when the WebView attempted to send the user to about:blank. This change allows the WebView to handle about:blank which prevents the Chrome windows from opening and gives the user a better experience.

Verified that the WebView no longer opens the device's browser when navigating to about:blank. My team has been using this change in our app.

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

Differential Revision: D5142352

Pulled By: hramos

fbshipit-source-id: 1070d4381b385a5bf1829fd8e97efba2045f7968
2017-05-26 17:00:51 -07:00
Pieter De Baets e9fc7311c4 Cleanup markers in getConstants
Summary:
* Only add the moduleName to the outer marker
* Include module init in the marker time
* Include the WritableNativeArray time in CONVERT_CONSTANTS
* Stop all markers from finally block in case of exception

Reviewed By: kathryngray

Differential Revision: D5031411

fbshipit-source-id: bf86ee3d59f2cb38866afd52e84af5699db1a003
2017-05-26 09:30:36 -07:00
Valentin Shergin 35393524a9 Fixed <TextInput>.onContentSizeChange on Android
Summary:
Previously <TextInput>'s onContentSizeChange event fires very rearly, usually just once after initial layout. This diff fixed that.
I also considered to a bunch of another things to get the native notification, but I found that overriding `onTextChanged` is the most reliable, easy and effitient way to implement this.

I tried/considered:
 * onLayout (does not fire)
 * OnPreDrawListener (fires to often)
 * OnGlobalLayoutListener (does not fire)
 * OnLayoutChangeListener (does not fire)
 * isLayoutRequested (too hacky)

(I also fixed the <AutoExpandingTextInput> demo to illustrate the fix.)

And just heads up, we will remove `contentSize` info from `onChange` event very soon.

GH issue: https://github.com/facebook/react-native/issues/11692

Reviewed By: achen1

Differential Revision: D5132589

fbshipit-source-id: e7edbd8dc5ae891a6f4a87b51d9450b8c6ce4a1e
2017-05-25 19:31:31 -07:00
Andrew Y. Chen 864c9f5248 Revert D5080735: [rn] Fix copy paste second attempt
Differential Revision: D5080735

fbshipit-source-id: 1783dddcf467c0103007db35643dc42bf8c526f4
2017-05-25 18:49:10 -07:00
Adam Comella e9ae31dfd6 Android: Fix memory leak in AccessibilityInfoModule
Summary:
This change fixes a memory leak in `AccessibilityInfoModule`.

Our tooling detected this memory leak. After this commit, we no longer see the leak in the tool. We've been using the change in our app.

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

Differential Revision: D5128845

Pulled By: javache

fbshipit-source-id: b604902188eb8cc029b1ad39d087e199ae26877c
2017-05-25 03:01:31 -07:00
yk3372 9dc0385405 fix memory leak
Summary:
Signed-off-by: yk3372 <yk3372@gmail.com>

What existing problem does the pull request solve?

ViewManagersPropertyCache, ViewManagerPropertyUpdater static field not release when ReactInstanceManager called destroy.

I use this url to integrate RN:
[http://facebook.github.io/react-native/docs/integration-with-existing-apps.html](http://facebook.github.io/react-native/docs/integration-with-existing-apps.html)
and in Activity's onDestroy function add the follow code to release RN:
```java
mReactInstanceManager.destroy();
mReactInstanceManager = null;
```
and then when I exit activity, find the static field not release.
the follow is screen shot:
before:
![2017-05-23 17 41 16](https://cloud.githubusercontent.com/assets/1514899/26350318/53ea250c-3fe5-11e7-8eda-a0dcc20ba4f6.jpg)
after:
![2017-05-23 17 38 49](https://cloud.githubusercontent.com/assets/1514899/26350329/5e5b273e-3fe5-11e7-9b0b-a8b0e044abf3.jpg)
Closes https://github.com/facebook/react-native/pull/14172

Differential Revision: D5128834

Pulled By: javache

fbshipit-source-id: 657763fa21fd8826b4060f9a17e7f35f0e1e04d3
2017-05-25 03:01:31 -07:00
Daniel Cestari fe229f8104 Move to{HashMap,ArrayList} up to Readable{Map,Array}
Summary:
NativeReadable{Map,Array} classes have convenient to{HashMap,ArrayList}
methods that make it easier to interoperate with existing Java code
from within a ReactNative application (e.g., Native Module) ...

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.

NativeReadable{Map,Array} classes have convenient to{HashMap,ArrayList}
methods that make it easier to interoperate with existing Java code
from within a ReactNative application (e.g., Native Module)

These changes make these same methods available to any code using
the Readable{Map,Array} interfaces, instead of forcing consumers to
cast their generic instances into the NativeReadable* equivalents

Moving this methods up to the interfaces also makes it easier to
write unit tests for Native Modules - using the JavaOnly{Map,Array}
implementations of Readable{Map,Array} - while still relying on the
to{HashMap,ArrayList} methods

* Write a native module that receives a JSON object as `ReadableMap` and a JSON array `ReadableArray`.
* Print out the result of `toHashMap` and `toArrayList`.
* Make sure `NativeReadable{Map,Array}` works:
  * Call the native module's method from JavaScript, passing an `Object` and an `Array`.
  * Compare the printed values with the passed content.
* Make sure `JavaOnly{Map,Array}` works:
  * Call the native module's method from the Java code and pass a `JavaOnlyMap` and a `JavaOnlyArray`.
  * Compare the printed values with the passed content.

**Please advise if there is an automated test suite where I could add a case for this.**
Closes https://github.com/facebook/react-native/pull/14072

Differential Revision: D5123120

Pulled By: javache

fbshipit-source-id: 343f4396b99e03ecaf47993db6955d7932152f77
2017-05-24 13:01:00 -07:00
Pieter De Baets 275ba316c3 Remove unused MessageQueueThreadRegistry
Reviewed By: astreet

Differential Revision: D5111966

fbshipit-source-id: 2d96c0fe0bb8f7e5c88e200dc09feee265c24890
2017-05-24 10:16:32 -07:00
Emil Sjolander e656adcaa8 Parse YogaValue from string. inverse of toString()
Reviewed By: kittens

Differential Revision: D5120456

fbshipit-source-id: 6ac7cff2a040778e63a953070e1bd7e768fedaa7
2017-05-24 08:06:09 -07:00
Kathy Gray f46eaa30cf Provide sync vs async interface for bundle loading via parameter
Reviewed By: javache

Differential Revision: D5104317

fbshipit-source-id: ffacb57d85c24795a3acc2faba2ff5824cc739b2
2017-05-24 07:31:36 -07:00
James Pearce 692fb94a6e Rogue apostrophe
Summary:
English :)
Closes https://github.com/facebook/react-native/pull/14138

Differential Revision: D5114337

Pulled By: javache

fbshipit-source-id: 73cfc4d3b31b4a86ac6fec0293a4f1246c911414
2017-05-24 02:45:27 -07:00
Swordsman-Inaction 663df57c62 Add viewIsDescendantOf for UIManager on Android
Summary:
Add the ability for UIManager to check if a node is an ancestor of anther one on Android like #7876 did on iOS
Closes https://github.com/facebook/react-native/pull/13129

Differential Revision: D4938319

Pulled By: hramos

fbshipit-source-id: abe20779be2142a1ea9ac46f52d8cd8609236419
2017-05-23 11:04:27 -07:00
Adam Ernst 0ee8786cd8 Handle [native code] stack frames
Reviewed By: ashwinb, javache

Differential Revision: D5104078

fbshipit-source-id: edefc7cb7e1d401155372c917875ad8b14af94e9
2017-05-22 15:47:32 -07:00
Kevin Gozali 3d3f74dc72 move @ReactMethod to the codegen'ed class so impl class don't need it anymore
Reviewed By: javache

Differential Revision: D5074121

fbshipit-source-id: 1b23a5d26ffe27c5093677ae7ecca424b232c8aa
2017-05-22 11:46:07 -07:00
Aaron Chiu 784f89d0c9 fix lint
Reviewed By: javache

Differential Revision: D5103275

fbshipit-source-id: 1df50ecef7b16289eecadde3c193db086eef1fc7
2017-05-22 03:15:41 -07:00
Pieter De Baets 247e8142e3 Remove NativeSoftError from OSS
Reviewed By: amnn

Differential Revision: D5095340

fbshipit-source-id: c4515140843c031490dbce5b297e6544919ac5ab
2017-05-22 02:32:23 -07:00
Aaron Chiu 213ea30346 Don't enqueue another UI operation if we're already on the UI thread
Reviewed By: alexeylang

Differential Revision: D5085488

fbshipit-source-id: 0613c1403a67d63ad06ce2db9950d902f1c6473a
2017-05-20 20:45:34 -07:00
Valentin Shergin f085d2bac0 Fixed small bag in computing contentSize of TextInput
Reviewed By: AaaChiuuu

Differential Revision: D5091491

fbshipit-source-id: ece8ac30b930aafc32a7994057d305025e4b032e
2017-05-19 11:37:27 -07:00
Pieter De Baets 74a70fea97 Add some helper methods to JStackTraceElement
Reviewed By: mhorowitz

Differential Revision: D5069764

fbshipit-source-id: e2073ab824c357b28e00838abc768d402905207d
2017-05-19 04:15:45 -07:00
Pieter De Baets 99f8c5df37 Sync fbjni to React Native
Reviewed By: mhorowitz

Differential Revision: D5086537

fbshipit-source-id: a95863113b3c63530a2550d29dfdc9626be86dc0
2017-05-19 04:15:45 -07:00
Emil Sjolander c6dd3d137b Add missing okio deps
Reviewed By: bestander

Differential Revision: D5094495

fbshipit-source-id: 395d63ff82022c83f58cae8b0005e0ec735ab958
2017-05-19 04:15:45 -07:00
Alexey Lang 523a103108 Make Systrace less noisy in Java
Reviewed By: AaaChiuuu

Differential Revision: D5087152

fbshipit-source-id: 5aa911e834be2ee0d8c5c53ec71e617d02da564f
2017-05-19 02:47:06 -07:00
Alex Kotliarskyi 3f8af2deee Better context for "Calling JS function after bridge has been destroyed" warning
Reviewed By: AaaChiuuu

Differential Revision: D5091701

fbshipit-source-id: 9bf66cf35ffc3ade82a0ee61227760f0946d410d
2017-05-18 17:02:06 -07:00
Greg Herlihy b5eb104617 Fix view collapsing
Summary:
Make more views collapse on Android by designating FLEX_BASIS, FLEX_GROW and FLEX_SHRINK as "layout-only" props.

Relies on existing layout tests.

See Issue #13622
Closes https://github.com/facebook/react-native/pull/13868

Reviewed By: astreet

Differential Revision: D5035864

Pulled By: javache

fbshipit-source-id: d2c9e0b33b07e51b19afc383ef913ac41b70415c
2017-05-18 11:31:52 -07:00
Andrew Y. Chen 6c4e8d74cd Fix copy paste second attempt
Reviewed By: AaaChiuuu

Differential Revision: D5080735

fbshipit-source-id: c76fb204c114b8a8fc884aa208ad5fa9bba01fcb
2017-05-18 09:46:04 -07:00
Emil Sjolander 93a1d592d6 Update okhttp3
Reviewed By: bestander

Differential Revision: D5078004

fbshipit-source-id: 79c66cedeeb682d8bb4e67798b41115899fd1c81
2017-05-18 08:16:02 -07:00
Aaron Chiu 658f632f59 add Systrace to ReactRootView
Reviewed By: alexeylang

Differential Revision: D5085095

fbshipit-source-id: 0ec42ecede72baa5f761c525fe9fd210361181be
2017-05-18 06:51:40 -07:00
David Aurelio d7659a0ec6 Move stack trace formatting in own class
Summary: Moves stack trace formatting logic into its own class to facilitate reusage from custom exception managers.

Reviewed By: javache

Differential Revision: D5086336

fbshipit-source-id: f434a1621c599c5c49991b3bfe5f66d05f84b5c9
2017-05-18 05:32:55 -07:00
Kathy Gray cc16830cfb Clean up package and imports left over from bridge merge
Reviewed By: javache

Differential Revision: D5077810

fbshipit-source-id: 2f569bfc9d0c45d2ca93b6e036efdaec9511633c
2017-05-17 07:46:53 -07:00
Andrew Y. Chen 4a225f79a3 Make ReactShadowNode's toString useful
Reviewed By: AaaChiuuu

Differential Revision: D5054307

fbshipit-source-id: af548077e9efabcdd9d86c3c06f6408a022762b8
2017-05-16 11:16:28 -07:00
Nitin George 06993fb780 Fix - NetInfoModule intialization
Reviewed By: AaaChiuuu

Differential Revision: D5065578

fbshipit-source-id: 618fbd036bbcbdcafe751802380c1047375ccf19
2017-05-16 10:47:14 -07:00
Dmitry Petukhov 36405d13ff Implemented linear gradient fill in Android
Summary:
Partial implementation of "TODO(6352048): Support gradients etc.": linear gradient fill implemented.

We implemented a custom Color Picker based on ReactART.

<img width="268" alt="screen shot 2016-12-19 at 12 27 09 pm" src="https://cloud.githubusercontent.com/assets/18415611/21309512/5033b5a4-c5e7-11e6-9558-5571d18210e9.png">
Closes https://github.com/facebook/react-native/pull/11541

Differential Revision: D5061836

Pulled By: ericvicenti

fbshipit-source-id: ec8b7a0a6f3d2d1a2c1b394d4960d3365ad6fb44
2017-05-16 00:03:08 -07:00
Paco Estevez Garcia 93f07ed31d Inspector crashes with NetworkOnMainThreadException in Android
Reviewed By: johnislarry

Differential Revision: D5062290

fbshipit-source-id: 0307d2d950b6f54c36f882470c3ac4c5cfb1c5b7
2017-05-15 12:18:02 -07:00
Pieter De Baets 0c1e009ad9 Disable SamplingProfiler for OSS builds
Summary:
It depends on symbols that are not available.
Closes https://github.com/facebook/react-native/pull/13950

Reviewed By: cwdick

Differential Revision: D5053724

Pulled By: javache

fbshipit-source-id: 9d5676ce5e4ad3ceeb20aeb8c48429319d48799e
2017-05-15 08:01:56 -07:00
Pieter De Baets 6221053179 Improve systrace markers
Reviewed By: mhorowitz

Differential Revision: D4860135

fbshipit-source-id: ce963010883e6b9cc8e34f7ff01b4018cd195eba
2017-05-12 18:07:49 -07:00
ivmarkov 28748f165b Support custom packager port when debugging on Android
Summary:
This three liner addresses the issue described by Rovack here: #9935

Basically, changing the React Native Packager port from 8081 to, say, 8088 does work, *except* if you want to debug your code with ChromeDevTools (i.e. selecting "Debug JS Remotely" from the Android app dev menu).

The analysis of Rovack, pointing to a hard-coded port in DevServerHelper.getHostForJSProxy() was *spot on* - many thanks to him.
Closes https://github.com/facebook/react-native/pull/12095

Differential Revision: D5044330

Pulled By: mkonicek

fbshipit-source-id: c07f59f700683ffba84f03d44f82b394e2e899c1
2017-05-12 13:31:24 -07:00
Emil Sjolander 54548894d0 Fix flex basis not accounting for max size constraint
Reviewed By: gkassabli

Differential Revision: D5044314

fbshipit-source-id: d9f9db832e4943a57a89c9d162ff6077b709795a
2017-05-12 09:18:56 -07:00
Pieter De Baets 6e2c07534e Fix Circle CI builds
Summary: Closes https://github.com/facebook/react-native/pull/13945

Differential Revision: D5052083

Pulled By: javache

fbshipit-source-id: eeda8253d26c2dfd0d20b93b238377fe92e3ca3c
2017-05-12 08:35:30 -07:00
Emil Sjolander 81b9e108bb Big refactor moving most logic into DebugComponent
Reviewed By: passy

Differential Revision: D5027780

fbshipit-source-id: 95a95b3572747aa2088f8f9b35a160257eb59269
2017-05-12 04:03:30 -07:00
Aaron Chiu c7317c5e61 make the CREATE_MODULE marker actually end
Reviewed By: fkgozali

Differential Revision: D5024378

fbshipit-source-id: 6f25ecd15e25a6d9aabaa52013c2abe24a3f8fb9
2017-05-11 20:00:21 -07:00
Georgiy Kassabli 70b7488f97 Adding node type and moving rounding dependency to rely on that type
Reviewed By: emilsjolander

Differential Revision: D5025107

fbshipit-source-id: a8d66e2f9c5d02ab080784cc474be583a09b92e2
2017-05-11 08:17:58 -07:00
Kathy Gray 8b53a2b29b Merging cxxbridge and bridge packages
Reviewed By: javache

Differential Revision: D5027875

fbshipit-source-id: 47e081069d4219bdb29f63ce8a78c1f31a590da7
2017-05-11 03:50:52 -07:00
Michael Lee 48c27b9a6c Fix gradle build due to renamed boost directory
Reviewed By: yungsters

Differential Revision: D5033507

fbshipit-source-id: 1ab1126e0beb0a72f5a090a7cfeee0d5d99b0d16
2017-05-10 06:03:06 -07:00
Pieter De Baets 567015fa04 Mark ByteBuffer methods as const
Reviewed By: emilsjolander

Differential Revision: D5020648

fbshipit-source-id: 6e60b80cb3d4718bab25dd6ca9627aee862117db
2017-05-10 04:32:54 -07:00
Ben Nham 65f22a5190 log script name with bundle loading perf event
Reviewed By: javache

Differential Revision: D5010638

fbshipit-source-id: 2e139201a8374245fa1dedc4f11a716dcf700fd7
2017-05-10 04:09:19 -07:00
Lukas Piatkowski 5dcfb2c6ad Add SamplingProfilerMethod to CSDevelopmentGlobalStateManager
Reviewed By: cwdick

Differential Revision: D5010523

fbshipit-source-id: ad602dfae039e0cbb7c62d42d75a93d1aa2d3aa4
2017-05-10 04:09:19 -07:00
Lukas Piatkowski 621148d724 Extract bundle download logic from DevServerHelper to BundleDownloader
Reviewed By: cwdick

Differential Revision: D4729058

fbshipit-source-id: 6ffbe4dbd916ac7ac6afffba2cf070aab9cb87b9
2017-05-10 04:09:19 -07:00
Lukas Piatkowski 9468c5a733 Added method handler for Sampling Profiler that uses only JSCcontext and JSC API
Reviewed By: cwdick

Differential Revision: D4689688

fbshipit-source-id: d1f9df0b3dcb21420cf813888c19f2d9a9aa5646
2017-05-10 04:09:19 -07:00
Fred Liu a324dfbd51 Allow Android videos to be shown in the CameraRoll selector
Summary:
Currently, Android camera roll videos cannot be retrieved in RN since

1) `CameraRollManager.java` doesn't do anything with the `assetType` param
2) Unspecifying MIME types doesn't show videos

This diff allows videos to be shown in the `CameraRoll.getPhotos(..)` call by reading `assetType`. Future diffs will come where the thumbnail and other info will be returned as well.

Reviewed By: furdei

Differential Revision: D5019202

fbshipit-source-id: a920273761b31f1a59ba6b8bc49c05852506829c
2017-05-10 03:31:24 -07:00
Aaron Chiu 20c2ae85f0 allow calling NativeViewHierarchyManager.addRootView() off the UI thread
Reviewed By: yungsters, shergin

Differential Revision: D4998706

fbshipit-source-id: f95cdcb0d193ffff2dfe39f9523a222d958ba5c6
2017-05-08 11:31:19 -07:00
Aaron Chiu 82c4b9f0b7 bump up priority of RN threads during startup
Reviewed By: shergin, yungsters

Differential Revision: D5002320

fbshipit-source-id: 8467370940d3742266b3bf319e9a38ae22eab98e
2017-05-08 11:31:19 -07:00
Aaron Chiu 83a58f6c4f assert on UIBackground thread if UIBackground thread is available
Reviewed By: raluca-elena

Differential Revision: D5008046

fbshipit-source-id: 033b9ee76b331f6a4abcf4070e1a3206d7a8a422
2017-05-04 21:49:45 -07:00
Aaron Chiu d353b75c12 log timespan of ATTACH_MEASURED_ROOT_VIEWS
Reviewed By: alexeylang

Differential Revision: D5002268

fbshipit-source-id: 530f5004e5d6f256ee000533599abb8942a76015
2017-05-04 17:48:07 -07:00
Aaron Chiu 857be044cc add more systraces
Reviewed By: alexeylang

Differential Revision: D4998351

fbshipit-source-id: a5c3ad829400b23aec49a2b919ab3fc7fc20c07b
2017-05-04 13:48:40 -07:00
Ben Nham cc3d034460 make ReactMarker initialization one-shot
Reviewed By: AaaChiuuu

Differential Revision: D4996560

fbshipit-source-id: 020a850f72a2b5c2327b904cac3245d39e114508
2017-05-03 15:04:38 -07:00
Lukas Wöhrl 5f2edfcca5 Move YGLogger into YGConfig and associate YGNodeRef with log events
Summary:
Moves the `YGLogger` into `YGConfig` and pass the `YGNodeRef` into the logger to be able to associate the log messages and assertions with the specific node.

Tackles facebook/yoga#530 and facebook/yoga#446
Closes https://github.com/facebook/yoga/pull/531

Reviewed By: astreet

Differential Revision: D4970149

Pulled By: emilsjolander

fbshipit-source-id: b7fcdaa273143ea2fa35861620b2e4d79f04f0af
2017-05-03 09:30:55 -07:00
Aaron Chiu 989eb985b3 measure time spent before RUN_JS_BUNDLE
Reviewed By: alexeylang

Differential Revision: D4989216

fbshipit-source-id: 4996c934931636eadbef97d5c7f51a5907e773fb
2017-05-03 07:08:16 -07:00
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
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
Jonathan Keljo 0a7427f599 Migrate ReactAndroid to use Buck's new java_annotation_processor rule
Reviewed By: asp2insp

Differential Revision: D4654756

fbshipit-source-id: d98d55786d84cf02234699a260e8750305982267
2017-03-14 11:16:13 -07:00
Edwin 8a7eb170dd Adds Animated.loop to Animated API
Summary:
* Any animation can be looped on the javascript thread
* Only basic animations supported natively at this stage, loops run
using the native driver cannot contain animations of type sequence,
parallel, stagger, or loop

Motivation: We need a spinner in our app that is displayed and animated while the javascript thread is tied up with other tasks. This means it needs to be offloaded from the javascript thread, so that it will continue to run while those tasks are churning away.

I originally submitted PR #9513, which has served our needs, but brentvatne pointed out a better way to do it. Had hoped his suggestion would be implemented by janicduplessis or another fb employee, but after 5 months I thought I'd give it another push.

I've put together an implementation that basically matches the suggested API. Let me know what you think, and whether others can pick it up from here and get it in to core.

Personal Motivation: I am leaving my current organisation on Feb 10th, so am trying to clean thing
Closes https://github.com/facebook/react-native/pull/11973

Differential Revision: D4704381

fbshipit-source-id: 42a2cdf5d53a7c0d08f86a58485f7f38739e6cd9
2017-03-14 00:00:08 -07:00