Commit Graph

4463 Commits

Author SHA1 Message Date
Ramanpreet Nara ef145adb9d Split NativeImageStore into iOS and Android counterparts
Summary:
Split the two specs, so that that we don't have to use Flow unions in the merged spec.

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D23800841

fbshipit-source-id: 28b67578832ebd733bd080877e4ab763c013fded
2020-09-29 14:39:37 -07:00
Joshua Gross c06f765f7d Allow Java classes to hook into ScrollView scroll and layout events
Summary:
For advanced interop cases.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D23984345

fbshipit-source-id: f5c2a43a1bf5937f9974bcc5c66c36ec35e679c5
2020-09-29 13:19:11 -07:00
Lulu Wu 121141c86b Convert AndroidDialogPicker to JS view configs
Summary:
Convert AndroidDialogPicker to JS view configs

Changelog: [Internal]

Reviewed By: ejanzer

Differential Revision: D23911673

fbshipit-source-id: d5fefa997432f0096308ab5593ba74c2c07b71e1
2020-09-29 05:16:48 -07:00
Samuel Susla 2c896d3578 Do not attach root view until size is available
Summary:
Changelog: [internal]

# Why is text laid out twice in Fabric?

Layout constraints (min and max size) change during startup of Fabric surface.
1. `Scheduler::startSurface` is called with max size being {inf, inf}.
2. `Scheduler::constraintSurfaceLayout` is called with max size equal to viewport.

These are two operations that don't happen one after the other and on Android, CompleteRoot is called from JS before second operation is called. This triggers layout with max size {inf, inf} and later when second operation is called. Layout happens again now with correct size.

# Fix
Make sure `Scheduler::startSurface` is called with proper values and not {inf, inf}.

Reviewed By: JoshuaGross, yungsters

Differential Revision: D23866735

fbshipit-source-id: b16307543cc75c689d0c1f0a16aa581458f7417d
2020-09-28 04:20:55 -07:00
Lulu Wu 863dd2df23 Make blocking people work in Dating Settings
Summary:
Blocking people didn't work in Dating Settings without the Bridge.

Changelog: [Internal]

Reviewed By: ejanzer

Differential Revision: D23904867

fbshipit-source-id: 4a68b9d99fcc812f6616783a06dc047a3bc64491
2020-09-28 03:10:01 -07:00
Kevin Gozali 4072b1865a TurboModule Android: rename libreact_nativemodule_manager to libturbomodulejsijni
Summary:
TurboModule Java files are still using the old lib name: `turbomodulejsijni`, so let's keep it that way for now.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D23946945

fbshipit-source-id: ff095ff51dca532c82e67e1c75e9a4e9be392d61
2020-09-25 22:14:56 -07:00
Kevin Gozali 45a4a67965 Android: consolidate various prebuilt C++ .so configuration into Android-prebuilt.mk
Summary:
To make it easier for hosting app or other lib to get access to the ReactAndroidNdk .so outputs, let's define common targets in a dedicated Android-prebuilt.mk. Hosting app's Android.mk just need to include the mk path.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D23938538

fbshipit-source-id: 850d690326d134212d5f040c6fa54ab50c53cb87
2020-09-25 22:14:56 -07:00
Michael Yoon (LAX) 1438543a2f round up layoutWidth for Android 11 in ReactTextShadowNode
Summary:
in Android 11, there's an issue where Text content is being clipped. The root cause appears to be a breaking change in how Android 11 is measuring text. rounding up the layoutWidth calculation mitigates the issue.

Changelog: [Internal]

Reviewed By: JoshuaGross

Differential Revision: D23944772

