Commit Graph

3002 Commits

Author SHA1 Message Date
Samuel Susla 9c27ccd7d0 Use commands from JS in RefreshControl instead of setNativeProps
Summary: Changelog: [Internal] RefreshControl uses commands instead of setNativeProps

Reviewed By: TheSavior

Differential Revision: D18475794

fbshipit-source-id: fbfe3fcfa465c821d673bf9a9666c989ba4f9545
2019-12-23 12:02:20 -08:00
David Vacca a8fbbe2350 Fix rendering of TextInput in Android 4
Summary:
This diff fixes the rendering of TextInput component for Android 4 devices.
This bug was caused by D18196901, when we changed the base class of ReactEditText from EditText to AppCompatEditText.
The root of the problem is that AppCompatEditText wraps the ReactContext received as a parameter in the construction of the View into a ContextWrapper object. This break the implicity assumption that the method View.getContext will return the same context that was used during the construction of the view.
https://android.googlesource.com/platform/frameworks/support/+/dd55716/v7/appcompat/src/android/support/v7/widget/AppCompatEditText.java#55

Changelog: [internal]

Reviewed By: ejanzer

Differential Revision: D19204032

fbshipit-source-id: eefb562b1da22e6cc58c75845c87dd032d727f49
2019-12-20 17:27:53 -08:00
David Vacca f2d58483c2 Disable accessibility state changes of the focused view for Android API < 21
Summary:
This diff disables accessibility state changes of the focused view for Android API < 21.
This is necessary because the method view.isAccessibilityFocused was introduced in Android API 21
Users in Android API < 21 will not be able to hear accessibility state changes of the focused view (feature introduced by D17903205)

Changelog: disables accessibility state changes of the focused view for Android API < 21, see PR: 26624

Reviewed By: fkgozali

Differential Revision: D19199096

fbshipit-source-id: 12b349f0ac94b77e9e7328ae40e1ae1a278e8b24
2019-12-20 12:04:10 -08:00
Ramanpreet Nara d43059d0b8 Correct ReactModuleSpecProcessor TurboModule detection logic
Summary:
## Problem
For efficiency reasons, we'd only check whether the current class or its superclass implemented the `TurboModule` interface. However, it's possible for NativeModules to exist that use inheritance, and have their base class extend a code-generated spec. In this case, the superclass of the superclass of the NativeModule will implement `TurboModule`.

## Solution
To fix this problem, I'm relying on the `Types.isAssignable` API and checking whether the NativeModule can be assigned to the `TurboModule` interface. This is a more reliable way of knowing whether a NativeModule is a TurboModule or not.

**Note:** Had to adjust the buck dependencies of FrescoModule to make the `mTypes.isAssignable` check work.

Changelog:
[Android][Fixed] - Correct TurboModule detection logic in ReactModuleSpecProcessor

Reviewed By: fkgozali

Differential Revision: D19183671

fbshipit-source-id: ad21881453fe7027d9432048108f6ba344fd7e63
2019-12-20 08:49:05 -08:00
Ramanpreet Nara c20963e11c Unregister JSDevSupport from DebugCorePackage
Summary:
## Problem
`DebugCorePackage` is a `TurboReactPackage`. To register a `TurboReactPackage`s NativeModules, the `NativeModuleRegistryBuilder` loops over all `ReactModuleInfo`s in the package's auto-generated `ReactModuleInfo` list. This list is generated from the `ReactModuleList` annotation of the package using our annotation processors. Because `JSDevSupport` was in its package's `ReactModuleList` annotation, we generated a `ReactModuleInfo` object for it. Therefore, `NativeModuleRegistryBuilder` registered `JSDevSupport` twice (once in `DebugCorePackage` and twice in `Fb4aReactPackage`).

## How did this work before?
`JSDevSupport` was always a part of the `ReactModuleList` annotation of `DebugCorePackage`. However, before D18974084 landed, there were two key things that made this work:
1. `DebugCorePackage` was a `LazyReactPackage`,
2. The `DebugCorePackage.getNativeModules()` did not return a `ModuleHolder` for `JSDevSupport`.

