Граф коммитов

1818 Коммитов

Автор SHA1 Сообщение Дата
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
Üstün Ergenoglu 8ba06cbfb1 Fix wrong modal size in fullscreen
Summary:
Display.getCurrentSizeRange() doesn't include the size of the status
bar, so Modal windows on Android have a gap in the bottom that is the
same size as the status bar. This checks the current theme and adds the
size of status bar to the modal window height if necessary.

**Test plan (required)**

Run a React Native app on Android with a theme that doesn't show status bar and launch a modal dialog. See issue #11872 for an example.
Closes https://github.com/facebook/react-native/pull/11928

Differential Revision: D4695847

fbshipit-source-id: 9fafc2b5040e2f58d562c9cc4cd4d6d87b0df2a3
2017-03-11 17:30:03 -08:00
Aaron Chiu 70e4a58d5b measure conversion of Java Map to WritableNativeMap for each NativeModule
Reviewed By: fkgozali

Differential Revision: D4688690

fbshipit-source-id: 871b3f5ab141d7f63ec15b06e44a2c398603d757
2017-03-10 22:00:48 -08:00
Alexey Lang 434ca242ec Use CLOCK_MONOTONIC instead of CLOCK_MONOTONIC_RAW in performanceNow
Reviewed By: AaaChiuuu

Differential Revision: D4688909

fbshipit-source-id: 30d02ea6af4cce47bcd4fe41bc1f048dccbb3b2b
2017-03-10 10:17:52 -08:00
Theo Yaung acb9fa8f66 Refactor dependencies
Reviewed By: mkonicek

Differential Revision: D4689351

fbshipit-source-id: 35e6939379dcb6723e7749883ad9613459f9787b
2017-03-10 09:15:50 -08:00
Felix Oghina d9ae27ba89 Clear Fresco memory cache in onHostDestroy
Summary: `onHostDestroy` is when the app is backgrounded and all Activities are destroyed. At this point it's safe to clear Fresco's memory cache.

Reviewed By: AaaChiuuu

Differential Revision: D4674950

fbshipit-source-id: f6db658ad56e3ad843cd2acfa31e2df1c40d3279
2017-03-10 06:45:36 -08:00
Martin Konicek f0394ce38b Revert D4588356: Refactor dependencies
Differential Revision: D4588356

fbshipit-source-id: 88cd348ed10cbf51e8ea4cde7503f6e0f9e6c572
2017-03-10 05:45:28 -08:00
Martin Konicek 193afff926 Update Boost dependency on Android to 1.63
Summary:
We use this version internally.
Closes https://github.com/facebook/react-native/pull/12837

Differential Revision: D4688986

Pulled By: mkonicek

fbshipit-source-id: 93d9dedb51a56d6104aae443e939455c44397e88
2017-03-10 05:45:28 -08:00
Fred Liu 28ed5eddf2 Revert D4494386: [react-native][PR] BREAKING - Remove LayoutAnimation experimental flag on Android
Differential Revision: D4494386

fbshipit-source-id: 1ba6fc60467d1c3347c90e52a3251e6591a99e25
2017-03-09 20:16:37 -08:00
Theo Yaung b47000a051 Refactor dependencies
Reviewed By: javache

Differential Revision: D4588356

fbshipit-source-id: ac13bbef8252ce87cdccc2f2d32890e94ff022fb
2017-03-09 16:22:58 -08:00
Janic Duplessis 921b9ac53d Native Animated - Support multiple events attached to the same prop
Summary:
Re-applying the diff that was reverted in D4659669 / b87f4abf78 because of some crashes with fixes from D4659708 merged in.

 ---

Fixes a bug that happens when trying to use ScrollView with sticky headers and native `Animated.event` with `onScroll`. Made a few changes to the ListViewPaging UIExplorer example to repro https://gist.github.com/janicduplessis/17e2fcd99c6ea49ced2954d881011b09.

What happens is we need to be able to add multiple events to the same prop + viewTag pair. To do that I simple changed the data structure to `Map<prop+viewTag, List<AnimatedEventDriver>>` and try to optimize for the case where there is only one item in the list since it will be the case 99% of the time.

**Test plan**
Tested by reproducing the bug with the above gist and made sure it was fixed after applying this diff.
Closes https://github.com/facebook/react-native/pull/12697

Reviewed By: fkgozali

Differential Revision: D4661105

Pulled By: sahrens

