Commit Graph

1906 Commits

Author SHA1 Message Date
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