Commit Graph

2712 Commits

Author SHA1 Message Date
Ramanpreet Nara 1a2d1dbae8 Attach RCTViewRegistry to NativeModules
Summary:
After this diff, NativeModules can synthesize the RCTModuleRegistry, and use that to query for UIViews of components, given their reactTags.

Changelog: [Internal]

Reviewed By: shergin

Differential Revision: D25645052

fbshipit-source-id: bb17606cc4862d07b739ef2c31a5e57f59201364
2020-12-19 06:01:48 -08:00
Ramanpreet Nara 86cdd88569 Integrate TurboModules with Venice's RCTSurfacePresenter
Summary:
After we create the RCTSurfacePresenter in Venice, we use it to create an RCTBridgelessComponentViewProvider, and pass it over to the RCTTurboModuleManager. In Venice, this allows all TurboModules to query components' UIViews given their reactTag.

Changelog: [Internal]

Reviewed By: shergin

Differential Revision: D25643261

fbshipit-source-id: 31da07c490d249534f700b7c8430e9cb43b5b0db
2020-12-19 06:01:48 -08:00
Ramanpreet Nara b71ebd10e5 Attach RCTViewRegistry to TurboModules
Summary:
Now, TurboModules that synthesize RCTModuleRegistry will have it available at runtime.

Changelog: [Internal]

Reviewed By: shergin

Differential Revision: D25643260

fbshipit-source-id: e9915f3da8412de823ae3d3e17849979c5cbd465
2020-12-19 06:01:47 -08:00
Valentin Shergin fb4e06b1a5 Fabric: Introducing UIManagerCommitHook, unified way to alter commits
Summary:
The new UIManagerCommitHook can be used to implement commit-atering features without modifying the core.
E.g. State Reconciation seems can be implemented as a coomit hook but first we will use it for a new feature called Timeline (see the coming diffs).

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: sammy-SC

Differential Revision: D25221312

fbshipit-source-id: dbe41b475bc8b36e1780d81447ab43b32758bdff
2020-12-18 16:01:30 -08:00
Valentin Shergin d2ae775bf7 Fabric: Introducing ShadowTreeDelegate::shadowTreeWillCommit()
Summary:
With the change, a new delegate method allows a receiver to alter a new (proposed) shadow tree with another tree by returning the altered tree.
We will it use in future diffs to implement Commit Hooks.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: sammy-SC

Differential Revision: D25221313

fbshipit-source-id: 9f83577d862b713fff71fa365ce660cc1de87c84
2020-12-18 16:01:30 -08:00
Ron Edelstein 8b4e2ac8e5 Explicitly set autoglob (long tail)
Reviewed By: fbanurag, strulovich

Differential Revision: D25620908