fbshipit-source-id: c719dc85f45c1a142ef5b9ebfe0a82ae8ec66497
2017-03-09 15:30:28 -08:00
Oleg Lokhvitsky d2796ea4ed Fix cookies not being sent with <Image> network requests
Reviewed By: pvulgaris

Differential Revision: D4669967

fbshipit-source-id: d26da8d3a60f71cf3751eb1c73974b0e57e59bed
2017-03-09 14:03:00 -08:00
Janic Duplessis 231bf7c68b Show bundle loading progress on Android
Summary:
This implements a loading banner like on iOS that shows the progress of the packager.

![](https://media.giphy.com/media/l4FGoepExkpOeXtTO/giphy.gif)

**Test plan**
- Tested that it displays similar messages as it does on iOS and also that is show the right message when waiting for the remote debugger.
- Tested that errors are still shown properly.
- Tested that it works with packagers that don't support multipart response (add && false in https://github.com/facebook/react-native/blob/master/packager/src/Server/MultipartResponse.js#L81).
- Run new unit tests.
- Tested that backgrounding / foregrounding the app hides / show the banner properly.
Closes https://github.com/facebook/react-native/pull/12674

Differential Revision: D4673638

Pulled By: mkonicek

fbshipit-source-id: b2a1163de3d0792cf481d7111231a065f80a9594
2017-03-09 10:45:35 -08:00
Aaron Chiu 07153dd8f2 remove dup TRACE_TAG_REACT_APPS
Summary:
Thanks for submitting a pull request! Please provide enough information so that others can review your pull request:

> **Unless you are a React Native release maintainer and cherry-picking an *existing* commit into a current release, ensure your pull request is targeting the `master` React Native branch.**

Explain the **motivation** for making this change. What existing problem does the pull request solve?

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

**Test plan (required)**

Demonstrate the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes UI.

Make sure tests pass on both Travis and Circle CI.

**Code formatting**

Look around. Match the style of the rest of the codebase. See also the simple [style guide](https://github.com/facebook/react-native/blob/master/CONTRIBUTING.md#style-guide).

For more info, see
Closes https://github.com/facebook/react-native/pull/12818

Differential Revision: D4680312

Pulled By: AaaChiuuu

fbshipit-source-id: d8410e99c3ced4e2c94145186a450923029d5b22
2017-03-08 20:46:16 -08:00
Aaron Chiu 1269f1ef4e don't obfuscate CxxModule names
Reviewed By: mhorowitz

Differential Revision: D4677275

fbshipit-source-id: 990e2e6338d76e283a1bc44d4991140560d1b101
2017-03-08 17:50:25 -08:00
Janic Duplessis abc483a653 BREAKING - Remove LayoutAnimation experimental flag on Android
Summary:
I don't remember exactly where we talked about this but LayoutAnimation on Android is pretty stable now so there's no reason to keep it behind an experimental flag anymore. The only part that is not really stable is delete animations, so what I did is remove the default delete animation that we provide in presets.

**Test plan**
Tested that layout animations work properly without any config.
Closes https://github.com/facebook/react-native/pull/12141

Differential Revision: D4494386

Pulled By: mkonicek

fbshipit-source-id: 5dd025584e35f9bff25dc299cc9ca5c5bf5f17a3
2017-03-08 06:45:22 -08:00
Prabakar Marimuthu 36eb69ecd0 Added option to set mixed content mode in android webview
Summary:
PR for option to set mixed content mode in Webview(Android) for issue #8460
Closes https://github.com/facebook/react-native/pull/12314

Differential Revision: D4663084

Pulled By: lacker

fbshipit-source-id: 0e40ea463739166311ddcb7887ff6d0289369637
2017-03-08 06:45:22 -08:00
Adam Comella 4c7576e485 Android: Fix clipping of text which contains unicode emoticons on Android 4.4.2
Summary:
Fixes #11592

This bug was seen on a Galaxy S4 running Android 4.4.2. On this device, Android's `Layout.getDesiredWidth` method doesn't correctly measure text that contains unicode emoticons. It appears to think the emoticons take up 0 space.

Setting ANTI_ALIAS_FLAG in the TextPaint's constructor instead of setting it later with setFlags works around the Android bug.

**Test plan (required)**

My team uses this fix in our app.

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

Differential Revision: D4673649

Pulled By: mkonicek

fbshipit-source-id: 535f371281927bfff5d8b42966496bc8daf30045
2017-03-08 05:45:17 -08:00
Aaron Chiu 7978f7a27b enable Systracing is JS before JSBundle finishes loading
Reviewed By: alexeylang

Differential Revision: D4671771

fbshipit-source-id: 5cd12bf84f25d4c3b188cf32907415b5a695b360
2017-03-08 03:34:54 -08:00
Martin Konicek 53c7f1d07f When building open source React Native, make Buck use the same version of Support Library as Gradle uses, and as we use internally
Reviewed By: bestander

Differential Revision: D4666693

fbshipit-source-id: a9a15164498353759a14630e2ce78a4a00e9c855
2017-03-07 09:45:48 -08:00
Aaron Chiu b085215237 move NativeModule initialization off UI thread
Summary: Initializing natives modules on the UI thread blocks the JS thread if the UI thread is busy.

Reviewed By: yungsters

Differential Revision: D4611211

fbshipit-source-id: cd4fb9cb5e52a478b6692b784cfd9e3bf34c0d34
2017-03-06 21:15:54 -08:00
Kevin Gozali 7acf74122d android: add ReactInstancePackage abstract class to pass down ReactInstanceManager to create modules
Summary:
At times, ReactPackage needs to get information from the ReactInstanceManager, e.g. to get the DevSupportManager for debugging purpose. This allows passing down the instance manager to create the native modules, in addition to just ReactApplicationContext. It is then up to the Package to use it or not.

To use this, you must make your package class extends ReactInstancePackage, instead of just implementing ReactPackage interface.

Reviewed By: mmmulani

Differential Revision: D4641997

fbshipit-source-id: 497c4408a7d2b773c49f08bff7c1bf8f9d372edb
2017-03-06 15:30:40 -08:00
Jiajie Zhu b87f4abf78 revert D4656347 to fix crashes
Reviewed By: jingc

Differential Revision: D4659669

fbshipit-source-id: 2c95c212a19cc8b67ce4ec62963c8374aecb3ef6
2017-03-06 11:15:45 -08:00
Konrad Reiche 4d4028d8d6 Inherit WebSocket protocol scheme in case of http and https
Summary:
**Motivation**

Currently, when supplying a URL with protocol scheme `http` or `https` to the WebSocket module:

```
new WebSocket("http://10.0.2.2:8080")
```
it will result in the following error:

![Unable to get cookie from http://10.0.2.2:8080](https://cloud.githubusercontent.com/assets/661993/23584771/f3f9573e-011f-11e7-839e-eb100c8cb5d2.png)

When a WebSocket URL with protocol scheme `http` or `https` is used the method [`getDefaultOrigin`](be4afdde37/ReactAndroid/src/main/java/com/facebook/react/modules/websocket/WebSocketModule.java (L274-L301)) will fail to substitute it and just returns a URL with empty protocol scheme leading to this opaque exception.

Thus, in case of `http` or `https` it should just inherit the protocol scheme since the WebSocket is responsible for upgrading the HTTP/HTTPS connection to the WebSocket protocol.

**Test plan**

If anything this change makes the method more robust. The WebSock
Closes https://github.com/facebook/react-native/pull/12713

Differential Revision: D4657738

Pulled By: ericvicenti

fbshipit-source-id: 8835b539e94713355e063a2639b7293c764b084b
2017-03-05 18:37:58 -08:00
Janic Duplessis c708234f66 Native Animated - Support multiple events attached to the same prop
Summary:
Fixes a bug that happens when trying to use ScrollView with sticky headers and native `Animated.event` with `onScroll`. Made a few changes to the ListViewPaging UIExplorer example to repro https://gist.github.com/janicduplessis/17e2fcd99c6ea49ced2954d881011b09.

What happens is we need to be able to add multiple events to the same prop + viewTag pair. To do that I simple changed the data structure to `Map<prop+viewTag, List<AnimatedEventDriver>>` and try to optimize for the case where there is only one item in the list since it will be the case 99% of the time.

**Test plan**
Tested by reproducing the bug with the above gist and made sure it was fixed after applying this diff.
Closes https://github.com/facebook/react-native/pull/12697

Differential Revision: D4656347

Pulled By: sahrens

fbshipit-source-id: b5c36ba796f478e56028c7a95bc0f86bc54cb2ce
2017-03-05 10:16:57 -08:00
Andy Street dfe09db990 Safely fix underline TextInput
Summary: Resubmit of https://github.com/facebook/react-native/pull/12493 factoring in the AOSP bug here: https://code.google.com/p/android/issues/detail?id=191754

Reviewed By: achen1

Differential Revision: D4627575

fbshipit-source-id: 8a984852db54be98bd6e781a4d00854d7d0dca68
2017-03-03 03:49:47 -08:00
Aaron Chiu d2050a35dd log onHostResume and onHostPause times
Reviewed By: alexeylang

Differential Revision: D4640631

fbshipit-source-id: fe55368b152c96ce631280143d59923aa2e628d3
2017-03-02 22:46:52 -08:00
Martin Konicek ee122be97e Android: Remove dependency on recyclerview
Summary:
Removing unused code. We used to have this dependency for the RecyclerViewBackedScrollView, which has been removed.

**Test plan (required)**

Tests pass on Circle CI.
Closes https://github.com/facebook/react-native/pull/12636

Differential Revision: D4646561

Pulled By: ericnakagawa

fbshipit-source-id: 285de78debec306078eb9ad34a2339f95bc42a9c
2017-03-02 16:16:49 -08:00
Aaron Chiu 9f68d95943 log native module initialization time
Reviewed By: alexeylang

Differential Revision: D4640369

fbshipit-source-id: 9d1ec353d9b8c4bccb5eedea1fc5d0f6cb414985
2017-03-02 16:01:52 -08:00
Aaron Chiu f9a3ed3793 in non-lazy mode, log instantiation time for each native module
Reviewed By: alexeylang

Differential Revision: D4640157

fbshipit-source-id: cfc1c3114ef97b8ba12839c3814a72b8ece869d6
2017-03-02 15:45:13 -08:00
Ludo Fardel 0b348095b6 blurRadius for Image
Summary:
This adds blurRadius support for <Image>, similar to iOS.
The heavy-lifting was done by lambdapioneer in the stack of diffs ending with
D3924013, we're just patching this in.
Two notes: we might need to apply two postprocessors going forward, will tackle
that in a separate diff, so we can ship this asap.
However, we need a new version of fresco to be released in order
to ship this.

Reviewed By: lexs

Differential Revision: D3936438

fbshipit-source-id: 353bf1f1120ebd5f4f8266c5a20188b41478a741
2017-03-02 07:47:21 -08:00
Scott Wolchok 906879ed9b BUCK file renaming round 2 (10/13)
Reviewed By: dinhviethoa

Differential Revision: D4641351

fbshipit-source-id: f965d3c55313258934d926f6333e2ba161263882
2017-03-01 21:15:03 -08:00
Ke Mao 8bfab2c733 Improve command-line experience for capturing mobile JS heap
Reviewed By: cwdick

Differential Revision: D4612319

fbshipit-source-id: 607a09286abdd83368996ffc553b3ce984b62f34
2017-03-01 19:26:28 -08:00
Marc Horowitz 18eb7aea97 Fix the RN OSS gradle build
Reviewed By: ericvicenti

Differential Revision: D4636504

fbshipit-source-id: 89a776902d893c19dff81afcf1cba631c220c9c2
2017-03-01 13:47:31 -08:00
Lukas Wöhrl bdd9aed909 Move configuration to new YGConfig and pass them down to CalculateLayout
Summary:
Move configuration to new ```YGConfig``` and pass them down to CalculateLayout. See #418 .

Adds ```YGConfigNew()``` + ```YGConfigFree```, and changed ```YGSetExperimentalFeatureEnabled``` to use the config.

New function for calculation is ```YGNodeCalculateLayoutWithConfig```.
Closes https://github.com/facebook/yoga/pull/432

Reviewed By: astreet

Differential Revision: D4611359

Pulled By: emilsjolander

fbshipit-source-id: a1332f0e1b21cec02129dd021ee57408449e10b0
2017-03-01 09:31:06 -08:00
Emil Sjolander 4d69f4b2d1 Add display:none support to react native
Summary:
This diff adds display:none support to React Native. This enables hiding components which still calling their render method and keeping them within the state of your application. This enables preserving state in a component even though the component is not visible. Previously this was often implemented by rendering a component off screen as a work around. See below playground for usage.

```
class Playground extends React.Component {
  render() {
    return (
      <View style={{width: '100%', height: '100%', flexDirection: 'row', backgroundColor: 'white'}}>
        <View style={{width: 100, height: 100, display: 'none', backgroundColor: 'red'}}/>
        <View style={{width: 100, height: 100, backgroundColor: 'blue'}}/>
      </View>
    );
  }
}
```

Reviewed By: astreet

Differential Revision: D4611771

fbshipit-source-id: 0dbe0494d989df42994ab9ad5125d47f3233cc5a
2017-03-01 09:16:05 -08:00
Emil Sjolander 31f848a5fa Expose alignContent to react native
Summary:
This diff adds alignContent (https://developer.mozilla.org/en-US/docs/Web/CSS/align-content) support to React Native. This enables aligning the lines of multi-line content. See below playground for example usage.

```
class Playground extends React.Component {
  render() {
    return (
      <View style={{width: '100%', height: '100%', flexDirection: 'row', backgroundColor: 'white', flexWrap: 'wrap', alignContent: 'space-between'}}>
        <View style={{width: 100, height: 100, marginLeft: 10, marginTop: 10, backgroundColor: 'red'}}/>
        <View style={{width: 100, height: 100, marginLeft: 10, marginTop: 10, backgroundColor: 'red'}}/>
        <View style={{width: 100, height: 100, marginLeft: 10, marginTop: 10, backgroundColor: 'red'}}/>
        <View style={{width: 100, height: 100, marginLeft: 10, marginTop: 10, backgroundColor: 'red'}}/>
        <View style={{width: 100, height: 100, marginLeft: 10, marginTop: 10, backgroundColor: 'red'}}/>
        <View style={{width: 100, height: 100, marginLeft: 10, marginTop: 10, backgroundColor: 'red'}}/>
        <View style={{width: 100, height: 100, marginLeft: 10, marginTop: 10, backgroundColor: 'red'}}/>
      </View>
    );
  }
}
```

Reviewed By: astreet

Differential Revision: D4611803

fbshipit-source-id: ae7f6b4b7e9f4bc78d2502da948214294aad4dd2
2017-03-01 09:16:05 -08:00
Emil Sjolander cc275557be Add margin auto support to react native
Summary:
This diff adds margin:auto (https://drafts.csswg.org/css-flexbox-1/#auto-margins) support to React Native. This enables layout not previously supported without inserting empty 'spacer' views. See below Playground for usage.

```
class Playground extends React.Component {
  render() {
    return (
      <View style={{width: '100%', height: '100%', flexDirection: 'row', backgroundColor: 'white'}}>
        <View style={{width: 100, height: 100, backgroundColor: 'red'}}/>
        <View style={{width: 100, height: 100, marginLeft: 'auto', backgroundColor: 'blue'}}/>
      </View>
    );
  }
}
```

Reviewed By: astreet

Differential Revision: D4611753

fbshipit-source-id: e78335565c193f7fb263129a638b444715ba5ab0
2017-03-01 09:16:05 -08:00
Emil Sjolander fb266fcaad More efficient decoding of Dynamic value in LayoutShadowNode
Reviewed By: astreet

Differential Revision: D4627219

fbshipit-source-id: 1495d58b08af3c619a8dc0d2df655e0c42aa813e
2017-03-01 09:16:05 -08:00
Aaron Chiu 6b738d1b2e remove getAllPerformanceCounters() function
Reviewed By: fkgozali

Differential Revision: D4626085

fbshipit-source-id: f07f5a72791176f075d3ce450af4c7ae4cd6fa5c
2017-02-28 20:22:24 -08:00
Georgiy Kassabli 1209b39492 Yoga test failure for flexing with min stack dimension
Reviewed By: emilsjolander

Differential Revision: D4558653

fbshipit-source-id: 06b38d7ed43aee063cc881f38b84558641f043f3
2017-02-28 16:30:40 -08:00
Marc Horowitz db8cec4331 Initialize glog in bridge
Reviewed By: AaaChiuuu

Differential Revision: D4614463

fbshipit-source-id: c115534c214f6bb40808f12e571a66afc9206d4d
2017-02-28 14:15:57 -08:00
Marc Horowitz 0b921ef52e Expand the visible parts of the android bridge a little bit
Reviewed By: javache

Differential Revision: D4560212

fbshipit-source-id: 7591ff825fd51ae5b3d3f494c677c75d75388471
2017-02-28 14:15:57 -08:00
Charles Dick 31628f3aa4 remove global list in JscHeapCapture
Differential Revision: D4620810

fbshipit-source-id: 88ddadb1a2111408bc0188512dd818b7a7bf31c7
2017-02-28 11:15:08 -08:00
Alexey Lang 1744639ad7 Log ReactContext counters
Reviewed By: AaaChiuuu

Differential Revision: D4501870

fbshipit-source-id: 97a5ece611a8d0d4049c63306382f56cac90434b
2017-02-28 06:32:43 -08:00
Andy Street 0884c3e3d1 Revert D4620034: [react-native][PR] Fix: set underlineColorAndroid properly
Differential Revision: D4620034

fbshipit-source-id: edb589ace310008866d8d4df5fbf00e785976402
2017-02-28 03:32:55 -08:00
Adam Comella 04790f1a78 Finish AccessibilityInfo implementation
Summary:
This PR is based on files ericvicenti gave me. Specifically, he gave me:
  - AccessibilityInfo.android.js
  - AccessibilityInfo.ios.js
  - AccessibilityInfoModule.java

Before this change, only a native iOS implementation of AccessibilityInfo existed. This change includes:
  - A native Android implementation of AccessibilityInfo.
  - JavaScript wrappers for the AccessibilityInfo module for both iOS and Android.
  - UIExplorer changes to illustrate how to use AccessibilityInfo on iOS and Android.
  - Documentation for the AccessibilityInfo APIs.

**Test plan (required)**

Tested the UIExplorer AccessibilityInfo example on iOS and Android with the screen reader both enabled and disabled.

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

Reviewed By: mkonicek

Differential Revision: D4527224

Pulled By: ericvicenti

fbshipit-source-id: d04638465ccbdbb35ecfc9504daaeb8e33aab57a
2017-02-27 18:34:19 -08:00
Eric Vicenti 6439f65fcb Switch to OSS buck config for textlayoutbuilder
Reviewed By: ahmedre

Differential Revision: D4623418

fbshipit-source-id: 50bbbb0df89a69b088186bd38e993f659421cef9
2017-02-27 14:45:53 -08:00
desmondyao 20ad2b3fbb support api 15 (use Handler-backed ui driven).
Summary:
Android API 15 still have 1.5~2.0% distribution (refer: [Dashboard - Android Developer](https://developer.android.com/ndk/guides/standalone_toolchain.html#creating_the_toolchain)).

React Native is a good tec but many companies cannot endure loose their consumer. [Choreographer](https://developer.android.com/reference/android/view/Choreographer.html) triggered UI operation is the only reason that React Native Android sdk use minSdkVersion 16, so we can use a backward solution **only in API 15**: [Handler](https://developer.android.com/reference/android/os/Handler.html).

In this PR, the biggest change is :

- Make core operation of ReactChoreographer to an interface: ReactUIDriver;
- Impl ReactUIDriver by Handler => UIDriverHandlerImpl, refactor ReactChoreographer to UIDriverChoreographerImpl;
- Let UIDriverFactory to choose which one impl would be in use. (Only use handler in api 15).
Closes https://github.com/facebook/react-native/pull/12396

Reviewed By: AaaChiuuu

Differential Revision: D4588399

Pulled By: astreet

fbshipit-source-id: 76408e53664314dd926e6a553cde6bafbd37779e
2017-02-27 14:04:57 -08:00
Swordsman-Inaction 8b01508410 Fix: set underlineColorAndroid properly
Summary:
This PR fixes #6332

The issue is that Android Framework will return the same drawable instance for all requests if they request for the same resource. So the changes on the drawable instance will affect all users(`TextInput` in this case). The solution is very easy, call `mutate()` before change it will get a new drawable instance which make sure the change doesn't affect other users.
Closes https://github.com/facebook/react-native/pull/12493

Differential Revision: D4620034

Pulled By: astreet

fbshipit-source-id: a7b10fbc7447e01132b7ca0e1f78413796493e07
2017-02-27 14:04:57 -08:00
Bhuwan Khattar a23a3c319c Add @providesModule annotations
Summary: Adding providesModule annotations to files that don't have a `providesModule` annotation but are in directories that packager crawls.

Reviewed By: cpojer

Differential Revision: D4612455

fbshipit-source-id: b23f0d6bbe2d26f480e93b56b67c6c8b1075e9f7
2017-02-27 14:04:56 -08:00
Michael Bolin 48cb932c6e Apply auto-formatter for BUCK files in fbandroid.
fbshipit-source-id: 278ce6f67f5df830b2218e3aca69be103d3c56a6
2017-02-27 14:04:56 -08:00
Eric Vicenti ce3146d618 Update BUCK 2017-02-27 13:58:55 -08:00
Eric Vicenti 288f480b71 Update BUCK 2017-02-27 13:42:01 -08:00