Граф коммитов

24337 Коммитов

Автор SHA1 Сообщение Дата
Paige Sun 917d63b37c (Easy) 2/5 Refactor RCTModuleData to use RCTBridgeModuleDecorator, to attach @synthesize ivars to non-TurboModule RCTBridgeModules in Bridge mode
Summary:
Changelog: 2/n Refactor RCTModuleData to use RCTBridgeModuleDecorator, to attach synthesize ivars to non-TurboModule RCTBridgeModules in Bridge mode

I decided to not include the `RCT_PROFILE_BEGIN_EVENT`s in [RCTBridgeModuleDecorator attachInteropAPIsToModule] because people don't override the set methods for the 4 synthesize ivars, so setting each ivar should be instant.

Reviewed By: RSNara

Differential Revision: D34438180

fbshipit-source-id: 871ac4cadd7a36821dac1274f0645c19d63943fc
2022-02-25 08:50:34 -08:00
Paige Sun 94b1b8a573 1/5 Refactor CxxBridge: Introduce RCTBridgeModuleDecorator to attach @synthesize ivars to RCTTurboModules, in Bridge mode
Summary:
Changelog: [iOS][Internal] Refactor CxxBridge: Introduce RCTBridgeModuleDecorator to attach synthesize ivars to RCTTurboModules, in Bridge mode

This doesn't change any logic. RCTBridgeModuleDecorator was created to consolidate several nearly identical implementations of the `attachInteropAPIsToModule` method to one place.

Most importantly, it allows us to attach interop APIs in RCTBridgeModuleDecorator to RCTViewManagers in diff 4/4, using  `attachInteropAPIsToModule`. Before this stack, these four synthesize ivars in RCTViewManagers are nil in Bridgeless mode, and point to instances in Bridge mode.

# Context
These are used in RCTBridgeModules to access APIs for view managers. These APIs are necessary and compatible with Bridgeless mode.

*  synthesize viewRegistry_DEPRECATED
*  synthesize bundleManager
*  synthesize callableJSModules
*  synthesize moduleRegistry

Reviewed By: RSNara

Differential Revision: D34437802

fbshipit-source-id: b773d511cf877d4896436fabf4893c978e5f8dd9
2022-02-25 08:50:34 -08:00
Pieter De Baets dc50308994 Remove default usages of enable_exceptions/rtti
Summary: Changelog: [Internal]

Reviewed By: ShikaSD

Differential Revision: D34379947

