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

22626 Коммитов

Автор SHA1 Сообщение Дата
Ramanpreet Nara 8ba73a79f2 Attach RCTBundleManager to TurboModules (Bridge mode)
Summary:
See title.

Changelog: [Internal]

Reviewed By: PeteTheHeat

Differential Revision: D28160096

fbshipit-source-id: c14e5a5bc9f226f1e2559b3a256edcf5379d3c2e
2021-05-04 18:33:23 -07:00
Ramanpreet Nara 329f58ee46 Attach RCTBundleManager to NativeModules
Summary:
After this diff, every NativeModule that has `synthesize bundleManager = _bundleManager`, will get access to an RCTBundleManager, that it can use to read from/write to the bridge's bundle URL.

Changelog: [iOS][Added] - Attach RCTBundleManager to NativeModules

Reviewed By: PeteTheHeat

Differential Revision: D28086319

fbshipit-source-id: 6e4cd815d300e9036957ec8c743e947d2cb3f365
2021-05-04 18:33:23 -07:00
Ramanpreet Nara 4a1bafe591 Introduce RCTBundleManager
Summary:
NativeModules can read from, or write to, the bridge's bundleURL. To do so, they access the bundleURL property on the bridge directly.
**Setter:**
https://www.internalfb.com/code/fbsource/[2a74581dfff31febe6e91c5739294705f5244ecb]/xplat/js/react-native-github/React/CoreModules/RCTDevMenu.mm?lines=213-214

**Getter:**
https://www.internalfb.com/code/fbsource/[2a74581dfff31febe6e91c5739294705f5244ecb]/xplat/js/react-native-github/React/CoreModules/RCTDevMenu.mm?lines=245%2C256

In bridgeless mode, the bridge is nil. So, this form of access will fail.

After this stack lands, every NativeModule will be able to synthesize an RCTBundleManager, like so:
```
synthesize bundleManager = _bundleManager;
```

From then on, all NativeModules will use this bundleManager to access the bundle URL. This should ensure that NativeModules can read from/write to the bundleURL, **even in bridgeless mode**.

Changelog: [iOS][Added] - Introduce RCTBundleManager for bundleURL access

Reviewed By: PeteTheHeat

Differential Revision: D28086318

fbshipit-source-id: 34c15bf05c144341aa912fad9aa25d6d3a364f9e
2021-05-04 18:33:23 -07:00
sangeethaKP 7db89f90ee #31386 Fix Readme link to Testing (#31387)
Summary:
Fix Readme link to Testing section

Fix Readme link to Testing section

## 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] - Fixed link to Testing in React Native Android ReadMe file

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

Test Plan: Change has been made to a Readme documentation, no changes in code

Reviewed By: TheSavior

Differential Revision: D28192184

Pulled By: PeteTheHeat

