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

19258 Коммитов

Автор SHA1 Сообщение Дата
Samuel Susla 5a94471650 Fabric: remove LocalData from ShadowNodeFragment
Summary:
LocalData isn't used by any components. We've moved towards State.
Changelog: [internal]

Reviewed By: mdvacca

Differential Revision: D19250603

fbshipit-source-id: f95da375117dcb8f6540a6c75d3a80bba630672c
2020-01-20 05:48:30 -08:00
Samuel Susla 55319a3fbb Remove const qualifier from codegened props
Summary:
To make testing easier, we allow mutation of Props classes.

Changelog: [Internal]

Reviewed By: shergin

Differential Revision: D19390813

fbshipit-source-id: ea8ce78de4effe1bbc002baad4e297b2d52a8ddc
2020-01-20 03:41:18 -08:00
Samuel Susla 7a8e10dac8 Use commands to send focus and blur to TextInput
Summary:
Migrate to Native commands with Blur and Focus on TextInput.

Changelog: [Internal]

Reviewed By: TheSavior, shergin

Differential Revision: D19412085

fbshipit-source-id: 33b29b2699bc74d31ef1b4b0e585daffd88c4140
2020-01-20 03:08:23 -08:00
Samuel Susla f43c9316e1 Add blur and focus native commands to TextInput
Summary:
Add Native Commands handlers to TextInput.
It is intentionally done in a way so that it can be easily swapped for codegened implementation once we properly type TextInput.

We also add native commands to view managers for backwards compatibility.

Changelog: [Internal]

Reviewed By: TheSavior, shergin

Differential Revision: D19412026

fbshipit-source-id: 8dc64275cf1da599b1bd5992a41035d51dd4148f
2020-01-20 03:08:23 -08:00
Samuel Susla 291b45b686 Add unit tests for LayoutableShadowNode::getRelativeLayoutMetrics
Summary:
Adds a bare minimum test that verifies correct behaviour of `getRelativeLayoutMetrics`.

Changelog: [internal]

Reviewed By: shergin

Differential Revision: D19449128

fbshipit-source-id: afde997a770921d580575eb0cdd04fce6252cb5a
2020-01-20 01:31:23 -08:00
Samuel Susla b3af384a13 Fix wrong layoutMetrics being returned by `measure` call
Summary:
# Logs
```
[tid:com.facebook.react.JavaScript][ConcreteViewShadowNode.h:119] width: 0   tag: 1432 debugValue: r1
[tid:com.facebook.react.JavaScript][ConcreteViewShadowNode.h:119] width: 375 tag: 1432 debugValue: r2
[tid:com.facebook.react.JavaScript][ConcreteViewShadowNode.h:119] width: 375 tag: 1432 debugValue: r2
[tid:com.facebook.react.JavaScript][UIManager.cpp:197]            width: 0   tag: 1432 debugValue: r1/sealed <----------------- FIRST TAP
[tid:com.facebook.react.JavaScript][UIManager.cpp:197]            width: 0   tag: 1432 debugValue: r1/sealed <----------------- FIRST TAP
[tid:com.facebook.react.JavaScript][ConcreteViewShadowNode.h:119] width: 375 tag: 1432 debugValue: r4
[tid:com.facebook.react.JavaScript][ConcreteViewShadowNode.h:119] width: 375 tag: 1432 debugValue: r5
[tid:com.facebook.react.JavaScript][ConcreteViewShadowNode.h:119] width: 375 tag: 1432 debugValue: r6
[tid:com.facebook.react.JavaScript][ConcreteViewShadowNode.h:119] width: 375 tag: 1432 debugValue: r7
[tid:com.facebook.react.JavaScript][ConcreteViewShadowNode.h:119] width: 375 tag: 1432 debugValue: r8
[tid:com.facebook.react.JavaScript][UIManager.cpp:197]            width: 375 tag: 1432 debugValue: r7/sealed <----------------- SECOND TAP
[tid:com.facebook.react.JavaScript][UIManager.cpp:197]            width: 375 tag: 1432 debugValue: r7/sealed <----------------- SECOND TAP
```
# What’s happening here?