fbshipit-source-id: 1639259da1c2c507c6bfc80fed377577316febac
2020-09-25 19:06:18 -07:00
Lulu Wu c2447d3f76 Follow-up for fixing xiaomi NullPointer crash
Summary:
This is a follow-up for fixing the xiaomi NullPointer crash (D23331828 (https://github.com/facebook/react-native/commit/07a597ad185c8c31ac38bdd4d022b0b880d02859) D23451929 (https://github.com/facebook/react-native/commit/b5b4a7041027fd767850a564b5d80fa4a98ba2a2)):

1, Clean up previous temporary fix in js.

2, Cover all cases including caretHidden is set and isn't set, in previous fix if caretHidden isn't set then fix won't be executed.

Changelog: [Internal]

Reviewed By: makovkastar

Differential Revision: D23816541

fbshipit-source-id: a7543f6767430abb74141a747b08391986662958
2020-09-25 05:33:51 -07:00
Samuel Susla d5f7622611 Fix rounding issue when setting padding
Summary:
Changelog: [Internal]

Padding needs to be rounded down (floor function), not rounded to the closest natural number.
Otherwise the content of the view might not fit.

Reviewed By: JoshuaGross

Differential Revision: D23905145

fbshipit-source-id: e84d70155b207144b98646dd0c4fea7a8c4bd876
2020-09-24 10:40:51 -07:00
Samuel Susla 246f746942 Set useLineSpacingFromFallbacks when measuring text
Summary:
Changelog: [internal]

When paper measures text, it sets `useLineSpacingFromFallbacks` flag on the Layout object. In Fabric this was missing and can cause incorrect layout.

Reviewed By: JoshuaGross

Differential Revision: D23845441

fbshipit-source-id: 538f440cdbbf8df2cba0458837b80db103888113
2020-09-23 06:03:11 -07:00
Emily Janzer e125f12c01 Add new ReactMarkers for bridgeless init start/end
Summary: Adding two new ReactMarkers for start and end of bridgeless initialization. Creating new ones instead of reusing existing ones to make it easier to differentiate data from the bridge vs. bridgeless, and also because our existing markers 1) aren't very easy to understand, and 2) don't map cleanly to the new architecture.

Reviewed By: PeteTheHeat

Differential Revision: D23789156

fbshipit-source-id: 2ed10769e08604e591503a2bc9566aeb1d0563ed
2020-09-22 14:49:31 -07:00
Samuel Susla a650696f0d Implement onTextLayout on Text component.
Summary:
Changelog: [Internal]

Add `Text.onTextLayout` implementation to Android's Text component.

Reviewed By: JoshuaGross

Differential Revision: D23782311

fbshipit-source-id: fdb5709aaf68efee0ab895a6661396f92cfc768a
2020-09-22 01:53:24 -07:00
Samuel Susla c1af56df71 Wire call from C++ to Java to get lines measurements
Summary: Changelog: [Internal]

Reviewed By: shergin

Differential Revision: D23782998

fbshipit-source-id: fa9bda274c024d5bbd3ca24f394b5d76f8c07ad2
2020-09-22 01:53:24 -07:00
Samuel Susla acb967e1bb Pull out construction of Layout from TextLayoutManager.measureText into separate function
Summary:
Changelog: [Internal]

Construction of Layout will be needed in `TextLayoutManager.measureLines`, pulling it out into separate function prevents code duplication.

Reviewed By: shergin

Differential Revision: D23782905

fbshipit-source-id: 8ab817559ca154716a190ca1012e809c5fa2fd6e
2020-09-22 01:53:24 -07:00
Kevin Gozali 2b46fd065f Codegen Android: Compile ReactAndroid codegen C++ output
Summary:
Now that the react-native-codegen produces the Android.mk for the JNI C++ output, let's compile them into its own shared library, to be included in the ReactAndroid final deliverable: libreact_codegen_reactandroidspec.so. This is gated behind `USE_CODEGEN` env var.

Note: RNTester specific C++ spec files are not compiled here.

Changelog: [Internal]

Reviewed By: shergin

Differential Revision: D23809081

fbshipit-source-id: 7a90f420a923d5d02654facac01ffe025c321e44
2020-09-21 11:09:12 -07:00
Kevin Gozali 5be44456f2 TurboModule Android: compile TurboModule C++ Core into ReactAndroid
Summary:
This is to prepare for enabling TurboModule on Android. This commit compiles in all the core files (C++) into the ReactAndroid NDK build step. This doesn't yet enable TurboModule by default, just compiling in the infra, just like for iOS.

New shared libs:
* libreact_nativemodule_core.so: The TurboModule Android core
* libreact_nativemodule_manager.so: The TurboModule manager/delegate

To be compatible with `<ReactCommon/` .h include prefix, the files had to move to local `ReactCommon` subdirs.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D23805717

fbshipit-source-id: b41c392a592dd095ae003f7b2a689f4add2c37a9
2020-09-20 14:23:43 -07:00
Joshua Gross 7b82df287d Notify ViewManagers when a View is deleted
Summary:
In a previous recent diff we changed Android's Delete mount instruction to *not* recursively delete the tree. This is fine, but because of that, we stopped calling `onDropViewInstance` when views are normally deleted.

Bring back that behaviour.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D23801666

fbshipit-source-id: 54e6b52ab51fff2a45102e37077fe41081499888
2020-09-19 02:33:30 -07:00
Kevin Gozali 7c93f5b001 Move TurboModule Core from ReactCommon/turbomodule to ReactCommon/react/nativemodule
Summary:
This diff moves the code of TurboModule Core from ReactCommon/turbomodule to ReactCommon/react/nativemodule

For iOS: Pod spec name stays as "ReactCommon/turbomodule/..." for now, only the source/header location is affected. The target will be renamed/restructured closer to TurboModule rollout.

changelog: [internal] Internal

Reviewed By: RSNara

Differential Revision: D23362253

fbshipit-source-id: c2c8207578e50821c7573255d4319b9051b58a37
2020-09-19 00:42:30 -07:00
Joshua Gross 03448715af Have BatchMountItem log the exact item that crashes
Summary:
Because BatchMountItem executes many items, sometimes it's unclear which MountItem causes a crash. Catch and log the exact item.

This shouldn't cause perf regressions because we have a try/catch block in FabricUIManager where execute is called.

Changelog: [Internal]

Reviewed By: shergin

Differential Revision: D23775500

fbshipit-source-id: c878e085c23d3d3a7ef02a34e5aca57759376aa6
2020-09-18 16:38:32 -07:00
Joshua Gross fa44c46e37 Fix flattening/unflattening case on Android
Summary:
There are cases where we Delete+Create a node in the same frame. Practically, the new differ should prevent this, but we don't want to rely on that necessarily.

See comments for further justification on why deleteView can do less work overall.

In reparenting cases, this causes crashes because dropView removes *and deletes* children that shouldn't necessarily be deleted.

Changelog: [Internal]

Reviewed By: shergin

Differential Revision: D23775453

fbshipit-source-id: c577c5af8c27cfb185d527f0afd8aeb08ee3a5fe
2020-09-18 16:38:32 -07:00
Ramanpreet Nara 9b094ee77a Stop accessing JVM in ~JavaTurboModule
Summary:
Inside JavaTurboModule, the native `CallInvoker` is used to schedule work on the NativeModules thread. So, in ~JavaTurboModule(), I scheduled some work on the NativeModules thread. This work holds a copy of the JNI global reference to the Java NativeModule object, and when it's executed, it resets this global reference to the Java NativeModule object. This should ensure that the we don't access the JVM in ~JavaTurboModule, which could crash the program.

I also removed the redundant `quitSynchronous()` in `~CatalystInstanceImpl()`, to prevent the NativeModules thread from being deleted before we delete the `jsi::Runtime`. This shouldn't cause an issue, because we delete the NativeModules thread when we call [ReactQueueConfigurationImpl.destroy()](https://fburl.com/codesearch/p7aurwn3).

Changelog: [Internal]

Reviewed By: ejanzer

Differential Revision: D23744777

fbshipit-source-id: a5c8d3f2ac4287dfef9a4b4404a04b335aa0963d
2020-09-17 16:06:48 -07:00
Samuel Susla 4a6039c635 Fix initial padding value for TextInput
Summary:
Changelog: [internal]

# Problem

Default padding for TextEdit is top: 26, bottom: 29, left: 10, right: 10 however the default values for LayoutMetrics.contentInsets is {0, 0, 0, 0}.

If you try to construct TextEdit with padding 0, Fabric will drop padding update because padding is already 0, 0, 0, 0.

# Fix
To fix this, I added a special case to `Binding::createUpdatePaddingMountItem`, if the mutation is insert, proceed with updating padding.

Reviewed By: JoshuaGross

Differential Revision: D23731498

fbshipit-source-id: 294ab053e562c05aadf6e743fb6bf12285d50307
2020-09-16 11:49:56 -07:00
Emily Janzer b352e2da81 Create a ClickableSpan for nested Text components
Summary:
Right now nested Text components are not accessible on Android. This is because we only create a native ReactTextView for the parent component; the styling and touch handling for the child component are handled using spans. In order for TalkBack to announce the link, we need to linkify the text using a ClickableSpan.

This diff adds ReactClickableSpan, which TextLayoutManager uses to linkify a span of text when its corresponding React component has `accessibilityRole="link"`. For example:

  <Text>
    A paragraph with some
    <Text accessible={true} accessibilityRole="link" onPress={onPress} onClick={onClick}>links</Text>
    surrounded by other text.
  </Text>

With this diff, the child Text component will be announced by TalkBack ('links available') and exposed as an option in the context menu. Clicking on the link in the context menu fires the Text component's onClick, which we're explicitly forwarding to onPress in Text.js (for now - ideally this would probably use a separate event, but that would involve wiring it up in the renderer as well).

ReactClickableSpan also applies text color from React if it exists; this is to override the default Android link styling (teal + underline).

Changelog: [Android][Fixed] Make nested Text components accessible as links

Reviewed By: yungsters, mdvacca

Differential Revision: D23553222

fbshipit-source-id: a962b2833d73ec81047e86cfb41846513c486d87
2020-09-15 17:34:35 -07:00
Joshua Gross 6524e611d3 Fix TextInput measurement caching
Summary:
This fixes TextInput measurement caching. Previously we were not setting the correct Spannable in the cache; we needed to additional Spans to it to indicate font size and other attributes.

This brings Fabric closer to how non-Fabric was measuring Spannables for TextInputs (see ReactTextInputShadowNode.java).

This should fix a few crashes and will be most noticeable with dynamically-sized multiline textinputs where the number of lines changes over time.

This also allows us to transmit less data from C++ to Java in the majority of cases.

Changelog: [Internal]

Differential Revision: D23670779

fbshipit-source-id: cf9b8c848b9e0c2619e01766b72b074248466825
2020-09-12 21:53:22 -07:00
Joshua Gross 78b42d7fb7 Take viewport offset into account in UIManager.measureInWindow
Summary:
D23021903 (https://github.com/facebook/react-native/commit/154ce789723f6e65785bcfc00da399ad9184bdfb) but for Android.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D23640968

fbshipit-source-id: 7a743ebd0ea2b573d6ef17b418ad98ec616b11d3
2020-09-11 13:43:26 -07:00
Joshua Gross e26c280782 Remove enableFabricStartSurfaceWithLayoutMetrics feature flag
Summary:
Remove `enableFabricStartSurfaceWithLayoutMetrics` and treat as `true` always from now on.

Changelog: [Internal]

Differential Revision: D23633198

fbshipit-source-id: 5b7455b87e578ffa97d80746fa901cd2b50d3ea9
2020-09-10 18:16:32 -07:00
Ramanpreet Nara 8a8c15f9fa Remove log when TurboModule cannot be created
Summary:
This log was necessary to get to the bottom of the TurboModule Fb4a eager init crash. It's no longer necessary, plus it's okay for TurboModules to be null, so we'll remove it for now.

Changelog: [Internal]

Differential Revision: D23607208

fbshipit-source-id: 083b00abe6bdefc5986f842cd6f9438f47cce1ce
2020-09-09 16:03:16 -07:00
Emily Janzer f1a8278187 Prevent scrolling with TalkBack if scrolling is disabled in JS
Summary:
Right now you can scroll a horizontal ScrollView with TalkBack even if you've disabled scrolling in JS, because our HorizontalScrollView component doesn't prevent the accessibility scroll event (this doesn't seem to happen with vertical ScrollViews for some reason...) This diff adds an accessibility delegate to both of the Android ScrollView components to make sure they're not scrollable if scrolling has been disabled in JS.

Changelog: [Internal]

Reviewed By: shergin

Differential Revision: D23582689

fbshipit-source-id: b670bdb462ab9c963c7125597d60ca97c7d88a9c
2020-09-09 13:28:07 -07:00
Emily Janzer f0e80ae229 Set selection to end of text input on accessibility click
Summary:
When we render a text input that already has a text value (<TextInput value="123" />), its selection (cursor) is automatically set to the end of the text. However, when you swipe to focus the text input with TalkBack, Android decides it needs to clear the selection, which moves the cursor back to the beginning of the text input. This is probably not what you want if you're editing some text that's already there. Ideally we would just keep the selection at the end, but I don't know how to prevent this from happening - it seems to be part of how TextView handles the accessibility focus event? So instead I'm just explicitly setting the selection to the end of the text in our handler for accessibility click.

Changelog: [Android][Fixed] Move selection to the end of the text input on accessibility click

Reviewed By: mdvacca

Differential Revision: D23441077

fbshipit-source-id: 16964f5b106637e55a98c6b0ef0f0041e8e6215d
2020-09-02 16:17:02 -07:00
Dulmandakh 7465239230 bump SoLoader to 0.9.0 (#29821)
Summary:
SoLoader fixed crash on Android 4.1, and includes many improvements and fixes https://github.com/facebook/SoLoader/releases/tag/v0.9.0. Also Fresco 2.3.0 depends on it, and will create a PR soon to bump Fresco.

## Changelog

[Android] [Changed] - Bump SoLoader to 0.9.0

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

Test Plan: CI is green

Reviewed By: fkgozali

Differential Revision: D23477538

Pulled By: mdvacca

fbshipit-source-id: d2d982d5c5c84fc173dc66dfe069713ca90711a8
2020-09-02 11:38:26 -07:00
Lulu Wu b5b4a70410 Set caretHidden to true to fix the Xiaomi crash
Summary:
After monitoring scuba for a few days,  previous fixes(D23301714 D23331828 (https://github.com/facebook/react-native/commit/07a597ad185c8c31ac38bdd4d022b0b880d02859)) don't work as expected.

I managed to test this issue on a Xiaomi device, the crash didn't happen but the there was a popup "Frequetly used email" on top of email edit text:

{F317216473}

Getting rid of the popup probably be the right fix.

For more context see https://github.com/facebook/react-native/issues/27204

Changelog: [Android] - Set caretHidden to true to fix the Xiaomi crash

Reviewed By: mdvacca

Differential Revision: D23451929

fbshipit-source-id: 521931422f3a46a056a9faa4b10fe93cf4732db0
2020-09-02 05:28:49 -07:00
Lulu Wu 59ddd7cd4b Add memory pressure listener in ReactHost
Summary:
Add memory pressure listener for ReactHost and ReactInstance

Changelog: [Internal]

Reviewed By: ejanzer

Differential Revision: D23214241

fbshipit-source-id: ec8476aeda8d9781d918ea41e5cab69fa862996e
2020-09-02 03:00:57 -07:00
David Vacca 7d6d5daa2b Refactor caching of Spannable objects instide TextLayoutManager
Summary:
This diff optimizes the caching of Spannable objects managed by the TextLayoutManager class.
Previously, these objects were cached using unsing a String representation of the RedableMap (creating this string adds a non trivial cost), this diff improves the caching performance relying on the equals / hashcode methods of the ReadableNativeMap class

I created a MC just to have a killswitch

Motivation: I was analysing another bug and I found this non performant code

changelog: [internal] internal

Reviewed By: shergin

Differential Revision: D23429365

fbshipit-source-id: 59e5ad0b1b95da992ac393aecfe029da68a8df97
2020-09-01 17:09:27 -07:00
Ian Childs 05abbd245c Declare all attrs used in res targets (#29794)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/29794

Per title - need to declare deps of attrs that we are using (soon Buck will enforce this).

Changelog: declare dependencies of all attributes that are used in the resource target.

Reviewed By: jiawei-lyu

Differential Revision: D23388058

fbshipit-source-id: b395d153188f75f8c0d4a6d69302812a56b23925
2020-08-31 11:36:33 -07:00
Valentin Shergin 6d3dcc72c5 Fabric: Using include instead of import in non-Objective-C file
Summary:
`#import` is non-standard C++ extension which is AFAIK part of Objective-C. I am surprised that it even compiles on Android.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D23407689

fbshipit-source-id: 2861138cbcce33674e118a1ad816e33bbf8f30fe
2020-08-30 22:26:38 -07:00
David Vacca fe79abb32c Introduce TransparentImmersiveReactActivity in FB4A
Summary:
This diff creates the new TransparentImmersiveReactActivity in FB4A, the intention is to help integrate TransparentReactActivity with Fb4A

Changelog: [Deprecated][Android] Deprecated method UIManagerModule.getUIImplementation. This method will not be part of the new architecture of React Native.

Reviewed By: stashuk

Differential Revision: D23324543

fbshipit-source-id: 35395fe410790a9611a4637361b888678eb0a836
2020-08-28 17:01:07 -07:00
Hamid 0f6fcb2c27 okhttp version 3.12.12 (#29741)
Summary:
This updates okhttp to the newest compatible version with a couple of fixes and improvements. See https://github.com/square/okhttp/commits/okhttp_3.12.x

## Changelog

[Android] [Changed] - Update Okhttp to version 3.12.12

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

Test Plan: Current tests should pass.

Reviewed By: shergin

Differential Revision: D23406613

Pulled By: mdvacca

fbshipit-source-id: b0b4ec52a6a8345f1c36e18e384761386096f1d8
2020-08-28 16:58:09 -07:00
Shoaib Meenai f19372361f Fix secure text entry setting
Summary:
We have password components which allow visibility to be toggled by
setting both the keyboardType and secureTextEntry props. The order in
which those updates are executed is determined by iterating a NativeMap
of props, and the iteration order of a NativeMap is implementation
dependent.

With libc++ as our STL, we observe that setSecureTextEntry is called
before setKeyboardType. This results in the following sequence of input
type flag settings when toggling the component to visible and then back
to hidden:

* The field starts out with TYPE_TEXT_VARIATION_PASSWORD (0x80).
* When we toggle to visible, setSecureTextEntry is called with password
  being false, which clears TYPE_TEXT_VARIATION_PASSWORD.
  setKeyboardType is then called with the visible-password keyboard
  type, which sets TYPE_TEXT_VARIATION_VISIBLE_PASSWORD (0x90).
* When we toggle back to hidden, setSecureTextEntry is called with
  password being true, which sets TYPE_TEXT_VARIATION_PASSWORD but
  doesn't clear TYPE_TEXT_VARIATION_VISIBLE_PASSWORD. setKeyboardType is
  then called with the default keyboard type and additionally sets
  TYPE_CLASS_TEXT, but TYPE_TEXT_VARIATION_VISIBLE_PASSWORD remains and
  the password field remains visible.

The fix is to clear TYPE_TEXT_VARIATION_VISIBLE_PASSWORD when
setSecureTextEntry is called with password being true, to ensure the
password gets hidden.

Changelog:
[Android][Fixed] - Fix secure text entry setting to always hide text

Reviewed By: shergin

Differential Revision: D23399174

fbshipit-source-id: a81deec702e768672e2103b76ab50ec728dac229
2020-08-28 16:13:21 -07:00
Lulu Wu 07a597ad18 Fix Xiaomi TextInput crash in native
Summary:
Long term fix in native for Error: android_crash:java.lang.NullPointerException:android.widget.Editor$SelectionModifierCursorController.access$300

For more detail please see T68183343 D23301714

Changelog:
[Android][Changed] - Fix Xiaomi TextInput crash in native

Reviewed By: mdvacca

Differential Revision: D23331828

fbshipit-source-id: 914f2d431772f49711b940d47a2b3ef57ab82cdc
2020-08-28 01:44:37 -07:00
Joshua Gross e60564215d ReactModalHostView: Prevent infinite SetState/UpdateState loop
Summary:
Make sure to check incoming state values before calling SetState, or we call back and forth forever.

Changelog: [internal]

Reviewed By: mdvacca

Differential Revision: D23389355

fbshipit-source-id: 9cf6110cf654fe93f555a6fbfd9b20f112214e0a
2020-08-27 20:00:02 -07:00
Joshua Gross ab8b77c3d2 Don't allow removeDelete collation experiment if LayoutAnimations is enabled
Summary:
See title.

This feature makes LayoutAnimations less stable and isn't needed generally; will be deleted soon.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D23382973

fbshipit-source-id: f633f482d463b3ee3e4625b30544a33cd6e36119
2020-08-27 19:37:06 -07:00
Joshua Gross e3711407a1 Noop when removing views from empty parent
Summary:
In some cases (BottomSheet?) the parent/ViewManager removes all children of the View before Fabric gets a chance to remove the children.

Apparently prior to D23368229 (https://github.com/facebook/react-native/commit/d344fb4e29a827d1e7d233672a3efe3b2b981a8a) (landed just today!) this sequence of operations happened and just noop'ed. Since we've been doing that happily as long as Fabric
has existed, we'll keep doing that for now.

I suspect that on *some* versions of Android this crashes and others it doesn't, based on logviews and my inability to repro certain crashes.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D23387044

fbshipit-source-id: 88a46191adef4f6816bd7babd9103d103ddcef33
2020-08-27 19:37:06 -07:00
Joshua Gross d344fb4e29 When logging errors with deleteView, try to find actual index of view
Summary:
If we try to delete a view and find the wrong one, when we crash, try to log the *actual* index of the view in question.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D23368229

fbshipit-source-id: 7f9835fd07cfe4924d05c7e37b42b9bcdffff4a9
2020-08-27 14:00:09 -07:00
Valentin Shergin cb48b50290 Fabric: Storing commit revision number in MountingTelemetry
Summary:
Now we store a revision number of a Shadow Tree that leads to a transaction for which the concrete instance of MountingTelemetry corresponds. This is useful to understand how many actual transactions were skipped during a mounting phase (a mounting transaction does not directly correspond to a commit operation).

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: mdvacca

Differential Revision: D23364663

fbshipit-source-id: 32b86bcdfc1ae97d8fff3b97a8615cc5a5b4d4a9
2020-08-27 12:33:58 -07:00
Joshua Gross 0fb7f5a6f5 NativeAnimatedModule in Fabric no longer crashes if all Animated nodes are not visited
Summary:
Previously this was crashing only in debug, but that's too noisy and isn't giving us any value for now.

Changelog: [Internal]

Differential Revision: D23338800

fbshipit-source-id: bf1535cdda231ccf30af6d00509eec1499a552a1
2020-08-27 01:32:08 -07:00
Joshua Gross 5e04e932a8 Give MountingManager debug log a little more context
Summary:
see title

Changelog: [internal]

Differential Revision: D23338751

fbshipit-source-id: 0ad9d4f4a415aaab762572a11044f359d60c2de7
2020-08-27 01:32:08 -07:00
Joshua Gross 792f6f69c9 New StopSurface deleteView mechanism
Summary:
Simplifying the StopSurface flow. Before we would still attempt to execute MountItems, but only the "Delete" operations. This was... well, frankly, overcomplicated. Instead we can just ignore all future MountInstructions for that Surface and delete all views recursively from the root.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D23338752

fbshipit-source-id: 6e7ab29ad85572782bfc6a39845a8a619f001559
2020-08-27 01:32:08 -07:00
Eloy Durán 941bc0ec19 Upstream RN macOS Hermes integration bits (#29748)
Summary:
Microsoft’s RN for macOS fork supports the Hermes engine nowadays https://github.com/microsoft/react-native-macos/pull/473. As a longer term work item, we’ve started moving bits that are not invasive for iOS but _are_ a maintenance burden on us—mostly when merging—upstream. Seeing as this one is a recent addition, it seemed like a good candidate to start with.

As to the actual changes, these include:

* Sharing Android’s Hermes executor with the objc side of the codebase.
* Adding a CocoaPods subspec to build the Hermes inspector source and its dependencies (`Folly/Futures`, `libevent`).
* Adding the bits to the Xcode build phase script that creates the JS bundle for release builds to compile Hermes bytecode and source-maps…
* …coincidentally it turns out that the Xcode build phase script did _not_ by default output source-maps for iOS, which is now fixed too.

All of the Hermes bits are automatically enabled, on macOS, when providing the `hermes-engine-darwin` [npm package](https://www.npmjs.com/package/hermes-engine-darwin) and enabling the Hermes pods.

## Changelog

[General] [Added] - Upstream RN macOS Hermes integration bits

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

Test Plan:
Building RNTester for iOS and Android still works as before.

To test the actual changes themselves, you’ll have to use the macOS target in RNTester in the macOS fork, or create a new application from `master`:

<img width="812" alt="Screenshot 2020-08-18 at 16 55 06" src="https://user-images.githubusercontent.com/2320/90547606-160f6480-e18c-11ea-9a98-edbbaa755800.png">

Reviewed By: TheSavior

Differential Revision: D23304618

Pulled By: fkgozali

fbshipit-source-id: 4ef0e0f60d909f3c59f9cfc87c667189df656a3b
2020-08-27 01:18:33 -07:00
Ramanpreet Nara 5ffabca054 Update NativeModule Specs
Summary:
For some reason, these got out of sync again.

This diff modifies the Java Codegen to sort all the methods.
build-break
overriding_review_checks_triggers_an_audit_and_retroactive_review

Differential Revision:
D23363410

Oncall Short Name: fbandroid_sheriff
Ninja: master broken

fbshipit-source-id: 257d85f92017528e64ced31bc7be011acb333186
2020-08-26 18:02:43 -07:00