Commit Graph

2954 Commits

Author SHA1 Message Date
Joshua Gross 7ab5eb4caf AndroidTextInput: support using commands instead of setNativeProps (native change)
Summary:
In AndroidTextInput, support codegen'd ViewCommands in native and add three commands that will eventually replace usage of setNativeProps on Android.

TextInput will use these commands in a future diff.

Changelog: [Internal]

Reviewed By: TheSavior

Differential Revision: D18612150

fbshipit-source-id: 5d427040686e8c5ab504dd845bc8ef863f558c35
2019-11-27 12:55:48 -08:00
Joshua Gross da5ea0215a AndroidTextInput: keep track of mostRecentEventCount in C++ State
Summary:
Keep track of AndroidTextInput's mostRecentEventCount in C++ State.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D18672368

fbshipit-source-id: ea7a635629050a6d4957cbcef6ec0bda5faaad9a
2019-11-27 12:55:47 -08:00
Joshua Gross 07580f0f7e AndroidTextInput: support proper measuring of AndroidTextInput text, and displaying attributed strings
Summary:
Use a similar setup as Paragraph, and support in Fabric:

- Correct measuring of AndroidTextInput
- Correct display of AndroidTextInput attributed strings

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D18669957

fbshipit-source-id: 84e0ad8021c9edf8219e0c673c781276ca29787d
2019-11-27 12:55:46 -08:00
Ramanpreet Nara e69be0ae55 Give ReactContextBaseJavaModule a 0 arg ctor
Summary:
We need to make our ExceptionsManagers into TurboModules. To do so, we need to first make them type-safe. This requires extending the base class code-generated from the NativeModule JavaScript spec. That base class extends `ReactContextBaseJavaModule`, which requires `ReactApplicationContext` to instantiate. Unfortunatley, our ExceptionsManagers need to be created before the `ReactInstanceManager`. This means that the `ReactApplicationContext` isn't available by the time they're created.

In this diff, I make the `ReactContextBaseJavaModule` have a 0 argument constructor that simply sets its ReactApplicationContext to null. This will allow us to eventually migrate our ExceptionsManagers to the TurboModule system.

Changelog:
[Android][Added] - Give ReactContextBaseJavaModule a 0 arg ctor

Reviewed By: mdvacca

Differential Revision: D18717908

fbshipit-source-id: 203ffc49f2ec0b32a809402801795879d3b3a64b
2019-11-27 10:38:54 -08:00
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
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
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
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
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
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
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
David Vacca 94ba059679 Introduce the IS_DEVELOPMENT_ENVIRONMENT flag
Summary:
This diff introduces the flag IS_DEVELOPMENT_ENVIRONMENT that will be used in Fabric to control the logging of props, localData and state ONLY during development.
Using DEBUG mode to control the logging of this kind of data is not enough.

Changelog: [internal]

Reviewed By: JoshuaGross

Differential Revision: D18290351

fbshipit-source-id: cf0824bd15b9f1c509bbb284b85761166099bc42
2019-11-04 10:52:28 -08:00
David Vacca 894ee72278 Collapse Delete-Create mounting instructions
Summary:
This diff implements an optimization / fix in the mounting layer of Fabric Android to ignore the "deletion" and "creation" of views for the same tag in the same commit.
This operation is adding ~100 ns for every commit (I measured this using a release APK running in a real device). I created a QE to enable / disable this optimization and to measure the performance impact of this change in production

Changelog: Implement optimization in mounting layer of Fabric

Reviewed By: JoshuaGross

Differential Revision: D18279240

fbshipit-source-id: d6fdeb2a9676bcfaf47886893eed5024bf86204b
2019-11-03 14:54:01 -08:00
David Vacca 70904f6163 Add new parameter in Binding to configure collapsing of Delete-Create Mounting instructions
Summary:
This diff adds a new parameter in Binding class to configure the collapsing of Delete-Create Mounting instructions. This is necessary to fix T55696973.
I'm configuring this in order to measure the cost of this fix in produiction environment.

Changelog: [Internal]

Reviewed By: shergin

Differential Revision: D18279239

fbshipit-source-id: b7743f6364b66d19c9ae7309919926debf574213
2019-11-03 13:12:22 -08:00
David Vacca 87e1734217 Add extra logging in FabricUIManager
Summary:
Easy diff to extend logging in FabricUIManager class

Changelog: Add extra logging in Fabric Android

Reviewed By: shergin

Differential Revision: D18277487

fbshipit-source-id: 387bdb4b237bdbdc0d65263c1f125ad5c9e26b18
2019-11-03 01:47:55 -07:00
Ramanpreet Nara 56ad1bd38a Assert TurboModuleRegistry is not null
Summary:
Looking at the crash reports from T46487253:
1. This crash happens only with TurboModule-compatible NativeModules.
2. Users who experience this crash are in the TurboModules test group.

Therefore, the crash happens while trying to load TurboModules.

The stack trace of the crash includes [this lookup via the NativeModule system](https://fburl.com/diffusion/vxj9goz5). When TurboModules are enabled, we can only start executing this line if one of two things are true:
1. The TurboModuleRegistry is null in CatalystInstanceImpl.
2. The TurboModuleRegistry isn't null but the NativeModule returned by the TurboModuleRegistry is null.

We can protect against 1 by asserting that when `ReactFeatureFlags.useTurboModules` is `true`, `mTurboModuleRegistry` is not null. Once this check lands, unless there's a race with setting `ReactFeatureFlags.useTurboModules`, we should be able to rule out 1.

Changelog:
[Added][Android] - Assert TurboModuleRegistry isn't null before using it in CatalystInstanceImpl

Reviewed By: PeteTheHeat

Differential Revision: D18211935

fbshipit-source-id: de88c033425c474ef80b73386b7182b1d3bb382f
2019-11-01 19:24:09 -07:00
David Vacca 34989c88e0 Stop logging props and local data
Summary:
Quick diff to avoid the logging of Props, State and localData in Fabric Android.

Changelog: [Internal]

Reviewed By: shergin

Differential Revision: D18277486

fbshipit-source-id: 462335e7dadaab2bd39a8ede6318f52f95dfb53a
2019-11-01 14:31:31 -07:00
David Vacca 00266693b3 Avoid copying vector in mounting layer of Fabric
Summary:
easy diff to avoid the constant copy of a vector when calling the method Binding.createRemoveAndDeleteMultiMountItem. Since we are not modifing the vector inside the method createRemoveAndDeleteMultiMountItem it's not necessary to copy it.

Changelog: Improve performance in mounting of Fabric views

Reviewed By: JoshuaGross

Differential Revision: D18250376

fbshipit-source-id: c984214a8148bab521cec51d42ba54a4b73e3e67
2019-10-31 17:21:14 -07:00
David Vacca 2afc4e2482 Remove unused variable in ReactTextInputManager
Summary:
quick diff to remove unused variable in ReactTextInputManager

Changelog: Remove unused variable in ReactTextInputManager

Reviewed By: JoshuaGross

Differential Revision: D18250377

fbshipit-source-id: 93c0dc9384fda811d53b078715101f3317af9753
2019-10-31 17:21:14 -07:00