Opening a *BottomSheet* and tapping the first item. As you can see before the item is tapped, it has *width* set to 375 in revision *r2*.
When the tap happens, JavaScript is requesting an old revision of ShadowNode, which still has width 0.

# My assumption.

1. Native creates node with *width* 0 and returns handle to *JS*.
2. Native *clones* the node, sets its *width* to 375, doesn’t tell *JS* about it. This update is due to state change.
3. *JS* tries to get the size of the node, but asking for first revision of the component it receives width 0.

# Other observations

1. Manually setting width to 375 in UIManager::getRelativeLayoutMetrics fixes the problem.
2. This happens only on device, I wasn’t able to reproduce this on simulator.

# Fix

Find the newest revision of ShadowNodeFamily, and return its layoutMetrics.

Changelog: [Internal]

Reviewed By: shergin

Differential Revision: D19433873

fbshipit-source-id: 4558cf6e704051e9b3968e83821d8d25b3dadcda
2020-01-20 01:31:22 -08:00
Samuel Susla 5b156f83fa Fix origin calculation in getRelativeLayoutMetrics
Summary:
# Problem
The issue is in implementation of `LayoutableShadowNode::getRelativeLayoutMetrics`.
If you have view tree (A has a child B), and you call `B.getRelativeLayoutMetrics(A)`, the expected result is B's origin within A. The implementation wasn't reflecting that, it was reflecting B's origin within A + A's origin within its parent.

# Fix
When iterating over ancestors of ShadowNode, the last ancestor should be skipped.
AncestorList is a list that starts with provided ancestor and ends with parent of `this`. To skip provided ancestor we iterate to `rend() - 1`.

# Why does it work in some cases?
This function is triggered from `UIManager.getRelativeLayoutMetrics` without `ancestorShadowNode` provided, we find the RootShadowNode, which has origin `{0, 0}`.

Changelog: [Internal]

Reviewed By: shergin

Differential Revision: D19447900

fbshipit-source-id: 4a9606dc1fab3fecfb85d337b014188d80e5b355
2020-01-20 01:31:22 -08:00
Samuel Susla 1e81b67701 Use fixtures for ShadowNodeTests
Summary:
Changelog: [Internal]

Refactor the setup code for tests to a single place.
Now there is fixed set of nodes where we test different methods of ShadowNode.

Reviewed By: shergin

Differential Revision: D19464966

fbshipit-source-id: 749e9f56ac2e5489647885b2ddcb1309eb20909a
2020-01-20 01:11:51 -08:00
Samuel Susla 582738bdc8 Use EXPECT instead of ASSERT in tests
Summary:
Changelog: [Internal]

1. Replace ASSERT_* with EXPECT_*. Assert is a fatal assertion. Expect is non-fatal assertion. So if assert fails, tests do not continue and therefore provide less information.

2. Rename tests in `RawPropsTest.cpp` from `ShadowNodeTest` to `RawPropsTest`.

Source: https://github.com/google/googletest/blob/master/googletest/docs/primer.md#basic-assertions

Reviewed By: shergin

Differential Revision: D19464967

fbshipit-source-id: add83751ebdb0a12fbf8f70b851747aa5624366a
2020-01-20 01:11:50 -08:00
Scott Kyle 84adc85523 Export exception classes with default visibility
Summary:
This fixes a crash caused by a `JSError` exception not being successfully caught in a different dynamic library from where it was thrown. Since the libraries were compiled with hidden symbols and loaded with `RTLD_LOCAL`, the exception typeinfo becomes unique to each module.

Reading on this subject:
https://gcc.gnu.org/wiki/Visibility
https://stackoverflow.com/questions/14268736/symbol-visibility-exceptions-runtime-error

Reviewed By: mhorowitz

Differential Revision: D19343161

fbshipit-source-id: 4eb3bc2576bbcca2c3aef4f52b5a27dfde214c6a
2020-01-19 00:10:38 -08:00
David Vacca 475df0699d Fix rendering of FB emoji in RN Android
Summary:
This diff ensures the measurement and rendering of FB emojis is correnct in RN Android.
Before this commit we were customizing Spannable object with FB emojis right before rendering the text into the TextView, this diff ensures that the Spannable is "customized" as soon as it is created, ensuring the measurement of the Text.