fbshipit-source-id: abff08ec99cff60d16ff82b7c0422d72caffd59b
2022-02-25 07:46:11 -08:00
Andrei Shikov 13b0b06522 Remove lint restricting properties on `DynamicColorIOS` (#33182)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/33182

This information can be checked by the type system + `DynamicColorIOS` supports other properties now.

Changelog: [Removed][iOS] - Removed lint restricting `DynamicColorIOS` to only two properties

Reviewed By: cortinico

Differential Revision: D34475985

fbshipit-source-id: c4190adad05e68b0a38a6ec89862372d9af55894
2022-02-25 06:46:14 -08:00
Pieter De Baets 4b1c8584e1 Remove size_ field from RawPropsParser
Summary:
`size_` will always match `keys_.size()` so we don't have to keep track of it.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D34391445

fbshipit-source-id: f6c9316c989137425abfb7b3d72b571d08240f34
2022-02-25 04:08:01 -08:00
jonathanmos 8d50bf1133 Fix Switch causing RetryableMountingLayerException (#32602)
Summary:
Added a null check to native.value in Switch to fix regression from RN 66 -> stuck operation in mViewCommandOperations list in Android Release on initial layout of a screen with Switch component. If approved, please incorporate this fix into an RN 66 release.

## Changelog
[Android][Fixed] - Added a null check to native.value in Switch to fix https://github.com/facebook/react-native/issues/32594

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

Test Plan: To reproduce, put a log in UIViewOperationQueue in dispatchViewUpdates you can see that the RetryableMountingException is no longer thrown for a screen with the Switch component on Android Release. As a result, mViewCommandOperations no longer has a stuck operation on initial layout.

Reviewed By: charlesbdudley

Differential Revision: D34397788

Pulled By: lunaleaps

fbshipit-source-id: 1cee3516fb987942dfa50ad1f2d11c965a947f05
2022-02-24 17:46:41 -08:00
Héctor Ramos 3c958a838d Add flag to enable building Hermes from source on iOS
Summary:
If Hermes is enabled on a project and the envvar `BUILD_HERMES_SOURCE` is truthy, a React Native project will build Hermes from source when running `pod install`:

```
cd ios/
BUILD_HERMES_SOURCE=1 pod install
```

* Requires `cmake` and `ninja` to be installed: `brew install cmake ninja`.
* Requires a `react-native` release with Hermes source code bundled in (`scripts/publish-npm.js --include-hermes && npm pack`).

# Changelog

[Internal]

Reviewed By: cortinico

Differential Revision: D34313581

fbshipit-source-id: 4ba5f82aa6c7027fd37f1982127fc5f63d931ded
2022-02-24 13:27:11 -08:00
Andrei Shikov 8b226f9f6a Add kotlin_home and related JARs for OSS Buck Kotlin build (#33168)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/33168

Buck Kotlin setup requires jars to be available locally before the build, so we are checking them in.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D34419817

fbshipit-source-id: 5e75f0f3818fb76b640349c003bd258bc12aa53d
2022-02-24 03:10:05 -08:00
Dave McCabe f035f9e6bb React Native sync for revisions 27b5699...4de99b3
Summary:
This sync includes the following changes:
- **[4de99b3ca](https://github.com/facebook/react/commit/4de99b3ca )**: fix getSnapshot warning when a selector returns NaN ([#23333](https://github.com/facebook/react/pull/23333)) //<OGURA Daiki>//
- **[40eaa22d9](https://github.com/facebook/react/commit/40eaa22d9 )**: Remove dependency on Offscreen Fiber updateQueue for React Cache ([#23229](https://github.com/facebook/react/pull/23229)) //<Luna Ruan>//
- **[caf6d4707](https://github.com/facebook/react/commit/caf6d4707 )**: Enable enableCache on Test Renderer native ([#23314](https://github.com/facebook/react/pull/23314)) //<David McCabe>//
- **[419ccc2b1](https://github.com/facebook/react/commit/419ccc2b1 )**: Land skipUnmountedBoundaries experiment ([#23322](https://github.com/facebook/react/pull/23322)) //<Andrew Clark>//
- **[54f785bc5](https://github.com/facebook/react/commit/54f785bc5 )**: Disallow comments as DOM containers for createRoot ([#23321](https://github.com/facebook/react/pull/23321)) //<Andrew Clark>//
- **[e9aa9592c](https://github.com/facebook/react/commit/e9aa9592c )**: change ReactBatchConfig.transition //<Luna Ruan>//
- **[51c8411d9](https://github.com/facebook/react/commit/51c8411d9 )**: Log a recoverable error whenever hydration fails ([#23319](https://github.com/facebook/react/pull/23319)) //<Andrew Clark>//
- **[79ed5e18f](https://github.com/facebook/react/commit/79ed5e18f )**: Delete vestigial RetryAfterError logic ([#23312](https://github.com/facebook/react/pull/23312)) //<Andrew Clark>//
- **[80059bb73](https://github.com/facebook/react/commit/80059bb73 )**: Switch to client rendering if root receives update ([#23309](https://github.com/facebook/react/pull/23309)) //<Andrew Clark>//
- **[f7f7ed089](https://github.com/facebook/react/commit/f7f7ed089 )**: Allow suspending in the shell during hydration ([#23304](https://github.com/facebook/react/pull/23304)) //<Andrew Clark>//

Changelog:
[General][Changed] - React Native sync for revisions 27b5699...4de99b3

jest_e2e[run_all_tests]

Reviewed By: rickhanlonii

Differential Revision: D34399162

fbshipit-source-id: 5c49e2bdcf63eb6a601cfa6a4e4b8f2e1f83e2dd
2022-02-23 19:56:24 -08:00
Andrei Shikov 78f6cdf2be Fix OSS native Android build (#33167)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/33167

The build is failing with:

```
error: undefined reference to 'folly::SharedMutexImpl<false, void, std::__ndk1::atomic, folly::SharedMutexPolicyDefault>::unlock_shared()'
```

Indicating missing link to `folly_futures`.

Changelog: [Internal]

Reviewed By: cortinico, GijsWeterings

Differential Revision: D34419236

fbshipit-source-id: ca777e0c3a13c2f23791a94b13de18911c93edd5
2022-02-23 09:23:21 -08:00
Ian Childs 22ac11a580 Mark some RN genrules as using local filesystem paths
Summary: Changelog: [Internal]

Differential Revision: D34380030

fbshipit-source-id: f444f176b56a7fd93f69936fdae2c81f26b310fe
2022-02-23 09:23:21 -08:00
Andrei Shikov 5fbc6f2adb Fix OSS Buck Kotlin build (#33166)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/33166

`pure_kotlin` kwarg doesn't exist in the OSS Buck definition, so we should remove it

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D34417682

fbshipit-source-id: 24a0d1adb15dc244d37be7ded12e244619cc803c
2022-02-23 08:23:14 -08:00
Lorenzo Sciandra df2e934a69 chore(deps): bump CLI version to 7.0.3 to address web debugging issue (#33156)
Summary:
Doing this patch level bump to ensure that all packages consuming `react-native` will get `7.0.3` and not lower 7.x versions.
This is because this new patch contains this fix:  https://github.com/react-native-community/cli/pull/1560
(thanks NickGerleman & thymikee for your work!)

We'll have to cherry-pick this into the 0.68 branch.

While at it, I've also done a cheeky `npx yarn-deduplicate` to clean up the `yarn.lock` a bit.

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[General] [Changed] - Bump RN CLI to v7.0.3 to address web debugging issue

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

Test Plan:
CI + some local testing via `test-manual-e2e`:
<img width="1779" alt="Screenshot 2022-02-21 at 11 40 54" src="https://user-images.githubusercontent.com/16104054/154948695-8c40bb56-87eb-4326-a740-49930994c08b.png">

Reviewed By: cortinico

Differential Revision: D34385503

Pulled By: motiz88

fbshipit-source-id: f0d8c4e0e92f83c0d819eeaa0fbec27820145968
2022-02-23 05:23:43 -08:00
Andrei Shikov 1953f6f02e Exclude raw props from view shadow nodes
Summary:
With the `MapBuffer`-based props calculated from C++ props, there's no need to keep `rawProps` around for Android views.

This change makes sure that the `rawProps` field is only initialized under the feature flag that is responsible for enabling `MapBuffer` for prop diffing, potentially decreasing memory footprint and speeding up node initialization as JS props don't have to be converted to `folly::dynamic` anymore.

For layout animations, props rely on C++ values, so there's no need to update `rawProps` values either.

Changelog: [Internal][Android] - Do not init `rawProps` when mapbuffer serialization is used for ViewProps.

Reviewed By: mdvacca

Differential Revision: D33793044

fbshipit-source-id: 35873b10d3ca8b152b25344ef2c27aff9641846f
2022-02-22 17:23:05 -08:00
Héctor Ramos 5928105d9d Bundle Hermes source code in react-native npm package
Summary:
If `--include-hermes` flag is set, the Hermes source code will be downloaded and included in the `react-native` npm package as part of the release.

Hermes will be available at `node_modules/react-native/third-party-podspecs/hermes`.

# Changelog

[Internal] Update build scripts to provide option to bundle Hermes source code

Reviewed By: cortinico

Differential Revision: D34255926

fbshipit-source-id: 76c1e9811a05a4a827ceba13e572d0ea756ac724
2022-02-22 12:23:49 -08:00
Andrei Shikov cbcdaae2b5 Use mapbuffer for ReactViewGroup
Summary:
Provides an alternative way of diffing props on Android side. Instead of passing dynamic JSON values from JS, the new approach diff C++ props and serializes difference into a `MapBuffer`. Current implementation does this only for `RCTView` component to test performance, correctness and memory impact (as MapBuffers are supposed to be more compact and performant).

This way of passing props allows for additional alignment between platforms, as C++ props are now source of truth for the view state, similar to iOS. At the same time, changing serialization method requires reimplementing `ViewManager` codegen (done manually for now) to account for `MapBuffer`s.

Changelog: [Added][Android] - Added an experimental prop serialization path based on MapBuffer

Reviewed By: mdvacca

Differential Revision: D33735245

fbshipit-source-id: 1515b5fe92f6557ae55abe215ce48277c83974a6
2022-02-22 12:23:49 -08:00
Andrei Shikov b1a779392d Enable Kotlin build in OSS (#33160)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/33160

Enables Kotlin build in RNAndroid, while adjusting the package structure to help with path/package inconsistency.

Moves `react/uimanager/interfaces` files into `react/uimanager` to make sure package name matches with file location and updates Buck configuration to still include it as a separate target.

Changelog: [Android][Changed] - Moved `com/react/facebook/uimanager/interfaces` files into `com/react/facebook/uimanager` to enable Kotlin build

Reviewed By: cortinico

Differential Revision: D34381179

fbshipit-source-id: 252588d9c7f62b8019bdfcce66197628d63e63a1
2022-02-22 10:22:52 -08:00
Andrei Shikov 733f228506 Diff C++ props for Android consumption
Summary:
Creates a mapbuffer from two ViewProp objects. This MapBuffer is used later instead of bag of props from JS to set the properties with platform ViewManager.

Changelog: [Internal] - Added MapBuffer diffing for ViewProps

Reviewed By: mdvacca

Differential Revision: D33735246

fbshipit-source-id: 10ad46251ea71aa844586624c888f5223fa44e57
2022-02-22 08:23:40 -08:00
Andrei Shikov da72b5d02c Add accessibility and view props required for Android to C++ layer
Summary:
Parses a set of props previously missing from C++ representation (they weren't required for iOS and core processing before).

Changelog: [Internal] - Added missing fields for Android to C++ view props

Reviewed By: sammy-SC

Differential Revision: D33797489

fbshipit-source-id: 1625baa0c1a592fcef409a5f206496dff0368912
2022-02-22 08:23:40 -08:00
Andrei Shikov d264f1e725 Changelog for 0.67.3 (#33162)
Summary:
Changelog for 0.67.3

## Changelog

[Changed] - Added changelog for 0.67.3

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

Test Plan: N/A

Reviewed By: cortinico

Differential Revision: D34389569

Pulled By: ShikaSD

fbshipit-source-id: 3b37c5ccb64357efd2021692976c3beed9a08933
2022-02-22 08:23:40 -08:00
Samuel Susla b8662f8f8a Remove mobile config remove_outstanding_surfaces_on_destruction_android
Summary:
changelog: [internal]

fewer flags = fewer problems.

Reviewed By: javache

Differential Revision: D34380114

fbshipit-source-id: c7213bd31e253fabeefc2514c7b51611d7c47e4e
2022-02-22 07:23:16 -08:00
Pieter De Baets d31c0c9109 Avoid string copy in RawPropsKey comparison
Summary:
Small performance improvement since we don't need to copy the char * into a string just for the sake of comparison.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D34351387

fbshipit-source-id: 10163164f6e95ab0737e8f865c37d8f0c3500662
2022-02-22 03:23:12 -08:00
Ian Childs bb8ddd6c12 Use realpath instead of readlink
Summary:
Changelog: [Internal]

Generated with:

```
python3 codemod.py -d xplat/js --extensions=sh 'THIS_DIR=\$\(cd -P "\$\(dirname "\$\(readlink "\${BASH_SOURCE\[0\]}"' 'THIS_DIR=$(cd -P "$(dirname "$(realpath "${BASH_SOURCE[0]}"'```

Reviewed By: motiz88

Differential Revision: D34379955

fbshipit-source-id: c60521cd6508b203f48ca8c890c450319991c2d4
2022-02-22 02:23:02 -08:00
Andrei Shikov 6b5c3db9c2 Execute animated operations that were peeked and not polled
Summary:
Changes `peek`->`poll` on Animated node queues to a single `poll`, accounting for race conditions. In case the queue batch is split at some point, previously polled operation is kept as a "carry-over" inside the queue abstraction.

Changelog: [Internal]

Reviewed By: JoshuaGross

Differential Revision: D34377737

fbshipit-source-id: 78e5ca60c4777576fbf009c3d3ffa53629221910
2022-02-21 20:23:01 -08:00
Riccardo Cipolleschi 4ec2d6cf0b Update RNTester documentation for Mac M1
Summary:
This Diff updates the RNTester README to support Mac M1 laptops.

## Changelog
[General][Changed] - Updated `rn-tester/README.md` to include instructions for Mac M1 users

Reviewed By: cortinico

Differential Revision: D34376951

fbshipit-source-id: 7195bddefb6e202261fef9b5f5225484c506fd9b
2022-02-21 09:22:52 -08:00
Gabriel Donadel Dall'Agnol 200488e87c build: Bump AGP to 7.1.1 and fix bundle inclusion in release mode (#33057)
Summary:
Upgrade Android Gradle to 7.1.0 on template and fix a bug where the bundle was not getting included when building the app in release mode

Closes https://github.com/facebook/react-native/issues/33002
Closes https://github.com/facebook/react-native/issues/33018
Closes https://github.com/facebook/react-native/issues/33046
Potentially fixes https://github.com/facebook/react-native/issues/33029

## Changelog

[Android] [Changed] - Bump AGP to 7.1.0 and fix bundle inclusion in release mode

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

Test Plan:
1. Run `./scripts/test-manual-e2e.sh`
2. Select `A new RN app using the template` and `Android`
3. Test app on the emulator
4. Open Android studio build the app using release variant
4. Check the release apk using Android studio "Analyze APK" tool and ensure the bundle is included

![image](https://user-images.githubusercontent.com/11707729/152700410-3bcb80b0-35b6-4bdc-bf57-98a42a29e5a6.png)

Reviewed By: ShikaSD

Differential Revision: D34076884

Pulled By: cortinico

fbshipit-source-id: da4392af37e08e22dbcafba38476fd712141474a
2022-02-21 06:23:31 -08:00
Riccardo Cipolleschi 235f168574 Move the `SegmentedComponentIOS` away from React Native Core (#33140)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/33140

Pull Request resolved: https://github.com/facebook/metro/pull/776

This Diff moves the `SegmentedComponentIOS` away from the core of React Native to move forward with the Lean Core effort

## Changelog
[General][Removed] - This diff removes the `SegmentedControlIOS` export from React Native. Internally, we are requiring `SegmentedControlIOS` directly now and externally people will have to use the community maintained module (https://github.com/react-native-segmented-control).

Reviewed By: cortinico

Differential Revision: D34304255

fbshipit-source-id: d4e2b0bda56708769603be6f164e6bf89997fd93
2022-02-21 05:23:16 -08:00
Riccardo Cipolleschi 802b3f778b Remove `find-node.sh` script (#33146)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/33146

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

It removes the find node script that introduced complexity in the system.

## Changelog
[Internal][Removed] - Removed the old `find-node.sh` script which was only adding complexity without doing nothing really useful.

Reviewed By: cortinico

Differential Revision: D34352049

fbshipit-source-id: 9ba4275c3863a1ae4bc2b4e2f1694a7ac994cdc8
2022-02-21 03:23:40 -08:00
Andrei Shikov d7f748a944 Drain animation operation queue before execution
Summary:
The concurrent queue seems to leak values on some Android 12 devices when interleaving instruction polling and execution. To help with that, we can drain the queue before executing operations, reducing the window when `add` and `poll` happen concurrently.

Changelog: [Internal] - Drain the Animated queue before execution

Reviewed By: JoshuaGross

Differential Revision: D34370056

fbshipit-source-id: 781631dbf1a10e3f1ba9564db985403bd77a2c06
2022-02-20 14:23:31 -08:00
Joshua Gross 7a3e6ae48f Add logging to detect inconsistencies with peeked/polled animation operations
Summary:
Just trying something out.

Changelog: [Internal]

Reviewed By: ShikaSD

Differential Revision: D34369919

fbshipit-source-id: 236f886fcc000a444bad494fd738688425159f21
2022-02-20 12:23:41 -08:00
David Vacca 05b4570d3f Refactor LayoutAnimation to use ReactNativeFeatureFlags
Summary:
This diff refactors LayoutAnimation to use ReactNativeFeatureFlags.ENABLE_LAYOUT_ANIMATION to enable / disable this feature

changelog: [internal] internal

Reviewed By: JoshuaGross

Differential Revision: D34349648

fbshipit-source-id: 90d1db6560867e44eeffbf03e5a84edadcdd55f9
2022-02-18 18:23:00 -08:00
David Vacca 33aba77456 Introduce ReactNativeFeatureFlags file to control FeatureFlags in React Native
Summary:
introduce ReactNativeFeatureFlags file to control FeatureFlags in React Native

changelog: [JS][Added] Create new API to configure FeatureFlags in ReactNative

Reviewed By: JoshuaGross

Differential Revision: D34349458

fbshipit-source-id: 73bb3704fc47e950ee1fcefcfaec1a85dfbcef59
2022-02-18 18:23:00 -08:00
Nicola Corti 42272211e4 Release react-native-gradle-plugin 0.0.5
Summary:
Time to release a new version of the Gradle plugin and bump it to 0.0.5
This version includes a deprecation of `reactRoot` and a warning message
to migrate to `root`/`reactNativeDir`.

Changelog:
[Android] [Changed] - Release react-native-gradle-plugin 0.0.5

Reviewed By: ShikaSD

Differential Revision: D34339272

fbshipit-source-id: c03495bda7c4185d674761e58a94fde8612f2941
2022-02-18 14:23:24 -08:00
Pieter De Baets fc35a65a7e moveToResumedLifecycleState must be called from UI thread
Summary:
I was seeing a SoftException in our apps due to this method being called as part of ReactInstanceManager's init. It seems inconsistent that we would call this from a background thread when all other `onHost*` methods are marked as confined to the UI thread.

Changelog: [Internal]

Reviewed By: ryancat

Differential Revision: D34340210

fbshipit-source-id: 0104eda66b2ca6bb315e64e806e9a30409d0d45c
2022-02-18 11:23:42 -08:00
Samuel Susla bb7214b9c4 Allow tests to be executed in platform agnostic environment
Summary:
changelog: [internal]

Make ManagedObjectWrapper compile in platform independent environment.

Reviewed By: ryancat

Differential Revision: D34302957

fbshipit-source-id: 50bf296983525c48cda1e532934b9998077c9fbf
2022-02-18 09:23:27 -08:00
Andrei Shikov e912c462eb Add a feature flag to disable Fabric layout animations
Summary:
tsia

Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D34340023

fbshipit-source-id: 61956f1819f1f7e10dc2520c444fa5dd305d1363
2022-02-18 08:21:06 -08:00
Samuel Susla 5e88223d85 Add support for nested components in legacy interop
Summary: changelog: [internal]

Reviewed By: ShikaSD

Differential Revision: D34173837

fbshipit-source-id: 09fbf12e9d8eb13a170ff92afff97f203d0ef805
2022-02-18 07:11:44 -08:00
Nicola Corti 8bc324fd34 Gradle: Deprecate `reactRoot` in favor of `root` and `reactNativeDir` (#33142)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/33142

The `reactRoot` property was confusing as we were using it for both the root of the project
and the react-native NPM Package root. I'm deprecating it and splitting it in two.

I've added several warning in the codebase to tell the people how to migrate away from it.
Moreover this is specifying default values that are more user-friendly. Users won't have to
configure anything unless they are in a monorepo.

Changelog:
[Android] [Changed] - Gradle: Deprecate `reactRoot` in favor of `root` and `reactNativeDir`

Reviewed By: ShikaSD

Differential Revision: D34277050

fbshipit-source-id: fc7f45017452b086726516a9586cacd9a661c287
2022-02-18 04:32:40 -08:00
Amy Lee 16feabf676 Address some RN build warnings
Summary:
Addresses build warnings for some additional compiler flags.

Changelog: [Internal]

Reviewed By: nlutsenko

Differential Revision: D34299822

fbshipit-source-id: d3d873fb600990a869cb0e6fbe9fff4ebc8c5d0e
2022-02-17 19:18:11 -08:00
Alfonso Curbelo c1db41f060 Fixed - Text with adjustsFontSizeToFit changes the text layout infinitely (#33135)
Summary:
Fixes the infinite loop explained in the issue https://github.com/facebook/react-native/issues/33129 by reverting commit  59021521e7. PR https://github.com/facebook/react-native/pull/31538.

`onCollectExtraUpdates` is part of the node update cycle. By marking the node as updated `markUpdated()` in `onCollectExtraUpdates` we are restarting the update infinitely.

Unfortunately, reverting this PR also reintroduces the original issue https://github.com/facebook/react-native/issues/30717 which IMO is minor compared to the infinite loop.

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[Android] [Fixed] - Text with adjustsFontSizeToFit changes the text layout infinitely

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

Test Plan:
I added a console.log to the Text `onTextLayout` in [packages/rn-tester/js/examples/Text/TextAdjustsDynamicLayoutExample.js ](https://github.com/facebook/react-native/blob/main/packages/rn-tester/js/examples/Text/TextAdjustsDynamicLayoutExample.js) to see if the infinite loop is gone.

![image](https://user-images.githubusercontent.com/3791120/154523914-e6aa7cf5-7a1c-488f-a392-898f4c85a833.png)

![Screen Shot 2022-02-17 at 11 20 31 AM](https://user-images.githubusercontent.com/3791120/154524274-880c3bed-d2c6-456b-8947-42e75793c424.jpg)

```

Reviewed By: ShikaSD

Differential Revision: D34310218

Pulled By: lunaleaps

fbshipit-source-id: 0d40f49d15c562ec25983145897bd95dc182f897
2022-02-17 13:46:23 -08:00
Moti Zilberman c56754ae39 Add default Instance type and variance to AnimatedComponentType
Summary:
Updates `AnimatedComponentType`'s type arguments to match [`React.AbstractComponent`](https://flow.org/en/docs/react/types/#toc-react-abstractcomponent)'s more closely in [variance](https://flow.org/en/docs/types/generics/#toc-variance-sigils) and defaults (`Instance = mixed`).

Changelog: [Internal]

Reviewed By: genkikondo

Differential Revision: D34254030

fbshipit-source-id: 622d1e4ecbc493bba8ec857454dd28583b677d78
2022-02-17 13:10:58 -08:00
Andrei Shikov aca9037813 React Native sync for revisions a3bde79...27b5699
Summary:
This sync includes the following changes:
- **[27b569969](https://github.com/facebook/react/commit/27b569969 )**: Simplify cache pool contexts ([#23280](https://github.com/facebook/react/pull/23280)) //<Andrew Clark>//
- **[1fb0d0687](https://github.com/facebook/react/commit/1fb0d0687 )**: [Devtools][Transition Tracing] Add Transition callbacks to createRoot ([#23276](https://github.com/facebook/react/pull/23276)) //<Luna Ruan>//
- **[a6987bee7](https://github.com/facebook/react/commit/a6987bee7 )**: add <TracingMarker> component boilerplate ([#23275](https://github.com/facebook/react/pull/23275)) //<Luna Ruan>//
- **[796fff548](https://github.com/facebook/react/commit/796fff548 )**: Allow suspending outside a Suspense boundary ([#23267](https://github.com/facebook/react/pull/23267)) //<Andrew Clark>//
- **[64223fed8](https://github.com/facebook/react/commit/64223fed8 )**: Fix: Multiple hydration errors in same render ([#23273](https://github.com/facebook/react/pull/23273)) //<Andrew Clark>//
- **[efd8f6442](https://github.com/facebook/react/commit/efd8f6442 )**: Resolve default onRecoverableError at root init ([#23264](https://github.com/facebook/react/pull/23264)) //<Andrew Clark>//
- **[e0af1aabe](https://github.com/facebook/react/commit/e0af1aabe )**: Fix wrong context argument to `apply` //<Andrew Clark>//
- **[9b5e0517b](https://github.com/facebook/react/commit/9b5e0517b )**: Remove deprecated wildcard folder mapping ([#23256](https://github.com/facebook/react/pull/23256)) //<Andrew Clark>//
- **[274b9fb16](https://github.com/facebook/react/commit/274b9fb16 )**: Remove path resolution from internal forks plugin ([#23255](https://github.com/facebook/react/pull/23255)) //<Andrew Clark>//

Changelog:
[General][Changed] - React Native sync for revisions a3bde79...27b5699

jest_e2e[run_all_tests]

Reviewed By: rickhanlonii, kacieb

Differential Revision: D34241986

fbshipit-source-id: f6ab62df2a918728864283b4f13201275eb3b8a3
2022-02-17 12:56:13 -08:00
Nicola Corti e695bc0bb5 Set a resolution strategy for com.facebook.react:react-native when on New Architecture. (#33134)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/33134

When a user is enabling New Architecture, we should make sure they don't accidentally mix
imports of React Native from source vs prebuilts.

With this resolution strategy, we'll make sure all the import of `com.facebook.react:react-native:+`
will be resolved to the correct dependency.

Changelog:
[Android] [Fixed] - Set a resolution strategy for com.facebook.react:react-native when on New Architecture

Reviewed By: ShikaSD

Differential Revision: D34303267

fbshipit-source-id: 492fec59175c5887571e1b09ca8e233584b45dd1
2022-02-17 12:31:30 -08:00
Yann Pringault 2db1bca952 Remove prettier from dependencies (#33125)
Summary:
`prettier` should not be declared in dependencies in the ESLint config because it can trigger issues when a different version is installed on the client app.

`prettier` is already declared as `peerDependencies` and in the [README](https://github.com/facebook/react-native/blob/main/packages/eslint-config-react-native-community/README.md), it's explicitly asked to install it:

```
yarn add --dev eslint prettier react-native-community/eslint-config
```

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[General] [Fixed] - Remove prettier from dependencies in eslint-config

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

Test Plan: - Install the package `react-native-community/eslint-config` and ensure everything works the same as before

Reviewed By: yungsters

Differential Revision: D34305118

Pulled By: ShikaSD

fbshipit-source-id: 65a3a79008cd5e28cc6aa93ef4a5032990b4e9f8
2022-02-17 09:18:55 -08:00
Moti Zilberman 35800962c1 Deprecate nonstandard Promise.prototype.done
Summary:
Deprecates the nonstandard `Promise.prototype.done` method. This also removes one call site within React Native itself that relied on this method.

As part of this we are also removing React Native's custom Flow definition for `Promise` in favour of the standard one built into Flow. This will flag uses of `done` as type errors for anyone using the default app template's `.flowconfig`.

In a future release of React Native, we will remove the `done` method from the built-in `Promise` polyfill.

Changelog:
[General][Deprecated] - Deprecate the Promise.prototype.done method and log a warning when it's called in development.

Reviewed By: yungsters

Differential Revision: D34222667

fbshipit-source-id: 4b9708ac20c45b3966fdb93e883ab7f8d80017c1
2022-02-17 09:15:03 -08:00
Nicola Corti 062c1f7277 Unblock CI by disabling integration testing for `test_ios_unit_hermes` (#33128)
Summary:
I'm disabling the integration test step for `test_ios_unit_hermes` as they're currently failign wiht a
`SIGSEGV` introduced by 9010bfe457

The change is legit, but is introducing an ABI incompatibility that is making the app crash at runtime.
We can re-enable them as soon as Hermes 0.12.0 is released.

## Changelog

[Internal] - Unblock CI by disabling integration testing for `test_ios_unit_hermes`

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

Test Plan: Will wait for a Circle CI green before merging

Reviewed By: neildhar

Differential Revision: D34285751

Pulled By: cortinico

fbshipit-source-id: 40f8e3d1b41fc4d5f0459003dcd19d651aefbeb7
2022-02-16 15:18:56 -08:00
fabriziobertoglio1987 b2e625a517 Switch component does not disable click (#33070)
Summary:
This issue fixes https://github.com/facebook/react-native/issues/30944 fixes https://github.com/facebook/react-native/issues/30840 ([Test Case 7.1][7.1], [Test Case 7.3][7.3], [Test Case 7.5][7.5]) which affects Platform Android. Previous PR https://github.com/facebook/react-native/pull/31199.
The issue is caused by the missing prop `accessibilityState` in the Switch component.

The solution consists of passing the accessibilityState to the `AndroidSwitchNativeComponent` component as previously implemented in other components (for example, [Button][8]).

Relevant discussions https://github.com/facebook/react-native/issues/30840#issuecomment-780981316 and https://github.com/facebook/react-native/pull/31001/files#r578827409.

[8]: https://github.com/facebook/react-native/pull/31001/files#diff-4f225d043edf4cf5b8288285b6a957e2187fc0242f240bde396e41c4c25e4124R281-R289

The solution proposed in this pull request consists of:
1. Passing `accessibilityState` to the `AndroidSwitchNativeComponent`
2. If the value of prop `accessibilityState.disabled` is different from the prop `disabled`, the prop `disabled` over-rides the `accessibilityState.disabled` value.

For example:
```jsx
<Switch disabled={true} accessibilityState={{disabled: false}} />
````
becomes:
````jsx
<Switch disabled={true} accessibilityState={{disabled: true}} />
````

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->

[General] [Fixed] - Switch Component doesn't disable click functionality when disabled

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

Test Plan:
[1]. Switch has `disabled` and `accessibilityState={{disabled: false}}`
[2]. Switch has `disabled`
[3]. Switch has `accessibilityState={{disabled: true}}`
[4]. Switch has `accessibilityState={{disabled:false}}`
[5]. Switch has `disabled={false}`  and `accessibilityState={{disabled:true}}`
7. Test Cases on the main branch
[7.1]. Switch has `disabled` and `accessibilityState={{disabled: false}}`
[7.3] Switch has `accessibilityState={{disabled: true}}`
[7.5] Switch has `disabled={false}`  and `accessibilityState={{disabled:true}}`

[1]: https://github.com/fabriziobertoglio1987/react-native-notes/issues/5#issuecomment-1031168488
[2]: https://github.com/fabriziobertoglio1987/react-native-notes/issues/5#issuecomment-1031168868
[3]: https://github.com/fabriziobertoglio1987/react-native-notes/issues/5#issuecomment-1031169167
[4]: https://github.com/fabriziobertoglio1987/react-native-notes/issues/5#issuecomment-1031170883
[5]: https://github.com/fabriziobertoglio1987/react-native-notes/issues/5#issuecomment-1031170989
[7.1]: https://github.com/fabriziobertoglio1987/react-native-notes/issues/5#issuecomment-1031171560
[7.3]: https://github.com/fabriziobertoglio1987/react-native-notes/issues/5#issuecomment-1031172605
[7.5]: https://github.com/fabriziobertoglio1987/react-native-notes/issues/5#issuecomment-1031173437

Reviewed By: kacieb

Differential Revision: D34189484

Pulled By: blavalla

fbshipit-source-id: 8ea9221a5641d05c20d0309abdb3f0d02c569f2f
2022-02-16 15:02:59 -08:00
Paige Sun af793dd14d Don't error to Logview APIs not supported by new architecture that are expected to happen often
Summary:
Changelog: [Internal]

In the new architecture, when an interop component is being called, log instead of warn/error, since at the moment we expect this to happen often.

Reviewed By: fkgozali

Differential Revision: D34252666

fbshipit-source-id: 971156a1cd9ef9b788f677c49fa2c55bd86ad4fa
2022-02-16 14:18:08 -08:00
Nicola Corti f11dcfaea1 Allow to setup a Gradle Enterprise instance via an external script
Summary:
This diff allows to setup a Gradle Enterprise instance
either locally or on CI via an external Gradle script.

I've create a `.sample` script that users can copy to
start setting up their GE instance, should they have one.

Moreover, it applies the `com.gradle.enterprise` Gradle
plugin by default. This has the positive side effect of
not invalidating build cache for the included build if
you happen to pass the `--scan` flag in OSS (as the
classpath isn't changed).

Changelog:
[Android] [Added] - Allow to setup a Gradle Enterprise instance via an external script

Reviewed By: mdvacca

Differential Revision: D33582388

fbshipit-source-id: 0c2f073cf7a8e39963b0adfc3b339b14c1e7759b
2022-02-16 06:37:56 -08:00
maaxg 7e8cce3d2d @react-native-community/viewpager is no longer supported (#33095)
Summary:
This pull request makes a simple change in the link of the lib [react-native-community/viewpager](https://www.npmjs.com/package/react-native-community/viewpager) that is no longer supported, the recommendation it's to use [react-native-pager-view](https://github.com/callstack/react-native-pager-view) instead.

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://github.com/facebook/react-native/wiki/Changelog
-->
[Android] [Changed] - ViewPagerAndroid recommendation link.

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

Reviewed By: cortinico

Differential Revision: D34216746

Pulled By: ShikaSD

fbshipit-source-id: c813d11557d0abc08ef4350538e2f211417f025b
2022-02-16 04:44:55 -08:00