Commit Graph

3752 Commits

Author SHA1 Message Date
Valentin Shergin be324ca2dc Fabric: Adding some logs to Scheduler, UIManager and co
Summary:
We hope that will help us to understand more.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D18599164

fbshipit-source-id: 431f83de707fc7113e04abd3dd5b59ee5c9cc675
2019-11-21 16:21:25 -08:00
Valentin Shergin 6dcd0de96c Fabric: Ressetting callable inside JMessageQueueThread
Summary:
We recently realized that `JNativeRunnable` instances that RN uses to pass C++ callables to Java land actually are GC managed objects. That makes their lifetime quite unpredictable (longer than necessary). Normally, it's fine but some C++ code explicitly relies on deallocation order.
To make the behavior of `JMessageQueueThread` more predictable, now we clear/reset stored `std::function` object right after an invocation to explicitly free all associated resources (`JNativeRunnable` still holds some wrapper but that wrapper holds nothing).

Changelog: [INTERNAL]

Reviewed By: JoshuaGross

Differential Revision: D18603390

fbshipit-source-id: 362f6cc0901cbe14d3360b928c98e204d277b1aa
2019-11-21 16:05:15 -08:00
George Zahariev 8553e1acc4 Exact-by-default codemod for react-native-github
Summary:
We are rolling out exact-by-default syntax to xplat/js.

I had to manually move around some comments to preserve proper placement.

Changelog: [Internal]

Reviewed By: jbrown215

Differential Revision: D18633611

fbshipit-source-id: 48f7468dcc55b1d00985419d035a61c6820b3abe
2019-11-21 09:42:57 -08:00
Ramanpreet Nara 1ad0862363 Revert D16969764: Make RCTDevLoadingView TurboModule-compatible
Differential Revision:
D16969764

Original commit changeset: 47e6682eea3f

fbshipit-source-id: d95b76eb8e57bbaff840b3d85f3745b13d622ce0
2019-11-21 08:43:12 -08:00
David Vacca 9c61693c9e Create ReactFeatureFlag to enable / disable custom implementation of getChildVisibleRect
Summary:
This diff introduces a new ReactFeatureFlag that will be used to enable / disable a custom implementation of getChildVisibleRect in the classes ReactViewGroup, ReactHorizontalScrollView and ReactScrollView.
The new ReactFeatureFlag is disabled by default bevause of T57363204

This is disabling the code landed as part of D17782658 / https://github.com/facebook/react-native/pull/26334

Changelog: Introduce ReactFeatureFlag to disable custom implementation of getChildVisibleRect (disabled by default)
This will disable the custom algorithm created on https://github.com/facebook/react-native/pull/26334

Reviewed By: yungsters

Differential Revision: D18621042