fbshipit-source-id: 6d4503f68398accacead116b43981e03e4c1430a
2021-05-04 15:50:02 -07:00
fabriziobertoglio1987 333b46c4b0 Fix Image does not announce "disabled" (#31252)
Summary:
This issue fixes https://github.com/facebook/react-native/issues/30935 screenreader does not announce Image disabled accessibilityState.

As stated in AOSP View.java, the framework will handle routine focus movement, views indicate their willingness to take focus through the `isFocusable` method https://bit.ly/3dCnyHb

```
* <p>The framework will handle routine focus movement in response to user input. This includes
* changing the focus as views are removed or hidden, or as new views become available. Views
* indicate their willingness to take focus through the {link #isFocusable} method. To change
* whether a view can take focus, call {link #setFocusable(boolean)}.
```

The property is updated through its shadow node `ReactImageManager` method `setAccessible` https://bit.ly/3dDuK5L

```java
 * <p>Instances of this class receive property updates from JS via @{link UIManagerModule}.
 * Subclasses may use {link #updateShadowNode} to persist some of the updated fields in the node
 * instance that corresponds to a particular view type.
```

## 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] - adding setAccessible to ReactImageManager to allow screenreader announce Image accessibilityState of "disabled"

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

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

Enable audio to hear the screenreader

TEST SCENARIO
- The user moves the screenreader focus to an image and the screenreader reads the Image accessibilityLabel "plain network image"

RESULT
- The screenreader announces the accessibilityState disabled after reading the Image accessibilityLabel "plain network image"

```javascript
<Image
  accessible={true}
  accessibilityLabel="plain network image"
  accessibilityState={{disabled: true}}
  source={fullImage}
  style={styles.base}
/>
```

<video src="https://user-images.githubusercontent.com/24992535/112670432-2f366d00-8e61-11eb-843f-4b56f4a06a91.mp4" width="700" />

</p>
</details>

Reviewed By: kacieb

Differential Revision: D28194597

Pulled By: lunaleaps

fbshipit-source-id: 5f89ce5c714405506261885ac6fea2c15c2e1f23
2021-05-04 14:29:58 -07:00
Moti Zilberman e0aec42efd Allow single-line template literals without placeholders in test files
Summary:
Our ESLint configuration currently disallows template literals that can be expressed using plain string syntax (with single quotes). Jest's inline snapshots feature sometimes produces such template literals. This not only adds unnecessary friction from the linter, but can break subsequent snapshot updates in a test file (after accepting the ESLint autofix).

This conflict between Jest and ESLint is a known issue (https://github.com/facebook/jest/issues/10164) with no upstream fix. Here we relax the linter's settings to allow all template literals in test files. Ideally we could allow them *only* in inline snapshots, but this is a reasonable approximation.

Changelog: [Internal]

Reviewed By: MichaReiser

Differential Revision: D28120785

fbshipit-source-id: c6c6c0ab8a3b8aca14df06f430b777cef42cd554
2021-05-04 12:33:26 -07:00
Rubén Norte 8abe737068 Centralize public access to LogBox in LogBox module
Summary:
Some components are using `LogBoxData` directly, forcing logs to be shown on the screen even when LogBox is uninstalled. This changes all accesses to `LogBoxData` to go through `LogBox` so `uninstall` is used correctly.

It also changes when LogBox is installed, moving it from `AppContainer` to `InitializeCore` (which happens earlier) so we can capture more logs in LogBox.

Changelog: [General][Changed] Initialized LogBox earlier and centralized access in LogBox module

Reviewed By: rickhanlonii

Differential Revision: D27999361

fbshipit-source-id: 1115ef6b71e08cc33743d205da0064fbe9a74a0e
2021-05-04 10:58:24 -07:00
Kevin Gozali ab45509d75 iOS: adding a few warning/enforcement for the new architecture
Summary:
In the full bridgeless, the following aren't allowed:
* using legacy view manager interop layer (won't support long term, but still needed today, so just warn)
* initializing any subclass of RCTViewManager (won't support long term, but still used by legacy interop layer)
* initializing RCTUIManager (fabric UIManager should be the only one used)

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D28111530

fbshipit-source-id: 4f5eab600c6c7896d51861545b7f878c25248e44
2021-05-03 21:31:19 -07:00
Kacie Bawiec da899c0cc4 Add support for Toggle Button accessibilityRole
Summary:
Changelog:
[General][Added] Add support for "togglebutton" accessibilityRole

# Context
The role for ToggleButton, which is needed on Android to implement toggle buttons correctly, is not currently supported.

# What does this diff do?
Adds support for accessibilityRole `"togglebutton"`.

On Android, this maps to class `"Android.widget.ToggleButton"`.

iOS does not have an equivalent trait for togglebutton, so I set it to be the same as setting `accessibilityRole="button"` for iOS.

# Caveats - checked vs selected
It seems to me like this role currently requires that you set `accessibilityState={{checked: true/false}}`. The behavior is strange when setting `selected` state, I think because on Android ToggleButtons are meant to use `checked` to indicate toggled on/off.

This is tricky because typically on iOS if you have a toggle button, you would use `selected` instead of `checked`, so RN users are likely to mess this up.

Possible solutions:
1. document that you should use `checked` state on Android for toggle buttons (and maybe throw a warning if someone passes in `selected`).
2. have RN ignore it if someone passes in accessibilityState `selected`, if this role is used.
3. Have RN convert passed in `selected` state to `checked` on the Android side.

Reviewed By: nadiia

Differential Revision: D27976046

fbshipit-source-id: 4ce202449cf2371f4bf83c4db2d53120369ee7b0
2021-05-03 11:50:02 -07:00
Luna Wei ab66741c8c Cleanup for shipping use_switch_modern
Summary:
Changelog:
[General][Changed] - Refactor Switch component to functional and remove experimentation around it

Reviewed By: kacieb

Differential Revision: D28127518

fbshipit-source-id: c71d305a2caa8b3342ba603133c6e28c34410528
2021-05-03 11:44:53 -07:00
Luna Wei 2e0e3f7ddb Cleanup for shipping use_vsl_modern_v2
Summary:
Changelog:
[General][Changed] - Refactored auxiliary component ItemWithSeparator in VirtualizedSectionList to be functional

Reviewed By: kacieb

Differential Revision: D28127519

fbshipit-source-id: 402bee01e7f26722c376e8ed94ff4b5524d32379
2021-05-03 11:44:53 -07:00
Tim Yung 13c650b8db RN: Retry `buck Fetch` in CircleCI
Summary:
Currently, various CircleCI jobs intermittently fail when trying to fetch dependencies via Maven.

This adds a few retries before failing the CircleCI job to reduce noise from intermittent network fetch failures.

Changelog:
[Internal]

Reviewed By: fkgozali

Differential Revision: D28153008

fbshipit-source-id: ac944882ff0495f568973a709d6d61ef7b51b318
2021-05-03 10:12:40 -07:00
Igor Klemenski 6d04a46f74 Add explicit type casts to fix compilation errors on Windows. (#31363)
Summary:
Recent changes to `MapBuffer` have broken the compilation on Windows.
This fix is similar to this recently-merged change: https://github.com/facebook/react-native/pull/31106

Side note - this PR only addresses a build break, but doesn't address the unsafe casting semantics in `MapBuffer`, which can still cause overflows.

## 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] - Fix compilation errors on Windows.

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

Test Plan: RN now builds in Visual Studio on Windows.

Reviewed By: mdvacca

Differential Revision: D28028342

Pulled By: rozele

fbshipit-source-id: 77d8d4870c59b77acfc0ab2f4c3b7df40b59851d
2021-05-03 09:35:28 -07:00
Paige Sun 7bf78eae5e iOS: 5/7 Use visible prop to dismiss Modal for Paper
Summary:
Changelog: [iOS] Use visible prop to dismiss Modal on old renderer.

Visible prop is used on Fabric so that onDismiss can be passed with the the bridgeless per-component event emitter, rather than the bridge global event emitter. The old renderer still uses the global event emitter.

I needed to use the visible prop for Paper too because in diff 6/7, Modal.js [no longer uses visible prop to return null](dc80b2dcb5/Libraries/Modal/Modal.js (L221-L222)), and Modal.js can't distinguish on whether it's a Fabric or Paper component.

Reviewed By: JoshuaGross

Differential Revision: D28137929

fbshipit-source-id: f6ede0019fbe498a10b822ff09fc135a9fff8ec0
2021-05-02 15:42:49 -07:00
Paige Sun 9ea2950b6e iOS: 4/7 Add back Modal examples in internal settings
Summary:
Changelog:
[Internal][Changed] - Fix Picker's item value in the ModalCustomizable example

This surface was removed a few days ago in D27926745 (23ae702d97). Add it back to be able to test Modals manually.

There's no e2e test associated with this surface at the moment.

Reviewed By: nadiia, kacieb

Differential Revision: D28074150

fbshipit-source-id: dbcceed75e982d211b5c74cdf5f80aee59f54678
2021-05-02 15:42:49 -07:00
Paige Sun 0932a0d775 iOS: 2/5 Remove use of bridge from Modal by dismissing with visible prop
Summary: Changelog: [Fabric][iOS][Fix] Remove use of bridge from Modal by dismissing Modal with visible prop

Reviewed By: sammy-SC

Differential Revision: D28074326

fbshipit-source-id: 0278bfb031db802b59429c553ac62d83838f4cc9
2021-05-02 15:42:49 -07:00
Paige Sun 3c17922c35 iOS: 1/7 Add missing onDismiss prop in Modal component
Summary:
Changelog: [Internal]

Static ViewConfigs are not yet available in Fabric. ViewConfigs are generated from Paper view managers.

For a prop to pass through from JS to iOS, props in [RCTModalHostViewNativeComponent.js](dc80b2dcb5/Libraries/Modal/RCTModalHostViewNativeComponent.js) need to match RCT_EXPORT_VIEW_PROPERTY in RCTModalHostViewManager.m.

Reviewed By: sammy-SC

Differential Revision: D27977574

fbshipit-source-id: 9790d93500890a04ffc0fb4d2bcd2de5187f1fc0
2021-05-02 00:19:53 -07:00
David Vacca cf0a6e9e27 Refactor RCTMultilineTextInputNativeComponent to use NativeComponentRegistry instead of requireNativeComponent
Summary:
This diff migrates RCTMultilineTextInputNativeComponent to use NativeComponentRegistry instead of requireNativeComponent. The intention is to unify the way the component is registered and enable StaticViewConfigs for this component
changelog: [internal] internal

Reviewed By: JoshuaGross

Differential Revision: D28116333

fbshipit-source-id: b245026ebcd564380d0c74bbd6d9a36c661a8e71
2021-04-30 17:41:25 -07:00
David Vacca f76943af1a Refactor RCTSingelineTextInputNativeComponent to use NativeComponentRegistry instead of requireNativeComponent
Summary:
This diff migrates RCTSingelineTextInputNativeComponent to use NativeComponentRegistry instead of requireNativeComponent. The intention is to unify the way the component is registered and enable StaticViewConfigs for this component
changelog: [internal] internal

Reviewed By: JoshuaGross

Differential Revision: D28116332

fbshipit-source-id: d0a1a512a1cd967608512423db3dffa7c68fd2c5
2021-04-30 17:41:25 -07:00
David Vacca fc52e93db5 Add warnings to deprecate UIManager methods when using Fabric + StaticViewConfigs enabled
Summary:
This diff reports warning when a method of the LazyUIManager is called when using fabric and StaticViewConfigs enabled

changelog: [Android][changed] Deprecate UIManager methods when using the new architecture enabled

Reviewed By: fkgozali

Differential Revision: D28108804

fbshipit-source-id: 4b430bdefa67914883a595dff97ea6c9ffd93361
2021-04-30 17:41:25 -07:00
David Vacca 37750100ac Add warnings to deprecate UIManager.getViewManagerConfig method
Summary:
UIManager.getViewManagerConfig method is deprecated, use UIManager.hasViewManagerConfig instead

changelog: [Deprecated] UIManager.getViewManagerConfig method has been deprecated, use UIManager.hasViewManagerConfig instead.

Reviewed By: fkgozali

Differential Revision: D27983717

fbshipit-source-id: 982ecce20eb441c076f7c26d9a54ea13d93c2a31
2021-04-30 17:41:25 -07:00
David Vacca 494bab399e RN][JS][static view configs] Use unstable_hasStaticViewConfig to detect if a component is registered in the native app
Summary:
This diff and stack migratest Migrate UIManager.getViewManagerConfig -> UIManager.hasViewManagerConfig
This is necessary to avoid initializing UIManagerModule to detect if a component is registered into the native platform
changelog: [internal] internal

Reviewed By: fkgozali

Differential Revision: D27983716

fbshipit-source-id: 504180d8883959835e736f8081610b8c49810803
2021-04-30 17:41:25 -07:00
David Vacca 25f942757f Migrate Shimmer.ios to use codegenNativeComponent
Summary:
Migrate Shimmer.ios to use codegenNativeComponent

changelog: [internal] internal

Reviewed By: JoshuaGross

Differential Revision: D28117192

fbshipit-source-id: 8edd06184abf29e0c8fe414bc9760d2e0f97c6c8
2021-04-30 17:41:25 -07:00
Ramanpreet Nara e5080e6171 Pull RCTViewRegistry attachment out of TurboModuleManager
Summary:
## Rationale
The TurboModuleManager should only be concerned with modules. The bridge and RCTInstance integrate the TurboModuleManager with the rest of React Native. Therefore, abstractions used by TurboModules that reach into the rest of React Native should be attached by the bridge or by RCTInstance.

## Changes
In this diff, we pull RCTViewRegistry attachment out of the TurboModuleManager. In bridge mode, it'll be attached to TurboModule by the bridge. In bridgeless mode, it'll be attached to TurboModules by the RCTInstance.

Changelog: [Internal]

Reviewed By: PeteTheHeat

Differential Revision: D28086320

fbshipit-source-id: 9d99835bdbb66bb6a41fbd0d8a3970cefae16b81
2021-04-30 16:40:16 -07:00
Peter Argany 8eceee744e Fix Hermes build on folly 2021.04.26.00
Summary:
This fixes multiple compile errors when building RNTester with Hermes enabled:
- `Typedef redefinition with different types ('uint8_t' (aka 'unsigned char') vs 'enum clockid_t')`
- `'event2/event-config.h' file not found`
- tons of missing files (all added to RCT-Folly/Futures)

Changelog: [iOS] Fix Hermes build on folly version 2021.04.26.00
allow-large-files

Reviewed By: RSNara

Differential Revision: D28128087

fbshipit-source-id: ee7cb6fda72d00d22f6182d958aa8ba55939f158
2021-04-30 15:05:22 -07:00
Riley Dulin 7579ed3f6f Implement HeapProfiler.getObjectByHeapObjectId
Summary:
Implement the API for querying the properties of an object found in a
heap snapshot.

Now when you are debugging and take a heap snapshot, you can hover
over an object and inspect it!

Only works for subclasses of JSObject. Doesn't work for stuff like HiddenClass,
PropertyAccessor, native objects like WeakValueMap, etc. Those internal objects
display "Preview is not available" which matches what Chrome prints for its own
internal stuff.

Changelog: [Internal]

Reviewed By: avp

Differential Revision: D27834672

fbshipit-source-id: 607a8984b5a48b76c5ae57f9bd5bf53168f3ec3f
2021-04-30 13:44:02 -07:00
Samuel Susla 2b27323308 Remove unnecessary access to UIKit on main thread in [RCTRedBox dealloc]
Summary:
Changelog: Fix main thread access to UIKit in RCTRedBox

{F611784226}

Xcode's main thread checker complains about this during reload. it is not needed to set `dataSource` and `delegate` to nil because the table view is about to be destroyed.

Reviewed By: mdvacca

Differential Revision: D28089039

fbshipit-source-id: 13b62cafb4790fc15b5a5dde131d4ae64bd97c82
2021-04-30 10:46:35 -07:00
Andrei Shikov 382e90c0dd Batch Animation setValue call in a separate batch
Summary:
NativeAnimationModule on Android is using batches to combine related updates together. In Fabric, this process is controlled by JS, which schedules starts batching when Animated component props are about to be updated.

In rare cases when there's no prop update (like calls to `setValue` on `AnimatedValue`), changes weren't applied until the next batch was scheduled. This change ensures that such changes get applied directly.

This problem doesn't happen on iOS or non-Fabric surfaces, because they use per-frame scheduling instead.

Changelog: [Internal]

Reviewed By: JoshuaGross

Differential Revision: D28100641

fbshipit-source-id: 87b3acb3a8de131cdcb2104dc121d40eccfbc29d
2021-04-30 10:21:36 -07:00
Rubén Norte 80ce3c7fe2 Cache root components with display name to avoid invalidating whole subtree on updates
Summary:
In development, we can specify a debug name to force the whole React tree to have a meaningful name. This is useful for debugging: React DevTools, component stack traces, etc. More context in D26637787 (eeb36f4709).

This worked fine until now because `renderApplication` is never called more than once per React Native root. With pre-rendering, this won't be true as we'll be able to re-render the whole React tree with new props (after navigating to the screen).

The problem with the current implementation is that we generate a new component every time `renderApplication` is called, which makes the React reconciliation consider them different components and discards the whole sub-tree.

This fixes it by caching those components so we always return a component with the same identity (exactly the same function) when we call `renderApplication` repeatedly.

This won't have any effect in production where these components aren't created at all.

Changelog: [Internal]

Reviewed By: ShikaSD

Differential Revision: D28061384

fbshipit-source-id: 95833a5b74bb622896cb47426f74324d8740e5d7
2021-04-30 09:46:14 -07:00
Rubén Norte fdfadd43f2 Simplify logic to coerce DisplayMode
Summary:
Changelog: [Internal]

TSIA

Reviewed By: ShikaSD

Differential Revision: D28061403

fbshipit-source-id: bb98fa2ccdd3f8e936bec95fbbbeace42664a608
2021-04-30 09:46:14 -07:00
Nat Mote 6386f691f7 Deploy Flow v0.150.0
Summary: Changelog: [Internal]

Reviewed By: dsainati1

Differential Revision: D28096358

fbshipit-source-id: 8b947673c32f4af6755954ede78e7708a5801197
2021-04-30 09:13:16 -07:00
Samuel Susla ad2f1caf9a Clean up optimized_hit_testing_ios
Summary:
Changelog: [internal]

Clean up the experiment

Reviewed By: JoshuaGross

Differential Revision: D27996499

fbshipit-source-id: 3c9598846b3800eef86d039580e6a12e7273e798
2021-04-30 06:11:55 -07:00
Rick Hanlon 2482684080 Run sync from CI artifacts
Summary:
Runs an A:A react sync against the current revision to pick up the updates from the sync script.

Changelog: [Internal]

Reviewed By: yungsters, kacieb

Differential Revision: D28103715

fbshipit-source-id: 3593909e999bdceeb95423dc37dc0ee4282963d9
2021-04-29 20:39:28 -07:00
Kevin Gozali f346dd616f iOS new architecture: disallow disabling enforcement when RCT_NEW_ARCHITECTURE is defined
Summary: Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D28080430

fbshipit-source-id: 3e89be8419776c4a6da9dd9e8c6c5501c8f6c304
2021-04-29 19:46:10 -07:00
Xuan Huang c54aeccf1a Reflect Hermes release version from HermesBadge
Summary:
Changelog:
[General] - Reflect Hermes release version from HermesBadge

It was a common footgun that an unexpected version of Hermes
engine is used in a RN app. To help with indicating this from
the runtime, Hermes exposes its OSS release version from
`HermesInternal.getRuntimeProperties()` Starting from 0.8.0.

This diff updates the `HermesBadge` used by `NewAppScreen`
header to reflect the version.

Reviewed By: nadiia

Differential Revision: D24436609

fbshipit-source-id: 8ba45be598a7d5af0e38f5044f9370fc7e1eb9a1
2021-04-29 17:13:29 -07:00
Brian Vaughn 9e020ef476 Update React DevTools to ^4.13.0
Summary:
React DevTools has gotten pretty outdated in React Native. Let's fix that!

Last time I tried this it caused a lot of churn for tools like Flipper, so I approached this in two steps ([detailed in this post](https://fb.workplace.com/groups/rnsyncsquad/permalink/808063140086959/)).

First was a short term plan (as implemented in [PR 21344](https://github.com/facebook/react/pull/21344)) to:
1. Branch and make a patch release of DevTools 4.10 that adds a protocol check to the frontend (to detect any newer backends).
2. Upgrade Flipper (and recommend upgrade for the OSS React Native Debugger as well) to this new frontend.
3. Wait for the updated frontend to roll out.

The short term plan is now done, at least for the internal build of Flipper, and both GitHub PRs to update Flipper and React Native Debugger have been merged.

So this diff moves forward with the longer term plan (implemented in [PR 21331](https://github.com/facebook/react/pull/21331)):
1. Add an explicit version to the protocol used by the DevTools "backend" and "frontend" components to talk to each other.
2. Check this protocol during initialization to ensure it matches.
3. Show upgrade/downgrade instructions if there's a mismatch (or if the check times out without a response– indicating an older backend).
4. Release this as 4.13.

 ---

Changelog:
[General][Changed] - Upgrade `react-devtools-core` from ~4.6.0 to ^4.13.0

Reviewed By: yungsters

Differential Revision: D28103394

fbshipit-source-id: 21114294144bde9aede63cb3ba98a240082299bd
2021-04-29 16:58:36 -07:00
Joshua Gross b44f4dda4f LayoutAnimations: fix mutation ordering hitting assert
Summary:
When REMOVE animations finish, they are hitting asserts in StubViewTree because of UPDATEs and REMOVEs being out-of-order. By simply not forcing REMOVEs to happen before UPDATEs, this problem seems to go away.

Long-term (in a couple weeks, likely) I want to add unit tests to catch all cases like this, but I'm comfortable with this change since it does fix a known assert failure.

Changelog: [Internal]

Differential Revision: D28086223

fbshipit-source-id: eb77ea94d76e996d7b2cb37038ce6f2a9799f8b4
2021-04-29 15:32:09 -07:00
Xuan Huang 2b67631210 Bump Hermes npm to 0.8.0
Summary:
Changelog:
[Breaking][Changed] - Bump Hermes to 0.8.0

allow-large-files

Reviewed By: nadiia

Differential Revision: D28087209

fbshipit-source-id: 2f26901d07ad29093d44e4a71eaa7b7c4ad9afb2
2021-04-29 15:23:57 -07:00
Neal Poole 33ef82ce6d Update validateBaseUrl to use latest regex
Summary:
Updating the regex to avoid a potential regular expression denial-of-service vulnerability.

Changelog: Update validateBaseUrl to use a more robust regular expression. Fixes CVE-2020-1920, GHSL-2020-293

Reviewed By: lunaleaps

Differential Revision: D25507604

fbshipit-source-id: c36a03c456881bc655c861e1a2c5cd41a7127c9d
2021-04-29 14:53:15 -07:00
Peter Argany 36b58a824e Bump Flipper-Folly to 2.5.3 and RCT-Folly to 2021.04.26.00
Summary:
This fixes an error where folly fails to build on Xcode 12.5, by bumping the various folly deps in RN to builds with a fix.

Next step is to commit this to 0.64 release branch

allow-large-files

Changelog: [iOS] Fix builds on Xcode 12.5

Reviewed By: fkgozali

Differential Revision: D28071808

fbshipit-source-id: 236b66bf8294db0c76ff25b11632c1bf89525921
2021-04-29 10:39:25 -07:00
Joshua Gross a249065503 Pass "blockNativeResponder" param to RCTMountingManager
Summary:
From looking at other implementations of setJSResponder, we need the MountingManager to have access to "blocksNativeResponder" param, but do not need to pass that through to individual views (see also Android implementation).

Changelog: [Internal]

Reviewed By: sammy-SC, mdvacca

Differential Revision: D28066257

fbshipit-source-id: e1420431478fd27d2e1463e291a0bbc600d3f0a6
2021-04-29 09:29:45 -07:00
David Vacca 8eeb01686f Ship virtualizedlist remeasure fix
Summary:
This diff ships the virtualizedlist remeasure fix implemented in D27003249 (1bc06f18c6)

For more details about experiment see: https://fb.workplace.com/groups/rn.engineering/permalink/2831770330485832/

changelog: [internal] internal

Reviewed By: JoshuaGross

Differential Revision: D28072308

fbshipit-source-id: c23c958ca9f2991236cb5a5c02084722aa6de919
2021-04-28 20:16:23 -07:00
Ramanpreet Nara 7e05480cc3 Delete @synthesize turboModuleRegistry API in RCTTurboModule
Summary:
All NativeModules/TurboModules can use the following Venice-compatible API instead:
```
synthesize moduleRegistry = _moduleRegistry
```

In bridge mode, it'll look up the module via the TurboModule system/bridge.
In bridgeless mode, it'll look up the module via the TurboModule system.

Therefore, there's no need to support this API.

Changelog: [iOS][Removed] - Delete synthesize turboModuleRegistry API in RCTTurboModule

Reviewed By: fkgozali

Differential Revision: D28070740

fbshipit-source-id: d2c8285fd4c05b67fb03ce82217bf6ddfd1dd685
2021-04-28 16:49:05 -07:00
ananta 2b49664cb8 Add flow types to AccessibilityExample.js (#31384)
Summary:
[AccessibilityExample.js](https://github.com/facebook/react-native/blob/master/packages/rn-tester/js/examples/Accessibility/AccessibilityExample.js) does not have proper Flow types. Without Flow typing enforced, it is easy for bugs to be introduced when making changes to this file. This pull request enforces Flow typing in this file.

## Changelog
[General] [Fixed] - Fixed return type of `AccessibilityRoleAndStateExample`
[General] [Added] - Added Flow Types to AccessibilityExample.js

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

Test Plan:
Before:
![Screen Shot 2021-04-19 at 7 39 58 PM](https://user-images.githubusercontent.com/12180395/115248265-42c6b200-a147-11eb-8dad-058f646a1550.png)

After:
![Screen Shot 2021-04-19 at 7 40 10 PM](https://user-images.githubusercontent.com/12180395/115248284-465a3900-a147-11eb-8bff-4050ce6bd806.png)

Reviewed By: yungsters, nadiia

Differential Revision: D28004170

Pulled By: kacieb

fbshipit-source-id: 77bc44bbaf7a19c034a92a2daef302d5dc6078fa
2021-04-28 15:29:54 -07:00
Samuel Susla c3d765883a Fix frames for in text links
Summary:
Changelog: [internal]

`accessibilityFrame` needs to take scrolling position into account. To fix that, we calculate the position dynamically.

Reviewed By: mdvacca

Differential Revision: D28056789

fbshipit-source-id: 3247b3e6fd64934e99563de83d163f657828e933
2021-04-28 14:50:14 -07:00
Kacie Bawiec c68c151cda React Native sync for revisions a632f7d...2a7bb41
Summary:
This sync includes the following changes:
- **[9a2591681](https://github.com/facebook/react/commit/9a2591681 )**: Fix export //<Sebastian Markbage>//
- **[4a8deb083](https://github.com/facebook/react/commit/4a8deb083 )**: Switch the isPrimaryRender flag based on the stream config ([#21357](https://github.com/facebook/react/pull/21357)) //<Sebastian Markbåge>//
- **[bd4f056a3](https://github.com/facebook/react/commit/bd4f056a3 )**: [Fizz] Implement lazy components and nodes ([#21355](https://github.com/facebook/react/pull/21355)) //<Sebastian Markbåge>//
- **[fc33f12bd](https://github.com/facebook/react/commit/fc33f12bd )**: Remove unstable scheduler/tracing API ([#20037](https://github.com/facebook/react/pull/20037)) //<Brian Vaughn>//
- **[721238394](https://github.com/facebook/react/commit/721238394 )**: Enable strict effects mode for React Native Facebook builds ([#21354](https://github.com/facebook/react/pull/21354)) //<Brian Vaughn>//
- **[48740429b](https://github.com/facebook/react/commit/48740429b )**: Expiration: Do nothing except disable time slicing ([#21345](https://github.com/facebook/react/pull/21345)) //<Andrew Clark>//
- **[0f5ebf366](https://github.com/facebook/react/commit/0f5ebf366 )**: Delete unreferenced type ([#21343](https://github.com/facebook/react/pull/21343)) //<Andrew Clark>//
- **[9cd52b27f](https://github.com/facebook/react/commit/9cd52b27f )**: Restore context after an error happens ([#21341](https://github.com/facebook/react/pull/21341)) //<Sebastian Markbåge>//
- **[ad091759a](https://github.com/facebook/react/commit/ad091759a )**: Revert "Emit reactroot attribute on the first element we discover ([#21154](https://github.com/facebook/react/pull/21154))" ([#21340](https://github.com/facebook/react/pull/21340)) //<Sebastian Markbåge>//
- **[709f94841](https://github.com/facebook/react/commit/709f94841 )**: [Fizz] Add FB specific streaming API and build ([#21337](https://github.com/facebook/react/pull/21337)) //<Sebastian Markbåge>//
- **[e8cdce40d](https://github.com/facebook/react/commit/e8cdce40d )**: Don't flush sync at end of discreteUpdates ([#21327](https://github.com/facebook/react/pull/21327)) //<Andrew Clark>//
- **[a15586001](https://github.com/facebook/react/commit/a15586001 )**: Fix: Don't flush discrete at end of batchedUpdates ([#21229](https://github.com/facebook/react/pull/21229)) //<Andrew Clark>//
- **[89847bf6e](https://github.com/facebook/react/commit/89847bf6e )**: Continuous updates should interrupt transitions ([#21323](https://github.com/facebook/react/pull/21323)) //<Andrew Clark>//
- **[ef37d55b6](https://github.com/facebook/react/commit/ef37d55b6 )**: Use performConcurrentWorkOnRoot for "sync default" ([#21322](https://github.com/facebook/react/pull/21322)) //<Andrew Clark>//

Changelog:
[General][Changed] - React Native sync for revisions a632f7d...2a7bb41

jest_e2e[run_all_tests]

Reviewed By: JoshuaGross

Differential Revision: D28063006

fbshipit-source-id: 7e3535f80961706863b6c2188ee44b5796b2f000
2021-04-28 14:17:08 -07:00
Samuel Susla 84d55868e8 Fix DatePicker sizing issue
Summary:
Changelog: Fix possible sizing issue with DatePicker

Changing `preferredDatePickerStyle` changes size of the component without triggering re-layout of the react native screen. The fix is to make sure the size stays the same after changing the style.

Reviewed By: mdvacca

Differential Revision: D28035226

fbshipit-source-id: 2dcb50fd5ebaa0c0d01d3289c4ffa77a053cfc4a
2021-04-28 13:48:28 -07:00
Scott Kyle 2f62c2892d Fix crash in RCTCoreModulesClassProvider during quit
Summary:
This intentionally leaks the static map, since it still might be accessed after static destructors are run. This is a common approach to this problem, see https://github.com/facebook/react-native/pull/22607 and https://github.com/facebook/componentkit/pull/906 as examples. It also sets up an autorelease pool from  `RCTNativeModule::invoke` as a precaution since there's no strict guarantee one exists when it is called.

Changelog:
[iOS][Fixed] - Fix crash in RCTCoreModulesClassProvider during quit

Reviewed By: RSNara

Differential Revision: D27932062

fbshipit-source-id: fa75da4b78290027a762440ac6943c81b8594a57
2021-04-28 13:29:06 -07:00
Adam Cmiel 08ea434ba8 Migrate xplat autoglob targets (#31400)
Summary:
## Changelog: [Internal]
Pull Request resolved: https://github.com/facebook/react-native/pull/31400
Pull Request resolved: https://github.com/facebook/react-native/pull/31411

Annotate autolgob mode for apple library targets

Reviewed By: adamjernst

Differential Revision: D27890473

fbshipit-source-id: 75239c6c1871310e1ccd6576569161eb4163a3c1
2021-04-28 11:07:17 -07:00
Samuel Susla 050f84fd2b EventQueue::enqueueStateUpdate now accepts rvalue reference
Summary:
Changelog: [internal]

state infra uses rvalue references until this point. I assume the original author intended to rvalue reference even here.
This way, we avoid unnecessary copy.

Reviewed By: JoshuaGross

Differential Revision: D28057570

fbshipit-source-id: 19af480234d44acffcdbb22606607279e25c8aed
2021-04-28 11:00:03 -07:00