For `LazyReactPackage`s, `NativeModuleRegistryBuilder` calls `LazyReactPackage.getNativeModuleIterator()` to register NativeModules. The iterator returned from `LazyReactPackage.getNativeModuleIterator()`, in this case, loops over the NativeModules returned from `DebugCorePackage.getNativeModules()`. Therefore, we don't register any NativeModules that aren't in `DebugCorePackage.getNativeModules()`. Since `DebugCorePackage.getNativeModules()` didn't contain `JSDevSupport`, it wasn't registered for the second time.

Changelog:
[Android][Fixed] - Unregister JSDevSupport from DebugCorePackage

Reviewed By: ejanzer

Differential Revision: D19187664

fbshipit-source-id: 34141c60542179567d75705937ba09ec8a3dfc2b
2019-12-20 08:34:13 -08:00
Héctor Ramos be355a24b7 Re-sync with internal repository 2019-12-19 13:42:21 -08:00
Kevin Gonzales 7428271995 Remove code that would cause accessibility header role to be spoken twice (#27496)
Summary:
The header role is being said twice in android. Stopped that from happening.

## Changelog
[General] [Added] - removed code that would cause accessibility header role to be spoken twice
Pull Request resolved: https://github.com/facebook/react-native/pull/27496

Test Plan:
Test plan is testing in RNTester making sure the examples work

## Note:
generatedComponentApiDocs.js was modified by lint commands. I can submit a PR without it if preferred.

Differential Revision: D18973520

Pulled By: hramos

fbshipit-source-id: 9a7cc2d3fac1d0fc79dedb443d5ca365026b3b15
2019-12-19 12:31:59 -08:00
sunnylqm 5ddf00ee1a Fix android modal not disappear when reload (#27542)
Summary:
Fixes https://github.com/facebook/react-native/issues/17986

See above issue

After apply this change:
![ezgif-4-45d9add85b74](https://user-images.githubusercontent.com/615282/70987576-2520ad00-20fb-11ea-9b90-c9a7839824a5.gif)

## Changelog

[Android] [Fixed] - Fix android modal not disappear when reload
Pull Request resolved: https://github.com/facebook/react-native/pull/27542

Test Plan: Open a modal and do a refresh to see whether it disappears

Differential Revision: D19178803

Pulled By: mdvacca

fbshipit-source-id: 61894927fc481650804b2196df06a80c16b64e6c
2019-12-19 10:06:45 -08:00
Rick Hanlon 2436aa94f2 Remove task TODO that's TODONE
Summary:
I stumbled on this comment where the task was closed

Changelog: [Internal]

Reviewed By: lunaleaps, RSNara

Differential Revision: D18933260

fbshipit-source-id: 8d35e0fa19dc9aec7b811131318858c27c34accd
2019-12-18 13:49:52 -08:00
Valentin Shergin b2f267ac3b Fabric: Propagation of ScrollView's contentOffset value down to ShadowNode layer on Android
Summary:
This implements propagation of ScrollView's contentOffset value on Android. That allows `LayoutableShadowNode::getRelativeLayoutMetrics` (and some measure functions) return values that take that info into  account.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: mdvacca

Differential Revision: D19027433

fbshipit-source-id: 023ff9642d023971b3d24d5cc5f7c2f4b443031e
2019-12-18 10:48:41 -08:00
Mehdi Mulani 3714f3648a Make package location customizable in dev mode
Summary:
@public
With this, you can determine the packager location at run time before we even try to load the bundle.

Changelog: [Android] [Added] - Packager location can be determined at run time

Reviewed By: makovkastar

Differential Revision: D18940087

fbshipit-source-id: fac99f28e119a4e7a2961b5504cfe7d2d409e8f7
2019-12-17 21:10:34 -08:00
Emily Janzer 636f48de89 Check bridgeless mode in getReactApplicationContextIfActiveOrWarn
Summary:
We currently have a method in ReactContextBaseJavaModule that logs a warning if the native module is trying to access a ReactContext without an active Catalyst instance (because if you try to access it directly, it throws).

For bridgeless mode, we never have a CatalystInstance, but it's safe to call certain methods on the context that would normally require one. For this case, let's just return the context when the context is in bridgeless mode.

Changelog: [Internal]

Reviewed By: RSNara

Differential Revision: D19133988

fbshipit-source-id: cae0bd397aa24d9ad416491cbc32676870cc70b0
2019-12-17 18:38:57 -08:00
Pascal Hartig 973253af8a Remove NativeRunnableDeprecated (#27529)
Summary:
The class was deprecated in 2016 and is blocking an upgrade to fbjni
which no longer supports the `Countable` class this extends.

Changelog:
[Android] [Removed] - NativeRunnableDeprecated
Pull Request resolved: https://github.com/facebook/react-native/pull/27529

Test Plan: No references to it in this codebase.

Reviewed By: mdvacca

Differential Revision: D19087074

Pulled By: passy

fbshipit-source-id: a4ee73be7c13cedf1d86d2643f8e788ad4a2e31f
2019-12-17 13:23:59 -08:00
David Vacca 69e9f3a389 Fix rendering of RN android apps
Summary:
This diff fixes the redbox that is currently affecting initial render of  RN Android apps
More details: https://fb.workplace.com/groups/rn.support/permalink/3125289967519597/

Changelog: [internal]

Reviewed By: JoshuaGross, ejanzer

Differential Revision: D19132862

fbshipit-source-id: 6833a32bae2e0dda254f1bd09520551aa41fa822
2019-12-16 18:25:54 -08:00
Ramanpreet Nara 96a6ffb3e8 Make NativeModules TurboModule-compatible
Summary:
All these NativeModules are now: (1) type-safe, (2) TurboModule-compatible.

**Note:** We still need to update `{Catalyst,Work,Fb4a}TurboModuleManagerDelegate` to understand these TurboModules. I'll most likely write up that diff and stack this one on top of it.

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

Reviewed By: mdvacca

Differential Revision: D18888735

fbshipit-source-id: 34df64dc70e3f3a0a0303c049861205f9d3fd2ed
2019-12-15 16:56:53 -08:00
David T. Nguyen 80bc51195e Revert D18787789: Make Java only NativeModules TurboModule-compatible
Differential Revision:
D18787789

Original commit changeset: d513006ffd73

fbshipit-source-id: 5757f8fe789840c10e358aa510e321fb8b326b7c
2019-12-13 22:26:48 -08:00
Ramanpreet Nara 1d3a95d96c Make Java only NativeModules TurboModule-compatible
Summary:
For NativeModules that don't need to be accessed from JS, we can just have them implement the TurboModule interface. This is enough to make them be instantiated via the TurboModule system.

Changelog:
[Android][Added] - Make Java only NativeModules TurboModule-compatible

Reviewed By: ejanzer

Differential Revision: D18787789

fbshipit-source-id: d513006ffd736621adbd41146ed6280a60a7437e
2019-12-13 18:23:14 -08:00
Ramanpreet Nara b40ed6890d Adjust TMMDelegate tests to account for all registered packages
Summary:
`Fb4a` and `Workplace` use only one product-specific `ReactPackage`, but `ReactInstanceManager` also installs `CoreModulesPackage` and `DebugCorePackage`. These two packages have NativeModules that got converted to the TurboModule system. So, I've added them to the `Fb4aReactPackagesTest` and `WorkReactPackageTest` to ensure that NativeModule conversions in framework-provided packages are also tested.

Changelog:
[Internal]

Reviewed By: PeteTheHeat

Differential Revision: D18974083

fbshipit-source-id: a98ec28a882ce51597a068ddecf43f5fbb6bfdc6
2019-12-13 16:08:59 -08:00
Ramanpreet Nara 4ba466c515 Make DebugCorePackage a TurboReactPackage
Summary:
The NativeModules in DebugCorePackage are now TurboModule-compatible. Therefore, we must make this extend `TurboReactPackage`.

Changelog:
[Internal] - Make DebugCorePackage a TurboReactPackage

Reviewed By: fkgozali

Differential Revision: D18974084

fbshipit-source-id: 648b54fefe7f8952666d5a23a9d81cc6bb167b31
2019-12-13 16:08:59 -08:00
Ramanpreet Nara 50999b1cf2 Stop hard-coding ReactModuleInfo constructor args
Summary:
We're going to migrate our NativeModules to the TurboModule system soon. Therefore, it's no longer safe to assume that all NativeModules are not TurboModules. Also, it's not a good idea to hard-code this stuff if we can calculate the correct values on the fly.

Changelog:
[Internal]

Reviewed By: PeteTheHeat

Differential Revision: D18980859

fbshipit-source-id: 399a75a72d7f57998b217502ff79d7d911cc5a1c
2019-12-13 16:08:58 -08:00
Dulmandakh aaa2765a92 ReactEditText extends AppCompatEditText (#27039)
Summary:
Google recommends to extend AppCompat widgets, and Android Studio suggests the change. This PR changes ReactEditText to extend AppCompatEditText.

## Changelog

[Android] [Changed] - ReactEditText extends AppCompatEditText
Pull Request resolved: https://github.com/facebook/react-native/pull/27039

Test Plan: CI is green

Reviewed By: mdvacca

Differential Revision: D18196901

Pulled By: hramos

fbshipit-source-id: 1484ae3da1be5776d0431dab3d4bb7ddbe5b8b7c
2019-12-12 07:51:25 -08:00
David Vacca f6edeccf20 Refactor ReactContext to use IllegalStateException instead of RuntimeException
Summary:
This diff refactors ReactContext to use IllegalStateException instead of RuntimeException when applicable.

Changelog: [internal]

Reviewed By: JoshuaGross

Differential Revision: D18901845

fbshipit-source-id: 51ec36824c8402fa2c17e76c55578be44ec8aa15
2019-12-11 18:39:51 -08:00
David Vacca b28cd93b68 Migrate events on ReactRootView and ScrollView to be bridgeless
Summary:
This diff migrates a couple of events callsites of ReactRootView and ScrollView to be compatible with Bridgeless React mode

Changelog: [internal]

Reviewed By: ejanzer

Differential Revision: D18862857

fbshipit-source-id: f8e0d2d684bfaf84e9c138746507bb7728481b18
2019-12-11 18:39:50 -08:00
Ramanpreet Nara f8d5c5bfd7 Make constructor arg of ReactContextBaseJavaModule @Nullable
Summary:
ExceptionManagers are created before the `ReactApplicationContext`. Once we make them all TurboModule-compatible, they'll also subclasses `ReactContextBaseJavaModule`. This means that they'll need to be created with `ReactApplicationContext`. Since one isn't available, we'll have to call `super(null)` in their constructor.

Changelog:
[Android][Changed] - Make ReactApplicationContext nullable as the constructor argument of ReactContextBaseJavaModule

Reviewed By: PeteTheHeat

Differential Revision: D18935950

fbshipit-source-id: a643a10a42cf36a2a2d6fde87795965f16295d43
2019-12-11 11:31:51 -08:00
Ramanpreet Nara a8fbc5b893 Fix BlobModule getConstants()
Summary:
It's possible for us to return no constants from the BlobModule. Therefore, I'm correcting the flow-type.

Changelog:
[Internal]

Reviewed By: fkgozali

Differential Revision: D18932328

fbshipit-source-id: 2b415d12effd16eda313d5591825c711a20f9ae3
2019-12-11 11:31:51 -08:00
David Vacca 4ef3fafa7c Extend UIManagerHelper class to retrieve EventDispatcher associated with a ReactContext
Summary:
This diff extends the UIManagerHelper class to expose the EventDispatcher associated to a tag / UImanagerType

Changelog: [internal]

Reviewed By: JoshuaGross

Differential Revision: D18862863

fbshipit-source-id: 14ce7a6a33f20a94a6296320924dbe3544eadd85
2019-12-10 20:33:56 -08:00
David Vacca c5efc63663 Expose getJSIModule as part of the ReactContext class
Summary:
This diff exposes the getJSIModule on the ReactContext class.
This class already has methods to obtain NativeModules and JSModules, it make sense to expose the getJSIModule method too.

Changelog: [internal]

Reviewed By: JoshuaGross

Differential Revision: D18862858

fbshipit-source-id: 95fe48c065266060c96fc40a002041ba398b3134
2019-12-10 20:33:55 -08:00
David Vacca df32ab43fb Expose a method to ReactContext to determine if we are running in Bridgeless mode or not
Summary:
This method exposes a method to ReactContext to determine if we are running in Bridgeless mode or not

Changelog: [internal]

Reviewed By: JoshuaGross

Differential Revision: D18901149

fbshipit-source-id: bdd5ba747381f3bde5f592276b42244ca01ccbb9
2019-12-10 20:33:55 -08:00
David Vacca bc11e9c7f1 Expose getEventDispatcher() method into UIManager interface
Summary:
This diff promotes the UIManagerModule.getEventDispatcher() to the interface UIManager and it implements this method in FabricUIManager class.

Changelog: [internal]

Reviewed By: JoshuaGross

Differential Revision: D18862862

fbshipit-source-id: 424f0e601ed1807dbd5d33048daf7dc3bb200dcd
2019-12-10 20:33:55 -08:00
Ramanpreet Nara 37df2b28ad Delete getConstants from ImageEditingManager
Summary:
`NativeImageEditor` doesn't export any constants. Therefore, `ImageEditingManager` doesn't need a `getConstants()` method. In a subsequent diff (D18888735), I rename all `ReactMethod getConstants()` methods to `Override getTypedExportedConstants()`. This raises an error because the spec for `ImageEditingManager` doesn't contain a `getTypedExportedConstants()` method.

Changelog:
[Internal] - Delete getConstants() from ImageEditingManager

Reviewed By: fkgozali

Differential Revision: D18909419

fbshipit-source-id: 7e4f84f102068aa44bb3d267c66a60c0d0d27404
2019-12-10 12:35:17 -08:00
Rick Hanlon e272089524 Add NativeLogBox module on Android
Summary:
This diff adds a NativeLogBox module implementation on Android to manage rendering LogBox the way we render RedBox, except rendering a React Native component instead of a native view.

The strategy here is:
- initialize: will create a React rootview and render it.
- show: will add the rootview to a dialog and display the dialog.
- hide: will remove the rootview from it's parent, dismiss the dialog, and release the reference to the activity to prevent leaks.

Most of this is copied from the way RedBox works, the difference here is that we eagerly initialize the rootview with the `initialize` function so that it's warm by the time the dialog needs to render.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D18768517

fbshipit-source-id: 2510d6c186ccf73153ef9372c736c9e0c71bbc7d
2019-12-10 02:31:37 -08:00
Joshua Gross 9bb042fe58 TextInput: ViewManager shouldn't reset EditText padding when none is set
Summary:
UpdateLocalData and UpdateState return an `extra data` object, which in the case of TextInput contains padding. In Paper, the padding was always set on this object; in Fabric, it generally is not. However, the ViewManager was unconditionally setting the padding on the view, regardless of whether or not padding was set. We just check the padding values before setting now. This fixes an issue where the padding would be reset when the user started typing in Fabric.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D18875261

fbshipit-source-id: d7cb87c07f47ab522e32cd34a4ca6ed5fea2e832
2019-12-08 18:24:18 -08:00
Joshua Gross 2ee11711e0 TextInput: don't call Paper UIManager setViewLocalData in Fabric
Summary:
In Paper this call causes Yoga to remeasure the tree. We don't need to do this in Fabric, and all the data contained in `ReactTextInputLocalData` is already set on the underlying EditText View.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D18870491

fbshipit-source-id: a982a708b810d45f70ad4981a963bb4ae798c83c
2019-12-07 00:12:59 -08:00
Anandraj Govindan 7cfabf42b8 Avoid throwing exceptions when the host activity is not FragmentActivity (#27425)
Summary:
There are some code in native modules which currently throws exception when the host activity is not a FragmentActivity, even if the native module is not used. This change avoids the throw and fail the promise instead.

## Changelog

There are some code in native modules which currently throws exception when the host activity is not a FragmentActivity, even if the native module is not used. This change avoids the throw and fail the promise instead.

[CATEGORY] [TYPE] - Message
Pull Request resolved: https://github.com/facebook/react-native/pull/27425

Test Plan: We've tested the change on MS Office applications, which currently don't use FragmentActivity.

Differential Revision: D18873012

Pulled By: mdvacca

fbshipit-source-id: 1b7c9efba5a59b2051487510da9ef7e1232877a5
2019-12-06 20:39:34 -08:00
Ramanpreet Nara 5c6451247d Make DeviceInfo extend ReactContextBaseJavaModule
Summary:
Changelog:
[Android][Changed] - Make DeviceInfo extend ReactContextBaseJavaModule

Reviewed By: PeteTheHeat

Differential Revision: D18784629

fbshipit-source-id: 782b922aa14232738dc7969594b0e0f07d9241f9
2019-12-06 10:05:10 -08:00
Ramanpreet Nara d9deee20e7 Refactor TurboModule filtering in NativeModuleRegistryBuilder
Summary:
## Context
`NativeModuleRegistryBuilder` calls `TurboReactPackage.getNativeModuleIterator()` to access ModuleHolders for all the NativeModules in the `TurboReactPackage`. We then filter out the ModuleHolders that contain `TurboModules`, before using that list to make create the `NativeModuleRegistry`.

## Problem
Creating `ModuleHolders` has the side-effect of actually creating the NativeModule if it requires eager initialization. See [ModuleHolder.java](https://fburl.com/diffusion/4avdtio0):

```
class ModuleHolder {
  // ...
  public ModuleHolder(ReactModuleInfo moduleInfo, Provider<? extends NativeModule> provider) {
    mName = moduleInfo.name();
    mProvider = provider;
    mReactModuleInfo = moduleInfo;
    if (moduleInfo.needsEagerInit()) {
      mModule = create(); // HERE!
    }
  }

```

So, we need to filter out TurboModules before we even create ModuleHolders.

Changelog:
[Android][Fixed] - Refactor TurboModule filtering in NativeModuleRegistryBuilder

Reviewed By: PeteTheHeat, mdvacca

Differential Revision: D18814010

fbshipit-source-id: a120d2b619b9280ba70e21d131dccc5a9fc6346d
2019-12-05 19:00:13 -08:00
Ramanpreet Nara b7f49a84d5 Implement TurboModule eager initialization
Summary:
The TurboModuleManagerDelegate now supports a `getEagerInitModuleNames()` method, which is supposed to return a `java.util.List` containing the names of all NativeModules that require eager initialization. The NativeModuels are created when the `TurboModuleManager` is created. This happens inside `ReactInstanceManager.createReactContext` slightly after the NativeModuleRegistry is created, which is when our legacy NativeModules are eagerly initialized.

All NativeModules declared in `TurboReactPackages` that are wired into the `TurboModules` infra via `ReactPackageTurboModuleManagerDelegate` can use the `ReactModule(needsEagerInit = true)` annotation. Our build pipeline should correctly process the annotation into a `ModuleInfo`, and `ReactPackageTurboModuleManagerDelegate` should correctly forward the eagerly initialized module names to TurboModuleManager.

Changelog:
[Android][Added] - Implement TurboModule eager initialization support

Reviewed By: mdvacca

Differential Revision: D18819552

fbshipit-source-id: b2009a3b8f4e064362d2abeb5281637962531678
2019-12-05 13:24:43 -08:00
Joshua Gross 0bae47434e TextInput: keep C++ state in-sync with updated AttributedStrings in Java
Summary:
When the TextInput is updated on the Java side, make sure C++ State gets updated. We do this by making sure that the AttributedString data-structured in mirrored in Java and in C++.

In practice, the AttributedString is copied into Java a few times during initialization, and then after then, 99% of the time Java is writing without receiving updates from C++. This means that we should optimize the Java-to-C++ update path most aggressively in the future.

However, it turns out that for now, at least, we can't reuse NativeWritableMaps/NativeWritableArrays because they're consumed on the C++ side and can't be modified after that. This is a perf improvement for the future.

This allows us the user to edit any fragments, and the changes will flow through C++ State. This also allows us to edit across multiple Fragments.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D18785960

fbshipit-source-id: 97b283ec411081eca4d2d7a4cce2b31b5e237c42
2019-12-05 13:20:30 -08:00
Joshua Gross a09346f129 TextInput: support text value+child Text nodes
Summary:
Fix and simplify `AndroidTextInputShadowNode::getAttributedString` so that it (1) works, and (2) is aligned with the equivalents in the old Java code.

The issue is that we weren't picking up `text` attributes since we're only traversing children and not the TextInput node itself. If a `text` attribute is present it needs to be treated as its own Text node.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D18739830

fbshipit-source-id: 4b3bc81dbe8c241c2e06fe5be1f9b50e49132890
2019-12-05 13:20:29 -08:00
Joshua Gross 48c69af3e0 Throw non-crashing SoftException when ViewCommand is sent to non-existent tag
Summary:
Motivation: TextInput.js frequently sends commands to views as they're disappearing (`blur`, for instance).

We should fix that in the future, if possible. For now, just log the issue and continue. It shouldn't cause any user-facing issues since 1) it appears that TextInput knows the underlying view is gone; 2) the View has already disappeared so the user can't interact with it, so commands can go safely into the void.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D18821448

fbshipit-source-id: 980dbbce8cdb2cc0bb4bf60b3bccc90869208f01
2019-12-05 13:20:28 -08:00
Emily Janzer 476a336e36 Convert NetworkingModule to TurboModule
Summary: Making the open source NetworkingModule TM-compatible.

Reviewed By: mdvacca

Differential Revision: D18770987

fbshipit-source-id: 64966f91308e31bdcf9bfa959381d4e40ccb2753
2019-12-04 11:26:39 -08:00
Ramanpreet Nara a6a34ba1d1 Add codegen specs as dependencies of NativeModules
Summary:
## Step 1
I'm going to make every Java NativeModule type-safe and TurboModule-compatible. The first step is to make sure that every type-unsafe NativeModule has a dependency on its spec's codegen target.

## Input
Module -> owner(Module): P123320255
Module -> name(Module): P123320256
Module -> owner(spec(name(Module))): P123320257

### Excluded NativeModules
NativeModules without Specs: P123320644
Java only NativeModules: P123320645

Changelog:
[Internal] - Add buck dependencies for NativeModule specs

Reviewed By: mdvacca

Differential Revision: D18781629

fbshipit-source-id: 89f39017b8224355d9d7b43bf6c162b0957760ee
2019-12-03 15:37:30 -08:00
Emily Janzer 3963c7aa56 Clean up unused functions on ReactContext
Summary: Removing the methods I recently added for storing/retrieving an instance key on a ReactContext.

Reviewed By: PeteTheHeat, mdvacca

Differential Revision: D18710637

fbshipit-source-id: d34683ec660bd999db8112865e15392606fc9237
2019-12-03 11:33:00 -08:00
Oleksandr Melnykov 8cb66e3202 Integrate RCTMap into Fabric on Android
Summary:
This diff integrates RCTMap into Fabric on Android.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D18762933

fbshipit-source-id: 6e3e02e0e8101f94fe0c6582e1a63a66fb2f70f9
2019-12-03 09:07:38 -08:00
Ramanpreet Nara 4d9e5f8481 Delete com.facebook.react.modules.debug.NativeSourceCodeSpec
Summary:
When SourceCode was converted to a TurboModule in D17586276, we had to check in `NativeSourceCodeSpec` into the codebase. Since all the OSS NativeModule base classes are now checked into `react-native-github`, it's no longer necessary to keep `NativeSourceCodeSpec`. So, I'm deleting it.

Changelog:
[Android][Removed] - Delete com.facebook.react.modules.debug.NativeSourceCodeSpec

Reviewed By: PeteTheHeat, mdvacca

Differential Revision: D18732997

fbshipit-source-id: 6026b4bcb9ebb9c4d7ba556bc644698eb550a9de
2019-12-03 06:29:58 -08:00
Ramanpreet Nara 7ce8babfef Make ExceptionsManagers extend ReactContextBaseJavaModule
Summary:
Eventually, we want these to extend the abstract base class code-generated from the NativeModule spec. That base class extends `ReactContextBaseJavaModule`. So, this is a step in the right direction.

Changelog:
[Internal] Make ExceptionsManagerModule extend ReactContextBaseJavaModule

Reviewed By: PeteTheHeat, mdvacca

Differential Revision: D18718061

fbshipit-source-id: 70ba5c45b3ef1dd7602e1186763c8bc7ab5d4f42
2019-11-27 16:27:36 -08:00
David Vacca 5ddbd5c54f Add extra logging information in RN Android animation system
Summary:
This diff re-throw and logs exceptions in the animated module of RN Android
Changelog: internal

Reviewed By: JoshuaGross

Differential Revision: D18694124

fbshipit-source-id: bb4cb56dce99f09c56b0bc62733e8264f2df5a3f
2019-11-27 15:56:52 -08:00
David Vacca 4ad852c137 Add extra logging in the Bridge exception handling
Summary:
This diff adds extra logging in the method that handles exceptions for RN Android
Changelog: internal

Reviewed By: JoshuaGross

Differential Revision: D18694123

fbshipit-source-id: e275445b65473ed55eec9d4b823938e32fa805e5
2019-11-27 15:56:52 -08:00
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