fbshipit-source-id: 1dd737d451ddfd07baa427902bdf1c96d7e67e64
2020-12-17 19:35:29 -08:00
Ramanpreet Nara 5275895af5 Roll out TurboModule block copy
Summary:
## Description
During TurboModule method invocation, when we convert JavaScript callbacks (i.e: jsi::Functions) into ObjC blocks inside the TurboModule jsi::HostObject, we [push them into an array](https://fburl.com/diffusion/r1n75ikx) that [gets cleared after the method gets invoked](https://fburl.com/diffusion/ubbvdmfs).

Prior to this experiment, we pushed these ObjC blocks into the array without copying them first. This goes contrary to ObjC best practices, which suggest that if you need to retain a block past its creation context for later invocation, you should defensively copy it to prevent it from being freed early. See the [Apple docs](https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/Blocks/Articles/bxUsing.html#//apple_ref/doc/uid/TP40007502-CH5-SW1):
> Typically, you shouldn’t need to copy (or retain) a block. You only need to make a copy when you expect the block to be used after destruction of the scope within which it was declared. Copying moves a block to the heap.

The diff that introduced the fix: D23764329 (https://github.com/facebook/react-native/commit/9b76e217bb16935069f0ea5b60f4c4d9b73f86d6).

Reviewed By: PeteTheHeat

Differential Revision: D25617672

fbshipit-source-id: 24863b31a2d82c8d39a91c8ea8eb3a62724b800a
2020-12-17 17:27:09 -08:00
Ramanpreet Nara 5c4f145e33 Roll out TurboModule Promise Async Dispatch
Summary:
## Context
The legacy NativeModule infra implements promise methods using [async NativeModule method calls](https://fburl.com/diffusion/tpkff6vg). In the TurboModule infra, promise methods [treat as sync methods](https://fburl.com/diffusion/yde7xw71), and executed directly on the JavaScript thread. This experiment makes TurboModule promise methods async, and dispatches them to the NativeModules thread, when they're executed from JavaScript.

Reviewed By: fkgozali

Differential Revision: D25623192

fbshipit-source-id: 2b50d771c5272af3b6edf150054bb3e80cab0040
2020-12-17 17:27:09 -08:00
Ramanpreet Nara 18ea422e91 Show RedBoxes during promise resolve/reject errors
Summary:
Previously, we'd throw std::runtime_error objects when we invoked RCTPromiseResolveBlock and RCTPromiseRejectBlock. This would crash the app. Now, we'll just show RedBoxes. The RedBoxes also contain the name of the NativeModule, along with the method.

Changelog: [Internal]

Reviewed By: PeteTheHeat

Differential Revision: D25549149

fbshipit-source-id: 33d5fc4480a577a1c17961c856ac42a9363b35f6
2020-12-17 10:29:41 -08:00
Keion Anvaripour 4537131878 Bytecode client for Android (#30595)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/30595

Changelog: [Internal]

Add support for loading HBC bundles from Metro in Twilight.
* adds `runtimeBytecodeVersion` to the bundleURL
* adds logic to check chunk hermes bytecode bundles
* adds support for running the bytecode bundles

Reviewed By: cpojer

Differential Revision: D24966992

fbshipit-source-id: acdd03a2e9e2b3e4c29c99c35a7c9136a3a7ef01
2020-12-16 16:03:57 -08:00
Valentin Shergin 98f1825f56 Fabric: Basic tests for zIndex and flattening
Summary:
Finally, a test for zIndex. Yay!

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: sammy-SC

Differential Revision: D25576920

fbshipit-source-id: daf8971f7d751e3316b89aae672fee4d25fe5b3e
2020-12-16 10:57:37 -08:00
Valentin Shergin 9a720ad47f Fabric: buildStubViewTreeWithoutUsingDifferentiator & buildStubViewTreeUsingDifferentiator
Summary:
After fixing `calculateShadowViewMutationsForNewTree` I realized that it will be even better to test Stacking Context and mutation instructions infra using both functions: `calculateShadowViewMutationsForNewTree` (used for testing) and the Differentiator itself. This diff implements it.

Now we have two similarly working functions with different implementations that we can use for testing Differentiator and other parts of the infra.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: sammy-SC

Differential Revision: D25576922

fbshipit-source-id: 7922e9ebfb9d6ef1792566554ba0c4a14f835ae2
2020-12-16 10:57:37 -08:00
Valentin Shergin 426b19073d Fabric: calculateShadowViewMutationsForNewTree now takes order-index into account
Summary:
Working on zIndex tests I found that calculateShadowViewMutationsForNewTree (that we use for testing) does not take zIndex into account. This fixes it.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: sammy-SC

Differential Revision: D25576923

fbshipit-source-id: a71b3a4630430488c783cd5010c0fbb7273bdaa5
2020-12-16 10:57:37 -08:00
Valentin Shergin bc7a43b15e Fabric: Added yet another test for Stacking Context
Summary:
The test covers most props that must generate views.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: sammy-SC

Differential Revision: D25576921

fbshipit-source-id: df5bedb8f6d409b5142e472ca2edcb1953bee4e1
2020-12-16 10:57:37 -08:00
Valentin Shergin 5a4685b44e Fabric: A basic unit test for Stacking Context
Summary:
It tests some basic flattening operations. More tests are coming.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: sammy-SC, mdvacca

Differential Revision: D25562529

fbshipit-source-id: 25978d97acdade8b6dc91c91fc227b6cbbd61899
2020-12-15 11:45:45 -08:00
Valentin Shergin 5d4514b492 Fabric: Small improvements in StubViewTree for more easier testing
Summary:
Added a couple of simple methods for quering view information.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: mdvacca

Differential Revision: D25562530

fbshipit-source-id: 697bea8d87c21d72475fb4896af3215f9279f34b
2020-12-15 11:45:45 -08:00
Ramanpreet Nara 0da02ab1ca Don't lookup TurboModules post-invalidation
Summary:
During cleanup, RCTNativeAnimatedModule [requires the RCTEventDispatcher](https://fburl.com/diffusion/0bnln893) to remove itself from the dispatcher a dispatch observer.

When the bridge is invalidated, if RCTEventDispatcher is has been cleaned up by then, we don't warn when this lookup fails: https://fburl.com/diffusion/rfioe5ay. This diff replicates that behaviour in the TurboModule infra.

Notes:
- In the legacy NativeModule infra, we can still query NativeModules post invalidation - we just won't create them. In the TurboModule infra, all requests for TurboModules from the TurboModuleManager start returning nil. Therefore, I simply did an early return inside TurboModuleManager moduleForName in the case that we're already invalidated. In addition to not displaying the warning, we just don't request/create the TurboModule in the first place.

Changelog: [Internal]

Reviewed By: PeteTheHeat

Differential Revision: D25560228

fbshipit-source-id: 102dcc147bab6121daacdb39890bad48c0e60894
2020-12-15 11:20:28 -08:00
Peter Argany 687ddf0f32 Downgrade TurboModule crash to warning
Summary:
This is to address a UBN blocking FBiOSv300 rollout. A TM is attempting to invoke a promise more than once and crashing. We can't find the TM, so downgrading this to a warning to unblock the release.

Plan going forward:
- Replace this with some better logging to try and identify the culprit module.

Changelog: [Internal]

Reviewed By: RSNara

Differential Revision: D25539676

fbshipit-source-id: 5b75b71110eaa393378049de6e0d9a77e6328831
2020-12-14 12:58:29 -08:00
Valentin Shergin 272ef6b86f Fabric: AccessibilityProps::testId mapped to testID and implemented for iOS
Summary:
This should make `testID` prop work as it works in pre-Fabric renderer on iOS.
On Android it should already work fine.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: JoshuaGross

Differential Revision: D25524890

fbshipit-source-id: 3f25eb427d4449abaab790099546be18ae573f98
2020-12-13 22:36:10 -08:00
Will Holen 62640d4410 Disable verbose inspector state logging by default
Summary:
We currently spam the log with verbose state change messages by default.
These messages are really only useful for internal Inspector
development, so turn them off by default.

Changelog: [Internal]

Reviewed By: avp

Differential Revision: D25500449

fbshipit-source-id: 57e0901856f104be613f79de3b3ac9e3e95b2655
2020-12-12 13:33:45 -08:00
Samuel Susla fe887173ee Fix clone of props for legacy interop component
Summary:
Changelog: [internal]

Cloning of `LegacyViewManagerInteropViewProps` causes loss of `sourceProps.otherProps` if the cloning happens before shadow node is mounted. This was happening in WebView and callback `onLoadEnd` was dropped because of this.

Reviewed By: JoshuaGross

Differential Revision: D25474581

fbshipit-source-id: 74d7c5cd32b7318bb99306c82bc8b5e5eab63db2
2020-12-11 14:07:26 -08:00
Peter Argany 2a175b14e6 Strip RCT prefix in TurbooduleManager
Summary:
This is a followup to the issue described in D25477044, basically the TM cache can get messed up if `TurboModuleManager` is asked for "RCTNetworking" vs "Networking". This solves that issue globally.

Changelog: [Internal]

Reviewed By: RSNara

Differential Revision: D25480624

fbshipit-source-id: 2024560eadbcf58cdc3d7d5675b4120aa2fa2582
2020-12-11 11:24:27 -08:00
Aditya Kumar e1d7dd3105 sed OBJC_ARC_PREPROCESSOR_FLAGS/get_preprocessor_flags_for_build_mode
Summary: This diff doesn't change any functionality.

Reviewed By: adamjernst

Differential Revision: D25466557

fbshipit-source-id: 813f9631b92e8145b932955cad64a0c4582281e8
2020-12-11 10:18:33 -08:00
Ramanpreet Nara 4974e293c6 Attach RCTModuleRegistry to NativeModules
Summary:
The bridge now creates the RCTModuleRegistry, and assigns it to all NativeModules it creates.

Changelog: [Internal]

Reviewed By: PeteTheHeat

Differential Revision: D25414108

fbshipit-source-id: 81c6a05bde0e52cff8ed60297f27d8aa3ff15a87
2020-12-10 20:23:16 -08:00
Ramanpreet Nara 5b0957962a Attach RCTModuleRegistry to TurboModules
Summary: Changelog: [Internal]

Reviewed By: PeteTheHeat

Differential Revision: D25414882

fbshipit-source-id: 9e45ffb86cf69a2d1921b7ff1c713c186a8c4e01
2020-12-10 20:23:16 -08:00
Emily Janzer 81096901a8 Use bridgeless flag instead of specific binding in UIManagerBinding
Summary:
This fix is still a little hypothetical. We have a few different JS errors that we're seeing with bridgeless mode that seem to be caused by Fabric trying to access `__fbBatchedBridge` from C++. I think what's happening is:

1. User encounters an unrelated JS error very early in rendering a new surface (possibly while the bundle is still loading?)
2. In release builds, BridgelessReactFragment handles the error by stopping the surface and rendering a retry button (actually, the surface is stopped in a bunch of places in BaseFbReactFragment, which might be why this is popping up now - I recently refactored that class to share more of its logic in bridgeless mode)
3. Fabric stops the surface by first checking to see if the custom binding `RN$stopSurface` exists; if not, it falls back to calling the registered callable module `ReactFabric`.

I think #3 is where things are going wrong for bridgeless mode; if you call stopSurface before `RN$stopSurface` is installed (which happens when ReactFabric shim is required) then you'll fall back to the bridge version.

My solution here is to instead rely on a flag set in C++ to determine whether we're in bridgeless mode, and then check to see if the stopSurface binding has been installed. If not, we just noop - if the ReactFabric shim hasn't been required, we probably don't actually have a React surface that needs to be stopped.

At least, that's my current theory. We'll see if this actually works.

Changelog: [Fixed][iOS] Fix an issue calling stopSurface in bridgeless mode before surface is started

Reviewed By: mdvacca

Differential Revision: D25453696

fbshipit-source-id: bff76675c43989101d0ba5ae0aba60089db230bf
2020-12-10 17:17:23 -08:00
Ramanpreet Nara 408bcdeedb Remove unneeded @synthesize bridge from NativeModules
Summary:
This is a codemod. All these NativeModules demand access to the bridge. However, they don't use it.

Changelog: [Internal]

Reviewed By: PeteTheHeat, RoelCastano

Differential Revision: D25386708

fbshipit-source-id: f05f4777d2527e96e53581e7ac58f6be47411dce
2020-12-08 20:27:44 -08:00
Martin Sherburn b26a9549ce When calling console set this value
Summary:
When calling the original console methods we should set this to the value of the original console. Otherwise this can lead to different behaviour between when the debugger is enabled or not.

Changelog: [Internal]

Reviewed By: mhorowitz

Differential Revision: D25367929

fbshipit-source-id: 0a7b65e501d4460d5e09a7ccd3c38ef61fbd2ef0
2020-12-08 09:56:47 -08:00
Joshua Gross e8770d7bb2 Code quality: Refactor ShadowViewMutation::UpdateMutation to remove index, parentShadowView parameters
Summary:
The `index` parameter for UpdateMutation is optional, and is normally just -1. It's not useful, so remove it. `parentShadowView` is also not relevant and is not used; in some existing use-cases the actual parent view of the updated view is available, and in some contexts the parent view is not set.

The function now will always set the index to -1 for UpdateMutations, and `{}` for ParentShadowView.

This should have no impact on iOS or Android, as this parameter is not used. It could theoretically have an impact on lifetimes of objects retained (now not retained) by not passing parentShadowView into the mutation. For example, any shared props or state associated with the parent will not be retained in the Update mutation now.

Changelog: [Internal]

Reviewed By: shergin

Differential Revision: D25342943

fbshipit-source-id: 0ddbef76a6e2eefc2629c9729f721d8674d7737e
2020-12-07 13:37:10 -08:00
Joshua Gross c224e9f155 Fix LayoutAnimations issue that could result in elements getting stuck with opacity ~0
Summary:
If a ShadowNode is being animated from opacity 0 to 1, and that animation is interrupted by another update to the same ShadowNode, we stop the animation and send the original "final" ShadowView
to the mounting layer. On iOS, this is enough to make the Mounting layer consistent with the Shadow layer. However, on Android, since only prop deltas are passed to the mounting layer and not the
entire props bag, this will NOT be enough because the opacity will not be updated in that final step.

Therefore, in those cases where we've detected a conflict and we're cleaning up after an interrupted animation, we must send two updates to the mounting layer: one to force the opacity to 1,
and another to make the ShadowTree consistent with the Mounting layer.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D25324942

fbshipit-source-id: 5d9666128feaae87d7530c394ef05db580aa5a75
2020-12-04 14:46:52 -08:00
Janic Duplessis 0959ff36d1 Move hermes to a separate podspec (#30478)
Summary:
Hermes being a subspec of ReactCore causes some build issues when RN is included in 2 different targets. It also causes it to include a lot of additional dependencies that it doesn't need. This moves it to a separate podspec loosely based on other specs in ReactCommon.

## Changelog

[iOS] [Fixed] - Move hermes to a separate podspec

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

Test Plan: Test that it builds and run properly in an app

Reviewed By: fkgozali

Differential Revision: D25308237

Pulled By: hramos

fbshipit-source-id: b4cc44ea2b1b854831e881dbbf9a2f30f6704001
2020-12-03 20:08:00 -08:00
Joshua Gross 50dde4b7b7 LayoutAnimations: Fix out-of-order DELETE and REMOVE instruction generation
Summary:
In very marginal cases, it was possible to set up an animation of the following diffing instructions:

```
REMOVE X from parent Y
DELETE X
```

If your LayoutAnimation configuration had no "delete" config, the DELETE would be executed immediately; the REMOVE was erroneously being categorized as an "update" (now fixed)
which caused the REMOVE to be delayed, but then executed very shortly thereafter. So the order of instructions would become:

```
DELETE X
REMOVE X from parent Y
```

which would crash (or at least fail an assertion) when the REMOVE instruction was processed.

This fixes the issue by ensuring that REMOVEs have a corresponding "delete" config, or they are also executed immediately; unless followed by an INSERT (and any combination of `REMOVE, DELETE, INSERT` in the same frame is not possible).

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D25292560

fbshipit-source-id: 7ffdd6cbcb43126de07a70c197dfaf1ebff83555
2020-12-03 17:09:51 -08:00
Joshua Gross 6864e5f3ac Ship reparenting differ everywhere on iOS and Android
Summary:
The "reparenting differ" has been the default differ for several months; ship it by removing config and the old differ.

Some functions can't be deleted yet because unit testing relies on it heavily; this can be refactored in the future if we care a lot.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D25257205

fbshipit-source-id: 6f1dcc490bb1efe3d12506addf5f0843ca48c5c6
2020-12-01 19:52:44 -08:00
Samuel Susla ae6f4f308e Align format of touch events with Paper
Summary:
Changelog: [internal]

Touch events should be of a type PressEvent. Fabric only provided touches, changedTouches and targetTouches and leaves out force, identifier, locationX, locationY, pageX, pageY and timestamp.

Reviewed By: shergin

Differential Revision: D25243347

fbshipit-source-id: e824558bd43f51c0c6dcca62bfc98318aa61678e
2020-12-01 09:23:36 -08:00
Samuel Susla 8656919bf0 Remove duplicate declaration
Summary:
Changelog: [internal]

This is already defined in Touch.h

Reviewed By: shergin

Differential Revision: D25242843

fbshipit-source-id: 23bac2a60f3d995e34d342c3a189760875f4bc77
2020-12-01 09:23:35 -08:00
Samuel Susla 8478f461df Simplify interface of LayoutAnimationKeyFrameManager::getAndEraseConflictingAnimations
Summary:
Changelog: [internal]

Return value from `LayoutAnimationKeyFrameManager::getAndEraseConflictingAnimations` was a tuple with 3 elements. Two of them are not being used so let's get rid of them.

Reviewed By: JoshuaGross

Differential Revision: D25220601

fbshipit-source-id: 35781e735b6a2e518337fdeaf956c18bb370993b
2020-11-30 12:27:46 -08:00
Samuel Susla 5677d812aa Disable assert in StubViewTree until it is resolved
Summary:
Changelog: [internal]

The assert is still firing, let's disable it until we can investigate why layout animations creates two delete mount instructions.

Reviewed By: majak

Differential Revision: D25216794

fbshipit-source-id: 6328a2afb5eaf7fceebdc05bc75804f2eb44ddd2
2020-11-30 07:55:13 -08:00
Joshua Gross f9a4cafa20 LayoutAnimations: Remove unnecessary optionals in config
Summary:
These configs are never actually empty, so they shouldn't be optionals.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D25129254

fbshipit-source-id: 626119fefad0440732541c680286ebbbfab6aeba
2020-11-20 17:30:11 -08:00
Samuel Susla 29bbeaf8ac Fix race condition in LayoutAnimationKeyFrameManager::currentAnimation_
Summary:
Changelog: [internal]

`currentAnimation_` is accessed on multiple threads and has dedicated mutex, but it was not acquiring the mutex in `LayoutAnimationKeyFrameManager::shouldAnimateFrame`

Reviewed By: JoshuaGross

Differential Revision: D25121654

fbshipit-source-id: 38b1c82eaabab283beab18dc210ea21379edbe93
2020-11-20 13:23:47 -08:00
Samuel Susla f6fb1d0936 Use auto and implicit type conversion to improve readability in LayoutAnimationKeyFrameManager
Summary:
Changelog: [internal]

Readability improvements.

Reviewed By: JoshuaGross

Differential Revision: D25121829

fbshipit-source-id: f2937150ca078cc07befd873e91779cb960529a2
2020-11-20 13:05:38 -08:00
Samuel Susla 8aae407b6f Fix race condition in LayoutAnimationCallbackWrapper
Summary:
Changelog: [Internal]

Contents of `callComplete_` are accessed from JavaScript thread and main thread and there is possible race condition. This diff changes `bool` to `atomic_bool` to prevent the race.

Reviewed By: JoshuaGross

Differential Revision: D25094907

fbshipit-source-id: 6a2c6e33ab5ba0c6ab728e175f2e5c11fdd0a579
2020-11-20 09:54:00 -08:00
Samuel Susla 246ddc72be Reset imageSource in ImageRequest's move constructor
Summary:
Changelog: [Internal]

General improvements. Behaviour should be exactly the same.

Reviewed By: JoshuaGross

Differential Revision: D25092505

fbshipit-source-id: 584640ece3e02d468f6bcb84577d7a6c899cc253
2020-11-20 06:40:24 -08:00
Joshua Gross b3865a9143 LayoutAnimations: attempt to re-queue animations if an UPDATE conflicts with a REMOVE+INSERT (move) without a corresponding Update
Summary:
Imagine the scenario in which there's an ongoing UPDATE animation; a REMOVE+INSERT (move) is queued up for the same tag, but there's no
new corresponding UPDATE - so maybe the indices of the view have changed, but the layout stays the same. Under the old model, the previous animation would be canceled and the node would jump to the final position. In theory, if there's no new UPDATE, we should continue animating the node to its final position.

I'm much happier with this - conflicting animations transition into each other super seamlessly now, and I think the logic is more straightforward as well.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D25071664

fbshipit-source-id: fcefc4619dc34cdafdc4d8e8e730b935e5528290
2020-11-19 14:53:23 -08:00
Joshua Gross 0423eab4ee LayoutAnimations: remove noisy, non-useful log
Summary:
This is noisy when enabled, and not very useful.

Changelog: [Internal]

Reviewed By: PeteTheHeat

Differential Revision: D25071584

fbshipit-source-id: 7205b5fa39622feccaf315ccebb181dbdac4281d
2020-11-19 14:53:23 -08:00
Joshua Gross a45c921396 Keep "previous" ShadowView for animations consistent with MOVE sequences (UPDATE/REMOVE/INSERT)
Summary:
See comments, hopefully they explain this situation. This fixes the last remaining case that I have repro'd where StubViewTree asserts fire.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D25062135

fbshipit-source-id: a28afba21f4094200aa0502b1e085dcbc10f9835
2020-11-19 14:53:23 -08:00
Joshua Gross 5bd5fcdd38 LayoutAnimations: ensure that all mutations retain the correct "old" node
Summary:
The current implementation of LayoutAnimations assumed that the "previous/old" ShadowView passed into the diff mutation didn't matter except for purposes of diffing.

As it turns out, iOS components could possibly use the "old" version of props, state, etc - so we should try to keep track of the current value in the tree as much as possible.

This diff accomplishes that by keeping track of the "previous" view, which the AnimationDriver will update over time. This also allows us to simplify logic around conflicting animations.

I'm also adding a few additional asserts to assist in debugging.

This doesn't totally eliminate all asserts hit on iOS, yet, but it does reduce the number of times the asserts are hit in StubViewTree.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D25048644

fbshipit-source-id: d00aeece5af04624d8193063be453c7ce4a6e565
2020-11-19 14:53:23 -08:00
Samuel Susla eaab64764e Do not remove oldChildShadowView from mutation
Summary:
Changelog: [internal]

This diff reverts some changes in D23886519 (https://github.com/facebook/react-native/commit/9f00752a97db3fe0b03cb412c5357eeebc3e2b16), I was not able to repro the issues that D23886519 (https://github.com/facebook/react-native/commit/9f00752a97db3fe0b03cb412c5357eeebc3e2b16) is fixing.
`oldChildShadowView` must be defined for update mutation.

Reviewed By: JoshuaGross

Differential Revision: D25088008

fbshipit-source-id: 956d0cc536e35376ce0e1cc09f7c5b66cb89fc77
2020-11-19 11:57:55 -08:00
Samuel Susla 5af6a44de3 Back out "Back out "[RN] Fabric: Strengthening StubView mutating validation""
Summary:
Changelog: [internal]

Original commit changeset: b6109a45f153

Reviewed By: JoshuaGross

Differential Revision: D25020497

fbshipit-source-id: c52d5ad03dd1049ac66ecb2d82b5018a05bb4f19
2020-11-19 11:57:55 -08:00
Peter Argany bea3495fd0 Fix crash in RCTLegacyViewManagerInteropCoordinator
Summary:
Like the task mentions `strongSelf->_eventInterceptors` was crashing, probably because the coordinator was cleaned up before this block ran.

Check to make sure self is still valid before attempting to access any instance variables.

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D25073812

fbshipit-source-id: cdf666f2ac028b5523097f15ff51fbae9f9ffbd8
2020-11-18 19:36:05 -08:00
Samuel Susla 19d4cc2d49 Implement ScrollView.zoomToRect
Summary: Changelog: [internal]

Reviewed By: JoshuaGross

Differential Revision: D24991008

fbshipit-source-id: 6048246a784b94a321281547d966379badd8f6fd
2020-11-18 15:32:30 -08:00