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

6844 Коммитов

Автор SHA1 Сообщение Дата
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
Luna Wei e3c3ef0ace Remove onEndReachedThreshold defaultProps
Summary:
Changelog:
[Internal][Changed] -Remove onEndReachedThreshold from defaultProps as part of larger effort to remove defaultProps from VirtualizedList

Reviewed By: nadiia

Differential Revision: D26969584

fbshipit-source-id: 03968c5831587f9ed60dc52c55c55c0980f20cbd
2021-03-17 12:50:22 -07:00
Luna Wei 69030a480c Remove maxToRenderPerBatch defaultProps
Summary:
Changelog:
[Internal][Changed] -Remove maxToRenderPerBatch from defaultProps as part of larger effort to remove defaultProps from VirtualizedList

Reviewed By: nadiia

Differential Revision: D26969582

fbshipit-source-id: 64a07aae11f0403b01c01896b4f83565da6ecf43
2021-03-17 12:50:22 -07:00
Luna Wei 529fbc84d5 ESM-ify VirtualizeUtils and flatten parameters on computeWindowedRenderLimits
Summary:
Changelog:
[General][Changed] - Change VirtualizeUtils to use ESM and change function signature on `computeWindowedRenderLimits` as part of larger effort to remove defaultProps from VirtualizedList

Reviewed By: nadiia

Differential Revision: D26969586

fbshipit-source-id: cd1961a2088d37543dbc9bca8c4a062cdb426a35
2021-03-16 21:30:25 -07:00
Luna Wei e928f54d76 Remove initialNumToRender defaultProps
Summary:
Changelog:
[Internal][Changed] - Remove initialNumToRender from defaultProps as part of larger effort to remove defaultProps from VirtualizedList

Reviewed By: nadiia

Differential Revision: D26969585

fbshipit-source-id: 8674544c06b7b99eee693cc7508c9e4199232e98
2021-03-16 21:30:24 -07:00
Luna Wei cbc3d90fd4 Remove horizontal from defaultProps
Summary:
Changelog:
[Internal][Changed] - Remove horizontal from defaultProps as part of larger effort to remove defaultProps from VirtualizedList

Reviewed By: nadiia

Differential Revision: D26969583

fbshipit-source-id: c21ac15a220a68a58e32b78dcc37c053756b72cf
2021-03-16 15:00:49 -07:00
Luna Wei 3ff7e86b0f Remove disableVirtualization from defaultProps
Summary:
Changelog:
[Internal][Changed] - Remove disableVirtualization from defaultProps as part of larger effort to remove defaultProps from VirtualizedList

Reviewed By: nadiia

Differential Revision: D26969587

fbshipit-source-id: 662fa620bc5b6b9a64c1906f62dae1f4b373a23b
2021-03-16 01:49:42 -07:00
Joshua Gross c4c0065b00 Add PressabilityPerformanceEventEmitter
Summary:
Add PressabilityPerformanceEventEmitter which allows product code / infrastructure to subscribe to touch-related performance events.

Changelog: [Added][JS] Product/infra can subscribe to Pressability touch events for telemetry purposes

Reviewed By: fkgozali

Differential Revision: D27034835

fbshipit-source-id: e62811f641994b9eadb5cdd7391e806b6cce479a
2021-03-15 23:45:45 -07:00
Nadiia D 6333c15fa2 Back out "Remove deprecated lifecycles usage"
Summary:
Changelog:
[General][Changed] REVERT: createAnimatedComponent: removed deprecated lifecycles usage

Original commit changeset: 04d016b30ae0

Reviewed By: JoshuaGross

Differential Revision: D27053061

fbshipit-source-id: 6bb50da0a773070a979e7c52957a375b20c7c609
2021-03-15 15:11:48 -07:00
David Vacca 1bc06f18c6 Fix impression logging in VirtualizedList
Summary:
This diff forces a remeasure of the children of VirtualizedLists everytime the VirtualizedList is measured.
The goal is to ensure that nested VirtualizedList has the correct "scroll information" all the time, scroll information information is used by ViewabilityHelper.computeViewableItems method to determine if Items of the list are visible to the user.

This new code is controlled by the MC: rn_core:enable_virtualizedlist_remeasure_children_if_needed.

changelog: [internal] internal

// I used an internal changelog because this is under a MC

Reviewed By: lunaleaps

Differential Revision: D27003249

fbshipit-source-id: f9452ceb27683b0f595dd4bffdcced0ecf6bb0b5
2021-03-12 15:33:51 -08:00
Nadiia D ba61267015 Remove deprecated lifecycles usage
Summary:
Changelog:
[General][Changed] createAnimatedComponent: removed deprecated lifecycles usage

Reviewed By: lunaleaps

Differential Revision: D26734209