changelog: [internal]

Reviewed By: JoshuaGross

Differential Revision: D19354107

fbshipit-source-id: 92e07cf30503404f7820f25eaa9efdc02f6bddbd
2020-01-18 18:47:43 -08:00
Emily Janzer bef845ffd5 Save a copy of DisplayMetrics native map in DeviceInfoModule
Summary:
After some more testing, I discovered a problem in D19395326 because the native map that DeviceInfoModule was storing in `mPreviousDisplayMetrics` had been consumed when the event was emitted to JS. This caused the comparison to fail, so it would emit the event again when the dimensions hadn't changed.

In this diff, I'm storing a Java-only copy of the native map before emitting the event to JS so this shouldn't happen.

Changelog: [Android][Fixed] Fix bug in updating dimensions in JS

Reviewed By: mdvacca

Differential Revision: D19462861

fbshipit-source-id: 2e47479df93377b85fe87f255972dd31e874e3a8
2020-01-18 12:00:07 -08:00
Emily Janzer cc3e27d484 Don't update dimensions for a new ReactRootView if they haven't changed
Summary:
ReactRootView currently caches the last seen DisplayMetrics so we can compare them against the current values in DisplayMetricsHolder to determine if the screen dimensions have changed. (If they have changed, we emit an event to notify JS of the new dimensions).

However, ReactRootView initializes these member variables with empty DisplayMetrics, which means that the first time we check against them in onGlobalLayout, we will *always* emit an event to JS.

This seems reasonable if you only have one ReactRootView, but if you create a new RRV for each RN screen in your app, then you're going to get updated dimensions on each navigation event, even though the screen dimensions have probably not changed.

In this diff, I'm no longer storing the DisplayMetrics in ReactRootView at all, but instead am using temporary variables to check the new DisplayMetrics values against the old.

Changelog: [Android][Fixed] Only update dimensions in ReactRootView if they've changed

Reviewed By: JoshuaGross, mdvacca

Differential Revision: D19395326

