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

6844 Коммитов

Автор SHA1 Сообщение Дата
Hetan Thakkar 3eddc9abb7 Opacity in TouchableOpacity properly react to state change (#32956)
Summary:
This PR fixes the opacity bug where it fails to properly react to state change. This PR resolves the issue detailed in https://github.com/facebook/react-native/issues/32476

## 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] - Fixed opacity value in TouchableOpacity

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

Test Plan: The code I added in componentDidUpdate does solve the issue and passes all the test cases

Reviewed By: ryancat

Differential Revision: D33766718

Pulled By: cortinico

fbshipit-source-id: 951bedf22619fc12e66156d0a6074cd8adf1d3eb
2022-02-07 04:23:01 -08:00
Moses DeJong eb19499484 Enable custom sound for local notification in PushNotificationIOS
Summary:
Add soundName property in NativePushNotificationManagerIOS JS module and deliver to native local notification API.
Changelog:
[iOS][Fixed] - Enable custom sound for local push notifications.

Reviewed By: RSNara

Differential Revision: D33898630

fbshipit-source-id: c6362032601f0f6d20479465ce1f0a84c450ea72
2022-02-04 18:16:19 -08:00
Moses DeJong 3633a05299 Invoke registerForRemoteNotifications on main UI thread to avoid error messages in Xcode
Summary:
Invoke registerForRemoteNotifications on main UI thread to avoid error messages in Xcode.

Changelog:
[iOS][Fixed] - Invoke registerForRemoteNotifications on main UI thread.

Reviewed By: philIip

Differential Revision: D33780141

fbshipit-source-id: 64b825dfc15e7ac262e210b90bb334a7e415e402
2022-02-04 18:16:19 -08:00
Ramanpreet Nara b8a2f34dee Make lefthandObjectDiff private to verifyComponentAttributeEquivalence
Summary:
## Rationale
verifyComponentAttributeEquivalence is the legacy check for making sure that Static ViewConfigs match Native ViewConfigs. Eventually, we should just delete this module/check from the codebase.

## Changes
This diff migrates the RNHostComponentViewConfig differences screen to display the ViewConfig differences using the new StaticViewConfigValidator validation result vs the legacy validator's lefthandObjectDiff method.

## Benefits:
- Now, **all the diffing logic** on this route uses the new StaticViewConfigValidator.
- This takes us one step closer towards deleting verifyComponentAttributeEquivalence
- StaticViewConfigValidator [supports ignoring ViewConfig properties](https://fburl.com/code/2it5r7py). Now, the RNHostComponentViewConfig respects these ignores.

Changelog: [Internal]

Reviewed By: p-sun

Differential Revision: D34017602

fbshipit-source-id: 3ad909adcbb95b932a269dd55dd5445834a9cfd4
2022-02-04 16:21:00 -08:00
Moti Zilberman 8c5cacf30e Fix type import style in EventEmitter and Linking
Summary:
Changelog: [Internal]

Fixes some files to use the preferred `import type {Foo}` syntax instead of `import {type Foo}`.

Reviewed By: rh389

Differential Revision: D34001108

fbshipit-source-id: 64675fefa71b6832118eabc60c825c65b87514d9
2022-02-04 05:27:56 -08:00
Moti Zilberman b2f871a6fa Fix crash with SectionList.scrollToLocation and private property munging
Summary:
Changelog:
[General][Fixed] - Remove illegal private property access in VirtualizedSectionList.scrollToLocation

`VirtualizedSectionList.scrollToLocation` internally uses `VirtualizedList`'s `_getFrameMetricsApprox` method. This method is private by convention (since it's `_`-prefixed), but under certain build setups this is also enforced at runtime, so using `scrollToLocation` can throw an error.

Here, we rename this internal method to `__getFrameMetricsApprox` (adding another leading underscore) which opts it out of being treated as private, while still communicating that it's not part of the public API. We also delete the Flow error suppression that masked this issue.

For reference: This convention for private methods (including the double-underscore opt out) has its roots in Facebook's pre-Babel [JSTransform](https://github.com/facebookarchive/jstransform/blob/master/visitors/es6-class-visitors.js) compiler and is implemented in Flow as [`munge_underscores=true`](https://flow.org/en/docs/config/options/#toc-munge-underscores-boolean).

Reviewed By: yungsters

Differential Revision: D33982339

fbshipit-source-id: 498563c59d42549c94fe90d363677d6d3ea35d2d
2022-02-03 17:34:50 -08:00
Moti Zilberman 6584304c10 Make Animated.Interpolation config read-only
Summary:
Changelog:
[General] [Changed] Type the argument of Animated.interpolate as read-only

Reviewed By: javache

Differential Revision: D33950698

fbshipit-source-id: b959d34eb9752358f4a8ba1d290b56c099f535e0
2022-02-03 03:45:23 -08:00
Genki Kondo 1f778014a7 Fix JS animated node value updating when listener is attached
Summary:
The JS-side animated node values were not being updated on AnimatedValue (and thus AnimatedValueXY); however, the native event "onAnimatedValueUpdate" is being handled properly in AnimatedNode. It turns out that single underscore prefixed methods are obfuscated at FB. And thus AnimatedValue._onAnimatedValueUpdateReceived was not getting called. Changing the method name to double underscore as a way to denote "protected" fixes the issue.

Changelog:
[General][Fixed] - JS animated node value updates properly when listener is attached

Reviewed By: yungsters

Differential Revision: D33962038

fbshipit-source-id: c4f60e1f1ccc0cef3e65b89034bdb91376a26416
2022-02-02 19:56:43 -08:00
Tim Yung 3e229f27bc RN: Remove `propTypes` from Image, Text, and TextInput
Summary:
Removes the `propTypes` member from the `Image`, `Text`, and `TextInput` components.

They have been deprecated since React Native v0.66.

Changelog:
[General][Removed] - Removed `Image.propTypes`, `Text.propTypes`, and `TextInput.propTypes`.

Reviewed By: kacieb

Differential Revision: D33750298

fbshipit-source-id: 085f83ad838196bdd531b097b8ce5957270c3ad1
2022-02-01 16:19:01 -08:00
Genki Kondo cb42049e0a Support platform color with AnimatedColor on Android
Summary:
Adds support for platform colors in AnimatedColor.
Passes the processed native color object to the native ColorAnimatedNode via the native config; ColorAnimatedNode then uses ColorPropConverter.getColor to resolve the resource path.

Note: setting a platform color via setValue on an existing AnimatedColor is not supported yet

Changelog:
[Android][Added] - Support platform color with AnimatedColor

Reviewed By: yungsters

Differential Revision: D33922266

fbshipit-source-id: 04d39a5ce0872b31d06ffbd4639d2f2213cf3314
2022-02-01 16:12:30 -08:00
Ramanpreet Nara 7b9490b4b1 Introduce PlatformBaseViewConfig and fix SVC for RCTView
Summary:
## Impact
Fix the Static ViewConfig for <View/>.

This diff fixes the base ViewConfig for all HostComponents on both platforms. Consequently, it simplifies SVC reconciliation efforts, by nearly eliminating the first of these classes of SVC errors:
1. Unexpected properties in SVC
2. Missing properties in SVC
3. Not matching properites in SVC

## What is the base ViewConfig on each iOS/Android?
**On iOS:**
- All props come from ViewManagers
- All HostComponent ViewManagers extend <View/> ViewManager

https://pxl.cl/1SxdF

Therefore, the base ViewConfig for all components should be <View/>'s static ViewConfig.

**On Android:**

The component model is a bit more complicated:

https://pxl.cl/1Vmp5

Takeaways:
- Props come from Shadow Nodes **and** ViewManagers
- Nearly all HostComponent ViewManagers extend BaseViewManager. But, that's not <View/>'s ViewManager.
- <View/>'s ViewManager is [ReactViewManager](https://fburl.com/code/0zalv8zk), which is a descendent of BaseViewManager, and declares its own ReactProps.

So, on Android, it's not safe for the base ViewConfig to be <View>'s ViewConfig:
1. No components actualy incorportate <View/>'s props
2. Some components don't even incorporate BaseViewManager's props.

So, what should the base ViewConfig be on Android?
- Nearly all components extend BaseViewManager. BaseViewManager must have a shadow node [that extends LayoutShadowNode](https://www.internalfb.com/code/fbsource/[47d68ebc06e64d97da9d069f1ab662b392f0df8a]/xplat/js/react-native-github/ReactAndroid/src/main/java/com/facebook/react/uimanager/BaseViewManager.java?lines=40). Therefore, we'll make the base ViewConfig on Android be generated by BaseViewManager + LayoutShadowNode.

## Changes
In this diff, I removed ReactNativeViewViewConfig, and introduced a new view config called PlatformBaseViewConfig. This ViewConfig partial will capture all the props available on all HostComponents on **both** platforms. This may not necessarily be the props made available on <View/>.

The only components that don't extend the base platform props are: RCTTextInlineImage. What we do with these components is TBD.

Changelog: [Internal]

Reviewed By: p-sun, yungsters

Differential Revision: D33135055

fbshipit-source-id: 7299f60ae45ed499ce47c0d0a6309a047bff90bb
2022-01-31 14:52:32 -08:00
Pieter De Baets d682753244 Support setting hitSlop with single value (JS) [re-land]
Summary:
JS changes to support D32138347 (a96bdb7154). This was previously reverted due to missing iOS Paper support.

Changelog: [Android][Fixed] Enable hitSlop to be set using a single number.

Original commit changeset: 91cfcc86582c

Original Phabricator Diff: D32559015 (589b129581)

Reviewed By: yungsters

Differential Revision: D33453327

fbshipit-source-id: d289a0a8b8208bc9c68e6ca537632b745e8196ed
2022-01-31 04:06:22 -08:00
Genki Kondo 3f49e6763e Support color animation with native driver for Android
Summary:
Adds support for Animated.Color with native driver for Android. Reads the native config for the rbga channel AnimatedNodes, and on update(), converts the values into an integer (0xaarrggbb)

Followup changes will include support for iOS and platform colors.

Changelog:
[Android][Added] - Support running animations with AnimatedColor with native driver

Reviewed By: javache

Differential Revision: D33833600

fbshipit-source-id: 2bf05c9715b603cf014ace09e9308b2bfd67f30a
2022-01-29 13:51:41 -08:00
Paige Sun 0ab0c5a42e Disable static ViewConfigs in bridge mode & enable for bridgeless mode - Remove __fbStaticViewConfig & UIManagerInjection
Summary: Changelog: [Internal]

Reviewed By: RSNara

Differential Revision: D33835081

fbshipit-source-id: ed625de3b2da73f98cdb9c9dc97086aa2c477e3a
2022-01-28 23:39:38 -08:00
Genki Kondo d3a0c4129d Support string color values in Animated.Color
Summary:
In addition to rgba values, allow creating Animated.Color with a string color.

Followup changes will include support for platform colors and native driver.

Changelog:
[General][Added] - Support string color values in Animated.Color

Reviewed By: javache

Differential Revision: D33810717

fbshipit-source-id: 208bc2675b6153a515fbf2122da15a065c473e73
2022-01-27 17:36:35 -08:00
Genki Kondo ea90a76efe Initial non-native implementation of AnimatedColor
Summary:
Creates Animated.Color for animating color props.

Implement AnimatedColor, which basically consists of 4 AnimatedValues (along the same vein as ValueXY) which allows us to just use AnimatedValue's interpolation. Provides a string color value of shape 'rgba(r, g, b, a)'

AnimationNode DAG looks like:

{F696076974}

Followup changes will include support for string color values, platform colors, and native driver.

Changelog:
[General][Added] - New Animated.Color node

Reviewed By: mdvacca

Differential Revision: D33778456

fbshipit-source-id: 83ddbc955156bf589c864f229a5f83fe6875fd0e
2022-01-27 13:37:59 -08:00
Dmytro Voronkevych 12a67425ab Adding string annotations to markEvent
Summary:
Adding string annotations support to markEvent API in ReactNative

Changelog:
[Internal][Change] - markEvent API now supports string annotations

Differential Revision: D33795346

fbshipit-source-id: 414cbd08ce5ff6045e2f35ae77059be5add3d834
2022-01-27 04:47:33 -08:00
Dmytro Voronkevych 0e39b95a45 Adding markEvent to the ReactNative QPL
Summary:
QPL in ReactNative were missing markEvent API - adding it in this diff. In the next diff I will add support for annotations.

Customer request: https://fb.workplace.com/groups/QPL.QandA/posts/1228789167531266/

Changelog:
[Internal][Change] - Adding markEvent API to QuickPerformanceLogger

Differential Revision: D33789590

fbshipit-source-id: 3e9dfde9d413943281d6aa7e85b9feeafc3bef7a
2022-01-27 04:47:33 -08:00
Genki Kondo 8858c21124 Make sure that AnimatedTracking is started when CompositeAnimation.start is called
Summary:
In Animated, when a toValue of AnimatedValue (as opposed to a number) is passed in, the [AnimatedValue starts tracking via AnimatedTracking](https://www.internalfb.com/code/fbsource/[b688f3747a706236fce300636978ed1ca5e4081a]/xplat/js/react-native-github/Libraries/Animated/AnimatedImplementation.js?lines=142) but it doesn't actually start animating even if start() is called on the animation.

This behavior is inconsistent with a toValue of a number, which executes immediately on start(). This diff adds a call to AnimatedTracking.update within AnimatedValue.track, which starts the tracking animation.

Changelog:
[General][Fixed] - Fixes execution of animation when a toValue of AnimatedValue is used.

Reviewed By: JoshuaGross

Differential Revision: D33800373

fbshipit-source-id: 85ee6f51bc2bb2e078b586b076a8d1dfe92c1155
2022-01-26 21:23:54 -08:00
Chiara Mooney 3d1d4ee457 Update RN Version Expected Structure (#32892)
Summary:
Current syntax options for RN version values break Windows. Following change to nightly build format to be 0.0.0-X-X-X, prerelease value is now a string (X-X-X).

https://github.com/microsoft/react-native-windows/issues/9223

## Changelog

[General] [Fixed] - Fix RN version syntax to match new nightly build structure.

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

Reviewed By: cortinico

Differential Revision: D33712950

Pulled By: lunaleaps

fbshipit-source-id: 9e47cae34930ee624a863c832430962354ebb5be
2022-01-25 22:23:30 -08:00
Marshall Roch 203a82e90a fix flow suppression in VirtualizedList
Summary:
flow 0.146 became more conservative about refinement invalidation, no longer accepting that `this.props.onViewableItemsChanged` is truthy. this was suppressed at the time.

instead, we can assign to a const to restore typechecking.

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D33743126

fbshipit-source-id: 0b1f0b83c2fe812e88b027c3b1d3d8aca7b09277
2022-01-25 15:23:47 -08:00
Marshall Roch 851e87a1a6 make Easing an object, not a class
Summary:
`Easing` only has static properties and is never constructed or subclassed, so there doesn't seem to be any reason for it to be a class instead of an object.

as a class, Flow errors about `method-unbinding` on every single use of it.

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D33774944

fbshipit-source-id: c0bd2e3d7a78e538f95b88b2b1b12d301c8f590c
2022-01-25 15:23:46 -08:00
Paige Sun 0567fd0e91 4/4 Fix RNHostComponentDetailsRoute to display differences between SVCs and NVCs
Summary: Changelog: [Internal]

Reviewed By: RSNara

Differential Revision: D33718142

fbshipit-source-id: d3a05503e7cc2b76a66a26376a47e4acdc30d514
2022-01-25 15:23:46 -08:00
Paige Sun 63605323b0 2/4 Fix RNHostListComponentListRoute to validate SVCs with NVCs
Summary: Changelog: [Internal]

Reviewed By: RSNara

Differential Revision: D33715385

fbshipit-source-id: d8d31e92dd934648f8431a508a78e2813c462f8f
2022-01-25 15:23:46 -08:00
MaeIg 8b5a5d4645 Fix capitalize Text style on IOS (#32774)
Summary:
On my project, I realized that capitalize style doesn't work with dates on IOS. I found [this issue](https://github.com/facebook/react-native/issues/32697) and tried to solve it.

(code example: https://snack.expo.dev/maelg/capitalize-demo)
| Android | IOS | Web |
| ------------- | ------------- | ------------- |
| ![image](https://user-images.githubusercontent.com/40902940/146158714-c658a83e-d8f3-41c9-92c8-4fc1f722f942.png) | ![image](https://user-images.githubusercontent.com/40902940/146159059-3cec1f7b-9bc7-4060-8164-79c47694b86b.png) | ![image](https://user-images.githubusercontent.com/40902940/146158095-0f94f25f-f245-4e45-9191-73520a0f6568.png) |

As we can see, the behavior is different on IOS, Android and web:
- **Android**: Capitalize the first letter of each word, unless it begins with a number. And put the rest in lowercase.
- **IOS**: Capitalize the first letter of each word, ~~unless it begins with a number~~. And put the rest in lowercase.
- **Web**: Capitalize the first letter of each word, unless it begins with a number. ~~And put the rest in lowercase.~~

This PR aims to unify behavior on Android and Ios. I am not changing the behavior which differs from the web because I don't know if it is desirable to align with the web.

## Changelog

[IOS] [Changed] - Don't capitalize the first letter of a word that is starting by a number

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

Test Plan:
I manually tested my changes on a POC app (same code: https://snack.expo.dev/maelg/capitalize-demo) on react-native v0.66.4 and react-native main branch.

You can see the result here:
| Android | IOS |
| ------------- | ------------- |
| ![image](https://user-images.githubusercontent.com/40902940/146191361-e2de26d1-3915-47dc-8707-480504af24d6.png) | ![image](https://user-images.githubusercontent.com/40902940/146161660-c869202a-104e-4d16-8f5e-db1c72b2ea5e.png) |

~~I tried to use rn-tester but it was not taking my code. I think it is because fabric was enabled so it was using other code.
I tried to disable fabric but I was not able to build the app on my IOS simulator anymore:~~

On rn-tester:
<image src="https://user-images.githubusercontent.com/40902940/146457851-864b2962-5e9c-4c7e-83fd-7686e27cb996.png" width=50% height=50% />

Reviewed By: philIip

Differential Revision: D33165963

Pulled By: yungsters

fbshipit-source-id: c3bf32bf33d2f109a119798eefdbb9077e904252
2022-01-25 09:08:18 -08:00
Tim Yung 23717c6381 RN: Remove DeprecatedPropTypes
Summary:
Removes all of the `DeprecatedPropTypes` modules from React Native.

Any call sites that were deep-linking to these modules and still requires them can instead import them from the `deprecated-react-native-prop-types` package.

Since this also removes the last reference to `prop-types`, this diff also removes the `prop-types` dependency from `react-native`. 🥳

Changelog:
[General][Removed] DeprecatedPropTypes (deep-link) modules removed from React Native.

Reviewed By: kacieb

Differential Revision: D33671645

fbshipit-source-id: 91829a556b272bbd17ee94806fc548af753593db
2022-01-20 18:17:03 -08:00
Moses DeJong f12c8fba60 Avoid self capture in blocks that would extend ImageView instance lifetime.
Summary:
Avoid self capture in blocks that would extend ImageView instance lifetime.

Changelog:
[iOS][Fixed] - Use weakSelf in objc block instead of self.

Reviewed By: RSNara

Differential Revision: D33639088

fbshipit-source-id: b6e5200d9410ddd9e0683ea6d3cc3116591dd31c
2022-01-20 15:39:52 -08:00
Michelle Laurenti 86db62b7a8 fix race condition in iOS websocket implementation (#32847)
Summary:
The iOS WebSocket implementation has a race condition that causes WebSocket frame payloads to be processed incorrectly.
This can cause errors on RFC6455 compliant WebSocket servers:
- the server sends a ping frame with no payload
- the server sends a text frame with a payload longer than 125 bytes
- the client answers the ping with a pong frame echoing back the contents of the text frame

This is caused by concurrent modification of the current frame contents, that is passed by reference to the handlers. The concurrent modification happens [here](https://github.com/facebook/react-native/blob/main/Libraries/WebSocket/RCTSRWebSocket.m#L1162).

The bug was detected and fixed in the original SocketRocket repository in [this PR](https://github.com/facebookincubator/SocketRocket/pull/371). The relevant part of the fix is applied in this PR.

Resolves https://github.com/facebook/react-native/issues/30020.

## 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 WebSocket control frames having payloads longer than 125 bytes

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

Test Plan:
The bug is not easily and consistently reproduced, being a race condition.
We were able to reproduce it by connecting a react native app to a websocket server that sent ~100 pings per second and ~100 text frames per second. After a couple of seconds, the server receives an invalid pong message, with a payload equal to the payload of the text frame. The following is a node server that can replicate the problem on a react-native app running on iOS.

<details>

```
const { WebSocketServer } = require('ws');

const wss = new WebSocketServer({ port: 8080 });

wss.on('connection', function connection(ws) {
  const pingInterval = setInterval(() => {
    ws.ping();
  }, 10);

  const sendInterval = setInterval(() => {
    const arr = new Array(100);
    for (let i = 0; i < arr.length; i++) {
      arr[i] = Math.random();
    }
    ws.send('message with payload longer than 125 bytes: ' + arr.join(','));
  }, 10);

  ws.on('close', () => {
    clearInterval(pingInterval);
    clearInterval(sendInterval);
  });

  ws.on('error', (err) => {
    console.error(err);
    process.exit(1);
  });
});
```

</details>

Reviewed By: hramos

Differential Revision: D33486828

Pulled By: sota000

fbshipit-source-id: ba52958a584d633813e0d623d29b19999d0c617b
2022-01-20 13:56:26 -08:00
Ramanpreet Nara 0343e697fd Fix NVC for RCTTextInlineImage
Summary:
This diff fixes the Static/Native ViewConfigs for RCTTextInlineImage.

Changelog: [Internal]

Reviewed By: p-sun, sshic

Differential Revision: D33674127

fbshipit-source-id: 8cf5ffeaca635b4afd30c437dc0f87ea1fdc15a8
2022-01-20 13:52:03 -08:00
Eric Rozell 4a227ce2ab Add platformConfig to native animations and nodes (#32736)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/32736

The ability to pass an additional property bag to further configure NativeAnimated is useful for a few reasons, e.g., experimentation with multiple implementations of the NativeAnimated module.

The specific use case this solves is on react-native-windows, where there are two underlying animation graph options, one "optimized" animation graph that uses UI.Composition, and another similar to the approach to iOS and Android that uses a frame rendering callback.

The platform configuration can be supplied to the animation node when `useNativeDriver` is set to `true`, and we pass the platform configuration object to the connected AnimatedValue and all it's children.

Changelog:
[General][Added] - Option to supply `platformConfig` to NativeAnimated

Reviewed By: yungsters

Differential Revision: D32988285

fbshipit-source-id: ab8a7bbf197573fc9e9a4737c255f124321295ac
2022-01-19 19:45:21 -08:00
Brad Zacher c0e489b729 remove duplicate class members
Summary:
Flow currently allows duplicate members on classes. At runtime the "last" member wins out and all previous values for the member are discarded.
This diff manually removes duplicate members, and fixes resulting flow errors by converting methods to arrow function properties.

Reviewed By: pieterv

Differential Revision: D33664966

fbshipit-source-id: 0f712ac96af4df593c0918fcbadd70624ddde4a6
2022-01-19 15:35:57 -08:00
Andrei Shikov 0a5481924c React Native sync for revisions fe905f1...51947a1
Summary:
This sync includes the following changes:
- **[51947a14b](https://github.com/facebook/react/commit/51947a14b )**: Refactored how React/DevTools log Timeline performance data ([#23102](https://github.com/facebook/react/pull/23102)) //<Brian Vaughn>//
- **[c09596cc6](https://github.com/facebook/react/commit/c09596cc6 )**: Add RN_FB bundles for react-is ([#23101](https://github.com/facebook/react/pull/23101)) //<Moti Zilberman>//
- **[9a7e6bf0d](https://github.com/facebook/react/commit/9a7e6bf0d )**: Add --no-show-signature to "git show" commands ([#23038](https://github.com/facebook/react/pull/23038)) //<Stefan Sundin>//
- **[2f26eb85d](https://github.com/facebook/react/commit/2f26eb85d )**: Add exports field to react-refresh's package.json ([#23087](https://github.com/facebook/react/pull/23087)) //<Gray Zhang>//
- **[811634762](https://github.com/facebook/react/commit/811634762 )**: add enableTransitionTracing feature flag ([#23079](https://github.com/facebook/react/pull/23079)) //<Luna Ruan>//

Changelog:
[General][Changed] - React Native sync for revisions fe905f1...51947a1

jest_e2e[run_all_tests]

Reviewed By: rickhanlonii, kacieb

Differential Revision: D33634332

fbshipit-source-id: a83b663a122a2cb79225ca33a007fe1774728c03
2022-01-18 20:09:38 -08:00
Gabriel Donadel Dall'Agnol 0cc80b4d0c fix: KeyboardAvoidingView _updateBottomIfNecessary typo (#32894)
Summary:
While working on a fix for https://github.com/facebook/react-native/issues/29974 I notice that the `_updateBottomIfNecessary` function inside `KeyboardAvoidingView` was misspelled, so I decided to open a PR fixing it.

## Changelog

[General] [Fixed] - Fix typo in _updateBottomIfNecessary function on KeyboardAvoidingView component

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

Test Plan: Shouldn't require much testing as this is just renaming a private function of `KeyboardAvoidingView`

Reviewed By: philIip

Differential Revision: D33620554

Pulled By: cortinico

fbshipit-source-id: 69b8969bef09cf58b9b1c8a9154dc52686187f8a
2022-01-17 11:36:57 -08:00
Ramanpreet Nara 28f5abc717 Fix NVC for RCTSlider
Summary:
## Android Failures
```
LOG  SVC RCTSlider Invalid
 LOG  {
  "missing": {
    "directEventTypes": {
      "topSlidingComplete": {
        "registrationName": "onSlidingComplete"
      }
    }
  },
  "unexpected": {
    "bubblingEventTypes": {
      "paperValueChange": {
        "phasedRegistrationNames": {
          "captured": "onValueChangeCapture",
          "bubbled": "onValueChange"
        }
      },
      "topValueChange": {
        "phasedRegistrationNames": {
          "captured": "onValueChangeCapture",
          "bubbled": "onValueChange"
        }
      }
    },
    "directEventTypes": {
      "paperSlidingComplete": {
        "registrationName": "onSlidingComplete"
      }
    },
    "validAttributes": {
      "disabled": true,
      "maximumTrackImage": {
        "process": "[Function resolveAssetSource]"
      },
      "minimumTrackImage": {
        "process": "[Function resolveAssetSource]"
      },
      "thumbImage": {
        "process": "[Function resolveAssetSource]"
      },
      "trackImage": {
        "process": "[Function resolveAssetSource]"
      }
    }
  },
  "unequal": {}
}
```

## iOS Failures
```
 LOG  SVC RCTSlider Invalid
 LOG  {
  "missing": {},
  "unexpected": {
    "bubblingEventTypes": {
      "paperValueChange": {
        "phasedRegistrationNames": {
          "captured": "onValueChangeCapture",
          "bubbled": "onValueChange"
        }
      }
    },
    "directEventTypes": {
      "paperSlidingComplete": {
        "registrationName": "onSlidingComplete"
      }
    },
    "validAttributes": {
      "enabled": true
    }
  },
  "unequal": []
}
```

Reviewed By: yungsters

Differential Revision: D33409401

fbshipit-source-id: 519b6e35246e6671dbea1f374435d92937d96c1d
2022-01-14 16:31:50 -08:00
Ramanpreet Nara 4ac209ca1d Fix NVC for RCTMap
Summary: Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D33354718

fbshipit-source-id: 76f837a552c043be75933eea018e0db8ee1ae238
2022-01-14 16:31:50 -08:00
Paige Sun 5e07347948 6/6 Style: Improve flow typing for UIManagerInjection
Summary: Changelog: [JS] Style: Improve flow typing for UIManagerInjection for static view configs

Reviewed By: yungsters

Differential Revision: D33522890

fbshipit-source-id: 4b0d4da4932473e2316abf25b00896c33f285b63
2022-01-14 13:44:57 -08:00
Marshall Roch 66dc211436 truncate JSTimers errors array instead of making it nullable
Summary:
instead of `errors: ?Array<Error>` and setting it back to `null` to clear errors, which Flow is not very happy with, we can make it always an array and truncate it with `errors.length = 0`.

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D33584184

fbshipit-source-id: 81b424e69e60203c645bafbac12177ffcdc0c6ef
2022-01-14 09:06:56 -08:00
Ramanpreet Nara 0ee66889e0 Fix SVC for AndroidHorizontalScrollView
Summary:
## Failure
```
 LOG  {
  "missing": {
    "validAttributes": {
      "borderBottomLeftRadius": true,
      "borderRightColor": {
        "process": "[Function processColor]"
      },
      "borderRadius": true,
      "borderLeftColor": {
        "process": "[Function processColor]"
      },
      "borderColor": {
        "process": "[Function processColor]"
      },
      "borderTopRightRadius": true,
      "borderBottomColor": {
        "process": "[Function processColor]"
      },
      "borderTopColor": {
        "process": "[Function processColor]"
      },
      "borderStyle": true,
      "borderBottomRightRadius": true,
      "borderTopLeftRadius": true,
      "removeClippedSubviews": true
    }
  },
  "unexpected": {},
  "unequal": []
}
```

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D33341777

fbshipit-source-id: c44661411e690b4536d9e979b79f34e200c3720b
2022-01-11 14:22:15 -08:00
Ramanpreet Nara 5bc7b02fc7 Fix SVC for AndroidHorizontalScrollContentView
Summary:
## Failure
```
 LOG  SVC AndroidHorizontalScrollContentView Invalid
 LOG  {
  "missing": {
    "validAttributes": {
      "removeClippedSubviews": true
    }
  },
  "unexpected": {},
  "unequal": []
}
```

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D33341774

fbshipit-source-id: 8f287ba00252f8456ad642eaedf38fa3aa2a11ff
2022-01-11 14:22:15 -08:00
Ramanpreet Nara fcf01b8c7a Fix SVC for RCTImageView
Summary: Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D33341778

fbshipit-source-id: fb51664706febce570808b6018e98637d5f0d42a
2022-01-11 14:22:15 -08:00
Ramanpreet Nara 067bcb5325 Fix SVC for RCT{Multiline,Singleline}TextInput
Summary:
See title.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D33341775

fbshipit-source-id: be1c876375b1106d51e871805c23d345906b4631
2022-01-11 14:22:14 -08:00
Ramanpreet Nara 9022849505 Fix SVC for RCTScrollView
Summary:
## Failure
```
 LOG  SVC RCTScrollView Invalid
 LOG  {
  "missing": {
    "validAttributes": {
      "borderBottomLeftRadius": true,
      "borderRightColor": {
        "process": "[Function processColor]"
      },
      "borderRadius": true,
      "borderLeftColor": {
        "process": "[Function processColor]"
      },
      "borderColor": {
        "process": "[Function processColor]"
      },
      "borderTopRightRadius": true,
      "borderBottomColor": {
        "process": "[Function processColor]"
      },
      "borderTopColor": {
        "process": "[Function processColor]"
      },
      "borderStyle": true,
      "borderBottomRightRadius": true,
      "borderTopLeftRadius": true,
      "removeClippedSubviews": true
    }
  },
  "unexpected": {
    "directEventTypes": {
      "topScrollToTop": {
        "registrationName": "onScrollToTop"
      }
    },
    "validAttributes": {
      "alwaysBounceHorizontal": true,
      "alwaysBounceVertical": true,
      "automaticallyAdjustContentInsets": true,
      "automaticallyAdjustKeyboardInsets": true,
      "automaticallyAdjustsScrollIndicatorInsets": true,
      "bounces": true,
      "bouncesZoom": true,
      "canCancelContentTouches": true,
      "centerContent": true,
      "contentInset": {
        "diff": "[Function pointsDiffer]"
      },
      "contentInsetAdjustmentBehavior": true,
      "directionalLockEnabled": true,
      "indicatorStyle": true,
      "inverted": true,
      "keyboardDismissMode": true,
      "maintainVisibleContentPosition": true,
      "maximumZoomScale": true,
      "minimumZoomScale": true,
      "onMomentumScrollBegin": true,
      "onMomentumScrollEnd": true,
      "onScroll": true,
      "onScrollBeginDrag": true,
      "onScrollEndDrag": true,
      "onScrollToTop": true,
      "pinchGestureEnabled": true,
      "scrollEventThrottle": true,
      "scrollIndicatorInsets": {
        "diff": "[Function pointsDiffer]"
      },
      "scrollToOverflowEnabled": true,
      "scrollsToTop": true,
      "showsHorizontalScrollIndicator": true,
      "zoomScale": true
    }
  },
  "unequal": []
}
```

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D32225225

fbshipit-source-id: 0f236256dcbcab4fe66165b5e36df2b5f785d94e
2022-01-11 14:22:14 -08:00
grgr-dkrk 36037fa81b feat: add `accessibilityLabelledBy` props (#32470)
Summary:
related: https://github.com/facebook/react-native/issues/30846, https://github.com/facebook/react-native/issues/26739

Added `accessibilityLabelledBy` props to find the nativeID of the associated label, it mainly for` <TextInput> `.

The reason for implementing it as `labelledBy` instead of `labelFor` is as follows.
- It was difficult to find a component with `labelFor` because the `<Text>` component does not add the `labelFor` received from her Props to the View's tag.
- The use case looks like the HTML `aria-labelledby`, which is intuitive for web developers. It also seems easy to convert to a web platform.

## 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] [Added] - add `accessibilityLabelledBy` props

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

Test Plan:
I checked it with RNTester using an Android11.

https://user-images.githubusercontent.com/40130327/138666856-891d9f4d-52cf-4181-a81f-13b033037db4.mp4

Reviewed By: lunaleaps, kacieb

Differential Revision: D31897112

Pulled By: ShikaSD

fbshipit-source-id: 66361735679560c01834b3a4483adf264098b3e3
2022-01-11 06:51:39 -08:00
Ramanpreet Nara 8487470476 Fix SVC for AndroidTextInput
Summary:
## SVC != NVC Failure
```
 LOG  SVC AndroidTextInput Invalid
 LOG  {
  "missing": {
    "validAttributes": {
      "borderBottomLeftRadius": true,
      "borderBottomColor": {
        "process": "[Function processColor]"
      },
      "borderRightColor": {
        "process": "[Function processColor]"
      },
      "borderLeftColor": {
        "process": "[Function processColor]"
      },
      "borderTopRightRadius": true,
      "borderColor": {
        "process": "[Function processColor]"
      },
      "borderBottomRightRadius": true,
      "borderRadius": true,
      "borderStyle": true,
      "borderTopColor": {
        "process": "[Function processColor]"
      },
      "borderTopLeftRadius": true
    }
  },
  "unexpected": {
    "validAttributes": {
      "autoCompleteType": true
    }
  },
  "unequal": []
}
```

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D33341773

fbshipit-source-id: a3c7f043d6b2ba0e2a4253739826e6f7f68e7ca5
2022-01-11 00:24:41 -08:00
Ramanpreet Nara cb3321e3b0 Refactor: Inline AndroidTextInputViewConfig
Summary:
Putting the static view config into its own file creates the uncertainty that n > 1 files import the static view config. This isn't true for AndroidTextViewConfig. So, let's just inline this static view config in the NativeComponent that uses it.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D33341776

fbshipit-source-id: 6fb710b8776d7b9276022c5226acefd7cf8395fb
2022-01-11 00:24:41 -08:00
Ramanpreet Nara 848e34e753 Fix SVC/NVC for AndroidDrawerLayout
Summary:
## Failures
```
 LOG  SVC AndroidDrawerLayout Invalid
 LOG  {
  "missing": {},
  "unexpected": {
    "directEventTypes": {
      "topDrawerOpened": {
        "registrationName": "onDrawerOpen"
      },
      "topDrawerClosed": {
        "registrationName": "onDrawerClose"
      }
    },
    "validAttributes": {
      "keyboardDismissMode": true,
      "drawerBackgroundColor": {
        "process": "[Function processColor]"
      },
      "statusBarBackgroundColor": {
        "process": "[Function processColor]"
      }
    }
  },
  "unequal": []
}
```

Changelog: [Internal]

Reviewed By: JoshuaGross

Differential Revision: D33409393

fbshipit-source-id: 9fa5b6cd5c8fc9bc01d825eb8fb7965c5cb691d2
2022-01-11 00:24:41 -08:00
Paige Sun b3a34194c0 5/5 Hook up Bridgeless' UIManager.hasViewManagerConfig with Fabric's native component registry
Summary:
Allow JS to detect if a native UI component is registered to `RCTComponentViewFactory.mm` with JS `UIManager.hasViewManagerConfig(componentName)`.

Fyi, `UIManager.js` is
- `DummyUIManager.js` for Bridgeless,
- `LazyUIManager.js` for Fabric with SVC enabled,
- and `PaperUIManager.js`. for Fabric with SVC disabled.

# How it works in Bridgeless
- `DummyUIManager.hasViewManagerConfig()` checks whether a component exists in the binary. It is hooked up to `unstable_hasComponent()`,
- which is hooked up to the native function `RCTInstallNativeComponentRegistryBinding()`,
- which returns whether a component has been registered to `RCTComponentViewFactory`
- (and also registers the native component if hasn't been registered yet).

Changelog: [Bridgeless][JS] Hook up Venice's UIManager.hasViewManagerConfig with Fabric's native component registry

Reviewed By: RSNara

Differential Revision: D33511659

fbshipit-source-id: 14519378ce3e4247516fcf5a6f83a82aa87c7919
2022-01-10 17:26:37 -08:00
Paige Sun a620d7dc85 4/5 Minor: Move unstable_hasComponent out of NativeComponentRegistry
Summary:
Without moving this, we would get this warning about a require cycle on the next diff, because DummyUIManager and LazyUIManager both need unstable_hasComponent.

```
(NOBRIDGE) WARN  Require cycle: react-native-github/Libraries/NativeComponent/NativeComponentRegistry.js -> react-native-github/Libraries/ReactNative/UIManager.js -> react-native-github/Libraries/ReactNative/DummyUIManager.js -> react-native-github/Libraries/NativeComponent/NativeComponentRegistry.js

Require cycles are allowed, but can result in uninitialized values. Consider refactoring to remove the need for a cycle.
```

Changelog: [Internal]

Reviewed By: philIip, RSNara

Differential Revision: D33511566

fbshipit-source-id: fd8c9732408d08ab17335273f86168bf30747929
2022-01-10 17:26:37 -08:00
Kacie Bawiec 85ecb0043f React Native sync for revisions a049aa0...fe905f1
Summary:
This sync includes the following changes:
- **[fe905f152](https://github.com/facebook/react/commit/fe905f152 )**: Update package.json ([#22954](https://github.com/facebook/react/pull/22954)) //<Jack Works>//
- **[3dc41d8a2](https://github.com/facebook/react/commit/3dc41d8a2 )**: fix: parseExportNamesInto specifiers typo ([#22537](https://github.com/facebook/react/pull/22537)) //<btea>//
- **[bd0a5dd68](https://github.com/facebook/react/commit/bd0a5dd68 )**: #22988 - Fix Bug: license header in React 18 bundles contains vundefined ([#23004](https://github.com/facebook/react/pull/23004)) //<Vitalie>//
- **[ceee524a8](https://github.com/facebook/react/commit/ceee524a8 )**: Remove unnecessary clearContainer call ([#22979](https://github.com/facebook/react/pull/22979)) //<Sebastian Markbåge>//
- **[cd1a3e9b5](https://github.com/facebook/react/commit/cd1a3e9b5 )**: Build both a partial renderer and fizz renderer of the legacy API for FB ([#22933](https://github.com/facebook/react/pull/22933)) //<Sebastian Markbåge>//

Changelog:
[General][Changed] - React Native sync for revisions a049aa0...fe905f1

jest_e2e[run_all_tests]

Reviewed By: rickhanlonii

Differential Revision: D33512179

fbshipit-source-id: c2df06c8af6bb674ea0c5524538259e6d6d98f78
2022-01-10 14:30:56 -08:00
Paige Sun 6be46b0bb5 Comments only. Clarify a few Venice and SVC methods
Summary: Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D33468276

fbshipit-source-id: bcc62ba1e728bba2492dbbbb0e4569285effeca7
2022-01-07 17:41:55 -08:00
Paige Sun 9daae5a5f2 For Fabric with StaticViewConfigs, fix UIManager to use LazyUImanager, not PaperUIManager
Summary: Changelog: [JS] For Fabric with StaticViewConfigs, fix UIManager to use LazyUImanager, not PaperUIManager

Reviewed By: fkgozali

Differential Revision: D33459937

fbshipit-source-id: 4298be7e1e455856cbcf3162b100099cd8c9ce09
2022-01-07 16:16:16 -08:00
Pieter De Baets 78614de1cb Revert D32559015: Support setting hitSlop with single value (JS changes)
Differential Revision:
D32559015 (589b129581)

Original commit changeset: c0409e6e5dd9

Original Phabricator Diff: D32559015 (589b129581)

fbshipit-source-id: 91cfcc86582c4716fc531a73bd8e06dea1406abd
2022-01-05 14:06:54 -08:00
Ramanpreet Nara d016766303 Attach "default events" to all ViewConfigs
Summary:
## Context
Default events are only attached to the first-loaded component.

## Problem
This complicates SVC == NVC reconciliation:
- The Static ViewConfigs of all components contain these default events.
- The native ViewConfig of *only the first component that loads* has these default events.

## FAQ
**Question:** If default events were only attached to the first loaded component, how come all components could emit these default events?

In short, if one component declares an event, React Native can dispatch that event to **all** components:
1. The ReactFabric-dev renderer invokes [ReactNativeViewConfigRegistry.get](https://fburl.com/code/468l3zp7) to get the ViewConfig of a component.
2. ReactNativeViewConfigRegistry.get inserts a component's the Bubbling/Direct events into [two **global** maps: ReactNativeViewConfigRegistry.customBubblingEventTypes, ReactNativeViewConfigRegistry.customDirectEventTypes](https://www.internalfb.com/code/fbsource/[00ccc3c7a1b76e55986a6d753b8748327397e5eb]/xplat/js/react-native-github/Libraries/Renderer/shims/ReactNativeViewConfigRegistry.js?lines=20-34%2C57-72%2C117).
3. When the ReactFabric-dev renderer needs to dispatch events, it just [does a lookup on these two **global** maps](https://www.internalfb.com/code/fbsource/[2de1e1d59f6e0316868a6c4d9bca5fe673210106]/xplat/js/react-native-github/Libraries/Renderer/implementations/ReactFabric-dev.js?lines=2426%2C2439-2440) to create/dispatch the SyntheticEvents.

**Question:** Should we gate these changes?
This change should be safe to land without gating. This diff just creates duplicate entries for bubbling/direct events across components, which should [just get ignored by ReactNativeViewConfigRegistry](https://www.internalfb.com/code/fbsource/[4c57b02a0edccfd8a5fcc3a63ed2dd622efea320]/xplat/js/react-native-github/Libraries/Renderer/shims/ReactNativeViewConfigRegistry.js?lines=42%2C57-72%2C117).

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D33303417

fbshipit-source-id: fa777ca92e57b82eafb94f7d05ef4064ed5060ed
2022-01-04 16:04:16 -08:00
Pieter De Baets 589b129581 Support setting hitSlop with single value (JS changes)
Summary:
JS changes to support D32138347 (a96bdb7154)

Changelog: [Android][Fixed] Enable hitSlop to be set using a single number.

Reviewed By: yungsters

Differential Revision: D32559015

fbshipit-source-id: c0409e6e5dd95b35a2a4605b16cfb48104be2858
2022-01-04 10:39:43 -08:00
Andres Suarez 8bd3edec88 Update copyright headers from Facebook to Meta
Reviewed By: aaronabramov

Differential Revision: D33367752

fbshipit-source-id: 4ce94d184485e5ee0a62cf67ad2d3ba16e285c8f
2021-12-30 15:11:21 -08:00
Samuel Susla 8c6a98400e Introduce TextInput.onChangeSync
Summary:
changelog: [internal]

Add experimental `TextInput.onChangeSync` which delivers onChange event synchronously.

Reviewed By: ShikaSD

Differential Revision: D33188083

fbshipit-source-id: 1e1dcd0d71c7eec98d3d5f69967659e07ac4e6a6
2021-12-30 06:38:50 -08:00
David Vacca 3e8934b49b Enable ConcurrentRoot in RN VR apps
Summary:
This diff is a prototype to enable ConcurrentRoot in RN VR apps

changelog: [internal] internal

Reviewed By: sammy-SC

Differential Revision: D33200238

fbshipit-source-id: 45f700808cdc3a970bcddef858944e764a7260bd
2021-12-22 03:00:45 -08:00
Luna Wei a63fccc259 Remove unused eslint-disable
Summary: Changelog: [Internal] - Fix the eslint warning of an unused disable

Reviewed By: philIip

Differential Revision: D33201539

fbshipit-source-id: a0ad449f77facaacf85ecfdc6a95cf19100f1e77
2021-12-21 12:34:28 -08:00
Luna Wei 3204c55981 Remove usages of bump-oss-version from generated scripts
Summary: Changelog: [Internal] - Update the source of the changes in generated files, no longer bump-oss-version but set-rn-version

Reviewed By: sota000

Differential Revision: D33110408

fbshipit-source-id: 8cd5004f5d40dde82fe4d6271d5b8598cd27ca31
2021-12-17 18:37:37 -08:00
Panagiotis Vekris abbb4b5bb9 new-merge fixes
Summary:
Some final fixes to enable Flow [new-merge](https://fb.workplace.com/groups/floweng/permalink/7366473803401171/) mode.

Changelog: [internal]

Reviewed By: samwgoldman

Differential Revision: D33110844

fbshipit-source-id: 96755262af44e48269cd64473412ed0b6dd9cfcf
2021-12-14 20:39:14 -08:00
Kacie Bawiec 312efd01c8 React Native sync for revisions c1220eb...a049aa0
Summary:
This sync includes the following changes:
- **[f2a59df48](https://github.com/facebook/react/commit/f2a59df48 )**: Remove unstableAvoidThisFallback from OSS ([#22884](https://github.com/facebook/react/pull/22884)) //<salazarm>//
- **[24dd07bd2](https://github.com/facebook/react/commit/24dd07bd2 )**: Add custom element property support behind a flag ([#22184](https://github.com/facebook/react/pull/22184)) //<Joey Arhar>//
- **[72e48b8e1](https://github.com/facebook/react/commit/72e48b8e1 )**: Fix: Don't skip writing updated package.json //<Andrew Clark>//
- **[e39b2c899](https://github.com/facebook/react/commit/e39b2c899 )**: Fix peer deps for use-sync-external-store //<Andrew Clark>//
- **[ec78b135f](https://github.com/facebook/react/commit/ec78b135f )**: Don't override use-sync-external-store peerDeps ([#22882](https://github.com/facebook/react/pull/22882)) //<Andrew Clark>//
- **[5041c37d2](https://github.com/facebook/react/commit/5041c37d2 )**: Remove hydrate option from createRoot ([#22878](https://github.com/facebook/react/pull/22878)) //<salazarm>//
- **[3f9480f0f](https://github.com/facebook/react/commit/3f9480f0f )**: enable continuous replay flag ([#22863](https://github.com/facebook/react/pull/22863)) //<salazarm>//
- **[4729ff6d1](https://github.com/facebook/react/commit/4729ff6d1 )**: Implement identifierPrefix option for useId ([#22855](https://github.com/facebook/react/pull/22855)) //<Andrew Clark>//
- **[ed00d2c3d](https://github.com/facebook/react/commit/ed00d2c3d )**: Remove unused flag ([#22854](https://github.com/facebook/react/pull/22854)) //<Dan Abramov>//
- **[0cc724c77](https://github.com/facebook/react/commit/0cc724c77 )**: update ReactFlightWebpackPlugin to be compatiable with webpack v5 ([#22739](https://github.com/facebook/react/pull/22739)) //<Michelle Chen>//
- **[4e6eec69b](https://github.com/facebook/react/commit/4e6eec69b )**: fix: document can be `null`, not just `undefined` ([#22695](https://github.com/facebook/react/pull/22695)) //<Simen Bekkhus>//

Changelog:
[General][Changed] - React Native sync for revisions c1220eb...a049aa0

jest_e2e[run_all_tests]

Reviewed By: rickhanlonii

Differential Revision: D33062386

fbshipit-source-id: 37e497947efad5696c251096da8a92ccdc6dcea7
2021-12-14 09:26:09 -08:00
Gijs Weterings 34efaab3a8 Back out "Fix Static View Config for RCTView"
Summary: Changelog: [internal]

Reviewed By: arushikesarwani94

Differential Revision: D33042498

fbshipit-source-id: 42667f0fb17d502494139645a42dc54dea9904b7
2021-12-11 06:58:07 -08:00
Gijs Weterings 0c744dea56 Back out "Introduce a PlatformBaseViewConfig for all HostComponents"
Summary: Changelog: [Internal]

Reviewed By: arushikesarwani94

Differential Revision: D33042499

fbshipit-source-id: 603fbfa4e2f482c5d002532745a29170daded184
2021-12-11 06:58:07 -08:00
Ramanpreet Nara cab16352c7 Introduce a PlatformBaseViewConfig for all HostComponents
Summary:
## iOS
On iOS:
- All props come from ViewManagers
- All HostComponent ViewManagers extend <View/> ViewManager

https://pxl.cl/1SxdF

Therefore, it's safe to have all HostComponent Static View Configs extend <View/> Static View Config.

## Android

On Android, the model is a bit more complicated:

https://pxl.cl/1Vmp5

Takeaways:
- Props come from Shadow Nodes **and** ViewManagers
- Nearly all HostComponent ViewManagers extend BaseViewManager. But, that's not <View/>'s ViewManager.
- <View/>'s ViewManager is [ReactViewManager](https://fburl.com/code/0zalv8zk), which is a descendent of BaseViewManager, and declares its own ReactProps.

So, it's not safe to have all Android HostComponent Static View Configs to extend <View/>'s Static View Config:
1. No components actualy incorportate <View/>'s props
2. Some components don't even incorporate BaseViewManager's props.

## Changes
In this diff, I removed ReactNativeViewViewConfig, and introduced a new view config called PlatformBaseViewConfig. This ViewConfig partial will capture all the props available on all HostComponents on **both** platforms. This may not necessarily be the props made available on <View/>.

The only components that don't extend the base platform props are: RCTTextInlineImage. What we do with these components is TBD.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D32187832

fbshipit-source-id: 9a057abb3f58801615891c21e42ad4cfa5c69f21
2021-12-10 23:19:52 -08:00
Ramanpreet Nara 8f3e188426 Fix Static View Config for RCTView
Summary:
- Fix the StaticViewConfig violations for RCTView

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D32187835

fbshipit-source-id: c8c926817a9245b1e8671e5a2e8965ab7ffecace
2021-12-10 23:19:52 -08:00
Amy Huyen 9b0ed920ef Export flow type for ScrollView Deceleration Rate
Summary:
## Changelog:
[General] [Changed] Export Flow type for deceleration rate for use in other files to keep deceleration rate prop values consistently typed

Reviewed By: lunaleaps

Differential Revision: D32989199

fbshipit-source-id: 2e2fef0721de0d0eb60aaefdbb635788bfc8c1f1
2021-12-10 11:43:08 -08:00
Eric Rozell fe53cae954 Deduct offset from `getValue` result when detaching
Summary:
The NativeAnimated `getValue` API returns `value + offset`:
Android:
iOS: https://github.com/facebook/react-native/blob/main/Libraries/NativeAnimation/Nodes/RCTValueAnimatedNode.m#L44
Android: https://github.com/facebook/react-native/blob/main/ReactAndroid/src/main/java/com/facebook/react/animated/ValueAnimatedNode.java#L36

When we store the value after detaching the NativeAnimated node, it stores the result of the NativeAnimated `getValue` call to the `_value` property, so if we call `__getValue` at some later point on the `AnimatedValue`, we will count the offset twice.

This change deducts the offset value from the result returned from `getValue` when storing the latest value.

Changelog:
[General][Fixed] - AnimatedValue.__detach should store getValue result with offset deducted

Reviewed By: yungsters

Differential Revision: D32987003

fbshipit-source-id: 488d1fe512f886c7a9de1e5a4de8f19441ebd81e
2021-12-10 08:07:38 -08:00
Eric Rozell 8ba771c3dd Fire `AnimatedValue.stopAnimation` callback with correct native value
Summary:
AnimatedValue fires a callback with the current value (raw value + offset) after calling it's `stopAnimation` method. The `_value` field on the `AnimatedValue` node is not necessarily kept in sync with the NativeAnimated value node, so the value provided to the callback may be out of sync.

This change checks if the `AnimatedValue` is a native node and passes the callback to the `NativeAnimatedAPI.getValue` callback, defaulting to the previous current JS node state if the node is not native.

Changelog:
[General][Fixed] - AnimatedValue.stopAnimation callback with correct value for NativeAnimated

Reviewed By: yungsters

Differential Revision: D32968572

fbshipit-source-id: b83f86eabe5456f762a15bc29cacb43f84513f6c
2021-12-09 11:40:13 -08:00
Samuel Susla f5f6fd70f2 Introduce TextInput.onKeyPressSync
Summary:
changelog: [internal]

Introduce a way to execute `onKeyPress` synchronously. This feature is experimental and will be changed in the future. It is not decided if marking native events as "sync" is going to be path forward with synchronous access.

NOTE: This is experimental API.

Reviewed By: ShikaSD

Differential Revision: D32882092

fbshipit-source-id: 68c66a9bb7c97758219e085c88a77f3c475c1eb3
2021-12-07 13:42:18 -08:00
Samuel Susla fcda1ac514 Add support for synchronous completeRoot
Summary:
changelog: [internal]

Exposes a new flag on RuntimeScheduler: `unstable_getIsSynchronous`. Flag indicates if the current code is run synchronously and therefore commit phase should be synchronous.

Unit tests will be added later, to keep this diff short. This code path is not executed yet.

Reviewed By: mdvacca, ShikaSD

Differential Revision: D32677814

fbshipit-source-id: e01d4fff7e716d627ff99fe104965851138c3aef
2021-12-07 12:11:24 -08:00
Ramanpreet Nara 39a35feff7 Fix uiViewClassName for TextInlineImageNativeComponent
Summary:
See title.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D32811821

fbshipit-source-id: 2c6fad21cd1e094162a12a4056ddeab948231c57
2021-12-06 15:44:23 -08:00
Marc Rousavy 49a1460a37 Feature: ScrollView `automaticallyAdjustKeyboardInsets` (#31402)
Summary:
Retrying D30015799 (6e903b07fa) with a fix where ScrollViewNativeComponent was missing the automaticallyAdjustKeyboardInsets prop.
----- Original Summary
Currently, ScrollViews provide the prop `keyboardDismissMode` which lets you choose `"interactive"`. However when the keyboard is shown, it will be rendered above the ScrollView, potentially blocking content.

With the `automaticallyAdjustKeyboardInsets` prop the ScrollView will automatically adjust it's `contentInset`, `scrollIndicatorInsets` and `contentOffset` (scroll Y) props to push the content up so nothing gets blocked.

* The animation curve and duration of the Keyboard is exactly matched.
* The absolute position of the ScrollView is respected, so if the Keyboard only overlaps 10 pixels of the ScrollView, it will only get inset by 10 pixels.
* By respecting the absolute position on screen, this automatically makes it fully compatible with phones with notches (custom safe areas)
* By using the keyboard frame, this also works for different sized keyboards and even `<InputAccessoryView>`s
* This also supports `maintainVisibleContentPosition` and `autoscrollToTopThreshold`.
* I also fixed an issue with the `maintainVisibleContentPosition` (`autoscrollToTopThreshold`) prop(s), so they behave more reliably when `contentInset`s are applied. (This makes automatically scrolling to new items fully compatible with `automaticallyAdjustKeyboardInsets`)

## Changelog

* [iOS] [Added] - ScrollView: `automaticallyAdjustKeyboardInsets` prop: Automatically animate `contentInset`, `scrollIndicatorInsets` and `contentOffset` (scroll Y) to avoid the Keyboard. (respecting absolute position on screen and safe-areas)
* [iOS] [Fixed] - ScrollView: Respect `contentInset` when animating new items with `autoscrollToTopThreshold`, make `automaticallyAdjustKeyboardInsets` work with `autoscrollToTopThreshold` (includes vertical, vertical-inverted, horizontal and horizontal-inverted ScrollViews)

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

Test Plan:
<table>
<tr>
<th>Before</th>
<th>After</th>
</tr>
<tr>
<td>

https://user-images.githubusercontent.com/15199031/115708680-9700aa80-a370-11eb-8016-e75d81a92cd7.MP4

</td>

<td>

https://user-images.githubusercontent.com/15199031/115708699-9b2cc800-a370-11eb-976f-c4010cd96d55.MP4

</td>
</table>

### "Why not just use `<KeyboardAvoidingView>`?"

<table>
<tr>
<th>Before (with <code>&lt;KeyboardAvoidingView&gt;</code>)</th>
<th>After (with <code>automaticallyAdjustKeyboardInsets</code>)</th>
</tr>
<tr>
<td>

https://user-images.githubusercontent.com/15199031/115708749-abdd3e00-a370-11eb-8e09-a27ffaef12b8.MP4

</td>

<td>

https://user-images.githubusercontent.com/15199031/115708777-b3044c00-a370-11eb-9b7a-e040ccb3ef8c.MP4

</td>
</table>

> Also notice how the `<KeyboardAvoidingView>` does not match the animation curve of the Keyboard

### Usage

```jsx
export const ChatPage = ({
  flatListProps,
  textInputProps
}: Props): React.ReactElement => (
  <>
    <FlatList
      {...flatListProps}
      keyboardDismissMode="interactive"
      automaticallyAdjustContentInsets={false}
      contentInsetAdjustmentBehavior="never"
      maintainVisibleContentPosition={{ minIndexForVisible: 0, autoscrollToTopThreshold: 100 }}
      automaticallyAdjustKeyboardInsets={true}
    />
    <InputAccessoryView backgroundColor={colors.white}>
      <ChatInput {...textInputProps} />
    </InputAccessoryView>
  </>
);
```

## Related Issues

* Fixes https://github.com/facebook/react-native/issues/31394
* Fixes https://github.com/facebook/react-native/issues/13073

Reviewed By: yungsters

Differential Revision: D32578661

Pulled By: sota000

fbshipit-source-id: 45985e2844275fe96304eccfd1901907dc4f9279
2021-12-06 13:31:13 -08:00
Liron Yahdav 771ca921b5 Add TextInput.setSelection method
Summary:
Adds a `setSelection` imperative method to `TextInput`.

Changelog:
[General][Added] - Adds a setSelection imperative method to TextInput

Reviewed By: JoshuaGross

Differential Revision: D32186514

fbshipit-source-id: 549a7d93b1c55363cf01d804b1e3d735e55c4481
2021-12-03 11:54:01 -08:00
Peter Carpenter 4d1357918a feat: support queuing accessibility announcements on ios (#32637)
Summary:
The current implementation of `AccessibilityInfo.announceForAccessibility` will immediately interrupt any existing in progress speech with the announcement. Sometimes this is desirable behaviour, but often you will want to wait until existing speech is finished before reading the new announcement. This change gives us that option.

My personal use case for this feature is a custom text input. When typing on iOS with voiceover enabled, each character is read out after being selected. I wanted to add some additional information after each character to help with the context of what has changed in the input, but I didn't want to override the reading of the character itself.

This feature is supported natively on iOS by constructing an `NSAttributedString` with the property [`accessibilitySpeechQueueAnnouncement`](https://developer.apple.com/documentation/foundation/nsattributedstring/key/2865770-accessibilityspeechqueueannounce), so this change just adds an extra parameter to `AccessibilityInfo.announceForAccessibility` which controls the value of that property on the native side. Adding this as an extra optional parameter with false as the default ensures that existing uses of the function won't be affected.

Unfortunately, this feature doesn't appear to be supported on Android, so the new second property will be iOS only.

## Changelog

[iOS] [Added] - add new argument to announceForAccessibility to allow queueing on iOS

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

Test Plan:
I've updated the `announceForAccessibility` section in RNTester with multiple buttons to demonstrate the difference between `queue: false` (default) and `queue: true` and show they work as intended.

Here's the expectation for each button:

- "Announce for Accessibility Immediately": on press, should start reading the button label, then be interrupted by the announcement
- "Announce for Accessibility Queued": on press, should read the button label then read the announcement afterwards
- "Announce for Accessibility Queue Multiple": on press, should read the button label, then read three announcements sequentially, no interruptions

You can see the realisation of those expectations in the following video recorded on an iPhone 12 running iOS 15.0.2:

https://user-images.githubusercontent.com/14826539/142770536-d57bfd69-eba5-444d-9c89-4bf4851ea062.mov

I've also tested the same way on an iPhone 8 running iOS 13.4 and it works exactly the same.

Reviewed By: yungsters

Differential Revision: D32637989

Pulled By: philIip

fbshipit-source-id: 3e90add523f11eb0eb34ea623211249263f257e2
2021-12-02 00:34:05 -08:00
Eric Rozell f3bf2e4f51 Add isPressable native prop to Text
Summary:
react-native-windows currently needs to maintain a fork of TextNativeComponent to wire through a native-only prop for `isPressable`.

The reason we do this on Windows is that we implement an optimization so we only attempt to hit test a virtual Text node if it is actually pressable, leading to significant perf improvement for pointer events (e.g., onMouseEnter / onMouseLeave) on Text.

Changelog:
[General][Added] - Native-only prop to optimize text hit testing on some RN platforms

Reviewed By: JoshuaGross

Differential Revision: D32564637

fbshipit-source-id: bf47c68d94a930d2c620cb3b1584355c5e412bd4
2021-11-30 21:55:39 -08:00
Andrei Shikov a596e98611 React Native sync for revisions c0c71a8...c1220eb
Summary:
This sync includes the following changes:
- **[c1220ebdd](https://github.com/facebook/react/commit/c1220ebdd )**: treat empty string as null ([#22807](https://github.com/facebook/react/pull/22807)) //<salazarm>//
- **[09d9b1775](https://github.com/facebook/react/commit/09d9b1775 )**: Update deprecated features in ESLint configuration files. ([#22767](https://github.com/facebook/react/pull/22767)) //<Esteban>//
- **[bddbfb86d](https://github.com/facebook/react/commit/bddbfb86d )**: Revert "Fix Node package.json ./ exports deprecation warning ([#22783](https://github.com/facebook/react/pull/22783))" ([#22792](https://github.com/facebook/react/pull/22792)) //<Sebastian Silbermann>//
- **[b831aec48](https://github.com/facebook/react/commit/b831aec48 )**: chore(fast-refresh): double check wasMounted ([#22740](https://github.com/facebook/react/pull/22740)) //<anc95>//
- **[8edeb787b](https://github.com/facebook/react/commit/8edeb787b )**: Fix Node package.json ./ exports deprecation warning ([#22783](https://github.com/facebook/react/pull/22783)) //<Rin Arakaki>//
- **[fdc1d617a](https://github.com/facebook/react/commit/fdc1d617a )**: Flag for client render fallback behavior on hydration mismatch ([#22787](https://github.com/facebook/react/pull/22787)) //<salazarm>//
- **[aa19d569b](https://github.com/facebook/react/commit/aa19d569b )**: Add test selectors to experimental build ([#22760](https://github.com/facebook/react/pull/22760)) //<Brian Vaughn>//
- **[520ffc77a](https://github.com/facebook/react/commit/520ffc77a )**: Use globalThis if possible for native fetch in browser build ([#22777](https://github.com/facebook/react/pull/22777)) //<Jiachi Liu>//
- **[afbc2d08f](https://github.com/facebook/react/commit/afbc2d08f )**: Remove unused react-internal/invariant-args ESLint rule. ([#22778](https://github.com/facebook/react/pull/22778)) //<Esteban>//
- **[ca94e2680](https://github.com/facebook/react/commit/ca94e2680 )**: Remove 'packages/shared/invariant.js' ([#22779](https://github.com/facebook/react/pull/22779)) //<Esteban>//
- **[83564712b](https://github.com/facebook/react/commit/83564712b )**: Move SuspenseList to experimental channel ([#22765](https://github.com/facebook/react/pull/22765)) //<Andrew Clark>//
- **[d4144e6e5](https://github.com/facebook/react/commit/d4144e6e5 )**: fix : grammatical typo for test description ([#22764](https://github.com/facebook/react/pull/22764)) //<Brijesh Prasad>//
- **[0b329511b](https://github.com/facebook/react/commit/0b329511b )**: chore: fix comment typo ([#22657](https://github.com/facebook/react/pull/22657)) //<Han Han>//
- **[e6f60d2ad](https://github.com/facebook/react/commit/e6f60d2ad )**: fix typos ([#22715](https://github.com/facebook/react/pull/22715)) //<180909>//

Changelog:
[General][Changed] - React Native sync for revisions c0c71a8...c1220eb

jest_e2e[run_all_tests]

Reviewed By: yungsters

Differential Revision: D32646433

fbshipit-source-id: c534ee7a17141634700c90fc2c7b34bfbe17887a
2021-11-29 04:37:28 -08:00
Phillip Pan b8f0e975b7 use NSInteger for NS_ENUM instead of NSUInteger
Summary:
as title

in practice, this doesn't make any difference, but this is to follow the apple recommendation and for us to have a more consistent codebase.

https://developer.apple.com/library/content/releasenotes/ObjectiveC/ModernizationObjC/AdoptingModernObjective-C/AdoptingModernObjective-C.html

>The NS_ENUM macro helps define both the name and type of the enumeration, in this case named UITableViewCellStyle of type NSInteger. The type for enumerations should be NSInteger.
>Like enumerations, the NS_OPTIONS macro defines both a name and a type. However, the type for options should usually be NSUInteger.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D32641990

fbshipit-source-id: 56e4cd44cdefe54f61c90844665a685ee2d6ffad
2021-11-24 15:45:23 -08:00
Jeffrey Hyer 9c5e177a79 Fix how KeyboardAvoidingView handles the onLayout prop. (#32609)
Summary:
Resolves https://github.com/facebook/react-native/issues/32608

This PR updates the `KeyboardAvoidingView` to correctly handle the `onLayout` prop.

## 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] - `onLayout` prop is handled correctly in `<KeyboardAvoidingView>`

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

Test Plan:
| Current Behavior with the `onLayout` prop specified | After applying fix |
|---|---|
| ![Simulator Screen Recording - iPhone 11 - 2021-11-17 at 14 44 09](https://user-images.githubusercontent.com/1406082/142287541-0dbcf137-4d72-4ab6-9367-ac42bdf5aed9.gif) | ![Simulator Screen Recording - iPhone 11 - 2021-11-17 at 14 44 28](https://user-images.githubusercontent.com/1406082/142287611-c7424a6c-b590-48f7-8d74-e96543eab41c.gif) |

Reviewed By: kacieb

Differential Revision: D32481315

Pulled By: philIip

fbshipit-source-id: 2f65440f4996152e4133211136f2920026149ee9
2021-11-23 18:15:35 -08:00
Jesse Katsumata 00bb2ba62d Fix Dead links to documents in the comments (#32619)
Summary:
Links under `reactnative.dev` that ended with `.html` lead to Page not found.
Fixed the url so that users get sent to the appropriate url.

## 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] - Fixed dead links in the comments.

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

Test Plan: - Changed links are accessible

Reviewed By: lunaleaps

Differential Revision: D32528978

Pulled By: cortinico

fbshipit-source-id: e039d18188371cf5240b37049e431329e28b1b8b
2021-11-22 03:31:10 -08:00
David Vacca 44143b50fd Update ViewConfigs to support onEnter/onExit/onMove events
Summary:
This diff updates the ViewConfigs in RN Android to add support for onEnter/onExit/onMove events.

Open questions:

- Should we just remove the override for RN VR: https://www.internalfb.com/code/ovrsource/[c82b81893393ad0c6f8c6e7f347e82bba39dc8cc]/arvr/js/libraries/reactvr/VrShellPanelLib/rn-support/setUpViewConfigOverrides.js

- Should we use w3c naming now (e.g. onPointerEnter / onPointerExit / onPointerMove) ? or should we migrate to it later? what would be the effort for VR to migrate now to onPointerEnter / onPointerExit / onPointerMove?

changelog: [Android][Changed] Add ViewConfigs to support onEnter/onExit/onMove events

Reviewed By: RSNara

Differential Revision: D32253129

fbshipit-source-id: 539d8672825c7f18f0b6a2570764a5988cd936bc
2021-11-19 15:48:14 -08:00
Phillip Pan b735cdf09d add scrollTo metadata RCTBackedTextInputViewProtocol
Summary:
fixing oncall issue: https://fb.workplace.com/groups/rn.support/permalink/7241260632589156/

in this diff, we add the properties to the native views that are needed for the `onScroll` event.

`UITextField` is not a `UIScrollView` unlike `UITextView`, so we need to add these dummy properties

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D32523147

fbshipit-source-id: 1d4f227f498fa1c333e2d6c457484b559ca18f7e
2021-11-19 11:41:26 -08:00
Genki Kondo f8fc90546c Fix reference URLs in Animated
Summary:
Fix reference URLs in Animated library

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D32507849

fbshipit-source-id: ec10202b0f07305e74c787d818fa1f288b775673
2021-11-17 20:35:19 -08:00
Andrei Shikov 55663ec99d React Native sync for revisions afcb9cd...c0c71a8
Summary:
This sync includes the following changes:
- **[c0c71a868](https://github.com/facebook/react/commit/c0c71a868 )**: Re-enable useMutableSource in internal RN ([#22750](https://github.com/facebook/react/pull/22750)) //<Ricky>//
- **[cb11155c8](https://github.com/facebook/react/commit/cb11155c8 )**: Add runtime type checks around module boundary code ([#22748](https://github.com/facebook/react/pull/22748)) //<Brian Vaughn>//
- **[a04f13d29](https://github.com/facebook/react/commit/a04f13d29 )**: react-refresh@0.11.0 //<Dan Abramov>//
- **[ff9897d23](https://github.com/facebook/react/commit/ff9897d23 )**: [React Refresh] support typescript namespace syntax ([#22621](https://github.com/facebook/react/pull/22621)) //<irinakk>//
- **[0ddd69d12](https://github.com/facebook/react/commit/0ddd69d12 )**: Throw on hydration mismatch and force client rendering if boundary hasn't suspended within concurrent root ([#22629](https://github.com/facebook/react/pull/22629)) //<salazarm>//
- **[c3f34e4be](https://github.com/facebook/react/commit/c3f34e4be )**: eslint-plugin-react-hooks@4.3.0 //<Dan Abramov>//
- **[827021c4e](https://github.com/facebook/react/commit/827021c4e )**: Changelog for eslint-plugin-react-hooks@4.3.0 //<Dan Abramov>//
- **[8ca3f567b](https://github.com/facebook/react/commit/8ca3f567b )**: Fix module-boundary wrappers ([#22688](https://github.com/facebook/react/pull/22688)) //<Brian Vaughn>//
- **[1bf6deb86](https://github.com/facebook/react/commit/1bf6deb86 )**: Renamed packages/react-devtools-scheduling-profiler to packages/react-devtools-timeline ([#22691](https://github.com/facebook/react/pull/22691)) //<Brian Vaughn>//
- **[51c558aeb](https://github.com/facebook/react/commit/51c558aeb )**: Rename (some) "scheduling profiler" references to "timeline" ([#22690](https://github.com/facebook/react/pull/22690)) //<Brian Vaughn>//
- **[00ced1e2b](https://github.com/facebook/react/commit/00ced1e2b )**: Fix useId in strict mode ([#22681](https://github.com/facebook/react/pull/22681)) //<Andrew Clark>//
- **[5cccacd13](https://github.com/facebook/react/commit/5cccacd13 )**: Upgrade useId to alpha channel ([#22674](https://github.com/facebook/react/pull/22674)) //<Andrew Clark>//
- **[75f3ddebf](https://github.com/facebook/react/commit/75f3ddebf )**: Remove experimental useOpaqueIdentifier API ([#22672](https://github.com/facebook/react/pull/22672)) //<Andrew Clark>//
- **[8c4a05b8f](https://github.com/facebook/react/commit/8c4a05b8f )**: Remove flow pragma comment from module registration start/stop templates ([#22670](https://github.com/facebook/react/pull/22670)) //<Brian Vaughn>//
- **[ebf9ae857](https://github.com/facebook/react/commit/ebf9ae857 )**: useId ([#22644](https://github.com/facebook/react/pull/22644)) //<Andrew Clark>//
- **[a0d991fe6](https://github.com/facebook/react/commit/a0d991fe6 )**: Re-land #22292 (remove uMS from open source build) ([#22664](https://github.com/facebook/react/pull/22664)) //<Andrew Clark>//
- **[6bce0355c](https://github.com/facebook/react/commit/6bce0355c )**: Upgrade useSyncExternalStore to alpha channel ([#22662](https://github.com/facebook/react/pull/22662)) //<Andrew Clark>//
- **[7034408ff](https://github.com/facebook/react/commit/7034408ff )**: Follow-up improvements to error code extraction infra ([#22516](https://github.com/facebook/react/pull/22516)) //<Andrew Clark>//
- **[90e5d3638](https://github.com/facebook/react/commit/90e5d3638 )**: chore: fix comment typo ([#22615](https://github.com/facebook/react/pull/22615)) //<btea>//
- **[3c4c1c470](https://github.com/facebook/react/commit/3c4c1c470 )**: Remove warning for dangling passive effects ([#22609](https://github.com/facebook/react/pull/22609)) //<Andrew Clark>//
- **[d5b6b4b86](https://github.com/facebook/react/commit/d5b6b4b86 )**: Expand act warning to cover all APIs that might schedule React work ([#22607](https://github.com/facebook/react/pull/22607)) //<Andrew Clark>//
- **[fa9bea0c4](https://github.com/facebook/react/commit/fa9bea0c4 )**: Initial implementation of cache cleanup ([#22510](https://github.com/facebook/react/pull/22510)) //<Joseph Savona>//
- **[0e8a5aff3](https://github.com/facebook/react/commit/0e8a5aff3 )**: Scheduling Profiler: Add marks for component effects (mount and unmount) ([#22578](https://github.com/facebook/react/pull/22578)) //<Brian Vaughn>//
- **[4ba20579d](https://github.com/facebook/react/commit/4ba20579d )**: Scheduling Profiler: De-emphasize React internal frames ([#22588](https://github.com/facebook/react/pull/22588)) //<Brian Vaughn>//
- **[cdb8a1d19](https://github.com/facebook/react/commit/cdb8a1d19 )**: [Fizz] Add option to inject bootstrapping script tags after the shell is injected ([#22594](https://github.com/facebook/react/pull/22594)) //<Sebastian Markbåge>//
- **[34e4c9756](https://github.com/facebook/react/commit/34e4c9756 )**: Clear extra nodes if there's a hydration mismatch within a suspense boundary  ([#22592](https://github.com/facebook/react/pull/22592)) //<Sebastian Markbåge>//
- **[02f411578](https://github.com/facebook/react/commit/02f411578 )**: Upgrade useInsertionEffect to stable ([#22589](https://github.com/facebook/react/pull/22589)) //<Andrew Clark>//
- **[2af4a7933](https://github.com/facebook/react/commit/2af4a7933 )**: Hydrate using SuspenseComponent as the parent ([#22582](https://github.com/facebook/react/pull/22582)) //<Sebastian Markbåge>//
- **[b1acff0cc](https://github.com/facebook/react/commit/b1acff0cc )**: Enable cache in test renderer ([#22580](https://github.com/facebook/react/pull/22580)) //<Joseph Savona>//
- **[996da67b2](https://github.com/facebook/react/commit/996da67b2 )**: Replace global `jest` heuristic with `IS_REACT_ACT_ENVIRONMENT` ([#22562](https://github.com/facebook/react/pull/22562)) //<Andrew Clark>//
- **[163e81c1f](https://github.com/facebook/react/commit/163e81c1f )**: Support disabling spurious act warnings with a global environment flag ([#22561](https://github.com/facebook/react/pull/22561)) //<Andrew Clark>//
- **[23b7dfeff](https://github.com/facebook/react/commit/23b7dfeff )**: Enable scheduling profiler for RN FB profiling builds ([#22566](https://github.com/facebook/react/pull/22566)) //<Brian Vaughn>//
- **[61455a25b](https://github.com/facebook/react/commit/61455a25b )**: Enable experimental Cache API in www TestRenderer ([#22554](https://github.com/facebook/react/pull/22554)) //<Joseph Savona>//
- **[7142d110b](https://github.com/facebook/react/commit/7142d110b )**: Bugfix: Nested useOpaqueIdentifier references ([#22553](https://github.com/facebook/react/pull/22553)) //<Andrew Clark>//
- **[1e247ff89](https://github.com/facebook/react/commit/1e247ff89 )**: Enabled scheduling profiler marks for React Native FB target ([#22544](https://github.com/facebook/react/pull/22544)) //<Brian Vaughn>//
- **[c16b005f2](https://github.com/facebook/react/commit/c16b005f2 )**: Update test and stack frame code to support newer V8 stack formats ([#22477](https://github.com/facebook/react/pull/22477)) //<Brian Vaughn>//
- **[55d75005b](https://github.com/facebook/react/commit/55d75005b )**: duplicate value in variable ([#22390](https://github.com/facebook/react/pull/22390)) //<BIKI DAS>//

Changelog:
[General][Changed] - React Native sync for revisions afcb9cd...c0c71a8

jest_e2e[run_all_tests]

Reviewed By: yungsters

Differential Revision: D32395873

fbshipit-source-id: 3afd158f167b1eedcc244e29aba1a2c502d3c9d9
2021-11-15 06:01:03 -08:00
Marcel Lasaj 9eb0881c8f fix(android): Updated TextInput prop types to accomodate for new autoComplete values (#32575)
Summary:
<!-- Explain the **motivation** for making this change. What existing problem does the pull request solve? -->
This fixes the "Failed prop type: Invalid prop `autoComplete` of value `[any-of-the-new-values]`" warning, as mentioned in https://github.com/facebook/react-native/issues/32557.

[This commit](d9e0ea77f0) introduced new HintConstants for autofill, but added those only to [`TextInput.js`](https://github.com/facebook/react-native/blob/main/Libraries/Components/TextInput/TextInput.js#L331) and forgot to add them (and the new docs' description) to either [`AndroidTextInputNativeComponent`](https://github.com/facebook/react-native/blob/main/Libraries/Components/TextInput/AndroidTextInputNativeComponent.js#L99) or [`DeprecatedTextInputPropTypes.js`](https://github.com/facebook/react-native/blob/main/Libraries/DeprecatedPropTypes/DeprecatedTextInputPropTypes.js#L67). I know, the latter has clearly been deprecated, but until it is actually being removed, it shouldn't throw warnings like that.

## 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] - Updated TextInput prop types to accomodate for new autoComplete values

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

Test Plan: There is no warning after these changes.

Reviewed By: yungsters

Differential Revision: D32324108

Pulled By: lunaleaps

fbshipit-source-id: df27cbbd54788f26471029c9201c6a27ca8b7893
2021-11-11 15:41:44 -08:00
Liron Yahdav f249d21da0 Native changes for TextInput.setSelection method
Summary:
Native changes in preparation for adding a `setSelection` imperative method to `TextInput`.

Changelog: [Internal]

Reviewed By: JoshuaGross

Differential Revision: D31590771

fbshipit-source-id: eed40d1c2803fec713f2008ab8053a2812249715
2021-11-11 13:35:46 -08:00
Gijs Weterings 5050e7eaa1 Pass testID down in Modal
Summary:
Changelog:
[General][Fixed] - Modal accepts a testID but didn't forward it to RCTModalHostView, therefore not making it show up for e2e tests depending on viewhierarchy.

Reviewed By: motiz88

Differential Revision: D32354377

fbshipit-source-id: 51df3a1f81c4b77240e83101b367b033ce98b0c7
2021-11-11 07:07:11 -08:00
Niklas Mischkulnig 91728e2266 Remove unused and incorrect type declarations (#32570)
Summary:
See https://github.com/facebook/react-native/pull/32566

This file doesn't have a `flow` comment, and the types that I removed here are incorrect anyway (missing a generic type parameter) because Flow didn't check them.

## 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 unused and incorrect type declarations in WebSocketInterceptor

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

Test Plan: See https://github.com/facebook/react-native/pull/32566

Reviewed By: lunaleaps

Differential Revision: D32315077

Pulled By: GijsWeterings

fbshipit-source-id: d3b826a01a0bb8e38380de5b79cb6b5d13db2ef1
2021-11-11 04:44:00 -08:00
Evan Yeung 037e346197 Add LTI annotations to xplat/js
Summary:
This diff runs the codemod to add type annotations to function parameters in preparation for Flow's local type inference (LTI) project. I ran the codemod over xplat/js and reverted any files that had flow errors in them. See the list of commands run to see the regeneration of various files.

Changelog:
[Internal][Changed] - Added type annotations

Reviewed By: yungsters

Differential Revision: D32075270

fbshipit-source-id: 6a9cd85aab120b4d9e690bac142a415525dbf298
2021-11-10 15:40:15 -08:00
Evan Yeung 83a1791991 Manually fix types for LTI annotations in xplat/js
Summary:
This diff makes the manual changes necessary to fix many of the errors in the stacked diff codemod.

See https://fb.workplace.com/groups/flowlang/posts/917522612186736 for details on this effort.

Reviewed By: bradzacher

Differential Revision: D31615035

fbshipit-source-id: 179b2df516833d59873b9003350f81eb4a6b4e9d
2021-11-10 15:40:15 -08:00
Niklas Mischkulnig 98abf1b02f Complete missing Flow declarations in URL (#32566)
Summary:
When transpiling flow with a Babel config like
```
{
	plugins:  [['babel/plugin-transform-flow-strip-types', {requireDirective: true}]]
}
```
all files containing Flow syntax need to have `flow` at the top of the file.
```
node_modules/react-native/Libraries/Blob/URL.js: A flow directive is required when using Flow annotations with the `requireDirective` option.
  55 |   _searchParams = [];
  56 |
> 57 |   constructor(params: any) {
     |                     ^^^^^
  58 |     if (typeof params === 'object') {
  59 |       Object.keys(params).forEach(key => this.append(key, params[key]));
  60 |     }
```

In URL, it was removed (mistakenly I think) by 63038500a2 (diff-552f9731d5c9bc329105a5f4224319966395e59b5bb23202b756c5d152e0f007). Only the `strict-local´ part should have been removed, not the whole line.

## 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] - Complete missing Flow declarations in URL

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

Test Plan: See above

Reviewed By: yungsters

Differential Revision: D32295816

Pulled By: lunaleaps

fbshipit-source-id: 1ad19a032e3399434f4e6a8eebbf37071a0f97be
2021-11-10 13:15:10 -08:00
Tim Yung 36bbd8fa31 RN: Eliminate Jest Log Spew
Summary:
Eliminates all of the console logs that appear when successfully running Jest tests for React Native.

Changelog:
[Internal]

Reviewed By: lunaleaps

Differential Revision: D32304619

fbshipit-source-id: 8bc8ef9337ae6af588238cec7cfb874ac6067340
2021-11-09 23:42:28 -08:00
Tim Yung 148c98ec80 RN: Resolve Outstanding ESLint Warnings
Summary:
Resolves outstanding ESLint warnings in React Native.

Changelog:
[Internal]

Reviewed By: lunaleaps

Differential Revision: D32291912

fbshipit-source-id: 61337d5a5a0e6ed55f732675e029f4b76d850af9
2021-11-09 21:46:21 -08:00
Tim Yung 10f9ab4d69 RN: Follow-up Format w/ Prettier v2.x
Summary:
When I upgraded React Native to Prettier v2.x, I removed `format` from a few files to reduce the number of changes.

This is a follow-up to bring back `format` and fix any remaining issues.

Changelog:
[Internal]

Reviewed By: zertosh

Differential Revision: D32287259

fbshipit-source-id: 37ea6d2c973b1db5d37c46d73675bdf436fb9a9d
2021-11-09 13:16:43 -08:00
Tim Yung 8880c09076 RN: Rename `Keyboard.remove{Event =>}Listener`
Summary:
Renames `Keyboard.removeEventListener` to `Keyboard.removeListener`.

When I implemented the compatibility layer in {D26589441 (035718ba97)}, I accidentally used the wrong name. Since `Keyboard.removeEventListener` was always deprecated, this removes it completely.

Changelog:
[General][Changed] - Rename deprecated `Keyboard.removeEventListener` to `Keyboard.removeListener`.

Reviewed By: lunaleaps

Differential Revision: D32282743

fbshipit-source-id: 309382af3269f85f781d38367d115a2ce3690efb
2021-11-09 12:57:40 -08:00
Rubén Norte 74b91c5073 Revert changes in RN preprocessor
Summary: Changelog: [General][Fixed] Revert changes in Jest preprocessor to fix tests in external projects

Reviewed By: yungsters

Differential Revision: D32250044

fbshipit-source-id: 0ed4c9f7bcfa82349b5c2ec7af2ccda970bbb0ef
2021-11-09 01:15:14 -08:00
Tim Yung 280e4ce4fe RN: Change `@{ => no}format` in React Files
Summary:
Instead of using `.prettierrc` to ignore the files sync'd from React, replace `format` with `noformat`.

This is necessary because currently, the version of Prettier used in React Native (v2.4.1) differs from the version used in React (v1.19.1). We can revert this when React is upgraded.

Changelog:
[Internal]

Reviewed By: ShikaSD

Differential Revision: D32129937

fbshipit-source-id: ca3b379edd732670a9a0b1b20b3f31bdad4b74aa
2021-11-09 00:33:12 -08:00
Tim Yung 32f36fe105 RN: Fix Prettier Formatting Errors (#32524)
Summary:
Ignores the `Libraries/Renderer/` directory of files which are synchronized from React (and should not be modified).

Also, formats some EventEmitter modules that for some reason were missed when I upgraded to Prettier v2.x.

## Changelog

[Internal]

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

Test Plan:
```
yarn run format-check
```

Reviewed By: javache

Differential Revision: D32129837

Pulled By: yungsters

fbshipit-source-id: 1cb42cec210508db499850e13f77beefdb35eb25
2021-11-09 00:33:12 -08:00
Ramanpreet Nara f1f88b02e8 Stop unnecessarily spreading ReactNativeViewViewConfig
Summary:
There's no need to spread ReactNativeViewViewConfig props into ViewConfig partials ourselves. createViewConfig does this for us:

https://www.internalfb.com/code/fbsource/[b319a947b3e5]/xplat/js/react-native-github/Libraries/NativeComponent/ViewConfig.js?lines=20-50

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D32187833

fbshipit-source-id: 6d7ea3fc808ccfc98e067f8f52334f7b3417d7a7
2021-11-09 00:29:13 -08:00
Ramanpreet Nara d29a6a116e Make sizesDiffer and matricesDiffer type-safe
Summary: Changelog: [Internal]

Reviewed By: philIip

Differential Revision: D32159547

fbshipit-source-id: 5223814cbb85c58219b99686b0b527768410e3ac
2021-11-09 00:29:13 -08:00
Ramanpreet Nara 73b243acbc Refactor: Make StaticViewConfigValidator.validate() output objects
Summary:
## Changes
- StaticViewConfigValidator.validate() now outputs a ValidationOutput object, that contains a Array<Differences>, if invalid
- The Difference type now contains the nativeValue and the staticValue. This makes the validate() function more useful in reconciling ViewConfigs.
- Nothing should change in NativeComponentRegistry.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D32139973

fbshipit-source-id: a9556fa370d2c14f9e5d0540b44824cd61773958
2021-11-09 00:29:13 -08:00