fbshipit-source-id: 35ca3417b596117b47edab29515a824c1726c2ce
2019-11-21 00:09:24 -08:00
Janic Duplessis 77ba82a6e1 Fix yogajni build with gradle (#27275)
Summary:
https://github.com/facebook/react-native/commit/4a69b3e636c479f39a997aec37f716afb3ab6150 changed the way the cpp files for yogajni are included but it doesn't work. I looked at other places where we are using `wildcard` and we need to add `LOCAL_PATH` otherwise the base path will be where this file is included initially, in this case the `react/jni` folder. This causes no cpp files to be included and the jni bindings are not initialized.

## Changelog

[Internal] [Fixed] - Fix yogajni build with gradle
Pull Request resolved: https://github.com/facebook/react-native/pull/27275

Test Plan: Tested that it builds properly and doesn't crash because of missing native implementation.

Differential Revision: D18633950

Pulled By: mdvacca

fbshipit-source-id: e229fffb53bc335d441060da3c5d4fd840a3c5b0
2019-11-20 23:04:31 -08:00
Ramanpreet Nara 294e31b7c2 Make RCTDevLoadingView TurboModule-compatible
Summary:
RCTDevLoadingView wasn't hooked up to the codegen. This diff makes RCTDevLoadingView type-safe and also makes it TurboModule-compatible.

Changelog:
[iOS][Added] - Make RCTDevLoadingView TurboModule-compatible

Reviewed By: PeteTheHeat

Differential Revision: D16969764

fbshipit-source-id: 47e6682eea3fc49d3f0448c636b5f616d5bce220
2019-11-20 11:20:12 -08:00
Samuel Susla 2d80a248cd Migrate RefreshControl to Native Commands
Summary:
Changelog: [Internal]

Introduce native command `setNativeRefreshing`, it has the word Native in order to avoid name conflict with setRefreshing in Android implementation. Even this component is iOS only, it would make it easier to merge them in the future.

Introduce `RCTRefreshableProtocol` and make `RCTRefreshControl` and `RCTPullToRefreshViewComponentView` to conform to the protocol so view manager can forward command to both, Paper and Fabric component.

Reviewed By: mmmulani

Differential Revision: D18475804

fbshipit-source-id: 4c19225784efc931b7b8f2d2671cc839bce429bf
2019-11-19 10:06:56 -08:00
Emily Janzer 641e9657dd Make ImageLoaderModule TurboModule-compatible
Summary:
Modifying ImageLoaderModule to be TM-compatible by extending the generated abstract class and fixing the conflicting method signatures (int -> double).

Changelog: [Android] [Changed] Changing method signatures for ImageLoaderModule to accept double for requestId

Reviewed By: mdvacca

Differential Revision: D18435628

fbshipit-source-id: bc2a82bda49e339d1feebfe917b0862a1af15a1f
2019-11-18 12:40:31 -08:00
Ramanpreet Nara 29b99720b2 Make TurboModuleRegistry in CatalystInstanceImpl.java volatile
Summary:
We read from / write to `CatalystInstanceImpl.mTurboModuleRegistry` from multiple threads. To ensure that we directly read/write from memory, and not a stale cache, we should make this variable `volatile`.

Changelog:
[Android][Fixed] Make TurboModuleRegistry in CatalystInstanceImpl.java volatile

Reviewed By: fkgozali

Differential Revision: D18542954

fbshipit-source-id: 0a47f05e0653b4f7f58503c678bdf31c68eab9bf
2019-11-15 17:31:31 -08:00
David Vacca 8accd77c45 Deprecate CallerContext from ReactImageManager
Summary:
This diff deprecates the constructors and getter method exposing CallerContext in ReactImageManager.
This will be replaced by the ReactCallerContextFactory class

Changelog: Deprecation of constructors and methods that expose CallerContext in ReactImageManager class

Reviewed By: JoshuaGross

Differential Revision: D18474012

fbshipit-source-id: d8190f938e00da0499bfef7e81522dc8022a8836
2019-11-15 17:28:12 -08:00
David Vacca 882e4a3f17 Integrate ReactContextContainerFactory as part of ReactImageViewManager
Summary:
This diff exposes the ReactContextContainerFactory class on ReactImageViewManager and it customize ChainContext to improve Fresco logging

Changelog: Expose new ReactContextContainerFactory class as part of ReactImageViewManager

Reviewed By: JoshuaGross

Differential Revision: D18474013

fbshipit-source-id: 143461da22966694e5b1e2c3b5b39e3d6be91fd6
2019-11-15 17:28:12 -08:00
David Vacca f0b6f8441b Expose SurfaceID as part ReactRootView
Summary:
This diff exposes the surfaceID as part of ReactRootView.

Changelog: [internal]

Reviewed By: JoshuaGross

Differential Revision: D18474014

fbshipit-source-id: 98f651b211d3cc4df88c6b1eb257bc12129eff57
2019-11-15 17:28:12 -08:00
Joshua Gross 76f41a0578 Gate fix for T54997838 with a feature flag
Summary:
Gating fix for T54997838 behind a feature flag for experimentation.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D18534767

fbshipit-source-id: 5c0191c454fba6dd4a36d6e179959651ec197cac
2019-11-15 17:01:03 -08:00
Joshua Gross cc6b430c3a Annotate UIManager methods to document thread semantics
Summary:
Document which methods can be called on UI thread or ANY thread.

In the future we should see if we can use only `ThreadConfined` or the AndroidX annotations instead of using both / choosing between them at each site.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D18532542

fbshipit-source-id: 3b5406ea5035615a0ebf83484bf8ec0747a6b6f7
2019-11-15 17:01:02 -08:00
David Vacca cddf9eb1da Extending ThemeReactContext to store surfaceID
Summary:
This diff extends ThemeReactContext class to store the surfaceID field

The getSurfaceID method is being exposed as a public method

Changelog: [internal]

Reviewed By: JoshuaGross

Differential Revision: D18474015

fbshipit-source-id: ee1f859a802d36c51dec537fa91d90022523e88d
2019-11-15 09:30:41 -08:00
David Vacca 9713b63d9a Introducing ReactCallerContextFactory interface
Summary:
This interface is used from ReactImageManager to customize the CallerContext object associated with each instance of ReactImageView.
CallerContext are used on Fresco to customize Debug and logs

Changelog: Introduce ReactCallerContextFactory interface, this interface is intended to customize Debug and logging on Fresco

Reviewed By: JoshuaGross

Differential Revision: D18474017

fbshipit-source-id: eda0fc9d3f64bbcc23ee1b7f5d779b441da1fe6c
2019-11-15 09:30:41 -08:00
Joshua Gross ce226c1f28 Fix T54997838
Summary:
Fixes T54997838 by preventing any view mutations during `onMeasure` calls.

There might still be places where this is possible, but this is where I'm seeing all the crashes currently.

See comments in ReactRootView for why views were mutated during onMeasure.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D18518591

fbshipit-source-id: 1406af8a6b0bfcc86f4cc5b451b3967f312dfd85
2019-11-14 21:23:32 -08:00
Ramanpreet Nara 7f637139e7 Make sure that ReactFeatureFlags.useTurboModules is read from memory
Summary:
`ReactFeatureFlags.useTurboModules` can be written to and read from any number of threads. We should use `volatile` to make sure that all threads read/write this data straight from/to memory.

Changelog:
[Android][Fixed] - Make ReactFeatureFlags.useTurboModules volatile

Reviewed By: fkgozali

Differential Revision: D18505673

fbshipit-source-id: 0b2527b8cb95c1e1aedc6b03b12a6b1e6a6cdaa4
2019-11-14 11:03:59 -08:00
Sidharth Guglani f0f83eb3b1 Remove useVanillaJNI flag and usage of fbjni in yoga build
Summary:
## Changelog:

[General] [Yoga] - Use vanilla jni instead of fbjni for all the jni communication

Reviewed By: astreet

Differential Revision: D17808005

fbshipit-source-id: 5e9a1ed73978f519c71c248774a28e5a294e7c7f
2019-11-13 15:16:47 -08:00
Oleksandr Melnykov c5c3264a94 Add setNativeRefreshing command to SwipeRefreshLayoutManager
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: D18475428

fbshipit-source-id: f2e978d88e34c74771f8582247ecc82b2b942557
2019-11-13 10:21:04 -08:00
Oleksandr Melnykov cd1e34d4a2 Add setNativeValue command to ReactCheckBoxManager
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: D18451524

fbshipit-source-id: 566f3574b85a1ae97f78b2fb95548b8529c0c92f
2019-11-13 10:15:50 -08:00
Oleksandr Melnykov bca8fa5a16 Use generated Java delegate for setting properties on ReactViewPagerManager
Summary:
This diff migrates ReactViewPagerManager to use the generated delegate for setting its properties.

Changelog: [Android] [Added] - Use generated Java delegate for setting properties on ReactViewPagerManager

Reviewed By: mdvacca

Differential Revision: D18298049

fbshipit-source-id: f989bedb16e3cabe6a9a8e4238a2b74515041d23
2019-11-12 05:41:28 -08:00
Marc Horowitz 61cb2686a2 Update hermes-engine to newest version 0.3.0
Summary:
Changelog:

[Android] [Changed] - Update hermes-engine to newest version 0.3.0

Reviewed By: cpojer

Differential Revision: D18364012

fbshipit-source-id: 819f7f7980f4bc965c8875eef70ee0108882f922
2019-11-11 18:38:01 -08:00
Emily Janzer d37baa78f1 Split JS spec for image loader module
Summary:
It turns out the ImageLoader native module has different method signatures on iOS than on Android, so the JS spec we currently have won't work for ANdroid. In this diff I'm splitting up the spec for NativeImageLoader into an Android & iOS versions (similar to PlatformConstants), and updating the Android spec to match the native implementation. I'm also changing `RCTImageLoader` to use the new generated spec, and updating the JS callers (`Image.android.js` and `Image.ios.js`) to use the right one for the platform (instead of importing the untyped `ImageLoader` native module from `react-native`, like we were on Android :-/).

This will be a breaking change for anyone who's directly using `NativeImageLoader.js`, but I think most callsites should be using the `Image` component instead.

Changelog: [General] [Changed] Split NativeImageLoader into NativeImageLoaderAndroid and NativeImageLoaderIOS

Reviewed By: RSNara

Differential Revision: D18439538

fbshipit-source-id: 94c796d3fd27800ea17053e963bee51aca921718
2019-11-11 17:24:25 -08:00
David Vacca 0284a73042 Update type for tag in Android mounting layer
Summary:
Easy replace of int -> Tag type in Binding

changelog: [internal]

Reviewed By: JoshuaGross

Differential Revision: D18429188

fbshipit-source-id: 08a19dff60bd90585f59a284be0e46ee7f381bcc
2019-11-11 12:36:05 -08:00
Oleksandr Melnykov a62a685b14 Add setNativeSelectedPosition command to ReactPickerManager
Summary:
Fabric doesn't support setNativeProps, so we have to use commands instead to set the value of the native component.

Changelog: [Android] [Added] - Add setNativeSelectedPosition command to ReactPickerManager

Reviewed By: mdvacca

Differential Revision: D18007791

fbshipit-source-id: dfa26792205189a336ab43b1c51f43f8f57c8e72
2019-11-11 12:32:51 -08:00
David Vacca a20939f49d Fix Collapsing of mutation instructions
Summary:
This diff fixes the algorithm that collapses mutation instructions in Fabric Android
The problem was that we were always relying on the fact that the oldShadowNode is present as part of the mutation instruction (which is not correct for mutation instructions of type CREATE)

Changelog: [Internal]

Reviewed By: JoshuaGross

Differential Revision: D18411360

fbshipit-source-id: 36f5e75f792db87003fcaef2ddcd9452415a0ad6
2019-11-09 10:38:25 -08:00
David Vacca f7385ac1b8 Setup collapsing of mounting instructions as disabled by default
Summary:
This diff updates the configuration of collapsing of mounting instructions to be disabled by default (in case the user didn't get any value from the server)

Changelog: [internal]

Reviewed By: JoshuaGross

Differential Revision: D18411934

fbshipit-source-id: 21f9ca525c28134800e929407c5a1e29a84de68e
2019-11-08 18:48:50 -08:00
Ramanpreet Nara d73ae1baa3 Make RCTWebSocketModule TurboModule-compatible
Summary:
Changelog:
[iOS][Added] - Make RCTWebSocketModule TurboModule-compatible

Reviewed By: PeteTheHeat

Differential Revision: D18353766

fbshipit-source-id: fde0f6593dd203ab3dcb8f9cf40012ba4761d6ba
2019-11-08 14:14:46 -08:00
David Vacca 2d40369237 Disable collapsing of mounting instructions
Summary:
Disable collapsing of mounting instructions

Changelog: [internal]

Reviewed By: JoshuaGross

Differential Revision: D18387365

fbshipit-source-id: dbb6325297ef73d902fbe519726accd40a78b559
2019-11-07 18:26:27 -08:00
Valentin Shergin 9883da167b Fabric: Removing RuntimeExecutor from EventBeatManager
Summary:
This diff changes the implementation a little bit:
* We don't use RuntimeExecutor there anymore (because it's already been used in EventBeat). The actual purpose of EventBeatManager was distilled to "provide a tick synchronized with the main run loop";
* Now we use dedicated EventBeatManagerObserver interface to decouple this functionality from EventBeat-intrinsic functionality;
* A bunch of small clean-ups.
* Now we ensure threading and capturing ownership in a single function in AsyncEventBeat class. Before this change, the EventBeatManager called `beat` function of the EventBeat directly bypassing AsyncEventBeat class, and effectively bypassing the check that underlying infra still exists (aka EventBeat::OwnerBox feature). That alone might fix some C++ crashes that we see.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: sammy-SC

Differential Revision: D18307655

fbshipit-source-id: 3b582cb71085ed99ee94f8e6d575196c2082557b
2019-11-07 09:43:07 -08:00
Valentin Shergin 68782d2239 Fabric: Removing unnecessary code from EventBeatManager
Summary:
* We no more pollute the global namespace with JSI stuff;
* We don't use JSI here, so why to include;
* We don't use `Instance`, so why to forward-declare this;

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: JoshuaGross, sammy-SC

Differential Revision: D18307654

fbshipit-source-id: b6c3ad55d7bd605074db9fa1d4bc58a73e0b2d74
2019-11-07 09:43:06 -08:00
Valentin Shergin 50b171ff8b Fabric: Removing scheduling to JS thread from EventBeatManager.java
Summary:
The C++ counterpart of EventBeatManager uses RuntimeExecutor for that, so it's redundant to do that in EventBeatManager.java.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: sammy-SC

Differential Revision: D18307657

fbshipit-source-id: 65823b25d691a56540247d317e3c0e86685150c8
2019-11-07 09:43:06 -08:00
Joshua Gross b7c2d4389a Guard against result of getUIManager(...) being null
Summary:
`getUIManagerX(...)` can return null now. Guard in a few places that use it or add comments.

Changelog: [Internal]

Reviewed By: alexeylang

Differential Revision: D18351197

fbshipit-source-id: f077835468a75d1af24cfb4210989ba875ff9086
2019-11-06 12:14:09 -08:00
Oleksandr Melnykov e99b926d27 Use generated Java delegate for setting properties on ReactDialogPickerManager and ReactDropdownPickerManager
Summary:
This diff migrates ReactDialogPickerManager and ReactDropdownPickerManager to use the generated delegates for setting their properties.

Changelog:
[Android] [Added] - Use generated Java delegate for setting properties on ReactDialogPickerManager and ReactDropdownPickerManager

Reviewed By: mdvacca

Differential Revision: D17930994

fbshipit-source-id: 009ad9eceb683b7170eddeccfd986b1dc5cb8c0b
2019-11-06 05:23:45 -08:00
Emily Janzer 6598292ede Add a field + getter for instanceKey to ReactContext
Summary:
Adding a new String field for `instanceKey` to ReactContext, which is set via a new constructor on ReactApplicationContext. Also adding getters to ReactContext and ThemedReactContext so that it's accessible from any instance/subclass of ReactContext.

This will only be used in bridgeless mode.

Reviewed By: mdvacca

Differential Revision: D18316556

fbshipit-source-id: 9757da72fde4ba36034c1e129326461fed496229
2019-11-05 19:01:53 -08:00
Joshua Gross f77abc583c Add UI asserts and logs to a few more places
Summary:
Add UI asserts to ensure thread safety of some operations.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D18339981

fbshipit-source-id: 9162b6351f40bdd543d3e255691e9f54d1934589
2019-11-05 18:20:01 -08:00
Joshua Gross b1b97b8b45 UiThreadUtil.assertX should only throw in DEBUG mode
Summary:
Turns out that `SoftAssertions.java` has always been a lie - it actually always throws exceptions. Migrate it to using `ReactSoftException`.

This file hasn't been touched at all since it was originally open-sourced, besides codemods!

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D18336020

fbshipit-source-id: cba3db25a9f9d61325dd3f7843e92e984ae56281
2019-11-05 15:36:29 -08:00
David Vacca e885ddedb9 Fix crash when using TextInput.FontVariant prop in Android API level < 26
Summary:
This diff fixes a crash when using TextInput.FontVariant prop in Android API level < 26

Changelog: Fix TextInput.FontVariant prop in Android API level < 26 (related to PR https://github.com/facebook/react-native/pull/27006)

Reviewed By: JoshuaGross

Differential Revision: D18331807

fbshipit-source-id: 5eac4d9e38eb099fae1287d128f3f8c249b0b8bc
2019-11-05 14:40:19 -08:00
Joshua Gross a7f56e73e4 Add UI-Thread assertions in methods that mutate Views
Summary:
As part of `T54997838` we're auditing where removeView could possibly be called in a background thread, and adding annotations to indicate places where we don't think it's possible.

Changelog: [internal]

Reviewed By: makovkastar

Differential Revision: D18320461

fbshipit-source-id: 84b6b9e293d903f835fc42bc98614efb54158986
2019-11-05 13:18:59 -08:00
David Vacca 3281714312 Ensure that ReactInstanceManager is still alive when animation system updates views in Fabric
Summary:
This diff ensures that ReactInstanceManager has a valid catalystInstance when updating views as part of the animation system.
This also force the update of views to be posted in the UI Thread

Changelog: [internal]

Reviewed By: JoshuaGross

Differential Revision: D18311782

fbshipit-source-id: 1f1e7b0d34346f34b3607e5b75e5c14cda3f4861
2019-11-05 12:33:07 -08:00
Vincent Cheung 1df8bd4932 Fix multiple set-cookie not aggregated correctly in response headers (#27066)
Summary:
Multiple `set-cookie` headers should be aggregated as one `set-cookie` with values in a comma separated list. It is working as expected on iOS but not on Android. On Android, only the last one is preserved

The problem arises because `NetworkingModule.translateHeaders()` uses `WritableNativeMap` as the translated headers but uses both native and non-native methods. The mixup causes out of sync data that both sets of methods do no agree. A simple fix is to use `Bundle` as the storage and only convert it to `WritableMap` at the end in one go

Related issues: https://github.com/facebook/react-native/issues/26280, https://github.com/facebook/react-native/issues/21795, https://github.com/facebook/react-native/issues/23185

## Changelog

[Android] [Fixed] - Fix multiple headers of the same name (e.g. `set-cookie`) not aggregated correctly
Pull Request resolved: https://github.com/facebook/react-native/pull/27066

Test Plan:
A mock api, https://demo6524373.mockable.io/, will return 2 `set-cookie` as follows:
```
set-cookie: cookie1=value1
set-cookie: cookie2=value2
```

Verify the following will print the `set-cookie` with a value `cookie1=value1, cookie2=value2`
```javascript
  fetch('https://demo6524373.mockable.io/')
    .then(response => {
      console.log(response.headers);
    });
```
On iOS, `set-cookie` will have `cookie1=value1, cookie2=value2` while on Android it will have `cookie2=value2` (preserving only the last one)

Differential Revision: D18298933

Pulled By: cpojer

fbshipit-source-id: ce53cd41d7c6de0469700617900f30a7d0914c26
2019-11-05 03:30:02 -08:00
Valentin Shergin 2690e7363c Fabric: Cross-platform implementation of monotonicTimeInMilliseconds
Summary:
Now the function supports iOS.
We will use it soon.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: mdvacca

Differential Revision: D18285828

fbshipit-source-id: b9c16433e9c75ab4c071e4bd55074757372f6c0a
2019-11-04 18:21:12 -08:00
Ramanpreet Nara 1d315608ef Make RCTCameraRollManager TurboModule-compatible
Summary:
See title.

Changelog:
[iOS][Added] - Make RCTCameraRollManager TurboModule-compatible

Reviewed By: PeteTheHeat

Differential Revision: D18148892

fbshipit-source-id: de49e368615032b2c4de129dc55191c562cbdfbe
2019-11-04 16:07:24 -08:00
Ramanpreet Nara 7e5de4e241 Make RedBox TurboModule-compatible
Summary:
See title.

Changelog:
[iOS][Added] - Make RedBox TurboModule-compatible

Reviewed By: PeteTheHeat

Differential Revision: D18142255

fbshipit-source-id: 2d130aca93a88ac7c983ce0e4848955ffb0be518
2019-11-04 16:07:23 -08:00
Ramanpreet Nara fe3ae9dce8 Make RCTDevMenu and RCTDevSettings TurboModule-compatible
Summary:
Changelog:
[iOS][Added] - Make RCTDevMenu and RCTDevSettings TurboModule-compatible

Reviewed By: shergin

Differential Revision: D18148890

fbshipit-source-id: bd4f0b2797e299cd963e34fa47044a9e1232efe0
2019-11-04 16:07:23 -08:00
Janic Duplessis 686ab49107 Don't restore default values when components unmount (#26978)
Summary:
There are some cases where restoring default values on component unmount is not desirable. For example in react-native-screens we want to keep the native view displayed after react has unmounted them. Restoring default values causes an issue there because it will change props controlled my native animated back to their default value instead of keeping whatever value they had been animated to.

Restoring default values is only needed for updates anyway, where removing a prop controlled by native animated need to be reset to its default value since react no longer tracks its value.

This splits restoring default values and disconnecting from views in 2 separate native methods, this way we can restore default values only on component update and not on unmount. This takes care of being backwards compatible for JS running with the older native code.

## Changelog

[General] [Fixed] - NativeAnimated - Don't restore default values when components unmount
Pull Request resolved: https://github.com/facebook/react-native/pull/26978

Test Plan:
- Tested in an app using react-native-screens to make sure native views that are kept after their underlying component has been unmount don't change. Also tested in RNTester animated example.

- Tested that new JS works with old native code

Reviewed By: mmmulani

Differential Revision: D18197735

Pulled By: JoshuaGross

fbshipit-source-id: 20fa0f31a3edf1bc57ccb03df9d1486aba83edc4
2019-11-04 15:40:09 -08:00
David Vacca 595f5ac64d Fix Collapsing of Delete-Create mounting instructions
Summary:
This diff fixes the Collapsing of Delete-Create mounting instructions algorithm. By mistake I switch the conditions before landing the original diff.

Changelog: [Internal]

Reviewed By: JoshuaGross

Differential Revision: D18306616

fbshipit-source-id: 50cd8ca67adcaf172ce51896df684fed270b2d51
2019-11-04 14:34:33 -08:00
Oleksandr Melnykov 8d31e38966 Integrate StickerInputView into Fabric on Android
Summary:
This diff integrates `StickerInputView` into Fabric on Android.

Changelog: [Internal]

Reviewed By: mdvacca, cpojer

Differential Revision: D18029223

fbshipit-source-id: 2e412b83f9af347e01606d526c04e13d1f2bfbb8
2019-11-04 12:42:26 -08:00