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

6844 Коммитов

Автор SHA1 Сообщение Дата
Kacie Bawiec 88021894f2 React Native sync for revisions 95d762e...e8feb11
Summary:
This sync includes the following changes:
- **[f4ac680c7](https://github.com/facebook/react/commit/f4ac680c7 )**: Fixed broken build script --unsafe-partial flag ([#22324](https://github.com/facebook/react/pull/22324)) //<Brian Vaughn>//
- **[67222f044](https://github.com/facebook/react/commit/67222f044 )**: [Experiment] Warn if callback ref returns a function ([#22313](https://github.com/facebook/react/pull/22313)) //<Dan Abramov>//
- **[263cfa6ec](https://github.com/facebook/react/commit/263cfa6ec )**: [Experimental] Add useInsertionEffect ([#21913](https://github.com/facebook/react/pull/21913)) //<Ricky>//
- **[806aaa2e2](https://github.com/facebook/react/commit/806aaa2e2 )**: [useSES shim] Import prefixed native API ([#22310](https://github.com/facebook/react/pull/22310)) //<Andrew Clark>//
- **[fd5e01c2e](https://github.com/facebook/react/commit/fd5e01c2e )**: [useSES/extra] Reuse old selection if possible ([#22307](https://github.com/facebook/react/pull/22307)) //<Andrew Clark>//
- **[33226fada](https://github.com/facebook/react/commit/33226fada )**: Check for store mutations before commit ([#22290](https://github.com/facebook/react/pull/22290)) //<Andrew Clark>//
- **[86c7ca70a](https://github.com/facebook/react/commit/86c7ca70a )**: Fix link ([#22296](https://github.com/facebook/react/pull/22296)) //<Konstantin Popov>//
- **[0fd195f29](https://github.com/facebook/react/commit/0fd195f29 )**: update error message to include useLayoutEffect or useEffect on bad e… ([#22279](https://github.com/facebook/react/pull/22279)) //<salazarm>//
- **[8f96c6b2a](https://github.com/facebook/react/commit/8f96c6b2a )**: [Bugfix] Prevent infinite update loop caused by a synchronous update in a passive effect ([#22277](https://github.com/facebook/react/pull/22277)) //<Andrew Clark>//
- **[4ce89a58d](https://github.com/facebook/react/commit/4ce89a58d )**: Test bad useEffect return value with noop-renderer ([#22258](https://github.com/facebook/react/pull/22258)) //<Sebastian Silbermann>//
- **[a3fde2358](https://github.com/facebook/react/commit/a3fde2358 )**: Detect subscriptions wrapped in startTransition ([#22271](https://github.com/facebook/react/pull/22271)) //<salazarm>//

Changelog:
[General][Changed] - React Native sync for revisions 95d762e...e8feb11

jest_e2e[run_all_tests]

Reviewed By: rickhanlonii

Differential Revision: D30966369

fbshipit-source-id: 6c88e591005deb1fd93493628ef4695add49186c
2021-09-22 10:10:44 -07:00
Luis Miguel Alvarado 64aa1e5ffe chore: removed unused files (#31465)
Summary:
All these files are unused

## Changelog

[JavaScript] [Removed] - chore: removed unused files

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

Test Plan: CI is passing

Reviewed By: yungsters

Differential Revision: D30653225

Pulled By: charlesbdudley

fbshipit-source-id: 30c646f10be382c4898a8e362176acc382eb9090
2021-09-20 02:23:26 -07:00
Jimmy Zhang be5372801a Pass accessibilityHint through Button component
Summary:
Changelog: [Internal]

Previously, the `accessibilityHint` value isn't passed through the underlying component so that the voice over system doesn't announce it. This diff fixes that.

Reviewed By: sammy-SC

Differential Revision: D31017275

fbshipit-source-id: 1bf5a5e36fdfed2a199986b82684a40e18325ba1
2021-09-17 17:23:22 -07:00
Kevin Gozali b0c8a4eee8 Link RCT-Folly against libc++abi
Summary:
Folly now depends on libc++abi. This solves linker error for RCT-Folly.podspec like this:

```
Undefined symbols for architecture arm64:
  "___cxa_increment_exception_refcount", referenced from:
      folly::exception_ptr_get_type(std::exception_ptr const&) in libRCT-Folly.a(Exception.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
```

See https://github.com/react-native-community/releases/issues/251

Note: RNTester was not affected by this bug for some reason, so the only way to verify is via the new app generated via `npx react-native init`.

Changelog: [Fixed][iOS] Unbreak Folly linker error

Reviewed By: lunaleaps

Differential Revision: D30950944

fbshipit-source-id: 3eb146e23faa308a02363761d08849d6801e21ca
2021-09-16 22:24:10 -07:00
Rick Hanlon 7f7f8188f2 React Native sync for revisions bd5bf55...95d762e
Summary:
This sync includes the following changes:
- **[95d762e40](https://github.com/facebook/react/commit/95d762e40 )**: Remove duplicate test //<Andrew Clark>//
- **[d4d1dc085](https://github.com/facebook/react/commit/d4d1dc085 )**: Reorder VARIANT feature flags ([#22266](https://github.com/facebook/react/pull/22266)) //<Dan Abramov>//
- **[2f156eafb](https://github.com/facebook/react/commit/2f156eafb )**: Adjust consoleManagedByDevToolsDuringStrictMode feature flag ([#22253](https://github.com/facebook/react/pull/22253)) //<Dan Abramov>//
- **[cfd819332](https://github.com/facebook/react/commit/cfd819332 )**: Add useSyncExternalStore to react-debug-tools ([#22240](https://github.com/facebook/react/pull/22240)) //<Andrew Clark>//
- **[8e80592a3](https://github.com/facebook/react/commit/8e80592a3 )**: Remove state queue from useSyncExternalStore ([#22265](https://github.com/facebook/react/pull/22265)) //<Andrew Clark>//
- **[06f98c168](https://github.com/facebook/react/commit/06f98c168 )**: Implement useSyncExternalStore in Fiber ([#22239](https://github.com/facebook/react/pull/22239)) //<Andrew Clark>//
- **[77912d9a0](https://github.com/facebook/react/commit/77912d9a0 )**: Wire up the native API for useSyncExternalStore ([#22237](https://github.com/facebook/react/pull/22237)) //<Andrew Clark>//
- **[031abd24b](https://github.com/facebook/react/commit/031abd24b )**: Add warning and test for useSyncExternalStore when getSnapshot isn't cached ([#22262](https://github.com/facebook/react/pull/22262)) //<salazarm>//
- **[b8884de24](https://github.com/facebook/react/commit/b8884de24 )**: break up import keyword to avoid being accidentally parsed as dynamic import statement in external code ([#21918](https://github.com/facebook/react/pull/21918)) //<Jianhua Zheng>//
- **[6d6bba5bf](https://github.com/facebook/react/commit/6d6bba5bf )**: Fix typo in ReactUpdatePriority-test.js ([#21958](https://github.com/facebook/react/pull/21958)) //<Ikko Ashimine>//
- **[0c0d1ddae](https://github.com/facebook/react/commit/0c0d1ddae )**: feat(eslint-plugin-react-hooks): support ESLint 8.x ([#22248](https://github.com/facebook/react/pull/22248)) //<Michaël De Boey>//
- **[1314299c7](https://github.com/facebook/react/commit/1314299c7 )**: Initial shim of useSyncExternalStore ([#22211](https://github.com/facebook/react/pull/22211)) //<Andrew Clark>//
- **[fc40f02ad](https://github.com/facebook/react/commit/fc40f02ad )**: Add consoleManagedByDevToolsDuringStrictMode feature flag in React Reconciler ([#22196](https://github.com/facebook/react/pull/22196)) //<Luna Ruan>//
- **[46a0f050a](https://github.com/facebook/react/commit/46a0f050a )**: Set up use-sync-external-store package ([#22202](https://github.com/facebook/react/pull/22202)) //<Andrew Clark>//
- **[8723e772b](https://github.com/facebook/react/commit/8723e772b )**: Fix a string interpolation typo in ReactHooks test ([#22174](https://github.com/facebook/react/pull/22174)) //<Matt Hargett>//
- **[60a30cf32](https://github.com/facebook/react/commit/60a30cf32 )**: Console Logging for StrictMode Double Rendering ([#22030](https://github.com/facebook/react/pull/22030)) //<Luna Ruan>//
- **[76bbad3e3](https://github.com/facebook/react/commit/76bbad3e3 )**: Add maxYieldMs feature flag in Scheduler ([#22165](https://github.com/facebook/react/pull/22165)) //<Ricky>//
- **[b0b53ae2c](https://github.com/facebook/react/commit/b0b53ae2c )**: Add feature flags for scheduler experiments ([#22105](https://github.com/facebook/react/pull/22105)) //<Ricky>//

Changelog:
[General][Changed] - React Native sync for revisions bd5bf55...95d762e

jest_e2e[run_all_tests]

Reviewed By: mdvacca

Differential Revision: D30809906

fbshipit-source-id: 131cfdf91e15f67fa59a5d925467e538ee89fe10
2021-09-10 17:28:55 -07:00
Tim Yung 504cbf1282 RN: Check `ReactSafeMobileConfig` Dependents for MobileConfig References
Summary:
Modifies `js1 build buckfiles` to also parse files that depend on `ReactSafeMobileConfig` for MobileConfig references.

That module was introduced in {D30470489}.

This fixes a bug where the MobileConfig reference in `ReactNativeInternalFeatureFlags` is not being correctly defined via Metro Buck.

Changelog:
[Internal]

Reviewed By: rickhanlonii

Differential Revision: D30815779

fbshipit-source-id: 156b0838fe47e7ab42c62258a1401875690813a6
2021-09-09 13:29:02 -07:00
Pieter De Baets 27dd2ecb70 Fix validation of AnimatedEvent with AnimatedValueXY
Summary: Changelog: [General][Fixed] Support Animated.ValueXY when validating Animated.event

Reviewed By: yungsters

Differential Revision: D30779011

fbshipit-source-id: 56f4d9eb6a20200584e5429a1693d0703f8c1a37
2021-09-09 04:31:58 -07:00
Ramanpreet Nara ddc4225dd4 Move NativeModule initialization logic outside of setModuleRegistry
Summary:
## Context
A while ago, we introduced a new initialization API in NativeModules via RCTInitializing.h (diff: D28435078 (9b45df1fce)).

## Problem
A number of our NativeModules still use setModuleRegistry to perform initialization.

## Changes
This diff migrates those NativeModules to instead use the initialize API.

## Motivation
In bridgeless mode each NativeModule object is [created and decorated by the RCTInstance](https://www.internalfb.com/code/fbsource/[89f6c0df78e453a20555975e06bc46b4e0d2bbe9]/fbobjc/Apps/Internal/Venice/Core/RCTInstance.mm?lines=180-189), while [holding the TurboModuleManagerDelegate mutex](https://www.internalfb.com/code/fbsource/[c50ce2bb3fb078d28e1f9afdef5e8793f1413472]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModuleManager.mm?lines=429%2C431). After D30753286, setModuleRegistry will be called in RCTInstance getModuleInstanceForClass, which means that we'll start calling setModuleRegistry while holding the TurboModuleManagerDelegate lock. This leads to a deadlock, because calling setModuleRegistry on RCTDeviceInfo [creates RCTAccessibilityManager](https://www.internalfb.com/code/fbsource/[89f6c0df78e453a20555975e06bc46b4e0d2bbe9]/xplat/js/react-native-github/React/CoreModules/RCTDeviceInfo.mm?lines=50), which tries to acquire the TurboModuleManagerDelegate lock again. The NativeModule initialize method isn't called while holding the TurboModuleManagerDelegate lock. That's why moving all initialization logic to the initialize method mitigates this deadlock hazard.

In general, we shouldn't do any sort of initialization inside setters for these bridge/bridgeless APIs. No other NativeModules do initialization outside of initialize.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D30754870

fbshipit-source-id: 7c2d50f995cba6f58ee2dfebfabd36f640579bcb
2021-09-08 12:46:35 -07:00
Meghnath Pillay b998e32501 removed default props for drawerBackgroundColor and fixed lint issues (#32162)
Summary:
Removed the deaultProps in the DrawerLayoutAndroid file and replaced it with a default value in case props are undefined.
## Changelog
[General] [Changed] - Remove defaultProps from the DrawerLayoutAndroid Component.�lunaleaps this is the fix for issue https://github.com/facebook/react-native/issues/31606

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

Test Plan: Ran test suite

Reviewed By: lunaleaps

Differential Revision: D30776242

Pulled By: cortinico

fbshipit-source-id: 51408acd92aecb8d725b0bbf39ddb059924481e5
2021-09-08 07:09:51 -07:00
wangqingyang a950634424 fix: compare the LogBoxData ignorePatterns with the right code (#31977)
Summary:
the `LogBoxData.addIgnorePatterns` function shows the wrong code to get a item in `Set`. because every item in `set.entries` looks like `[value, value]`, but not `value`.

while the `addIgnorePatterns` function evalutes two itertaions that is not necessary. So I refacted this function.

## 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] - for LogBox checking existingPattern in a wrong way.
[General] [Changed] - addIgnorePatterns runs in one iteration.
[General] [Added] - add a function `getIgnorePatterns` in `LogBoxData.js` for tests or other usecases.

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

Test Plan:
test codes in `LogBoxData-test.js`:
````js
it('adding same pattern multiple times', () => {
    expect(LogBoxData.getIgnorePatterns().length).toBe(0);
    LogBoxData.addIgnorePatterns(['abc']);
    expect(LogBoxData.getIgnorePatterns().length).toBe(1);
    LogBoxData.addIgnorePatterns([/abc/]);
    expect(LogBoxData.getIgnorePatterns().length).toBe(2);
    LogBoxData.addIgnorePatterns(['abc']);
    expect(LogBoxData.getIgnorePatterns().length).toBe(2);
    LogBoxData.addIgnorePatterns([/abc/]);
    expect(LogBoxData.getIgnorePatterns().length).toBe(2);
  });

  it('adding duplicated patterns', () => {
    expect(LogBoxData.getIgnorePatterns().length).toBe(0);
    LogBoxData.addIgnorePatterns(['abc', /ab/, /abc/, /abc/, 'abc']);
    expect(LogBoxData.getIgnorePatterns().length).toBe(3);
    LogBoxData.addIgnorePatterns([/ab/, /abc/]);
    expect(LogBoxData.getIgnorePatterns().length).toBe(3);
  });
````

and they have passed

Reviewed By: rickhanlonii

Differential Revision: D30675522

Pulled By: yungsters

fbshipit-source-id: 4a05e0f04a41d06cac416219f1e8e540bf0eea02
2021-09-07 12:00:19 -07:00
Janic Duplessis 7edf9274cf Fix keyboardDismissMode="on-drag" on Android (#31943)
Summary:
Fixes https://github.com/facebook/react-native/issues/23364

The current logic using `_isTouching` does not work because `_handleTouchCancel` is always called before scroll events begin. This means `_isTouching` is always false. To fix it I moved the logic to `_handleScrollBeginDrag` which is only called once when scroll drag beings. This accomplishes the expected behavior and is better than keeping it in onScroll where it would be called for each scroll event.

## Changelog

[Android] [Fixed] - Fix keyboardDismissMode="on-drag" on Android

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

Test Plan: Tested in an app that on-drag does not work before and works after this patch.

Reviewed By: sshic

Differential Revision: D30674276

Pulled By: yungsters

fbshipit-source-id: aa0bd605809fa01518f70fbf323c06e32c76ed1d
2021-09-02 13:20:04 -07:00
Aaron (Li Bo) Tao 4384c32aad revert to class component of ScrollViewStickyHeader
Summary:
Changelog:
[Internal][Changed] - revert to class component of ScrollViewStickyHeader. There is a redbox error during unmount in the functional version

Reviewed By: lunaleaps

Differential Revision: D30705974

fbshipit-source-id: b564c522b0026db0b334cc834a80bbbe9cd261e2
2021-09-02 03:30:46 -07:00
Samuel Susla 569c1cdce9 Remove unused property _rootTag RCTPropsAnimatedNode
Summary:
changelog: [internal]

`_rootTag` is never assigned to and never read, let's remove it.

Reviewed By: RSNara

Differential Revision: D30667860

fbshipit-source-id: f4b89ebe6b6d26559188b0e19682f5ac765d40b6
2021-09-01 10:27:31 -07:00
Tim Yung 65e58f26e1 RN: @react-native/normalize-color support Node.js
Summary:
Changes `react-native/normalize-color` to be useable from Node.js by making the following changes:

1. Rename `base.js` to `index.js` so importing is more convenient.
2. Move Flow definitions into a seprate library definition flow so `index.js` can be consumed directly.

I also made a few improvements to the actual implementation:

1. Avoid allocating `matchers` for non-strings.
2. Avoid allocating an object of all the color keywords. This will reduce memory usage (in exchange for slightly larger compiled bytecode).

Changelog:
[General][Changed] - react-native/normalize-color now supports Node.js

Reviewed By: lunaleaps

Differential Revision: D30595908

fbshipit-source-id: e6279e9ff815d8d1f489811187deabfdf53b8fbf
2021-09-01 01:26:56 -07:00
Joshua Gross cbe0e6bf27 Pass nativeTimestamp into PressabilityPerformanceEvent
Summary:
Pass nativeTimestamp into PressabilityPerformanceEvent as a way to uniquely identify events.

Changelog: [Internal]

Differential Revision: D30648544

fbshipit-source-id: 7cb0146f6ff1655f1312e5094535e59268fb2a22
2021-08-30 20:03:28 -07:00
Andrew Coates 49b3b31d8e Native component check in deprecatedPropType was inverted (#31164)
Summary:
While investigating an issue hit on a recent sync of [react-native-windows](https://github.com/microsoft/react-native-windows) I noticed that e68cf7cee9 appears to have accidently inverted the logic to avoid checking native components.

`!UIManager.getViewManagerConfig(componentName)`
become
`UIManager.hasViewManagerConfig(componentName)`
losing the !

Also adding a check in PaperUIManager's getViewManagerConfig to avoid trying to call a sync method when using Chrome Debugging.

## Changelog

[Internal] [Fixed] - Restored the previous logic of deprecatedPropType

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

Test Plan:
Change tested and being submitted in react-native-windows:
https://github.com/microsoft/react-native-windows/pull/7397

Reviewed By: hramos

Differential Revision: D30624302

Pulled By: fkgozali

fbshipit-source-id: 0f26e750283a1fa5eb5f44ecd2cf90617b6d931f
2021-08-30 18:03:27 -07:00
Genki Kondo a0d30b848a Remove unsupported values for android_hyphenationFrequency
Summary:
hyphenationStrategy must be one of one of Layout#HYPHENATION_FREQUENCY_NONE, Layout#HYPHENATION_FREQUENCY_NORMAL, Layout#HYPHENATION_FREQUENCY_FULL: (https://developer.android.com/reference/android/widget/TextView#setHyphenationFrequency(int))

Thus "high" and "balanced" are not only redundant, but actually don't do what the value indicates - Layout#BREAK_STRATEGY_BALANCED (constant value: 2) and Layout#BREAK_STRATEGY_HIGH_QUALITY (constant value: 1) are only meant to be used for android:breakStrategy

Changelog:
[Android][Changed] - Remove `"high"` and `"balanced"` as values for `android_hyphenationFrequency` on `Text`

Reviewed By: JoshuaGross

Differential Revision: D30531096

fbshipit-source-id: 1a0b6e733bb21ce6b2f104a2025a79c16de3cfea
2021-08-26 10:40:11 -07:00
Xuan Huang e60ad0837e Type more globals
Summary:
Changelog: [Internal]

This diff add types to some of the common globals so uses of
them through `global` are now typed.

All the globals are marked as read-only for their intented uses.
However, some of them do have write cites (mostly are in tests to
deliberately set up a special test environment). Those write cites
are considered as "necessary evil" and annotated as `FlowFixMe`.

Reviewed By: yungsters

Differential Revision: D30158145

fbshipit-source-id: 93a99063361a4b7a1e33d9fc97a661be30a4d8f9
2021-08-26 01:06:44 -07:00
Keion Anvaripour 8da6964d80 Refactor Image to log component stacktraces for images rendering non-fb sources
Summary:
This diff refactors the Image component in order to log the component hierarchy stacktraces for images rendering non-fb sources

Changelog: [Internal] internal

Reviewed By: fkgozali

Differential Revision: D30504483

fbshipit-source-id: 1e41a67d5b9643730360bce7e787ee3427d931e8
2021-08-25 16:41:50 -07:00
Andres Riveros Moya 7a770526c6 Remove DatePickerAndroid from react-native-github
Summary:
Changelog:
[JavaScript][Removed] - Remove DatePickerAndroid from React Native

Reviewed By: lunaleaps, yungsters

Differential Revision: D30281952

fbshipit-source-id: 5cd0ad2ad741afeef3e6f8a39635c6baf4b79b38
2021-08-25 13:38:25 -07:00
alessandro 2fb102b601 refactor: remove DefeaultProps from the DatePickerIOS component (#32064)
Summary:
Closes issue  https://github.com/facebook/react-native/issues/31605.
This is part of a bigger issue that plans to remove defaultProps from class components in order to provide a smoother transition to functional components.

## Changelog

[General] [Changed] - Remove defaultProps from the DatePickerIOS Component.
[General] [Test] - Added snapshot test for the new component

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

Test Plan: Compiled the rn-tester folder to check if the behavior is consistent with the previous versions.

Reviewed By: lunaleaps

Differential Revision: D30492515

Pulled By: yungsters

fbshipit-source-id: ed2c5f3211742d528ff3f8e406a53cd7ea43d7e7
2021-08-25 13:09:36 -07:00
Connor Tumbleson 2bcc6fac38 feat: add Android 12 BLUETOOTH_ADVERTISE to PermissionsAndroid (#32079)
Summary:
This PR adds BLUETOOTH_ADVERTISE, which showed up in the latest Android 12 Beta build as new `dangerous` permissions requiring approval for them.

https://developer.android.com/reference/android/Manifest.permission.html#BLUETOOTH_ADVERTISE

You can see the new set of `SCAN/ADVERTISE/CONNECT` added in this doc - https://developer.android.com/about/versions/12/features/bluetooth-permissions, previously SCAN/CONNECT were added in: https://github.com/facebook/react-native/pull/31488

## Changelog

[Android] [Changed] - Add BLUETOOTH_ADVERTISE to PermissionsAndroid

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

Test Plan:
```
PermissionsAndroid.BLUETOOTH_ADVERTISE === 'android.permission.BLUETOOTH_ADVERTISE'
```

Reviewed By: cortinico

Differential Revision: D30532656

Pulled By: yungsters

fbshipit-source-id: 986ad8cbfc27913df13ab24bba36f6e13104e7d9
2021-08-25 12:46:44 -07:00
Kacie Bawiec 7299cb485e React Native sync for revisions 424fe58...bd5bf55
Summary:
Post: https://fb.workplace.com/groups/rnsyncsquad/permalink/879923262900946/

This sync includes the following changes:
- **[fc3b6a411](https://github.com/facebook/react/commit/fc3b6a411 )**: Fix a few typos ([#22154](https://github.com/facebook/react/pull/22154)) //<Bowen>//
- **[986d0e61d](https://github.com/facebook/react/commit/986d0e61d )**: [Scheduler] Add tests for isInputPending ([#22140](https://github.com/facebook/react/pull/22140)) //<Andrew Clark>//
- **[d54be90be](https://github.com/facebook/react/commit/d54be90be )**: Set up test infra for dynamic Scheduler flags ([#22139](https://github.com/facebook/react/pull/22139)) //<Andrew Clark>//
- **[7ed0706d7](https://github.com/facebook/react/commit/7ed0706d7 )**: Remove the warning for setState on unmounted components ([#22114](https://github.com/facebook/react/pull/22114)) //<Dan Abramov>//
- **[9eb2aaaf8](https://github.com/facebook/react/commit/9eb2aaaf8 )**: Fixed ReactSharedInternals export in UMD bundle ([#22117](https://github.com/facebook/react/pull/22117)) //<Brian Vaughn>//
- **[bd255700d](https://github.com/facebook/react/commit/bd255700d )**: Show a soft error when a text string or number is supplied as a child to non text wrappers ([#22109](https://github.com/facebook/react/pull/22109)) //<Sota>//

Changelog:
[General][Changed] - React Native sync for revisions 424fe58...bd5bf55

jest_e2e[run_all_tests]

Reviewed By: yungsters

Differential Revision: D30485521

fbshipit-source-id: c5b92356e9e666eae94536ed31b8de43536419f8
2021-08-24 09:50:33 -07:00
Steven Bell ddf9a63acb fix typos in comments (#32061)
Summary:
Fixed some typos in the code comments.

## Changelog

[Internal] [Fixed] - Fixed typo in the comments

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

Test Plan: N/A

Reviewed By: javache

Differential Revision: D30482511

Pulled By: cortinico

fbshipit-source-id: ff67bc00d57972df88e41ee7a933259673de3aa2
2021-08-24 07:21:56 -07:00
Jimmy Zhang 11f8d9c7cd Add support for the UIAccessibilityTraitsTabBar
Summary:
Changelog:
Add the capability to set tabbar accessibilityRole which maps to the iOS's UIAccessibilityTraitsTabBar

Reviewed By: yungsters

Differential Revision: D30490752

fbshipit-source-id: f7561a8932306e133d2f65a5ab40ba0be3899ec3
2021-08-24 02:31:17 -07:00
Xuan Huang ff4b33672a Add Flow libdefs for HermesInternalType
Summary:
Changelog: [Internal]

This diff add a flow libdefs for the `HermesInternalType` to type
`HermesInternal` as the first accurately typed `global` property,
and filled all the type holes.

Reviewed By: yungsters

Differential Revision: D29986749

fbshipit-source-id: a94be7919f989b5085f6b264e55145a85020fea9
2021-08-24 00:12:21 -07:00
edenb-moveo 6c080167e6 Update ImageBackground.js (#32055)
Summary:
Currently ImageBackGround component has optional style props, but if you don't pass it as prop, it still "thinks" you pass style and crushes.
In this pr, I made width and height inside component to be optional so it won't crush.

## Changelog

[General] [Fix] - Changed ImageBackground's style so it won't crush.

[Screen Shot 2021-08-20 at 15 05 45](https://user-images.githubusercontent.com/62840630/130230568-be02b1a2-52ec-4f9d-b3d3-212552d3882b.png)

As you can see in this component, I tried to use ImageBackground without any style props, and my app crushes. Then I added style with empty object and the app didn't crush anymore, as you can see here:
![Screen Shot 2021-08-20 at 15 09 23](https://user-images.githubusercontent.com/62840630/130230932-a576c397-a910-4e40-a202-56482d83dd9c.png).

In conclusion, if we make width and height styles optionals inside ImageBackground component, it won't crush anymore.

Thoughts:
Maybe consider to make style props for this component none-optional because it isn't make any sense that image won't have any style at all.

Thanks ahead, that was my first pr, Eden Binyamin.

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

Reviewed By: charlesbdudley

Differential Revision: D30452297

Pulled By: sshic

fbshipit-source-id: b7071aa457dba443ed2f627c2458ea84fd24b36d
2021-08-20 23:37:18 -07:00
Jimmy Zhang f085e09be5 Passing the scheme field throughout all the metro connection pipeline to allow different scheme other than the default hardcoded http
Reviewed By: lunaleaps

Differential Revision: D30218490

fbshipit-source-id: 3832c731156a4f88ad1c55be0a0e4f68fa3e1d48
2021-08-19 10:28:49 -07:00
alessandro 5923ee50fc refactor: remove DefaultProps from the StatusBar Component (#31631)
Summary:
Issue https://github.com/facebook/react-native/issues/31607. defaultProps makes it difficult to migrate components to functional.

## Changelog

[General] [Changed] -  Remove defaultProps from the StatusBar Component.

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

Test Plan:
Verified the behaviour of the existing functionality after the removal on the RN Tester app.

https://user-images.githubusercontent.com/11355609/120085709-a2b35f80-c0da-11eb-94f2-2649270155ef.mov

Reviewed By: sota000

Differential Revision: D30259324

Pulled By: lunaleaps

fbshipit-source-id: 0c8841691198761589fdd029cab36629f7dfa757
2021-08-18 01:23:04 -07:00
Rick Hanlon aad9f3553b React Native sync for revisions 19092ac...5634ed1
Summary:
This sync includes the following changes:
- **[424fe5870](https://github.com/facebook/react/commit/424fe5870 )**: Revert "Show a soft error when a text string or number is supplied as a child to non text wrappers ([#21953](https://github.com/facebook/react/pull/21953))" ([#22108](https://github.com/facebook/react/pull/22108)) //<Sota>//
- **[aebf3b456](https://github.com/facebook/react/commit/aebf3b456 )**: [Scheduler] Check for continuous input events ([#22107](https://github.com/facebook/react/pull/22107)) //<Andrew Clark>//
- **[e9b2028b3](https://github.com/facebook/react/commit/e9b2028b3 )**: Show a soft error when a text string or number is supplied as a child to non text wrappers ([#21953](https://github.com/facebook/react/pull/21953)) //<Sota>//
- **[ecd73e17b](https://github.com/facebook/react/commit/ecd73e17b )**: Enable enableSuspenseLayoutEffectSemantics flag statically for Facebook ([#22050](https://github.com/facebook/react/pull/22050)) //<Brian Vaughn>//
- **[a8725a3e6](https://github.com/facebook/react/commit/a8725a3e6 )**: Scheduling profiler: Added lane labels and durations to React measures ([#22029](https://github.com/facebook/react/pull/22029)) //<Brian Vaughn>//

Changelog:
[General][Changed] - React Native sync for revisions 19092ac...5634ed1

jest_e2e[run_all_tests]

Reviewed By: kacieb

Differential Revision: D30225923

fbshipit-source-id: 562895d3e0d264f40770dadb89d4a16241967c4c
2021-08-16 20:35:28 -07:00
fabriziobertoglio1987 3560753559 Fix TextInput Cursor jumping to the right when the placeholder null (#28995)
Summary:
This issue fixes https://github.com/facebook/react-native/issues/28794 fixes https://github.com/facebook/react-native/issues/27658
Flow type ?Stringish allows to set the placeholder value to null. The null value causes the cursor to jump to the right in a TextInput. The fix replaces the placeholder null value with an empty string which avoid calling setHint(null) as causes the placeholder to jump to the right.

## 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] - avoid calling setHint with a null parameter causing cursor to jump to the right

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

Test Plan:
**<details><summary>CLICK TO OPEN TESTS RESULTS (28 May 2020 20a9473aaa330ad9b6e7a0b42ebd9c4ed41ce60b)</summary>**
<p>

More videos and information included in issue https://github.com/facebook/react-native/issues/28794
The below test cases are from the [following repository](https://github.com/fabriziobertoglio1987/AwesomeProject)

| **BEFORE** |
|:-------------------------:|
| <img src="https://user-images.githubusercontent.com/24992535/83123470-3e2f8000-a0d5-11ea-8718-11e6a0575a0c.gif" />|

| **AFTER** |
|:-------------------------:|
| <img src="https://user-images.githubusercontent.com/24992535/83123554-599a8b00-a0d5-11ea-9701-6557f0d76044.gif" />|

Extensive testing on `RNTester` did not identify any regression.

| **AFTER** |
|:-------------------------:|
| <img src="https://user-images.githubusercontent.com/24992535/83123586-628b5c80-a0d5-11ea-92eb-449d499dcc7d.gif" />|

</p>
</details>

**<details><summary>CLICK TO OPEN TESTS RESULTS (15 February 2021 20a9473aaa)</summary>**
<p>

| **BEFORE** |
|:-------------------------:|
| <video src="https://user-images.githubusercontent.com/24992535/107960803-5d44a980-6fa5-11eb-90e2-f0d665e35291.mp4" />|

| **AFTER** |
|:-------------------------:|
| <video src="https://user-images.githubusercontent.com/24992535/107960602-1f478580-6fa5-11eb-8f39-b985fafa6a6c.mp4" />|

</p>
</details>

Reviewed By: charlesbdudley

Differential Revision: D30095877

Pulled By: lunaleaps

fbshipit-source-id: 38a3e788443a22d48a4335063cd4315638bd8e97
2021-08-11 22:53:16 -07:00
jeswinsimon 27fec9569e Updated TextInput autoCompleteType prop to autoComplete 2/2 (#26010)
Summary:
Fix for bug https://github.com/facebook/react-native/issues/26003 Rename TextInput prop "autoCompleteType" to "autoComplete".

## Changelog

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

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

Test Plan: Sandcastle

Reviewed By: mdvacca

Differential Revision: D29795575

Pulled By: lunaleaps

fbshipit-source-id: 6eba7030968e9b7384529a43a6cd1b3c9e8b2a2c
2021-08-11 17:53:37 -07:00
Dmytro Voronkevych 899fa25d38 Documenting UserFlow.endFailure
Summary:
We had some confusion lately, where errorName was used to dump "error message". This caused problems in Scuba.
This doc should add some clarity on what is expected from endFailure users.

Changelog:
[Internal][Added] - Documentation for method in UserFlow.js class

Reviewed By: mityal

Differential Revision: D30192127

fbshipit-source-id: d057668aab714a9342131c83daf41cbe9372cb39
2021-08-11 02:52:53 -07:00
Samuel Susla beb3c2b538 Back out "Flush operations queue when animation starts in RCTNativeAnimatedModule"
Summary:
Changelog: [internal]

Original commit changeset: d3fc021dd434

Reviewed By: motiz88

Differential Revision: D30223203

fbshipit-source-id: 8edf79e109858855d13a36fabab2bcae36180df2
2021-08-10 09:48:38 -07:00
Samuel Susla f3374d0508 Flush operations queue when animation starts in RCTNativeAnimatedModule
Summary:
changelog: [internal]

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

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

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

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

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

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

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

Reviewed By: RSNara

Differential Revision: D30099010

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

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

Reviewed By: yungsters

Differential Revision: D30129658

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

## Changelog

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

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

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

Test Plan: Warning when user imports `StatusBarIOS`

Reviewed By: yungsters

Differential Revision: D30109324

Pulled By: lunaleaps

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

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

jest_e2e[run_all_tests]

Reviewed By: JoshuaGross

Differential Revision: D30092460

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

Changelog: [Internal]

Reviewed By: GijsWeterings

Differential Revision: D30047103

fbshipit-source-id: 4248a0f573c3b6facd25c7ae6ce007a357a1469b
2021-08-04 05:13:57 -07:00
Samuel Susla c39a4c7f2e Flush operations queue when animation starts
Summary:
changelog: [internal]

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

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

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

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

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

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

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

Reviewed By: JoshuaGross, p-sun

Differential Revision: D30053890

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

Changelog: [Internal]

Reviewed By: GijsWeterings

Differential Revision: D27967499

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

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

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

Reviewed By: JoshuaGross

Differential Revision: D30035911

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

## Changelog

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

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

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

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

Reviewed By: yungsters

Differential Revision: D29932940

Pulled By: GijsWeterings

fbshipit-source-id: bf97bb972964c585207e2450ccf71d932555e291
2021-08-03 03:15:42 -07:00
Xuan Huang d9a9ae38d1 Conditionalize the Regenerator Setup
Summary:
Changelog: [Internal]

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

This should save some work during the Core initialization.

Reviewed By: motiz88

Differential Revision: D29986751

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

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

Reviewed By: RSNara

Differential Revision: D29986750

fbshipit-source-id: 6e48e38d92ceccb35eead3c52e00e1eecb81b5b0
2021-08-02 19:43:04 -07:00
jeswinsimon 8066bc9ff6 Updated TextInput autoCompleteType prop to autoComplete 1/2 (#26010)
Summary:
Fix for bug https://github.com/facebook/react-native/issues/26003 Rename TextInput prop "autoCompleteType" to "autoComplete".

## Changelog

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

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

Test Plan:
Test Pass

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

Reviewed By: mdvacca

Differential Revision: D29980220

Pulled By: lunaleaps

fbshipit-source-id: 3c9e7d3250b5f95b0dbd523fdb0d917a039cd6a9
2021-07-30 03:16:35 -07:00
Michael Chow 1c87d4aee3 Update Dimension.js typo (#29858)
Summary:
preferred instead of preffered

## Changelog

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

[CATEGORY] [TYPE] - Message

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

Reviewed By: charlesbdudley

Differential Revision: D29998754

Pulled By: sota000

fbshipit-source-id: f13fef58e9154ddf8087944d53e022fb9afa6b1b
2021-07-29 17:26:01 -07:00
Ikko Ashimine 8b1b7f7126 Fix typo in VirtualizedList-test.js (#31756)
Summary:
occured -> occurred

## Changelog

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

[Internal] [Fixed] - Fixed typo in VirtualizedList-test.js

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

Test Plan: NONE

Reviewed By: lunaleaps

Differential Revision: D29975153

Pulled By: charlesbdudley

fbshipit-source-id: 966d90df0bf015b4a6a2e3b1bf88c66b61161a7a
2021-07-28 18:51:07 -07:00
Xuan Huang dc8d218077 Shim Immediate APIs when Promise is queueing to JSVM
Summary:
Changelog: [Internal]

Historically, Immediate API is implemented upon the React Native's
internal microtask-y queue (known as "immediate queue"), which
is the same queue Promise polyfill is operating on.

To make React Native suitable of using the built-in Promises from JSVMs,
which usually enqueues to the JSVM internal microtask queue and has no
access to React Native microtask-y queue, we need to migrate the
Immediate API to use the JSVM microtask queue as well to preserve the
semantics of code relies on the interleaving of promises and immediates.

To do that, this diff implement a shim layer for immediate APIs via the
new `global.queueMicrotask` API (which enqueues to JSVM) in JS, by wrapping
the immediate callback into a "microtask callback", which validate the
`immediate ID` against `clearedImmediate` Set before invoking it.

Reviewed By: RSNara

Differential Revision: D29845305

fbshipit-source-id: c2ed3fed426a5316b1e0dfbfaad51706d1765d4d
2021-07-28 13:37:54 -07:00
Xuan Huang be189cd819 Introduce queueMicrotask API
Summary:
Changelog:
[General][Added] - Add global.queueMicrotask

`queueMicrotask` is a relatively recent API defined in the WHATWG HTML spec
and it's been widely adopted by all web browsers and Node.js.

This diff introduced it to React Native by polyfilling it via a lazily-allocated
resolved Promise, or calling directly into a fast path provided by Hermes.

Reviewed By: RSNara

Differential Revision: D29838852

fbshipit-source-id: 8c4378b1b713fb8b0da5e67f92ba2ea9838766f7
2021-07-28 13:37:54 -07:00
Rick Hanlon d98ec75199 React Native sync for revisions cae6350...419cc9c
Summary:
This sync includes the following changes:
- **[419cc9c37](https://github.com/facebook/react/commit/419cc9c37 )**: Fix: Hide new/updated nodes in already hidden tree ([#21929](https://github.com/facebook/react/pull/21929)) //<Andrew Clark>//
- **[4758e4533](https://github.com/facebook/react/commit/4758e4533 )**: React Native: Export getInspectorDataForInstance API ([#21572](https://github.com/facebook/react/pull/21572)) //<Brian Vaughn>//
- **[ae5d26154](https://github.com/facebook/react/commit/ae5d26154 )**: Fix: LegacyHidden should not toggle effects ([#21928](https://github.com/facebook/react/pull/21928)) //<Andrew Clark>//
- **[9ab90de60](https://github.com/facebook/react/commit/9ab90de60 )**: Clean-up: Move Offscreen logic from Suspense fiber ([#21925](https://github.com/facebook/react/pull/21925)) //<Andrew Clark>//
- **[3f62dec84](https://github.com/facebook/react/commit/3f62dec84 )**: Typo fix ([#21729](https://github.com/facebook/react/pull/21729)) //<Deniz Susman>//
- **[5579f1dc8](https://github.com/facebook/react/commit/5579f1dc8 )**: Update test comments with explanations ([#21857](https://github.com/facebook/react/pull/21857)) //<Ricky>//
- **[262ff7ad2](https://github.com/facebook/react/commit/262ff7ad2 )**: Refactor "disappear" logic into its own traversal ([#21901](https://github.com/facebook/react/pull/21901)) //<Andrew Clark>//
- **[34600f4fa](https://github.com/facebook/react/commit/34600f4fa )**: Refactor "reappear" logic into its own traversal ([#21898](https://github.com/facebook/react/pull/21898)) //<Andrew Clark>//
- **[310187264](https://github.com/facebook/react/commit/310187264 )**: Clean up flushSync flow types ([#21887](https://github.com/facebook/react/pull/21887)) //<Ricky>//
- **[a97b5ac07](https://github.com/facebook/react/commit/a97b5ac07 )**: [Bugfix] Don't hide/unhide unless visibility changes ([#21875](https://github.com/facebook/react/pull/21875)) //<Andrew Clark>//
- **[81346764b](https://github.com/facebook/react/commit/81346764b )**: Run persistent tests in more configurations in CI ([#21880](https://github.com/facebook/react/pull/21880)) //<Andrew Clark>//
- **[9090257e6](https://github.com/facebook/react/commit/9090257e6 )**: fix: restore execution context after RetryAfterError completed ([#21766](https://github.com/facebook/react/pull/21766)) //<Sebastian Silbermann>//
- **[14bac6193](https://github.com/facebook/react/commit/14bac6193 )**: Allow components to render undefined ([#21869](https://github.com/facebook/react/pull/21869)) //<Ricky>//
- **[87b67d319](https://github.com/facebook/react/commit/87b67d319 )**: Enable scheduling profiler flag for react-dom profiling builds ([#21867](https://github.com/facebook/react/pull/21867)) //<Brian Vaughn>//
- **[464f27572](https://github.com/facebook/react/commit/464f27572 )**: Update link to flow ([#21862](https://github.com/facebook/react/pull/21862)) //<Ehsan Hosseini>//
- **[9f5224a9c](https://github.com/facebook/react/commit/9f5224a9c )**: Restore DevTools console message ([#21864](https://github.com/facebook/react/pull/21864)) //<Dan Abramov>//
- **[a4ecd85e8](https://github.com/facebook/react/commit/a4ecd85e8 )**: act: Batch updates, even in legacy roots ([#21797](https://github.com/facebook/react/pull/21797)) //<Andrew Clark>//
- **[c2c6ea1fd](https://github.com/facebook/react/commit/c2c6ea1fd )**: Capture suspense boundaries with undefined fallbacks ([#21854](https://github.com/facebook/react/pull/21854)) //<Ricky>//
- **[0f09f14ae](https://github.com/facebook/react/commit/0f09f14ae )**: Check if already rendering before flushing //<Andrew Clark>//
- **[54e88ed12](https://github.com/facebook/react/commit/54e88ed12 )**: Bugfix: Flush legacy sync passive effects at beginning of event ([#21846](https://github.com/facebook/react/pull/21846)) //<Andrew Clark>//
- **[cb8afda18](https://github.com/facebook/react/commit/cb8afda18 )**: Add test for #21837 ([#21842](https://github.com/facebook/react/pull/21842)) //<Andrew Clark>//
- **[f85f429d5](https://github.com/facebook/react/commit/f85f429d5 )**: Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839)) ([#21841](https://github.com/facebook/react/pull/21841)) //<Andrew Clark>//
- **[84639ab53](https://github.com/facebook/react/commit/84639ab53 )**: Guard against reused fibers in React Native commands ([#21837](https://github.com/facebook/react/pull/21837)) //<Timothy Yung>//
- **[c549bc491](https://github.com/facebook/react/commit/c549bc491 )**: Revert "Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839))" ([#21840](https://github.com/facebook/react/pull/21840)) //<Timothy Yung>//
- **[59d3aca68](https://github.com/facebook/react/commit/59d3aca68 )**: Use `act()` in ReactFabric tests ([#21839](https://github.com/facebook/react/pull/21839)) //<Timothy Yung>//
- **[9ccc25a0e](https://github.com/facebook/react/commit/9ccc25a0e )**: Reverting recent flushSync changes ([#21816](https://github.com/facebook/react/pull/21816)) //<Brian Vaughn>//
- **[ed6c091fe](https://github.com/facebook/react/commit/ed6c091fe )**: Replace unbatchedUpdates with flushSync ([#21776](https://github.com/facebook/react/pull/21776)) //<Andrew Clark>//
- **[32eefcb3c](https://github.com/facebook/react/commit/32eefcb3c )**: Replace flushDiscreteUpdates with flushSync ([#21775](https://github.com/facebook/react/pull/21775)) //<Andrew Clark>//
- **[ab390c65e](https://github.com/facebook/react/commit/ab390c65e )**: ReactDebugHooks optionally includes fileName, and line/column numbers ([#21781](https://github.com/facebook/react/pull/21781)) //<Brian Vaughn>//
- **[c96761c7b](https://github.com/facebook/react/commit/c96761c7b )**: Delete batchedEventUpdates ([#21774](https://github.com/facebook/react/pull/21774)) //<Andrew Clark>//
- **[3e8c86c1c](https://github.com/facebook/react/commit/3e8c86c1c )**: fix: maxYieldInterval should not compare with currentTime directly in Scheduler-shouldYieldToHost //<郭帅彬>//
- **[d483463bc](https://github.com/facebook/react/commit/d483463bc )**: Updated scripts and config to replace "master" with "main" branch ([#21768](https://github.com/facebook/react/pull/21768)) //<Brian Vaughn>//

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

jest_e2e[run_all_tests]

Reviewed By: JoshuaGross

Differential Revision: D29913856

fbshipit-source-id: 58e4903766a312a64a17cfba0b0f684cf4bcacb0
2021-07-27 19:57:52 -07:00
Xuan Huang 37dc1d44a5 Rename immediate to ReactNativeMicrotask in Bridge
Summary:
Changelog: [Internal]

This diff replaced all the internal occurrences of "Immediate" with
"ReactNativeMicrotask" in the legacy bridge and then polyfilled the
original immediate APIs during the timer setup phases as aliases of them.

Note that this diff is part of a larger refactoring.

Reviewed By: RSNara

Differential Revision: D29785430

fbshipit-source-id: 7325d2a7358a6c9baa3e9abb8acf90414de5072f
2021-07-27 00:51:34 -07:00
Jesse Katsumata b4b8b73a9b chore: fix dead link in comment (#31902)
Summary:
Fixed a link in a comment that lead to dead link

whatwg-url changed the source directory from `lib` to `src`

## Changelog

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

[INTERNAL] [FIXED] - fix dead link in a comment

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

Test Plan: - [ ] Changed URL opens properly

Reviewed By: charlesbdudley

Differential Revision: D29915170

Pulled By: lunaleaps

fbshipit-source-id: 00b69db82f51d16cf887cd4540a159132ad7d771
2021-07-26 13:10:41 -07:00
Rick Hanlon a90f8d8644 React Native sync for revisions 568dc35...cae6350
Summary:
This sync includes the following changes:
- **[cae635054](https://github.com/facebook/react/commit/cae635054 )**: `act`: Resolve to return value of scope function ([#21759](https://github.com/facebook/react/pull/21759)) //<Andrew Clark>//
- **[e2453e200](https://github.com/facebook/react/commit/e2453e200 )**: act: Add test for bypassing queueMicrotask ([#21743](https://github.com/facebook/react/pull/21743)) //<Andrew Clark>//
- **[534c9c52e](https://github.com/facebook/react/commit/534c9c52e )**: Move error logging to update callback ([#21737](https://github.com/facebook/react/pull/21737)) //<Dan Abramov>//
- **[51b0becf3](https://github.com/facebook/react/commit/51b0becf3 )**: Always keep disabled logs in the second pass ([#21739](https://github.com/facebook/react/pull/21739)) //<Dan Abramov>//
- **[7fec38041](https://github.com/facebook/react/commit/7fec38041 )**: Log and show error overlay for commit phase errors ([#21723](https://github.com/facebook/react/pull/21723)) //<Dan Abramov>//
- **[27c9c95e2](https://github.com/facebook/react/commit/27c9c95e2 )**: act: Bypass microtask for "default sync" updates ([#21740](https://github.com/facebook/react/pull/21740)) //<Andrew Clark>//
- **[355591add](https://github.com/facebook/react/commit/355591add )**: Next/experimental release versions include commit date ([#21700](https://github.com/facebook/react/pull/21700)) //<Brian Vaughn>//
- **[d7dce572c](https://github.com/facebook/react/commit/d7dce572c )**: Remove internal `act` builds from public modules ([#21721](https://github.com/facebook/react/pull/21721)) //<Andrew Clark>//
- **[06f7b4f43](https://github.com/facebook/react/commit/06f7b4f43 )**: `act` should work without mock Scheduler ([#21714](https://github.com/facebook/react/pull/21714)) //<Andrew Clark>//

Changelog:
[General][Changed] - React Native sync for revisions 568dc35...cae6350

jest_e2e[run_all_tests]

Reviewed By: JoshuaGross, ShikaSD

Differential Revision: D29555979

fbshipit-source-id: 0afc869cc007bce417f0020d3ee4dc8b0ea5beb9
2021-07-24 14:27:32 -07:00
Altaibayar Tseveenbayar 6b4d8dbf1a Wrong warning message
Summary:
* it says focusTextInput but the function name is blurTextInput
* probably the message was copy-pasted from `focusTextInput` where is the same error message.

Changelog: [Internal]

Reviewed By: arhelmus

Differential Revision: D29845922

fbshipit-source-id: 21fd3e572c32779c13f6909556153d07dc7a416f
2021-07-22 08:28:02 -07:00
Evan Yeung afe0c1daea Remove existential types from xplat/js
Summary: Changelog: [Internal]

Reviewed By: pieterv

Differential Revision: D29724915

fbshipit-source-id: 97cbeefbba2ddc2e1088dfe19db14fa545213549
2021-07-21 16:52:22 -07:00
Jason Safaiyeh d9e0ea77f0 Migrate to androidx.autofill.HintConstants & Support all constant types (#28008)
Summary:
Fix for https://github.com/facebook/react-native/issues/27952.

Noticed more than just `AUTOFILL_HINT_NEW_PASSWORD` were missing, this PR will support every `AUTOFILL_HINT_*` type.

## Changelog

[Android] [Added] - Added all autofill types to TextEdit

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

Reviewed By: sturmen

Differential Revision: D29766235

Pulled By: mdvacca

fbshipit-source-id: d5171aef8092d37716fddcb6f3443637a4af8481
2021-07-21 15:14:41 -07:00
Mark Bridges aa98978302 Adding metadata to React Native QPL points
Summary:
Changelog:
[General][Added] - Added data field to markerPoint to allow callers to add additional arbitrary string data to logged points

Reviewed By: dmitry-voronkevich

Differential Revision: D29764274

fbshipit-source-id: b0d21e3b20a5353351424afb10c950f3e8689887
2021-07-21 10:34:27 -07:00
Nick Gerleman cd78558552 Add unit tests for VirtualizedList render quirks (#31401)
Summary:
This change adds a series of snapshot tests to validate the render output of VirtualizedList in mixed scenarios. Jest timer mocks are used to measure rendering at different ticks. These test cases mostly center around realization logic, to help prevent regressions when chaning internal state representation.
## Changelog

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

[Internal] [Added] - Add unit tests for VirtualizedList render quirks

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

Test Plan: Ran the added UTs locally.

Reviewed By: lunaleaps

Differential Revision: D28017750

Pulled By: rozele

fbshipit-source-id: df9684c4ac80a8732f3e88e7496815127213832e
2021-07-20 10:10:48 -07:00
Joshua Wiegmann 7d5895df4e Remove defaultProps from FlatList (#31798)
Summary:
Issue https://github.com/facebook/react-native/issues/31602. Remove `defaultProps` from `FlatList`.

## Changelog

[JavaScript] [Changed] - Remove defaultProps from FlatList

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

Test Plan:
All test for `FlatList` pass.

https://user-images.githubusercontent.com/57131123/124164691-4066c980-daa1-11eb-8653-5c51640fe63e.mov

Reviewed By: charlesbdudley

Differential Revision: D29619867

Pulled By: lunaleaps

fbshipit-source-id: 8d8a6f095f80374407a55bac0b4e899bae04c577
2021-07-20 00:23:56 -07:00
Kudo Chien b77948e33b Upgrade folly to 2021.06.28.00 and boost to 1.76.0 (#31840)
Summary:
1. [ios] upgrade folly to 2021.06.28.00 which aligned to android.
2. folly compile setting from c++14 -> c++17: _this folly requires c++17 for `std::unordered_map::insert_or_assign`._
3. boost 1.63.0 -> 1.76.0:  _the old boost does not support c++17._
4. deprecating react-native-community/boost-for-react-native: _by cocoapods installer, we could download the official target._

## Changelog

[iOS] [Changed] - Upgrade folly to 2021.06.28.00 and boost to 1.76.0

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

Test Plan: CI passed

Reviewed By: fkgozali

Differential Revision: D29668480

Pulled By: yungsters

fbshipit-source-id: 98eae9ca47f489dcea91974e6f5e9dcb4d66c40c
2021-07-16 15:13:12 -07:00
Adrián Cuesta 1465c8f387 Add support to URI keyboard type in Android (#31781)
Summary:
Android react-native `TextInput` component does nothing if prop `keyboardType` is `url` value. This PR solves that problem.

## Changelog

[Android] [Added] - Add support to URI keyboard type in Android

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

Test Plan:
Before change:

{F630980679}

After Change:

{F630986399}

Reviewed By: lunaleaps

Differential Revision: D29517822

Pulled By: sshic

fbshipit-source-id: 1bda29584a3799570f34e772b5589b59ac80c524
2021-07-16 05:13:07 -07:00
Tim Yung 92c13f0d1d RN: Replace `master` with `main` in Documentation
Summary:
Updates documentation in React Native to reference `main` (or `HEAD` for URLs) instead of `master`.

Part of https://github.com/facebook/react-native/issues/31788.

Changelog:
[General][Changed] - Update documentation reference from `master` to `main` or `HEAD`.

Reviewed By: JoshuaGross

Differential Revision: D29717128

fbshipit-source-id: 0b0babd8407c6fd3d0e5431f6eaf976059731d6f
2021-07-15 15:22:57 -07:00
Evan Yeung efd4dafc54 Update xplat to Flow v0.155.0
Summary:
Update flow version to v0.155.0

Changelog: [Internal]

Reviewed By: pieterv

Differential Revision: D29641055

fbshipit-source-id: 601a82fe4fa4ce548a790347a84aea4014c418d9
2021-07-14 09:13:29 -07:00
Joshua Wiegmann fa0518d3d3 Remove defaultProps from SegmentedControlIOS (#31804)
Summary:
Issue https://github.com/facebook/react-native/issues/31604 . Remove `defaultProps` from `SegmentedControlIOS`.

## Changelog

[JavaScript] [Changed] - Remove defaultProps from SegmentedControlIOS

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

Test Plan: Added tests for `SegmentedControlIOS` pass.

Reviewed By: yungsters

Differential Revision: D29653982

Pulled By: lunaleaps

fbshipit-source-id: ed6e133cc3af629be6cd83be79e402ad1e68b29b
2021-07-13 19:25:43 -07:00
Anas Khurshid 25a16123a6 Added Support for Entrance/exit from collection by Flatlist (#31630)
Summary:
Issue https://github.com/facebook/react-native/issues/30964 .When using a screen reader, flatlist does not announce entrance/ exit from the flat list.

## Changelog

[Android] [Changed] - Added support for accessibility role of "list" for flatlist and sectioned list

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

Test Plan: I have added accessibility role prop in flatlist and sectioned list in rntester app, that will announce entrance/ exit from flatlist and sectioned list.

Reviewed By: kacieb

Differential Revision: D29599351

Pulled By: blavalla

fbshipit-source-id: e16ec69a694780d12f15f88a1e6bb5d7d77ac15f
2021-07-09 19:25:36 -07:00
Kacie Bawiec 771d584098 Add passthroughAnimatedPropsExplicitValues to modern createAnimatedComponent
Summary:
Code almost directly copied from the old implementation of [createAnimatedComponent.js](https://www.internalfb.com/intern/diffusion/FBS/browsefile/master/xplat/js/react-native-github/Libraries/Animated/createAnimatedComponent.js?commit=156dbfe5d0fc491819a8b4939896d23b2273e251&lines=208-211).

This is necessary for certain things to work (like ScrollViewStickyHeader).

The reason is because when animations are driven by useNativeDriver, JS does not know where the component has moved to. If a component that is translated like ScrollViewStickyHeader is also Pressable, the onPress will **not** work without this prop. [Link to where ScrollViewStickyHeader uses passthroughAnimatedPropsExplicitValues](https://www.internalfb.com/intern/diffusion/FBS/browsefile/master/xplat/js/react-native-github/Libraries/Components/ScrollView/ScrollViewStickyHeader.js?commit=124a38e1708b620857e4e6969cdef6004aa1bd10&lines=294-296)

I am not adding this to the Flow type because we only want people using this if they really know what they're doing, as it's a hacky fix.

Followup work to this would be to create a hook to attach the listener to the animated values, which ScrollViewStickyHeader does manually. But this is not required for this component to work.

Changelog: Internal

Reviewed By: yungsters

Differential Revision: D29557480

fbshipit-source-id: 293fab4746c3404f5ae9b90afe85d2ca91181873
2021-07-08 09:29:38 -07:00
Kacie Bawiec 7ebafc0066 Add animation queue to modern createAnimatedComponent
Summary:
Add animation queuing back into createAnimatedComponent_EXPERIMENTAL.js, which is a concurrent-safe version of createAnimatedComponent.

T93269035 for details on why this is needed.

# How does this work?

In the old createAnimatedComponent, Animations were queued by calling `setWaitingForIdentifier` before render, and then calling `unsetWaitingForIdentifier` after render.

In this diff, instead we are calling `setWaitingForIdentifier` in an `useLayoutEffect` before calling `useAnimatedProps`, and we are calling `unsetWaitingForIdentifier` in a `useEffect` after `useAnimatedProps`. So the ordering for the effects are:

1. `useLayoutEffect` with `setWaiting`
2. `useLayoutEffect`s in `useAnimatedProps`
3. `useEffect`s in `useAnimatedProps`
4. `useEffect` with `unsetWaiting`.

There's a React guarantee that **if one effect is called, all of them will be called**, so we don't have a concern about the queue getting locked.

## **Main concerns:**
1. This works in my test cases, but it's not the same behavior as the old createAnimatedComponent (which is wait before and unset wait after render). This may still be ok because the relevant side effects in render from that component have been moved to `useLayoutEffect` or `useEffect` in `useAnimatedProps` (so the ordering is still the same?).
2. I'm not sure about the ordering of `onLayoutEffect`, `onLayout` callbacks, and `useEffect`. createAnimatedComponent_EXPERIMENTAL doesn't use `onLayout`, but with this new method of queuing, **`onLayout` calls will likely be called before the animation queue has been flushed**. It's not clear to me whether this is bad.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D29467458

fbshipit-source-id: 2be23a8968404526d0fa394a7879fda8b5ffbfdc
2021-07-08 09:29:38 -07:00
Justin Huntington bc1e602e0c Add ScrollView.automaticallyAdjustsScrollIndicatorInsets prop (on iOS) (#29809)
Summary:
iOS 13 added a new property to `UIScrollView`: `automaticallyAdjustsScrollIndicatorInsets`, which is `YES` by default.  The property changes the meaning of the `scrollIndicatorInsets` property.  When `YES`, any such insets are **in addition to** whatever insets would be applied by the device's safe area.  When `NO`, the iOS <13 behavior is restored, which is for such insets to not account for safe area.

In other words, this effects ScrollViews that underlay the device's safe area (i.e. under the notch).  When `YES`, the OS "automatically" insets the scroll indicators, when `NO` it does not.

There are two problems with the default `YES` setting:

1. It means applying `scrollIndicatorInsets` to a `ScrollView` has a different effect on iOS 13 versus iOS 12.
2. It limits developers' control over `scrollIndicatorInsets`.  Since negative insets are not supported, if the insets the OS chooses are too large for your app, you cannot fix it.

Further explanation & sample code is available in issue https://github.com/facebook/react-native/issues/28140 .

This change sets the default for this property to `NO`, making the behavior consistent across iOS versions, and allowing developers full control.

## 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] [Changed] - ScrollView scrollIndicatorInsets to not automatically add safe area on iOS13+

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

Test Plan:
Updated the RNTester example to explain what to expect. Also removed the `pageScreen` modal example for now as mentioned in my Github comment.

{F628636466}

Here are screenshots of the demo app (from the original bug) before (with safe area applied to insets) & after (without safe area applied to insets):

![before](https://user-images.githubusercontent.com/428831/91644197-ea03a700-ea07-11ea-9489-be27820930eb.png)

![after](https://user-images.githubusercontent.com/428831/91644200-eff98800-ea07-11ea-8788-daf1e783639d.png)

Reviewed By: p-sun

Differential Revision: D28229603

Pulled By: lunaleaps

fbshipit-source-id: 2e774ae150b1dc41680b8b7886c7ceac8808136a
2021-07-07 20:23:36 -07:00
Nishan Bende d85d72d0d9 fix: TouchableNativeFeedback ripple starts on previous touch location (#31777)
Summary:
TouchableNativeFeedback's ripple starts from previous location on subsequent presses. This is similar to https://github.com/facebook/react-native/pull/31669

Fixes https://github.com/facebook/react-native/issues/28944

Issue

https://user-images.githubusercontent.com/23293248/123521731-1f375f00-d6d6-11eb-8e4c-fc5ffb322e67.mov

Fix

https://user-images.githubusercontent.com/23293248/123521735-2bbbb780-d6d6-11eb-88b2-be75342cf22a.mov

## 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] - TouchableNativeFeedback ripple starts on previous touch location.

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

Test Plan: Tested TouchableNativeFeedback examples in rn-tester app. Registering coordinates before pressed command fixes the issue.

Reviewed By: lunaleaps

Differential Revision: D29496515

Pulled By: kacieb

fbshipit-source-id: 77ac626181a61eee2cd30c4d48e52d10d800f2d8
2021-07-06 17:50:35 -07:00
Ruslan Serebriakov d5676f8370 CKComponentLayout
Summary:
fastmod --accept-all "CKComponentLayout" "RCLayout"
Changelog: [Internal]

## Changelog:

[Internal] - Renaming

Reviewed By: cuva

Differential Revision: D29228868

fbshipit-source-id: 2a5601eb7464e2cff3302781030c175e972f38bb
2021-07-01 09:04:46 -07:00
Joshua Gross afafbf8ec4 Log soft exception instead of crashing if ref is null on TextInput onPress
Summary:
See title.

Changelog: [internal]

Reviewed By: yungsters

Differential Revision: D29410457

fbshipit-source-id: 0b9a9836baa0b5b7deb88cd73f4f634ca10c5868
2021-06-25 19:49:04 -07:00
Nick Gerleman 5cb2debbea Add "CellRenderMask" Region Tracking Structure (#31420)
Summary:
A CellRenderMask helps track regions of cells/spacers to render. It's API allows adding ranges of cells, where its otput be an ordered list of contiguous spacer/non-spacer ranges.

The implementation keeps this region list internally, splitting or merging regions when cells are added. This output will be used by the render function of a refactored VirtualizedList.

## Changelog

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

[Internal] [Added] - Add "CellRenderMask" Region Tracking Structure

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

Test Plan: Validated via UTs.

Reviewed By: lunaleaps

Differential Revision: D28293161

Pulled By: rozele

fbshipit-source-id: a5e4e2144a90387aabe0974650429018440abf67
2021-06-24 07:57:01 -07:00
Tim Yung 123d184944 ImageSource: Convert `ImageURISource` to Interface
Summary:
Changes the `ImageURISource` Flow type into an interface.

- This enables both objects and class instances to be subtypes of `ImageURISource`.
- This makes it invalid to spread `ImageURISource` as a type, so `interface X extends ImageURISource` can instead be used.
- This makes it invalid to spread `ImageURISource` as a value, so `getImageSourceProperties(x)` can instead be used.
- This makes it invalid to use `$Exact` with `ImageURISource`.

Changelog:
[General][Changed] - `ImageURISource` Flow type is now an interface instead of an object.

Reviewed By: timrc

Differential Revision: D29323508

fbshipit-source-id: 647c2f9b0bfead6d7e56bdb7108e623cbf8b6c89
2021-06-23 13:15:02 -07:00
Peter Argany e83feffeba Back out "Avoid re-encoding images when uploading local files"
Summary:
This was causing an upload error in FB Dating, will need to re-land with the fix.

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D29320144

fbshipit-source-id: 5d09dd2171b5696afe89cffa064947f0a0bb413d
2021-06-22 19:18:22 -07:00
Kacie Bawiec d4d22fbfb9 React Native sync for revisions c96b78e...568dc35
Summary:
This sync includes the following changes:
- **[43f4cc160](https://github.com/facebook/react/commit/43f4cc160 )**: Fix failing test ([#21697](https://github.com/facebook/react/pull/21697)) //<Dan Abramov>//
- **[d0f348dc1](https://github.com/facebook/react/commit/d0f348dc1 )**: Fix for failed Suspense layout semantics ([#21694](https://github.com/facebook/react/pull/21694)) //<Brian Vaughn>//
- **[bd0a96344](https://github.com/facebook/react/commit/bd0a96344 )**: Throw when `act` is used in production ([#21686](https://github.com/facebook/react/pull/21686)) //<Andrew Clark>//
- **[9343f8720](https://github.com/facebook/react/commit/9343f8720 )**: Use the server src files as entry points for the builds/tests ([#21683](https://github.com/facebook/react/pull/21683)) //<Sebastian Markbåge>//
- **[502f8a2a0](https://github.com/facebook/react/commit/502f8a2a0 )**: [Fizz/Flight] Don't use default args ([#21681](https://github.com/facebook/react/pull/21681)) //<Sebastian Markbåge>//
- **[a8f5e77b9](https://github.com/facebook/react/commit/a8f5e77b9 )**: Remove invokeGuardedCallback from commit phase ([#21666](https://github.com/facebook/react/pull/21666)) //<Dan Abramov>//
- **[dbe3363cc](https://github.com/facebook/react/commit/dbe3363cc )**: [Fizz] Implement Legacy renderToString and renderToNodeStream on top of Fizz ([#21276](https://github.com/facebook/react/pull/21276)) //<Sebastian Markbåge>//
- **[101ea9f55](https://github.com/facebook/react/commit/101ea9f55 )**: Set deletedTreeCleanUpLevel to 3 ([#21679](https://github.com/facebook/react/pull/21679)) //<Dan Abramov>//
- **[1a106bdc2](https://github.com/facebook/react/commit/1a106bdc2 )**: Wrap eventhandle-specific logic in a flag ([#21657](https://github.com/facebook/react/pull/21657)) //<Dan Abramov>//
- **[cb30388d1](https://github.com/facebook/react/commit/cb30388d1 )**: Export React Native `AttributeType` Types ([#21661](https://github.com/facebook/react/pull/21661)) //<Timothy Yung>//
- **[c1536795c](https://github.com/facebook/react/commit/c1536795c )**: Revert "Make enableSuspenseLayoutEffectSemantics static for www ([#21617](https://github.com/facebook/react/pull/21617))" ([#21656](https://github.com/facebook/react/pull/21656)) //<Sebastian Markbåge>//

Changelog:
[General][Changed] - React Native sync for revisions c96b78e...568dc35

jest_e2e[run_all_tests]

Reviewed By: rickhanlonii

Differential Revision: D29303157

fbshipit-source-id: 90952885eb2264f4effa04070357b80700bb9be3
2021-06-22 14:29:17 -07:00
Luna Wei fc9c326912 Use Animated.event implementation in AnimatedMock
Summary: Changelog: [Internal] - Animated.event from my limited understanding attaches Animated.Values to native views. In terms of animation, Animated.Values are already handled by AnimatedMock to skip interpolation.

Reviewed By: GijsWeterings

Differential Revision: D29241590

fbshipit-source-id: 98650883dad53d6f77dbc398ba0cac903194deca
2021-06-22 08:16:42 -07:00
David Vacca 7f117394af Refactor Image to log component stacktraces for images rendering non-fb sources
Summary:
This diff refactors the Image component in order to log the component hierarchy stacktraces for images rendering non-fb sources

changelog: [internal] internal

Reviewed By: yungsters

Differential Revision: D29266451

fbshipit-source-id: 826230b1a18a5809b340ef0767d80a281e20477a
2021-06-21 20:29:27 -07:00
Luna Wei ad0ccac0d6 Remove Picker from OSS
Summary:
Changelog:
[General][Removed] - Remove Picker/PickerIOS export from react-native and delete JS related code

Reviewed By: kacieb

Differential Revision: D29122947

fbshipit-source-id: 9f754396d1f221fde57ec4dec8e29af598432102
2021-06-21 15:19:09 -07:00
David Vacca 14ca57b435 Log ImageSource uris that are not using Facebook domain
Summary:
This diff adds logging to uncover what are the ReactNative screens that are rendering images using NON-Facebook domains

changelog: [internal] internal

Reviewed By: yungsters

Differential Revision: D29179990

fbshipit-source-id: 85f6380848d1ac1461419bc29c4666be389fb87a
2021-06-17 15:11:06 -07:00
Tim Yung 765d1e247b RN: Change `ImageURISource` to Object Type
Summary:
Changes `ImageURISource` back to an object type.

It was changed to an interface by D27193522 (05418f8fcc), but that is not the right direction for this type.

Changelog:
[Internal] - There was no changelog entry for this initially, so the revert can also be omitted.

Reviewed By: lunaleaps

Differential Revision: D29205798

fbshipit-source-id: 727ef70bbf47d14b163ecf5d6f31184da51c894a
2021-06-17 13:51:41 -07:00
Ramanpreet Nara 8a677face4 Add NOBRIDGE prefix to Venice Metro logs
Summary:
## Context
In dev mode, Metro hijacks the JavaScript `console`, and prints all logs into the terminal running the Metro server.

## Problem
We have no way to distinguish between Bridge mode and Bridgeless mode logs. This makes it hard to tell catch warnings and errors are coming from bridgeless mode.

## Changes
- This diff adds a "NOBRIDGE" prefix to all React Native Metro logs coming from Bridgeless mode.
- Bridge mode console logs/warnings/errors are **unaffected**.

Changelog: [Internal]

Reviewed By: PeteTheHeat

Differential Revision: D29152292

fbshipit-source-id: 257b8140327cfd7a0a10aa229bcb88117231e452
2021-06-16 12:45:08 -07:00
Peter Argany c3dffe059b Fix native module lookup followup from D28630805
Summary:
In D28630805 (f78526ce3d) ([github link](https://github.com/facebook/react-native/pull/31457)) I added a setter to workaround a bug I perceived with `moduleRegistry`. Turns out - the proper fix was to remove the `synthesize` line. See conversation on linked diff for more context.

Changelog: [Internal]

Reviewed By: RSNara

Differential Revision: D29144717

fbshipit-source-id: aa95b670b540b9007eed76769c9babc10ea399ce
2021-06-15 18:50:08 -07:00
Arthur Lee f78526ce3d Avoid re-encoding images when uploading local files (#31457)
Summary:
Fixes https://github.com/facebook/react-native/issues/27099

When you upload a local file using XHR + the `FormData` API, RN uses `RCTNetworkTask` to retrieve the image file data from the local filesystem (request URL is a file:// URL) ([code pointer](https://github.com/facebook/react-native/blob/master/Libraries/Network/RCTNetworking.mm#L398)). As a result, if you are uploading a local image file that is in the app's directory `RCTNetworkTask` will end up using `RCTLocalAssetImageLoader` to load the image, which reads the image into a `UIImage` and then re-encodes it using `UIImageJPEGRepresentation` with a compression quality of 1.0, which is the higest ([code pointer](4c5182c1cc/Libraries/Image/RCTImageLoader.mm (L1114))). Not only is this unnecessary, it ends up inflating the size of the jpg if it had been previously compressed to a lower quality.

With this PR, this issue is fixed by forcing the `RCTFileRequestHandler` to be used when retrieving local files for upload, regardless of whether they are images or not. As a result, any file to be uploaded gets read into `NSData` which is the format needed when appending to the multipart body.
I considered fixing this by modifying the behavior of how the handlers were chosen, but this felt like a safer fix since it will be scoped to just uploads and wont affect image fetching.

## Changelog

[iOS] [Fixed] - Avoid re-encoding images when uploading local files

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

Test Plan:
The repro for this is a bit troublesome, especially because this issue doesn't repro in RNTester. There is [some code](https://github.com/facebook/react-native/blob/master/packages/rn-tester/RNTester/AppDelegate.mm#L220) that is to be overriding the handlers that will be used, excluding the `RCTImageLoader`. I had to repro this in a fresh new RN app.

1. Create a blank RN app
2. Put an image in the folder of the app's install location. This would be similar to where files might be placed after an app downloads or captures an image.
3. Set up a quick express server that accepts multipart form uploads and stores the files
4. Trigger an upload via react native
```
const data = new FormData();
data.append('image', {
  uri:
    '/Users/arthur.lee/Library/Developer/CoreSimulator/Devices/46CDD981 (d0c8cb12f2)-9164-4925-9025-1A76C0D9 (1946aee3d9)F0F5/data/Containers/Bundle/Application/B1E8A764-6221-4EA9-BE9A-2CB1699FD218 (1c92b1cff6)/test.app/test.bundle/compressed.jpg',
  type: 'image/jpeg',
  name: 'image.jpeg',
});

fetch(`http://localhost:3000/upload`, {
  method: 'POST',
  headers: {'Content-Type': 'multipart/form-data'},
  body: data,
}).then(console.log);
```
5. Trigger the upload with and without this patch

Original file:
```
$ ls -lh
total 448
-rw-r--r--  1 arthur.lee  staff   223K Apr 29 17:08 compressed.jpg
```

Uploaded file (with and without patch):
```
$ ls -lh
total 1624
-rw-r--r--@ 1 arthur.lee  staff   584K Apr 29 17:11 image-nopatch.jpeg
-rw-r--r--@ 1 arthur.lee  staff   223K Apr 29 17:20 image-withpatch.jpeg
```

Would appreciate pointers on whether this needs to be tested more extensively

Reviewed By: yungsters

Differential Revision: D28630805

Pulled By: PeteTheHeat

fbshipit-source-id: 606a6091fa3e817966548c5eb84b19cb8b9abb1c
2021-06-14 22:52:58 -07:00
Martin Sherburn e539e7d0be Fix bug in parseHermesStack.js
Summary:
If function name is an empty string then it would fail to parse the line. And not only that, it would cause the entire stack to be lost. This fixes the issue by replacing `.+?` with `.*?`.

For example this line fails to parse:
```
    at global (:2:4)
```

Changelog:
[General][Fixed] - Fixed bug parsing hermes call stacks when the file name is empty

Reviewed By: yungsters

Differential Revision: D29063192

fbshipit-source-id: 604e457af51f852fe547e6424283631ae148897d
2021-06-14 02:57:37 -07:00
Tim Yung ed76d4d8db RN: Statically Define `ReactNativeStyleAttributes`
Summary:
Rewrites `ReactNativeStyleAttributes` so that it is statically defined.

This means it will no longer require a handful of modules that defines `prop-types` only to use their keys.

Functionally, this should be equivalent to what was there before.

Changelog:
[Internal]

Reviewed By: TheSavior

Differential Revision: D29019308

fbshipit-source-id: 47f85a8c7703a133c68c20c7f3e14e1026ce4ff2
2021-06-11 23:52:09 -07:00
Tim Yung 33b385825c RN: Simplify `ReactNativeStyleAttributes` Type
Summary:
Simplifies the Flow type for `ReactNativeStyleAttributes`, an internal module.

Changelog:
[Internal]

Reviewed By: TheSavior

Differential Revision: D29019311

fbshipit-source-id: cf95dac4b8c2261812cc1d753255dfb905540759
2021-06-11 23:52:09 -07:00
Tim Yung 2e8c0bd7ea RN: Delete `StyleSheetValidation`
Summary:
Deletes `StyleSheetValidation` because it is `prop-types` in disguise.

Changelog:
[General][Removed] - `StyleSheet.create` will no longer do DEV-time validation.

Reviewed By: TheSavior

Differential Revision: D29019310

fbshipit-source-id: bfe886d8dc09a1aa8dac4a73bfd62f481e3eb9e9
2021-06-11 23:52:09 -07:00
Tim Yung 052b3e3faa RN: Cleanup `DeprecatedTextInputPropTypes`
Summary:
Removes the unnecessary dependency from `DeprecatedTextInputPropTypes` on `Text`. Just use `DeprecatedTextPropTypes` directly.

Changelog:
[Internal]

Reviewed By: TheSavior

Differential Revision: D29017596

fbshipit-source-id: b816c2261bf473e02473d84984cfb3d5a63ec8c1
2021-06-11 23:52:09 -07:00
Tim Yung efefae92ca RN: Move `{ => Deprecated}ImageProp{s => Types}` (Android)
Summary:
Moves `ImagePropTypes` out of `Image.android.js` in preparation for some cleanup.

Changelog:
[Internal]

Reviewed By: TheSavior

Differential Revision: D29017076

fbshipit-source-id: e7d3d6533f69dc2c54e7c25e215648d7c7ff1840
2021-06-11 23:52:09 -07:00
Daniel Sainati 974f0a3281 pre-suppress this typing errors ahead of 154
Summary:
This pre-suppresses the 154 error diff ahead of its release, since it is large.

Changelog: [Internal]

Reviewed By: samwgoldman

Differential Revision: D29065246

fbshipit-source-id: f418041305a46df410dcbe3d9a4db81a61ac7014
2021-06-11 14:31:41 -07:00
Samuel Susla 2a6df5b375 Pass concurrentRoot flag through to renderApplication
Summary:
Changelog: [internal]

Pass concurrentRoot flag to renderApplication.

Reviewed By: rubennorte

Differential Revision: D28630516

fbshipit-source-id: 959b9c684a8736a28a86d42699a78c96da859224
2021-06-11 04:23:50 -07:00
Samuel Susla e31e2cc318 React Native sync for revisions 0eea577...c96b78e
Summary:
This sync includes the following changes:
- **[c96b78e0e](https://github.com/facebook/react/commit/c96b78e0e )**: Add concurrentRoot property to ReactNativeTypes ([#21648](https://github.com/facebook/react/pull/21648)) //<Samuel Susla>//
- **[1a3f1afbd](https://github.com/facebook/react/commit/1a3f1afbd )**: [React Native] Fabric get current event priority ([#21553](https://github.com/facebook/react/pull/21553)) //<Samuel Susla>//
- **[48a11a3ef](https://github.com/facebook/react/commit/48a11a3ef )**: Update next React version ([#21647](https://github.com/facebook/react/pull/21647)) //<Andrew Clark>//
- **[5aa0c5671](https://github.com/facebook/react/commit/5aa0c5671 )**: Fix Issue with Undefined Lazy Imports By Refactoring Lazy Initialization Order ([#21642](https://github.com/facebook/react/pull/21642)) //<Sebastian Markbåge>//

Changelog:
[General][Changed] - React Native sync for revisions 0eea577...c96b78e

jest_e2e[run_all_tests]

Reviewed By: bvaughn

Differential Revision: D29029542

fbshipit-source-id: 9f2e19b4714b5697b5b846f2db8eb28c25420932
2021-06-11 02:09:02 -07:00
Kacie Bawiec 6e2989a7b3 Update Image.[android|ios].js to use import from instead of require
Summary:
As title

Changelog:
[General][Changed] Update Image.[android|ios].js to use import from instead of require

Reviewed By: TheSavior, yungsters

Differential Revision: D29003824

fbshipit-source-id: 0f98c730b1bd9cb581d2fcf6f4c0e911bb8c24b5
2021-06-10 17:12:06 -07:00
Luna Wei fc587c9e98 Back out "Back out "[react-native][PR] remove defaultProps from picker of components""
Summary:
Changelog:
[Internal] - Remove defaultProps from Picker

Reviewed By: TheSavior

Differential Revision: D28941586

fbshipit-source-id: ca9efef597936badfd5c2920028ebd11dc7422a0
2021-06-09 10:34:50 -07:00
Luna Wei 0aa8e25deb Switch: useMergeRef for forwarding ref
Summary:
Changelog:
[Internal] - Replace `useImperativeHandle` usage with new `useMergeRef` which will keep both the forwarded and internal ref handle up to date (in case the instance ever changes). That being said, this change was not motivated in fear of a stale ref but more an intention to show that `useImperativeHandle`'s use case is more about creating a selective API and `useMergeRef` is better suited for publishing ref updates.

Reviewed By: yungsters

Differential Revision: D28950632

fbshipit-source-id: 594afda02693545aab77f24566180c338b58bb8b
2021-06-09 10:12:53 -07:00
Nishan Bende 961b00d8c0 Pressable ripple should pick press event coordinates on subsequent press. (#31669)
Summary:
Please watch the recording below for better explanation. Ripple effect starts from previous press event's coordinates on subsequent presses.

https://user-images.githubusercontent.com/23293248/120929850-51bdef80-c708-11eb-906c-d711672370ee.mov

## Changelog

[Android] [Fixed] - Pressable ripple subsequent press coordinates.

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

Test Plan:
- Tested all Pressable examples. Registering coordinates before press seems to fix the issue.

https://user-images.githubusercontent.com/23293248/120929905-892c9c00-c708-11eb-9e63-576ae800733c.mov

Reviewed By: yungsters

Differential Revision: D28966505

Pulled By: kacieb

fbshipit-source-id: b745180065611390e1897692a0bdea7d6e022cdd
2021-06-08 15:28:22 -07:00
Birkir Gudjonsson 4b9d9dda27 Accessible colors for DynamicColorIOS (#31651)
Summary:
Allow you to harvest the `UIAccessibilityContrastHigh` trait from iOS to show accessible colors when high contrast mode is enabled.

```jsx
// usage

PlatformColorIOS({
  light: '#eeeeee',
  dark: '#333333',
  highContrastLight: '#ffffff',
  highContrastDark: '#000000',
});

// {
//   "dynamic": {
//     "light": "#eeeeee",
//     "dark": "#333333",
//     "highContrastLight": "#ffffff",
//     "highContrastDark": "#000000",
//   }
// }
```

This is how apple's own dynamic system colors work under the hood (https://developer.apple.com/design/human-interface-guidelines/ios/visual-design/color/#dynamic-system-colors)

 ---

The react native docs mention that more keys may become available in the future, which this PR is adding:

> In the future, more keys might become available for different user preferences, like high contrast.

https://reactnative.dev/docs/dynamiccolorios

## 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] [Added] - High contrast dynamic color options for dark and light mode.

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

Test Plan: Added unit tests for `normalizeColor` to pass the high contrast colors downstream to RCTConvert

Reviewed By: lunaleaps

Differential Revision: D28922536

Pulled By: p-sun

fbshipit-source-id: f81417f003c3adefac50e994e62b9be14ffa91a1
2021-06-08 11:51:23 -07:00
Nishan Bende 0823f299e5 Foreground ripple support in Pressable (#31632)
Summary:
This PR aims to enable support for foreground ripple in Pressable. This makes it possible to show ripple on top of custom child components like Image as shown in the below example.

## 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] - Support for foreground ripple in Pressable

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

Test Plan:
- Pass property useForeground: true in android_ripple config to verify the changes.

https://user-images.githubusercontent.com/23293248/120111371-4cecbf00-c18f-11eb-8acb-d10718d5483c.mov

Reviewed By: kacieb

Differential Revision: D28926493

Pulled By: yungsters

fbshipit-source-id: 12a6ba71a7dc6ed60fbaeb651f015cace38e03b1
2021-06-07 17:07:58 -07:00
Andrei Shikov a403e76177 React Native sync for revisions 2d8d133...0eea577
Summary:
- **[0eea57724](https://github.com/facebook/react/commit/0eea57724 )**: Fix typo in comment (accumlated → accumulated) ([#21637](https://github.com/facebook/react/pull/21637)) //<ithinker5>//
- **[0706162ba](https://github.com/facebook/react/commit/0706162ba )**: Fix typo in comment (environement → environment) ([#21635](https://github.com/facebook/react/pull/21635)) //<niexq>//
- **[9d17b562b](https://github.com/facebook/react/commit/9d17b562b )**: Fix typo in comment (satsify → satisfy) ([#21629](https://github.com/facebook/react/pull/21629)) //<niexq>//
- **[b610fec00](https://github.com/facebook/react/commit/b610fec00 )**: fix comments: expiration time -> lanes ([#21551](https://github.com/facebook/react/pull/21551)) //<Shannon Feng>//
- **[cc4d24ab0](https://github.com/facebook/react/commit/cc4d24ab0 )**: [Fizz] Always call flush() if it exists ([#21625](https://github.com/facebook/react/pull/21625)) //<Dan Abramov>//
- **[e0d9b2899](https://github.com/facebook/react/commit/e0d9b2899 )**: [Fizz] Minor Fixes for Warning Parity ([#21618](https://github.com/facebook/react/pull/21618)) //<Sebastian Markbåge>//
- **[1b7b3592f](https://github.com/facebook/react/commit/1b7b3592f )**: [Fizz] Implement Component Stacks in DEV for warnings ([#21610](https://github.com/facebook/react/pull/21610)) //<Sebastian Markbåge>//
- **[39f007489](https://github.com/facebook/react/commit/39f007489 )**: Make enableSuspenseLayoutEffectSemantics static for www ([#21617](https://github.com/facebook/react/pull/21617)) //<Brian Vaughn>//
- **[8f3794276](https://github.com/facebook/react/commit/8f3794276 )**: Prepare semver (`latest`) releases in CI ([#21615](https://github.com/facebook/react/pull/21615)) //<Andrew Clark>//
- **[8b4201535](https://github.com/facebook/react/commit/8b4201535 )**: Devtools: add feature to trigger an error boundary ([#21583](https://github.com/facebook/react/pull/21583)) //<Bao Pham>//
- **[154a8cf32](https://github.com/facebook/react/commit/154a8cf32 )**: Fix reference to wrong variable //<Andrew Clark>//
- **[6736a38b9](https://github.com/facebook/react/commit/6736a38b9 )**: Add single source of truth for package versions ([#21608](https://github.com/facebook/react/pull/21608)) //<Andrew Clark>//
- **[86715efa2](https://github.com/facebook/react/commit/86715efa2 )**: Resolve the true entry point during tests ([#21505](https://github.com/facebook/react/pull/21505)) //<Sebastian Markbåge>//
- **[a8a4742f1](https://github.com/facebook/react/commit/a8a4742f1 )**: Convert ES6/TypeScript/CoffeeScript Tests to createRoot + act ([#21598](https://github.com/facebook/react/pull/21598)) //<Sebastian Markbåge>//
- **[1d3558965](https://github.com/facebook/react/commit/1d3558965 )**: Disable deferRenderPhaseUpdateToNextBatch by default ([#21605](https://github.com/facebook/react/pull/21605)) //<Sebastian Markbåge>//
- **[a8964649b](https://github.com/facebook/react/commit/a8964649b )**: Delete an unused field ([#21415](https://github.com/facebook/react/pull/21415)) //<okmttdhr>//
- **[76f85b3e5](https://github.com/facebook/react/commit/76f85b3e5 )**: Expose Fizz in stable builds ([#21602](https://github.com/facebook/react/pull/21602)) //<Dan Abramov>//
- **[e16d61c30](https://github.com/facebook/react/commit/e16d61c30 )**: [Offscreen] Mount/unmount layout effects ([#21386](https://github.com/facebook/react/pull/21386)) //<Andrew Clark>//
- **[63091939b](https://github.com/facebook/react/commit/63091939b )**: OSS feature flag updates ([#21597](https://github.com/facebook/react/pull/21597)) //<Brian Vaughn>//
- **[efbd69b27](https://github.com/facebook/react/commit/efbd69b27 )**:  Define global __WWW__ = true flag during www tests ([#21504](https://github.com/facebook/react/pull/21504)) //<Sebastian Markbåge>//
- **[28625c6f4](https://github.com/facebook/react/commit/28625c6f4 )**: Disable strict effects for legacy roots (again) ([#21591](https://github.com/facebook/react/pull/21591)) //<Brian Vaughn>//
- **[3c2341416](https://github.com/facebook/react/commit/3c2341416 )**: Update jest to v26 ([#21574](https://github.com/facebook/react/pull/21574)) //<Sebastian Silbermann>//
- **[0d493dcda](https://github.com/facebook/react/commit/0d493dcda )**: Removed _debugID field from Fiber - Issue #21558 ([#21570](https://github.com/facebook/react/pull/21570)) //<Pulkit Sharma>//
- **[7841d0695](https://github.com/facebook/react/commit/7841d0695 )**: Enable the updater-tracking feature flag in more builds ([#21567](https://github.com/facebook/react/pull/21567)) //<Brian Vaughn>//
- **[6405efc36](https://github.com/facebook/react/commit/6405efc36 )**: Enabled Profiling feature flags for OSS release ([#21565](https://github.com/facebook/react/pull/21565)) //<Brian Vaughn>//

Changelog:
[General][Changed] - React Native sync for revisions 2d8d133...0eea577

jest_e2e[run_all_tests]

Reviewed By: bvaughn

Differential Revision: D28932083

fbshipit-source-id: 012c1bfb857ed59d7283334d633f1cce8ec50360
2021-06-07 11:42:50 -07:00
Tim Yung c774f9e97e Animated: Support Concurrent Rendering
Summary:
Creates a `useAnimatedProps` hook that is compatible with concurrent mode, and uses this in `createAnimatedComponent_EXPERIMENTAL`.

Changelog:
[Internal]

Reviewed By: lunaleaps

Differential Revision: D28390393

fbshipit-source-id: d8aa471507a5d096832b93caf63a24f71733deda
2021-06-06 17:08:55 -07:00
Tim Yung cb25638a0e RN: Create `useRefEffect` Utility
Summary:
Creates `useRefEffect` which will be used by components in React Native.

Changelog:
[Internal]

Reviewed By: lunaleaps

Differential Revision: D28862440

fbshipit-source-id: 50e0099c1a3e0a0f506bf82e68984fc5a032f101
2021-06-06 17:08:55 -07:00
Tim Yung 0b994ac19c RN: Create `useMergeRefs` Utility
Summary:
Creates `useMergeRefs` which will be used by components in React Native.

Changelog:
[Internal]

Reviewed By: lunaleaps

Differential Revision: D28862439

fbshipit-source-id: 60eac7bcd6cceb06ee82181386b4712d642f5404
2021-06-06 17:08:55 -07:00
Andrei Shikov 29bc96135b Back out "remove defaultProps from picker of components"
Summary:
Reverts changes that were causing insta crashes on Android surfaces.

Changelog: [Internal]

Reviewed By: TheSavior

Differential Revision: D28924291

fbshipit-source-id: eebaf9d28b40e4bb4168af1ceafd5ee29935c81c
2021-06-06 11:10:50 -07:00
Kermit b4cde15cdb remove defaultProps from picker of components (#31644)
Summary:
Remove `defaultProps` from `Picker` of components, replace it with destructuring assignment.

## Changelog

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

[JavaScript] [Changed] - Remove defaultProps from picker

close https://github.com/facebook/react-native/issues/31603

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

Test Plan: all test suite and CI passes.

Reviewed By: TheSavior

Differential Revision: D28886320

Pulled By: lunaleaps

fbshipit-source-id: d88a922dffeebe2bce019250d460b5e43a0af562
2021-06-04 21:00:17 -07:00
Shuhao Zhang f3b8d4976f Bug fix: <TextInput> content is reset when emoji is entered at the max length
Summary:
When maxLength is defined in <TextInput>, if the last character at max length is an emoji, the content of the input is cleared:

{F620865178} {F620865237}

Related Github issues:

https://github.com/facebook/react-native/issues/10929
https://github.com/facebook/react-native/issues/10964

## Root cause:

When NSString was created, unicode characters were 16-bit long, so Objective-C considers every unicode character as 16-bit. However, unicode was later extended to more than 16bit, for example, emojis, which causes NSString substring method cuts off at the wrong position.

Example:

```
NSString *s = @"abc{emoji:1f601}";
NSInteger len = s.length; //length is 5 (as {emoji:1f601} occupies two 16-bit characters)
NSString *s3 = [s substringToIndex: 3]; //s3 is "abc"
NSString *s4 = [s substringToIndex: 4]; //s4 is null!
```

If string s, "abc{emoji:1f601}", is entered in <TextInput>, which has max length 4, it will truncate the string to the first 4 characters, "cutting" the emoji in half which causes encoding error and returns null. The text input is cleared.

## Solution:

If the character at max length is longer than 16-bit, truncate the character BEFORE it instead. In the previous example, truncate till index 3 instead of 4. The end result will be "abc" and the emoji is dropped.

## Changelog:

[iOS] [Fixed] - <TextInput> content is reset when emoji is entered at the max length

Reviewed By: p-sun

Differential Revision: D28821909

fbshipit-source-id: 4720d864970b554160ed5388f65b352ce95a6199
2021-06-04 13:40:42 -07:00
Nick Gerleman 41f145fa47 Add testID to NewAppScreen Header Component (#31652)
Summary:
The RN OSS release process includes manual testing that a new template app can be started under various platforms, JS engines, etc. This should ideally be automated, to help reduce wasted engineer-time, and to allow reliably increasing release velocity.

`react-native-windows` does already have tests to create and build template projects across our matrix, but they do not do any runtime validation on the newly created app. Adding a `testID` to the new app screen header gives us something to search for in black-box testing to validate that the app started successfully. This should help catch cases where a sample project in repo has changes not reflected in a newly created template app.

## Changelog

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

[Internal] [Added] - Add testID to NewAppScreen Header Component

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

Test Plan: Did not manually validate the change, though did check that `ImageBackground` forwards props to `Image`, and that `Image` is aware of `testID` and will forward to the native component.

Reviewed By: kacieb

Differential Revision: D28907197

Pulled By: p-sun

fbshipit-source-id: db3974294afba25878383f1955cad37b69d95da3
2021-06-04 13:14:48 -07:00
Rubén Norte 249b8d21c4 Fix inline requires for ESM in react-native-github
Summary:
This fixes how ES modules are handled in Jest tests in the react-native codebase.

They caused some problems before because `import` statements weren't inlined as `require` calls were, so there were some errors in tests when migrating from CommonJS to ESM.

This changes the transform that Jest uses to inline import statements the same way, so we can migrate everything without issues in tests.

Changelog: [Internal]

Reviewed By: kacieb

Differential Revision: D28899692

fbshipit-source-id: 027690f57ca3b5613c261a1089c0635af76662b2
2021-06-04 13:05:11 -07:00
Kacie Bawiec 7f3f868020 Convert KeyboardAvoidingView to use export default
Summary:
Changelog:
[General][Changed] Convert KeyboardAvoidingView to use export default

Reviewed By: TheSavior

Differential Revision: D28884111

fbshipit-source-id: e2d144505536362b405b833c9ebad530f6dcacb5
2021-06-04 12:56:17 -07:00
Tim Yung 819b926beb Animated: Create Experimental Stub
Summary:
Creates an experimental stub implementation of `createAnimatedComponent` to be implemented in future commits.

Changelog:
[Internal]

Reviewed By: lunaleaps, kacieb

Differential Revision: D28799738

fbshipit-source-id: dc3fbee557db353de6807bd87561f8f372d7cab5
2021-06-02 22:36:13 -07:00
Tim Yung 8ccc4064c5 Animated: Setup Experiment Injection
Summary:
Sets up an injection mechanism for experimenting in production with an alternate implementation of `createAnimatedComponent`.

This will be used to implement and refine a new `createAnimatedComponent` that is compatible with concurrent rendering.

Changelog:
[Internal]

Reviewed By: lunaleaps

Differential Revision: D28799739

fbshipit-source-id: 46ba2dd6137f7bf73ce8a659698533ed3985516f
2021-06-02 22:36:13 -07:00
Håkon Knutzen 58444c74f5 Custom NSURLSession configuration (#27701)
Summary:
While it is possible in the React Native implementation for Android to provide a custom configuration for HTTP requests, the iOS implementation does not allow for the same customization. As the NSURLSession used for HTTP requests on iOS is configured internally, one may for instance not supply an ephemeral configuration for HTTP requests. Other concerns related to the given problem have been addressed in the community: https://github.com/react-native-community/discussions-and-proposals/issues/166. I did make a PR with an RFC in the community repo, but after some discussion in the said repo, I figured I might as well make a PR with a suggestion :)

## Changelog

[iOS] [Added] - Allow for configuring the NSURLSessionConfiguration

Implement a C function `RCTSetCustomNSURLSessionConfigurationProvider` which gives the app programmer the ability to provide a block which provides an NSURLSessionConfiguration that will be used for all HTTP requests instead of the default configuration. The provided block will be called when the session configuration is needed.

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

Test Plan: Unsure if this can be tested in any other way than uncommenting the example code in `RNTester/RNTester/AppDelegate.mm`.

Reviewed By: yungsters

Differential Revision: D28680384

Pulled By: JoshuaGross

fbshipit-source-id: ae24399955581a1cc9f4202f0f6f497bfe067a5c
2021-06-02 18:39:52 -07:00
Janic Duplessis 1538fa4455 Fix Switch ref forwarding (#31629)
Summary:
Since moving Switch to a function component it is no longer possible to get the native switch ref. This adds forwardRef so it is possible again.

## Changelog

[General] [Fixed] - Fix Switch ref forwarding

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

Test Plan: Tested the change in an app using react-native-gesture-handler, which tries to set a ref on Switch. Also made sure flow still passes.

Reviewed By: TheSavior

Differential Revision: D28839605

Pulled By: lunaleaps

fbshipit-source-id: 1fee86145caeabb60c0010bb9062dddca419f7ca
2021-06-02 14:44:52 -07:00
Tim Yung 249435c4d5 RN: Cleanup `collapsable` Experiment (iOS)
Summary:
With the conclusion of D27944688 (925af8ddea), this backs out the experiment introduced via D27987619 (f598dd0ee3).

Changelog:
[Internal]

Reviewed By: kacieb

Differential Revision: D28799741

fbshipit-source-id: 607ee85db26326e13dd8ddb52f5aebb732e9a354
2021-06-02 09:43:41 -07:00
Tim Yung e4a4c4d6d7 ExceptionsManager: Report Fatal "Warnings"
Summary:
As suggested by motiz88 on D28421692 (883e0d5752), make sure to still report fatal "warnings".

Changelog:
[General][Fixed] Report fatal errors even if its `type` is "warn".

Reviewed By: motiz88

Differential Revision: D28815228

fbshipit-source-id: 8d3b77958ef687a4ce64bdfccbf6ce2dc5557eaf
2021-06-02 01:31:50 -07:00
Tim Yung b85572af6e RN: Cleanup `TextInjection`
Summary:
Deletes `TextInjection` which is no longer needed.

Changelog:
[Internal]

Reviewed By: kacieb

Differential Revision: D28799740

fbshipit-source-id: 5dfbff23db3f73153aa0c3df25fec5acfb4977e4
2021-06-01 15:29:59 -07:00
Daniel Sainati 74d5d03dbd pre-suppress Flow errors in xplat ahead of 153 release
Summary:
This pre-suppresses the 153 error diff ahead of its release, since it is large.

Changelog: [Internal]

Reviewed By: mroch

Differential Revision: D28754374

fbshipit-source-id: 1806f53bc7d804644d434583a2dcd6da63d00328
2021-06-01 09:01:26 -07:00
Paige Sun 8a5ee96354 Remove log info when TurboModule cannot be found
Summary: Changelog: [Internal]

Reviewed By: rubennorte

Differential Revision: D28749474

fbshipit-source-id: 28079904023f23e88b4f5bca45d7e600171e929e
2021-05-27 10:42:34 -07:00
Dennis Urtubia 44717152ca Adds accessiblity actions on core components (#31532)
Summary:
Android: Adding custom actions (https://github.com/facebook/react-native/issues/30854).
Adds accessiblity actions on core components (Button, TextInput, Text, and Picker).

## Changelog
[General] [Added] - Adds accessiblity actions on core components

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

Test Plan:
- `npm test`
- Rendering of components on `RNTesterApp` using talkback:
    - Check if accessibility actions were available;
    ![image](https://user-images.githubusercontent.com/33161939/118381843-a668c180-b5c5-11eb-9ce4-016a49157dc5.png)
    - Trigger `activate` action for all components;
    ![image](https://user-images.githubusercontent.com/33161939/118381736-7bca3900-b5c4-11eb-82fb-32e824e1b38c.png)

## Notes
- For `TextInput` an unexpected error is raised:
![image](https://user-images.githubusercontent.com/33161939/118381603-d1054b00-b5c2-11eb-93f2-1d5730ee2d24.png)

Reviewed By: kacieb

Differential Revision: D28654294

Pulled By: lunaleaps

fbshipit-source-id: 80dd3f3c7aa27bbaf16ef12997e8f55952a02eb2
2021-05-26 16:49:11 -07:00
Evgen Filatov 34b8d07bfb Back out "iOS: 6/7 JS only. Remove logic for visible prop in JS, and pass it to native"
Summary:
Changelog: [Internal]

back out D28138741 (40706e0546)

Differential Revision: D28709374

fbshipit-source-id: c7085588ab4573c0ca18a2324f8e1ed40384753c
2021-05-26 10:35:10 -07:00
Andrew Coates 6b91ae73cd localeIdentifier missing from flow type of I18nManager (#31589)
Summary:
23d9bf1a24 looks like it accidently removed `localeIdentifier` from I18nManager.

## 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] - Re-added localeIdentifier to I18nManager constants

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

Reviewed By: GijsWeterings

Differential Revision: D28690202

Pulled By: fkgozali

fbshipit-source-id: 543a491f89789bca5629e1251c94fd055ec4a801
2021-05-26 00:04:19 -07:00
Rick Hanlon f684d99a50 React Native sync for revisions 459c34f...1e4c353
Summary:
This sync includes the following changes:
- **[2d8d133e1](https://github.com/facebook/react/commit/2d8d133e1 )**: Turn on enableSyncDefaultUpdates everywhere ([#21548](https://github.com/facebook/react/pull/21548)) //<Ricky>//

Changelog:
[General][Changed] - React Native sync for revisions 459c34f...2d8d133

jest_e2e[run_all_tests]

Reviewed By: gaearon

Differential Revision: D28654355

fbshipit-source-id: c245f272e7f8d4215539fa90602b76cad67632fe
2021-05-25 10:24:00 -07:00
Paige Sun 40706e0546 iOS: 6/7 JS only. Remove logic for visible prop in JS, and pass it to native
Summary: Changelog: [Fabric][iOS] Use non-global event emitter for onDismiss event for <Modal>

Reviewed By: fkgozali

Differential Revision: D28138741

fbshipit-source-id: df9069e523f2e8bd1b85f3d9be55cfd300f89d66
2021-05-25 10:07:10 -07:00
Rick Hanlon d2a6d88790 React Native sync for revisions 3169430...459c34f
Summary:
This sync includes the following changes:
- **[459c34fde](https://github.com/facebook/react/commit/459c34fde )**: Add flag concurrent root ([#21552](https://github.com/facebook/react/pull/21552)) //<Samuel Susla>//

Changelog:
[General][Changed] - React Native sync for revisions 3169430...459c34f

jest_e2e[run_all_tests]

Reviewed By: mdvacca

Differential Revision: D28641463

fbshipit-source-id: 0930a8f82e49b222582995e4c8b2c8a41564bf53
2021-05-24 17:58:40 -07:00
Rick Hanlon 1c5d0dc605 React Native sync for revisions b8fda6c...ebcec3c
Summary:
This sync includes the following changes:
- **[316943091](https://github.com/facebook/react/commit/316943091 )**: Make StrictMode double rendering flag static for FB/www ([#21517](https://github.com/facebook/react/pull/21517)) //<Brian Vaughn>//
- **[e0f89aa05](https://github.com/facebook/react/commit/e0f89aa05 )**: Clean up Scheduler forks ([#20915](https://github.com/facebook/react/pull/20915)) //<Ricky>//
- **[5890e0e69](https://github.com/facebook/react/commit/5890e0e69 )**: Remove data-reactroot from server rendering and hydration heuristic ([#20996](https://github.com/facebook/react/pull/20996)) //<Sebastian Markbåge>//
- **[46491dce9](https://github.com/facebook/react/commit/46491dce9 )**: [Bugfix] Prevent already-committed setState callback from firing again during a rebase ([#21498](https://github.com/facebook/react/pull/21498)) //<Andrew Clark>//
- **[b770f7500](https://github.com/facebook/react/commit/b770f7500 )**: lint-build: Infer format from artifact filename ([#21489](https://github.com/facebook/react/pull/21489)) //<Andrew Clark>//
- **[2bf4805e4](https://github.com/facebook/react/commit/2bf4805e4 )**: Update entry point exports ([#21488](https://github.com/facebook/react/pull/21488)) //<Brian Vaughn>//

Changelog:
[General][Changed] - React Native sync for revisions b8fda6c...ebcec3c

jest_e2e[run_all_tests]

Reviewed By: JoshuaGross

Differential Revision: D28572047

fbshipit-source-id: eb09c0358edb7fbf241333ea9c08724748906fea
2021-05-24 17:58:40 -07:00
Ramanpreet Nara a2ab3fccd0 Migrate RCTNativeAnimatedTurboModule to initialize
Summary: Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D28595948

fbshipit-source-id: a12207f8e0c11e1e105225404450ff335242aba7
2021-05-21 14:49:51 -07:00
Ramanpreet Nara ed86891d01 Migrate NativeModules to initialize
Summary:
This migrates all ObjC NativeModule setBridge: calls to the bridge compatible initialize: call. I filtered out ViewManagers.

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D28595520

fbshipit-source-id: b0e5dd681fb3563894f1aa3da1728f0c694f04bb
2021-05-21 14:49:51 -07:00
Sladyn Nunes 35dd86180b Fix/30842 - Add accessibilityState prop in slider (#31145)
Summary:
Accessibility service does not announce "selected" on accessibilityState = {selected: true} of the Button Component.
Issue link - https://github.com/facebook/react-native/issues/30956

## 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] [Added] - Add accessibilityState prop to Slider component

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

Test Plan:
Verified accessibility states are read by voiceover and talkback. Some state values aren't handled by iOS and have been identified.

Added snapshot tests to test accessibilityState.disabled = disabled values

`js1 test Slider-test`

Reviewed By: yungsters

Differential Revision: D28337723

Pulled By: lunaleaps

fbshipit-source-id: 72a54d8d9dcf1fafb9785c81da99f32a21f3df00
2021-05-21 13:35:56 -07:00
Tim Yung 883e0d5752 RN: Suppress Warning-Like Errors
Summary:
Changes `ExceptionsManager` in React Native so that errors with a `type` property equal to `'warn'` are not reported.

This change is banking on the fact that `type` is a non-standard and uncommon property on `Error` instances. If this ends up being problematic, we can instead change this to use a `unstable_type` or `unstable_level` property instead.

Changelog:
[General][Changed] - ExceptionsManager will no longer report exceptions with `type === 'warn'`.

Reviewed By: motiz88

Differential Revision: D28421692

fbshipit-source-id: 3ca19e29f32c8c5cad6dac637dcb930944fb24ed
2021-05-20 19:08:25 -07:00
Erich Graham fa4045e4dd Add ios_assume_nonnull flag to react native codegen library (#31543)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/31543

Changelog:
[iOS][Added] - Description

When compiling iOS apps with flag `-Wnullability-completeness` (like Lightspeed app and soon Instagram), Objective-C headers are required to either have full *explicit* nullability annotations on all members of its public API, or none at all; partially annotated headers will fail to build that module.

RN native modules are currently generated with *partial* annotations.  This works today because most apps are not compiled with `-Wnullability-completeness` turned on. But when we flip the switch for Instagram, the app doesn't build due to importing these RN partially annotated modules.

JavsScript Flow types are implied nonnull, and the current RN codegen translates Flow's [maybe/optional](https://flow.org/en/docs/types/maybe/) type to Obj-C `_Nullable` annotation, and everything else without an explicit Obj-C annotation. However this creates a mismatch with the Obj-C type system, where the implied default is *unannotated*, which is handled differently from nonnull when built with the nullability compiler flags.

There is a simple Obj-C macro that automatically adds *explicit nonnull* annotations to all members in a header: `NS_ASSUME_NONNULL_BEGIN` / `NS_ASSUME_NONNULL_END`. If we add this to *all* RN-generated headers, however, we run into issues:
1) We may erroneously assume any previously-unannotated header was meant to be nonnull and cause future bugs
2) Another compiler flag (`-Wnullable-to-nonnull-conversion`) statically analyzes Obj-C implementation code to prevent us from ever passing null to one of these headers. Much existing Obj-C code will break here, and it's ambiguous if these are true or false positives because of the first point.

Instead, in this diff we add a new BUCK flag `ios_assume_nonnull` to let module authors opt into automatic nonnull for unannotated members so that Obj-C headers are generated correctly in alignment with Flow's type system. We can migrate all libraries individually as needed and eventually make this the RN native codegen default.

Reviewed By: RSNara

Differential Revision: D28396446

fbshipit-source-id: ad3a3a97ab19183df4ef504b1c3140596c8f69ca
2021-05-20 10:07:37 -07:00
Tim Yung ede74e5936 RN: Cleanup `ExtendedError` Type
Summary:
Cleans up the `ExtendedError` internal type and moves it into a separate module instead of burying it in `parseErrorStack.js`.

Also, this resolves some unnecessary Flow type suppressions.

Changelog:
[Internal]

Reviewed By: GijsWeterings

Differential Revision: D28470299

fbshipit-source-id: 04093243f06f67f41567270ef9778f01c7549b05
2021-05-19 12:30:41 -07:00
Tim Yung 0dba0aff18 ExceptionsManager: Minor Code Cleanup
Summary:
Cleans up `reactConsoleErrorHandler` in `ExceptionsManager` using modern language features, and fixes a minor edge case with how warning-like errors are handled.

Changelog:
[General][Fixed] - Avoid downgrading `console.error` when passed warning-like objects.

Reviewed By: GijsWeterings

Differential Revision: D28418488

fbshipit-source-id: 394e8608c2c81c794c9a0fc155142dcfcfe1c661
2021-05-19 12:30:41 -07:00
Connor Tumbleson eeb8e5829e feat: add Android 12 BLUETOOTH_[CONNECT/SCAN] to PermissionsAndroid (#31488)
Summary:
This PR adds BLUETOOTH_CONNECT / BLUETOOTH_SCAN, which showed up in the latest Android 12 Preview build as new `dangerous` permissions requiring approval for them.

https://developer.android.com/reference/android/Manifest.permission.html#BLUETOOTH_CONNECT
https://developer.android.com/reference/android/Manifest.permission.html#BLUETOOTH_SCAN

## Changelog

[Android] [Changed] - Add BLUETOOTH_CONNECT and BLUETOOTH_SCAN to PermissionsAndroid

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

Test Plan:
```
PermissionsAndroid.BLUETOOTH_CONNECT === 'android.permission.BLUETOOTH_CONNECT'
PermissionsAndroid.BLUETOOTH_SCAN === 'android.permission.BLUETOOTH_SCAN'
```

Reviewed By: yungsters

Differential Revision: D28449023

Pulled By: mdvacca

fbshipit-source-id: 000fc31f5db2996d04a2a5ec7db7c71d0425f52a
2021-05-19 12:23:39 -07:00
Subramanya Chakravarthy ea609defe8 Disable TouchableOpacity when accessibility disabled is set (#31108)
Summary:
When using a screen reader the TouchableOpacity component disables click functionality.
Fixes Issue https://github.com/facebook/react-native/issues/30951

## Changelog

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

[Android] [Changed] - Message

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

Test Plan: Added Exmple to Accessibility

Reviewed By: yungsters

Differential Revision: D28334356

Pulled By: kacieb

fbshipit-source-id: 3a3e8efaf57272d2091392f6d7d3e0ba0f2a9adc
2021-05-18 13:35:21 -07:00
Tim Yung ebc89bfb78 RN: Cleanup `ReactFiberErrorDialog`
Summary:
Minor cleanup of `ReactFiberErrorDialog` with no behavior changes.

Changelog:
[Internal]

Reviewed By: GijsWeterings

Differential Revision: D28423265

fbshipit-source-id: 796777ca2c26d6d7cfae956299786151c74e937f
2021-05-17 01:04:32 -07:00
Rubén Norte c6d77a8570 Make some modules flow strict
Summary:
TSIA

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D28412774

fbshipit-source-id: 899a78e573bb49633690275052d5e7cb069327fb
2021-05-14 04:23:21 -07:00
Tien Pham 129180c77b Fix natively driven animations not getting reset properly (#29585)
Summary:
Fixes https://github.com/facebook/react-native/issues/28517

Animated.loop needs to reset the animation after each iteration but currently, natively driven animations are not getting reset properly.
## Changelog

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

[General] [Fixed] - Fix natively driven animations not getting reset properly

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

Test Plan: Tested within RNTester

Reviewed By: kacieb

Differential Revision: D28383538

Pulled By: yungsters

fbshipit-source-id: 40790ad8f825c402afc3515ef6afc00570704109
2021-05-13 00:43:47 -07:00
Andrei Shikov 10b9308eb9 React Native sync for revisions 2a7bb41...b8fda6c
Summary:
This sync includes the following changes:
- **[b8fda6cab](https://github.com/facebook/react/commit/b8fda6cab )**: [React Native] Set allowConcurrentByDefault = true ([#21491](https://github.com/facebook/react/pull/21491)) //<Ricky>//
- **[1bb8987cc](https://github.com/facebook/react/commit/1bb8987cc )**: Renamed function in error log issue #21446 ([#21449](https://github.com/facebook/react/pull/21449)) //<faebzz>//
- **[bd070eb2c](https://github.com/facebook/react/commit/bd070eb2c )**: Enable setJSResponder/setIsJSResponder for React Native Fabric ([#21439](https://github.com/facebook/react/pull/21439)) //<Joshua Gross>//
- **[e9a4a44aa](https://github.com/facebook/react/commit/e9a4a44aa )**: Add back root override for strict mode ([#21428](https://github.com/facebook/react/pull/21428)) //<Ricky>//
- **[d1542de3a](https://github.com/facebook/react/commit/d1542de3a )**: Unify React.memo and React.forwardRef display name logic ([#21392](https://github.com/facebook/react/pull/21392)) //<Brian Vaughn>//
- **[9a130e1de](https://github.com/facebook/react/commit/9a130e1de )**: StrictMode includes strict effects by default ([#21418](https://github.com/facebook/react/pull/21418)) //<Brian Vaughn>//
- **[15fb8c304](https://github.com/facebook/react/commit/15fb8c304 )**: createRoot API is no longer strict by default ([#21417](https://github.com/facebook/react/pull/21417)) //<Brian Vaughn>//
- **[aea7c2aab](https://github.com/facebook/react/commit/aea7c2aab )**: Re-land "Support nesting of startTransition and flushSync (alt) ([#21149](https://github.com/facebook/react/pull/21149))" //<Andrew Clark>//
- **[bacc87068](https://github.com/facebook/react/commit/bacc87068 )**: Re-land "Flush discrete passive effects before paint ([#21150](https://github.com/facebook/react/pull/21150))" //<Andrew Clark>//
- **[098600c42](https://github.com/facebook/react/commit/098600c42 )**: Re-land "Fix: flushSync changes priority inside effect ([#21122](https://github.com/facebook/react/pull/21122))" //<Andrew Clark>//
- **[df420bc0a](https://github.com/facebook/react/commit/df420bc0a )**: Re-land "Delete LanePriority type ([#21090](https://github.com/facebook/react/pull/21090))" //<Andrew Clark>//
- **[ab5b37927](https://github.com/facebook/react/commit/ab5b37927 )**: Re-land "Clean up host pointers in level 2 of clean-up flag ([#21112](https://github.com/facebook/react/pull/21112))" //<Andrew Clark>//
- **[fd907c1f1](https://github.com/facebook/react/commit/fd907c1f1 )**: Re-land "Use highest priority lane to detect interruptions ([#21088](https://github.com/facebook/react/pull/21088))"" //<Andrew Clark>//
- **[269dd6ec5](https://github.com/facebook/react/commit/269dd6ec5 )**: subtreeFlag warning: Fix legacy suspense false positive ([#21388](https://github.com/facebook/react/pull/21388)) //<Andrew Clark>//
- **[9e9dac650](https://github.com/facebook/react/commit/9e9dac650 )**: Add unstable_concurrentUpdatesByDefault ([#21227](https://github.com/facebook/react/pull/21227)) //<Ricky>//
- **[86f3385d9](https://github.com/facebook/react/commit/86f3385d9 )**: Revert "Use highest priority lane to detect interruptions ([#21088](https://github.com/facebook/react/pull/21088))" //<Andrew Clark>//
- **[c6702656f](https://github.com/facebook/react/commit/c6702656f )**: Revert "Clean up host pointers in level 2 of clean-up flag ([#21112](https://github.com/facebook/react/pull/21112))" //<Andrew Clark>//
- **[1bd41c664](https://github.com/facebook/react/commit/1bd41c664 )**: Revert "Delete LanePriority type ([#21090](https://github.com/facebook/react/pull/21090))" //<Andrew Clark>//
- **[e7e0a90bd](https://github.com/facebook/react/commit/e7e0a90bd )**: Revert "Fix: flushSync changes priority inside effect ([#21122](https://github.com/facebook/react/pull/21122))" //<Andrew Clark>//
- **[7bac7607a](https://github.com/facebook/react/commit/7bac7607a )**: Revert "Flush discrete passive effects before paint ([#21150](https://github.com/facebook/react/pull/21150))" //<Andrew Clark>//
- **[207d4c3a5](https://github.com/facebook/react/commit/207d4c3a5 )**: Revert "Support nesting of startTransition and flushSync (alt) ([#21149](https://github.com/facebook/react/pull/21149))" //<Andrew Clark>//

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

jest_e2e[run_all_tests]

Reviewed By: yungsters

Differential Revision: D28351439

fbshipit-source-id: 29620f96c9fb9f02b0d856111d3882d3c69fd1c5
2021-05-11 11:20:10 -07:00
Tim Yung 0bbb51e8c2 Animated: Remove Erroneous `AnimatedProps` Check
Summary:
This check will never pass because `this._propsAnimated` contains an instance of `AnimatedProps`, but `nextProps` contains an object literal containing the new props.

Changelog:
[Internal]

Reviewed By: JoshuaGross, TheSavior, kacieb

Differential Revision: D28271627

fbshipit-source-id: c563eec1eeaee5eb84bb01525313b46db502225a
2021-05-10 17:02:59 -07:00
Tim Yung faf4550047 Animated: Decouple `__attach` from `new AnimatedProps`
Summary:
Decouples `__attach` from the constructor in `AnimatedProps`.

This change will enable the instantiation of `AnimatedProps` (and subsequent invocation of `__getValue()`) without having to trigger side effects until after mount or update. This is important in order for `Animated` to ever become safe for Concurrent Mode.

Changelog:
[Internal]

Reviewed By: lunaleaps

Differential Revision: D28271628

fbshipit-source-id: 6ccfed6de79382cecdfa6939c7dad3134e1ecaaa
2021-05-10 17:02:59 -07:00
Rubén Norte d87542ee4c Create usePerformanceLogger hook
Summary:
Having to import `useContext` every time is annoying, so this just creates a convenience function to get it.

Changelog: [Internal]

Reviewed By: GijsWeterings

Differential Revision: D28258305

fbshipit-source-id: 7293478f9baa11711a541f987225108871688e0e
2021-05-10 07:21:25 -07:00
Tim Yung ae4946f983 Animated: Remove `Animated.__PropsOnlyForTests`
Summary:
Deletes `Animated.__PropsOnlyForTests` because it is unnecessary for actually testing `AnimatedProps`.

Changelog:
[General][Removed] - Removed `Animated.__PropsOnlyForTests`.

Reviewed By: kacieb

Differential Revision: D28271629

fbshipit-source-id: 7d4c83d72f7298ed43e3659126cb45d271c5dac7
2021-05-07 21:05:58 -07:00
Adrien HARNAY 1d924549ca Add onPressIn & onPressOut props to Text (#31288)
Summary:
I added onPressIn & onPressOut props to Text to help implement custom highlighting logic (e.g. when clicking on a Text segment). Since TouchableOpacity can't be nested in Text having custom lineHeights without bugs in some occasions, this modification helps to replicate its behavior.

## Changelog

[General] [Added] - Add onPressIn & onPressOut props to Text

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

Test Plan:
```
const [pressing, setPressing] = useState(false);

<Text
  onPressIn={() => setPressing(true)}
  onPressOut={() => setPressing(false)}
  style={{ opacity: pressing ? 0.5 : 1 }}
/>
```

Thanks in advance!

Reviewed By: yungsters

Differential Revision: D27945133

Pulled By: appden

fbshipit-source-id: 8342ca5f75986b4644a193d2f71eab3bc0ef1a5f
2021-05-06 12:42:00 -07:00
Kacie Bawiec 438a4cf59b Cleanup to ship ScrollViewStickyHeader experiment
Summary:
Changelog:
[General][Changed] Refactor ScrollViewStickyHeader to a functional component to remove unsafe lifecycles and mutations during render

Reviewed By: lunaleaps

Differential Revision: D28203776

fbshipit-source-id: 615c8e1cd9e9e26d25c7d02aee7e4a0bfc8ec6c3
2021-05-05 15:23:23 -07:00
David Vacca 873bd5b04c Delete registerGeneratedViewConfig API
Summary:
This diff deletes the registerGeneratedViewConfig API that is not used anymore.
This API was likely ONLY used internally at facebook, that's why I'm not deprecating it.

changelog: [Delete] Delete registerGeneratedViewConfig API

Reviewed By: fkgozali

Differential Revision: D28207558

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

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

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

Reviewed By: rickhanlonii

Differential Revision: D27999361

fbshipit-source-id: 1115ef6b71e08cc33743d205da0064fbe9a74a0e
2021-05-04 10:58:24 -07:00
Kacie Bawiec da899c0cc4 Add support for Toggle Button accessibilityRole
Summary:
Changelog:
[General][Added] Add support for "togglebutton" accessibilityRole

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

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

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

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

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

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

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

Reviewed By: nadiia

Differential Revision: D27976046

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

Reviewed By: kacieb

Differential Revision: D28127518

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

Reviewed By: kacieb

Differential Revision: D28127519

fbshipit-source-id: 402bee01e7f26722c376e8ed94ff4b5524d32379
2021-05-03 11:44:53 -07:00
Paige Sun 0932a0d775 iOS: 2/5 Remove use of bridge from Modal by dismissing with visible prop
Summary: Changelog: [Fabric][iOS][Fix] Remove use of bridge from Modal by dismissing Modal with visible prop

Reviewed By: sammy-SC

Differential Revision: D28074326

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

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

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

Reviewed By: sammy-SC

Differential Revision: D27977574

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

Reviewed By: JoshuaGross

Differential Revision: D28116333

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

Reviewed By: JoshuaGross

Differential Revision: D28116332

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

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

Reviewed By: fkgozali

Differential Revision: D28108804

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

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

Reviewed By: fkgozali

Differential Revision: D27983717

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

changelog: [internal] internal

Reviewed By: JoshuaGross

Differential Revision: D28117192

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

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

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

Changelog: [Internal]

Reviewed By: JoshuaGross

Differential Revision: D28100641

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

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

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

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

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

Changelog: [Internal]

Reviewed By: ShikaSD

Differential Revision: D28061384

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

TSIA

Reviewed By: ShikaSD

Differential Revision: D28061403

fbshipit-source-id: bb98fa2ccdd3f8e936bec95fbbbeace42664a608
2021-04-30 09:46:14 -07:00
Rick Hanlon 2482684080 Run sync from CI artifacts
Summary:
Runs an A:A react sync against the current revision to pick up the updates from the sync script.

Changelog: [Internal]

Reviewed By: yungsters, kacieb

Differential Revision: D28103715

fbshipit-source-id: 3593909e999bdceeb95423dc37dc0ee4282963d9
2021-04-29 20:39:28 -07:00
Xuan Huang c54aeccf1a Reflect Hermes release version from HermesBadge
Summary:
Changelog:
[General] - Reflect Hermes release version from HermesBadge

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

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

Reviewed By: nadiia

Differential Revision: D24436609

fbshipit-source-id: 8ba45be598a7d5af0e38f5044f9370fc7e1eb9a1
2021-04-29 17:13:29 -07:00
Neal Poole 33ef82ce6d Update validateBaseUrl to use latest regex
Summary:
Updating the regex to avoid a potential regular expression denial-of-service vulnerability.

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

Reviewed By: lunaleaps

Differential Revision: D25507604

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

Next step is to commit this to 0.64 release branch

allow-large-files

Changelog: [iOS] Fix builds on Xcode 12.5

Reviewed By: fkgozali

Differential Revision: D28071808

fbshipit-source-id: 236b66bf8294db0c76ff25b11632c1bf89525921
2021-04-29 10:39:25 -07:00
David Vacca 8eeb01686f Ship virtualizedlist remeasure fix
Summary:
This diff ships the virtualizedlist remeasure fix implemented in D27003249 (1bc06f18c6)

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

changelog: [internal] internal

Reviewed By: JoshuaGross

Differential Revision: D28072308

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

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

jest_e2e[run_all_tests]

Reviewed By: JoshuaGross

Differential Revision: D28063006

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

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

Reviewed By: RSNara

Differential Revision: D27932062

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

Annotate autolgob mode for apple library targets

Reviewed By: adamjernst

Differential Revision: D27890473

fbshipit-source-id: 75239c6c1871310e1ccd6576569161eb4163a3c1
2021-04-28 11:07:17 -07:00
Ramanpreet Nara 4c5182c1cc RCTNetworking: Use RCTModuleRegistry to load handlers
Summary:
## Context
A React Native application can configure its RCTNetworking by initializing it with id<RCTURLRequestHandler> objects.

Therefore, RCTNetworking supports this initializer:
```
- (instancetype)initWithHandlersProvider:(NSArray<id<RCTURLRequestHandler>> * (^)(void))getHandlers
```

Right now, all id<RCTURLRequestHandler> are NativeModules. So, they need to be loaded using the Bridge/TurboModuleManager.

## Problem
The method [that constructs RCTNetworking](https://www.internalfb.com/code/fbsource/[6530647879a5e6d5edcfad029b39879c87e97bb3]/fbobjc/Apps/Wilde/FBReactModule2/FBReactModuleAPI/FBReactModuleAPI/FBReactModule.mm?lines=1471) is shared between bridge mode and bridgeless mode. So, the shared constructor needs to know what infra to use to load the request handlers: the TurboModuleManager, when called from a bridgeless context; the bridge, when called from a bridge context. There's no easy way to let this shared constructor know what context it's being called from. We could fork the constructor, but that's not very clean.

## Changes
In this refactor, RCTNetworking gives its _handlersProvider its RCTModuleRegistry. If the module was instantiated in bridgeless mode, RCTModuleRegistry will use the TurboModuleManager. If the module was instantiated in bridge mode, RCTModuleRegistry will use the bridge. Using RCTModuleRegistry allows the _handlersProvider to load id<RCTURLRequestHandler> from correct infra, in both contexts.

Changelog: [iOS][Changed] - Give RCTNetworking handler provider block RCTModuleRegistry

Reviewed By: PeteTheHeat

Differential Revision: D28013000

fbshipit-source-id: 956d660771ab18f5e7f24fcc28792f9a217146e7
2021-04-27 15:03:05 -07:00
Ramanpreet Nara af6bcfa3ab RCTImageLoader: Use RCTModuleRegistry to load loaders/decoders
Summary:
## Context
A React Native application can configure its RCTImageLoader by initializing it with two different sets of objects:
- id<RCTImageURLLoader>
- id<RCTImageDataDecoder>

Therefore, RCTImageLoader supports this initializer:
```
- (instancetype)initWithRedirectDelegate:(id<RCTImageRedirectProtocol>)redirectDelegate
                         loadersProvider:(NSArray<id<RCTImageURLLoader>> * (^)(void))getLoaders
                        decodersProvider:(NSArray<id<RCTImageDataDecoder>> * (^)(void))getHandlers
```

Right now, both the id<RCTImageURLLoader>s and id<RCTImageDataDecoder>s are NativeModules. So, they need to be loaded using the Bridge/TurboModuleManager.

## Problem
The method [that constructs RCTImageLoader](https://www.internalfb.com/code/fbsource/[6530647879a5e6d5edcfad029b39879c87e97bb3]/fbobjc/Apps/Wilde/FBReactModule2/FBReactModuleAPI/FBReactModuleAPI/FBReactModule.mm?lines=1462-1469) is shared between bridge mode and bridgeless mode. So, the shared constructor needs to know what infra to use to load the loaders/decoders: the TurboModuleManager, when called from a bridgeless context; the bridge, when called from a bridge context. There's no easy way to let this shared constructor know what context it's being called from. We could fork the constructor, but that's not very clean.

## Changes
In this refactor, RCTImageLoader gives its loadersProvider and decodersProvider its RCTModuleRegistry. If the module was instantiated in bridgeless mode, RCTModuleRegistry will use the TurboModuleManager. If the module was instantiated in bridge mode, RCTModuleRegistry will use the bridge. Using RCTModuleRegistry allows these two blocks to load the RCTImageURLLoaders and RCTImageDataDecoder from correct infra, in both contexts.

Changelog: [iOS][Changed] - Give RCTImageURLLoader's loader/decoder provider blocks RCTModuleRegistry

Reviewed By: PeteTheHeat

Differential Revision: D28012999

fbshipit-source-id: 09c787923b57bbf72aff95b504f88ee1f2f44283
2021-04-27 15:03:05 -07:00
Andrei Shikov ef0db95300 Back out "Adjust animation batch numbers to be consistent when controlled by native"
Summary:
This change caused crashes in animations on some surfaces.

Changelog: [Internal]

Reviewed By: JoshuaGross

Differential Revision: D28013969

fbshipit-source-id: 95845c69d6e67d59582ea14ad08cbf42fd3e2f8f
2021-04-27 04:00:16 -07:00
Nadiia D 46ffe84453 Make RootTag an opaque type
Summary:
Changelog:
[General][Changed] Make the RootTag an opaque type

Reviewed By: yungsters

Differential Revision: D27992320

fbshipit-source-id: 2901f0e59f573106295b986fe04db227134235da
2021-04-26 22:57:55 -07:00
Kacie Bawiec 0afd71a18d Convert require to import in Libraries/Components
Summary:
Changelog:
[General][Changed] Convert require statements to use import from in Libraries/Components

Reviewed By: lunaleaps

Differential Revision: D27921557

fbshipit-source-id: 3f1618455a47a56c4a090f3ececfef88476c0b8a
2021-04-26 12:50:59 -07:00
Tim Yung f598dd0ee3 RN: Create Experiment for `collapsable` (iOS)
Summary:
Sets up an experiment that enables `collapsable` in Fabric for iOS. This will enable us to validate with production data that enabling the use of this prop does not cause unexpected regressions.

Changelog:
[internal]

Reviewed By: mdvacca

Differential Revision: D27987619

fbshipit-source-id: 9b1c0ff45bed09b1e72ad7d9c782f07bb4211cc6
2021-04-25 01:17:55 -07:00
Tim Yung b914153286 Animated: Delete `getNode()` on Refs
Summary:
In 0.62, `createAnimatedComponent` was changed to use `forwardRef` instead of requiring callers to use `ref.getNode()`. In order to preserve backward-compatibility, `ref.getNode()` was monkey-patched onto the returned ref, if possible, to return the `ref` and output a console warning.

Three major (well, technically, minor) releases later, we are dropping support for `getNode()`. Calling it on the `ref` of an animated component will begin to fail after this (unless the underlying component itself actually implements a `getNode()` method on its imperative handle).

Changelog:
[General][Removed] - Removed `getNode()` from animated component refs.

Reviewed By: nadiia

Differential Revision: D27979882

fbshipit-source-id: 885c3dbf4f2749c994fc2662dd6f16ff3dd887c7
2021-04-24 17:09:12 -07:00
Andrei Shikov bda032af6e Adjust animation batch numbers to be consistent when controlled by native
Summary:
D27682424 (ea1ff374de) updated how animated node batches are executed in Fabric. On Paper, these batches were controlled by native module in some places (batch was executed ~every 2 frames), but some animations were switching animation batching control to JS globally there as well.

This change updates two things:
- If batching is controlled by native, it makes sure batches are calculated correctly.
- At the same time, this change switches control for animation node batching to JS, aligning it with Fabric.

Changelog: [Internal]

Reviewed By: JoshuaGross, mdvacca

Differential Revision: D27939659

fbshipit-source-id: d6251bce2a303a4a007dc10297edc0175cc4b348
2021-04-23 15:07:35 -07:00
Lulu Wu de477a0df6 Register RCTEventEmitter as callable module for Venice
Summary:
## Context
Trying to fix this js error
```
com.facebook.errorreporting.lacrima.common.exception.LacrimaJavascriptException: Error: Module RCTEventEmitter has not been registered as callable. Did you forget to call `RN$registerCallableModule`?, js build: UNKNOWN
```
https://fburl.com/logview/fvc33d48

Changelog:
[General][Changed] - Register RCTEventEmitter as callable module for Venice

Reviewed By: PeteTheHeat

Differential Revision: D27969226

fbshipit-source-id: 8e807ee5b2ef447b0bb49fa2107352d89584c181
2021-04-23 13:32:05 -07:00
Andy Chou 266b21baf3 Update height for different UIDatePickerStyles
Summary:
Adding support for DatePickerStyles on iOS13.4+
Changelog:
[iOS][Added] - Expose UIDatePickerStyles as a prop for DatePickerIOS

Reviewed By: PeteTheHeat

Differential Revision: D27953279

fbshipit-source-id: a35adf245147467ecbacac3770b9c50836cea468
2021-04-22 22:27:22 -07:00
Andy Chou 2b62e19a78 iOS 14 Support new DatePicker styles
Summary:
Adding support for DatePickerStyles on iOS13.4+

Changelog:
[iOS][Added] - Expose UIDatePickerStyles as a prop for DatePickerIOS

Reviewed By: PeteTheHeat

Differential Revision: D27948608

fbshipit-source-id: fcc16c630148818d9db0c9eef8363f8592b13791
2021-04-22 22:27:22 -07:00
Rick Hanlon 96930fad13 Flip useTransition tuple
Summary:
This diff flips the order of the tuple returned by useTransition.

See here for more info: https://github.com/facebook/react/pull/20976

Changelog: internal

Reviewed By: gaearon

Differential Revision: D27928490

fbshipit-source-id: a1896f92ef24382012fa3be1ef043752e62b21e7
2021-04-21 20:29:34 -07:00
Rick Hanlon 42dceaf21c React Native sync for revisions f7cdc89...bd7f4a0
Summary:
This sync includes the following changes:
- **[bd7f4a013](https://github.com/facebook/react/commit/bd7f4a013 )**: Fix sloppy factoring in `performSyncWorkOnRoot` ([#21246](https://github.com/facebook/react/pull/21246)) //<Andrew Clark>//
- **[78120032d](https://github.com/facebook/react/commit/78120032d )**: Remove `flushDiscreteUpdates` from end of event ([#21223](https://github.com/facebook/react/pull/21223)) //<Andrew Clark>//
- **[a3a7adb83](https://github.com/facebook/react/commit/a3a7adb83 )**: Turn off enableSyncDefaultUpdates in test renderer ([#21319](https://github.com/facebook/react/pull/21319)) //<Ricky>//
- **[cdb6b4c55](https://github.com/facebook/react/commit/cdb6b4c55 )**: Only hide outermost host nodes when Offscreen is hidden ([#21250](https://github.com/facebook/react/pull/21250)) //<Brian Vaughn>//
- **[b9c6a2b30](https://github.com/facebook/react/commit/b9c6a2b30 )**: Remove LayoutStatic check from commit phase ([#21249](https://github.com/facebook/react/pull/21249)) //<Brian Vaughn>//
- **[af1a4cbf7](https://github.com/facebook/react/commit/af1a4cbf7 )**: Revert expiration for retry lanes ([#21300](https://github.com/facebook/react/pull/21300)) //<Andrew Clark>//
- **[cc4b431da](https://github.com/facebook/react/commit/cc4b431da )**: Mark boundary as client rendered even if aborting fallback ([#21294](https://github.com/facebook/react/pull/21294)) //<Sebastian Markbåge>//

Changelog:
[General][Changed] - React Native sync for revisions f7cdc89...bd7f4a0

jest_e2e[run_all_tests]

Reviewed By: JoshuaGross

Differential Revision: D27909257

fbshipit-source-id: 36ec4cf1de9df109f1fe1542031df10a693baae0
2021-04-21 09:58:51 -07:00
Rubén Norte 158e17f6a0 Fix incorrect warning on NativeEventEmitter when nativeModule is null
Summary: Changelog: [Internal]

Reviewed By: ShikaSD

Differential Revision: D27881851

fbshipit-source-id: 3b1cba618a86aff1e1c7ffbc0ea5d7047713d30a
2021-04-20 08:45:42 -07:00
Andrei Shikov de318cd318 React Native sync for revisions c9aab1c...f7cdc89
Summary:
This sync includes the following changes:
- **[f7cdc8936](https://github.com/facebook/react/commit/f7cdc8936 )**: Also turn off enableSyncDefaultUpdates in RN test renderer ([#21293](https://github.com/facebook/react/pull/21293)) //<Ricky>//
- **[4c9eb2af1](https://github.com/facebook/react/commit/4c9eb2af1 )**: Add dynamic flags to React Native ([#21291](https://github.com/facebook/react/pull/21291)) //<Ricky>//
- **[9eddfbf5a](https://github.com/facebook/react/commit/9eddfbf5a )**: [Fizz] Two More Fixes ([#21288](https://github.com/facebook/react/pull/21288)) //<Sebastian Markbåge>//
- **[11b07597e](https://github.com/facebook/react/commit/11b07597e )**: Fix classes ([#21283](https://github.com/facebook/react/pull/21283)) //<Sebastian Markbåge>//
- **[96d00b9bb](https://github.com/facebook/react/commit/96d00b9bb )**: [Fizz] Random Fixes ([#21277](https://github.com/facebook/react/pull/21277)) //<Sebastian Markbåge>//
- **[81ef53953](https://github.com/facebook/react/commit/81ef53953 )**: Always insert a dummy node with an ID into fallbacks ([#21272](https://github.com/facebook/react/pull/21272)) //<Sebastian Markbåge>//
- **[a4a940d7a](https://github.com/facebook/react/commit/a4a940d7a )**: [Fizz] Add unsupported Portal/Scope components ([#21261](https://github.com/facebook/react/pull/21261)) //<Sebastian Markbåge>//
- **[f4d7a0f1e](https://github.com/facebook/react/commit/f4d7a0f1e )**: Implement useOpaqueIdentifier ([#21260](https://github.com/facebook/react/pull/21260)) //<Sebastian Markbåge>//
- **[dde875dfb](https://github.com/facebook/react/commit/dde875dfb )**: [Fizz] Implement Hooks ([#21257](https://github.com/facebook/react/pull/21257)) //<Sebastian Markbåge>//
- **[a597c2f5d](https://github.com/facebook/react/commit/a597c2f5d )**: [Fizz] Fix reentrancy bug ([#21270](https://github.com/facebook/react/pull/21270)) //<Sebastian Markbåge>//
- **[15e779d92](https://github.com/facebook/react/commit/15e779d92 )**: Reconciler should inject its own version into DevTools hook ([#21268](https://github.com/facebook/react/pull/21268)) //<Brian Vaughn>//
- **[4f76a28c9](https://github.com/facebook/react/commit/4f76a28c9 )**: [Fizz] Implement New Context ([#21255](https://github.com/facebook/react/pull/21255)) //<Sebastian Markbåge>//
- **[82ef450e0](https://github.com/facebook/react/commit/82ef450e0 )**: remove obsolete SharedArrayBuffer ESLint config ([#21259](https://github.com/facebook/react/pull/21259)) //<Henry Q. Dineen>//
- **[dbadfa2c3](https://github.com/facebook/react/commit/dbadfa2c3 )**: [Fizz] Classes Follow Up ([#21253](https://github.com/facebook/react/pull/21253)) //<Sebastian Markbåge>//
- **[686b635b7](https://github.com/facebook/react/commit/686b635b7 )**: Prevent reading canonical property of null ([#21242](https://github.com/facebook/react/pull/21242)) //<Joshua Gross>//
- **[bb88ce95a](https://github.com/facebook/react/commit/bb88ce95a )**: Bugfix: Don't rely on `finishedLanes` for passive effects ([#21233](https://github.com/facebook/react/pull/21233)) //<Andrew Clark>//
- **[343710c92](https://github.com/facebook/react/commit/343710c92 )**: [Fizz] Fragments and Iterable support ([#21228](https://github.com/facebook/react/pull/21228)) //<Sebastian Markbåge>//
- **[933880b45](https://github.com/facebook/react/commit/933880b45 )**: Make time-slicing opt-in ([#21072](https://github.com/facebook/react/pull/21072)) //<Ricky>//
- **[b0407b55f](https://github.com/facebook/react/commit/b0407b55f )**: Support more empty types ([#21225](https://github.com/facebook/react/pull/21225)) //<Sebastian Markbåge>//
- **[39713716a](https://github.com/facebook/react/commit/39713716a )**: Merge isObject branches ([#21226](https://github.com/facebook/react/pull/21226)) //<Sebastian Markbåge>//
- **[8a4a59c72](https://github.com/facebook/react/commit/8a4a59c72 )**: Remove textarea special case from child fiber ([#21222](https://github.com/facebook/react/pull/21222)) //<Sebastian Markbåge>//
- **[dc108b0f5](https://github.com/facebook/react/commit/dc108b0f5 )**: Track which fibers scheduled the current render work ([#15658](https://github.com/facebook/react/pull/15658)) //<Brian Vaughn>//
- **[6ea749170](https://github.com/facebook/react/commit/6ea749170 )**: Fix typo in comment ([#21214](https://github.com/facebook/react/pull/21214)) //<inokawa>//
- **[b38ac13f9](https://github.com/facebook/react/commit/b38ac13f9 )**: DevTools: Add post-commit hook ([#21183](https://github.com/facebook/react/pull/21183)) //<Brian Vaughn>//
- **[b943aeba8](https://github.com/facebook/react/commit/b943aeba8 )**: Fix: Passive effect updates are never sync ([#21215](https://github.com/facebook/react/pull/21215)) //<Andrew Clark>//
- **[d389c54d1](https://github.com/facebook/react/commit/d389c54d1 )**: Offscreen: Use JS stack to track hidden/unhidden subtree state ([#21211](https://github.com/facebook/react/pull/21211)) //<Brian Vaughn>//
- **[c486dc1a4](https://github.com/facebook/react/commit/c486dc1a4 )**: Remove unnecessary processUpdateQueue ([#21199](https://github.com/facebook/react/pull/21199)) //<Sebastian Markbåge>//
- **[cf45a623a](https://github.com/facebook/react/commit/cf45a623a )**: [Fizz] Implement Classes ([#21200](https://github.com/facebook/react/pull/21200)) //<Sebastian Markbåge>//
- **[75c616554](https://github.com/facebook/react/commit/75c616554 )**: Include actual type of `Profiler#id` on type mismatch ([#20306](https://github.com/facebook/react/pull/20306)) //<Sebastian Silbermann>//
- **[1214b302e](https://github.com/facebook/react/commit/1214b302e )**: test: Fix "couldn't locate all inline snapshots" ([#21205](https://github.com/facebook/react/pull/21205)) //<Sebastian Silbermann>//
- **[1a02d2792](https://github.com/facebook/react/commit/1a02d2792 )**: style: delete unused isHost check ([#21203](https://github.com/facebook/react/pull/21203)) //<wangao>//
- **[782f689ca](https://github.com/facebook/react/commit/782f689ca )**: Don't double invoke getDerivedStateFromProps for module pattern ([#21193](https://github.com/facebook/react/pull/21193)) //<Sebastian Markbåge>//
- **[e90c76a65](https://github.com/facebook/react/commit/e90c76a65 )**: Revert "Offscreen: Use JS stack to track hidden/unhidden subtree state" ([#21194](https://github.com/facebook/react/pull/21194)) //<Brian Vaughn>//
- **[1f8583de8](https://github.com/facebook/react/commit/1f8583de8 )**: Offscreen: Use JS stack to track hidden/unhidden subtree state ([#21192](https://github.com/facebook/react/pull/21192)) //<Brian Vaughn>//
- **[ad6e6ec7b](https://github.com/facebook/react/commit/ad6e6ec7b )**: [Fizz] Prepare Recursive Loop for More Types ([#21186](https://github.com/facebook/react/pull/21186)) //<Sebastian Markbåge>//
- **[172e89b4b](https://github.com/facebook/react/commit/172e89b4b )**: Reland Remove redundant initial of isArray ([#21188](https://github.com/facebook/react/pull/21188)) //<Sebastian Markbåge>//
- **[7c1ba2b57](https://github.com/facebook/react/commit/7c1ba2b57 )**: Proposed new Suspense layout effect semantics ([#21079](https://github.com/facebook/react/pull/21079)) //<Brian Vaughn>//
- **[316aa3686](https://github.com/facebook/react/commit/316aa3686 )**: [Scheduler] Fix de-opt caused by out-of-bounds access ([#21147](https://github.com/facebook/react/pull/21147)) //<Andrey Marchenko>//
- **[b4f119cdf](https://github.com/facebook/react/commit/b4f119cdf )**: Revert "Remove redundant initial of isArray ([#21163](https://github.com/facebook/react/pull/21163))" //<Sebastian Markbage>//
- **[c03197063](https://github.com/facebook/react/commit/c03197063 )**: Revert "apply prettier ([#21165](https://github.com/facebook/react/pull/21165))" //<Sebastian Markbage>//
- **[94fd1214d](https://github.com/facebook/react/commit/94fd1214d )**: apply prettier ([#21165](https://github.com/facebook/react/pull/21165)) //<Behnam Mohammadi>//
- **[b130a0f5c](https://github.com/facebook/react/commit/b130a0f5c )**: Remove redundant initial of isArray ([#21163](https://github.com/facebook/react/pull/21163)) //<Behnam Mohammadi>//
- **[2c9fef32d](https://github.com/facebook/react/commit/2c9fef32d )**: Remove redundant initial of hasOwnProperty ([#21134](https://github.com/facebook/react/pull/21134)) //<Behnam Mohammadi>//
- **[1cf9978d8](https://github.com/facebook/react/commit/1cf9978d8 )**: Don't pass internals to callbacks ([#21161](https://github.com/facebook/react/pull/21161)) //<Sebastian Markbåge>//
- **[b9e4c10e9](https://github.com/facebook/react/commit/b9e4c10e9 )**: [Fizz] Implement all the DOM attributes and special cases ([#21153](https://github.com/facebook/react/pull/21153)) //<Sebastian Markbåge>//
- **[f8ef4ff57](https://github.com/facebook/react/commit/f8ef4ff57 )**: Flush discrete passive effects before paint ([#21150](https://github.com/facebook/react/pull/21150)) //<Andrew Clark>//
- **[b48b38af6](https://github.com/facebook/react/commit/b48b38af6 )**: Support nesting of startTransition and flushSync (alt) ([#21149](https://github.com/facebook/react/pull/21149)) //<Sebastian Markbåge>//

Changelog:
[General][Changed] - React Native sync for revisions c9aab1c...f7cdc89

jest_e2e[run_all_tests]

Reviewed By: rickhanlonii

Differential Revision: D27740113

fbshipit-source-id: 6e27204d78e3e16ed205170006cb97c0d6bfa957
2021-04-20 05:51:09 -07:00
Rubén Norte 114be1d217 Check existence of native methods before calling them in NativeEventEmitter
Summary:
Check the existence of `addListener` and `removeListeners` in the native module passed to `NativeEventEmitter` to determine if it can be used.

Changelog: [General][Changed] Show warning when native module without `addListener` or `removeListeners` is passed to `NativeEventEmitter`

Reviewed By: yungsters

Differential Revision: D27851425

fbshipit-source-id: c0ad3ba65a9239f5bf84548dab36e8dfbc51058a
2021-04-19 13:14:38 -07:00
Nadiia D 17be3a0032 Remove legacy context API usage
Summary:
Changelog:
[General][Removed] - Remove legacy context API usage in AppContainer

Reviewed By: kacieb

Differential Revision: D27681097

fbshipit-source-id: 7391be577955171ade5b8fd53cf274900f88e7ca
2021-04-18 16:40:40 -07:00
Kacie Bawiec 2824b68ee8 Remove defaultProps from KeyboardAvoidingView
Summary:
Changelog:
[General][Removed] Remove defaultProps from KeyboardAvoidingView

Reviewed By: lunaleaps

Differential Revision: D27770146

fbshipit-source-id: 61d56c50978cc67287d56349283959b9a32c9a0b
2021-04-16 18:30:22 -07:00
Carlos Cuesta 697164077c Disable `accessibilityState` when `TouchableWithoutFeedback` is `disabled` (#31297)
Summary:
Disable `accessibilityState` when the `TouchableWithoutFeedback` is `disabled`. This fixes https://github.com/facebook/react-native/issues/30953

## Changelog

[General] [Changed] - Disable `accessibilityState` when the `TouchableWithoutFeedback` is `disabled`.

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

Test Plan: Tested the `TouchableWithoutFeedback` component on an Android device

Reviewed By: nadiia

Differential Revision: D27770689

Pulled By: kacieb

fbshipit-source-id: a317246021354ed288b093f8a5e6fbba43d3a04e
2021-04-16 14:37:38 -07:00
Héctor Ramos ae07c53d0b Resolve "fatal: not a git repository" error outside of git repositories
Summary:
CocoaPods will display a "fatal: not a git repository" when these podspecs are consumed within Facebook's internal Mercurial repository due to the reliance on `git` to obtain the current commit hash.

In these cases, the podspec is being consumed locally and the commit hash is unnecessary.

The error is removed by avoiding the use of `git` if the current working directory is not a git repository (or any of the parent directories).

Changelog:
[Internal] [iOS] - Remove CocoaPods error within Facebook's repository

Reviewed By: fkgozali

Differential Revision: D27750974

fbshipit-source-id: 99159611c580baf5526f116948c5ff60e1c02e5c
2021-04-15 13:30:31 -07:00
Ramanpreet Nara e1eb938c9d Create rn_codegen BUCK macro (#31340)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/31340

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D27669950

fbshipit-source-id: 3129d87da8f74d896c0b9e82799b8896b3ed7635
2021-04-15 13:27:38 -07:00
Kacie Bawiec 1747536007 Clean up the initialization of instance variables in ScrollView
Summary:
This is a small cleanup to move initialization out of the `constructor` as it is unnecessary, and it is currently double initializing a few values.

Changelog:
[General][Changed] Clean up the initialization of instance variables in ScrollView

Reviewed By: nadiia

Differential Revision: D27631320

fbshipit-source-id: 762277e4993a9ce86d444ff2d9e845c93e94d1a8
2021-04-15 12:41:48 -07:00
Kacie Bawiec 328f4ee06b Clean up imports and update KeyboardAvoidingView to @flow strict-local
Summary:
Changelog:
[General][Changed] Clean up imports and update KeyboardAvoidingView to flow strict-local

Reviewed By: lunaleaps, nadiia

Differential Revision: D27720919

fbshipit-source-id: 9863c2de0ad34889dbde87c7d5ad9316bda24649
2021-04-14 12:03:47 -07:00
Jorge Rossi d9a86aa651 Convert SafeAreaView to ES Module (#31344)
Summary:
Convert SafeAreaView to ES Module (https://github.com/facebook/react-native/issues/31330).

## Changelog

[General] [Changed] - Converted `SafeAreaView` to ES Module.

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

Test Plan: Tested that `npm test` passes.

Reviewed By: kacieb

Differential Revision: D27767463

Pulled By: lunaleaps

fbshipit-source-id: fd3aee58ae6d621a292ff3360d8833f5e5007d52
2021-04-14 11:48:42 -07:00
Kacie Bawiec 50c3dd3860 Update View to use import instead of require
Summary:
Changelog:
[General][Changed] Update View to use import instead of require

Reviewed By: lunaleaps

Differential Revision: D27747147

fbshipit-source-id: 49bd705bd475ca518829d3364550c14ec2ac1da8
2021-04-14 11:10:31 -07:00
Brian Vaughn 60a18c138c Don't disconnect DevTools WebSocket connection on Cmd+D
Summary:
When the React Native Cmd+D menu is opened, something re-runs module initialization code (including DevTools backend initialization) which recreates the `WebSocket` and kills any already-connected frontend.

It's not clear to me why this is done. (Intentional? Accident?) But it makes it difficult to connect the React Native Inspector and DevTools together without multiple reloads. This Diff prevents the Cmd+D menu from killing the `WebSocket` connection as a workaround. A better long-term fix would (probably) be to not eagerly re-run these modules.

## Changelog

[General] [Fixed] - Don't disconnect DevTools WebSocket connection on Cmd+D

Reviewed By: fkgozali, sammy-SC

Differential Revision: D27742376

fbshipit-source-id: 60ab3e4763da6b055c28c7aafc6d460e7f4a601d
2021-04-14 07:42:38 -07:00
Nadiia D d65b5895ce Rewrite Modal to a functional component and add gating for the change
Summary:
Changelog:
[Internal][Added] - Use injected Modal if set

Due to Modal uses AppContainer in a dev env, in the StrictMode we'll get warnings about legacy context API usage from inside the AppContainer.

It's a gnarly change to get rid of that legacy context so I'll be following up with additional code change prep steps towards the eventual removal of the legacy context.

Reviewed By: lunaleaps

Differential Revision: D27611218

fbshipit-source-id: f79475845e763527fff9ecfdbf3e581c4666e015
2021-04-12 12:47:00 -07:00
Tim Yung cb6cbd12f8 EventEmitter: Deprecate `removeSubscription`
Summary:
Deprecates `EventEmitter#removeSubscription`. This required temporarily introducing a new `__removeSubscription` method that is only invoked by `EmitterSubscription`. This is necessary so that we do not completely break usages of `EventEmitter` that are supplying constructor arguments (which is also deprecated, but still supported until the next release).

Calling this method will now cause a warning to appear with instructions to instead invoke `remove()` on the subscription itself.

Lastly, changed `console.error` deprecation notice to instead use `console.warn`. This is in line with the principle that errors are "broken today" and warnings will be "broken tomorrow".

Changelog:
[General][Deprecated] - `EventEmitter#removeSubscription` is now deprecated.

Reviewed By: rubennorte

Differential Revision: D27704279

fbshipit-source-id: 581f5b2ab46b1bcfc1d20898b3d3392988dccbd5
2021-04-12 12:43:07 -07:00
Tim Yung 62934e555d EventEmitter: Cleanup Redundant Internal Types
Summary:
Cleans up some minor redundant internal types in `_EventEmitter.js`.

Changelog:
[Internal]

Reviewed By: rubennorte

Differential Revision: D27712301

fbshipit-source-id: e6affcb7948e0f47a1775b74b12f59ec2a6abddb
2021-04-12 12:43:07 -07:00
Tim Yung 14f7a2b707 EventEmitter: Deprecate Constructor Argument
Summary:
Deprecates the constructor argument to `EventEmitter`.

It was only ever used by React Native to instantiate a `NativeEventEmitter` with the same "vendor" as `RCTDeviceEventEmitter`, which was a gross violation of encapsulation that led to an overcomplicated implementation of `EventEmitter`. I am now untangling that mess.

Changelog:
[General][Deprecated] - It is now deprecated to pass a constructor argument to `EventEmitter(...)`.

Reviewed By: rubennorte

Differential Revision: D27704182

fbshipit-source-id: 102f26a8a9c029f0e7a1346dc2f2d9f2548d6a42
2021-04-12 12:43:07 -07:00
Madhav Gharmalkar 9d263aacf4 Refactor React Native SectionList component to a functional component
Summary:
Changelog:
[Internal] - Refactors SectionList component to be a functional component instead of a Class component

Closes #31322

Reviewed By: lunaleaps

Differential Revision: D27681457

fbshipit-source-id: ef0e68dd4bc91e83b40c55a4a959f27e69292964
2021-04-12 12:13:32 -07:00
Samuel Susla 8f4aed6386 Fix race inside ScrollView._inputMeasureAndScrollToKeyboard
Summary:
Changelog: [internal]

For React Native classic the behaviour is identical.

# Problem

`ScrollView.scrollResponderScrollNativeHandleToKeyboard` is broken in new React Native renderer. The behaviour depends on race between two events, `measureLayout` and `keyboardWillShow` event. In the new renderer, `measureLayout` always wins because it is a synchronous call, unlike in React Native classic.

To fix this we can just delay execution by wrapping it in `setTimeout`, which puts it on the back of the queue.

Reviewed By: JoshuaGross

Differential Revision: D27705883

fbshipit-source-id: 7556f86978ca3ccd2fddf1eef2435af26b54f585
2021-04-12 09:48:37 -07:00
Rubén Norte f5502fbda9 Use native module passed to NativeEventEmitter on Android
Summary:
## Context

In native modules implementing an event emitter, we can wait for JS to subscribe to an event before making the subscription to the right native API in the native module. This is only supported on iOS at the moment and we want to support it on Android too, so we can manage resources more efficiently and avoid custom code to do this on Android, like this:

https://www.internalfb.com/intern/diffusion/FBS/browse/master/xplat/js/RKJSModules/public/Dating/Profile/ProfileView/ProfileGemstoneProfileView.js?commit=165ad219e6bf&lines=302-304

The way this works now is by creating instances of `NativeEventEmitter`, where we pass a reference to the native module that needs to be notified when there are new subscriptions. We have explicit code to ignore this native modules in all platforms except for iOS:
https://www.internalfb.com/intern/diffusion/FBS/browsefile/master/xplat/js/react-native-github/Libraries/EventEmitter/NativeEventEmitter.js?commit=5a1e671453465e844dd851c458cb2467a2db5d03&lines=44-52

## Changes

This removes the check for iOS from `NativeEventEmitter` so we also try to use the native module to notify subscriptions on Android.

We have migrated all existing code passing a native module to `NativeEventEmtiter` to only pass it on iOS, so we don't change this behavior in existing code.

Any other existing code using this API is most likely fine too. It didn't work before so the expectation is that the native module wouldn't be implemented on Android anyway.

Changelog: [Android][Changed] - Modified `NativeEventEmitter` to also use the passed native module to report subscriptions on Android

Reviewed By: yungsters

Differential Revision: D27500994

fbshipit-source-id: ef82da04020fb08cd0ea4f1cfffd1da6453ab0b9
2021-04-12 06:27:20 -07:00
Rubén Norte 38cfa93775 Migrate remaining modules using NativeEventEmitter to only pass the native module on iOS
Summary: Changelog: [Internal]

Reviewed By: fred2028

Differential Revision: D27501270

fbshipit-source-id: 1d447017e862baf834310650778f2abbff50945c
2021-04-12 06:27:20 -07:00
Rubén Norte 87517aeecb Codemod usages of NativeEventEmitter in react-native-github to only pass a native module on iOS
Summary: Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D27500993

fbshipit-source-id: 99b33e25daf46b7d1debc6435dd32505ad2cf855
2021-04-12 06:27:20 -07:00
David Vacca b28ddede7b Transfer 'DisplayMode' value from Native -> JS
Summary:
This diff adds a new variable called "DisplayMode" into SurfaceHandler.cpp and FacebookAppRouteHandler.js. The purpose of DisplayMode is for the native pre-render system to notify React that the a surface is either being "pre-rendered" or "rendered"

When the surface is being "pre-rendered" (displayMode == "SUSPENDED"), react will create and commit React Trees, but it will not execute use-effect callbacks

When the surface is being "rendered" (displayMode == "VISIBLE"), react will create and commit React Trees and it will not execute all use-effect callbacks that weren't executed during "pre-rendering"

By default surfaces are going to be rendered with displayMode == "VISIBLE".

This diff should not create any change of behavior for now, this is the infra required to integrate the new offScreen API the react team is working on for pre-rendering system

changelog: [internal] internal

Reviewed By: yungsters

Differential Revision: D27614664

fbshipit-source-id: f1f42fdf174c2ffa74174feb1873f1d5d46e7a95
2021-04-12 00:05:43 -07:00
David Vacca b5e2e1d52d Expose setSurfaceProps API in JS
Summary:
This diff introduces the new function "setSurfaceProps" in SurfaceRegistry and AppRegistry

This new method will be used to update initialProps of a surface at the root level. In the near future this will be useful to integrate the OffScreen API component in pre-rendering

changelog: [internal] internal

Reviewed By: JoshuaGross

Differential Revision: D27607587

fbshipit-source-id: 3cc58c51924feb68f6a24bf762986c57f9a245ae
2021-04-12 00:05:43 -07:00
Ramanpreet Nara 3f38186b78 Codemod: Give legacy cxx and ObjC-only NativeModules a getTurboModule: method
Summary:
We're making the getTurboModule: method required for all classes that conform to RCTTurboModule.

Many of our ObjC-only and Cxx NativeModules don't implement this method. This diff implements a getTurboModule: method on all those modules that returns nullptr.

**Question:** Why is it fine to make ObjC-only NativeModules return nullptr from their getTurboModule: method?
- Because they're only accessed from ObjC, and should appear as null on the JavaScript side. Longer term, these NativeModules will also go away.

**Question:** Why is it fine to make Cxx NativeModules return nullptr from getTurboModule: method?
- Because after D27316872, the TurboModuleManager checks if the module is a CxxModule first. If it is, we do an early return, and never call the module's getTurboModule: method.

Changelog: [Internal]

Reviewed By: JoshuaGross

Differential Revision: D27316871

fbshipit-source-id: bc693f2927ab3b0de24e6e9e7699390ec0f7d729
2021-04-08 21:15:52 -07:00
Tim Yung e7275d5c1b RN: Reapply `AccessibilityInfo` Changes
Reviewed By: nadiia, kacieb

Differential Revision: D27595098

fbshipit-source-id: a949476c3e4681d3ddcfd1a53abe1d8f3b05c1f9
2021-04-08 17:37:08 -07:00
Luna Wei 4565fd8092 Convert to ESM export
Summary:
Changelog:
[Internal] - Convert to ESM export

Reviewed By: kacieb

Differential Revision: D27631062

fbshipit-source-id: 59509809d87e70831c070a882a96fe93c3410bc3
2021-04-07 19:13:45 -07:00
Luna Wei 959dc5ac51 Remove defaultProps
Summary:
Changelog:
[Internal] - Remove defaultProps for SectionList

Reviewed By: kacieb

Differential Revision: D27630645

fbshipit-source-id: 81571fb5f90ea4e820c74781811b82f954f97396
2021-04-07 19:13:45 -07:00
Luna Wei 683b825b32 Modern Switch
Summary:
Changelog:
[Internal] - Update Switch to allow injected implementations

## General understanding of the component
The main flow of Switch is pretty straightforward, basically passing the props to the respective native component which uses the platform switch views on Android / iOS

The interesting parts of Switch is the fact that it's a controlled component -- meaning that this component sees the JS value prop as the source of truth about the state of this component and any time the native value of the switch is out of sync with the JS value prop, we send a command `setNativeValue` to keep those in sync.

The problems I ran into:
* Keeping native and JS in sync
* Switch skips animation occassionally on iOS simulator
## How we keep native and JS in sync
By construction, the native value of the component should be the same as JS value. Then, we know the native value has changed whenever the callback `handleChange` has been fired.

**Before**
In the handleChange callback, we'd set an [instance variable `lastNativeValue` with the updated value](https://fburl.com/diffusion/nangxzoh) and force update. Then, in `componentDidUpdate`, we'd send the native commands if we determine that `lastNativeValue` and the `value` prop were out of sync.

**After**
For our modern implementation, we store the value of the switch as reported by `handleChange` and check it against the `props.value` of the switch. If they are out of sync then we will update the native switch via the switch command.

**Why is `native` an object?**
We need to run the `useLayoutEffect` every time `handleChange` is called independent of the value of the switch.

**Why not move the logic of dispatching commands to `handleChange`?**?
This would change behavior from old implementation where we would call `onChange` handlers and then re-render. Additionally, the logic to run the native commands were on `componentDidUpdate` which would've run when any prop changed. We can simplify this down to caring only when `props.value` updates.

## Unsolved, existing issue: Switches skip animation occasionally
* This occurs both in the modern and old versions of Switch and I've only seen this on iOS simulators. It occurs most frequently in the "events" example where two switches' values are synced and most often the first transition after we navigate to the example surface. I have not been able to reproduce this behavior on device.
* Something must be triggering a re-render in the middle of native's animation..

{F564595576}

Reviewed By: nadiia, kacieb

Differential Revision: D27381306

fbshipit-source-id: 06d13c6fe1ff181443f4b8dd27fb1ac65e071962
2021-04-07 18:08:53 -07:00
Kevin Gozali 3dda7ee438 iOS: Removed unused helper methods for image instrumentation
Summary:
These helpers are no longer in use, let's remove them.

Changelog: [Internal]

Reviewed By: p-sun

Differential Revision: D27557211

fbshipit-source-id: 5dd670b8615ed336745e390134983adea36a8a99
2021-04-07 08:57:37 -07:00
grgr-dkrk d29a7e7a89 add getRecommendedTimeoutMillis to AccessibilityInfo (#31063)
Summary:
resolve https://github.com/facebook/react-native/issues/30866

This PR is for using `getRecommendedTimeoutMillis` with React Native, which is available on Android 10 and above.
This allows the Android "Time to take action (Accessibility timeout)" setting to be reflected in the app.

## 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 `getRecommendedTimeoutMillis` to AccessibilityInfo

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

Test Plan:
I couldn't find any tests at the code level, so I tested them on my Android device.

 ---

### Android 10 (Pixel4a)
#### Settings
<img src="https://user-images.githubusercontent.com/40130327/109322854-210f2400-7896-11eb-9f3b-b88afa27abfb.png" width="400" alt="Set the timeout to 1 minute on the settings screen." />

#### App
<img src="https://user-images.githubusercontent.com/40130327/109322895-32583080-7896-11eb-9c48-c4aa9afb94d9.png" width="400" alt="The baseline timeout is 3000 ms, but the result of `getRecommendedTimeoutMillis` returns 60000 ms." />

 ---

### Android 7, iOS(Simulator)
Return the original timeout.
<img src="https://user-images.githubusercontent.com/40130327/109323217-911daa00-7896-11eb-9eba-659bc623f2ac.png" width="400" alt="Return the original timeout on Android 7." />

<img src="https://user-images.githubusercontent.com/40130327/109323357-b7dbe080-7896-11eb-89e9-305eea8b801b.png" width="400" alt="Return the original timeout on iOS simulator." />

Reviewed By: lunaleaps

Differential Revision: D27475370

Pulled By: nadiia

fbshipit-source-id: 4cdd9eb5ddb20d89c1d870e640b4b7e3c3c1b14d
2021-04-06 13:48:24 -07:00
Kacie Bawiec 2785ce7e61 React Native sync for revisions 6d3ecb7...c9aab1c
Summary:
This sync includes the following changes:
- **[c9aab1c9d](https://github.com/facebook/react/commit/c9aab1c9d )**: react-refresh@0.10.0 //<Dan Abramov>//
- **[516b76b9a](https://github.com/facebook/react/commit/516b76b9a )**: [Fast Refresh] Support callthrough HOCs ([#21104](https://github.com/facebook/react/pull/21104)) //<Dan Abramov>//
- **[0853aab74](https://github.com/facebook/react/commit/0853aab74 )**: Log all errors to console.error by default ([#21130](https://github.com/facebook/react/pull/21130)) //<Sebastian Markbåge>//
- **[d1294c9d4](https://github.com/facebook/react/commit/d1294c9d4 )**: Add global onError handler ([#21129](https://github.com/facebook/react/pull/21129)) //<Sebastian Markbåge>//
- **[64983aab5](https://github.com/facebook/react/commit/64983aab5 )**: Remove redundant setUpdatePriority call ([#21127](https://github.com/facebook/react/pull/21127)) //<Andrew Clark>//
- **[634cc52e6](https://github.com/facebook/react/commit/634cc52e6 )**: Delete dead variable: currentEventWipLanes ([#21123](https://github.com/facebook/react/pull/21123)) //<Andrew Clark>//
- **[1102224bb](https://github.com/facebook/react/commit/1102224bb )**: Fix: flushSync changes priority inside effect ([#21122](https://github.com/facebook/react/pull/21122)) //<Andrew Clark>//
- **[dbe98a5aa](https://github.com/facebook/react/commit/dbe98a5aa )**: Move sync task queue to its own module ([#21109](https://github.com/facebook/react/pull/21109)) //<Andrew Clark>//
- **[3ba5c8737](https://github.com/facebook/react/commit/3ba5c8737 )**: Remove Scheduler indirection ([#21107](https://github.com/facebook/react/pull/21107)) //<Andrew Clark>//
- **[46b68eaf6](https://github.com/facebook/react/commit/46b68eaf6 )**: Delete LanePriority type ([#21090](https://github.com/facebook/react/pull/21090)) //<Andrew Clark>//
- **[dcd13045e](https://github.com/facebook/react/commit/dcd13045e )**: Use Lane to track root callback priority ([#21089](https://github.com/facebook/react/pull/21089)) //<Andrew Clark>//
- **[5f21a9fca](https://github.com/facebook/react/commit/5f21a9fca )**: Clean up host pointers in level 2 of clean-up flag ([#21112](https://github.com/facebook/react/pull/21112)) //<Andrew Clark>//
- **[32d6f39ed](https://github.com/facebook/react/commit/32d6f39ed )**: [Fizz] Support special HTML/SVG/MathML tags to suspend ([#21113](https://github.com/facebook/react/pull/21113)) //<Sebastian Markbåge>//
- **[a77dd13ed](https://github.com/facebook/react/commit/a77dd13ed )**: Delete enableDiscreteEventFlushingChange ([#21110](https://github.com/facebook/react/pull/21110)) //<Andrew Clark>//
- **[048ee4c0c](https://github.com/facebook/react/commit/048ee4c0c )**: Use `act` in fuzz tester to flush expired work ([#21108](https://github.com/facebook/react/pull/21108)) //<Andrew Clark>//
- **[556644e23](https://github.com/facebook/react/commit/556644e23 )**: Fix plurals ([#21106](https://github.com/facebook/react/pull/21106)) //<Sebastian Markbåge>//
- **[8b741437b](https://github.com/facebook/react/commit/8b741437b )**: Rename SuspendedWork to Task ([#21105](https://github.com/facebook/react/pull/21105)) //<Sebastian Markbåge>//
- **[38a1aedb4](https://github.com/facebook/react/commit/38a1aedb4 )**: [Fizz] Add FormatContext and Refactor Work ([#21103](https://github.com/facebook/react/pull/21103)) //<Sebastian Markbåge>//
- **[1b7e471b9](https://github.com/facebook/react/commit/1b7e471b9 )**: React Native New Architecture: Support passing nativeViewTag to getInspectorDataForViewAtPoint callback, for React DevTools compat ([#21080](https://github.com/facebook/react/pull/21080)) //<Joshua Gross>//
- **[4a99c5c3a](https://github.com/facebook/react/commit/4a99c5c3a )**: Use highest priority lane to detect interruptions ([#21088](https://github.com/facebook/react/pull/21088)) //<Andrew Clark>//
- **[77be52729](https://github.com/facebook/react/commit/77be52729 )**: Remove LanePriority from computeExpirationTime ([#21087](https://github.com/facebook/react/pull/21087)) //<Andrew Clark>//
- **[3221e8fba](https://github.com/facebook/react/commit/3221e8fba )**: Remove LanePriority from getBumpedLaneForHydration ([#21086](https://github.com/facebook/react/pull/21086)) //<Andrew Clark>//
- **[05ec0d764](https://github.com/facebook/react/commit/05ec0d764 )**: Entangled expired lanes with SyncLane ([#21083](https://github.com/facebook/react/pull/21083)) //<Andrew Clark>//
- **[03ede83d2](https://github.com/facebook/react/commit/03ede83d2 )**: Use EventPriority to track update priority ([#21082](https://github.com/facebook/react/pull/21082)) //<Andrew Clark>//
- **[a63f0953b](https://github.com/facebook/react/commit/a63f0953b )**: Delete SyncBatchedLane ([#21061](https://github.com/facebook/react/pull/21061)) //<Ricky>//
- **[fa868d6be](https://github.com/facebook/react/commit/fa868d6be )**: Make opaque EventPriority type a Lane internally ([#21065](https://github.com/facebook/react/pull/21065)) //<Andrew Clark>//
- **[eb58c3909](https://github.com/facebook/react/commit/eb58c3909 )**: react-hooks/exhaustive-deps: Handle optional chained methods as dependency ([#20204](https://github.com/facebook/react/pull/20204)) ([#20247](https://github.com/facebook/react/pull/20247)) //<Ari Perkkiö>//
- **[7b84dbd16](https://github.com/facebook/react/commit/7b84dbd16 )**: Fail build on deep requires in npm packages ([#21063](https://github.com/facebook/react/pull/21063)) //<Dan Abramov>//
- **[2c9d8efc8](https://github.com/facebook/react/commit/2c9d8efc8 )**: Add react-reconciler/constants entry point ([#21062](https://github.com/facebook/react/pull/21062)) //<Dan Abramov>//
- **[d0eaf7829](https://github.com/facebook/react/commit/d0eaf7829 )**: Move priorities to separate import to break cycle ([#21060](https://github.com/facebook/react/pull/21060)) //<Andrew Clark>//
- **[435cff986](https://github.com/facebook/react/commit/435cff986 )**: [Fizz] Expose callbacks in options for when various stages of the content is done ([#21056](https://github.com/facebook/react/pull/21056)) //<Sebastian Markbåge>//
- **[25bfa287f](https://github.com/facebook/react/commit/25bfa287f )**: [Experiment] Add feature flag for more aggressive memory clean-up of deleted fiber trees ([#21039](https://github.com/facebook/react/pull/21039)) //<Benoit Girard>//
- **[8fe7810e7](https://github.com/facebook/react/commit/8fe7810e7 )**: Remove already completed comment ([#21054](https://github.com/facebook/react/pull/21054)) //<Sebastian Markbåge>//
- **[6c3202b1e](https://github.com/facebook/react/commit/6c3202b1e )**: [Fizz] Use identifierPrefix to avoid conflicts within the same response ([#21037](https://github.com/facebook/react/pull/21037)) //<Sebastian Markbåge>//
- **[dcdf8de7e](https://github.com/facebook/react/commit/dcdf8de7e )**: Remove discrete lanes and priorities ([#21040](https://github.com/facebook/react/pull/21040)) //<Andrew Clark>//
- **[ca99ae97b](https://github.com/facebook/react/commit/ca99ae97b )**: Replace some flushExpired callsites ([#20975](https://github.com/facebook/react/pull/20975)) //<Ricky>//
- **[1fafac002](https://github.com/facebook/react/commit/1fafac002 )**: Use SyncLane for discrete event hydration ([#21038](https://github.com/facebook/react/pull/21038)) //<Andrew Clark>//

Changelog:
[General][Changed] - React Native sync for revisions 6d3ecb7...c9aab1c

jest_e2e[run_all_tests]

Reviewed By: JoshuaGross

Differential Revision: D27436763

fbshipit-source-id: da79a41e26bffdcdacd293178062edf098e9b58a
2021-04-06 12:42:37 -07:00
Jimmy Zhang 950f241cda Back out "RN: Unify `AccessibilityInfo` Platform Forks", Back out "RN: Refactor `AccessibilityInfo` Listeners"
Reviewed By: MichaReiser

Differential Revision: D27589727

fbshipit-source-id: 13104cf37f46abf38e5be6943b3236213afd3935
2021-04-06 03:28:42 -07:00
Tim Yung 9a9e7f917b RN: Unify `AccessibilityInfo` Platform Forks
Summary:
Unifies the platform-specific implementations of `AccessibilityInfo` to simplifying checking Flow types and making changes to the module.

Changelog:
[Internal]

Reviewed By: mdvacca

Differential Revision: D27578847

fbshipit-source-id: 84dc274a66acd22fc6f1dd2773a4e4630761e17d
2021-04-06 00:21:30 -07:00
Tim Yung d831134d51 RN: Remove `AccessibilityInfo.fetch`
Summary:
Removes `AccessibilityInfo.fetch` which had already been deprecated for a while by 0090ab32c2.

Changelog:
[General][Removed] - Removed `AccessibilityInfo.fetch`, use `isScreenReaderEnabled` instead.

Reviewed By: kacieb

Differential Revision: D27576528

fbshipit-source-id: f5df3445b4cc3bcb4ce6873c6845748109bc393d
2021-04-05 17:36:55 -07:00
Tim Yung 003d63d6e5 RN: Refactor `AccessibilityInfo` Listeners
Summary:
Refactors `AccessibilityInfo` so that it does not reimplement the event listener logic that is already implemented in `EventEmitter` (which backs the implementation of `RCTDeviceEventEmitter`).

This also means that calling `AccessibilityInfo.removeEventListener` will correctly display a deprecation error, due to `EventEmitter.removeListener` being deprecated. In a future release, both of these methods will be removed.

Changelog:
[General][Deprecated] - Deprecate `AccessibilityInfo.removeEventListener`.

Reviewed By: kacieb

Differential Revision: D27574340

fbshipit-source-id: 98c71d9c1470018df0f1526cc2f349aac842e786
2021-04-05 17:36:55 -07:00
Kazuki Yamashiro 88f2356eed Added talkback support for TouchableNativeFeedback accessibility: disabled prop (#31224)
Summary:
Issue https://github.com/facebook/react-native/issues/30952
Add talkback support for TouchableNativeFeedback component.

## Changelog

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

[Android] [Changed] - TouchableNativeFeedback: sync disabled prop with accessibilityState

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

Test Plan:
I have checked that talkback and disabled works properly on the actual device(Pixel4a Android11).

```jsx
/**
 * Sample React Native App
 * https://github.com/facebook/react-native
 *
 * format
 * flow strict-local
 */

import * as React from 'react';
import {
  Text,
  View,
  StyleSheet,
  TouchableNativeFeedback,
  Alert,
} from 'react-native';

export default function App() {
  const onPress = () => Alert.alert('test');

  return (
    <View style={styles.container}>
      {/*not disabled, voice:double tap to activate*/}
      <TouchableNativeFeedback onPress={onPress}>
        <View style={styles.touchable}>
          <Text style={styles.text}>talkback OK</Text>
        </View>
      </TouchableNativeFeedback>

      {/*disabled, voice:disabled*/}
      <TouchableNativeFeedback disabled={true} onPress={onPress}>
        <View style={styles.touchable}>
          <Text style={styles.text}>
            should be disabled when disabled is true
          </Text>
        </View>
      </TouchableNativeFeedback>

      {/*disabled, voice:disabled*/}
      <TouchableNativeFeedback
        accessibilityState={{disabled: true}}
        onPress={onPress}>
        <View style={styles.touchable}>
          <Text style={styles.text}>
            should be disabled when accessibilityState disabled is true
          </Text>
        </View>
      </TouchableNativeFeedback>

      {/*disabled, voice:disabled*/}
      <TouchableNativeFeedback
        disabled={true}
        accessibilityState={{}}
        onPress={onPress}>
        <View style={styles.touchable}>
          <Text style={styles.text}>
            should be disabled when disabled is true and accessibilityState is
            empty
          </Text>
        </View>
      </TouchableNativeFeedback>

      {/*disabled, voice:disabled*/}
      <TouchableNativeFeedback
        disabled={true}
        accessibilityState={{checked: true}}
        onPress={onPress}>
        <View style={styles.touchable}>
          <Text style={styles.text}>
            should keep accessibilityState when disabled is true
          </Text>
        </View>
      </TouchableNativeFeedback>

      {/*disabled, voice:disabled*/}
      <TouchableNativeFeedback
        disabled={true}
        accessibilityState={{disabled: false}}
        onPress={onPress}>
        <View style={styles.touchable}>
          <Text style={styles.text}>
            should overwrite accessibilityState with value of disabled prop
          </Text>
        </View>
      </TouchableNativeFeedback>

      {/*not disabled, voice:double tap to activate*/}
      <TouchableNativeFeedback
        disabled={false}
        accessibilityState={{disabled: true}}
        onPress={onPress}>
        <View style={styles.touchable}>
          <Text style={styles.text}>
            should overwrite accessibilityState with value of disabled prop
          </Text>
        </View>
      </TouchableNativeFeedback>
    </View>
  );
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    justifyContent: 'center',
    padding: 16,
  },
  touchable: {flex: 0.5, borderColor: 'black', borderWidth: 1, marginBottom: 8},
  text: {alignSelf: 'center'},
});

```

Reviewed By: yungsters

Differential Revision: D27479271

Pulled By: kacieb

fbshipit-source-id: 43187839b58dfe8f91afdba91453fb6b98e1a604
2021-04-02 17:12:20 -07:00
Tim Yung bb6cd56fae RN: Fallback for Invalid Colors in `processColorArray`
Summary:
If an invalid color is supplied to a native component that expects `Array<ColorValue>`, it is currently possible to produce an array that contains null or undefined elements. This is problematic because the native component may not know what to do with the null or undefined value.

This changes `processColorArray` to always return an array with valid color values. Any invalid color values will fallback to being transparent black, `0x00000000`.

Changelog:
[General][Fixed] - For native components that accept color arrays, invalid elements will now fallback to transparent with a console error.

Reviewed By: JoshuaGross

Differential Revision: D27542291

fbshipit-source-id: efa5d130644b3aee68d2b9fad6fdb61af11a2966
2021-04-02 15:07:54 -07:00
Nadiia D a782b6f5a1 Remove unsafe lifecycles usage
Summary:
Changelog:
[General][Changed] - [Modal] removed UNSAFE_componentWillReceiveProps lifecycle usage

Reviewed By: lunaleaps

Differential Revision: D27523213

fbshipit-source-id: 288b91bc6c479c62313ba17047069893cd19588c
2021-04-02 13:07:35 -07:00
Huzaifa b5e649fcf6 Accessibility/button test (#31189)
Summary:
This PR aims to add test's for button.
Snapshot test for PR https://github.com/facebook/react-native/issues/31001 . This would make sure `accessibilityState` is properly set.

## 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] [Added] - Test's for button

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

Test Plan:
`npm test` to run the test's.
Since the disabled prop of button has precedence over `accessibilityState.disabled` the test's will make sure it remains this way.

Reviewed By: kacieb

Differential Revision: D27473082

Pulled By: lunaleaps

fbshipit-source-id: 65d82620e8c245c2a8e29c3e9a8252d3a4275b09
2021-04-02 11:44:12 -07:00
Luna Wei bac2c2c801 Update FlowFixMes to use error codes in react-native-github
Summary:
Changelog:
[Internal] - Add error codes to existing FlowFixMe's

Reviewed By: kacieb

Differential Revision: D27445689

fbshipit-source-id: 2b19692e1cb822ab6785efcc5f93ee33e7dce1e5
2021-03-31 18:21:47 -07:00
Luna Wei 321de15803 Delete unused FlowFixMes in xplat/js/react-native-github
Summary:
Changelog:
[Internal] - Remove unused FlowFixMes

Reviewed By: kacieb

Differential Revision: D27445690

fbshipit-source-id: c1fbf4495ae020b30a458c2ef4870547fd5d5c6e
2021-03-31 18:21:47 -07:00
Bruno Castro c4e40b81c0 feat: add displayName to touchables (#29531)
Summary:
Since TouchableHighlight and TouchableOpacity are being exported using `forwardRef`, it's messing up jest's snapshots and some matchers.
This commit 4b935ae95f fixed this for components being mocked on [setup.js](https://github.com/facebook/react-native/blob/master/jest/setup.js). However, these Touchables aren't being mocked.

It resolves https://github.com/facebook/react-native/issues/27721

## Changelog

[General] [Added] - Add displayName to TouchableHighlight and TouchableOpacity

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

Test Plan: Check the new snapshots.

Reviewed By: kacieb

Differential Revision: D27485269

Pulled By: yungsters

fbshipit-source-id: ba2082a4ae9f97ebe93ba92971d58c9195bdf26d
2021-03-31 17:36:02 -07:00
Lucas Santos b86e52a9ec Add method to retrieve authorization status
Summary:
Changelog:
[iOS][Added] - Adds an ability to retrieve the notifications authorization status from JavaScript side.

Differential Revision: D27426952

fbshipit-source-id: 84a1eae1ff8c8f9f7601c7479745002c21178850
2021-03-30 16:06:39 -07:00
Luna Wei 7248291d5d Simplify logic
Summary:
Changelog:
[Internal] - Simplify logic by not creating an unnecessary object

Reviewed By: kacieb

Differential Revision: D27371155

fbshipit-source-id: c34db151f57f9f6e46cc1984a5a9ef24f81adecd
2021-03-29 18:34:30 -07:00
Kacie Bawiec eacabe1398 Convert ScrollViewStickyHeader to functional component and gate the change
Summary:
Changelog:
[Internal][Added] - Use injected ScrollViewStickyHeader if set

Reviewed By: lunaleaps

Differential Revision: D26931404

fbshipit-source-id: 6f6f1b501b610a05999898be3e2ce08aeb4dab1b
2021-03-29 15:25:19 -07:00
simek 95f7c791c5 remove unused VR-only props (#31230)
Summary:
It looks like `ScrollView` still contains the remnant props for VR platform, which afaik has be discontinued a while ago (please correct me, if I'm wrong).

This PR removes `scrollBarThumbImage` prop marked as VR platform only prop from `ScrollView`.

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

[VR] [Removed] - remove VR platform specific `scrollBarThumbImage` prop from `ScrollView`

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

Test Plan: CI

Reviewed By: javache

Differential Revision: D27367267

Pulled By: PeteTheHeat

fbshipit-source-id: b76fdb0e03c443aaf87308162bf75f8683220918
2021-03-29 03:32:09 -07:00
Paige Sun 9ebdf74708 Remove Unable to get TurboModule for DialogManagerAndroid warning for iOS
Summary:
The import of DialogManagerAndroid in [Alert.js](https://fburl.com/diffusion/n57e4l50) causes "Unable to get iOS TurboModule for DialogManagerAndroid" log.

Don't call ` TurboModuleRegistry.get` on DialogManagerAndroid when the Platform is iOS.

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D27376204

fbshipit-source-id: 948da5c162100ffe196d5e0a54dc8b85659239ae
2021-03-26 23:48:28 -07:00
Paige Sun 3c4363d822 Clarify TurboModule cannot be found log
Reviewed By: JoshuaGross

Differential Revision: D27376177

fbshipit-source-id: 3e1a91ca7c11963874c029237bc2f45839fbbf6d
2021-03-26 21:11:47 -07:00
Quentin Valmori 452240bafa fix: Let's be more specific about "not implemented" (#31237)
Summary:
After installed a third party library I just got "Error: not implemented" without any other informations in the stack trace. Adding a more specific sentence within the error's message can be useful to understand what is going on.

## Changelog

[General] [CHANGED] - Added context to URL's error messages when the feature is not implemented

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

Differential Revision: D27367109

Pulled By: PeteTheHeat

fbshipit-source-id: 87e8b3beef661e028d89098729bd242a57bb9a47
2021-03-26 16:00:33 -07:00
Paige Sun bfe3cd01bc Log info when TurboModule cannot be found
Summary:
There are a surprisingly large number of nil modules in both bridge and bridgeless. So far, features may silently fail if a module is nil.

We can't log with with console.error or console.warn because many tests will break even though modules aren't used in the test.

Differential Revision: D27285601

fbshipit-source-id: 1467100f2a4c48e97de5dd6e846c26981c14f099
2021-03-25 16:08:38 -07:00
Luna Wei fda1acec51 Refactor renderItem logic and gate changes
Summary:
# Changelog:
[Internal][Added] - Use injected VirtualizedSectionList if set

Reviewed By: kacieb

Differential Revision: D27004445

fbshipit-source-id: 9c07ee80c893817c1fe3171a4ee271f5839568c9
2021-03-25 13:00:28 -07:00
Luna Wei 5475f29554 Reland stack for removing defaultProps from VL and remove breaking FlowFixMe
Summary:
Changelog:
[Internal][Changed] - Remove keyExtractor from defaultProps as part of larger effort to remove defaultProps from VirtualizedList

[General][Changed] - Remove data as a prop for VirtualizedSectionList. In the reactnative.dev docs it mentions that sections is the equivalent for *SectionList: https://reactnative.dev/docs/sectionlist#sections

[General][Changed] - Change export type of VirtualizedSectionList and wrap component updates in act in test.

[Internal] - Remove FlowFixMe from VirtualizedSectionList

Reviewed By: kacieb

Differential Revision: D27271493

fbshipit-source-id: f83bdcce9c71c140c8a8fb6f0ecd9bb520fcb85b
2021-03-25 13:00:28 -07:00
Kacie Bawiec d754bdefc6 Fix ScrollViewStickyHeader to push up header above it
Summary:
When there are multiple sticky headers, ScrollViewStickyHeader should push up the header above it when it gets to the top.

This behavior was accidentally changed in D21948830 (fa5d3fb6b8) when this component was fixed to work in Fabric.

This diff added a new variable `_shouldRecreateTranslateY`, which determines whether the `translateY` value should be recreated on render. `_shouldRecreateTranslateY` was not being set to true during `setNextHeaderY`, so the next header's Y value was never accounted for at render.

Changelog:
[General][Fixed] Fix ScrollViewStickyHeader to push up header above it

Reviewed By: lunaleaps

Differential Revision: D27277829

fbshipit-source-id: 83c9aacd454be178649bf8d060d1a5c750f4060f
2021-03-25 11:32:42 -07:00
Joshua Gross 334da89b3d LayoutAnimation: don't call non-Fabric configurNext if Fabric is installed
Summary:
If Fabric is "installed"/enabled in the JS VM, only send LayoutAnimations configureNext to Fabric.

This will have no impact unless your app is running Fabric and non-Fabric side-by-side.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D27274016

fbshipit-source-id: 5d709e23968c2b65cc79d5611170fb70a9578953
2021-03-23 14:37:25 -07:00
Rick Hanlon 563b42bab4 React Native sync for revisions c9f6d0a...6d3ecb7
Summary:
This sync includes the following changes:
- **[6d3ecb70d](https://github.com/facebook/react/commit/6d3ecb70d )**: Remove unstable_changedBits ([#20953](https://github.com/facebook/react/pull/20953)) //<Andrew Clark>//
- **[754e30728](https://github.com/facebook/react/commit/754e30728 )**: Delete immediateQueueCallbackNode ([#20980](https://github.com/facebook/react/pull/20980)) //<Andrew Clark>//
- **[be5a2e231](https://github.com/facebook/react/commit/be5a2e231 )**: Land enableSyncMicrotasks ([#20979](https://github.com/facebook/react/pull/20979)) //<Andrew Clark>//
- **[f6bc9c824](https://github.com/facebook/react/commit/f6bc9c824 )**: [Fizz] Expose maxBoundarySize as an option ([#21029](https://github.com/facebook/react/pull/21029)) //<Sebastian Markbåge>//
- **[154b85213](https://github.com/facebook/react/commit/154b85213 )**: [Fizz] Expose a method to explicitly start writing to a Node stream ([#21028](https://github.com/facebook/react/pull/21028)) //<Sebastian Markbåge>//
- **[cf485e6f6](https://github.com/facebook/react/commit/cf485e6f6 )**: [Fizz] Expose a method to abort a pending request ([#21027](https://github.com/facebook/react/pull/21027)) //<Sebastian Markbåge>//
- **[3fb11eed9](https://github.com/facebook/react/commit/3fb11eed9 )**: React Native: Touch Instrumentation Interface ([#21024](https://github.com/facebook/react/pull/21024)) //<Timothy Yung>//
- **[825c3021f](https://github.com/facebook/react/commit/825c3021f )**: Don't delete trailing mismatches during hydration at the root ([#21021](https://github.com/facebook/react/pull/21021)) //<Sebastian Markbåge>//
- **[1d1e49cfa](https://github.com/facebook/react/commit/1d1e49cfa )**: [Fizz] Assign an ID to the first DOM element in a fallback or insert a dummy (and testing infra) ([#21020](https://github.com/facebook/react/pull/21020)) //<Sebastian Markbåge>//
- **[466b26c92](https://github.com/facebook/react/commit/466b26c92 )**: Store commit durations on HostRoot for DevTools access ([#20983](https://github.com/facebook/react/pull/20983)) //<Brian Vaughn>//
- **[89acfa639](https://github.com/facebook/react/commit/89acfa639 )**: Fix native event batching in concurrent mode ([#21010](https://github.com/facebook/react/pull/21010)) //<Ricky>//
- **[0203b6567](https://github.com/facebook/react/commit/0203b6567 )**: chore: update react-reconciler README ([#21016](https://github.com/facebook/react/pull/21016)) //<susiwen8>//

Changelog:
[General][Changed] - React Native sync for revisions c9f6d0a...6d3ecb7

jest_e2e[run_all_tests]

Reviewed By: JoshuaGross, kacieb

Differential Revision: D27231625

fbshipit-source-id: 89c0c0662e69044ae8890486a693013bee6005dd
2021-03-23 12:56:38 -07:00
Daniel Sainati 05418f8fcc codemod objects to interfaces where they appear as supertypes of classes
Summary:
Flow is changing the behavior of object types to no longer be valid supertypes of classes. This replaces object types when they appear as supertypes of classes to be interfaces to avoid errors when this change rolls out.

Changelog: [Internal]

Reviewed By: pieterv

Differential Revision: D27193522

fbshipit-source-id: c3e3fca8a4cacd90770a95b773ff2c659774b9a6
2021-03-23 10:26:19 -07:00
Jesse Katsumata f69e096bb4 feat: set disabled accessibilityState when TouchableHighlight is disabled (#31135)
Summary:
https://github.com/facebook/react-native/issues/30950

automatically set `disabled` to accessibilityState when TouchableHighlight is disabled

## Changelog

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

[General] [Changed] - Set disabled accessibilityState when TouchableHighlight is disabled

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

Test Plan: Tested on physical android device that pressing disabled TouchableHighlight announces "dim" when talkback is on

Reviewed By: yungsters, nadiia

Differential Revision: D27157207

Pulled By: kacieb

fbshipit-source-id: b8e24aad699c43cf02401b3ba39726a06b751995
2021-03-22 14:04:16 -07:00
Shelly Willard 3671712df5 Deprecate markerCancel
Summary:
We have migrated most markerCancel calls to markerDrop. This diff removes the last bit (QPLBase API and bindings)

Changelog: [Internal]

Differential Revision: D26945891

fbshipit-source-id: 09b727809b316286930ced8533f9c79007350687
2021-03-22 06:46:00 -07:00
David Vacca eacc94005b Extend AccessibilityInfo.sendAccessibilityEvent to support 'click' event for Android
Summary:
This diff extends AccessibilityInfo.sendAccessibilityEvent to support 'click' event on RN Android

changelog: [internal] internal

Reviewed By: kacieb

Differential Revision: D27060395

fbshipit-source-id: 5bf7479d72efb66c3a388fc3ea11990e285ca054
2021-03-20 03:01:01 -07:00
Joshua Gross a0dcc4c51c Pressability: don't report touch telemetry events when the event doesn't have timestamp associated
Summary:
On iOS, not all touch events have timestamp associated. Don't report telemetry events for those events.

Separately, we can try to ensure that all iOS events have timestamps associated but it's low-pri.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D27179814

fbshipit-source-id: ea2745df560bc4e9e6744bdf8f54269223adb209
2021-03-19 10:09:34 -07:00
Kacie Bawiec d40f2a29c6 Switch AdsManagerRefreshableScrollView to use ElementConfig instead of ElementProps
Summary:
Changelog:
[Changed] Removed rest operator from ScrollViewStickyHeader props

Reviewed By: lunaleaps

Differential Revision: D27100507

fbshipit-source-id: 7d90ebeaf757bcaed0b125a4a8abf44f07adf98f
2021-03-18 08:03:38 -07:00
Jimmy Zhang f293d41ead Back out "Update typed export and fix test", Back out "[VirtualizedSectionList] Remove defaultProps", Back out "[VirtualizedList] Remove keyExtractor defaultProps"
Summary:
Changelog:
Partial revert the stack

Reviewed By: makovkastar

Differential Revision: D27156625

fbshipit-source-id: b158c9102047bb64ce708b200a8e5786f5a0c176
2021-03-18 07:42:41 -07:00
Joshua Gross 85f9b7af36 React Sync for revisions c3e20f1... c9f6d0a
Summary:
This sync includes the following changes:
- **[b9c4a01f7](https://github.com/facebook/react/commit/b9c4a01f7 )**: Allow the streaming config to decide how to precompute or compute chunks ([#21008](https://github.com/facebook/react/pull/21008)) //<Sebastian Markbåge>//
- **[c06d245fc](https://github.com/facebook/react/commit/c06d245fc )**: Update devtools-extensions build script to reflect changes in local b… ([#21004](https://github.com/facebook/react/pull/21004)) //<Hector Rincon>//
- **[14e4fd1ff](https://github.com/facebook/react/commit/14e4fd1ff )**: [Fizz] Move DOM/Native format configs to their respective packages ([#20994](https://github.com/facebook/react/pull/20994)) //<Sebastian Markbåge>//
- **[f2b6bf7c8](https://github.com/facebook/react/commit/f2b6bf7c8 )**: [Fizz] Destroy the stream with an error if the root throws ([#20992](https://github.com/facebook/react/pull/20992)) //<Sebastian Markbåge>//
- **[10cc40018](https://github.com/facebook/react/commit/10cc40018 )**: Basic Fizz Architecture ([#20970](https://github.com/facebook/react/pull/20970)) //<Sebastian Markbåge>//
- **[b7e631066](https://github.com/facebook/react/commit/b7e631066 )**: Stop tracking roots with pending discrete updates ([#20978](https://github.com/facebook/react/pull/20978)) //<Andrew Clark>//
- **[860f673a7](https://github.com/facebook/react/commit/860f673a7 )**: Remove Blocking Mode (again) ([#20974](https://github.com/facebook/react/pull/20974)) //<Ricky>//
- **[acde65469](https://github.com/facebook/react/commit/acde65469 )**: Unify InputDiscreteLane with SyncLane ([#20968](https://github.com/facebook/react/pull/20968)) //<Ricky>//
- **[6556e2a87](https://github.com/facebook/react/commit/6556e2a87 )**: Cleaned up unused PassiveUnmountPendingDev DEV flag ([#20973](https://github.com/facebook/react/pull/20973)) //<Brian Vaughn>//
- **[60182d64c](https://github.com/facebook/react/commit/60182d64c )**: Cleanup tests using runWithPriority. ([#20958](https://github.com/facebook/react/pull/20958)) //<Ricky>//
- **[e4d4b7074](https://github.com/facebook/react/commit/e4d4b7074 )**: Land enableNativeEventPriorityInference ([#20955](https://github.com/facebook/react/pull/20955)) //<Ricky>//
- **[73e900b0e](https://github.com/facebook/react/commit/73e900b0e )**: Land enableDiscreteEventMicroTasks ([#20954](https://github.com/facebook/react/pull/20954)) //<Ricky>//
- **[41e62e771](https://github.com/facebook/react/commit/41e62e771 )**: Remove runWithPriority internally //<Rick Hanlon>//
- **[431e76e2d](https://github.com/facebook/react/commit/431e76e2d )**: Switch callsites over to update lane priority //<Rick Hanlon>//
- **[e89d74ee6](https://github.com/facebook/react/commit/e89d74ee6 )**: Remove decoupleUpdatePriorityFromScheduler //<Rick Hanlon>//
- **[ca15606d8](https://github.com/facebook/react/commit/ca15606d8 )**: chore(build):  Ensure experimental builds exists on windows ([#20933](https://github.com/facebook/react/pull/20933)) //<Sebastian Silbermann>//
- **[d74559746](https://github.com/facebook/react/commit/d74559746 )**: Use update lane priority to set pending updates on roots ([#20918](https://github.com/facebook/react/pull/20918)) //<Ricky>//
- **[f04bcb813](https://github.com/facebook/react/commit/f04bcb813 )**: [Bugfix] Reset `subtreeFlags` in `resetWorkInProgress` ([#20948](https://github.com/facebook/react/pull/20948)) //<Andrew Clark>//
- **[c7b449798](https://github.com/facebook/react/commit/c7b449798 )**: [Experiment] Lazily propagate context changes ([#20890](https://github.com/facebook/react/pull/20890)) //<Andrew Clark>//
- **[258b375a4](https://github.com/facebook/react/commit/258b375a4 )**: Move context comparison to consumer //<Andrew Clark>//
- **[7df65725b](https://github.com/facebook/react/commit/7df65725b )**: Split getComponentName into getComponentNameFromFiber and getComponentNameFromType ([#20940](https://github.com/facebook/react/pull/20940)) //<Brian Vaughn>//
- **[ee4326357](https://github.com/facebook/react/commit/ee4326357 )**: Revert "Remove blocking mode and blocking root ([#20888](https://github.com/facebook/react/pull/20888))" ([#20916](https://github.com/facebook/react/pull/20916)) //<Andrew Clark>//
- **[de0ee76db](https://github.com/facebook/react/commit/de0ee76db )**: Add unstable_strictModeLevel to test renderer ([#20914](https://github.com/facebook/react/pull/20914)) //<Andrew Clark>//
- **[d857f9e4d](https://github.com/facebook/react/commit/d857f9e4d )**: Land enableSetImmediate feature flag ([#20906](https://github.com/facebook/react/pull/20906)) //<Dan Abramov>//
- **[553440bd1](https://github.com/facebook/react/commit/553440bd1 )**: Remove blocking mode and blocking root ([#20888](https://github.com/facebook/react/pull/20888)) //<Ricky>//
- **[38f392ced](https://github.com/facebook/react/commit/38f392ced )**: typo fix for the word 'Psuedo' ([#20894](https://github.com/facebook/react/pull/20894)) //<Bowen>//
- **[0cf9fc10b](https://github.com/facebook/react/commit/0cf9fc10b )**: Fix React Native flow types ([#20889](https://github.com/facebook/react/pull/20889)) //<Ricky>//
- **[c581cdd48](https://github.com/facebook/react/commit/c581cdd48 )**: Schedule sync updates in microtask ([#20872](https://github.com/facebook/react/pull/20872)) //<Ricky>//
- **[90bde6505](https://github.com/facebook/react/commit/90bde6505 )**: Add SuspenseList to react-is ([#20874](https://github.com/facebook/react/pull/20874)) //<Brian Vaughn>//
- **[8336f19aa](https://github.com/facebook/react/commit/8336f19aa )**: Update React Native types ([#20883](https://github.com/facebook/react/pull/20883)) //<Rubén Norte>//
- **[9209c30ff](https://github.com/facebook/react/commit/9209c30ff )**: Add StrictMode level prop and createRoot unstable_strictModeLevel option ([#20849](https://github.com/facebook/react/pull/20849)) //<Brian Vaughn>//
- **[e5f6b91d2](https://github.com/facebook/react/commit/e5f6b91d2 )**: Add Lane labels to scheduling profiler marks ([#20808](https://github.com/facebook/react/pull/20808)) //<Brian Vaughn>//
- **[c62986cfd](https://github.com/facebook/react/commit/c62986cfd )**: Add additional messaging for RulesOfHooks lint error ([#20692](https://github.com/facebook/react/pull/20692)) //<Anthony Garritano>//
- **[78d2f2d30](https://github.com/facebook/react/commit/78d2f2d30 )**: Fabric-compatible implementation of `JSReponder` feature ([#20768](https://github.com/facebook/react/pull/20768)) //<Valentin Shergin>//
- **[4d28eca97](https://github.com/facebook/react/commit/4d28eca97 )**: Land enableNonInterruptingNormalPri ([#20859](https://github.com/facebook/react/pull/20859)) //<Ricky>//
- **[8af27aeed](https://github.com/facebook/react/commit/8af27aeed )**: Remove scheduler sampling profiler shared array buffer ([#20840](https://github.com/facebook/react/pull/20840)) //<Brian Vaughn>//
- **[af3d52611](https://github.com/facebook/react/commit/af3d52611 )**: Disable (unstable) scheduler sampling profiler for OSS builds ([#20832](https://github.com/facebook/react/pull/20832)) //<Brian Vaughn>//
- **[8fa0ccca0](https://github.com/facebook/react/commit/8fa0ccca0 )**: fix: use SharedArrayBuffer only when cross-origin isolation is enabled ([#20831](https://github.com/facebook/react/pull/20831)) //<Toru Kobayashi>//
- **[099164792](https://github.com/facebook/react/commit/099164792 )**: Use setImmediate when available over MessageChannel ([#20834](https://github.com/facebook/react/pull/20834)) //<Dan Abramov>//
- **[e2fd460cc](https://github.com/facebook/react/commit/e2fd460cc )**: Bailout in sync task if work is not sync ([#20813](https://github.com/facebook/react/pull/20813)) //<Andrew Clark>//
- **[1a7472624](https://github.com/facebook/react/commit/1a7472624 )**: Add `supportsMicrotasks` to the host config ([#20809](https://github.com/facebook/react/pull/20809)) //<Andrew Clark>//
- **[696e736be](https://github.com/facebook/react/commit/696e736be )**: Warn if static flag is accidentally cleared ([#20807](https://github.com/facebook/react/pull/20807)) //<Andrew Clark>//
- **[483358c38](https://github.com/facebook/react/commit/483358c38 )**: Omit TransitionHydrationLane from TransitionLanes ([#20802](https://github.com/facebook/react/pull/20802)) //<Andrew Clark>//
- **[78ec97d34](https://github.com/facebook/react/commit/78ec97d34 )**: Fix typo ([#20466](https://github.com/facebook/react/pull/20466)) //<inokawa>//
- **[6cdc35972](https://github.com/facebook/react/commit/6cdc35972 )**: fix comments of markUpdateLaneFromFiberToRoot ([#20546](https://github.com/facebook/react/pull/20546)) //<neroneroffy>//
- **[47dd9f441](https://github.com/facebook/react/commit/47dd9f441 )**: Remove fakeCallbackNode ([#20799](https://github.com/facebook/react/pull/20799)) //<Andrew Clark>//
- **[114ab5295](https://github.com/facebook/react/commit/114ab5295 )**: Make remaining empty lanes Transition lanes ([#20793](https://github.com/facebook/react/pull/20793)) //<Andrew Clark>//
- **[d3d2451a0](https://github.com/facebook/react/commit/d3d2451a0 )**: Use a single lane per priority level ([#20791](https://github.com/facebook/react/pull/20791)) //<Andrew Clark>//
- **[eee874ce6](https://github.com/facebook/react/commit/eee874ce6 )**: Cross-fork lint: Support named export declaration ([#20784](https://github.com/facebook/react/pull/20784)) //<Andrew Clark>//
- **[3b870b1e0](https://github.com/facebook/react/commit/3b870b1e0 )**: Lane enableTransitionEntanglement flag ([#20775](https://github.com/facebook/react/pull/20775)) //<Andrew Clark>//
- **[d1845ad0f](https://github.com/facebook/react/commit/d1845ad0f )**: Default updates should not interrupt transitions ([#20771](https://github.com/facebook/react/pull/20771)) //<Andrew Clark>//
- **[3499c343a](https://github.com/facebook/react/commit/3499c343a )**: Apply #20778 to new fork, too ([#20782](https://github.com/facebook/react/pull/20782)) //<Andrew Clark>//
- **[3d10eca24](https://github.com/facebook/react/commit/3d10eca24 )**: Move scheduler priority check into ReactDOM ([#20778](https://github.com/facebook/react/pull/20778)) //<Dan Abramov>//
- **[97fce318a](https://github.com/facebook/react/commit/97fce318a )**: Experiment: Infer the current event priority from the native event ([#20748](https://github.com/facebook/react/pull/20748)) //<Dan Abramov>//
- **[6c526c515](https://github.com/facebook/react/commit/6c526c515 )**: Don't shift interleaved updates to separate lane ([#20681](https://github.com/facebook/react/pull/20681)) //<Andrew Clark>//
- **[35f7441d3](https://github.com/facebook/react/commit/35f7441d3 )**: Use Lanes instead of priority event constants ([#20762](https://github.com/facebook/react/pull/20762)) //<Dan Abramov>//
- **[a014c915c](https://github.com/facebook/react/commit/a014c915c )**: Parallel transitions: Assign different lanes to consecutive transitions ([#20672](https://github.com/facebook/react/pull/20672)) //<Andrew Clark>//
- **[77754ae61](https://github.com/facebook/react/commit/77754ae61 )**: Decouple event priority list from event name list ([#20760](https://github.com/facebook/react/pull/20760)) //<Dan Abramov>//
- **[b5bac1821](https://github.com/facebook/react/commit/b5bac1821 )**: Align event group constant naming with lane naming ([#20744](https://github.com/facebook/react/pull/20744)) //<Dan Abramov>//
- **[4ecf11977](https://github.com/facebook/react/commit/4ecf11977 )**: Remove the Fundamental internals ([#20745](https://github.com/facebook/react/pull/20745)) //<Dan Abramov>//
- **[eeb1325b0](https://github.com/facebook/react/commit/eeb1325b0 )**: Fix UMD bundles by removing usage of global ([#20743](https://github.com/facebook/react/pull/20743)) //<Dan Abramov>//
- **[0935a1db3](https://github.com/facebook/react/commit/0935a1db3 )**: Delete consolidateBundleSizes script ([#20724](https://github.com/facebook/react/pull/20724)) //<Andrew Clark>//
- **[7cb9fd7ef](https://github.com/facebook/react/commit/7cb9fd7ef )**: Land interleaved updates change in main fork ([#20710](https://github.com/facebook/react/pull/20710)) //<Andrew Clark>//
- **[dc27b5aaa](https://github.com/facebook/react/commit/dc27b5aaa )**: useMutableSource: Use StrictMode double render to detect render phase mutation ([#20698](https://github.com/facebook/react/pull/20698)) //<Andrew Clark>//
- **[bb1b7951d](https://github.com/facebook/react/commit/bb1b7951d )**: fix: don't run effects if a render phase update results in unchanged deps ([#20676](https://github.com/facebook/react/pull/20676)) //<Sebastian Silbermann>//
- **[766a7a28a](https://github.com/facebook/react/commit/766a7a28a )**: Improve React error message when mutable sources are mutated during render ([#20665](https://github.com/facebook/react/pull/20665)) //<Brian Vaughn>//
- **[a922f1c71](https://github.com/facebook/react/commit/a922f1c71 )**: Fix cache refresh bug that broke DevTools ([#20687](https://github.com/facebook/react/pull/20687)) //<Andrew Clark>//
- **[e51bd6c1f](https://github.com/facebook/react/commit/e51bd6c1f )**: Queue discrete events in microtask ([#20669](https://github.com/facebook/react/pull/20669)) //<Ricky>//
- **[aa736a0fa](https://github.com/facebook/react/commit/aa736a0fa )**: Add queue microtask to host configs ([#20668](https://github.com/facebook/react/pull/20668)) //<Ricky>//
- **[deeeaf1d2](https://github.com/facebook/react/commit/deeeaf1d2 )**: Entangle overlapping transitions per queue ([#20670](https://github.com/facebook/react/pull/20670)) //<Andrew Clark>//
- **[e316f7855](https://github.com/facebook/react/commit/e316f7855 )**: RN: Implement `sendAccessibilityEvent` in RN Renderer that proxies between Fabric/non-Fabric ([#20554](https://github.com/facebook/react/pull/20554)) //<Joshua Gross>//
- **[9c32622cf](https://github.com/facebook/react/commit/9c32622cf )**: Improve tests that use discrete events ([#20667](https://github.com/facebook/react/pull/20667)) //<Ricky>//
- **[d13f5b953](https://github.com/facebook/react/commit/d13f5b953 )**: Experiment: Unsuspend all lanes on update ([#20660](https://github.com/facebook/react/pull/20660)) //<Andrew Clark>//
- **[a511dc709](https://github.com/facebook/react/commit/a511dc709 )**: Error for deferred value and transition in Server Components ([#20657](https://github.com/facebook/react/pull/20657)) //<Sebastian Markbåge>//
- **[fb3f63f1a](https://github.com/facebook/react/commit/fb3f63f1a )**: Remove lazy invokation of segments ([#20656](https://github.com/facebook/react/pull/20656)) //<Sebastian Markbåge>//
- **[895ae67fd](https://github.com/facebook/react/commit/895ae67fd )**: Improve error boundary handling for unmounted subtrees ([#20645](https://github.com/facebook/react/pull/20645)) //<Brian Vaughn>//
- **[f15f8f64b](https://github.com/facebook/react/commit/f15f8f64b )**: Store interleaved updates on separate queue until end of render ([#20615](https://github.com/facebook/react/pull/20615)) //<Andrew Clark>//
- **[0fd6805c6](https://github.com/facebook/react/commit/0fd6805c6 )**: Land rest of effects refactor in main fork ([#20644](https://github.com/facebook/react/pull/20644)) //<Andrew Clark>//
- **[a6b5256a2](https://github.com/facebook/react/commit/a6b5256a2 )**: Refactored recursive strict effects method to be iterative ([#20642](https://github.com/facebook/react/pull/20642)) //<Brian Vaughn>//
- **[3957853ae](https://github.com/facebook/react/commit/3957853ae )**: Re-add "strict effects mode" for legacy roots only ([#20639](https://github.com/facebook/react/pull/20639)) //<Brian Vaughn>//
- **[fceb75e89](https://github.com/facebook/react/commit/fceb75e89 )**: Delete remaining references to effect list ([#20625](https://github.com/facebook/react/pull/20625)) //<Andrew Clark>//
- **[741dcbdbe](https://github.com/facebook/react/commit/741dcbdbe )**: Schedule passive phase whenever there's a deletion ([#20624](https://github.com/facebook/react/pull/20624)) //<Andrew Clark>//
- **[11a983fc7](https://github.com/facebook/react/commit/11a983fc7 )**: Remove references to Deletion flag ([#20623](https://github.com/facebook/react/pull/20623)) //<Andrew Clark>//
- **[2e948e0d9](https://github.com/facebook/react/commit/2e948e0d9 )**: Avoid .valueOf to close #20594 ([#20617](https://github.com/facebook/react/pull/20617)) //<Dima Tisnek>//
- **[2a646f73e](https://github.com/facebook/react/commit/2a646f73e )**: Convert snapshot phase to depth-first traversal ([#20622](https://github.com/facebook/react/pull/20622)) //<Andrew Clark>//
- **[fb3e158a6](https://github.com/facebook/react/commit/fb3e158a6 )**: Convert ReactSuspenseWithNoopRenderer tests to use built-in cache ([#20601](https://github.com/facebook/react/pull/20601)) //<Andrew Clark>//
- **[e0fd9e67f](https://github.com/facebook/react/commit/e0fd9e67f )**: Use update lane priority in work loop ([#20621](https://github.com/facebook/react/pull/20621)) //<Ricky>//
- **[58e830448](https://github.com/facebook/react/commit/58e830448 )**: Remove custom error message from hook access error ([#20604](https://github.com/facebook/react/pull/20604)) //<Andrew Clark>//
- **[9043626f0](https://github.com/facebook/react/commit/9043626f0 )**: Cache tests: Make it easier to test many caches ([#20600](https://github.com/facebook/react/pull/20600)) //<Andrew Clark>//
- **[af0bb68e8](https://github.com/facebook/react/commit/af0bb68e8 )**: Land #20595 and #20596 in main fork ([#20602](https://github.com/facebook/react/pull/20602)) //<Andrew Clark>//
- **[2b6985114](https://github.com/facebook/react/commit/2b6985114 )**: build-combined: Fix failures  when renaming across devices ([#20620](https://github.com/facebook/react/pull/20620)) //<Sebastian Silbermann>//
- **[af16f755d](https://github.com/facebook/react/commit/af16f755d )**: Update DevTools to use getCacheForType API ([#20548](https://github.com/facebook/react/pull/20548)) //<Brian Vaughn>//
- **[95feb0e70](https://github.com/facebook/react/commit/95feb0e70 )**: Convert mutation phase to depth-first traversal ([#20596](https://github.com/facebook/react/pull/20596)) //<Andrew Clark>//
- **[6132919bf](https://github.com/facebook/react/commit/6132919bf )**: Convert layout phase to depth-first traversal ([#20595](https://github.com/facebook/react/pull/20595)) //<Andrew Clark>//
- **[42e04b46d](https://github.com/facebook/react/commit/42e04b46d )**: Fix: Detach deleted fiber's alternate, too ([#20587](https://github.com/facebook/react/pull/20587)) //<Andrew Clark>//
- **[a656ace8d](https://github.com/facebook/react/commit/a656ace8d )**: Deletion effects should fire parent -> child ([#20584](https://github.com/facebook/react/pull/20584)) //<Andrew Clark>//
- **[e6ed2bcf4](https://github.com/facebook/react/commit/e6ed2bcf4 )**: Update package.json versions as part of build step ([#20579](https://github.com/facebook/react/pull/20579)) //<Andrew Clark>//
- **[eb0fb3823](https://github.com/facebook/react/commit/eb0fb3823 )**: Build stable and experimental with same command ([#20573](https://github.com/facebook/react/pull/20573)) //<Andrew Clark>//
- **[e8eff119e](https://github.com/facebook/react/commit/e8eff119e )**: Fix ESLint crash on empty react effect hook ([#20385](https://github.com/facebook/react/pull/20385)) //<Christian Ruigrok>//
- **[27659559e](https://github.com/facebook/react/commit/27659559e )**: Add useRefresh hook to react-debug-tools ([#20460](https://github.com/facebook/react/pull/20460)) //<Brian Vaughn>//
- **[99554dc36](https://github.com/facebook/react/commit/99554dc36 )**: Add Flight packages to experimental allowlist ([#20486](https://github.com/facebook/react/pull/20486)) //<Andrew Clark>//
- **[efc57e5cb](https://github.com/facebook/react/commit/efc57e5cb )**: Add built-in Suspense cache with support for invalidation (refreshing) ([#20456](https://github.com/facebook/react/pull/20456)) //<Andrew Clark>//
- **[00a5b08e2](https://github.com/facebook/react/commit/00a5b08e2 )**: Remove PassiveStatic optimization //<Andrew Clark>//
- **[a6329b105](https://github.com/facebook/react/commit/a6329b105 )**: Don't clear static flags in resetWorkInProgress //<Andrew Clark>//
- **[1cf59f34b](https://github.com/facebook/react/commit/1cf59f34b )**: Convert passive unmount phase to tree traversal //<Andrew Clark>//
- **[ab29695a0](https://github.com/facebook/react/commit/ab29695a0 )**: Defer more field detachments to passive phase //<Andrew Clark>//
- **[d37d7a4bb](https://github.com/facebook/react/commit/d37d7a4bb )**: Convert passive mount phase to tree traversal //<Andrew Clark>//
- **[19e15a398](https://github.com/facebook/react/commit/19e15a398 )**: Add PassiveStatic to trees with passive effects //<Andrew Clark>//
- **[ff17fc176](https://github.com/facebook/react/commit/ff17fc176 )**: Don't clear other flags when adding Deletion //<Andrew Clark>//
- **[5687864eb](https://github.com/facebook/react/commit/5687864eb )**: Add back disableSchedulerTimeoutInWorkLoop flag ([#20482](https://github.com/facebook/react/pull/20482)) //<Ricky>//
- **[9f338e5d7](https://github.com/facebook/react/commit/9f338e5d7 )**: clone json obj in react native flight client host config parser ([#20474](https://github.com/facebook/react/pull/20474)) //<Luna Ruan>//
- **[4e62fd271](https://github.com/facebook/react/commit/4e62fd271 )**: clone json obj in relay flight client host config parser ([#20465](https://github.com/facebook/react/pull/20465)) //<Luna Ruan>//
- **[070372cde](https://github.com/facebook/react/commit/070372cde )**: [Flight] Fix webpack watch mode issue ([#20457](https://github.com/facebook/react/pull/20457)) //<Dan Abramov>//
- **[0f80dd148](https://github.com/facebook/react/commit/0f80dd148 )**: [Flight] Support concatenated modules in Webpack plugin ([#20449](https://github.com/facebook/react/pull/20449)) //<Dan Abramov>//
- **[daf38ecdf](https://github.com/facebook/react/commit/daf38ecdf )**: [Flight] Use lazy reference for existing modules ([#20445](https://github.com/facebook/react/pull/20445)) //<Dan Abramov>//
- **[3f9205c33](https://github.com/facebook/react/commit/3f9205c33 )**: Regression test: SuspenseList causes lost unmount ([#20433](https://github.com/facebook/react/pull/20433)) //<Andrew Clark>//
- **[cdfde3ae1](https://github.com/facebook/react/commit/cdfde3ae1 )**: Always rethrow original error when we replay errors ([#20425](https://github.com/facebook/react/pull/20425)) //<Sebastian Markbåge>//
- **[b15d6e93e](https://github.com/facebook/react/commit/b15d6e93e )**: [Flight] Make PG and FS server-only ([#20424](https://github.com/facebook/react/pull/20424)) //<Dan Abramov>//
- **[40ff2395e](https://github.com/facebook/react/commit/40ff2395e )**: [Flight] Prevent non-Server imports of aliased Server entrypoints ([#20422](https://github.com/facebook/react/pull/20422)) //<Dan Abramov>//
- **[94aa365e3](https://github.com/facebook/react/commit/94aa365e3 )**: [Flight] Fix webpack plugin to use chunk groups ([#20421](https://github.com/facebook/react/pull/20421)) //<Dan Abramov>//
- **[842ee367e](https://github.com/facebook/react/commit/842ee367e )**: [Flight] Rename the shared entry point ([#20420](https://github.com/facebook/react/pull/20420)) //<Dan Abramov>//
- **[dbf40ef75](https://github.com/facebook/react/commit/dbf40ef75 )**: Put .server.js at the end of bundle filenames ([#20419](https://github.com/facebook/react/pull/20419)) //<Dan Abramov>//
- **[03126dd08](https://github.com/facebook/react/commit/03126dd08 )**: [Flight] Add read-only fs methods ([#20412](https://github.com/facebook/react/pull/20412)) //<Dan Abramov>//
- **[b51a686a9](https://github.com/facebook/react/commit/b51a686a9 )**: Turn on double effects for www test renderer ([#20416](https://github.com/facebook/react/pull/20416)) //<Brian Vaughn>//
- **[56a632adb](https://github.com/facebook/react/commit/56a632adb )**: Double Invoke Effects in __DEV__ (in old reconciler fork) ([#20415](https://github.com/facebook/react/pull/20415)) //<Brian Vaughn>//
- **[1a2422337](https://github.com/facebook/react/commit/1a2422337 )**: fixed typo ([#20351](https://github.com/facebook/react/pull/20351)) //<togami2864>//
- **[a233c9e2a](https://github.com/facebook/react/commit/a233c9e2a )**: Rename internal cache helpers ([#20410](https://github.com/facebook/react/pull/20410)) //<Dan Abramov>//
- **[6a4b12b81](https://github.com/facebook/react/commit/6a4b12b81 )**: [Flight] Add rudimentary FS binding ([#20409](https://github.com/facebook/react/pull/20409)) //<Dan Abramov>//
- **[7659949d6](https://github.com/facebook/react/commit/7659949d6 )**: Clear `deletions` in `detachFiber` ([#20401](https://github.com/facebook/react/pull/20401)) //<Andrew Clark>//
- **[b9680aef7](https://github.com/facebook/react/commit/b9680aef7 )**: Cache react-fetch results in the Node version ([#20407](https://github.com/facebook/react/pull/20407)) //<Dan Abramov>//
- **[cdae31ab8](https://github.com/facebook/react/commit/cdae31ab8 )**: Fix typo ([#20279](https://github.com/facebook/react/pull/20279)) //<inokawa>//
- **[51a7cfe21](https://github.com/facebook/react/commit/51a7cfe21 )**: Fix typo ([#20300](https://github.com/facebook/react/pull/20300)) //<Hollow Man>//
- **[373b297c5](https://github.com/facebook/react/commit/373b297c5 )**: fix: Fix typo in react-reconciler docs ([#20284](https://github.com/facebook/react/pull/20284)) //<Sam Zhou>//
- **[1b5ca9906](https://github.com/facebook/react/commit/1b5ca9906 )**: Fix module ID deduplication ([#20406](https://github.com/facebook/react/pull/20406)) //<Dan Abramov>//
- **[5fd9db732](https://github.com/facebook/react/commit/5fd9db732 )**: [Flight] Rename react-transport-... packages to react-server-... ([#20403](https://github.com/facebook/react/pull/20403)) //<Sebastian Markbåge>//
- **[ce40f1dc2](https://github.com/facebook/react/commit/ce40f1dc2 )**: Use assets API + writeToDisk instead of directly writing to disk ([#20402](https://github.com/facebook/react/pull/20402)) //<Sebastian Markbåge>//
- **[b66ae09b6](https://github.com/facebook/react/commit/b66ae09b6 )**: Track subtreeFlags et al with bubbleProperties //<Andrew Clark>//
- **[de75315d7](https://github.com/facebook/react/commit/de75315d7 )**: Track deletions using an array on the parent //<Andrew Clark>//
- **[1377e465d](https://github.com/facebook/react/commit/1377e465d )**: Add Placement bit without removing others ([#20398](https://github.com/facebook/react/pull/20398)) //<Andrew Clark>//
- **[18d7574ae](https://github.com/facebook/react/commit/18d7574ae )**: Remove `catch` from Scheduler build ([#20396](https://github.com/facebook/react/pull/20396)) //<Andrew Clark>//
- **[30dfb8602](https://github.com/facebook/react/commit/30dfb8602 )**: [Flight] Basic scan of the file system to find Client modules ([#20383](https://github.com/facebook/react/pull/20383)) //<Sebastian Markbåge>//
- **[9b8060041](https://github.com/facebook/react/commit/9b8060041 )**: Error when the number of parameters to a query changes ([#20379](https://github.com/facebook/react/pull/20379)) //<Dan Abramov>//
- **[60e4a76fa](https://github.com/facebook/react/commit/60e4a76fa )**: [Flight] Add rudimentary PG binding ([#20372](https://github.com/facebook/react/pull/20372)) //<Dan Abramov>//
- **[88ef95712](https://github.com/facebook/react/commit/88ef95712 )**: Fork ReactFiberLane ([#20371](https://github.com/facebook/react/pull/20371)) //<Andrew Clark>//
- **[41c5d00fc](https://github.com/facebook/react/commit/41c5d00fc )**: [Flight] Minimal webpack plugin ([#20228](https://github.com/facebook/react/pull/20228)) //<Dan Abramov>//
- **[e23673b51](https://github.com/facebook/react/commit/e23673b51 )**: [Flight] Add getCacheForType() to the dispatcher ([#20315](https://github.com/facebook/react/pull/20315)) //<Dan Abramov>//
- **[555eeae33](https://github.com/facebook/react/commit/555eeae33 )**: Add disableNativeComponentFrames flag ([#20364](https://github.com/facebook/react/pull/20364)) //<Philipp Spiess>//
- **[148ffe3cf](https://github.com/facebook/react/commit/148ffe3cf )**: Failing test for Client reconciliation ([#20318](https://github.com/facebook/react/pull/20318)) //<Dan Abramov>//
- **[a2a025537](https://github.com/facebook/react/commit/a2a025537 )**: Fixed invalid DevTools work tags ([#20362](https://github.com/facebook/react/pull/20362)) //<Brian Vaughn>//
- **[5711811da](https://github.com/facebook/react/commit/5711811da )**: Reconcile element types of lazy component yielding the same type ([#20357](https://github.com/facebook/react/pull/20357)) //<Sebastian Markbåge>//
- **[3f73dcee3](https://github.com/facebook/react/commit/3f73dcee3 )**: Support named exports from client references ([#20312](https://github.com/facebook/react/pull/20312)) //<Sebastian Markbåge>//
- **[565148d75](https://github.com/facebook/react/commit/565148d75 )**: Disallow *.server.js imports from any other files ([#20309](https://github.com/facebook/react/pull/20309)) //<Sebastian Markbåge>//
- **[e6a0f2763](https://github.com/facebook/react/commit/e6a0f2763 )**: Profiler: Improve nested-update checks ([#20299](https://github.com/facebook/react/pull/20299)) //<Brian Vaughn>//
- **[d93b58a5e](https://github.com/facebook/react/commit/d93b58a5e )**: Add flight specific entry point for react package ([#20304](https://github.com/facebook/react/pull/20304)) //<Sebastian Markbåge>//
- **[a81c02ac1](https://github.com/facebook/react/commit/a81c02ac1 )**: Profiler onNestedUpdateScheduled accepts id as first param ([#20293](https://github.com/facebook/react/pull/20293)) //<Brian Vaughn>//
- **[ac2cff4b1](https://github.com/facebook/react/commit/ac2cff4b1 )**: Warn if commit phase error thrown in detached tree ([#20286](https://github.com/facebook/react/pull/20286)) //<Andrew Clark>//
- **[0f83a64ed](https://github.com/facebook/react/commit/0f83a64ed )**: Regression test: Missing unmount after re-order ([#20285](https://github.com/facebook/react/pull/20285)) //<Andrew Clark>//
- **[ebf158965](https://github.com/facebook/react/commit/ebf158965 )**: Add best-effort documentation for third-party renderers ([#20278](https://github.com/facebook/react/pull/20278)) //<Dan Abramov>//
- **[82e99e1b0](https://github.com/facebook/react/commit/82e99e1b0 )**: Add Node ESM Loader and Register Entrypoints ([#20274](https://github.com/facebook/react/pull/20274)) //<Sebastian Markbåge>//
- **[bf7b7aeb1](https://github.com/facebook/react/commit/bf7b7aeb1 )**: findDOMNode: Remove return pointer mutation ([#20272](https://github.com/facebook/react/pull/20272)) //<Andrew Clark>//
- **[369c3db62](https://github.com/facebook/react/commit/369c3db62 )**: Add separate ChildDeletion flag ([#20264](https://github.com/facebook/react/pull/20264)) //<Andrew Clark>//
- **[765e89b90](https://github.com/facebook/react/commit/765e89b90 )**: Reset new fork to old fork  ([#20254](https://github.com/facebook/react/pull/20254)) //<Andrew Clark>//
- **[7548dd573](https://github.com/facebook/react/commit/7548dd573 )**: Properly reset Profiler nested-update flag ([#20253](https://github.com/facebook/react/pull/20253)) //<Brian Vaughn>//
- **[b44e4b13a](https://github.com/facebook/react/commit/b44e4b13a )**: Check for deletions in `hadNoMutationsEffects` ([#20252](https://github.com/facebook/react/pull/20252)) //<Andrew Clark>//
- **[3ebf05183](https://github.com/facebook/react/commit/3ebf05183 )**: Add new effect fields to old fork, and vice versa ([#20246](https://github.com/facebook/react/pull/20246)) //<Andrew Clark>//
- **[2fbcc9806](https://github.com/facebook/react/commit/2fbcc9806 )**: Remove cycle between ReactFiberHooks and ReactInternalTypes ([#20242](https://github.com/facebook/react/pull/20242)) //<Paul Doyle>//
- **[504222dcd](https://github.com/facebook/react/commit/504222dcd )**: Add Node ESM build option ([#20243](https://github.com/facebook/react/pull/20243)) //<Sebastian Markbåge>//
- **[1b96ee444](https://github.com/facebook/react/commit/1b96ee444 )**: Remove noinline directives from new commit phase ([#20241](https://github.com/facebook/react/pull/20241)) //<Andrew Clark>//
- **[760d9ab57](https://github.com/facebook/react/commit/760d9ab57 )**: Scheduling profiler tweaks ([#20215](https://github.com/facebook/react/pull/20215)) //<Brian Vaughn>//
- **[9403c3b53](https://github.com/facebook/react/commit/9403c3b53 )**: Add Profiler callback when nested updates are scheduled ([#20211](https://github.com/facebook/react/pull/20211)) //<Brian Vaughn>//
- **[62efd9618](https://github.com/facebook/react/commit/62efd9618 )**: use-subscription@1.5.1 //<Dan Abramov>//
- **[e7006d67d](https://github.com/facebook/react/commit/e7006d67d )**: Widen peer dependency range of use-subscription ([#20225](https://github.com/facebook/react/pull/20225)) //<Billy Janitsch>//
- **[15df051c9](https://github.com/facebook/react/commit/15df051c9 )**: Add warning if return pointer is inconsistent ([#20219](https://github.com/facebook/react/pull/20219)) //<Andrew Clark>//
- **[9aca239f1](https://github.com/facebook/react/commit/9aca239f1 )**: Improved dev experience when DevTools hook is disabled ([#20208](https://github.com/facebook/react/pull/20208)) //<Alphabet Codes>//
- **[12627f93b](https://github.com/facebook/react/commit/12627f93b )**: Perform hasOwnProperty check in Relay Flight ([#20220](https://github.com/facebook/react/pull/20220)) //<Sebastian Markbåge>//
- **[163199d8c](https://github.com/facebook/react/commit/163199d8c )**: Dedupe module id generation ([#20172](https://github.com/facebook/react/pull/20172)) //<Sebastian Markbåge>//
- **[76a6dbcb9](https://github.com/facebook/react/commit/76a6dbcb9 )**: [Flight] Encode Symbols as special rows that can be referenced by models … ([#20171](https://github.com/facebook/react/pull/20171)) //<Sebastian Markbåge>//
- **[35e53b465](https://github.com/facebook/react/commit/35e53b465 )**: [Flight] Simplify Relay row protocol ([#20168](https://github.com/facebook/react/pull/20168)) //<Sebastian Markbåge>//
- **[16e6dadba](https://github.com/facebook/react/commit/16e6dadba )**: Encode throwing server components as lazy throwing references ([#20217](https://github.com/facebook/react/pull/20217)) //<Sebastian Markbåge>//
- **[c896cf961](https://github.com/facebook/react/commit/c896cf961 )**: Set return pointer when reusing current tree ([#20212](https://github.com/facebook/react/pull/20212)) //<Andrew Clark>//
- **[089866015](https://github.com/facebook/react/commit/089866015 )**: Add version of scheduler that only swaps MessageChannel for postTask ([#20206](https://github.com/facebook/react/pull/20206)) //<Ricky>//
- **[393c452e3](https://github.com/facebook/react/commit/393c452e3 )**: Add "nested-update" phase to Profiler API ([#20163](https://github.com/facebook/react/pull/20163)) //<Brian Vaughn>//
- **[13a62feab](https://github.com/facebook/react/commit/13a62feab )**: Fix path for SchedulerFeatureFlags ([#20200](https://github.com/facebook/react/pull/20200)) //<Ricky>//
- **[7a73d6a0f](https://github.com/facebook/react/commit/7a73d6a0f )**: (Temporarily) revert unmounting error boundaries changes ([#20147](https://github.com/facebook/react/pull/20147)) //<Brian Vaughn>//
- **[c29710a57](https://github.com/facebook/react/commit/c29710a57 )**: fix: useImperativeMethods to useImperativeHandle ([#20194](https://github.com/facebook/react/pull/20194)) //<Jack Works>//
- **[f8979e0e2](https://github.com/facebook/react/commit/f8979e0e2 )**: Revert 'Fabric-compatible implementation of  feature' and have Fabric noop when setJSResponder is called for now ([#21009](https://github.com/facebook/react/pull/21009)) //<Joshua Gross>//
- **[c9f6d0a3a](https://github.com/facebook/react/commit/c9f6d0a3a )**: Sync `ReactNativeTypes` from React Native ([#21015](https://github.com/facebook/react/pull/21015)) //<Timothy Yung>//

Changelog:
[General][Changed] - React Native sync for revisions c3e20f1...c9f6d0a

jest_e2e[run_all_tests]

Reviewed By: PeteTheHeat

Differential Revision: D27051885

fbshipit-source-id: 5b232f6093f5f2527f3b321bc8b5487934e92d70
2021-03-17 14:43:01 -07:00
Luna Wei 4b3c8e76b2 Update typed export and fix test
Summary:
Changelog:
[General][Changed] - Change export type of VirtualizedSectionList and wrap component updates in `act` in test.

Reviewed By: nadiia, kacieb

Differential Revision: D26575615

fbshipit-source-id: 60923604b40c343ed4244ec4fd33107158888c8e
2021-03-17 12:50:24 -07:00
Luna Wei f1cf2c39f9 Remove defaultProps
Summary:
#Changelog:
[General][Changed] - Remove `data` as a prop for VirtualizedSectionList. In the reactnative.dev docs it mentions that `sections` is the equivalent for `*SectionList`: https://reactnative.dev/docs/sectionlist#sections

Reviewed By: nadiia

Differential Revision: D26992800

fbshipit-source-id: afcd027fca0cc8b4d7418e0c5543382bc8e2f56c
2021-03-17 12:50:24 -07:00
Luna Wei 1cbedb95ec Remove keyExtractor defaultProps
Summary:
Changelog:
[Internal][Changed] -Remove keyExtractor from defaultProps as part of larger effort to remove defaultProps from VirtualizedList

Reviewed By: nadiia

Differential Revision: D26969588

fbshipit-source-id: b00922a339cbe471fcbf560ab4abdd9e48eda1fc
2021-03-17 12:50:23 -07:00
Luna Wei 76b6a66f4f Remove updateCellsBatchingPeriod defaultProps
Summary:
Changelog:
[Internal][Changed] -Remove updateCellsBatchingPeriod from defaultProps as part of larger effort to remove defaultProps from VirtualizedList

Reviewed By: nadiia

Differential Revision: D26969581

fbshipit-source-id: b1d1d18d575d9a6af2e68fe564d221849094f26b
2021-03-17 12:50:23 -07:00
Luna Wei b3101457a6 Remove windowSize defaultProps
Summary:
Changelog:
[Internal][Changed] -Remove windowSize from defaultProps as part of larger effort to remove defaultProps from VirtualizedList

Reviewed By: nadiia

Differential Revision: D26969589

fbshipit-source-id: da6215ee3876c8f186d59f91ef6fd94396366119
2021-03-17 12:50:23 -07:00
Luna Wei 3c5fa3b642 Remove scrollEventThrottle defaultProps
Summary:
Changelog:
[Internal][Changed] -Remove scrollEventThrottle from defaultProps as part of larger effort to remove defaultProps from VirtualizedList

Reviewed By: nadiia

Differential Revision: D26969580

fbshipit-source-id: 504e11493113c01d70e77b90f96c6506c179c060
2021-03-17 12:50:23 -07:00