fbshipit-source-id: c01aee73064764503c9b49208032c790b83a1d29
2020-01-17 21:13:22 -08:00
Frieder Bluemle a89a553532 Update Gradle wrapper to 6.1 (#27800)
Summary:
```
Welcome to Gradle 6.1!

Here are the highlights of this release:
 - Dependency cache is relocatable
 - Configurable compilation order between Groovy, Java & Scala
 - New sample projects in Gradle's documentation

For more details see https://docs.gradle.org/6.1/release-notes.html
```

## Changelog

[Android] [Changed] - Update Gradle wrapper to 6.1
Pull Request resolved: https://github.com/facebook/react-native/pull/27800

Test Plan: Build project

Differential Revision: D19460735

Pulled By: mdvacca

fbshipit-source-id: b5e71cf97c0208947d6e524a74907b74f6a71c8d
2020-01-17 21:10:42 -08:00
Peter Argany 8fe04cfd7e Migrate RCTDevSettings to TM
Summary: As titled. The work to write the spec and make this module compatible were done in D18148890.

Reviewed By: RSNara

Differential Revision: D19442016

fbshipit-source-id: 369bb4247d6590d41ec414f93c79d98d4a6bed88
2020-01-17 17:22:14 -08:00
Héctor Ramos e69ce88ef6 Use Xcode 11.3.0 and iOS 13.3 in tests (#27783)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/27783

Use Xcode 11.3.0 to run tests, using an iPhone 8 simulator running iOS 13.3.

Snapshot tests disabled as they're failing on Circle CI.

Changelog:
[iOS] [Changed] - Use Xcode 11.3 and iOS 13.3 simulator in iOS tests

Reviewed By: PeteTheHeat

Differential Revision: D19411972

fbshipit-source-id: 3ddef9e6fbdbd3c35271732fc6d6d74de099230e
2020-01-17 16:42:56 -08:00
Rajat Gupta 9457efa84c Always update background color and bar style on Android status bar
Summary: Changelog: [Fix] Fix status bar color not updating when navigating between two screens with the same status bar color.

Reviewed By: RSNara

Differential Revision: D19439424

fbshipit-source-id: 44388f1f94c87c12102471d72183bb6c152a46b6
2020-01-17 16:14:57 -08:00
Ramanpreet Nara 44678bbf76 Add @DoNotStrip annotation to getJavaModule
Summary:
For some reason, I think this method is being optimized away, which is really strange considering that it's being used in getModule.

Changelog:
[Internal]

Reviewed By: ejanzer

Differential Revision: D19454855

fbshipit-source-id: 414b4888f7aacf730dd22939e2e2140b94dff4e7
2020-01-17 16:00:01 -08:00
Peter Argany 459c54c407 Refactor RCTTurboModuleManager to take in a CallInvoker
Summary:
In bridgeless mode, `RCTTurboModuleManager` is initialized with a nil bridge. This has mostly worked, since `RCTBridge` doesn't do too many things for TMM (some notifs and perf markers). The one important thing it provides is a `_jsInvoker`.

In bridgeless mode, up until this point `_jsInvoker` has been nil, and turbo modules were not able to call functions on the JS thread. This diff fixes that.

Reviewed By: RSNara

Differential Revision: D19437174

fbshipit-source-id: 86bfc0a47bd9576e7d3203b860e86446eb0b63dd
2020-01-17 15:55:25 -08:00
Samuel Susla dd476d0506 Run rn-native-modules/specs/update_oss to stop tests from failing
Summary:
Changelog: [Internal]

Fix following test failure

```
Date: 2020-01-17 07:18:10.533721
Step JSON: {"name": "Test: Verify OSS NativeModules Specs for iOS are up-to-date.", "continue_after_user_failure": true, "timeout": 3600, "shell": "cd \"$(hg root)/xplat/js\" && NODE_ENV=test scripts/rn-native-modules/specs/update_oss ios", "env": {}}
Command: cd "$(hg root)/xplat/js" && NODE_ENV=test scripts/rn-native-modules/specs/update_oss ios
Exit code: 1
Stdout:
Building OSS NativeModule Specs - platform: ios...
Stderr:
Starting new Buck daemon...
Using additional configuration options from .buckconfig.local, /etc/buckconfig.d/sandcastle
PARSING BUCK FILES: FINISHED IN 5.9s
CREATING ACTION GRAPH: FINISHED IN 0.1s
DOWNLOADED 0 ARTIFACTS, 0.00 BYTES, 0.0% CACHE MISS
BUILDING: FINISHED IN 8.5s (100%) 1/1 JOBS, 1 UPDATED
Top slow rules
    //xplat/js:FBReactNativeSpec-flow-types-ios: 0.1s
BUILD SUCCEEDED
More details at https://our.intern.facebook.com/intern/buck/build/d68bbc08-49cf-4ef5-8eba-51d79bea09ba
Error: Spec files are not up-to-date, please re-run 'js1 build oss-native-modules-specs -p ios'!
    at main.then.updated (/data/sandcastle/boxes/trunk-hg-fbobjc-fbsource/xplat/js/scripts/rn-native-modules/specs/update-specs.js:96:15)
```

I ran `js1 build oss-native-modules-specs -p ios` to fix it.

Reviewed By: PeteTheHeat

Differential Revision: D19450371

fbshipit-source-id: 0957298ad70ad3e8feca96622cd29ed223438961
2020-01-17 11:21:56 -08:00
Nat Mote c40988cc22 Deploy Flow v0.116 to xplat
Summary: Changelog: [Internal]

Reviewed By: gkz

Differential Revision: D19416307

fbshipit-source-id: 32767f24e5bfeb1912f7dd5527eb8c4db7a08a1a
2020-01-16 14:05:49 -08:00
Ramanpreet Nara ce18521c9e Ensure TurboModuleManager.getModule also queries CxxModuleWrappers
Summary:
We should also call `TurboModuleManager.getLegacyCxxModule('foo')` when we call `TurboModuleManager.getModule('foo')` is called.

This fixes a Marketplace crash. See: D19432594

Changelog:
[Android][Fixed] - Ensure TMM.getModule also queries CxxModuleWrappers

Reviewed By: ejanzer

Differential Revision: D19434549

fbshipit-source-id: cff741cf1587d2a0dbcdc5eb95016c8aa283b727
2020-01-16 13:38:10 -08:00
Jordan Brown 434526e13d Get rid of implicit exact object in PickerExample
Summary:
In order to be sure that 0.62 does not require an exact-by-default codebase, we should get rid of any `{}` occurrences inside of react-native-github. If all the object types in react-native-github are either explicitly exact `{||}` or explicitly inexact `{...}` then those object types will have consistent semantics regardless of the Flow settings in the client codebase.

Changelog: [Internal]

Reviewed By: rickhanlonii

Differential Revision: D19347283

fbshipit-source-id: 4c199bd7f1684b70df1b1c717941d0d477f67117
2020-01-16 12:46:07 -08:00
Riley Dulin 0ee7fb98cc Update the chrome devtools protocol for the inspector
Summary:
Changelog: [Internal] Upgrade Chrome devtools protocol for Hermes

Update to the most recent version of the devtools protocol, r730699.
This just adds a few parameters to the stable API.
They have reasonable defaults that shouldn't break the existing functionality.

Reviewed By: willholen

Differential Revision: D19387559

fbshipit-source-id: 49d9ebf4a1a20f349ea6e46be6d5f36184ba8afb
2020-01-15 16:52:19 -08:00
Riley Dulin 46351cc276 Use the devtools-protocol npm package to generate code
Summary:
Changelog: [Internal]

Before, we were relying on checking out the `devtools-protocol` Github repo at a specific commit and
making special changes to the JSON file.
In order to make it easier to update, use the officially published npm package.

I found the closest package version that was published, but it had two differences:
* `Runtime.getHeapUsage` was either missing (in earlier versions) or experimental (in later versions)
* `isDefault` and `isPageContext` were removed. I'm not sure what these were used for anyway, the comment leads me to believe they're probably not necessary anymore

There were some customizations made previously to annotate `recursive` on some properties. The npm package doesn't set these,
so I wrote some checks to add it back in if it can be detected. This was mostly to handle one special case: `Runtime.StackTrace`.
The workaround seems to be fine for that case.

Reviewed By: willholen

Differential Revision: D19386890

fbshipit-source-id: db0d85f6bc71cba77ee67d85efe2f38376d7cc87
2020-01-15 16:52:18 -08:00
Riley Dulin 4b703e3c1f Remove .flowconfig from hermes/inspector/tools/msggen
Summary:
Changelog: [Internal]

This separate `.flowconfig` file was causing versioning issues.
Delete it so that `msggen` can share the same flowconfig as the rest
of React Native.

Reviewed By: willholen

Differential Revision: D19413710

fbshipit-source-id: 748cb50a3151df1c67ee7176e57e259e48f50be7
2020-01-15 16:52:18 -08:00
Kevin Gozali 58a6a40eac Re-land [RN] iOS - deprecate iOS 9 support by removing runtime checks for 10.0+
Summary:
Re-landing the reverted change:

This removes all callsites that rely on runtime checks to detect the target deployment version. We no longer need to check for iOS 10+ in a few places. Note: for this to compile, the hosting app needs to target iOS 10.0+.

Changelog: [iOS] [Deprecated] - Deprecate iOS 9

Reviewed By: sammy-SC

Differential Revision: D19411136

fbshipit-source-id: ec0a957dc57819f0ee7d138c858209cabe3e5102
2020-01-15 09:23:30 -08:00
Jiawei Lv f11937ef65 Revert D19271321: iOS - deprecate iOS 9 support by removing runtime checks for 10.0+
Differential Revision:
D19271321

Original commit changeset: 424ad7e21612

fbshipit-source-id: 2bd9599e8fb31914dbcbc03f732379d6c8103028
2020-01-14 21:43:08 -08:00
Héctor Ramos 8b735a2c1e Skip testNotUTF8Convertible (correct path) (#27767)
Summary:
Use correct path to testNotUTF8Convertible which is being skipped.

## Changelog

[Internal] - Use correct path to testNotUTF8Convertible which is being skipped.
Pull Request resolved: https://github.com/facebook/react-native/pull/27767

Test Plan: Circle CI

Differential Revision: D19404469

Pulled By: hramos

fbshipit-source-id: 70cf06c90dac74ac7963b9a35a543e11b21ba471
2020-01-14 18:23:49 -08:00
Kevin Gozali d3e81d5832 iOS - deprecate iOS 9 support by removing runtime checks for 10.0+
Summary:
This removes all callsites that rely on runtime checks to detect the target deployment version. We no longer need to check for iOS 10+ in a few places. Note: for this to compile, the hosting app needs to target iOS 10.0+.

Changelog: [iOS] [Deprecated] - Deprecate iOS 9

Reviewed By: hramos

Differential Revision: D19271321

fbshipit-source-id: 424ad7e2161261d148cb436cc20b4c531a4ba5b7
2020-01-14 18:23:49 -08:00
Kevin Gozali 9d36375b66 iOS: mark apple_library()'s to target SDK 10
Summary:
This forces individual rn libraries to target SDK 10+

Changelog: [Internal]

Reviewed By: PeteTheHeat

Differential Revision: D19382542

fbshipit-source-id: f4cdebc82a03578134d1de4c9d8a7923fa128e65
2020-01-14 18:23:49 -08:00
Héctor Ramos ace68f03e8 Use correct location for buck_to_junit (#27766)
Summary:
`test_android`'s Test Collection step fails when it attempts to convert buck's output to the junit-compatible format that Circle CI expects. Executing the script from the `okbuck` location should help here.

## Changelog

[Internal] - Use correct location for buck_to_junit in test_android CI step
Pull Request resolved: https://github.com/facebook/react-native/pull/27766

Test Plan: Circle CI

Differential Revision: D19403837

Pulled By: hramos

fbshipit-source-id: 44e599ab653e7412340c3dcfdc45c5d37bcea1ee
2020-01-14 18:23:48 -08:00
Ramanpreet Nara cd833c3bb0 Make remaining NativeModules TurboModule-compatible
Summary:
This converts all NativeModules excluding the following into TurboModules:

```
// Deleted
"fbsource/fbandroid/java/com/facebook/catalyst/modules/relaynativecache/RelayNativeCacheReaderModule.java"

// Owners of FBC will migrate these by themselves
"fbsource/xplat/fbc-mobile-app/android/app/src/main/java/com/fbc/i18n/FBCi18nAssetsModule.java"
"fbsource/xplat/fbc-mobile-app/android/app/src/main/java/com/fbc/react/CellScanResultsModule.java"
"fbsource/xplat/fbc-mobile-app/android/app/src/main/java/com/fbc/react/WiFiScanResultsModule.java"

// Don't have Buck owners
"fbsource/xplat/js/react-native-fbsdk/android/src/main/java/com/facebook/reactnative/androidsdk/FBAccessTokenModule.java"
"fbsource/xplat/js/react-native-fbsdk/android/src/main/java/com/facebook/reactnative/androidsdk/FBGraphRequestModule.java"
"fbsource/xplat/js/react-native-fbsdk/android/src/main/java/com/facebook/reactnative/androidsdk/FBLoginManagerModule.java"
"fbsource/xplat/js/react-native-fbsdk/android/src/main/java/com/facebook/reactnative/androidsdk/FBShareAPIModule.java"
"fbsource/xplat/intl/oss-fbt/__github__/react-native-fbt-android-native-module/android/src/main/java/com/reactlibrary/FbtAndroidNativeModule.java"
```

This should conclude the Android TurboModule migration.

Changelog:
[Android][Added] - Make remaining NativeModules TurboModule-compatible

Reviewed By: PeteTheHeat

Differential Revision: D19383442

fbshipit-source-id: 71beaee087f6436b197a65f0d68527d9964bb6ce
2020-01-14 16:39:54 -08:00
Ramanpreet Nara 4eb389d069 Ensure NativeModules depend on their spec's owners
Summary:
For every untyped NativeModule Java file, we ensure that its owner depends on the owner of its JS spec.

Changelog:
[Internal]

Reviewed By: PeteTheHeat

Differential Revision: D19382937

fbshipit-source-id: 0a1d840bff2f9e8db0f06c910448e9b25415d18c
2020-01-14 16:39:54 -08:00
Héctor Ramos 05f1bb3dd4 Bump Homebrew cache key (#27764)
Summary:
Trivial: bump Circle CI Homebrew cache key to move past cache error in CI builds.

Changelog:
[Internal] - Bump Homebrew cache key on Circle CI

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

Differential Revision: D19401723

Pulled By: hramos

fbshipit-source-id: cec18ea68ac141ab85ad694ac261d98cbf0e4440
2020-01-14 16:36:29 -08:00
Nate Stedman 644eb0a961 Revert D19400656: Revert D19377037: [fb_apple_library][codemod][12/12] Add extension API parameters to libraries
Differential Revision:
D19400656

Original commit changeset: 57deddfd6006

fbshipit-source-id: 5271e9faa002ff64508d8e52d0c60bf7a362ff02
2020-01-14 15:27:31 -08:00
Shubho Sadhu 89823c944b Revert D19377037: Add extension API parameters to libraries
Differential Revision:
D19377037

Original commit changeset: 3026a3400570

fbshipit-source-id: 57deddfd6006c6d171a005f4dd35e1d1df30de64
2020-01-14 14:45:39 -08:00
Héctor Ramos 9fb2ca0b53 Bump Xcode to 11.2.1 (#27434)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/27434
Pull Request resolved: https://github.com/facebook/react-native/pull/27295

- Use Xcode version 11.2.1 in both internal and external tests.
- Update snapshot reference images to use iPhone 8 test device.

Xcode 11.3.0 will be available in Sandcastle in the next week or so.

Changelog:

[Internal] - Bump Xcode version used in tests to 11.2.1.
[Internal] - Update iOS Snapshots.

Reviewed By: cs01

Differential Revision: D18849584

fbshipit-source-id: 9e3b92f080a4dc6a15dac0535b7562ff6a5c08a9
2020-01-14 13:30:05 -08:00
Oleksandr Melnykov 7c066ae952 Integrate WebView into Fabric on Android
Summary:
This diff integrates WebView into Fabric on Android.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D19177933

fbshipit-source-id: 0586f2a44201ee867756e000923859a73ec68ab9
2020-01-14 11:36:57 -08:00
David Vacca dbb7eacb42 Add support to render <View> with no fixed size nested within a <Text>
Summary:
This diff fixes the redbox error: Views nested within a <Text> must have a width and height

This error is reproducible when rendering a View with no fixed size, inside a <Text>. e.g.
```
function PlaygroundContent(props: {}) {
  return (
    <View style={styles.container}>
      <Text>
        <View>
          <Image source={fbicon.filled('chevron-down', 10)} />
        </View>
      </Text>
    </View>
  );
}
```

changelog: Add support to render <View> with no fixed size nested within a <Text>

Reviewed By: shergin

Differential Revision: D19387760

fbshipit-source-id: a9cee8410e56a2d362d6b8f993e602719c416925
2020-01-14 09:05:21 -08:00
Ramanpreet Nara 7e3a43c23d Fix NativeJSCHeapCapture
Summary:
In D15393464, we introduced `NativeHeapCapture`, but it had a few problems:
1. It required `JSCHeapCapture` by doing `TurboModuleRegistry.get<Spec>('HeapCapture')`, when it should have done `TurboModuleRegistry.get<Spec>('JSCHeapCapture')`.
2. It had an additional method `captureHeap`, which didn't exist on the Android NativeModule.

This diff corrects those mistakes.

Changelog:
[Both][Fixed] - Fix JSCHeapCapture

Reviewed By: PeteTheHeat

Differential Revision: D19383511

fbshipit-source-id: 30e69afbcdba673f3f32c16bde4f0342568ab97d
2020-01-14 08:03:49 -08:00
Samuel Susla 6bdfd84a45 Move event structs into event emitter namespace
Summary:
In codegen we generate structs that represents events. These structs are later dispatched by generated `EventEmitter`.
They had unpleasant naming, for example `SliderOnValueChangeStruct`. This diff changes the code generated so it becomes `SliderEventEmitter::OnValueChange`, this better expresses the relationship of the two classes.

Changelog: [Internal]

Motivation: Better express relationship between EventEmitter and classes that represent events.

Reviewed By: rickhanlonii, shergin

Differential Revision: D19373850

fbshipit-source-id: a5eea085013dbc119169e2b06ba9f9fe44c7fcd9
2020-01-14 06:39:33 -08:00
Samuel Susla f15b80b675 Migrate Keyframes to Fabric using interop layer
Summary:
Adds Keyframes to interop whitelist of supported components.
In `RCTKeyframesManager.m` we look into subviews in order to find `RCTKeyframesView`, this is because the view returned from paper's `UIManager` is interop itself.

Changelog: [Internal]

Reviewed By: shergin

Differential Revision: D19309355

fbshipit-source-id: f9b598ee6ad5340a4e4b3914330c70eea9f43926
2020-01-14 06:30:35 -08:00
Samuel Susla fca833e2ae Fix handling of nil event in legacy interop layer's eventInterceptor
Summary:
interop layer doesn't deal with `nil` being sent as event, example https://fburl.com/diffusion/t5zx6xm0.

This later triggers following assertion https://fburl.com/diffusion/dr5xzgic.

Changelog: [Internal]

Reviewed By: shergin

Differential Revision: D19309356

fbshipit-source-id: 82b3841c337f949ce7ca0b875c98f608edddb599
2020-01-14 06:30:35 -08:00
Samuel Susla 139bf7cffe Add plugin assertion to ensure image component is loaded
Summary:
With plugins being used for components, there is danger that someone will remove buck target as dependency and component in the target won't be available for Fabric.

That's where `plugin_assertion` comes into play. For now I hardcoded a list of components. In the future, this list will be generated from JS components that are used in the app.

Changelog: [Internal]

Reviewed By: shergin

Differential Revision: D19197548

fbshipit-source-id: 0d31f53b573c343561715a8fb6fc7f0abfdb5b76
2020-01-14 04:05:16 -08:00
Oleksandr Melnykov e848b0036d Use commands instead of setNativeProps for PickerAndroid
Summary:
Fabric doesn't support setNativeProps, so we are using view commands instead.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D18044169

fbshipit-source-id: d5f199b930244d02f174ea8a7ef732e9a8ef2476
2020-01-14 03:57:28 -08:00
Oleksandr Melnykov 1e6e37a3a8 Use commands instead of setNativeProps for AndroidSwipeRefreshLayout
Summary:
As a part of the migration from setNativeProps in Fabric and Paper, we are replacing it by view commands in the RefreshControl component on Android.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D18475450

fbshipit-source-id: ad89547fada3444f725fd9b00e8482cfc8f4d7fc
2020-01-14 03:53:57 -08:00
Oleksandr Melnykov 461d68e656 Use commands instead of setNativeProps for CheckBox
Summary:
As a part of the migration from setNativeProps in Fabric and Paper, we are replacing it by view commands in the Checkbox component on Android.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D18451749

fbshipit-source-id: 49d786ef3383df95b10260ba2b7f68489ad31789
2020-01-14 03:44:25 -08:00
Pascal Hartig d5ba113bb2 clang-format cpp
Summary:
Ran `arc f` against some CPP files to be modified with the next diff
to reduce the churn on it.

## Changelog

[Android] [Changed] - Formatted cpp/h code with clang-format

Reviewed By: javache

Differential Revision: D19371785

fbshipit-source-id: b7f7b92c4cb9ec7f8da728bb577db29cf11fbb39
2020-01-14 01:04:16 -08:00
Nate Stedman 8d57691a60 Add extension API parameters to libraries
Summary: Changelog: [Internal]

Differential Revision: D19377037

fbshipit-source-id: 3026a34005707fb371df60eaacd142988b012751
2020-01-13 23:26:15 -08:00