fbshipit-source-id: 04d016b30ae0d989890a4b3d8602d47a399dcd11
2021-03-11 16:43:10 -08:00
Huzaifa Khan 5889cbebe3 Added talkback support for button accessibility: disabled prop (#31001)
Summary:
Issue # https://github.com/facebook/react-native/issues/30934 .When using a screen reader disabled buttons do not announce that they are disabled.

## Changelog

[Android] [Changed] - Passing accessibility state in button so it can announce disabled in talkback

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

Test Plan:
I have added Button in Button Example with accessibiltyState prop that will announce button is disabled when testing with talkback.

## Ios test
I am unable to run ios project on my machine. RNTesterPods.xcworkspace gives workspace integrity error :/

Reviewed By: kacieb

Differential Revision: D26492483

Pulled By: lunaleaps

fbshipit-source-id: c4bbe8ca896b0d303976591c300ccac67a96ac73
2021-03-11 12:02:40 -08:00
David Biedenbach 310a6bcf4b Fix Issue 10718: Add iOS support for progressViewOffset (#30737)
Summary:
Fixes https://github.com/facebook/react-native/issues/10718, bringing `progressViewOffset` support to iOS.

Thanks to Taylor123 for the initial PR upon which this fix is based.

## Changelog

[iOS] [Fix] - `progressViewOffset` prop of `RefreshControl` and `VirtualizedList` now works on iOS

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

Test Plan:
Tested with quick-and-dirty sample app.

![progressViewOffset-iOS](https://user-images.githubusercontent.com/1563532/104526540-82fe1d80-55b7-11eb-9f99-e025bedf4874.gif)

## Documentation

The corresponding documentation update PR can be found [here](https://github.com/facebook/react-native-website/pull/2441).

Reviewed By: kacieb

Differential Revision: D26813977

Pulled By: sammy-SC

fbshipit-source-id: 45cc5a647d70e44a29c6391b7586cb41ca011bef
2021-03-11 10:27:25 -08:00
Nick Gerleman 4fb9e2f6a3 Add tests describing current sticky header realization behavior (#31075)
Summary:
See https://github.com/react-native-community/discussions-and-proposals/pull/335 for extra context.

A VirtualizedList may have sticky headers, forwarded on to ScrollView. These sticky headers are exempt from virtualization once realized for the first time. This change documents the behavior of keeping sticky header cells realized after scrolling away.

This scenario performs the same behavior as creating an internal "realization window" for sticky headers with a single cell window size. Generalizing the concept of realization windows should be shaped to support the existing sticky header scenario.

## 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 tests describing current sticky header realization behavior

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

Reviewed By: lunaleaps

Differential Revision: D26767582

Pulled By: appden

fbshipit-source-id: 0d151bd6046fcb5384c646205aafa1ca7edf6c77
2021-03-10 17:10:22 -08:00
Tim Yung 035718ba97 RN: Restore Deprecated Event Methods
Summary:
Restore deprecated event listener removal methods in order to minimize breaking changes for the next release. The methods will work, but they will not report a warning via `console.error`.

Changelog:
[General][Added] - `EventEmitter.removeListener` now emits a deprecation notice.
[General][Added] - Restored `AppState.removeEventListener` with a deprecation notice.
[General][Added] - Restored `Keyboard.removeEventListener` with a deprecation notice.
[General][Added] - Restored `Linking.removeEventListener` with a deprecation notice.

Reviewed By: nadiia, kacieb

Differential Revision: D26589441

fbshipit-source-id: 7d89982a182cf2163136e157d4c1beee91c30393
2021-03-10 16:06:26 -08:00
Tim Yung c47a03563d RN: Change Dimensions to Return EventSubscription
Summary:
Changes `Dimensions.addEventListener` to return an `EventSubscription` object that has a `remove()` method on it.

In an upcoming commit, calling `Dimensions.removeEventListener` will lead to a deprecation warning.

Changelog:
[General][Change] - `Dimensions.addEventListener` now returns an `EventSubscription`.

Reviewed By: kacieb

Differential Revision: D26808827

fbshipit-source-id: 0cfdc65b83c177f60937c1aa3a4cf633592f73d7
2021-03-10 16:06:26 -08:00
Ramanpreet Nara 23d9bf1a24 Make I18nManagerModule TurboModule-compatible
Summary:
This NativeModule will now be type-safe, and TurboModule-compatible.

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D26956332

fbshipit-source-id: 6651a003c70819934869dd6a8c664ef984d0efcb
2021-03-10 14:55:29 -08:00
Yan Zhang ffba25c648 add a hide-on-scroll feature to ScrollView
Summary:
Add a stickyHeaderHiddenOnScroll option to keep the sticky header hidden during scrolling down, and only slide in when scrolling up
Changelog:
[General][Added] - Add a stickyHeaderHiddenOnScroll option to keep the sticky header hidden during scrolling down, and only slide in when scrolling up

Reviewed By: JoshuaGross

Differential Revision: D26900810

fbshipit-source-id: 6bfb1a4da07fff0763223d60836df187f9d95dd6
2021-03-09 12:36:20 -08:00
David Vacca aba11daff8 Integrate global.__nativeComponentRegistry__hasComponent into NativeComponentRegistry.js
Summary:
This diff creates a new unstable method (unstable_hasComponent) to expose `global.__nativeComponentRegistry__hasComponent` into NativeComponentRegistry.js

changelog: [internal] internal

Reviewed By: yungsters

Differential Revision: D26716903

fbshipit-source-id: 52ff63b2779f41770b292cfc0b9022b1669d59fe
2021-03-09 10:39:20 -08:00
Hans Halverson d477f80113 Deploy Flow v0.146.0
Summary: Changelog: [Internal]

Reviewed By: mroch

Differential Revision: D26835439

fbshipit-source-id: 2607c3185485c8bd2c7e868dd2e3e0c06866f1f9
2021-03-06 11:37:57 -08:00
David Vacca 4c73ab08ed Migrate AndroidDropdownPicker to use NativeComponentRegistry instead of requireNativeComponent
Summary:
This diff migrates AndroidDropdownPicker 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: yungsters

Differential Revision: D26810196

fbshipit-source-id: 7be0396d49d9e1413d424ab1be035cbb6a211706
2021-03-04 13:54:45 -08:00
David Vacca aeed84d361 Migrate AndroidDialogPicker to use NativeComponentRegistry instead of requireNativeComponent
Summary:
This diff migrates AndroidDialogPicker 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: yungsters

Differential Revision: D26799476

fbshipit-source-id: d6605f60cc083d1d22b4f0fc0a2f79881502b1b4
2021-03-04 13:54:45 -08:00
David Vacca ce0b7e080b Migrate RCTPicker to use NativeComponentRegistry instead of requireNativeComponent
Summary:
This diff migrates RCTPicker 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: yungsters

Differential Revision: D26799477

fbshipit-source-id: 2f5935e0a4796c7a76921762a087cf7823ebd62e
2021-03-04 13:54:45 -08:00
Samuel Susla 7e81c1d483 Implement caretHidden in multiline text input
Summary:
Changelog: [internal]

Add missing implementation of caretHidden to multiline text input. This will work for both React Native Classic and New React Native Renderer.

Reviewed By: shergin

Differential Revision: D26818087

fbshipit-source-id: 3597604a6bd414a4a3b292d809d63a18efa8acb3
2021-03-04 10:53:35 -08:00
Lulu Wu c7d28bca30 Remove developer tool guard for android
Summary:
Debugging with not having Metro console.log() working in Venice is inconvenient.

After PeteTheHeat's fixes in diff series D26624224 the ground issues should be gone, so I tried removing the guard for Android and it worked.

The only issue I found is that when connected to Hermes Debugger in Flipper it keeps refreshing (reloading?), I posted here https://fb.workplace.com/groups/2308952995990093/permalink/2899448643607189/, with this found, I think it's a good start to iterate on since there are no crashes and this would help us a lot on Venice debugging.

Changelog:
[Android][Changed] - Remove developer tool guard for android

Reviewed By: PeteTheHeat

Differential Revision: D26779418

fbshipit-source-id: 96bb18771e01a25f84f845833a4f71e70433ef2b
2021-03-04 05:02:06 -08:00
Tim Yung 305b4253c2 RN: Change Appearance to Return EventSubscription
Summary:
Changes `Appearance.addChangeListener` to return an `EventSubscription` object that has a `remove()` method on it.

In an upcoming commit, calling `Appearance.removeChangeListener` will lead to a deprecation warning.

Changelog:
[General][Change] - `Appearance.addChangeListener` now returns an `EventSubscription`.

Reviewed By: kacieb

Differential Revision: D26696388

fbshipit-source-id: d0bdeffff3a2a366b3c11b6dc1417dfb2f1455c2
2021-03-03 21:43:48 -08:00
Kacie Bawiec 921c9ff165 Fix sticky header not sticking on first render in ScrollView
Summary:
# The bug
Sticky headers would not "stick" to the top of the ScrollView on initial render. On subsequent redners, all sticking would work correctly.

# Why the bug existed
This code to initialize the animated values used for sticky headers was in `UNSAFE_componentWillMount` prior to D26375818 (1641d46529). `UNSAFE_componentWillMount` is called before `render`.

In D26375818 (1641d46529), I moved the code into `componentDidMount`, which is called after `render`.

This caused a problem because code in `render` was relying on these initializations being done already.

# How I resolved the bug
To resolve this, I initialize these values in the constructor.

# Reference
Docs for React mount ordering: https://reactjs.org/docs/react-component.html#mounting

Changelog:
[General][Fixed] Fix sticky header not sticking on first render in ScrollView

Reviewed By: nadiia

Differential Revision: D26792003

fbshipit-source-id: c575e8cdd1d986ce3c38941d95d763e329e74874
2021-03-03 15:19:00 -08:00
Nadiia D 397bfa6ad7 Hide caret during test runs
Summary:
Changelog:
[General][Changed] Hide caret in the TextInput during test runs.

Reviewed By: lunaleaps

Differential Revision: D26728766

fbshipit-source-id: b75827f00b4d5c6243d93106093f97b40dc4b366
2021-03-02 18:04:28 -08:00
Sam Goldman 62fcb4e22c Fixed Flow typing of TextInput refs
Summary:
`React.ElementRef<HostComponent<mixed>>` is an inexact object type, which can not be spread into an exact object type, as is happening here. This error is masked in types-first mode, but causes the instance type of this component to be `any`. In a future version of Flow, this issue will be fixed, so this change unblocks upgrading Flow.

This change is likely to cause code using `TextInput` refs to find errors which were missed before.

Changelog:
[General][Fixed] - Fixed Flow typing of TextInput refs

Reviewed By: yungsters

Differential Revision: D26733314

fbshipit-source-id: 8aa26ce5b49357b279f76dd1767a17a9fb4dd4f1
2021-03-02 00:28:03 -08:00
Joshua Gross ee98e6a493 ReactCommon/nativemodule: Migrate uses of NDEBUG to REACT_NATIVE_DEBUG + react_native_assert
Summary:
For better cross-platform consistency, migrate usages of NDEBUG to REACT_NATIVE_DEBUG. See flags.h for explanation.

Changelog: [Internal]

Reviewed By: PeteTheHeat

Differential Revision: D26695016

fbshipit-source-id: 63e6f6fc919076d94f04416f6821f21e0b3707a3
2021-02-26 21:20:25 -08:00
Ramanpreet Nara 2ee5db0fb7 Back out "React Native sync for revisions c3e20f1...0cf9fc1"
Summary:
This diff broke scrolling on Profile React Native surfaces. Please see the task for repro steps. Backing this out.

Changelog:
[General][Changed] - Back out "React Native sync for revisions c3e20f1...4d28eca"

build-break
overriding_review_checks_triggers_an_audit_and_retroactive_review

Oncall Short Name: fbandroid_sheriff

Reviewed By: JoshuaGross

Differential Revision: D26708096

fbshipit-source-id: 40f1e7473b8cc041073b2658d46f9500281da99e
2021-02-26 20:00:06 -08:00
Rick Hanlon ab53332115 React Native sync for revisions c3e20f1...0cf9fc1
Summary:
This sync includes the following changes:
- **[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>//

jest_e2e[run_all_tests]

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

Reviewed By: mdvacca

Differential Revision: D26583597

fbshipit-source-id: a042df12c587fa9248d8de6f0b21b3ab231b3a7d
2021-02-25 22:32:33 -08:00
Joshua Gross 4e243ca7a3 Fix RTL scrolling
Summary:
We recently fixed RTL scrolling in Fabric on iOS: D26608231 (e5921f7f38)

Turns out, the mechanism for RTL scrolling on Android is completely different. It requires that content be wrapped in a "directional content view", which is `View` in LTR and `AndroidHorizontalScrollContentView` in RTL, backed by `ReactHorizontalScrollContainerView.java`.

iOS doesn't require that and just uses View and some custom logic in ScrollView itself.

In the future it would be great to align the platforms, but for now, for backwards-compat with non-Fabric and so we don't have to tear apart ScrollView.js, we codegen the AndroidHorizontalScrollContentView so it exists in C++, register the component, and stop mapping it to View explicitly in C++.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D26659686

fbshipit-source-id: 3b9c646dbdb7fe9527d24d42bdc6acb1aca00945
2021-02-25 10:09:32 -08:00
Rubén Norte eeb36f4709 Improve display names of root components in React Profiler
Summary:
Changelog:
[General][Added] - Added `debugName` parameter to `renderApplication` to use as the display name for the React root tree

Reviewed By: rickhanlonii

Differential Revision: D26637787

fbshipit-source-id: 3ddc037573f4434101a9d3dcb5592a127193481c
2021-02-25 03:01:14 -08:00
Joshua Gross 468bc62da3 Animated JS: clear out component refs on unmount
Summary:
"The instance should not stick around after unmount..." - Tim Yung, 2021

I have a hypothesis that, if a component instance of an animated component sticks around after unmount, it could cause memory leaks due to references to Fabric ShadowNodes across the JSI (this would not impact non-Fabric... in theory).

Wild guess. If OOMs disappear then maybe this hypothesis is correct, but it's a long shot. I figure there's ~no harm in doing this cleanup here anyway.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D26650348

fbshipit-source-id: 90633db650b65755cacfb52344e7b53e46c9b125
2021-02-24 17:15:30 -08:00
Joshua Gross 3e06af9394 Animated: Default to disabling view flattening for animated Views
Summary:
There's logic in Animated JS that prevents flattening of animated views in Fabric. However, we cannot actually detect Fabric vs non-Fabric in the first render pass; in the past we defaulted to assuming non-Fabric. Now we assume Fabric for View flattening purposes.

Changelog: [Internal]

Reviewed By: shergin

Differential Revision: D26647393

fbshipit-source-id: c91b51aeeb4f352cc502bc018f086e36fd1ffd85
2021-02-24 16:37:12 -08:00
Nadiia D 7b09eb54e7 Use flow strict-local
Summary:
Changelog:
[General][Changed] TextInput: use flow strict-local

Reviewed By: kacieb

Differential Revision: D26573763

fbshipit-source-id: 9d7d48310dd41949d07ad7616c4713b521c2545d
2021-02-22 18:30:01 -08:00
Luna Wei 33ff4445dc Fix disabled behavior
Summary:
Changelog:
[General][Fixed] - Pass disabled prop to pressability config

Reviewed By: kacieb

Differential Revision: D26590399

fbshipit-source-id: dd4f8f25d1b243b2983cd4ffaadb5d3dc6f3ed3e
2021-02-22 16:56:48 -08:00
Nadiia D c4aa411ee3 Replace Touchable with usePressability hook
Summary:
Changelog:
[General][Changed] textInput component changes:
- use Pressability hook directly
- no more cloning the component

Reviewed By: yungsters, kacieb

Differential Revision: D26573762

fbshipit-source-id: 17b47c8b0b9af22796d6e1528e8e3c16b5ed5d51
2021-02-22 15:39:57 -08:00
Nadiia D 7f005e6077 Add cancelable prop, use mixed return type for event handlers
Summary:
Changelog:
[General][Added] Added `cancelable` prop to Pressable.
[General][Changed] Event handlers return mixed type instead of void.

Reviewed By: yungsters

Differential Revision: D26432837

fbshipit-source-id: c7bafdec085d08a06e859b45bff91a3b07d747ed
2021-02-19 17:54:19 -08:00
simek 927573c581 Flow: fix VirtualizedList issues, remove few no longer valid suppressions (#30128)
Summary:
This PR fixes few suppressed Flow issues in `VirtualizedList` component.

I have also removed few no longer valid Flow suppressions in `ActivityIndicator` and `ReactNativeTestTools`.

## Changelog
[General] [Fixed] - Flow: fix few issues in `VirtualizedList`,
[General] [Removed] - Flow: remove few no longer valid suppressions in `ReactNativeTestTools`

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

Test Plan: Successful run of `yarn flow` check.

Reviewed By: kacieb

Differential Revision: D26489398

Pulled By: lunaleaps

fbshipit-source-id: db71d8bfeb3b6dc5a2738a73ac6644aef4a0311b
2021-02-19 14:31:33 -08:00
Peter Argany 441d630ed0 Enable dev tools setup in bridgeless mode
Summary:
Changelog: [Internal]

I'm trying to get Fast refresh working in bridgeless mode. I need the `    require('./setUpReactRefresh');` line to be executed to do so.

I'm not sure why this was commented out in the first place, it seems to be working fine in FBiOS/FB4A.

Reviewed By: p-sun

Differential Revision: D26289573

fbshipit-source-id: 6151f781c31e3aadaebfeb759d3eb776e8b525cc
2021-02-19 13:47:25 -08:00
Peter Argany f0faa7843c Remove iOS10/tvOS10 support from remaining podfiles
Summary: Changelog: [iOS] Remove iOS10/tvOS10 support from remaining podfiles

Reviewed By: shergin

Differential Revision: D26410811

fbshipit-source-id: 9050346def5070338e709ff102a284a828821586
2021-02-19 13:47:25 -08:00
Luna Wei 224757e830 Remove FlowFixMe in VirtualizedSectionList
Summary:
Changelog:
[Internal][Fixed] - Remove FlowFixMe in VirtualizedSectionList

Reviewed By: kacieb

Differential Revision: D26497027

fbshipit-source-id: 57ea417041df643139068b084d69aaa4efb995fd
2021-02-18 13:46:52 -08:00
Paige Sun 10f8c1a1c0 Add ViewConfig for MultilineTextInput
Differential Revision: D26463558

fbshipit-source-id: fe73e60f9a03d865bc9deab59260321072151e22
2021-02-18 09:20:22 -08:00
Kacie Bawiec aaede1029d Remove UNSAFE_componentWillReceiveProps
Summary:
This diff removes `UNSAFE_componentWillReceiveProps` and adds the changes to `componentDidUpdate` instead.

Why use `componentDidUpdate`? When reading through the [React docs on removing UNSAFE_componentWillReceiveProps](https://reactjs.org/docs/react-component.html#unsafe_componentwillreceiveprops), it says:
> If you need to perform a side effect (for example, data fetching or an animation) in response to a change in props, use componentDidUpdate lifecycle instead.

The original usage of `UNSAFE_componentWillReceiveProps` updates the content inset when `props.contentInset` changes. However, we don't always want it to update if the content inset hasn't changed, as calling `setValue` will reset the animated value unnecessarily, and kill any current animations (which we don't want to do). [React Native doc on setValue for reference](https://reactnative.dev/docs/animatedvalue#setvalue).

Changelog:
[General] Use componentDidUpdate instead of UNSAFE_componentwillReceiveProps in ScrollView

Reviewed By: lunaleaps

Differential Revision: D26487276

fbshipit-source-id: 77419deacf5db676cd721b58f34932bd6ca2399f
2021-02-17 15:00:07 -08:00
Tim Yung 3af0c84aa5 RN: Simplify `RCTDeviceEventEmitter`
Summary:
Simplifies `RCTDeviceEventEmitter` to simply be an `EventEmitter`.

The only thing special about it is that all native events are emitted on it and that `NativeEventEmitter` composes it.

Changelog:
[General][Removed] - Removed `RCTDeviceEventEmitter.sharedSubscribers`.

Reviewed By: RSNara

Differential Revision: D26163660

fbshipit-source-id: aedff8323d86947220fc293a74a19a3981fd875a
2021-02-17 12:20:26 -08:00
David Vacca 34d3efe2ef TextInlineImage view configs
Summary:
Migrate RCTTextInlineImage to use NativeComponentRegistry

changelog: [internal] internal

Reviewed By: PeteTheHeat

Differential Revision: D26427141

fbshipit-source-id: 56c120f19493e17c9be4e467032e0a4f2244c0a9
2021-02-17 10:46:20 -08:00
David Vacca 769136ca3c Fix rendering of Text and TextInlineViews in Fabric + StaticViewConfigs enabled
Summary:
This diff fixes the render of Text and TextInlineViews when using Fabric + StaticViewConfigs enabled

Similar to Bridgeless mode, we want TextNativeComponent to render "createReactNativeComponentClass('RCTVirtualText..." instead of NativeText.

https://www.internalfb.com/intern/diffusion/FBS/browsefile/master/xplat/js/react-native-github/Libraries/Text/TextNativeComponent.js?commit=f044696a1a273dec1fac227898f5603682d4b19d&lines=59

UIManager.hasViewManagerConfig returns false for all components when using StaticViewConfigs enabled.
I'm changing this method to return true when the component is supported by static view configs:

https://www.internalfb.com/intern/diffusion/FBS/browsefile/master/xplat/js/RKJSModules/EntryPoints/Fb4aBundle.js?commit=4661488cc6aab5078dc6b2afcbb0624e887346d5&lines=81-94

This is correct because hasViewManagerConfig is a new method that's used ONLY in two callsites:

https://www.internalfb.com/intern/diffusion/FBS/browsefile/master/xplat/js/react-native-github/Libraries/Text/TextNativeComponent.js?lines=59

https://www.internalfb.com/intern/diffusion/FBS/browsefile/master/xplat/js/react-native-github/Libraries/Utilities/deprecatedPropType.js?lines=24

Although, this can fail if "hasViewManagerConfig" is started to be used as "feature detection" (see next diffs of the stack)

I'm open to other suggestions (please comment in the diff

My current plan is:

- Land this diff (or similar) to unblock static view configs experiment next week
- Include all codeGenNativeComponents into the list of static view configs
- Migrate callsites of getViewManagerConfig() -> hasNativeConfig() (only for components that have static view configs)
- Think/Discuss/Plan long term plan about feature detection

changelog: [internal] internal

Reviewed By: yungsters

Differential Revision: D26427140

fbshipit-source-id: ce8bf00d6c9793ad17bdc65eb8476aaab63db066
2021-02-17 10:46:19 -08:00
Joshua Gross 84778d7cfd LayoutAnimation: ensure onCompleteCallback is called in Fabric and non-Fabric
Summary:
Previously this branch of code only ran on Fabric+iOS. It is also needed for non-Fabric+Android in case `setLayoutAnimationEnabledExperimental` is not called on Android and an animation is queued up.

Changelog: [Internal]

Reviewed By: ShikaSD

Differential Revision: D26466482

fbshipit-source-id: 11c50bf94daa287a619f2b623785b60675eb6cf0
2021-02-17 10:33:58 -08:00
Kacie Bawiec 1641d46529 Replace UNSAFE_componentWillMount with componentDidMount
Summary:
Changelog:
[General] Replace UNSAFE_componentWillMount with componentDidMount in ScrollView

Reviewed By: nadiia

Differential Revision: D26375818

fbshipit-source-id: 1a33a7fddcf78c05cc1e4f04bd85b48a59290560
2021-02-17 09:58:10 -08:00
Kacie Bawiec 099f67cf8a Move ScrollResponder.Mixin methods into ScrollView and Remove ScrollResponder.js
Summary:
The purpose of this diff is to move all of the ScrollResponder methods into ScrollView to delete ScrollResponder.Mixin.

NOTE: ScrollResponder.Mixin uses a variable named "state" but it does not use React state correctly. Instead of calling `setState()`, state is set using `this.state.item = 123` ([example](https://www.internalfb.com/intern/diffusion/FBS/browsefile/master/xplat/js/react-native-github/Libraries/Components/ScrollResponder.js?lines=315)).  This means these are not actually React state - these are functionally just variables. In this stack, these "state" items from ScrollResponder are turned into regular internal variables.

Changelog:
[General][Removed] Moved ScrollResponder.Mixin methods into ScrollView to Remove ScrollResponder.js

Reviewed By: lunaleaps, nadiia

Differential Revision: D20715880

fbshipit-source-id: 99441434a6dc1c8ff3f435e7d6ec2840821e4e05
2021-02-16 08:03:11 -08:00
David Vacca 5d500f4dbc Remove log in PaperUIManager
Summary:
Removing log in PaperUIManager since this is logging warn messages for "Text" components

changelog: [internal] internal

Differential Revision: D26315745

fbshipit-source-id: 8871148b0fc1791e1723962f1f2477cd5e0c562d
2021-02-15 21:07:25 -08:00
Luna Wei 0939b938b2 Remove FlowFixMe on ref
Summary:
Changelog:
[Internal][Fixed]:Remove FlowFixMe VirtualizedSectionList ref

Reviewed By: nadiia

Differential Revision: D26381836

fbshipit-source-id: ed9a687c50a05f1176d99e6e6bd362ac830fbfae
2021-02-12 14:49:19 -08:00
Luna Wei 4e6d33a112 Remove UNSAFE_componentWillReceiveProps
Summary:
Changelog:
[General][Fixed] Remove UNSAFE_componentWillReceiveProps from VirtualizedSectionList

Reviewed By: nadiia

Differential Revision: D26381837

fbshipit-source-id: b029c82e4090369c76f303e71a3c9158e34ad82e
2021-02-12 14:49:19 -08:00
Pieter De Baets a8b5b63d4e Remove unused promiseRejectionIsError
Summary: Changelog: [Internal]

Reviewed By: MichaReiser

Differential Revision: D26338073

fbshipit-source-id: 7b4d8881ffc58ee93b1ccf58e6717a4a8597dece
2021-02-10 07:57:17 -08:00
Micha Reiser cb0764eeb0 Upgrade react-hooks rules
Summary:
Upgrades the `react-hooks` eslint-rules to `4.2.0`

Changelog:
[Internal]

Reviewed By: GijsWeterings

Differential Revision: D26366235

fbshipit-source-id: 04628e8f2a6c56eacba516d877df143c6c81adb8
2021-02-10 07:43:52 -08:00
Tim Yung d39643b9de RN: Rewrite `NativeEventEmitter`
Summary:
Rewrites `NativeEventEmitter` to not extend `EventEmitter` and to compose `RCTDeviceEventEmitter` instead of (mis)using its exported `sharedSubscriber` property.

This makes it easier to reason about `NativeEventEmitter`. Also, the extraneous methods on `EventEmitter` are no longer inherited.

Changelog:
[General][Removed] - `NativeEventEmitter` no longer inherits from `EventEmitter`, so it no longer implements `removeListener` and `removeSubscription`. Instead, use the `remove()` method on the subscription object returned by `addListener`.

Reviewed By: rubennorte

Differential Revision: D26163562

fbshipit-source-id: c1aadb99bdefbaa36fece57ce74604e414f94d4d
2021-02-09 21:27:45 -08:00
Tim Yung 1049835b50 RN: Simplify `Keyboard`
Summary:
Simplifies `Keyboard` by removing redundant methods and changing `addEventListener` to return an `EventSubscription`.

Changelog:
[General][Changed] - `Keyboard.addListener` now returns an `EventSubscription` object.
[General][Removed] - Removed `Keyboard.removeListener`. Instead, use the `remove()` method on the object returned by `Keyboard.addListener`.
[General][Removed] - `Keyboard` no longer inherits from `NativeEventEmitter`, so it no longer implements `removeAllListeners`, and `removeSubscription`.

Reviewed By: milroc

Differential Revision: D26163536

fbshipit-source-id: b4bd91627cd027a13fcba269a253823913eb7589
2021-02-08 17:49:31 -08:00
Tim Yung 88a41f180c LogBox: Intelligently Un-Collapse Stack Frames
Summary:
Tweaks LogBox so that if all stack frames are collapsed, start off without collapsing any of them.

It saves developers from one extra interaction to make the LogBox actually useful for errors where every frame is ignored.

Changelog:
[General][Changed] - LogBox will not initially collapse stack frames if every frame would be collapsed.

Differential Revision: D26266195

fbshipit-source-id: dcdbe0834da5fc3a0bf49fb7857de30dd7e4b8cb
2021-02-08 17:17:57 -08:00
Kacie Bawiec 1c7d9c8046 Fix disabled prop not disabling onPress for voice assistant
Summary:
It is currently possible to activate a disabled Pressable with VoiceOver/TalkBack. This fixes this.

Changelog:
[General][Fixed] Fix disabled prop not disabling onPress for voice assistant

Reviewed By: blavalla

Differential Revision: D26225448

fbshipit-source-id: 67fa10f9e5c50143d986dc709a2fb639fdc3e718
2021-02-08 15:18:50 -08:00
Tim Yung 6c0f5d1178 Fabric: Fix DevTools Inspector
Summary:
Fixes a bug when using Fabric with React DevTools to inspect a component.

The bug is due to the shape of instances being a bit different. These are where Paper and Fabric create instances differently:

- Paper: [ReactNativeHostConfig.js](aa736a0fa6/packages/react-native-renderer/src/ReactNativeHostConfig.js (L138))
- Fabric: [ReactFabricHostConfig.js](aa736a0fa6/packages/react-native-renderer/src/ReactFabricHostConfig.js (L218-L236))

Changelog:
[Internal]

Reviewed By: TheSavior

Differential Revision: D26265476

fbshipit-source-id: dfc510dc3854e1478d20a4c612237b1c2da608eb
2021-02-04 17:17:17 -08:00
David Vacca 3d0e974ed8 Add logs in the getViewManagerConfig
Summary:
This diff adds error logs when the method getViewManagerConfig() can't find a ViewConfig associated to a view manager

changelog: [inernal] internal

Reviewed By: JoshuaGross, ShikaSD

Differential Revision: D26231245

fbshipit-source-id: d9252dcdcb84464d57342058a928881ebbb1b68c
2021-02-04 15:56:15 -08:00
Valentin Shergin 338ce93648 Fabric: `setNativeProps` methods was removed from `FabricUIManager` Flow type declaration
Summary:
FabricUIManager does not support it, the declaration is not correct.

Changelog: [Internal] Fabric-specific internal change.

Created from Diffusion's 'Open in Editor' feature.

Differential Revision: D26241483

fbshipit-source-id: 8a894dc847bce9c196d8ac2e1601853e4fe03e1d
2021-02-04 13:55:43 -08:00
Tim Yung 6f22989e92 RN: Simplify `AppState`
Summary:
Simplifies `AppState` by removing redundant methods and changing `addEventListener` to return an `EventSubscription`.

Changelog:
[General][Changed] - `AppState.addEventListener` now returns an `EventSubscription` object.
[General][Removed] - Removed `AppState.removeEventListener`. Instead, use the `remove()` method on the object returned by `AppState.addEventListener`.
[General][Removed] - `AppState` no longer inherits from `NativeEventEmitter`, so it no longer implements `addListener`, `removeAllListeners`, and `removeSubscription`.

Reviewed By: wtfil

Differential Revision: D26161343

fbshipit-source-id: b3cff76bf0f8f7d79cd954fdef551d0654c682ca
2021-02-04 12:48:13 -08:00
Tim Yung c8c975f0d7 RN: Remove `RCTDeviceEventEmitter` Checks
Summary:
Removes the checks in `RCTDeviceEventEmitter` that were initially added to migrate call sites to other modules when `NativeEventEmitter` was introduced.

This set of checks is problematic for a few reasons:

1. Does not cover many other events that have since been introduced, so the small list covered is arbitrary.
2. Prevents composition of `RCTDeviceEventEmitter` in the implementation of those modules.
3. Code bloat.

Changelog:
[General][Removed] - `RCTDeviceEventEmitter` no longer throws for `SttatusBar`, `Keyboard`, and `AppState` events. However, you are still recommended to use the more appropriate modules for listening to these events.

Reviewed By: lunaleaps

Differential Revision: D26163602

fbshipit-source-id: 316287bfdf2947fe85d022a3f83a205e89c432ba
2021-02-03 22:04:40 -08:00
Ramanpreet Nara 690a29355e Make PaperUIManager.getViewManagerConfig log thrown exceptions
Summary:
When NativeUIManager.getConstantsForViewManager throws an exception from native, we just swallow that exception and set null as the view config. Instead, we should log that an error occurred. This way, we can tell if the NativeModule sync method call returned undefined, or if the NativeModule sync method call thew an exception.

I'll take a look and see if we can add this logging higher up in the native stack, so that we can actually capture the stack information from this NativeModule sync method call failure.

Created from Diffusion's 'Open in Editor' feature.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D26227379

fbshipit-source-id: 02b516d247f82f873f059005e6a2cc6f2a64fdb5
2021-02-03 11:47:58 -08:00
Tim Yung 6d1aca806c RN: Delete `Linking.removeEventListener`
Summary:
Deletes `Linking.removeEventListener` in favor of returning the `EventSubscription` returned by `NativeEventEmitter.addListener`.

Changelog:
[General][Added] - `Linking.addEventListener` now returns a subscription with a `remove()` method.
[General][Removed] - Removed `Linking.removeEventListener`. Instead, call `remove()` on the subscription returned by `Linking.addEventListener`.

Reviewed By: rubennorte, wtfil

Differential Revision: D26155896

fbshipit-source-id: 1176ec6eae1c0fff2d68acf5411a18da530b212a
2021-02-02 19:36:21 -08:00
Micha Reiser 93377ff508 Remove "use strict" directive from ES Modules
Summary:
ES Modules implicitly enable strict mode. Adding the "use strict" directive is, therefore, not required.

This diff removes all "use strict" directives from ES modules.

Changelog:

[Internal]

Reviewed By: motiz88

Differential Revision: D26172715

fbshipit-source-id: 57957bcbb672c4c3e62b1db633cf425c1c9d6430
2021-02-02 11:12:56 -08:00
Tim Yung 41b6884a1b RN: Implements `EventSubscription`
Summary:
Changes the to-be-legacy `_EventSubscription` and `_EmitterSubscription` classes to implement the event-agnostic `EventSubscription` interface.

This interface is valuable because it abstracts away the event definitions.

Changelog:
[Internal]

Reviewed By: lunaleaps

Differential Revision: D26155911

fbshipit-source-id: f94280976d4f9219f4780ac8fae0d5fbc1865386
2021-02-01 17:50:22 -08:00
Tim Yung 70cd569e7e RN: Simplify `DevSettings` Implementation
Summary:
Simplifies the implementation of `DevSettings`. The fact that it uses `NativeEventEmitter` is an implementation detail and does not need to be exposed via inheritance.

This also enables more code to be removed from production builds (because the development implementation is now statically enclosed by `__DEV__`).

Changelog:
[General][Changed] - `DevSettings` no longer inherits from `NativeEventEmitter`

Reviewed By: RSNara

Differential Revision: D26140148

fbshipit-source-id: 99fa9d0c6ce8e365f89936aa12a4720f7a04b984
2021-02-01 17:50:22 -08:00
Tim Yung f5f47879b8 RN: Delete `NativeEventEmitter` Options
Summary:
Removes the `options` argument in the `NativeEventEmitter` constructor. It was only being used for an experimental flag that is no longer necessary.

Changelog:
[General][Removed] - Removed second optional argument of `NativeEventEmitter` constructor

Reviewed By: RSNara

Differential Revision: D26138239

fbshipit-source-id: 0481ce44f0464668e3a6e7ffaf079d17c87afd42
2021-02-01 17:50:21 -08:00
Janic Duplessis 12fccdeea3 Make codegen more reliable on iOS (#30792)
Summary:
This addesses a few issues I noticed while migrating my app to the new build-time codegen on iOS.

1. I noticed random failures because of codegen on iOS. This is mostly due to the fact the codegen output files are not specified in the xcode script. The only reason it works relatively fine currently is because the codegen output is inside the input files directory. This has the side effect of causing files to be regenerated every build, then causes all core modules to be recompiled which adds up a significant amount of time to rebuilds. To fix this I added the generated files to the script phase output and moved the FBReactNativeSpec dir outside of the codegen source (Libraries). I moved it to the React directory as this seemed to make sense and is where a lot of iOS files are as well as the core modules. Note this might require internal changes. This removes the circular dependency between our build phase input and output so consecutive builds can be cached properly.

2. Add `set -o pipefail` to the xcode script, this helped propagate errors properly to xcode because of the `| tee` pipe so it fails at the script phase and not later with a header not found error. Also add `2>&1` to pipe stderr to stdout so errors are also captured in the log file.

3. Add the `-l` flag to the bash invocation to help finding the yarn binary. With my setup yarn is added to the system PATH in my user .profile. Adding this file will cause bash to source the user environment which xcode scripts does not by default. I think this will help with most setups.

4. If yarn is not found the `command -v yarn` would make the script exit without any output because of the -e flag. I made a change to ignore the return code and check later if YARN_BINARY is set and have an explicit error message if not.

## Changelog

[iOS] [Fixed] - Make codegen more reliable on iOS

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

Test Plan:
Tested various project states to make sure the build always succeeds in RN tester:

- Simulate fresh clone, remove all ignored files, install pods, build
- Build, delete FBReactNativeSpec generated files, build again
- Build, build again, make sure FBReactNativeSpec is cached and not rebuilt
- Make the script fail and check that xcode shows the script error logs properly

![image](https://user-images.githubusercontent.com/2677334/105891571-c8badd00-5fde-11eb-839c-259d8e448523.png)

Note: Did not test fabric

Reviewed By: fkgozali

Differential Revision: D26104213

Pulled By: hramos

fbshipit-source-id: e18d9a0b9ada7c0c2e608d29ffe88087f04605b4
2021-02-01 14:39:25 -08:00
Joshua Gross 6eea5974cf LayoutAnimations.js: ensure that onComplete callback is always called, even if LayoutAnimations is disabled on iOS
Summary:
See comments. On iOS in Fabric, LayoutAnimations is only conditionally enabled; whereas on Android it's always enabled. That means for code on iOS that relies on the onComplete callback, there might be bugs.

Ensure the callback is always called on iOS by racing a timer with the animation completion.

This will be deleted before Fabric "ships" fully.

Impact is minimal since this change is scoped to only run on iOS and under Fabric.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D26166237

fbshipit-source-id: 9a07a402845c379e1511f199eef3d3e249e1eb06
2021-02-01 11:57:33 -08:00
Tim Yung a81b7d18fa RN: Cleanup RCTNetworking (iOS)
Summary:
Refactors `RCTNeworking.ios.js` so that event registration does not get passed along to `NativeNetworkingIOS`. Instead, we go straight to `RCTDeviceEventEmitter` (which is what `NativeEventEmitter` ultimately does when `nativeModule` is not supplied).

This optimization reduces overhead of making network requests, and it is made possible because `NativeNetworkingIOS` does not actually do any meaningful work when `startObserving` is invoked.

Changelog:
[iOS][Removed] - Removed event methods except `addListener` from `Networking`

Reviewed By: lunaleaps

Differential Revision: D26137965

fbshipit-source-id: b6e0288689459ddb8ecf8d34dce6250d3b0ecb59
2021-02-01 11:04:37 -08:00
Samuel Susla 88c43490a1 Fix initial placeholder in multiline TextInput
Summary:
Changelog: [internal]

`[self _invalidatePlaceholderVisibility]` wasn't triggered in multiline text input in Fabric. Even in Paper it was triggered what to me seems like coincidence rather than intention (I might be wrong). This is more explicit, visibility of placeholder text needs to be re-evaluated every time placeholder text is changed.

Reviewed By: shergin

Differential Revision: D26172754

fbshipit-source-id: 3a767d333b79c266a3d70a96883b1289fff16750
2021-02-01 10:59:38 -08:00
Tim Yung ef765d423c RN: Move `TOUCH_TARGET_DEBUG` to PressabilityDebug
Summary:
This is just cleanup. When I migrated components to `Pressability` instead of `Touchable`, I left `TOUCH_TARGET_DEBUG` alone to minimize moving pieces. But I had created `PressabilityDebug` as the eventual destination for this logic.

Now that `Text` is migrated away from `Touchable` (see D26106824 (f275514f27)), this cleans up the final internal reference to `Touchable`.

Changelog:
[General][Changed] - `Touchable.renderDebugView` now accepts `ColorValue` instead of `string | number`.
[General][Removed] - Removed `Touchable.TOUCH_TARGET_DEBUG` property.

Reviewed By: kacieb

Differential Revision: D26108570

fbshipit-source-id: 2694c9a9c29182ae04a77ba6c2e4406fcd5a277e
2021-01-28 14:13:43 -08:00
Joshua Gross 99b7052248 Implement sendAccessibilityEvent in the React(Fabric/non-Fabric) renderer
Summary:
`sendAccessibilityEvent_unstable` is a cross-platform, Fabric/non-Fabric replacement for previous APIs (which went through UIManager directly on Android, and a native module on iOS).

Changelog: [Added] sendAccessibilityEvent_unstable API in AccessibilityInfo and sendAccessibilityEvent in React renderer

Reviewed By: kacieb

Differential Revision: D25821052

fbshipit-source-id: 03f7a9878c95e8395f9102b3e596bfc9f03730e0
2021-01-27 17:37:38 -08:00
Tim Yung f275514f27 RN: Modernize `Text` Component
Summary:
Rewrites the `Text` component using modern best practices.

Notably, `Text` no longer depends on `Touchable` and now instead depends on `Pressability`.

Changelog:
[Internal]

Reviewed By: mdvacca

Differential Revision: D26106824

fbshipit-source-id: 0797e66075ae03c51dd5b4b3395b21ae92c39ba6
2021-01-27 16:20:20 -08:00
David Vacca 3dd3123113 Avoid retrieving view configs on Text component
Summary:
This diff avoids retrieving view configs on Text component when static view configs are enabled

changelog: [interrnal]

Reviewed By: JoshuaGross, sammy-SC

Differential Revision: D25577278

fbshipit-source-id: 674b8067cea13d284848e35dabaf26cd1bea4e27
2021-01-26 14:05:34 -08:00
David Vacca 4cdafd997a Add supoprt for Text Input view configs
Summary:
This diff adds TextInput in the list of components that support static view configs

changelog: [internal]

Reviewed By: yungsters

Differential Revision: D26040854

fbshipit-source-id: d6b5d3a78ef4657acf3f2c4ebe527ad4ca40bcb5
2021-01-26 14:05:33 -08:00
David Vacca e68cf7cee9 Avoid the call to getViewManagerConfig on deprecatedPropType method
Summary:
This diff removes the call to UIManager.getViewManagerConfig into the deprecatedPropType method when static view configs are enabled

This was necessary to avoid innecessary calls to UIManager.getViewManagerConfig and to avoid loading UIManagerModule classes when static view configs are enabled

changelog: [internal] internal

Reviewed By: fkgozali, yungsters

Differential Revision: D26040855

fbshipit-source-id: 82cad9f4abe9898e781fd989ebaa03497dad926b
2021-01-26 14:05:33 -08:00
David Vacca ec7b2085d8 Refactor StaticViewConfigsPaperUIManager to avoid loading NativeUIManager.js
Summary:
This diff refactors the StaticViewConfigsPaperUIManager to avoid loading NativeUIManager.

This is part of a experiment to prevent loading UIManagerModule class in native.

changelog: [internal]

Reviewed By: JoshuaGross

Differential Revision: D25630215

fbshipit-source-id: 40d6f3b36ad4c3377820b1dcf0bd949db063d899
2021-01-26 14:05:33 -08:00
David Vacca dd60414578 Change flow types of RefreshControl.size prop
Summary:
This diff changes the flow types of RefreshControl.size prop from 'int' to string'. For more context see previous diff of the stack.
This diff will be landed as soon as the native release containing D25933458 (65975dd28d) goes to production.

It's important to clarify that there are currently no usages of this prop in production

Changelog: [Android][Changed] - RefreshControl.size prop changed its type to string, the valid values are: 'default' and 'large'

Reviewed By: JoshuaGross

Differential Revision: D25933457

fbshipit-source-id: 2f34566f2f8a097e6d40f63c09ecb3ada2fd8409
2021-01-25 21:05:56 -08:00
Nadiia D 881860886c TextInput: sort props
Summary:
Changelog:
[General][Changed] - Refactor TextInput component

Reviewed By: lunaleaps

Differential Revision: D26009114

fbshipit-source-id: 25676a93d59d43ec6c5073fc481d4b9cd20e2f9a
2021-01-22 13:13:57 -08:00
Ramanpreet Nara 5a2099fe7d Rename rn_codegen_modules(native_module_spec_name => name)
Summary: Changelog: [Internal]

Reviewed By: PeteTheHeat

Differential Revision: D25963929

fbshipit-source-id: 4c82562404a21b5a1789d11ae2d228411329fee5
2021-01-21 19:04:54 -08:00
Ramanpreet Nara 93e4170d03 Rename NativeModule schema targets
Summary:
NativeModule schema targets will now take the form '{library_name}-codegen-modules-schema'.

NOTE: Will launch the necessary diffs to make the same refactor in our component codegen.

Changelog: [Internal]

Differential Revision: D25968071

fbshipit-source-id: 1d7c9f4679e4ae6c26c9a29a74fa7b7ea76460eb
2021-01-21 19:04:53 -08:00
Brandon Baumgarten 17aa1e320e Fix image loop counter on iOS 14 (#30744)
Summary:
Animated gifs, which do not loop, currently animate twice on iOS 14.
See: https://github.com/facebook/react-native/issues/30147

## Changelog

[iOS] [Fixed] - Animated images without loop no longer animate twice

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

Test Plan:
Run the example app with any animated gif. I attached a gif, which is affected.

![checkmark](https://user-images.githubusercontent.com/54310840/104746529-b2e02900-574f-11eb-9870-0c03c769c990.gif)

Reviewed By: sammy-SC

Differential Revision: D25977626

Pulled By: PeteTheHeat

fbshipit-source-id: 889d4a7bed8f7a7be6a9a427501d0071b7c02b8c
2021-01-21 10:56:14 -08:00
Peter Argany b32e996898 Fix RCTNetworking yellow box
Summary:
Since `RCTNetworking` overrides init, it requires main queue setup. Native module infra currently throw a yellowbox if a module forgets it.

This diff fixes that.

{F361182429}

Changelog: [Internal]

Reviewed By: shergin

Differential Revision: D25962402

fbshipit-source-id: d847117cbfe0a191dc1882898711693c6fda68cd
2021-01-20 12:57:40 -08:00
sirpy 8facc865ab fix: save connection url as class variable
Summary:
Conform with Websocket javascript api.
related to web3js issues: https://github.com/ethereum/web3.js/issues/2864 https://github.com/ethereum/web3.js/issues/2602

Reviewed By: javache

Differential Revision: D25927475

Pulled By: TheSavior

fbshipit-source-id: 26b2df0565dac581d546b6824dd4f0fc2c8cdc32
2021-01-18 21:58:53 -08:00
David Vacca 65975dd28d Change type of SwipeRefreshLayoutManager.size prop from Int to String
Summary:
This diff changes the type of the SwipeRefreshLayoutManager.size prop from Int to String in Fabric.

The current implementation of this prop allows JS developers to use "int" type when fabric is enables and "int or string" types when using Fabric is disabled.
Since long term we want to only support "string" type for this prop, I'm changing the type of the prop to be String.

After my diff Fabric will start supporting only "string" types, non fabric screens will keep supporting "int or string" values.

**Will this break production?**
No, because there are no usages of RefreshControl.Size prop in fbsource

**What about if someone start using this prop next week?**
IMO It's very unlikely because of the nature of this prop, I will be monitoring next week and if there's an usage it will be detected by flow when trying to land D25933457.

Changelog: [Android][Changed] - RefreshControl.size prop changed its type to string, the valid values are: 'default' and 'large'

Reviewed By: JoshuaGross

Differential Revision: D25933458

fbshipit-source-id: 55067d7405b063f1e8d9bb7a5fd7731f5f168960
2021-01-17 02:57:02 -08:00
Ramanpreet Nara 1f017617ac Stop passing in the schema from JavaScript
Summary:
This concludes the JavaScript clean for TurboModule JavaScript codegen teardown.

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D25915168

fbshipit-source-id: 1decc394ff63b1d39d270fc048e817501ea388ea
2021-01-14 19:14:23 -08:00
Vladislav Shabanov 6e36d046a3 Fix ScrollView getInnerViewNode and getInnerViewRef ref methods (#30588)
Summary:
Currently ScrollView ref's `getInnerViewNode` and `getInnerViewRef` are unbound and don't work as expected returning empty values. The origin of this problem probably is issued by d2f314af75

Working example of the problem is available here: https://github.com/vshab/RNGetInnerViewBug

This PR binds getInnerViewNode and getInnerViewRef to ScrollView and adds test checking the value of getInnerViewRef.

Before:
![Simulator Screen Shot - iPhone 11 - 2020-12-15 at 02 07 03](https://user-images.githubusercontent.com/6755908/102149544-c7df4900-3e7f-11eb-89de-de39a28fbdb3.png)
After:
![Simulator Screen Shot - iPhone 11 - 2020-12-15 at 01 49 31](https://user-images.githubusercontent.com/6755908/102149559-d168b100-3e7f-11eb-8b27-031c9e43112c.png)

## 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] [Fixed] - ScrollView: Fix `getInnerViewNode` and `getInnerViewRef` ref methods

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

Test Plan:
1. The test checking the value of getInnerViewRef is added.
2. Example app demonstrating the problem is provided with before/after screenshots.

Reviewed By: TheSavior, nadiia

Differential Revision: D25916413

Pulled By: kacieb

fbshipit-source-id: bf18079682be7c647b8715bd0f36cf84953abcfa
2021-01-14 14:45:55 -08:00
Luna Wei cfd39bc656 Provide default for cachebreaker value
Summary:
Changelog:
[Internal][Fixed] - Add a default value for the cache breaker value

Reviewed By: fkgozali

Differential Revision: D25907137

fbshipit-source-id: 243346cbc67d1a85519bb469f4d68d61676ba547
2021-01-14 14:11:10 -08:00
Tim Yung 1433ed6333 Text: Restore `android_hyphenationFrequency`
Summary:
Restore the `android_hyphenationFrequency` attribute in the view config for `Text`. This was accidentally dropped by D23708205 (06ce643565) (06ce643565).

Changelog:
[Android][Fixed] - Restore `android_hyphenationFrequency` on `Text`.

Reviewed By: mdvacca

Differential Revision: D25889971

fbshipit-source-id: 622eef618370efdd9a8b060ccd3272e25de218fa
2021-01-13 10:11:12 -08:00
Moti Zilberman 05e380f26c Type AsyncStorage
Summary:
Types the AsyncStorage module with Flow.

Changelog: [Internal]

Reviewed By: MichaReiser

Differential Revision: D25884607

fbshipit-source-id: 7762ebfc68b87e6c5a0d8100fcc564f002061f5c
2021-01-12 11:14:27 -08:00
Samuel Susla c42a59af7e Fix detection of Fabric in ScrollViewStickyHeader
Summary:
Changelog: [internal]

Revert a change introduced in https://github.com/facebook/react-native/pull/30333 where rickhanlonii asked it to be reverted as well.

The change breaks sticky header in Fabric.

Reviewed By: rubennorte

Differential Revision: D25883861

fbshipit-source-id: b01305c6def390d0664c7be939ab3fc72186a07a
2021-01-12 09:59:03 -08:00
Peter Argany a1d626739d Delete iOS10/tvOS10 support from React Native Libraries
Summary:
allow-large-files

Changelog: [iOS] Remove iOS10/tvOS10 suppport

Similar to D19265731 (674b591809) for iOS9.

I just ran this command:
`find . -type f -exec sed -i '' 's/{ :ios => "10.0" }/{ :ios => "11.0" }/' {} +`
and then updated pods

Reviewed By: fkgozali

Differential Revision: D25693227

fbshipit-source-id: 0073d57ecbb268c52d21962cef202316857bcbd2
2021-01-11 16:46:16 -08:00
Valentin Shergin e37e56b042 Back out "Add onFocus and onBlur to Pressable."
Summary:
I suspect it's causing T82781515.

Changelog:
[Category][Type] - Backout of "[react-native][PR] Add onFocus and onBlur to Pressable."

Reviewed By: p-sun

Differential Revision: D25864414

fbshipit-source-id: efba9136edba97d5bd2a0de15f9ddae7dfd24e51
2021-01-10 13:56:27 -08:00
Ramanpreet Nara 4bf03e1f23 Stop force including OSS specs in TMMDelegate codegen
Summary: Changelog: [Internal]

Reviewed By: JoshuaGross

Differential Revision: D25844710

fbshipit-source-id: b80c29335fbac6941918c07f24027971359d0df2
2021-01-08 14:44:00 -08:00
Igor Klemenski cab4da7288 Add onFocus and onBlur to Pressable. (#30405)
Summary:
Starting to upstream keyboard-related features from React Native Windows - this is the Android implementation.
Exposing onFocus and onBlur callbacks on Pressable; they're already declared for View in ViewPropTypes.js, which Pressable wraps.

Registering event listeners in ReactViewManager to listen for native focus events.
## 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 onFocus/onBlur for Pressable on Android.

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

Test Plan:
Tested on v63-stable, since building master on Windows is now broken. Screenshots from RNTester running on the emulator:
![image](https://user-images.githubusercontent.com/12816515/99320373-59777e80-2820-11eb-91a8-704fff4aa13d.png)
![image](https://user-images.githubusercontent.com/12816515/99320412-6f853f00-2820-11eb-98f2-f9cd29e8aa0d.png)

Reviewed By: mdvacca

Differential Revision: D25444566

Pulled By: appden

fbshipit-source-id: ce0efd3e3b199a508df0ba1ce484b4de17471432
2021-01-08 13:59:48 -08:00