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

22989 Коммитов

Автор SHA1 Сообщение Дата
Saad Najmi fcead14b0e Fix Deadlock in RCTi18nUtil (iOS) (#31032)
Summary:
Note: PR to react-native-macos here https://github.com/microsoft/react-native-macos/pull/733

Internally in Microsoft code, we ran into a deadlock where the main queue and the UIManager queue were both trying to access `[RCTI18nUtil sharedInstance]`, and were blocked on each other. This is similar to an earlier issue with RCTScreenScale decsribed [here](https://github.com/facebook/react-native/issues/18096).

To summarize:
1- RCTShadowView (on the UIManager queue) and RCTView (on the main queue) both try to access `[RCTI18nUtil sharedInstance]`
2- The UIManager thread gets there first, and lazily initializes the sharedInstance. Meanwhile, the main thread is waiting on a lock possessed by the UIManager thread
3- As part of the initialization, we set an NSUserDefault, which seems to require the (blocked) main thread.
4- Deadlock.

For whatever reason, this only happens on debug. I did not figure out why, but I do know based on [this comment](https://github.com/facebook/react-native/issues/18096#issuecomment-368718081), that the UIManagerQueue should never block the main queue.

The fix is to not use NSUserDefaults, and simpy use atomic properties instead. We get the thread safety for free, and it also simplifies the code somewhat without changing the public API. The downside is values aren't persisted anymore, but I do not think that was necessary / intended.

## 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
-->

[iOS] [Fixed] - Fix deadlock on RCTi18nUtil

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

Test Plan:
Ran the RTLExample in RNTester, and ensured switching to RTL still worked, and that setting forceRTL would still work after reloading the bundle.

https://user-images.githubusercontent.com/6722175/108775429-aefdae80-7526-11eb-9a89-3114f7ddc2af.mov

Reviewed By: javache

Differential Revision: D29522152

Pulled By: RSNara

fbshipit-source-id: 160840f63a7b1d6721b0fd8294fb11990a4509fa
2021-08-06 02:44:50 -07:00
David Vacca 91437d65d5 Replace Paper -> old renderer
Summary:
Replace Paper -> old renderer

changelog: [internal] internal

Reviewed By: sammy-SC

Differential Revision: D30139941

fbshipit-source-id: 3bb1e81a3df018aa669f3dba1de445107d70116c
2021-08-05 18:35:52 -07:00
David Vacca cf717ffc19 Add TODOs to unify component names between JS - Android - iOS - C++
Summary:
EZ diff that adds a few TODOs to unify component names between JS - Android - iOS - C++
see task: T97384889

changelog: [internal] internal

Reviewed By: sammy-SC

Differential Revision: D30139942

fbshipit-source-id: 91f51d04e7e7ecba7f059f94a121be43d820647d
2021-08-05 18:35:52 -07:00
Ramanpreet Nara 55f504a0be Make So loading inside generated TMM delegates less confusing
Summary:
## Rationale
Inlining the maybeLoadSoLibrary private static method makes following the So load chain from TurboModuleManagerDelegate through ReactPackageTurboModuleManagerDelegate to each app's TurboModuleManagerDelegate much easier to understand.

Changelog: [Internal]

Reviewed By: sshic

Differential Revision: D30082675

fbshipit-source-id: ff467d6ac8c792317dd9bdcd91844d3b480cbb60
2021-08-05 17:38:49 -07:00
Andrei Shikov 3bc883c6c6 Warn when negative `numberOfLines` prop set on <Text/> component
Summary:
Updates previous variant that was crashing a surface to the non-crashing variant.
Now it prints error in console and modifies value to be 0.

Changelog: [General][Fixed] Clamp negative values for `numberOfLines` in <Text> component

Reviewed By: yungsters

Differential Revision: D30129658

fbshipit-source-id: fda47a262365573514d3e1e4bf8a26f6d30cdae0
2021-08-05 12:39:09 -07:00
Sunny Luo 72f7962d4a Update JSLoader.cpp (#29270)
Summary:
Since react-native-cli is deprecated, the correct command should be `npx react-native start`

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

Reviewed By: sammy-SC

Differential Revision: D30017028

Pulled By: sota000

fbshipit-source-id: cfcf9e1d150f51750a4e86133bd3167506ee7348
2021-08-05 10:39:55 -07:00
Moti Zilberman b30fe90a4c Remove package boundary exceptions in OSS Buck config
Summary: Changelog: [Internal]

Reviewed By: stepancheg

Differential Revision: D30102445

fbshipit-source-id: 571ab5dc41379e01d4482f64418f6383f660dbfa
2021-08-05 08:44:51 -07:00
Moti Zilberman 8d153729c5 Fix Buck package boundary violation involving RCTEventDispatcher.h (#31965)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/31965

Changelog: [Internal]

Reviewed By: GijsWeterings

Differential Revision: D30030580

fbshipit-source-id: 3b4140a831c7ad7282aae0ff79c54014dcd82615
2021-08-05 07:18:38 -07:00
Moti Zilberman b385484502 Fix OSS Buck parsing errors (#31957)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/31957

Changelog: [Internal]

Some fixes for the GitHub shims for FB-internal Buck macros. Should fix the Buck-related breakages in the `test_android` and `test_docker` CI jobs.

Also adds license headers to some recently-added files that didn't have them.

Reviewed By: mdvacca

Differential Revision: D30114177

fbshipit-source-id: 88a24fa7130bd98dd60568566bde51fcfc89df60
2021-08-05 02:23:28 -07:00
Luis Miguel Alvarado 7ce0f40f5c refactor!: drop deprecated `StatusBarIOS` (#31466)
Summary:
This component has been merged with `StatusBar` and deprecated since [Jun 24, 2019](a833778553)

## 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
-->

[JavaScript] [Removed] - refactor!: drop deprecated `StatusBarIOS`

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

Test Plan: Warning when user imports `StatusBarIOS`

Reviewed By: yungsters

Differential Revision: D30109324

Pulled By: lunaleaps

fbshipit-source-id: fa2d3aa2cf35206ed8a196e09f12af57d3b61ccc
2021-08-04 21:14:46 -07:00
Andrew Clark a169009095 React Native sync for revisions 419cc9c...19092ac
Summary:
This sync includes the following changes:
- **[19092ac8c](https://github.com/facebook/react/commit/19092ac8c )**: Re-add old Fabric Offscreen impl behind flag ([#22018](https://github.com/facebook/react/pull/22018)) //<Andrew Clark>//
- **[215db465a](https://github.com/facebook/react/commit/215db465a )**: [Fabric] Add `flex: 1` to Offscreen view container ([#22019](https://github.com/facebook/react/pull/22019)) //<Andrew Clark>//
- **[8a37b0ef3](https://github.com/facebook/react/commit/8a37b0ef3 )**: typos fixed ([#21955](https://github.com/facebook/react/pull/21955)) //<Sinan Sonmez (Chaush)>//
- **[e3049bb85](https://github.com/facebook/react/commit/e3049bb85 )**: DevTools scheduling profiler: Add React component measures ([#22013](https://github.com/facebook/react/pull/22013)) //<Brian Vaughn>//
- **[27bf6f9a8](https://github.com/facebook/react/commit/27bf6f9a8 )**: Scheduling profiler UX changes ([#21990](https://github.com/facebook/react/pull/21990)) //<Brian Vaughn>//
- **[f0d354efc](https://github.com/facebook/react/commit/f0d354efc )**: [Fabric] Fix reparenting bug in legacy Suspense mount ([#21995](https://github.com/facebook/react/pull/21995)) //<Andrew Clark>//
- **[34308b5ad](https://github.com/facebook/react/commit/34308b5ad )**: Tidy up early bailout logic at start of begin phase ([#21852](https://github.com/facebook/react/pull/21852)) //<Andrew Clark>//
- **[321087d13](https://github.com/facebook/react/commit/321087d13 )**: [Fizz] Don't add aborted segments to the completedSegments list ([#21976](https://github.com/facebook/react/pull/21976)) //<Sebastian Markbåge>//
- **[4cc8ec64c](https://github.com/facebook/react/commit/4cc8ec64c )**: Separate unit tests for ReactFabricHostComponent ([#21969](https://github.com/facebook/react/pull/21969)) //<Timothy Yung>//
- **[d4d786493](https://github.com/facebook/react/commit/d4d786493 )**: Fix `ReactFabricHostComponent` methods if detached ([#21967](https://github.com/facebook/react/pull/21967)) //<Timothy Yung>//
- **[392253a77](https://github.com/facebook/react/commit/392253a77 )**: [Fabric] Use container node to toggle the visibility of Offscreen and Suspense trees ([#21960](https://github.com/facebook/react/pull/21960)) //<Andrew Clark>//

Changelog:
[General][Changed] - React Native sync for revisions 419cc9c...19092ac

jest_e2e[run_all_tests]

Reviewed By: JoshuaGross

Differential Revision: D30092460

fbshipit-source-id: 9f118db2419a9a5db26a9b873868f91ab88f2f89
2021-08-04 13:47:11 -07:00
Moti Zilberman 260c5a393f Move RCTTestApple into packages/rn-tester
Summary: Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D30056021

fbshipit-source-id: 9012ca6934f95946ff157ca472aa6a6e84d7d7e9
2021-08-04 13:03:21 -07:00
Moti Zilberman 30d37cfd39 Move RNTester unit/integration test Buck targets to GitHub
Summary: Changelog: [Internal]

Reviewed By: GijsWeterings

Differential Revision: D30032476

fbshipit-source-id: d1f9a39a6d2fc92f69b9ee931c2a0f3ba37687f6
2021-08-04 13:03:21 -07:00
Moti Zilberman 1ed1ac7caf Move integration test Buck targets to GitHub
Summary: Changelog: [Internal]

Reviewed By: GijsWeterings

Differential Revision: D30032467

fbshipit-source-id: 56e293c821f02e78fe13f5e7f22bcb2b2050019a
2021-08-04 13:03:21 -07:00
Moti Zilberman b26ae3e0c9 Move RCT* Buck targets to GitHub
Summary: Changelog: [Internal]

Reviewed By: GijsWeterings

Differential Revision: D30030454

fbshipit-source-id: 02a4c36f5c5ca519e4de3d1a3d79708d0d0b6d01
2021-08-04 13:03:21 -07:00
Jesse Katsumata 298fd10c96 chore: remove FlowFixMe (#29468)
Summary:
Removed FlowFixMe that has been fixed

## 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] - Removed FlowFixMe that has been fixed

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

Test Plan: flow check passes

Reviewed By: JoshuaGross

Differential Revision: D29967702

Pulled By: lunaleaps

fbshipit-source-id: 541279287ba6f21c5c7290bcba7c282f092126ff
2021-08-04 12:20:15 -07:00
David Vacca 81167e0e80 Add documentation for FabricUIManager.getInspectorDataForInstance
Summary:
Add documentation for FabricUIManager.getInspectorDataForInstance

changelog: [internal] internal

Reviewed By: sammy-SC

Differential Revision: D30095818

fbshipit-source-id: dfe8590598099e7581460ca45bc0e779690463a6
2021-08-04 11:39:17 -07:00
David Vacca 43a91d03eb Extend getInspectorDataForInstance to return props
Summary:
This diff extends the FabricUIManager.getInspectorDataForInstance to return the props of the React Native component associated to the view passed as a parameter.

changelog: [internal] internal

Reviewed By: sammy-SC

Differential Revision: D30095406

fbshipit-source-id: 50fdba6636a1f5042dbc113e341c3cb2534a1b04
2021-08-04 11:39:17 -07:00
David Vacca f1b49f7df8 Fix NPE when hierarchy return null values
Summary:
This diff fixes a NullPointer that was being thorwn when hierarchy values are null

changelog: [internal] internal

Reviewed By: sammy-SC

Differential Revision: D30095407

fbshipit-source-id: b0a13661b4506cf94eeb5d99923d4c12cba0f972
2021-08-04 11:39:17 -07:00
Andrei Shikov a8a85034e1 Check for negative `numberOfLines` in TextView
Summary:
Negative `numberOfLines` prop is not supported by Android and causes a crash during layout measurement. This change adds a check in JS to catch the error earlier.

Changelog: [Internal]

Reviewed By: GijsWeterings

Differential Revision: D30047103

fbshipit-source-id: 4248a0f573c3b6facd25c7ae6ce007a357a1469b
2021-08-04 05:13:57 -07:00
Moti Zilberman 8408d723ff Update Android Dockerfile to include root BUCK file (#31950)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/31950

Changelog: [Internal]

Adds the root BUCK file to the Docker image we use to test RNTester on CircleCI. See df9cd05621

Reviewed By: ShikaSD

Differential Revision: D30099261

fbshipit-source-id: 936c505a0f4e7b791743901a06fa3b14c40b183e
2021-08-04 04:35:45 -07:00
Moti Zilberman df9cd05621 Update OSS Buck definitions (#31948)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/31948

Changelog: [Internal]

Adds necessary shims to bring our BUCK files closer to parsing/building correctly in open source. This is part of fixing the Buck-based tests on CircleCI which were broken by d4ee734f32.

Reviewed By: sammy-SC

Differential Revision: D30072866

fbshipit-source-id: 4aebd9f67dd0a102516603915d9a021032611279
2021-08-04 03:13:19 -07:00
Moti Zilberman dc15c48434 fbshipit-source-id: 909b2667480ed96ae376896d966f6c27f5e73964 2021-08-04 01:27:28 -07:00
Paige Sun 363a8fb08c iOS: Log error when invalid NSNull data is passed to RCTAsyncLocalStorage
Summary: Changelog: [Internal]

Differential Revision: D30081478

fbshipit-source-id: 7d425e71b020eaeb4eb1b33b500fbf5df7ea9c29
2021-08-03 16:41:32 -07:00
Samuel Susla c39a4c7f2e Flush operations queue when animation starts
Summary:
changelog: [internal]

If nodesManager has the information if animated node is managed by Fabric, we can't decide if the operation queue should be flushed before it is flushed. Therefore, keep the information about animated nodes inside a set instead of nodesManager.

For simplicity, I will refer to class `RCTNativeAnimatedTurboModule` as *NativeAnimated* and to `RCTNativeAnimatedNodesManager` as *NodesManager*

Notice that each call to *NativeAnimated* is queued up in `_operations` or `_preOperations`. When the queues are flushed, only then methods are called on `RCTNativeAnimatedNodesManager`.

There are two mechanisms that flush operations.
One is triggered by `RCTMountingManager` before mounting operations are applied and after they are applied. This works fine but is important to paint the picture.

The second mechanism is inside `[RCTNativeAnimatedTurboModule startAnimatingNode]`. It flushes the queues for Fabric nodes only (not sure why Fabric nodes only, I couldn't find any explanation in old diffs). It checks with *NativeAnimated* if a node is managed by Fabric. Keep in mind, *NodesManager* only knows about the nodes when the queues have been flushed.

Exampe:
JavaScript calls methods on *NativeAnimated*.
For example:
1. `createNode`
2. `connectAnimatedNodeToView`
3. `startAnimatingNode`. (here, the queues should be flushed, since we are in Fabric)

All of these operations are queued up and for as long as `RCTMountingManager` executes mounting, all proceeds as expected.
But if those operations happen after mounting phase, `startAnimatingNode` will not flush the operations queues, because it can't tell if nodeTag is managed by fabric or it isn't. This is because *NodesManager* hasn't been notified about any new nodes.

Reviewed By: JoshuaGross, p-sun

Differential Revision: D30053890

fbshipit-source-id: b7fe24861d5300f9cfefa813a53df8330fa56d86
2021-08-03 11:32:43 -07:00
Pieter De Baets de255528e0 Allow resolving view from FabricUIManager
Summary: Changelog: [Internal]

Reviewed By: JoshuaGross

Differential Revision: D30043188

fbshipit-source-id: d8675754b29fb58a28a06777f602098da6dbc27f
2021-08-03 10:55:47 -07:00
Moti Zilberman 228b8e5529 Fix Buck package boundary violation in core components schema
Summary: Changelog: [Internal]

Reviewed By: GijsWeterings

Differential Revision: D29996246

fbshipit-source-id: e560c7261c4274da5219dc1e2d59d46b60e7549e
2021-08-03 05:42:03 -07:00
Moti Zilberman d4ee734f32 Merge BUCK file at Libraries/ into root
Summary:
Merges the Facebook-internal Buck target definitions in `Libraries/` into the BUCK file at the root of the repo (which is currently not synced to GitHub at all). This does not affect how React Native is built in open source.

Changelog: [Internal]

Reviewed By: GijsWeterings

Differential Revision: D27967499

fbshipit-source-id: 39c51a544b3868242598072d24cb6cfb5a6e2d8c
2021-08-03 05:42:03 -07:00
Samuel Susla 8a8a5323cf Fix order of calls for Native Animated Module
Summary:
Changelog: [internal]

Make sure the order of call is preserved for `NativeAnimatedModule`. The order of calls to NativeAnimatedModule needs to be preserved because its internals depend on it. For example, if you `getValue` is called before `createAnimatedNode`, it causes a crash.

To resolve it, we need to enqueue `getValue` onto operationQueue.

Reviewed By: JoshuaGross

Differential Revision: D30035911

fbshipit-source-id: bbd698a96cada5d2b1312a1a689ca99b04a07cdc
2021-08-03 04:04:06 -07:00
Test User 0b4f4eec8e chore: update Dimensions API Flow types (#31898)
Summary:
This small PR updates the Flow types used in Dimensions. The following changes has been made:
* generic types has been replaced with types from `NativeDeviceInfo` (which already were used in event subscription update)
* ~simplification of `DisplayMetricsAndroid` by spreading via intersection with `DisplayMetrics` type and removing shared properties~
  > I have tried both notations, but according to the lint, it looks like a Native Modules typing limitation which requires redundancy / code duplication in cases like this.

## 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
-->

[Internal] [Changed] - update Dimensions API Flow types

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

Test Plan: Running `yarn flow` in the workspace yields no errors.

Reviewed By: yungsters

Differential Revision: D29932940

Pulled By: GijsWeterings

fbshipit-source-id: bf97bb972964c585207e2450ccf71d932555e291
2021-08-03 03:15:42 -07:00
Moti Zilberman 4fcf468131 Co-locate Buck targets for JS polyfills with their sources
Summary: Changelog: [Internal]

Reviewed By: GijsWeterings

Differential Revision: D30032230

fbshipit-source-id: 0d714b4e0a79a9c5c1c21e79f782635d8bd9c5f1
2021-08-03 00:47:30 -07:00
Joshua Gross 402eec8de7 Protect against crashes when over-releasing a TouchEvent
Summary:
It seems that, possibly due to optimizations and refactoring elsewhere in the event system, some TouchEvents are being over-disposed.

This doesn't really pose a problem besides performance; and could even indicate that an Event was in a pool but never properly initialized. In these
cases it seems perfectly reasonable to silently continue, and to log a soft exception. This WILL still crash in debug mode, so we can gather more information
if we find a good repro; otherwise we will continue to get production data from this soft exception if it's an issue and we can investigate further.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D30061178

fbshipit-source-id: 05d1f60afc382ce0a202ac8f3de34770cf9a760d
2021-08-02 20:47:42 -07:00
Xuan Huang d9a9ae38d1 Conditionalize the Regenerator Setup
Summary:
Changelog: [Internal]

If generators are provided natively, that should suggest that the JS source
code did not go through the regenerator-transform (e.g. in Metro Hermes profile),
then there is no need to set up the regenerator runtime.

This should save some work during the Core initialization.

Reviewed By: motiz88

Differential Revision: D29986751

fbshipit-source-id: 129f5122e8e4c05535ee2aa5da6970a66843e8cd
2021-08-02 19:43:04 -07:00
Xuan Huang 06388891a3 Extract feature detection as an utilitiy module
Summary:
Changelog: [Internal]

This diff only extracted the `isNativeFunction` used in `setUpTimers`
into the `FeatureDetection` utility, but later we will add more functions
in it and reuse them in other places.

Reviewed By: RSNara

Differential Revision: D29986750

fbshipit-source-id: 6e48e38d92ceccb35eead3c52e00e1eecb81b5b0
2021-08-02 19:43:04 -07:00
Moti Zilberman 8efbb2e71e Move react-native Buck library to GitHub
Summary:
Moves the Facebook-internal Buck target definition for React Native closer to the actual JS source files. This does not affect how React Native is built in open source.

Changelog: [Internal]

Reviewed By: GijsWeterings

Differential Revision: D27942687

fbshipit-source-id: 328febb661ed6597feafdfd8efb2a95365325348
2021-08-02 16:01:07 -07:00
Moti Zilberman 4f2c6d02af Move RNTester Buck library to GitHub (#31435)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/31435

Moves the Facebook-internal Buck target definition for RNTester closer to the actual source files. This does not affect how RNTester is built in open source.

Changelog: [Internal]

Reviewed By: GijsWeterings

Differential Revision: D27942209

fbshipit-source-id: 66c970a5464a9329597d155ceeca78fb7f4834e8
2021-08-02 16:01:07 -07:00
David Vacca 809fd7eab2 Add TODO to fix and enable 'generated_tests-codegen_testsAndroid'
Summary:
Add TODO to fix and enable 'generated_tests-codegen_testsAndroid'

changelog: [internal] internal

Reviewed By: JoshuaGross

Differential Revision: D30046143

fbshipit-source-id: dbeba6f1d51b32c069bda8bb9ca976014d299dae
2021-08-02 15:36:33 -07:00
David Vacca f9ca578fb6 Remove 'using namespace facebook::jni'
Summary:
Ez diff to remove 'using namespace facebook::jni'

changelog: [internal] internal

Reviewed By: sshic

Differential Revision: D30046080

fbshipit-source-id: 52100970a408d772854cc0783fa13edd0cc39235
2021-08-02 15:36:33 -07:00
Vegas Murphy 0fa8253d56 setup fragment based tab bar navigation
Summary: `Changelog: [Android] [Changed] - Make ReactFragment variables protected instead of private, create getter for ReactDelegate`

Reviewed By: keoskate

Differential Revision: D29981436

fbshipit-source-id: 3e5df811cd07edccf37f72c9f917f9ea0882be0b
2021-08-02 15:23:06 -07:00
Ramanpreet Nara 034c6dfe34 Stop sharing LongLivedObjectCollection with the bridge
Summary:
This is the Android analogue to D30019833.

Changelog: [Internal]

Reviewed By: p-sun

Differential Revision: D30029295

fbshipit-source-id: 13df0dfb915697eeedcc527dcdb6c246e89afb0c
2021-08-02 11:22:22 -07:00
Ramanpreet Nara 32bfd7a857 Stop sharing LongLivedObjectCollection with the bridge
Summary:
## Context
Previously, when you'd call TurboModule methods with JavaScript callbacks, we'd [store the callbacks](https://www.internalfb.com/code/fbsource/[c503ff1b38621aebca87b2bbebeae088b01886c4]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModule.mm?lines=173%2C248-249) into [this global LongLivedObjectCollection collection](https://www.internalfb.com/code/fbsource/[c503ff1b38621aebca87b2bbebeae088b01886c4]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleUtils.h?lines=65). Then, when React Native's JavaScript VM got torn down, we'd [clear the global collection](https://www.internalfb.com/code/fbsource/[e26f476ce208c578f05b1edb7639d1dad5612c7d]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleBinding.cpp?lines=49), which would ensure that we deleted all held jsi::Functions, before deleting the jsi::Runtime.

## Problem
With bridgeless mode enabled, there can be two TurboModule systems. Further, it is possible to tear down bridgeless mode, or the bridge, without tearing down the other initialization infra. In this scenario, the jsi::Function for the other initialization infra would also get deleted, which could lead to mysterious problems.

## Fix
In this diff, I refactored the jsi::Function cleanup in the TurboModule system. Now, there are 3 modes:
- kGlobalScope: Everything works as it did before
- kRCTGlobalScopeUsingRetainJSCallback: We still use the global LongLivedObjectCollection, but we do it through invoking a block passed to every ObjCTurboModule by the TurboModuleManager. This group exists to assess the impact of having each TurboModule retain/use the block. I suspect this will be negligible, but it'd be good to have actual data to back this claim.
- kRCTTurboModuleManagerScope: Every TurboModule uses a LongLivedObjectCollection that is owned by its TurboModuleManager. This should effectively fix the problem I outlined above.

Changelog: [Internal]

Reviewed By: p-sun

Differential Revision: D30019833

fbshipit-source-id: da50d884c7e37190107f570d8ed70eeda7d9ae83
2021-08-02 11:22:22 -07:00
Ramanpreet Nara 1e4dd5e877 Clean up RAIICallbackManager experiment
Summary:
This experiment was shipped in D27436402 (3d1afbbda3).

Changelog: [Internal]

Reviewed By: JoshuaGross

Differential Revision: D30023039

fbshipit-source-id: 5f7335f2ddaf6f4e2d876a917aaff2cf3d906b5c
2021-08-02 11:22:22 -07:00
Samuel Susla 3ed3d34987 Correct error message in getViewState method
Summary:
Changelog: [internal]

Here, getting `viewState` has failed, not its view property.

Reviewed By: mdvacca

Differential Revision: D30042652

fbshipit-source-id: 42831b577f17db1f64860e68be33870f5be27207
2021-08-02 09:36:33 -07:00
fabriziobertoglio1987 cb0e1d603a Allows to set individual (left,top,right,bottom) dotted/dashed borders (#29099)
Summary:
This issue:

fixes https://github.com/facebook/react-native/issues/24224 fixes https://github.com/facebook/react-native/issues/28695 fixes https://github.com/facebook/react-native/issues/23651 fixes https://github.com/facebook/react-native/issues/23475  fixes https://github.com/facebook/react-native/issues/22256 fixes https://github.com/facebook/react-native/issues/22226 fixes https://github.com/facebook/react-native/issues/19234 fixes  https://github.com/facebook/react-native/issues/18285  fixes https://github.com/facebook/react-native/issues/17344 fixes https://github.com/facebook/react-native/issues/17343 fixes https://github.com/facebook/react-native/issues/17251 fixes https://github.com/facebook/react-native/issues/12817 fixes https://github.com/facebook/react-native/issues/12403 fixes https://github.com/facebook/react-native/issues/11042 fixes https://github.com/facebook/react-native/issues/9343 fixes https://github.com/facebook/react-native/issues/8236 fixes https://github.com/facebook/react-native/issues/8105 fixes https://github.com/facebook/react-native/issues/7838 fixes https://github.com/facebook/react-native/issues/6721 fixes https://github.com/facebook/react-native/issues/5411 fixes https://github.com/facebook/react-native/issues/3159 fixes https://github.com/facebook/react-native/issues/2335 fixes https://github.com/facebook/react-native/issues/840 fixes https://github.com/facebook/react-native/issues/27133 fixes https://github.com/facebook/react-native/issues/28695

Allows to set individual (left,top,right,bottom) dotted/dashed borders.

If a single border is specified and the borderStyle is dotted or dashed, each border will be drawn with moveTo and lineTo taking in consideration of the border style and thickness.

## 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] - Quickfix individual border style dotted or dashed rendering as solid

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

Test Plan:
**<details><summary>CLICK TO OPEN TESTS RESULTS</summary>**
<p>

| **AFTER** | **AFTER** |
|:-------------------------:|:-------------------------:|
| <img src="https://user-images.githubusercontent.com/24992535/84158300-05e05800-aa6c-11ea-96a3-40007b2ca611.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158309-07aa1b80-aa6c-11ea-973b-51e8e68b5808.png"  width="300" height="" /> |

| **AFTER** | **AFTER** |
|:-------------------------:|:-------------------------:|
| <img src="https://user-images.githubusercontent.com/24992535/84158320-0d9ffc80-aa6c-11ea-9d7f-dfba49fbfe41.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158334-11cc1a00-aa6c-11ea-8422-cd5b9384f391.png"  width="300" height="" /> |

| **AFTER** | **AFTER** |
|:-------------------------:|:-------------------------:|
| <img src="https://user-images.githubusercontent.com/24992535/84158556-4c35b700-aa6c-11ea-9a4d-eea791b3813a.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158574-51930180-aa6c-11ea-8e84-526cfb168f49.png"  width="300" height="" /> |

| **AFTER** | **AFTER** |
|:-------------------------:|:-------------------------:|
| <img src="https://user-images.githubusercontent.com/24992535/84158586-55268880-aa6c-11ea-9540-51d79a8e4cb0.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158601-5952a600-aa6c-11ea-82e7-85d54b858f1a.png"  width="300" height="" /> |

| **AFTER** | **AFTER** |
|:-------------------------:|:-------------------------:|
| <img src="https://user-images.githubusercontent.com/24992535/84158638-62dc0e00-aa6c-11ea-8765-ecba0d9d126f.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158652-67a0c200-aa6c-11ea-8336-e6eb8aa52e96.png"  width="300" height="" /> |

| **AFTER** | **AFTER** |
|:-------------------------:|:-------------------------:|
| <img src="https://user-images.githubusercontent.com/24992535/84158690-738c8400-aa6c-11ea-9cf1-edec72d27cb7.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158912-b6e6f280-aa6c-11ea-94a7-0ee0db685f38.png"  width="300" height="" /> |

</p>
</details>

Reviewed By: mdvacca

Differential Revision: D28688914

Pulled By: RSNara

fbshipit-source-id: 34781d63265dcf55e30f11c014e6b4a35d67dcbd
2021-08-02 04:06:07 -07:00
David Vacca cdce14f670 Implement PlatformColor in Fabric Android
Summary:
This diff implements PlatformColor in Fabric Android

changelog: [internal] internal

Reviewed By: JoshuaGross

Differential Revision: D29841461

fbshipit-source-id: 63a523626b021c634bc399e749b639b55730391a
2021-07-30 22:16:08 -07:00
jeswinsimon 8066bc9ff6 Updated TextInput autoCompleteType prop to autoComplete 1/2 (#26010)
Summary:
Fix for bug https://github.com/facebook/react-native/issues/26003 Rename TextInput prop "autoCompleteType" to "autoComplete".

## Changelog

[Android] [Changed] - Updated `autoCompleteType` prop of `TextInput` to `autoComplete`

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

Test Plan:
Test Pass

PR for [Doc Update](https://github.com/facebook/react-native-website/pull/1184)

Reviewed By: mdvacca

Differential Revision: D29980220

Pulled By: lunaleaps

fbshipit-source-id: 3c9e7d3250b5f95b0dbd523fdb0d917a039cd6a9
2021-07-30 03:16:35 -07:00
Jacob Parker feae814153 Remove unused import (#30544)
Summary:
Remove unused import

## 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
-->

[iOS] [performance] - Remove unused import

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

Test Plan: Should build on CI

Reviewed By: lunaleaps

Differential Revision: D30000901

Pulled By: charlesbdudley

fbshipit-source-id: 3d3310917823b7af57564ca1ea397cd32cd0c4d5
2021-07-29 17:26:02 -07:00
Evan Yeung 853e7a5b9d Make existential type an error in xplat
Summary:
This diff updates the xplat flowconfigs to make existential types an error.

Changelog: [Internal]

Reviewed By: pieterv

Differential Revision: D29967838

fbshipit-source-id: f08bbafe2a0269adb2c9afa4572b7a34fd254a4d
2021-07-29 17:26:01 -07:00
Michael Chow 1c87d4aee3 Update Dimension.js typo (#29858)
Summary:
preferred instead of preffered

## 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
-->

[CATEGORY] [TYPE] - Message

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

Reviewed By: charlesbdudley

Differential Revision: D29998754

Pulled By: sota000

fbshipit-source-id: f13fef58e9154ddf8087944d53e022fb9afa6b1b
2021-07-29 17:26:01 -07:00
CodemodService FBSourceClangFormatLinterBot ce44104b2b Daily `arc lint --take CLANGFORMAT`
Reviewed By: zertosh

Differential Revision: D29983521

fbshipit-source-id: bebd38e79180c544c8c1986605cc1af4b1f4df98
2021-07-29 04:23:09 -07:00