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

6736 Коммитов

Автор SHA1 Сообщение Дата
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
Ramanpreet Nara 36612a8060 Default {bubbling,direct}EventTypes to {} in Native VCs
Summary:
## Rationale
**Consistency with Static View Configs:** Static view config will default bubblingEventTypes or directEventTypesto to an empty object, if the any of them are undefined.

https://www.internalfb.com/code/fbsource/[a73d46ab4052838e46e0f3aab8508025795aec1f]/xplat/js/react-native-github/Libraries/NativeComponent/ViewConfig.js?lines=20-23%2C26-33%2C41%2C43-50

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D32159393

fbshipit-source-id: fefb3509b9b7c7374d2c3d8962afa5402daf6f72
2021-11-09 00:29:13 -08:00
Paige Sun 77ce91822d Minor Style: Make RCTNativeAnimatedNodesManager a non-null class
Summary:
For native animations,
* Add NS_ASSUME_NONNULL_BEGIN / END to RCTNativeAnimatedNodesManager since most of its params are nonnull.

* Explicitly mark nullable params.

Reviewed By: philIip

Differential Revision: D32209819

fbshipit-source-id: c881294d8ba8c2cdcaa931801c977cd5bbe764f4
2021-11-05 14:15:59 -07:00
Paige Sun 698a936e4d Minor Style: Make viewName nullable in native animated modules for Fabric
Summary:
Make viewName in native animations nullable, because viewName is not used when the RCTAnimationNode is managed by Fabric.

Changelog: [Internal] Minor: Make viewName nullable in native animated modules for Fabric

Reviewed By: philIip

Differential Revision: D32196270

fbshipit-source-id: 76d05dc7fd2850efb097f953ccd22fd3f6d80599
2021-11-05 14:15:58 -07:00
Paige Sun e9ed115bab Remove RCTUIManagerObserver from RCTNativeAnimatedTurboModule
Reviewed By: philIip

Differential Revision: D32115902

fbshipit-source-id: 27a35ff4b4dad5f6364af6b91a6de9e467c068d0
2021-11-05 14:15:58 -07:00
Andrei Shikov f0947a78af Back out "React Native sync for revisions afcb9cd...3fcd81d"
Summary: Changelog: [Internal] - Reverting React sync due to Recoil being broken

Reviewed By: yungsters

Differential Revision: D32148092

fbshipit-source-id: 276b33d3c9c9059472590cd6a987c2f5a658910c
2021-11-03 16:10:15 -07:00
Ramanpreet Nara d03b4f9ee2 Omit null process/diff functions from native VC attributes
Summary:
## Rationale
- **Consistency with Static View Configs**: In Static View Configs, if there isn't a diff or process function, we do not generate a property for it.
- **Type-safety**: The [Flow type for attributes](https://fburl.com/code/tafncg5c), doesn't allow null diff/process functions.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D32152924

fbshipit-source-id: 4156158c5fe09868feec1a0c55aa411d2bd72a27
2021-11-03 15:58:30 -07:00
Tim Yung fba1ae1643 RN: Temporarily Disable Prettier for Some Files
Summary:
We are in the middle of a Prettier upgrade and some of the files which disagree between Prettier v1.x and v2.x are now being flagged by `eslint-plugin-prettier` as lint errors.

The correct fix here is probably to update `eslint-config-prettier` and `eslint-plugin-prettier`, but I am landing this first to unbreak CI.

Reviewed By: mendoncakeegan

Differential Revision: D32129458

fbshipit-source-id: a5206a5ef58f1d7614f9459c99b9e39109be6de9
2021-11-02 23:09:38 -07:00
Tim Yung 77ecc7ede1 JS: Format with Prettier v2.4.1 [3/n]
Summary:
Changelog:
[General][Internal]

Reviewed By: zertosh

Differential Revision: D31883447

fbshipit-source-id: cbbf85e4bf935096d242336f41bf0cc5d6f92359
2021-11-02 22:14:16 -07:00