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

2912 Коммитов

Автор SHA1 Сообщение Дата
Alexandre Kirszenberg 1eedf05651 Update the Delta/HMR format
Summary:
Makes the delta bundle data structures more consistent.

The changes are as follows:
* There are now two types of JSON bundles that can be downloaded from the delta endpoint. Base bundles (`Bundle` type), and Delta bundles (`DeltaBundle` type).
* The `reset` boolean is renamed to `base`.
* `pre` and `post` properties are now strings.
* Only `Bundle` can define `pre` and `post` properties.
* The `delta` property is renamed to `modules`.
* Deleted modules are now listed inside of the `deleted` property, which is only defined by `DeltaBundle`.

Reviewed By: mjesun

Differential Revision: D10446831

fbshipit-source-id: 40e229a2811d48950f0bad8dd341ece189089e9b
2018-10-29 08:58:30 -07:00
Dulmandakh 99632e16d9 fix android ci (#21913)
Summary:
This PR adds support-annotations to devsupport buck dependency, which fixes Android CI.
Pull Request resolved: https://github.com/facebook/react-native/pull/21913

Differential Revision: D10842175

Pulled By: hramos

fbshipit-source-id: f3f3e0e6a3a5e9ceb18db11ac67e820a7f10937a
2018-10-24 14:48:42 -07:00
Andrew Chen (Eng) dc74975c5f Remove hard crash when root view is reused
Summary: Alternative to D10499861. If an app does not have an exception handler, context.handleException will still hard crash. Since this error is just saying that we're reusing an unexpected RootView, it might be safe to continue execution. Let's remove the exception for now while we investigate further

Reviewed By: mmmulani

Differential Revision: D10560413

fbshipit-source-id: 6c08a16cd250a019d2aef5afcaf3ba61534d29f7
2018-10-24 13:08:41 -07:00
Max Sherman b141363943 Instrument native library load time
Summary: I'm interested in measuring this.

Reviewed By: alexeylang

Differential Revision: D10510275

fbshipit-source-id: e833153524413bc5ec6159ff100ade92b29e6d0c
2018-10-24 09:00:22 -07:00
Andrew Chen (Eng) f671f8868f Don't crash when ReactRootView's id is already set
Summary:
This is a bandaid fix to address a crash with a stack trace involving

```
com.facebook.react.uimanager.IllegalViewOperationException: Trying to add a root view with an explicit id already set. React Native uses the id field to track react tags and will overwrite this field. If that is fine, explicitly overwrite the id field to View.NO_ID before calling addRootView.
0+com.facebook.react.uimanager.NativeViewHierarchyManager.addRootViewGroup(NativeViewHierarchyManager.java:546) [inlined]
1+com.facebook.react.uimanager.NativeViewHierarchyManager.addRootView(NativeViewHierarchyManager.java:538) [inlined]
2+com.facebook.react.uimanager.UIViewOperationQueue.addRootView(UIViewOperationQueue.java:678) [inlined]
3+com.facebook.react.uimanager.UIImplementation.registerRootView(UIImplementation.java:216) [inlined]
4+com.facebook.react.uimanager.UIManagerModule.addRootView(UIManagerModule.java:355)
5+com.facebook.react.ReactInstanceManager.attachRootViewToInstance(ReactInstanceManager.java:1032)
6+com.facebook.react.ReactInstanceManager.attachRootView(ReactInstanceManager.java:726) [inlined]
7+com.facebook.react.ReactRootView.attachToReactInstanceManager(ReactRootView.java:524)
8+com.facebook.react.ReactRootView.startReactApplication(ReactRootView.java:377)
```

This crash seems to be happening because the root view's id is set to a non NO_ID value, but further up in the stack trace, UIManager.addRootView() is called which always sets the root view's id to NO_ID. It's not clear how this error is happening, but in this code path it's expected that addRootView should always ensure that the id is always reset. In order to avoid crashing for this, let's remove the exception and log the issue instead.

In the future, we should not be overloading the android view id field with these types of react native implementation details. The react tag should be stored as a view tag instead.

Reviewed By: mmmulani

Differential Revision: D10499861

fbshipit-source-id: 4dffedab4e7a34eee7f64bb43ec8209699521c73
2018-10-22 17:28:17 -07:00
David Vacca 6debfdf6d6 RN crash when processing Exception with null message
Summary: This diff fixes a crash that happens when a component throws an exception that contains a null message

Reviewed By: achen1

Differential Revision: D10429661

fbshipit-source-id: 9faed36906844b51f5a3dc2b3cbc80ede6b93457
2018-10-22 01:07:45 -07:00
David Vacca b002df945b Re-introduce UIImplementationProvider
Summary: UIImplementationProvider was removed as part of D8650376, this was a breaking change that caused problems in OSS. This diff introduces the concept of a deprecated UIImplementationProvider again to allow OSS community to upgrade to latest version of RN.

Reviewed By: achen1

Differential Revision: D10456317

fbshipit-source-id: 6817629524f927dfcb5ebc054dbfd983877b7606
2018-10-20 11:27:50 -07:00
Marc Horowitz 6b0e924915 lint fixes
Reviewed By: QueryConnectionException

Differential Revision: D10458992

fbshipit-source-id: f57b0ef3c51a0bcf5703e187d36960aa3b944002
2018-10-19 11:35:06 -07:00
Héctor Ramos 47fb387455 Update copyright headers
Summary: Use MIT License copyright headers in JSI source code.

Reviewed By: axe-fb

Differential Revision: D10454031

fbshipit-source-id: d584073bb885fb7d977df1a45a6666ef6f52dcd6
2018-10-19 11:08:57 -07:00
Marc Horowitz 6370b86c1f Get RNTester to compile and run
Summary:
This diff includes a few changes:
1. Move the headers inside `jsiexecutor` into `jsiexecutor/jsireact`. As far as I'm aware, the Android ndk build system isn't flexible enough to support header namespaces, so we can't just expose the headers inside the `jsiexecutor` directory under the `jsireact` namespace. Therefore, I moved the headers to `jsiexecutor/jsireact`, and added `jsiexecutor` to the header search path.  This was the easiest way to simulate `jsireact` namespace.
2. Setup the Android.mk files to get RNTester compiling and running.
3. Introduce a `jscexecutor` module to make `JSCExecutor.java` execute without throwing.

**Note:** Moving the header files inside `jsiexecutor` probably breaks the iOS builds and internal builds. I'll fix those in subsequent diffs on this stack.

Reviewed By: shergin

Differential Revision: D9995429

fbshipit-source-id: 418a4ee91f585842c5e317af2f300227a51e9ba8
2018-10-18 01:06:24 -07:00
Marc Horowitz 7ffb406517 Remove RN files which use JSC
Summary:
JSI+JSCRuntime replaces direct use of JSC
@public

Reviewed By: danzimm

Differential Revision: D9328235

fbshipit-source-id: a4d0cad8250ef2da058ffffbdedbffa19f96bb12
2018-10-18 01:06:24 -07:00
Marc Horowitz 6796e62bb3 Remove JSC references
Summary:
Removing entire files will be the next diff
@public

Reviewed By: fkgozali

Differential Revision: D9328239

fbshipit-source-id: 083847d3b841a3c7bfa751a82e8cc16bd112bace
2018-10-18 01:06:24 -07:00
Marc Horowitz 53fa8130f5 Switch RN from JSCJavaScriptExecutorFactory to JSCExecutorFactory
Summary:
This removes the dependency on JSCExecutor.  Everything goes
through JSI now.

Reviewed By: RSNara

Differential Revision: D9328240

fbshipit-source-id: c9c085fec1ebd5d0f4679cd70b89cc263ca33ac4
2018-10-18 01:06:24 -07:00
Marc Horowitz 749b18dbc9 Add JSI-based JSExecutor for the bridge
Summary:
This is similar in function to the old JSCExecutor, but uses the more abstract JSI API to interact with the JSVM.
@public

Reviewed By: axe-fb

Differential Revision: D9328241

fbshipit-source-id: 3212ff4f43d0589a70d7bebc4d463d4433590f1d
2018-10-18 01:06:24 -07:00
Mehdi Mulani 1c240ae898 Fix onTextLayout metrics on Android when using alignText
Summary:
With this, we send the correct x position when using center or right aligned text. In order to accomplish this though, we have to pass the text alignment into the Layout object that we create.

Also update RNTester to allow us to try different alignments.

Reviewed By: sahrens

Differential Revision: D10316494

fbshipit-source-id: 11c7d2a59e636528f12211168acb46f16b54a126
2018-10-17 12:55:10 -07:00
JenLindsay bbfff90ab8 remove createReactClass from ScrollViewTestModule.js (#21627)
Summary:
Related to issue #21581
Removed createReactClass from ReactAndroid/src/androidTest/js/ScrollViewTestModule.js
Pull Request resolved: https://github.com/facebook/react-native/pull/21627

Reviewed By: TheSavior

Differential Revision: D10363828

Pulled By: RSNara

fbshipit-source-id: 08c9776060cfdfde3b69f310bca0353d393b67c4
2018-10-16 16:27:56 -07:00
Ronaldo Lima 998d69d12d from ReactAndroid/src/androidTest/js/UIManagerTestModule.js (#21702)
Summary:
Related to #21581 .
Removed createReactClass from ReactAndroid/src/androidTest/js/UIManagerTestModule.js
Pull Request resolved: https://github.com/facebook/react-native/pull/21702

Reviewed By: TheSavior

Differential Revision: D10345717

Pulled By: RSNara

fbshipit-source-id: 280f499abb2e2aa9f8ea25c3f8faaed8162e67d5
2018-10-16 16:21:25 -07:00
Jonathan Lee bb407fa1ec Back out "[react-native][PR] Rounded corner rendering fixed on Android N."
Summary:
Original PR: https://github.com/facebook/react-native/pull/21340

The original PR fixed a bug with border radius on Android 7.0, but caused a new bug where no `ReactART` components would render if they were nested within a View with border radius set.

Differential Revision: D10409352

fbshipit-source-id: 0b4e36ae9d4c3bc2f4884a43909f8efdeeb41b74
2018-10-16 14:45:01 -07:00
Haitao Li b0d68c0bb9 Fix DynamicFromMap object pool synchronization (#17842)
Summary:
DynamicFromMap internally uses SimplePool object to recycle dynamic prop objects. But the pool is not multi-thread safe. Currently the most used dynamic props are size props such as left, paddingVertical, marginTop and so on. These props are only accessed from the layout thread so the pool works fine. If a dynamic prop is needed in UI thread, then the two threads can access the same pool object and cause random errors. This PR make the pool object thread local to avoid synchronization. After this change there are two pool objects created in the process.

Tested in official Airbnb app after updating accessibilityComponentType to be dynamic.

Once this is merged, I'll send another PR to support "disabled" state in `accessibilityComponentType`.

[ANDROID] [BUGFIX] [DynamicFromMap] - Fix a crash caused by dynamic props.
Pull Request resolved: https://github.com/facebook/react-native/pull/17842

Differential Revision: D10374238

Pulled By: hramos

fbshipit-source-id: 7ebf89c5abf06bd5fb43b205348ba4dc7e19517d
2018-10-13 17:42:44 -07:00
Ram N 5e7c774d64 Initialize the Choreographer in ReactChoreographer lazily
Summary:
Today, ReactInstanceManager calls `ReactChoreographer.initialize()` in its constructor. Since `ReactChoreographer` also needs to run on the UI thread, this forces the entire `ReactInstanceManager` to run on the UI thread.

By moving `ReactChoreographer` to lazily set up its Choreographer, we can make `ReactInstanceManager` run on any thread

Reviewed By: mdvacca

Differential Revision: D10097432

fbshipit-source-id: eb8c80aafcba745ea15c86296d11c487329b1df0
2018-10-12 19:37:42 -07:00
David Vacca 082a869dae Cleaning up imports in ViewGroupManager
Summary: Trivial cleanup of imports in ViewGroupManager class

Reviewed By: shergin

Differential Revision: D10343029

fbshipit-source-id: 0b049df545a4101f11dd67809c9a96723e746945
2018-10-12 18:41:51 -07:00
David Vacca ca3a6e8f13 Uninstalling native FabricUIManager when reloading RN screen
Summary: This diff makes sure the native side of the UILayer of RN is deallocated when the a RN screen is reloaded.

Reviewed By: shergin

Differential Revision: D10343030

fbshipit-source-id: 7add841b8875d28fe527f20b96f799733769b11a
2018-10-12 18:41:51 -07:00
David Vacca 9817f85def Avoid cleaning up ReactRootView content when reactContext is destroyed
Summary: This diff avoids deleting all the views of ReactRootView when the ReactContext is destroyed (ONLY FOR FABRIC). In Fabric these views are removed and deleted by the framework when the ReactShadowNode is destroyed.

Reviewed By: shergin

Differential Revision: D10319737

fbshipit-source-id: 2e2d2599006cd8205e0153c18cd75383387ce1df
2018-10-12 18:41:51 -07:00
Dulmandakh 10fc548809 bump okhttp3 to 3.11 (#21626)
Summary:
OkHTTP3 3.11 version includes many bug fixes, and few new features. Also it embed R8/ProGuard rules in the jar, which will help reduce APK size.

Changelog https://github.com/square/okhttp/blob/master/CHANGELOG.md
Pull Request resolved: https://github.com/facebook/react-native/pull/21626

Differential Revision: D10367048

Pulled By: RSNara

fbshipit-source-id: b168138178f96eeefba493002f7b6a2e921a531d
2018-10-12 15:00:17 -07:00
Emily Janzer f1b4daf51f Start core marker earlier
Summary: Moving up when we start the CORE marker to `FbReactFragment.onFragmentCreate` on FB4A. Right now the CORE marker gets started with CREATE_REACT_CONTEXT_START, since it's possible for the instance manager to be created before TTI begins. We address this in HOME_TTI by collecting the getInstanceManager time, comparing to TTI start, and using that as bridgeStartupStartTime. Ideally, though, we'd just start the CORE marker at the right time so we can use it independently to measure RN startup. This diff moves up CORE start time to `onFragmentCreate` (even before `getReactInstanceManager`)

Reviewed By: alexeylang

Differential Revision: D10094921

fbshipit-source-id: 77986535915f8e81d4d2c5b9108cbed40d1a75be
2018-10-12 10:10:09 -07:00
Oleg Lokhvitsky 6eeff75849 Android ScrollView fix for snapToInterval not snapping to end
Summary:
The end-of-scrollable-range offset was not clipped before the nearestOffset calculation causing the ScrollView to not snap to the end of the view when the width of the ScrollView was not an exact multiple of snapToInterval.

Addresses https://github.com/facebook/react-native/issues/21116#issuecomment-427944838

Reviewed By: yungsters

Differential Revision: D10248545

fbshipit-source-id: 2bdc94ea0a9d9f063769f2c5da4c33d4872b1db2
2018-10-11 10:01:30 -07:00
Emily Janzer 01a1004808 Fix for InterpolatorType crash
Summary:
We're currently getting a redbox in Turkish when we try to convert the string 'easeInEaseOut' to an InterpolatorType. This is because I use toLowerCase() to compare the string without setting a locale; in Turkish, the capital letter 'I' doesn't convert to 'i' when you lowercase it, but rather to 'ı' (http://www.i18nguy.com/unicode/turkish-i18n.html).

Passing in a locale param to `toLowerCase()` fixes it. Also updating the test.

Differential Revision: D10315474

fbshipit-source-id: 54be3ff1d3f91cb2ec765ff705ac364b976b8c6f
2018-10-10 15:31:20 -07:00
Lorenzo Sciandra 15c05988e9 Update to Detox 9 (#21570)
Summary:
Updating to Detox 9 - this should help with better Xcode 10 support, and should fix https://github.com/facebook/react-native/issues/21539.

I've updated to fixed `9.0.4` since it seems that each version is fairly different from the next, and I've followed the [migration guide](https://github.com/wix/detox/blob/master/docs/Guide.Migration.md#migrating-from-detox-8xx-to-9xx) for the android native dependencies.

Release Notes:

[INTERNAL] [ENHANCEMENT] [DETOX] - Update to version 9.0.4

Pull Request resolved: https://github.com/facebook/react-native/pull/21570

Reviewed By: TheSavior

Differential Revision: D10242373

Pulled By: RSNara

fbshipit-source-id: bd29d554e0972f16d96b9b39b86c7143941d5b7c
2018-10-10 10:01:21 -07:00
Radovan Šmitala 4b6f02ea75 Normalize scheme for URL on Android (#21561)
Summary:
Android requires lowercase for URL scheme. This commit d00bdb9bb8 fixed it but on React Native side.
Because it is Android specific, it should be fixed on Android side.

Android has method to normalize url scheme: https://developer.android.com/reference/android/net/Uri.html#normalizeScheme()
Pull Request resolved: https://github.com/facebook/react-native/pull/21561

Differential Revision: D10287868

Pulled By: hramos

fbshipit-source-id: f5e474164fdb2cfd49bd8ee51da17de3f1341a9c
2018-10-09 23:32:24 -07:00
David Vacca 397573ffed Fix onPress for TextView containing just RawText
Summary: This diff enables the onPress event for TextViews that render RawText

Reviewed By: shergin

Differential Revision: D10222183

fbshipit-source-id: 4b6a6ad548286453f7dd3a14a5e4ee453a55b923
2018-10-09 16:47:28 -07:00
David Vacca 95afdd8bb3 Introducing "collapsable" prop as part of ViewProps
Summary: This diff introduces the collapsable props in the viewProps. This prop is used in product code to prevent specific Views to be removed from the view hierarchy

Reviewed By: shergin

Differential Revision: D10254679

fbshipit-source-id: 637665b8998a86e29e839eb6d405a0fac354c8d3
2018-10-09 16:47:27 -07:00
Emily Janzer b7526b2095 Add test for InterpolatorType
Summary: Adding a test for the newly added InterpolatorType.fromString()

Reviewed By: axe-fb

Differential Revision: D10203814

fbshipit-source-id: f3c70db1a5754c79b1bdd881d266bec110934494
2018-10-08 11:31:18 -07:00
Rick Ratmansky b3f4872659 Adding new Buck targets
Summary: This will facilitate various cleanups

Differential Revision: D10145594

fbshipit-source-id: 3a360684ba96d5e0466a3e3dc2306c59e6fb50bd
2018-10-08 09:16:30 -07:00
Emily Janzer b8cb8d50a5 Update copyright for yoga files
Summary: Appeasing lint

Reviewed By: hramos

Differential Revision: D9819535

fbshipit-source-id: 0080f17a62291291a0ea90942af4b38588e9057f
2018-10-05 18:48:50 -07:00
Marc Horowitz bb9b9a8b9d When converting arguments JS->Java, handle integers correctly
Summary:
If a folly::dynamic contains a double when a Java method is
declared to take an int, getInt() will be called, and a C++ exception
will be thrown.  This change uses similar logic to
NativeReadableMap.getInt() to convert a folly::dynamic double to a
jint.  This will still throw an exception if the JS value cannot be
represented as a jint without loss.

Reviewed By: fromcelticpark

Differential Revision: D10209492

fbshipit-source-id: fd96416200c6b283ce5c8f8fa4c227ceb8f43054
2018-10-05 16:21:33 -07:00
Emily Janzer c5186aeb46 Simplify OSS enums
Summary: Simplifying our OSS enums (remove private variables and methods) so that redex can more easily optimize them for us.

Reviewed By: achen1, Feng23

Differential Revision: D9812796

fbshipit-source-id: 11a8272db41ff04399d1cdf366e28ddf1b07b7be
2018-10-03 18:47:39 -07:00
Andrew Chen (Eng) fa6035bda6 Fix accessibility role/label
Summary: D10138128 had some shamefully wrong boolean logic to determine whether we should customize the accessibility delegate. Previously, we did it if BOTH the accessibility label AND role were present. We should actually do it if EITHER are present.

Reviewed By: mdvacca

Differential Revision: D10182135

fbshipit-source-id: 209a8ab43f5869762843fe878cfd59a7b9b5ab1a
2018-10-03 18:40:12 -07:00
Ram N 7f6254be43 Cache the instance of `ChoreographerCompat`
Summary:
Since `ChoreographerCompat.getInstance()` is a singleton, we cache its instance.

This will be important in a subsequent diff where we ensure that `ChoreographerCompat.getInstance()` is only called on the UI thread

Reviewed By: achen1

Differential Revision: D9169298

fbshipit-source-id: 2067a50770dd41f5b1a12b62b6a9f8fea83d91e8
2018-10-03 13:40:36 -07:00
Ram N a5f3571770 Refactor the usages of ChoreographerCompat
Summary:
Reducing the places where we directly access `ChoreographerCompat.getInstance()`.

Since this is a singleton anyway, there was no need to pass this as an argument. In subsequent diffs, we will also ensure that `ChoreographerCompat.getInstance()` runs on the UI thread, so that the `Choreographer` it gets is based on the `Looper` of the main thread.

Reviewed By: achen1

Differential Revision: D10136624

fbshipit-source-id: ad18f7b61eb8b05094aff310f2eb90eb225427dc
2018-10-03 13:40:35 -07:00
Ram N 8b487d4d5a Create Handler lazily in DevServerHelper
Summary: Creating this Handler in the constructor implies that the constructor needs to run on the UI Thread. Since DevSupportManager is also initialized with ReactInstanceManager,

Reviewed By: mdvacca

Differential Revision: D10094981

fbshipit-source-id: b724b05ddbd6af68da1111a1a004491835f7a35a
2018-10-03 09:19:14 -07:00
David Vacca 001b04f983 Cleanup FabricBinding class
Summary: This diff removes unused method on the FabricBinding class, these methods were being used as part of the Fabric Android implementation, but they are not necessary anymore.

Reviewed By: shergin

Differential Revision: D10128636

fbshipit-source-id: 5afef4c2e9f4955af008200c5bdd2b6acc7ef333
2018-10-02 15:09:05 -07:00
David Vacca 9e7d918365 Introduce EventBeatManager and enable events
Summary: This diff introduces the concept of EventBeatManager, this is a class that acts as a proxy between the list of EventBeats registered in C++ and the Android side.

Reviewed By: shergin

Differential Revision: D10127857

fbshipit-source-id: a1956ca42d4c470fbc11cc9f30336a182fe7910c
2018-10-02 15:09:04 -07:00
Andrew Chen (Eng) 5be0dff433 Avoid view manager class loads (take 2)
Summary:
Second attempt at landing D9930713. Notes about the previous issue is mentioned as an inline comment below.

===========

We are currently iterating through each view manager to get its class name to pass to JS. JS uses this list to define lazy property accesses for each view manager to grab the constants synchronously. This results in each view manager's class loading immediately -- causing a small perf hit.

Let's avoid this view managers list entirely. JS is able to access each view manager directly by calling getConstantsForViewManager(name)

Reviewed By: axe-fb

Differential Revision: D10118711

fbshipit-source-id: 78de8f34db364a64f5ce6af70e3d8691353b0d4d
2018-10-02 14:03:24 -07:00
Andrew Chen (Eng) d3f2f96f93 Fix default accessibility delegate
Summary:
The current accessibility implementation tries to generalize every view's accessibility node info by setting an accessibility delegate on every view -- regardless of whether or not any accessibility properties are set. This delegate however doesn't correctly set the appropriate accessibility node fields for every view. For example, ScrollViews needs AccessibilityNode.setScrollable(true) set, but the generic delegate does not account for this. For now let's avoid unnecessarily
setting an accessibility delegate on views that don't have any accessibility props set, which will likely fix the majority of these issues.

Reviewed By: mdvacca

Differential Revision: D10138128

fbshipit-source-id: b999b41e7256e3dce94cd70e9b944979d52f74fd
2018-10-01 18:47:29 -07:00
Andrew Chen (Eng) 4ac500a337 Don't access ReadableNativeArray on UI thread
Summary: ReadableNativeArray initializes the ReactBridge which loads a bunch of c++ classes. Let's avoid doing this on the UI thread.

Reviewed By: mdvacca

Differential Revision: D10108380

fbshipit-source-id: ab4520535288ce450a865952e996b716d571df7f
2018-10-01 16:49:10 -07:00
Alexander Khaylo 4768bea0cf Fix CameraRoll.getPhotos() crash on Android if device has a problematic video asset (#21438)
Summary:
Changed catching IOException to Exception
Fixes #20112
Pull Request resolved: https://github.com/facebook/react-native/pull/21438

Differential Revision: D10132453

Pulled By: hramos

fbshipit-source-id: c68fa8c45d43e4f2d116b8084ffd731ad6bf5aec
2018-10-01 14:32:27 -07:00
Ram N ee74135a46 Add tracing to when SO libraries are loaded
Summary:
Currently, loading SO libraries is pretty expensive. While they are triggered due to accessing `ReadableNativeArray`. However, with preloader experiments, this block seems to move around and is loaded when the first dependent class loads it.

Also, as a part of D10108380, this will be moved again.

Adding a trace to keep track of where it moves.

Reviewed By: achen1

Differential Revision: D9890280

fbshipit-source-id: 4b331ef1d7e824935bf3708442537349d2d631d0
2018-10-01 14:08:29 -07:00
Héctor Ramos e28d8f6eeb Fix copyright headers
Summary:
Update several files to use the proper copyright header:

```
//  Copyright (c) Facebook, Inc. and its affiliates.
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree.
```

In the case of Xcode project files, I used the shortform version, `Copyright (c) Facebook, Inc. and its affiliates.`

Reviewed By: axe-fb

Differential Revision: D10114529

fbshipit-source-id: a1f2d5a46d04797c1cf281ea9ab80d3a2caa6fb4
2018-09-28 17:33:12 -07:00
chenwenyu ea53727e16 Android: fix cookies lost on Android 5.0 and above (#19770)
Summary:
This fixes cookie missing bug on Android 5.0 and above.
On Android 5.0 and above, after the app successfully obtains the cookie, you kills the App within 30 seconds and restarts the App. It accesses the interface that needs to carry the cookie and finds that the cookie does not exist.

Updated tests for the addCookies function to include test cases specifying Android version, and tested on the command line in my app to make sure it has the expected behavior.

Updated tests for the addCookies function to include test cases specifying Android version, and tested on the command line in my app to make sure it has the expected behavior.

[ANDROID] [BUGFIX] [Cookie] - Fix cookies lost on Android 5.0 and above
Pull Request resolved: https://github.com/facebook/react-native/pull/19770

Differential Revision: D10114102

Pulled By: hramos

fbshipit-source-id: 5b4766f02f70541fd46ac5db36f1179fe386ac7a
2018-09-28 16:02:35 -07:00
Artur Chrusciel af181fb192 Check if child view != null before dropping (#20465)
Summary:
Fixes our top crash when framework try drop a view from parent, but it's a null (already removed etc.).

Fixes #20288
Pull Request resolved: https://github.com/facebook/react-native/pull/20465

Differential Revision: D10113976

Pulled By: hramos

fbshipit-source-id: 34f5654f3bdbc63eb7f7d0b5c94885576fc3cdcd
2018-09-28 15:47:25 -07:00
Andrew Chen (Eng) e082a61324 Revert D9930713: Avoid view manager class loads
Differential Revision:
D9930713

Original commit changeset: 4aa013f8398d

fbshipit-source-id: 1fed02b41fa9d91f54d1a19f710bdb666701a4a0
2018-09-28 15:20:35 -07:00
Timothy Kukulski 97f0e43710 allow zero offset when shadow radius is nonzero
Summary:
update creation logic for text shadow: allow shadows with zero offset when the radius is nonzero

(?should we also add a check to drop the node as a no-op when color.alpha == 0 ?)

Reviewed By: yungsters

Differential Revision: D10017778

fbshipit-source-id: 0168ac6db5ad22a5d7eb32dcd184aede361d6651
2018-09-28 13:02:20 -07:00
Krzysztof Magiera 02ad56f541 Expose a getter for overflow setting in ReactViewGroup (#21398)
Summary:
This change adds getter for overflow attribute in ReactViewGroup class. Overflow setting can affect how view children are drawn but also how hit testing behaves when receiving touch. Exposing this setting makes it possible for gesture-handler library to implement proper hit testing that takes into account overflow property of a view.
Pull Request resolved: https://github.com/facebook/react-native/pull/21398

Differential Revision: D10105398

Pulled By: shergin

fbshipit-source-id: 15ae2b31be3bf80e7e1d28b87ce4474af0f486f5
2018-09-28 09:36:54 -07:00
Andrew Chen (Eng) 95174d4ea8 Avoid view manager class loads
Summary:
We are currently iterating through each view manager to get its class name to pass to JS. JS uses this list to define lazy property accesses for each view manager to grab the constants synchronously. This results in each view manager's class loading immediately -- causing a small perf hit.

Let's avoid this view managers list entirely. JS is able to access each view manager directly by calling getConstantsForViewManager(name)

Reviewed By: TheSavior

Differential Revision: D9930713

fbshipit-source-id: 4aa013f8398d4f51b7eef07937d2977ba1950726
2018-09-27 16:03:24 -07:00
Andrew Chen (Eng) 230b7b0e72 Introduce ReactNativeConfiguration to manage experimentation
Summary: Similar to ComponentsConfiguration used by Litho. Allows us to abtest without having to pipe everything through ReactInstanceManager

Reviewed By: axe-fb

Differential Revision: D9930707

fbshipit-source-id: 43edf7d8fa2bab7b7888df57ea1bec2b4726f51b
2018-09-27 16:03:23 -07:00
Andrew Chen (Eng) aac7c4d5d2 Refactor UIManager view manager accesses
Summary: Replaced each view manager access with a getViewManager() function call. This will later be used to lazily load view manager classes by allowing java to avoid sending the entire list of view managers to JS.

Reviewed By: QueryConnectionException

Differential Revision: D9695788

fbshipit-source-id: 949858aa2f0b0b00b68e260461ba8f1d085cf07f
2018-09-27 16:03:22 -07:00
Sergei Dryganets 748cf82c97 Rounded corner rendering fixed on Android N. (#21340)
Summary:
On Android N (API 24) rounded corners rendering has issues in case scale factor is set for the view.
Pull Request resolved: https://github.com/facebook/react-native/pull/21340

Differential Revision: D10084318

Pulled By: hramos

fbshipit-source-id: 53ae5a32b96cc7ee7eba084330682239d8beb85d
2018-09-27 08:17:21 -07:00
Ram N 62829a7a69 Initialize getConstantsForViewManagers eagerly
Summary: During the JS run, the view managers used on a React Native screen eventually call the native methods for `UIManagerModule.getConstantsForViewMangers(viewManagerName)`. This blocks the JS thread. This diff tries to cache the values of those calls and return them when JS needs it, ensuring that JS is not blocked as much.

Reviewed By: achen1

Differential Revision: D9985817

fbshipit-source-id: 36feabc8a386956f8a6474f6e7978285d31f24dd
2018-09-26 18:17:13 -07:00
David Aurelio 6bcc1dfcc8 Set up Yoga experiment
Reviewed By: priteshrnandgaonkar

Differential Revision: D9943869

fbshipit-source-id: 6b6550f453ab4e0ab8305401b299f2d0ed415f72
2018-09-25 15:48:03 -07:00
David Aurelio 27a3bdb886 Adapt methods for fast calls
Summary:
Changes all possible native JNI methods to critical methods.

For now, this only changes Android up and including v7. In order to be prepared for the `CriticalNative` annotation in Android v8, the following restrictions apply:

- Qualifying methods must be static (this is also enforced for Dalvik / Android v4)
- Method implementations can only consume primitive JNI types (`boolean`, jchar`, etc.)

Reviewed By: priteshrnandgaonkar

Differential Revision: D9943868

fbshipit-source-id: 728817eb37822b717fd3daf94cd9f02b42c17db6
2018-09-25 15:48:03 -07:00
David Aurelio ee6c1ecef0 Make native method binding configurable
Summary:
Moves binding of native methods into a separate native method that can be parameterized.

This will be used to experiment with JNI-related technology.

Reviewed By: priteshrnandgaonkar

Differential Revision: D9943870

fbshipit-source-id: 661f15537d5bbf7a3eef7717e3d99fed2de23904
2018-09-25 15:48:03 -07:00
Matias Colotto 201f2f189f ReactScrollView should account for `overflow: scroll`
Summary:
Support for `overflow: visible` was recently added to Android ScrollView.
However, it didn't account for `overflow: scroll` and changed the behavior, causing content to render
when before it would be clipped.

Reviewed By: achen1

Differential Revision: D10036807

fbshipit-source-id: e44a79b18eecbc7d64621f7cf5d800a00a121b13
2018-09-25 15:04:01 -07:00
Andrew Chen (Eng) 59aada873e Remove overflow hidden killswitch
Summary: There hasn't been any reports of overflow issues since the last issue was fixed in v183 (July 30th). Let's remove this flag

Reviewed By: yungsters

Differential Revision: D10020006

fbshipit-source-id: 593c7d2c2bef5f0bd60d5de1941cd58f7fd6ccc7
2018-09-25 11:52:19 -07:00
David Vacca b41ce43c07 Move folder and packages from 'fabricxx' to 'fabric'
Summary: This diff renames fabricxx into fabric

Reviewed By: achen1

Differential Revision: D10013410

fbshipit-source-id: 75d73ace6957d706d39bb87118140bb642bed747
2018-09-25 02:30:04 -07:00
David Vacca a5f1d79adf Move fabric dependecies out of OSS instrumentation tests (#21306)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/21306

This diff moves fabric dependencies out of OSS instrumentation tests (js/react-native-github/ReactAndroid/src/androidTest/java/com/facebook/react/testing/BUCK), this will un-break build of OSS project in CI.

Reviewed By: rsnara

Differential Revision: D10020517

fbshipit-source-id: e2cf23afeeecf4cfb41345742f59c16af6b108d0
2018-09-25 02:30:04 -07:00
gengjiawen 0a2825f8b3 add x86_64 arm64-v8a support. Fixes #2814 (#18754)
Summary:
add arm64 support, related issue : https://github.com/facebook/react-native/issues/2814.
If we are okay with binary aar android-jsc, then the pr can be directly merged. Otherwise merge facebook/android-jsc#30 first and do a new release.

RNTester all variant works. You can also test the apk from here: https://github.com/gengjiawen/react-native/releases/tag/v0.56beta.

https://github.com/facebook/android-jsc/pull/30.

 [ANDROID] [ENHANCEMENT] [ABI] - add x86_64 arm64-v8a support.

Differential Revision: D9491481

Pulled By: hramos

fbshipit-source-id: d6ec6992768eb0c0866a0317273e09fae5b8935e
2018-09-24 11:32:56 -07:00
David Vacca ef863c0679 Remove unused parameters in ReactInstanceManager methods
Summary: Just a small diff to remove some unused parameters in some methods of the ReactInstnaceManager class

Reviewed By: achen1

Differential Revision: D10011168

fbshipit-source-id: 2247ecd01bfc63c27837c6abad4bff1b4e590ac0
2018-09-24 11:17:59 -07:00
Oleg Lokhvitsky e0170a9445 Android ScrollView fix for pagingEnabled
Summary:
The snapToOffsets changes improved the flinging algorithm for snapToInterval/snapToOffsets but actually broke it for pagingEnabled because it's meant to only scroll one page at a time.

First, I just brough back the old algorithm, but noticed that it has a bunch of issues (e.g. #20155). So, I tried to improve the algorithm to make sure it uses the proper target offset prediction using the same physics model that Android uses for it's normal scrolling but still be limited to one page scrolls.

This resolves #21116.

Reviewed By: shergin

Differential Revision: D9945017

fbshipit-source-id: be7d4dfd1140f4c4d32bad93a03812dc80286069
2018-09-24 10:22:23 -07:00
Oleg Lokhvitsky 4af4da9089 Android ScrollView support for `overflow: visible`
Summary:
ScrollView always clipping children on Android even when `overflow: visible` was specified.
This change just omits the clipping during draw if `overflow: visible` is passed in.
The default is not changed (from hidden to visible) in case there is a performance impact.
Android now matches iOS in behavior. This helps with issue #21116 and resolves #14416.

Reviewed By: shergin

Differential Revision: D9952096

fbshipit-source-id: 367afe33ee7ff0fdc5aa1074d239883aa289888a
2018-09-24 10:22:23 -07:00
Kevin Leung 65e4e674fc Android subpixel text (#19043)
Summary:
<!--
  Required: Write your motivation here.
  If this PR fixes an issue, type "Fixes #issueNumber" to automatically close the issue when the PR is merged.
-->

Fixes inconsistency in custom font rendering in android. See explanation below.

<!--
  Required: Write your test plan here. If you changed any code, please provide us with
  clear instructions on how you verified your changes work. Bonus points for screenshots and videos!
-->

I tested the following on my physical device (Sony Z5C) and on Android emulator on Mac.
The test app contains various fonts in the AvenirNext family, which are added to the app as `.ttf` format.

Note that the character "thickness" is inconsistent. Some characters looks thicker than other. See the screenshots below as an example:
- Looks thicker: right half of the `g` and `&` as in "Region & Language" (list-view screen)
- Looks thicker: `w` as in `Change Password` (list-view screen)
- Looks vertically compressed: `a` and `e` as in "Message" in the bottom bar (list-view screen)
- Looks thicker: `A`, `N`, `V`, `v` (paragraph screen)
- Looks thinner: `i` (paragraph screen), it leaves extra space on its right hand side

![screenshot_20180427-151129](https://user-images.githubusercontent.com/1103788/39350754-ae9fafe2-4a31-11e8-8835-97280783bb95.png)
![screenshot_20180427-151419](https://user-images.githubusercontent.com/1103788/39350755-aecc9bba-4a31-11e8-8128-2d230f003dfa.png)

Every characters has consistent "weight" and looks nice:

![screenshot_20180427-150835](https://user-images.githubusercontent.com/1103788/39350753-ae698728-4a31-11e8-8a55-4e161c559b95.png)
![screenshot_20180427-151639](https://user-images.githubusercontent.com/1103788/39350756-aef95d44-4a31-11e8-820b-1a7dee77fabe.png)

<!--
  Does this PR require a documentation change?
  Create a PR at https://github.com/facebook/react-native-website and add a link to it here.
-->

None

<!--
  Required.
  Help reviewers and the release process by writing your own release notes. See below for an example.
-->

[ANDROID] [ENHANCEMENT] [CustomStyleSpan] - Enable subpixel text rendering

<!--
  **INTERNAL and MINOR tagged notes will not be included in the next version's final release notes.**

    CATEGORY
  [----------]      TYPE
  [ CLI      ] [-------------]    LOCATION
  [ DOCS     ] [ BREAKING    ] [-------------]
  [ GENERAL  ] [ BUGFIX      ] [ {Component} ]
  [ INTERNAL ] [ ENHANCEMENT ] [ {Filename}  ]
  [ IOS      ] [ FEATURE     ] [ {Directory} ]   |-----------|
  [ ANDROID  ] [ MINOR       ] [ {Framework} ] - | {Message} |
  [----------] [-------------] [-------------]   |-----------|

 EXAMPLES:

 [IOS] [BREAKING] [FlatList] - Change a thing that breaks other things
 [ANDROID] [BUGFIX] [TextInput] - Did a thing to TextInput
 [CLI] [FEATURE] [local-cli/info/info.js] - CLI easier to do things with
 [DOCS] [BUGFIX] [GettingStarted.md] - Accidentally a thing/word
 [GENERAL] [ENHANCEMENT] [Yoga] - Added new yoga thing/position
 [INTERNAL] [FEATURE] [./scripts] - Added thing to script that nobody will see
-->
Pull Request resolved: https://github.com/facebook/react-native/pull/19043

Differential Revision: D10008155

Pulled By: hramos

fbshipit-source-id: 7fe9bb0f9be80380947ff80eac522e3cfd6b22cf
2018-09-24 02:03:31 -07:00
Krzysztof Ciombor 4d71b1525d Fix event handlers for DPad arrows on Android TV (#21143)
Summary:
<!--
Thank you for sending the PR! We appreciate you spending the time to work on these changes.
Help us understand your motivation by explaining why you decided to make this change.

If this PR fixes an issue, type "Fixes #issueNumber" to automatically close the issue when the PR is merged.
-->

Fixes #20924
DPad arrow events were missing from `KEY_EVENTS_ACTIONS` which meant that they were not broadcasted by `TVEventHandler`.
Pull Request resolved: https://github.com/facebook/react-native/pull/21143

Differential Revision: D10007851

Pulled By: mdvacca

fbshipit-source-id: 9a03cad249a4a1917975d1de10b6112e69d32a72
2018-09-24 00:47:07 -07:00
Ram N c31f79fe47 Remove class loads for CoreModulesPackage
Summary: CoreModulePackages was following the old way of adding Native Modules to the Array list. This diff changes it to use names instead of class.

Reviewed By: achen1

Differential Revision: D9996803

fbshipit-source-id: a6c3daf2193a2559db0908f9e26e339e03e4f8c7
2018-09-21 21:17:57 -07:00
Janic Duplessis a6f47d46ca Decode gzip body if not handled by okhttp (#21187)
Summary:
When looking at enabling gzip content encoding on Android I stumbled on this old issue where the body content is not decoded. It happens because okhttp only handles gzip decoding if the user does NOT provide an accept-encoding header. This is pretty confusing because on iOS we need to pass the header manually if we want to receive a gzipped response. I think it makes sense to handle the decoding no matter what.

See the comment in code for more details.

Fixed #5297
Pull Request resolved: https://github.com/facebook/react-native/pull/21187

Differential Revision: D9978889

Pulled By: hramos

fbshipit-source-id: b86791fb7d3157f325a0904225d2f63d166080d5
2018-09-20 15:07:02 -07:00
Héctor Ramos 5068dfcad3 Use Android SDK 27 in React Native
Summary:
Upgrade React Native to Android SDK 27 again, following the reversal in D9886607 (68c7999c25).

The SDK 27 is actually available internally in an alternate location that is suitable for use cases like React Native's. For future reference, SDK 28 is also available for use in this location.

Reviewed By: axe-fb

Differential Revision: D9929066

fbshipit-source-id: 9413f891d5587293a30544351340e9407a2dce55
2018-09-20 07:56:23 -07:00
Ram N 8bd570b7ba Initialize Native Modules in a separate thread
Reviewed By: achen1

Differential Revision: D9693326

fbshipit-source-id: 1ccefa4a7a320a6720bbd31f60a96f49ec5f8974
2018-09-19 23:17:34 -07:00
Ram N 0cd3994f1a Channge interface to getNativeModule to use strings instead of classes
Summary: Now that NativeModules are stored based on String keys instead of classnames, the old innterface to getNativeModules(Class moduleInterface) is deprecated. This interface is also incorrect since a native module with the same name may be overridden, causing issues. Getting native modules by name is also similar to what JavaScript does

Reviewed By: achen1

Differential Revision: D9697827

fbshipit-source-id: ff832bd2ea5e1c7cfe7d8c0c3a66f0d755b2c354
2018-09-19 19:53:00 -07:00
David Aurelio 5f31a1082b Support `!`-style fast calls for Android
Summary:
Adds support for `!`-style fast calls in Android versions < 8.

For now, this comes with the following restrictions:

- has to be enabled with a macro
- only supports native functions that return and accept primitive Java types (`jint`, `jdouble`, etc.), and `void`
- this is supposed to map to `CriticalNative` as described in https://source.android.com/devices/tech/dalvik/improvements#faster-native-methods.

Inline documentation in art: http://androidxref.com/6.0.1_r10/xref/art/runtime/jni_internal.cc#2110

Possible follow ups:
- don’t prefix when the Android runtime is too new (to avoid the warning, and future error, see http://androidxref.com/8.1.0_r33/xref/art/runtime/jni_internal.cc#2355)
- shim `CriticalNative` (see https://android.googlesource.com/platform/libcore/+/master/dalvik/src/main/java/dalvik/annotation/optimization/CriticalNative.java)
- test whether we can use `CriticalNative` at all (docs claim classes must be on bootclasspath)
- suppport `FastNative`, i.e. instance methods that can also receive and return `jobject`

Reviewed By: cjhopman

Differential Revision: D9630538

fbshipit-source-id: 0ae86c909b192429d60f8eddb15528cc38610379
2018-09-19 17:32:46 -07:00
David Vacca 6b0512c819 Enable Fabric test using Fabric C++ implementation
Summary:
This diff:
- Disables all tests but one of FabricViewTest
- Disables all tests but one of FabricBenchmarkTest
- Changes ReactAppTestActivity to run with Hermes

The reason there is only one test running in each test class, is because the tear down process of Fabric is still flaky and it produces crashes when restarting RN. We are working on this right now and we will enable the rest of the tests after that's fixed.

Reviewed By: achen1

Differential Revision: D9890700

fbshipit-source-id: a8716481eff15b77bd12b38aaaefd4e282c71f3b
2018-09-19 08:03:21 -07:00
David Vacca 7e7040b7bd Remove Fabric android implementation
Summary: This diff removes the Fabric Android implementation in favor of Fabric C++, as part of another diff I'm going to move the fabricxx package into fabric package

Reviewed By: shergin

Differential Revision: D9841240

fbshipit-source-id: c7922b7bfb9885f33b1f52237ec7cf00c1df96fb
2018-09-19 08:03:20 -07:00
Héctor Ramos 68c7999c25 Downgrade to compileSdkVersion 26
Summary:
Go back to using compileSdkVersion 26 and targetSdkVersion 26, temporarily. We can re-add this once Android SDK 27 becomes available in Facebook's internal repository.

The Android SDK Build Tools 27.0.3 **are** available, so we can continue using those.

Reviewed By: axe-fb

Differential Revision: D9886607

fbshipit-source-id: 6c1c9c1e1309c3a0483cc4c0bd8dcb4a5f29fc7e
2018-09-18 08:02:50 -07:00
David Vacca 9ad193c35b Implement Local Data in Android Fabric C++
Summary: This diff introduces the concept of Local Data in Android Fabric C++ and as an example we uses it to implement Text View.

Reviewed By: shergin

Differential Revision: D9583970

fbshipit-source-id: ab7478b16ef4327ff574ca1467870ab9cb684ea0
2018-09-17 18:49:06 -07:00
David Vacca 5c0da011cb Add support to measure shadow nodes in the FabricUIManager
Summary: In this diff I added support to be able to measure C++ shadowNode in Android. As an example I implemented the measurement of TextViews

Reviewed By: shergin

Differential Revision: D9583972

fbshipit-source-id: 1344782d4c586c94a4576b18a4acfa4775e46952
2018-09-17 18:49:05 -07:00
gengjiawen 4f49404e15 bump android target version to 27 (#20843)
Summary:
bump target version to 27
pass all current ci.
none
[GENERAL] [ANDROID] [FEATURE] - bump android target version to 27
Pull Request resolved: https://github.com/facebook/react-native/pull/20843

Differential Revision: D9845999

Pulled By: hramos

fbshipit-source-id: 3c532a2d5a2b7d201bacab54cf3d60e1efffb653
2018-09-15 05:47:09 -07:00
Dulmandakh ba608a2db7 Consolidate native dependencies versions (#20742)
Summary:
This PR tries to consolidate Android native dependencies versions to make it less error prone to version bumps.
Pull Request resolved: https://github.com/facebook/react-native/pull/20742

Differential Revision: D9818155

Pulled By: hramos

fbshipit-source-id: 9bf631640910edad5731014f4e23dbca45af2b59
2018-09-13 15:49:00 -07:00
empyrical cb87c3f410 Fix failing Android CI (#21083)
Summary:
This PR does 2 things:

 * Have Facebook internal dependencies only be added if `IS_OSS_BUILD` is `True`. This syntax is used in other BUCK files in the codebase.
    * `ReactAndroid/src/androidTest/java/com/facebook/react/tests/core/BUCK`
    * `ReactAndroid/src/androidTest/java/com/facebook/react/testing/rule/BUCK`
* Add a missing Android dependency to this BUCK file:
    * `ReactAndroid/src/main/java/com/facebook/react/BUCK`

As a result, `test_android` is passing again.
Pull Request resolved: https://github.com/facebook/react-native/pull/21083

Differential Revision: D9809808

Pulled By: hramos

fbshipit-source-id: c840ea2892006a88fe13de1b1324746d030ebaf2
2018-09-13 07:48:14 -07:00
Mehdi Mulani 737f93705c Android: Send <Text> metrics in onTextLayout events
Summary:
@public
As we're doing in D9440914 (OSS 64a52532fe), send text metrics in an onTextLayout callback. These can be used by surrounding views for doing complicated layout like:
- displaying a cursor at the end of text
- vertical centering using capheight-baseline

This right now isn't very performant but is only done when `onTextLayout` is set. I plan to optimize it with a capheight and xheight cache in a follow up diff.

Reviewed By: achen1

Differential Revision: D9585613

fbshipit-source-id: aa20535b8371d5aecf15822d66a0d973c9a7eeda
2018-09-12 14:17:27 -07:00
David Vacca 0c576ef84a Expose AllowFileAccess property in WebView
Summary: This diff adds a new property in ReactWebView to be able to configure allowFileAccess

Reviewed By: achen1

Differential Revision: D9789466

fbshipit-source-id: 39d042ac6ef69e44f006a4c4b0c2dd900f84dbc9
2018-09-12 11:49:20 -07:00
Emily Janzer 2869117127 Remove @CountEnum from OSS classes
Summary: Back out D9614432 and partially revert D9623235 to unbreak OSS.

Reviewed By: hramos

Differential Revision: D9779548

fbshipit-source-id: 931c4987ed5acbae3790c42717662fed77599335
2018-09-11 16:31:46 -07:00
Héctor Ramos 1151c096da Update copyright headers to yearless format
Summary: This change drops the year from the copyright headers and the LICENSE file.

Reviewed By: yungsters

Differential Revision: D9727774

fbshipit-source-id: df4fc1e4390733fe774b1a160dd41b4a3d83302a
2018-09-11 15:33:07 -07:00
Michael Lee c5daf3fed9 Reformat BUCK files to follow new buildifier format
Summary: buildifier was updated and now we sort loads!

Reviewed By: zertosh

Differential Revision: D9771824

fbshipit-source-id: 0001aa5f656d4aa40b3498d5bfd792a3d14e56e1
2018-09-11 15:20:48 -07:00
Jiaqi Wu 1830f9baae Add more systrance on startup
Summary: as title

Reviewed By: achen1

Differential Revision: D9729852

fbshipit-source-id: 15bb2ab4cff7f7fb1730eb354b36d7caf5cbac36
2018-09-09 14:17:00 -07:00
Emily Janzer 2434b965f2 [qpl
Summary: Renaming QPL point to VM_INIT

Differential Revision: D9734261

fbshipit-source-id: daeb339813dfebc80e774e8b64eb5e9ba30f1a2b
2018-09-08 11:48:11 -07:00
Emily Janzer dd627479c2 Add marker point for initializing Hermes
Summary: Adding a QPL point for initializing Hermes to both (MP) HOME_TTI and (RN) CORE.

Reviewed By: yungsters

Differential Revision: D9725795

fbshipit-source-id: 673f54950a2d9ebfa496a000a0d47aabf290bfc8
2018-09-07 17:51:32 -07:00
Jyrno Ader 6bc483c8cc Fix crash on overlayColor usage (#20929)
Summary:
see snack for demo on the issue: https://snack.expo.io/jyrno42/overlaycolor-issue-snack
Pull Request resolved: https://github.com/facebook/react-native/pull/20929

Differential Revision: D9727250

Pulled By: hramos

fbshipit-source-id: 03c95d4b5a38ae51ecebb8615fda1af9599c0508
2018-09-07 14:18:27 -07:00
Daniel Ignat 6e7ffff4a5 If source.method is "post", use HTTP POST method (#21010)
Summary:
The React Native Web View takes a method option to determine if HTTP GET or HTTP POST should be used.
For iPhone this is not case sensitive, meaning that `method: "post"` is allowed.
For Android "post" is not understood and therefore the request will be using HTTP GET.

I suggest we ignore case for the method, or throw an Exception.
Pull Request resolved: https://github.com/facebook/react-native/pull/21010

Differential Revision: D9700895

Pulled By: hramos

fbshipit-source-id: 3fa904e7946dd40958cb44f9a234ee66cb68fab2
2018-09-07 10:26:21 -07:00
Ram N 27348f0f07 Remove getEagerNativeModules()
Summary: An experiment was added to A/B test eager modules. Removing this experiment, as the next diff on this stack has a different way to add eager modules per route.

Reviewed By: achen1

Differential Revision: D9685803

fbshipit-source-id: ca6c91ca377b6dfaf5accda1e1f6bbfe17b1d616
2018-09-07 10:26:21 -07:00
Ram N 6da93a302e Better error message when using getNativeModule(Class)
Summary:
Some of the native modules are accessed using `getNativeModule()` may not have an `ReactModule` annotation. As a result, such native modules cannot be found.

This diff adds a better error message, and also adds the annotation to Mobile Home's `PushNotificationManager` that is accessed using the `getNativeModule()`

Differential Revision: D9697256

fbshipit-source-id: 2e2f7d2f1eb705c9c515ff40d9acbc53055c26d8
2018-09-07 10:26:21 -07:00
Ram N 4b15eb53ec Fix broken systrace message markers
Summary: SystraceMessage needs to have a flush method

Reviewed By: shergin

Differential Revision: D9696709

fbshipit-source-id: 7f8c9422fbc2e3ca8c184015889a4d1aa1500a7c
2018-09-07 10:26:21 -07:00
Andrew Chen (Eng) f38ab24a19 Fix setupReactContext systrace
Summary: setupReactContext wasn't ending because D9664719 added incorrect end markers. Need to use either Systrace.endSection() or SystraceMessage.endSection().flush().

Differential Revision: D9695854

fbshipit-source-id: e0f7d492bc58536ce242962438edac7eec671867
2018-09-07 10:26:20 -07:00
Nicolas Charpentier 0cce0a62c1 Add backface-visibility support on Android (#15970)
Summary:
`backfaceVisibility` was only available on iOS and 3D transformations were lacking on Android.

Backface Visibility is computed from ~the decomposed matrix of transform prop~ the view with their rotation degree values.

~`MatrixDecompositionContext` properties have been made public so we can access to decomposed matrix values from outside (`ReactViewGroup`).~

I'm not sure if this is the best implementation, so if it's not let's discuss it.

cc janicduplessis foghina

Tested in https://github.com/charpeni/react-native-backface-visibility.

| Before | Now |
| - | - |
| <img src="https://user-images.githubusercontent.com/7189823/30123717-e5361598-9300-11e7-8e2e-a87a7a8d896a.gif" width="260" /> | <img src="https://user-images.githubusercontent.com/7189823/30514997-4d203572-9aee-11e7-8542-bfde41678eb6.gif" width="244" /> |

| iOS | Android |
| - | - |
| <img src="https://user-images.githubusercontent.com/7189823/36995899-609513b4-2083-11e8-9834-ee44c1a292e1.gif" width="300" /> | <img src="https://user-images.githubusercontent.com/7189823/36995978-9ed3b158-2083-11e8-841e-b9e3357d2509.gif" width="240" /> |

[ANDROID] [FEATURE] [ReactViewGroup] - Add backface-visibility support on Android
Pull Request resolved: https://github.com/facebook/react-native/pull/15970

Differential Revision: D9411130

Pulled By: hramos

fbshipit-source-id: 62f646a4de37d83922286cb98893a95b55fa889e
2018-09-07 10:26:20 -07:00