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

6640 Коммитов

Автор SHA1 Сообщение Дата
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
Kshitij Kotasthane 835117aba3 Added sharedAction example to Share API (#30333)
Summary:
* Added an example for `sharedAction` and `dismissedAction` in Share API examples

**Motivation** - Missing example for `sharedAction` in examples

## 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] - Added an example in ShareExample.js

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

Test Plan:
* Tested on Android

![sharedAction](https://user-images.githubusercontent.com/26821140/98447958-ed758600-214e-11eb-8a50-67ad5dcebea5.png)

Reviewed By: cpojer

Differential Revision: D25246375

Pulled By: rickhanlonii

fbshipit-source-id: f0d25a04c77ba02c9bea07aceccbfb65b2aa67e9
2021-01-08 12:41:32 -08:00
Pieter Vanderwerff f2052fedc2 Land suppressions for 0.142.0 release to xplat
Summary:
This change contains the suppressions for the up coming v0.142.0 Flow release.

The new suppressions are a result the following changes:
* Disallow flowing functions or inexact objects to indexed objects to improve object soundness. This can cause errors if you are passing a function or inexact objects when an indexed object is expected.
* Flow now processes imports before checking the body of a file. In some rare cases this can expose previously skipped errors due to the processing order.

Reviewed By: mroch

Differential Revision: D25820434

fbshipit-source-id: 59cc1d852ffc8cc39f0d5112ce485fb33f05c092
2021-01-07 11:33:45 -08:00
Rubén Norte fa406ac2aa Implement typed event emitters
Summary:
Adds types to Event Emitters and migrates the most relevant modules using them in `react-native`.

The most relevant file of this diff is `react-native/Libraries/vendor/emitter/__flowtests__/EventEmitter-flowtest.js` with the Flow tests showing and testing the behavior of the new types

Changelog: [Internal] Add types for Event Emitters and subclasses

Reviewed By: motiz88

Differential Revision: D25587936

fbshipit-source-id: feeb09f9ad15d383cdd82deaaaba0d12b94e868b
2021-01-07 03:19:04 -08:00
Micha Reiser 306edff62c Pass Systrace and Refresh as globals
Summary:
The `Systrace` and `Refresh` dependencies are injected into the `metroRequire` implementation by assigning the values to e.g. `require.Systrace = ...`.

The issue with this approach is that some `require` implementations might not support extending the `require` object or doing so results in a degraded performance. An example where this is the case is Hermes where changing the `require` object forces Hermes to opt out of the static require optimization.

This diff extends Metro so that the `Systrace` and `Refresh` implementation can either be injected by assigning to `require.Systrace` or by exposing the implementation in the global scope. It further changes the `Systrace` and `Refresh` modules to inject the instances using the global scope instead of extending `require`.

Changelog:
[Internal][Changed] - Expose Systrace and ReactRefresh as globals instead of extending require.

Reviewed By: motiz88

Differential Revision: D25693381

fbshipit-source-id: 254d66d43e7a56d3310cf1a17d5146b8d1307562
2021-01-04 07:40:19 -08:00
Rubén Norte e2033c5b7b Add FlowFixMes for future violations of typed EventEmitter
Summary:
This prevents having to modify too many files when we add the proper typing for that module

Changelog: [Internal]

Reviewed By: nadiia

Differential Revision: D25586848

fbshipit-source-id: 16001ada4a37a58f83b6e5a4400daebf9257be72
2021-01-04 03:56:57 -08:00
Rubén Norte c7463f0059 Add FlowFixMes for future violations of typed NativeEventEmitter
Summary:
Migrates all usages of `NativeEventEmitter` to `NativeEventEmitter<$FlowFixMe>`.

This prevents having to modify a very large number of files in the same change that adds support for typed events. It adds an unused typed parameter to `NativeEventEmitter` so we can change all usages to add `$FlowFixMe`.

Changelog: [Internal]

Reviewed By: nadiia

Differential Revision: D25575774

fbshipit-source-id: c7979e1502e980401d9c03456282eba333c1606d
2021-01-04 03:56:57 -08:00
Rubén Norte 1e7536a070 Migrate CodegenTypes and dependencies to Flow strict
Summary:
Migrates `CodegenTypes` and its transitive dependencies to Flow strict to unblock this mode in Native Modules and Native Components.

Changelog: [Internal]

Reviewed By: TheSavior

Differential Revision: D25540629

fbshipit-source-id: 7bed2ee58af7a789b50932734c7a86cf1719e2c5
2021-01-04 03:56:57 -08:00
Rubén Norte e088a4fe9c Add support for UnsafeObject to allow using Flow strict in native modules
Summary:
This new type will be valid in Flow strict mode and can be used by native modules and components to replace `Object`, with the same semantics.

This unblocks the migration of the most modules in the React Native package to Flow strict.

Changelog: [Internal] Add UnsafeObject type compatible with Flow strict mode to use in native modules and components

Reviewed By: RSNara

Differential Revision: D25540631

fbshipit-source-id: 60b80bbc84a53aecc747e3a1799cdf551e1859cd
2021-01-04 03:56:57 -08:00
Joshua Gross 053b8f6c93 Fix typo in ReactNativeTypes
Summary:
Faric -> Fabric

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D25734126

fbshipit-source-id: 5d0bb02482fd713601de0a22477c5b5c39daf522
2020-12-30 12:23:20 -08:00
Héctor Ramos 811ccec74e Add use_react_native_codegen!
Summary:
Consolidate CocoaPods codegen scripts under a single `use_react_native_codegen!` method in `react_native_pods.rb`.

This is the first step towards making the codegen scripts library-agnostic. There are still a handful of hardcoded assumptions in place (e.g. the output directory structure, the use of a separate directory for components), but with some work one would be able to add codegen support to arbitrary CocoaPods podspecs.

The codegen script no longer takes a CODEGEN_PATH argument, and will instead attempt to use the local react-native-codegen package if available, and fallback to using the node_modules/react-native-codegen package if not.

## Usage

The `use_react_native_codegen!` method has two arguments:

- `spec`, a pod [Specification](https://www.rubydoc.info/github/CocoaPods/Core/Pod/Specification) object.
- `options`, an optional object. Supported keys:
  - `:srcs_dir`, the path to your JavaScript sources. Your native module or component specs should be located somewhere in this directory.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D25728053

fbshipit-source-id: feec587b656d5b220598ce6196ea6bb34a9580a9
2020-12-29 16:10:34 -08:00
Valentin Shergin 00e038689d TextInput measuring error in ScrollResponder downgraded to a warning
Summary:
Even though replacing an error with a warning does not look like a future-proof solution here are the reasons for this:
* The measuring operation might just fail because of the async nature of React Native. And here, from my understanding, we don't even have a good reason for measuring. Auto-scrolling to selected textinput (which is the reason for this code, AFAIK) is a standard feature that OS does for all text input. I suspect that this (very old) feature was built in a timeframe where this system feature was originally broken (sometime before 2016).
* This product-facing API does not have an error-callback, so just loggin an error here is as (not) actionable as logging a warning.
* The error callback was never implemented in the pre-Fabric world, so it *never* got called for years, and now when Fabric is starting calling in some cases, it is being "punished" for this. In the next diff, I will try to retrofit this feature back to Paper to reach parity with Paper.

Changelog: [Internal]

Differential Revision: D25700156

fbshipit-source-id: 319a146b17cc2130848148ad11adbde16e86c5d5
2020-12-29 15:58:56 -08:00
Ramanpreet Nara 4c734d1e8d Support custom android_package_name in module codegen
Summary:
## Changes
All `rn_library(codegen_modules = True)` must now also specify native_module_android_package_name, like so:

```
rn_library(
  name = "FBAuth"
  codegen_modules = True,
  native_module_spec_name = "Foo",
  native_module_android_package_name = "com.facebook.fbreact.specs",
)
```

This will generate the FBAuth Java spec files under the appropriate directory: "com/facebook/fbreact/specs". It will also make the code-generated specs have the appropriate package name: "com.facebook.fbreact.specs".

Changelog: [Internal]

Reviewed By: shergin

Differential Revision: D25723176

fbshipit-source-id: 6efec1cbee43d70110c0ef23e2422e08609b61d4
2020-12-29 13:04:36 -08:00
Joshua Gross b8ca59cd74 Reduce re-rendering of Animated components in Fabric
Summary:
The `isFabric` method used in createAnimatedComponent is unreliable (another reason in a long list of reasons why you should not duplicate this code elsewhere, and why we want to delete it ASAP).
In particular, during the first render, the ref component has not been set yet, so we /cannot/ detect if the component is Fabric or non-Fabric and assume it's non-Fabric.

In Fabric, this causes `collapsable` and `nativeID` values to change after the first render.

To reduce this re-rendering, but not eliminate it for all components, I've introduced a flag that indicates if a component will /never/ be flattened. In particular, Image components, ScrollViews, Text cannot ever be flattened,
so we should always pass `collapsable:false` and the same nativeID prop for those components. For Animated <View>s and other components, the re-rendering issue is still a problem in Fabric for now.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D25720322

fbshipit-source-id: fe3234d8ae974911a2b5f82e4f6a093216f43d4b
2020-12-28 22:35:15 -08:00
Luna Wei 3ade096f02 Add cachebreaker to remote assets
Summary:
Changelog:
[Internal][Added] - Create a general utils for assets and add a cache breaker utility to set/get a urlparam for remote assets.

Reviewed By: motiz88

Differential Revision: D25521331

fbshipit-source-id: 042e52a27e826bc9993e80bc68cc6fc68abaf224
2020-12-23 19:49:27 -08:00
Luna Wei 1c895678cf Separate out pickScale
Summary:
Changelog:
[Internal][Changed] - Separate `pickScale` implementation from AssetSourceResolver

Reviewed By: motiz88

Differential Revision: D25520686

fbshipit-source-id: 7c5845d5e6f130e719cf8725224589031037a61d
2020-12-23 01:12:58 -08:00
Samuel Susla e5ecca39a8 Prevent crash when blurring an image
Summary:
Changelog: [internal]

Return original image instead of calling `abort()` when malloc fails.
Should we show a redbox? I don't think so, the redbox wouldn't be actionable for product engineer.

Reviewed By: PeteTheHeat

Differential Revision: D25678532

fbshipit-source-id: dd44d5e87198a0f76767ea40fe111ed347a7669a
2020-12-22 12:18:46 -08:00
empyrical f312e5ba84 Update iOS Fabric-related files to compile on OSS (#29810)
Summary:
Original PR contents:

This pull request updates the Podspecs and associated build scripts, and some source files so they build on OSS. RNTester now compiles with `fabric_enabled` again.

The following changes have been made:

 * Various spots that were pointing to the old `ReactCommon/fabric` location have now been updated to `ReactCommon/react/renderer`
 * Files that were attempting to use internal FB header `FBRCTFabricComponentsPlugins.h` were changed to use `RCTFabricComponentsPlugins.h`
 * `RCTFabricComponentsPlugins` in OSS was updated to include the `Image` fabric component (thanks tsapeta)
 * Replaced old `generate-rncore.sh` build script with new `generate-rncore.js` script which does not require `flow-node` and uses the `react-native-codegen` API directly, so there is no longer any need for an interim `schema-rncore.json` file.
 * Updated Yoga podspec which wasn't fully synced with changes from the main Yoga repo
 * Updated Fabric podspec with additional needed subspecs

Additions to PR by hramos:
* Replaced use of generate-rncore scripts with the original generate-native-modules-specs.sh script, which is now generate-specs.sh and supports both codegen for Native Modules and Components now (TurboModules/Fabric).
* Codegen now runs at build time as part of the Xcode build pipeline instead of as part of `pod install`. The build script is injected by the FBReactNativeSpec pod, as the pod is part of both Fabric and non-Fabric builds.

## Changelog

[General] [Fixed] - RNTester compiles with `fabric_enabled` again

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

Test Plan:
RNTester now compiles and runs in the simulator again when `fabric_enabled` is set to `true`.

```
cd xplat/js/react-native-github/packages/rn-tester
USE_FABRIC=1 pod install
open RNTesterPods.xcworkspace
# Build and run
```

Reviewed By: fkgozali

Differential Revision: D24058507

Pulled By: hramos

fbshipit-source-id: 8b2ea3694e6cb9aa23f83f087e2995fd4320e2bb
2020-12-22 08:36:22 -08:00
Ramanpreet Nara 331dc2a998 Default initialize RCTNetworking with observation disabled
Summary:
## Context
When you add/remove listeners from event emitters in JavaScript on iOS, we [call the NativeModule's addListener/removeListener methods](https://fburl.com/diffusion/4878jv6p). These addListener() and removeListener() methods [are implemented on the RCTEventEmitter class](https://fburl.com/diffusion/y913pqhy). All event emitters on iOS are subclasses of RCTEventEmitter.

The only purpose of calling RCTEventEmitter's addListener() and removeListener() methods is to call the [subclasses' startObservation, and stopObservation methods](https://fburl.com/diffusion/rpzyfppk), and [increment/decrement a listenerCount member variable](https://fburl.com/diffusion/ktl8if26) in RCTEventEmitter, which helps catch memory leaks.

RCTNetworking is a subclass of RCTEventEmitter, but it doesn't implement these startObserving/stopObserving methods. Since the [listenerCount is only used to show warnings](https://fburl.com/diffusion/i45lobil), in D24272560 (82187bfb6b), I disabled observation in RCTNetworking on the native side. Then in D24272663 (dabca52f77), I disabled RCTNetworking.addListener/removeListener NativeModule calls in JavaScript. This was gated via a QE/MC.

## Problem
The default initializer of RCTNetworking doesn't initialize with observation disabled. This broke antwerp when we shipped the experiment in D24272663 (dabca52f77). This diff fixes that problem.

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D25671343

fbshipit-source-id: d9a8ba5324a23ade8f4b0bf2ec093f3e4fb494dc
2020-12-21 16:18:23 -08:00
Javier Fraire 932c04cc99 Back out "Roll out RCTNetworking extraneous NativeModule call removal"
Summary:
It broke Forecast.

Original commit changeset: 0da20475a088

Changelog: [Internal]

Differential Revision: D25641098

fbshipit-source-id: 94daf0479963745bbca50b409b5a1dec1c8e8e71
2020-12-18 11:09:59 -08:00
Ramanpreet Nara 0e0d2e84f5 Roll out RCTNetworking extraneous NativeModule call removal
Summary:
## Context
Every time we call RCTNetworking.sendRequest(), we [set up six event listeners inside XMLHttpRequest](https://fburl.com/diffusion/85k6ou5w) by calling RCTNetworking.addListener(). Seeing how RCTNetworking.addListener() is implemented, each call results in two async NativeModule call: [one to addListener()](https://fburl.com/diffusion/ng21jek6), and [another to removeEventListener()](https://fburl.com/diffusion/nua3y973).

For RCTNetworking, both of these NativeModule calls are unnecessary, as explained in D24272663 (dabca52f77)
> RCTNetworking.startObserving and RCTNetworking.stopObserving don't exist. The main purpose of RCTEventEmitter.addListener is to call these methods, and increment the _listeners counter, so that we can start dispatching events when _listeners > 0. In D24272560 (82187bfb6b), I made RCTEventEmitter dispatch events even when _listeners <= 0. This is sufficient for us to stop calling these two RCTNetworking methods entirely.

Therefore, this experiment gets rid of on average 6-8 NativeModule method calls for every network call we make in React Native on iOS.

Reviewed By: PeteTheHeat

Differential Revision: D25618704

fbshipit-source-id: 0da20475a0882ed737cf32de27f266fd2cd016af
2020-12-17 17:27:09 -08:00
Ramanpreet Nara df0bfec201 Round 2: Remove synthesize bridge = _bridge
Summary:
All NativeModules that used to use the bridge to require other NativeModules now require other NativeModules via the Venice-compatible RCTModuleRegistry abstraction. Therefore, we can safely get rid of synthesize bridge = _bridge from them.

## How did I generate this diff?
1. Search for all NativeModules that have `synthesize bridge =`
2. Remove the `synthesize bridge = _bridge` from each NativeModule, and if it doesn't contain `_bridge`, `setBridge:`, or `elf.bridge`, add it to this codemod.

Changelog: [Internal]

Reviewed By: PeteTheHeat

Differential Revision: D25551295

fbshipit-source-id: 585d50ad55cb9ab083e430b07e1cf30e31f0d3c5
2020-12-17 10:13:32 -08:00
Mike c4950610e4 fix: First press not working after pull to refresh (#30291)
Summary:
According to https://github.com/facebook/react-native/issues/20011, the first onPress will not work after pull to refresh.

Dive into the code, found out that is because the state `isTouching` in `Libraries/Components/ScrollResponder.js` is not updated after the pull to refresh.

Update the `isTouching` state in `scrollResponderHandleResponderRelease` to fix this.

## Changelog

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

[iOS] [Fixed] - First press not working after pull to refresh

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

Test Plan:
### Before
- The first onPress fail
![ezgif-4-c6aa5383e898](https://user-images.githubusercontent.com/48589760/97789482-cd4c4100-1bfb-11eb-8a6b-649e8a966b99.gif)
### After
- The first onPress success
![ezgif-4-195f9f6c302e](https://user-images.githubusercontent.com/48589760/97789488-da693000-1bfb-11eb-9a87-f005e61b8ad0.gif)

Eli:
I tested this myself internally using this code sample:

```
'use strict';

import PlaygroundRoute from 'PlaygroundRoute';
import type {SurfaceProps} from 'Surface';
import TetraText from 'TetraText';
import TetraView from 'TetraView';
import {TouchableOpacity, Text, View, ScrollView, RefreshControl, StyleSheet} from 'react-native';
import * as React from 'react';

type Props = SurfaceProps<PlaygroundRoute>;

class App extends React.Component<{}> {
  constructor() {
    super();
    this.state = {refreshing: true, items: []};
  }

  componentDidMount() {
    this.refresh();
  }

  refresh = () => {
    this.setState({
      refreshing: true,
      items: [],
    });

    setTimeout(
      () =>
        this.setState({
          refreshing: false,
          items: [0, 1, 2, 3, 4, 5],
        }),
      1500,
    );
  };

  renderItem = ({item}) => {
    return (
      <TouchableOpacity onPress={() => alert('pressed!')} key={`${item}`}>
        <Text style={{width: '100%', height: 48, backgroundColor: 'white'}}>
          {item}
        </Text>
        <View style={{width: '100%', height: 1, backgroundColor: 'gray'}} />
      </TouchableOpacity>
    );
  };

  render() {
    return (
      <View style={{flex: 1, padding: 48}}>
        <ScrollView
          style={{
            flex: 1,
            backgroundColor: '#aaa',
            borderColor: 'gray',
            borderWidth: 1,
          }}
          keyExtractor={item => `${item}`}
          refreshControl={
            <RefreshControl
              refreshing={this.state.refreshing}
              onRefresh={this.refresh}
            />
          }>
          {this.state.items.map(item => this.renderItem({item}))}
        </ScrollView>
      </View>
    );
  }
}

export default function Playground(props: Props): React.Node {
  return (
    <App />
  );
}

const styles = StyleSheet.create({
  container: {
    padding: 10,
    paddingTop: 30,
  },
});
```

{F351458967}

Reviewed By: appden

Differential Revision: D25574927

Pulled By: TheSavior

fbshipit-source-id: 7abf8a2f947d94150419e51d46a19e792441c981
2020-12-16 10:14:02 -08:00
Ramanpreet Nara ad75a3fbb0 Fix RCTBlobManager require inside RCTFileReaderModule
Summary:
RCTBlobManager actually has the name "BlobModule", not "BlobManager".

Changelog: [Internal]

Reviewed By: PeteTheHeat

Differential Revision: D25569865

fbshipit-source-id: f6b41300bda6485cef3f18d3d0308dad9c002b77
2020-12-15 15:15:11 -08:00
Samuel Susla 67309277fe Fix infinite loop in KeyboardAvoidingView
Summary:
Changelog: [General][Fixed] Fix stalling UI due to a bug in KeyboardAvoidingView

I introduced this bug in D22764192 (b08fff6f86).

The stalling was caused by onLayout in JavaScript triggering native layout which called onLayout in JavaScript without terminating condition.

The fix is to only cause native layout once from JavaScript's onLayout function. This makes sure both Fabric and Paper works correctly and UI stall isn't caused.

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

Reviewed By: TheSavior

Differential Revision: D25522362

fbshipit-source-id: 602e540bb1c40ae4f421b3e6ebc5a047cd920c17
2020-12-15 12:04:36 -08:00
simek 7485208498 Pressability: fix typo in variable, follow event check pattern, small tweak (#30151)
Summary:
This small PR introduces the following changes to the `Pressability`:
* fixes typo in internal `isActivationTransiton` variable name
* assigns `onPressMove` to variable before check and potential usage (this is the common pattern in this file)
* utilizes destructuring assignment to simplify passing coordinates to `_touchActivatePosition`

## Changelog

[Internal] [Fixed] - Pressability: fix typo in variable, follow event check pattern, small tweak

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

Test Plan: Successful `yarn test` run.

Reviewed By: kacieb

Differential Revision: D25545662

Pulled By: nadiia

fbshipit-source-id: 8d311fe21b485ee707e05dad120322b3027e686b
2020-12-15 11:50:02 -08:00
Ramanpreet Nara 6c3dd87ef1 Manual: Migrate from bridge.moduleForName to RCTModuleRegistry
Summary:
All NativeModules that use `[RCTBridge moduleForName:]` to access other NativeModules are now instead using the Venice-compatible RCTModuleRegistry to access other NativeModules.

Changelog: [Internal]

Reviewed By: shergin

Differential Revision: D25508910

fbshipit-source-id: 85fc390063af264f2f2843e5640fa7336a784ab4
2020-12-12 19:02:04 -08:00
Ramanpreet Nara 282b1a880f Manual: Migrate from bridge.moduleForClass to RCTModuleRegistry
Summary:
All NativeModules that use `[RCTBridge moduleForClass:]` to access other NativeModules are now instead using the Venice-compatible RCTModuleRegistry to access other NativeModules.

Changelog: [Internal]

Reviewed By: shergin

Differential Revision: D25508277

fbshipit-source-id: 1b415a5ad4055290940879e100ceaa84ae83feeb
2020-12-12 19:02:04 -08:00
Ramanpreet Nara c7e1355dec Manual: Migrate from bridge.webSocketModule to RCTModuleRegistry
Summary:
All NativeModules that access the _bridge from self to require the WebSocketModule NativeModule now instead get the WebSocketModule NativeModule from the _moduleRegistry.

Changelog: [Internal]

Reviewed By: PeteTheHeat

Differential Revision: D25500433

fbshipit-source-id: 21aebc5684dd6a058de4e35b042c9fb255ffcb33
2020-12-12 19:02:03 -08:00
Ramanpreet Nara f50d9c41b2 Manual: Clean up bridge.networking -> RCTModuleRegistry codemod
Summary:
Spotted a few errors in Codemod that migrated bridge.networking calls to [_moduleRegistry moduleForName:"Networking"] calls. This diff fixes those mistakes.

Changelog: [Internal]

Reviewed By: PeteTheHeat

Differential Revision: D25499699

fbshipit-source-id: 29f296fc1011cf65d30e083e0ef001e3185edbfb
2020-12-12 19:02:03 -08:00
Ramanpreet Nara ad6705f142 Codemod: Migrate from bridge.networking to RCTModuleRegistry
Summary:
All NativeModules that access the _bridge from self to require the Networking NativeModule now instead get the Networking NativeModule from the _moduleRegistry.

NOTE: xbgs .networking reveal any other usages. So, there won't be a manual migration diff associated with this codemod.

Changelog: [Internal]

Reviewed By: PeteTheHeat

Differential Revision: D25499412

fbshipit-source-id: 7b0e33135c6c91ffc1e041ad3ab95f1346a8bc22
2020-12-12 19:02:03 -08:00
Ramanpreet Nara e041c616d1 Codemod: Migrate from bridge.imageStoreManager to RCTModuleRegistry
Summary:
All NativeModules that access the _bridge from self to require the ImageStoreManager now instead get the ImageStoreManager from the `_moduleRegistry`.

Changelog: [Internal]

Reviewed By: PeteTheHeat

Differential Revision: D25498774

fbshipit-source-id: 1d97888ed2ef8d295aa35cf08cb9e9f3bc33ed05
2020-12-12 19:02:02 -08:00
Peter Argany e0ece12203 Fix duplicate Networking module bug
Summary:
While investigating a bridgeless networking issue, I noticed something very peculiar. **Two** networking turbo modules are built and used in bridgeless mode. Upon debugging, I realized that each of them have a different `TurboModuleHolder`. The reason is the following:
1. In JS, the module's name is [Networking](https://fburl.com/diffusion/f2xu4wie)
2. In ObjC, we call the module "RCTNetworking" (examples in this diff)
3. Both scenarios end up creating the correct Turbo Module: [RCTNetworking](https://www.internalfb.com/intern/diffusion/FBS/browsefile/master/xplat/js/react-native-github/Libraries/Network/RCTNetworking.mm?link_ref=search), but the `TurboModuleHolder` doesn't know that "RCTNetworking" and "Networking" are the same. Any other modules accessed this way will have the same issue.

An alternative solution would be to tell `TurboModuleHolder` to strip the `RCT` suffix, which would solve the problem globally. RSNara thoughts?

Changelog: [Internal]

Reviewed By: RSNara

Differential Revision: D25477044

fbshipit-source-id: 02219de578ef4d19e579110e4242883a30cefcd6
2020-12-11 11:24:27 -08:00
Ramanpreet Nara 1f883192ec Manual: Migrate from bridge.eventDispatcher to RCTModuleRegistry
Summary:
This is an extension of D25449795. I searched for all usages of .eventDispatcher within NativeModules, and migrated them all to the Venice-compatible RCTModuleRegistry API.

Changelog: [Internal]

Reviewed By: PeteTheHeat

Differential Revision: D25473844

fbshipit-source-id: 2b8deec236e019f3adfb59fadd745c249ff822f4
2020-12-11 10:42:28 -08:00
Ramanpreet Nara 74fd6fb1da Codemod: Migrate from bridge.eventDispatcher to RCTModuleRegistry
Summary:
All NativeModules that use the bridge to require the eventDispatcher are now instead using the RCTModuleRegistry I introduced in D25412847 (0ed81b28d3).

## What does this codemod do?
For all ObjC files that contain `synthesize bridge = _bridge`, migrate calls that access the React Native bridge from `self`, and use it to load the event dispatcher.

**Thoughts on Codemod Safety:** If we can access the bridge from self, then that means that if we synthesize the module registry, we can access the module registry from self. Therefore, this codemod is safe.

Changelog: [Internal]

Reviewed By: PeteTheHeat

Differential Revision: D25449795

fbshipit-source-id: 2f7235d14659e73d673ae08763dc2cccdde55a19
2020-12-11 10:42:28 -08:00
Ramanpreet Nara de7cc12707 Migrate NativeModules from [self bridge] -> _bridge
Summary:
This should be a noop. It just makes writing codemods easier.

Changelog: [Internal]

Reviewed By: PeteTheHeat

Differential Revision: D25442218

fbshipit-source-id: dba0c35a6f566e83ed5b7142075fff6929efeada
2020-12-10 20:23:17 -08:00
Kevin Gozali 3af21381df Codegen Android: allow generating Fabric Java component files during build time
Summary:
This commit:
* Generate Fabric component Java files along side Java NativeModule specs, when `USE_FABRIC=1` is set
* Adjust the component codegen to place output files in a subdir based on package name
* Adjust existing Buck targets to filter the right nativemodule vs component java files (this avoids duplicated symbols)
* Compiles the Java output during build time on RNTester/ReactAndroid (Gradle)

Not in this commit:
* Fabric C++ files
* Removing checked-in generated component files.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D25416614

fbshipit-source-id: fd670ead2198c9b5a65812c692b7aed9f3d7cd58
2020-12-09 09:19:33 -08:00
Samuel Susla 2092dca003 Add missing @synthesize bridge to VerseThreadView and RCTFileReaderModule
Summary:
Changelog: [internal]

In D25386708 (408bcdeedb) `synthesize bridge` was removed. But two modules actually depend on this.

`RCTFileReaderModule` and `VerseThreadView` which both use it.

Reviewed By: RSNara

Differential Revision: D25423574

fbshipit-source-id: daf95d9b27841cf8d205d8ea2666d5aa69a6d720
2020-12-09 07:27:38 -08:00
Ramanpreet Nara 408bcdeedb Remove unneeded @synthesize bridge from NativeModules
Summary:
This is a codemod. All these NativeModules demand access to the bridge. However, they don't use it.

Changelog: [Internal]

Reviewed By: PeteTheHeat, RoelCastano

Differential Revision: D25386708

fbshipit-source-id: f05f4777d2527e96e53581e7ac58f6be47411dce
2020-12-08 20:27:44 -08:00
David Vacca f96478778c Ensure iOS Native components are initialized when using JS View configs
Summary:
As part of the initialization of Native View configs, the PaperUIManager.getViewManagerConfig() method calls the native side to lazy initialize iOS Native components. This is necessaary to make ensure that native classes are loaded and initialized before a view is created.
Note that this requirement is only necessary when Fabric is disabled.

As part of JS ViewConfigs, we removed the native call to lazy initialize iOS native components. This causes a crash during the creation of NativeViews when JS ViewConfigs are enabled and Fabric is disabled. The rootcase of the exception is that native classes are not properly initialized when the createView method is executed in iOS.

This diff forces the lazy initialization of iOS Native components when JS View configs are enabled and Fabric is disabled. This new mechanism is executed as part of the creation of views and it's ONLY going to be executed when the user navigates to a NON-FABRIC screen, JS ViewConfigs are enabled and the component is not initialized yet.

The extra cost should be minimal or zero.

changelog: [internal] internal

Reviewed By: fkgozali

Differential Revision: D25387014

fbshipit-source-id: fe3bc42f803a805192b419bfb4b7a6b5b1b71b60
2020-12-07 23:14:02 -08:00
Dmytro Voronkevych 0d4985900b Adding support for cancelOnBackground for UserFlow
Summary:
UserFlow API now takes configuration parameter, which is required. It contains of 2 arguments:
* triggerSource
* cancelOnBackround

Reviewed By: swillard13

Differential Revision: D25094721

fbshipit-source-id: 64a468c2168265ade9f8d4cea4beb911637544fa
2020-12-07 10:49:29 -08:00
David Vacca 959bc47c18 Add internal_analyticTag into RCTImageView JS view configs
Summary:
this diff fixes the next error:

```
'RCTImageView' has a view config that does not match native. 'validAttributes' is missing: internal_analyticTag
    in RCTImageView (at Image.ios.js:149)
    in ImageAnalyticsTagContext.Consumer (at Image.ios.js:146)
    in Image (at TintedIcon.js:55)
    in TintedIcon (at TetraIcon.js:98)
    in TetraIcon (at FDSCheckbox.js:67)
    in FDSCheckbox (at TetraListCell.js:820)
    in TetraAddOnSecondary (at TetraListCell.js:576)
    in TetraPressable (at TetraListCell.js:603)
    in TetraListCell (created by TetraListCell)
    in TetraListCell (at RNInternalSettingsUnit.js:35)
    in TetraList (at RNInternalSettingsUnit.js:32)
    in RNInternalSettingsUnit (at RNInternalSettingsDeveloperModeUnit.new.js:73)
    in RNInternalSettingsDeveloperModeUnit (at RNInternalSettingsSurface.js:79)
    in RNInternalSettingsSurface (at withDefaultErrorBoundary.js:30)
    in DefaultError(React.lazy(RNInternalSettingsSurfaceForFacebook)) (at renderApplication.js:47)
```

changelog: [internal] internal

Reviewed By: fkgozali

Differential Revision: D25313414

fbshipit-source-id: ab951d25ac6a80809a2977c80ff059f667cc5595
2020-12-04 10:54:33 -08:00
Kim Svatos 5d8fcde632 Back out "Avoid accessing `self.component` on background thread"
Summary: Changelog: [Internal] backout change dispatching main queue before using it

Reviewed By: shergin

Differential Revision: D25319046

fbshipit-source-id: 4f8952e577cfd9033fb2c2248b9b056a0d468b5d
2020-12-03 19:09:50 -08:00
Héctor Ramos 5eee2f2bc0 Fix Circle CI iOS Tests: Make FBReactNativeSpec dir as needed
Summary:
Quick fix for Circle CI: Ensure FBReactNativeSpec dir exists before touching files.

Changelog:
[Internal]

Reviewed By: fkgozali

Differential Revision: D25285573

fbshipit-source-id: 8dec496856c90accc687648d7068aadfea24d72b
2020-12-02 16:13:03 -08:00
Héctor Ramos c901c1fbce Integrate Native Module codegen into Xcode build pipeline (#30449)
Summary:
Move the codegen invocation out of Podfiles and into the FBReactNativeSpec Pod itself. With this change, developers do not need to modify their existing project's Podfiles, and yet the codegen will be integrated into their projects automatically by way of the FBReactNativeSpec Pod.

This is accomplished in part by injecting a script build phase into the Pods Xcode project that is generated by CocoaPods. The build phase will save the output of the codegen script to a log in the derived files directory. The codegen will be executed if the codegen log file is not present, or if the contents of the Libraries directory has changed.

The codegen will thus be invoked in these situations:

**RNTester:**
* When `packages/rn-tester/RNTesterPods.xcworkspace` is built, if the codegen output logfile is not present or if the input files have changed.

**OSS React Native apps:**
* When `ios/AwesomeProject.xcworkspace` is built, if the codegen output file is not present or if the input files have changed. Normally, this should not happen, as we do not expect folks to update the contents of `node_modules/react-native/Libraries`.

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

Changelog: [Internal] - Moved codegen invocation out of Podfile and into FBReactNativeSpec Pod

Reviewed By: fkgozali

Differential Revision: D25138896

fbshipit-source-id: 4779f822459cea2c30fd544eee19a49e8d80153d
2020-12-02 14:27:50 -08:00
Emily Janzer d435d26d87 Check if result from native UIManager is null before accessing view config
Summary:
As titled - attempt to mitigate a JS error on iOS while we work on getting JS view configs. It seems like this happens when the bridge is invalid.

Changelog: [Fixed][iOS] Don't throw an error if the UIManager returns null when fetching a view config

Reviewed By: kacieb

Differential Revision: D25247203

fbshipit-source-id: e2003f99b818f9657c60ff95b266be74fe18a94b
2020-12-01 15:02:20 -08:00
Tim Yung aa03c836b4 RN: Migrate `View` to NativeComponentRegistry
Summary:
Migrates `View` to use `NativeComponentRegistry`, which enables configuring it to avoid reflection by using a static `ViewConfig`.

Changelog:
[Internal]

Reviewed By: JoshuaGross

Differential Revision: D25136054

fbshipit-source-id: f2abda1105bd2a8b396db6f1a640430b62bbcdaf
2020-11-28 21:49:58 -08:00
Shelly Willard bb1dcc182e Migrate jsi wrapper + pass markerId to get next instance key
Summary:
Migrating jsi wrapper userflow v2. Also pass markerId to the method that gets instance key

Changelog: [internal]

Differential Revision: D25184462

fbshipit-source-id: c316720b0b3d47b345156bb71d51d6f4c473ceef
2020-11-27 11:15:00 -08:00
Kevin Lin 9528ef27b9 Avoid accessing `self.component` on background thread
Summary: Changelog: [Internal] `self.component` is main thread affined so we need to dispatch to main queue before using it.

Reviewed By: shergin

Differential Revision: D25163182

fbshipit-source-id: a7da0324982354215e0ccb47615f7f121200f12a
2020-11-26 04:06:59 -08:00
Tim Yung f638aff434 RN: Add `NativeComponentRegistry.getWithFallback_DEPRECATED`
Summary:
Creates `NativeComponentRegistry.getWithFallback_DEPRECATED`. This is deprecated from inception because it exists only to support a pattern that should not be necessary.

For any given `NativeX` component, the JavaScript module that calls `NativeComponentRegistry.get('NativeX', …)` should only exist in the JavaScript bundle if the native binary actually supports that native component.

But in today's transitional state of the world, there are JavaScript modules that use `UIManager.getViewManagerConfig('NativeX')` as a means of feature detection.

The purpose of `NativeComponentRegistry.getWithFallback_DEPRECATED` is to bridge this transitional gap. Component should migrate toward initializing the `NativeComponentRegistry` with a runtime configuration provider that enumerates all supported native components. If the native component is not supported, it should return null.

Changelog:
[Internal]

Reviewed By: fkgozali

Differential Revision: D25109988

fbshipit-source-id: 76f7077904594ca63495d8338905c43712ea02e0
2020-11-20 18:53:14 -08:00
Tim Yung a865bd89d7 RN: Migrate `ImageView` to NativeComponentRegistry
Summary:
Migrates `ImageView` to use `NativeComponentRegistry`, which enables configuring it to avoid reflection by using a static `ViewConfig`.

Changelog:
[Internal]

Reviewed By: JoshuaGross

Differential Revision: D25104446

fbshipit-source-id: dd01bf01ead94ca6632b2653b45becf408953bcf
2020-11-20 18:53:14 -08:00
Tim Yung 9dfefa8da0 RN: Rename to `ScrollViewNativeComponent`
Summary:
There may be assumptions that `Native*.js` contains TurboModule. In order to avoid introducing unplanned breaking changes (especially right before the holidays), roll this back for now.

In doing so, I also realized that I forgot to migrate over `ScrollContentViewNativeComponent`. This does that, too.

Changelog:
[Internal]

Reviewed By: RSNara

Differential Revision: D25129324

fbshipit-source-id: 343c4b800969dab91f7cd9f2bf253788c94d38e6
2020-11-20 18:53:14 -08:00
Mike Vitousek 7f53bb95f7 Suppress errors and switch to new-generics in xplat
Summary:
The Flow team has been building a new implementation of the system that typechecks the body of generic functions and classes. This system is more sound than the previous approach and detects errors that were uncaught previously. This diff turns on the new generic system by setting generate_tests=false in the .flowconfig, and suppresses newly discovered errors.

This diff modifies and re-signs some generated modules, because syncing from www pulled in a ton of other changes that have runtime differences, and I'm not equipped to verify that the changes are safe to land.

Changelog: [Internal]

Reviewed By: panagosg7

Differential Revision: D24801184

fbshipit-source-id: bb31fe4c5a4107d183649b436a548df5ff42e217
2020-11-20 00:50:30 -08:00
Tim Yung 00e623ddbb RN: Migrate `ScrollView` to NativeComponentRegistry
Summary:
Migrates `ScrollView` (and its related native components) to use `NativeComponentRegistry`. This will enable it to be configured using experiments to conditionally use the native `ViewConfig` or verify the static `ViewConfig`.

This also cleans up a bunch of the modules and types related to defining the native `ScrollView` component.

This also proposes adopting the same module naming protocol was has been adopted for TurboModules (i.e. `NativeScrollView` instead of `ScrollViewNativeComponent`).

Changelog:
[Internal]

Reviewed By: JoshuaGross

Differential Revision: D25098530

fbshipit-source-id: ff1394bfac023daf58e85d5f9068e4f8da3538be
2020-11-19 15:55:23 -08:00
Tim Yung d4e29ecdaa RN: Fix `ScrollView` Type Errors
Summary:
Fixes some of the type errors in `ScrollView` that were previously being suppressed by comments. This also slightly simplifies the implementation of `ScrollView`.

Changelog:
[Internal]

Reviewed By: kacieb

Differential Revision: D25097225

fbshipit-source-id: a444db8179c91e264671d8f32431b93c4da8dfc4
2020-11-19 15:55:23 -08:00
Tim Yung 54a067e61e RN: Refactor `ScrollView` Style Splitting
Summary:
Rewrites `splitLayoutProps`, which is only used by `ScrollView`.

- Improve type safety by avoiding `DangerouslyImpreciseStyle`.
- Avoid allocating objects when it is not necessary.
- Avoid allocating a object enumeratig layout props by using a switch statement.

Changelog:
[Internal]

Reviewed By: JoshuaGross, kacieb

Differential Revision: D25097226

fbshipit-source-id: 2050c03b681024212c06a48b7eb05f28c14415f9
2020-11-19 15:55:23 -08:00
Tim Yung 7e7527e7db RN: Preserve Style Type in `flattenStyle`
Summary:
Refactors `flattenStyle` so that it preserves the style type of the argument. This lets us avoid using `DangerouslyImpreciseStyleProp` where we can.

Changelog:
[Internal]

Reviewed By: JoshuaGross, nadiia, kacieb

Differential Revision: D25097227

fbshipit-source-id: df6af6fefab25dbb62e3c81897c3cef98619a9c7
2020-11-19 15:55:23 -08:00
Nick Gerleman 6d2a527984 Avoid eating clicks/taps into ScrollView when using physical keyboard (#30374)
Summary:
This is an extension of https://github.com/facebook/react-native/issues/29798 which was reverted due to cases where the soft keyboard could not be dismissed.

## 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] - Avoid eating clicks/taps into ScrollView when using physical keyboard

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

Test Plan: Validated with iOS simulator that taps on default ScrollView will dismiss soft keyboard and be eaten if open, but taps are not eaten when emulating a connected physical keyboard.

Reviewed By: kacieb

Differential Revision: D24935077

Pulled By: lyahdav

fbshipit-source-id: 19d9cf64547e40a35f9363896e3abbdccb95b546
2020-11-19 13:12:41 -08:00
Tim Yung 6a547c6c57 RN: Create `NativeComponentRegistry`
Summary:
Creates `NativeComponentRegistry` which makes native component initialization more declarative and configurable through an optionally configurable provider.

The next diff converts `ScrollView` to use this new abstraction as a demonstration. The plan would be to use this to replace all current manual call sites of `registerGeneratedViewConfig`, and then the ones generated via the Babel plugin.

Migrating to this will not change any production behavior, but it will enable verification of `ViewConfig` in development.

Changelog:
[Internal]

Reviewed By: JoshuaGross

Differential Revision: D25084468

fbshipit-source-id: 9c758ddc279bf937a401a868a066907a94098f37
2020-11-19 10:55:50 -08:00
Tim Yung f6b8736b09 RN: Update ViewConfig for ScrollView
Summary:
Updates `ReactScrollViewManager` and the `ViewConfig` for `ScrollView` so that they are equivalent.

- `inverted` was missing.
- `contentOffset` was missing differ on Android. (However, there does not seem to be any perceivable behavior difference besides the native `ViewConfig` being different.)

Changelog:
[Internal]

Reviewed By: JoshuaGross

Differential Revision: D25084470

fbshipit-source-id: 8bea3b7a692c1038819a4147b174583a4faa71e9
2020-11-19 02:52:00 -08:00
Tim Yung de92e7405d RN: Refactor `ViewConfig` Inflation
Summary:
Refactors the conversion of a `PartialViewConfig` into a `ViewConfig` to a separate function so that it can be reused.

Changelog:
[Internal]

Reviewed By: JoshuaGross

Differential Revision: D25084469

fbshipit-source-id: 8a7f53ff2c68860697c791c37a6abbfd3213a0f9
2020-11-19 02:52:00 -08:00
Luna Wei 003d72d80b Provide default device scale
Summary:
Changelog:
[Internal][Fixed] - Provide a default device scale

Reviewed By: kacieb

Differential Revision: D24975788

fbshipit-source-id: 5f2158d7b704713b6a759734943e52228c9cafbc
2020-11-18 21:27:17 -08:00
Tim Yung 5b527fefcb RN: Fix `registerGeneratedViewConfig` Types
Summary:
Fixes types in `registerGeneratedViewConfig` and also removes some unnecessary hacks for the `ReactNativeViewViewConfig` type.

Changelog:
[Internal]

Reviewed By: JoshuaGross

Differential Revision: D25076608

fbshipit-source-id: 5cb2060e11db598b42fbb7f2f8aecfd7f4b262ef
2020-11-18 21:19:13 -08:00
Tim Yung e136aa3fc4 RN: Cleanup ViewConfig Types
Summary:
Cleans up the Flow types for React Native ViewConfig. After this diff, we will have two new canonical types:

- `ViewConfig` which is what we get from native and what is registered in the `ReactNativeViewConfigRegistry`.
- `PartialViewConfig` which is what we generate statically and augment at runtime before registering with the `ReactNativeViewConfigRegistry`.

Changelog:
[Internal]

Reviewed By: JoshuaGross

Differential Revision: D25075299

fbshipit-source-id: 4b53927b2db437b615447b711e83db355d0cfa55
2020-11-18 21:19:12 -08:00
Tim Yung 69b4611049 RN: Hoist Reflection from Verification
Summary:
Hoists the call to `getNativeComponentAttributes` out of the verification function so that it's easier to keep track of when this function is and is not called.

The purpose of this will become clearer in a future refactor.

Changelog:
[Internal]

Reviewed By: ejanzer

Differential Revision: D25072600

fbshipit-source-id: bc42461baae3476fa7ecb6186c4256dd23921ed5
2020-11-18 21:19:12 -08:00
Tim Yung 9611a7b43e RN: Move RN$Bridgeless Check to Registration
Summary:
Moves the `RN$Bridgeless` check as part of moving more logic out of the verification function.

Changelog:
[Internal]

Reviewed By: ejanzer

Differential Revision: D25072601

fbshipit-source-id: 929230c02a6eaa1b724f7fd2e1a691a7c20c4b11
2020-11-18 21:19:12 -08:00
Luke Walczak a7c1c5aff2 Add possibility to disable buttons in action sheet ios (#28979)
Summary:
_**Fixed**_ version of [the previous PR](https://github.com/facebook/react-native/pull/28792) after reverting [changes](c8d678abcf (commitcomment-39299254))

----

I've noticed that currently there is no option to disable button within the `ActionSheetIOS`. It can be really useful and decided to extend the API to support that functionality.

I added a new option called `disabledButtonsIndices` to `ActionSheetIOS` which is an array of button indices which should be disabled.

`ActionSheetIOS` documentation - PR https://github.com/facebook/react-native-website/pull/1898

## Changelog

[iOS] [Added] - Add disableButtonsIndices option to ActionSheetIOS component

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

Test Plan:
1. Run the `RNTester`
2. Choose `ActionSheetIOS`
3. Check the fourth example `Show Action Sheet with disabled buttons`
4. `Option 1` and `Option 2` should be disabled

screenshot | gif
 --- | ---
<img width="493" alt="Screenshot 2020-04-30 at 15 16 22" src="https://user-images.githubusercontent.com/22746080/80739025-1ec52780-8b16-11ea-8b1c-30bb40ad8c99.png"> | <img src="https://user-images.githubusercontent.com/22746080/80739043-24227200-8b16-11ea-8bcb-af25eb57baac.gif" width="493" />

Reviewed By: sammy-SC

Differential Revision: D21727497

Pulled By: PeteTheHeat

fbshipit-source-id: 749b6c623eb8a44fe2bd96829ce89be5310e2368
2020-11-18 21:11:48 -08:00
Tim Yung 130618fd85 RN: Suppress RCTVirtualText Warning in Bridgeless
Summary:
The `DummyUIManager` module warns whenever `RCTVirtualText` is initialized. This stops that.

Changelog:
[Internal]

Reviewed By: PeteTheHeat

Differential Revision: D25073194

fbshipit-source-id: 8b9052d1cbb9a4defa5efbd110e1a91cd8884c48
2020-11-18 20:59:24 -08:00
Samuel Susla a6b785553b Check error code returned from vImageBoxConvolve_ARGB8888
Summary:
Changelog: [internal]

If value returned from `vImageBoxConvolve_ARGB8888` is negative, an error occurred.
Converting a negative number to `unsigned long` produces a large positive number (larger than memory). Trying to allocate that much memory fails, malloc returns NULL, and abort triggered inside `RCTBlurredImageWithRadius`.

To fix this we need to check for return value from `vImageBoxConvolve_ARGB8888`.

Documentation: https://developer.apple.com/documentation/accelerate/1515945-vimageboxconvolve_argb8888?language=objc

Reviewed By: JoshuaGross

Differential Revision: D25055827

fbshipit-source-id: 2c46ae6eea5cfcc95c2b552c7cd2bc60125fd24a
2020-11-18 09:39:57 -08:00
Brian Vaughn 68a476103a Name a bunch of anonymous RN contexts
Summary:
Changelog:
[General] [Changed] - Added (DEV-only) `displayName` to some RN contexts to make them more easy to differentiate when debugging.

Reviewed By: lunaleaps

Differential Revision: D24993068

fbshipit-source-id: 4904259eda50444c2f74700a3540ff4fd02ac322
2020-11-16 13:12:09 -08:00
Koichi Nagaoka d85d5d2e19 Fix cannot working Modal's onDismiss. (#29882)
Summary:
Fixes: https://github.com/facebook/react-native/issues/29455

Modal's onDismiss is not called on iOS.
This issue occurred the commit bd2b7d6c03 and was fixed the commit 27a3248a3b.
However, the master and stable-0.63 branches do not have this modified commit applied to them.

## Changelog

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

[iOS] [Fixed] - Modal's onDismiss prop will now be called successfully.

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

Test Plan:
Tested on iOS with this change:

1. Set function Modal's onDismiss prop.
1. Set Modal's visible props is true. (show Modal)
1. Set Modal's visible props is false. (close Modal)
1. The set function in onDismiss is called.

Reviewed By: shergin

Differential Revision: D24648412

Pulled By: hramos

fbshipit-source-id: acf28fef21420117c845d3aed97e47b5dd4e9390
2020-11-13 23:56:09 -08:00
Tim Yung 480dabd665 RN: Remove Android `setTimeout` Warning
Summary:
Many third-party libraries (especially data management and caching ones) make use of long timeouts.

There are currently no plans to change `setTimeout` on Android to support firing when apps are in the background. In the meantime, this warning is not actionable for developers who are using these frameworks. Their workarounds are to 1) deal with the noise in their logs, or 2) suppress the warning.

Changelog:
[General][Removed] - Removed warning on Android for `setTimeout` with delays greater than 1 minute.

Reviewed By: lunaleaps

Differential Revision: D24964958

fbshipit-source-id: 1b40c8ba95d554c29dec74477aa63ea3ef8e4768
2020-11-13 18:07:37 -08:00
Nadiia D 9be3356e02 replace defaultProps usage in functional components
Summary:
Changelog:
[General] [Removed] - Replace defaultProps usage in functional components

Reviewed By: kacieb

Differential Revision: D24907836

fbshipit-source-id: 05c7381b66c7738790eff5fea594791c3ecfa12e
2020-11-13 17:07:11 -08:00
Samuel Susla 3a0927ce43 Fix memory leak in ScrollViewStickyHeader
Summary:
Changelog: [internal]

`addListener` call needs a matching `removeListener` call. Otherwise a memory leak is introduced to the app.
This memory leak can retain a UIImage on iOS in Fabric and cause OOM.

Reviewed By: JoshuaGross

Differential Revision: D24860489

fbshipit-source-id: 2625e4bfec416d59e048d9b5ada3813019dd107c
2020-11-11 01:59:38 -08:00
Kacie Bawiec 46be292f67 Fix nested FlatList not firing onScrollDragEnd and onMomentum methods
Summary:
With nested FlatLists, three methods aren't firing: `onMomentumScrollBegin`, `onMomentumScrollEnd`, and `onScrollDragEnd`. This is because the nested child lists' methods are not being called.

This copies the solution for this from `onScrollBeginDrag` to the other three methods.

Changelog: [Fixed] Fix nested FlatList not firing onScrollDragEnd and onMomentum methods

Reviewed By: nadiia

Differential Revision: D24803418

fbshipit-source-id: 8685b1ab9f1bd5f67a88d93ac5de628d4bd69024
2020-11-10 09:08:07 -08:00
Paige Sun f27e305056 Fix prefetchImageWithMetadata redbox in AMA
Reviewed By: RSNara

Differential Revision: D24837264

fbshipit-source-id: b2aeef2c051fa15c06cf2eb6350c152b722196c2
2020-11-10 08:39:30 -08:00
Sebastian Markbage c7ab780360 React Native sync for revisions 454c221...c3e20f1
Reviewed By: rickhanlonii

Differential Revision: D24700276

fbshipit-source-id: 877759c60632985753f3cd02ad0ded50144b6744
2020-11-09 14:30:51 -08:00
Sebastian Markbage 69ade5996f React Native sync for revisions 4e5d7fa...454c221
Summary:
Base sync before adding Flight files.

This sync includes the following changes:
- **[454c2211c](https://github.com/facebook/react/commit/454c2211c )**: Refactor SchedulerHostConfigs ([#20025](https://github.com/facebook/react/pull/20025)) //<Ricky>//
- **[56e9feead](https://github.com/facebook/react/commit/56e9feead )**: Remove Blocks ([#20138](https://github.com/facebook/react/pull/20138)) //<Sebastian Markbåge>//
- **[3fbd47b86](https://github.com/facebook/react/commit/3fbd47b86 )**: Serialize pending server components by reference (lazy component) ([#20137](https://github.com/facebook/react/pull/20137)) //<Sebastian Markbåge>//
- **[930ce7c15](https://github.com/facebook/react/commit/930ce7c15 )**: Allow values to be encoded by "reference" to a value rather than the value itself ([#20136](https://github.com/facebook/react/pull/20136)) //<Sebastian Markbåge>//
- **[39eb6d176](https://github.com/facebook/react/commit/39eb6d176 )**: Rename ([#20134](https://github.com/facebook/react/pull/20134)) //<Sebastian Markbåge>//
- **[ffd842335](https://github.com/facebook/react/commit/ffd842335 )**: [Flight] Add support for Module References in transport protocol ([#20121](https://github.com/facebook/react/pull/20121)) //<Sebastian Markbåge>//
- **[343d7a4a7](https://github.com/facebook/react/commit/343d7a4a7 )**: Fast Refresh: Don't block DevTools commit hook ([#20129](https://github.com/facebook/react/pull/20129)) //<Brian Vaughn>//
- **[779a472b0](https://github.com/facebook/react/commit/779a472b0 )**: Prevent inlining into recursive commit functions ([#20105](https://github.com/facebook/react/pull/20105)) //<Andrew Clark>//
- **[25b18d31c](https://github.com/facebook/react/commit/25b18d31c )**: Traverse commit phase effects iteratively ([#20094](https://github.com/facebook/react/pull/20094)) //<Andrew Clark>//

Changelog:
[General][Changed] - React Native sync for revisions 4e5d7fa...454c221

Reviewed By: rickhanlonii

Differential Revision: D24698701

fbshipit-source-id: dfaf692b1051150355dece1657764a484b7ae603
2020-11-09 14:30:50 -08:00
Lulu Wu 8e956b3afd Back out "Change StatusBar default style handling strategy"
Summary:
Original commit changeset: 76e7d0d45fd3

Changelog: [Internal]

Reviewed By: makovkastar

Differential Revision: D24783092

fbshipit-source-id: 876eaeaffbed63599553456f189f3675aa406e13
2020-11-09 07:24:22 -08:00
Paige Sun 017bc91192 Log prefetched image's view controller moduleName and GraphQL queryRootName
Reviewed By: fkgozali, rubennorte

Differential Revision: D24683194

fbshipit-source-id: 5a3f37123c0d9f6f40124e131212e6bf190193cc
2020-11-07 02:23:54 -08:00
Lulu Wu 7324b92dc4 Change StatusBar default style handling strategy
Summary:
Changelog: [Android] - Change StatusBar style handling strategy

Previously Android status bar can set to `dark-content` or `default`, I made the following changes:

- Added `light-content` to get align with iOS
- Changed the behavior of `default` from setting status bar with 'SYSTEM_UI_FLAG_LIGHT_STATUS_BAR' to not doing anything, I did this because 1, `setStyle('default')` is found called even without explicitly declared <StatusBar> on that surface, which I think should fail silently 2, my idea is that user should set status bar style to `dark-content` or `light-content` explicitly instead of using `default`.
- Fixed the bug found in Dating Settings's Second Look.

Reviewed By: RSNara

Differential Revision: D24714152

fbshipit-source-id: 76e7d0d45fd3b8c3733efaee81426f5f449cc7d8
2020-11-04 12:48:50 -08:00
Paige Sun e37708dfb6 Allow image loaders to enable/disable image telemetry
Summary:
When shouldEnableLoggingForRequestUrl is false, ImageTelemetry is not initialized, and no logging is done.

* Replace `- (NSString *)loaderModuleNameForRequestUrl:(NSURL *)url` with `- (BOOL)shouldEnableLoggingForRequestUrl:(NSURL *)url`
* Rename RCTImageLoaderInstrumentableProtocol.h -> RCTImageLoaderLoggableProtocol.h

Reviewed By: fkgozali

Differential Revision: D24523984

fbshipit-source-id: a5463eceea1c40f9452b0ad2ee6bf047f71a02c1
2020-10-29 21:59:59 -07:00
Rubén Norte 697d7610ab Annotate usedReactFabric in TTRC
Summary:
Adds an annotation in the performance logger that indicates if the component was rendered using Fabric or not.

Changelog: [internal]

Reviewed By: JoshuaGross, ShikaSD

Differential Revision: D24596131

fbshipit-source-id: 489f3a03f09c5425c870678ed593ee8f16a2d98b
2020-10-28 18:45:44 -07:00
Christoph Nakazawa a6825e590a Clean up `symbolicateStackTrace`
Summary:
This diff cleans up a bunch of code in `symbolicateStackTrace`. According to motiz88 all of it is dead code and I can confirm symbolication does not break with the changes applied.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D24585849

fbshipit-source-id: 5b2c76f56dbbbf27449ce1472cdd0271ed230c35
2020-10-28 03:00:00 -07:00
Oleksandr Melnykov 3ea899f3fb Pass segment hash from JS to Java
Summary: Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D24333057

fbshipit-source-id: cb65ae0c21a4b425ea8fd462e8a42910cf3f8507
2020-10-27 10:13:02 -07:00
Joshua Gross 3ddba567a8 Animated module: don't use random IDs as waiting identifier for queueing
Summary:
In D24521951 (2ff1d4c041) I refactored the JS-side queueing for NativeAnimated API calls, and used randomized IDs for queueing. This could cause bugs or unexpected behavior, and potentially crashes, if there's ever a collision in random numbers generated or
a collision between random number and one of the deterministic numbers generated in createAnimatedComponent.

In this diff I make both of them namespaced with a string, and deterministic, to eliminate any potential collisions. This could also be slightly faster (but not meaningfully) since we're not relying on Math.random.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D24553557

fbshipit-source-id: 8b765e21597ad4f8e641453c1f9f90bdf1ee022f
2020-10-26 22:14:25 -07:00
Kevin Gozali f760f90f1e Codegen BUCK: define codegen entrypoint under react-native-github/Libraries/ for core modules
Summary:
This defines a separate codegen entrypoint for the entire react-native repo, picking up all JS files under Libraries/ subdir. Buck can then build the codegen library targets. This is a pre-req for removing the checked in Java spec files for NativeModules.

Changelog: [Internal]

Reviewed By: RSNara

Differential Revision: D24518569

fbshipit-source-id: 2ece53c7274698e2431a00e590fad213e3a0bece
2020-10-26 22:02:05 -07:00
Tim Yung dd2a9af69b Text: Setup Rewrite Experiment
Summary:
Prepares for production experimentation of a reimplementation of the `Text` component that uses `Pressability` and React Hooks.

After I validate the new experimental implementation of `Text`, I will revert these changes and replace `Text.js` with the new implementation.

Changelog:
[Internal]

Reviewed By: nadiia, kacieb

Differential Revision: D24490569

fbshipit-source-id: 1ee4af72fcbda1b1d283a81c6bdf3fe67aa17e73
2020-10-26 21:19:25 -07:00
Rick Hanlon 24bca492c3 Update React Native to React 17.0.0
Summary:
This sync includes the following changes:
- **[eaaf4cbce](https://github.com/facebook/react/commit/eaaf4cbce )**: 17.0.1 //<Dan Abramov>//
- **[6f62abb58](https://github.com/facebook/react/commit/6f62abb58 )**: Remove usage of Array#fill ([#20071](https://github.com/facebook/react/pull/20071)) //<Dan Abramov>//
- **[40cfe1f48](https://github.com/facebook/react/commit/40cfe1f48 )**: Update CHANGELOG.md //<Dan Abramov>//
- **[f021a983a](https://github.com/facebook/react/commit/f021a983a )**: Bump versions for 17 ([#20062](https://github.com/facebook/react/pull/20062)) //<Dan Abramov>//
- **[d1bb4d851](https://github.com/facebook/react/commit/d1bb4d851 )**: Profiler: Include ref callbacks in onCommit duration ([#20060](https://github.com/facebook/react/pull/20060)) //<Brian Vaughn>//
- **[c59c3dfe5](https://github.com/facebook/react/commit/c59c3dfe5 )**: useRef: Warn about reading or writing mutable values during render ([#18545](https://github.com/facebook/react/pull/18545)) //<Brian Vaughn>//
- **[7b6cac952](https://github.com/facebook/react/commit/7b6cac952 )**: Improved Profiler commit hooks test ([#20053](https://github.com/facebook/react/pull/20053)) //<Brian Vaughn>//
- **[dfb6a4033](https://github.com/facebook/react/commit/dfb6a4033 )**: [Fast Refresh] Fix crashes caused by rogue Proxies ([#20030](https://github.com/facebook/react/pull/20030)) ([#20039](https://github.com/facebook/react/pull/20039)) //<Kai Riemann>//
- **[37cb732c5](https://github.com/facebook/react/commit/37cb732c5 )**: Use bitwise OR to define flag masks ([#20044](https://github.com/facebook/react/pull/20044)) //<Andrew Clark>//
- **[eb3181e77](https://github.com/facebook/react/commit/eb3181e77 )**: Add Visibility flag for hiding/unhiding trees ([#20043](https://github.com/facebook/react/pull/20043)) //<Andrew Clark>//
- **[0dd809bdf](https://github.com/facebook/react/commit/0dd809bdf )**: Remove last schedulePassiveEffectCallback call ([#20042](https://github.com/facebook/react/pull/20042)) //<Andrew Clark>//
- **[8df7b7911](https://github.com/facebook/react/commit/8df7b7911 )**: Remove Passive flag from "before mutation" phase ([#20038](https://github.com/facebook/react/pull/20038)) //<Andrew Clark>//
- **[c57fe4a2c](https://github.com/facebook/react/commit/c57fe4a2c )**: ReactIs.isValidElementType Unit Test extended with PureComponent case ([#20033](https://github.com/facebook/react/pull/20033)) //<adasq>//
- **[02da938fd](https://github.com/facebook/react/commit/02da938fd )**: Don't double-invoke effects in legacy roots ([#20028](https://github.com/facebook/react/pull/20028)) //<Brian Vaughn>//
- **[d95c4938d](https://github.com/facebook/react/commit/d95c4938d )**: [EventSystem] Revise onBeforeBlur propagation mechanics ([#20020](https://github.com/facebook/react/pull/20020)) //<Dominic Gannaway>//
- **[f46a80ae1](https://github.com/facebook/react/commit/f46a80ae1 )**: Update outdated links and fix two broken links  ([#19985](https://github.com/facebook/react/pull/19985)) //<Saikat Guha>//
- **[0a4c7c565](https://github.com/facebook/react/commit/0a4c7c565 )**: [Flight] Don't warn for key, but error for ref ([#19986](https://github.com/facebook/react/pull/19986)) //<Sebastian Markbåge>//
- **[993ca533b](https://github.com/facebook/react/commit/993ca533b )**: Enable eager listeners statically ([#19983](https://github.com/facebook/react/pull/19983)) //<Dan Abramov>//
- **[40c52de96](https://github.com/facebook/react/commit/40c52de96 )**: [Flight] Add Runtime Errors for Non-serializable Values ([#19980](https://github.com/facebook/react/pull/19980)) //<Sebastian Markbåge>//
- **[1992d9730](https://github.com/facebook/react/commit/1992d9730 )**: Revert "Temporarily disable Profiler commit hooks flag ([#19900](https://github.com/facebook/react/pull/19900))" ([#19960](https://github.com/facebook/react/pull/19960)) //<Brian Vaughn>//
- **[44d39c4d7](https://github.com/facebook/react/commit/44d39c4d7 )**: Removed skip-error-boundaries modifications from old fork ([#19961](https://github.com/facebook/react/pull/19961)) //<Brian Vaughn>//
- **[cc77be957](https://github.com/facebook/react/commit/cc77be957 )**: Remove unnecessary error overriding in ([#19949](https://github.com/facebook/react/pull/19949)) //<Paul Doyle>//
- **[97625272a](https://github.com/facebook/react/commit/97625272a )**: Debug tracing tests for CPU bound suspense ([#19943](https://github.com/facebook/react/pull/19943)) //<Brian Vaughn>//
- **[43363e279](https://github.com/facebook/react/commit/43363e279 )**: Fix codestyle for typeof comparison ([#19928](https://github.com/facebook/react/pull/19928)) //<Eugene Maslovich>//
- **[5427b4657](https://github.com/facebook/react/commit/5427b4657 )**: Temporarily disable Profiler commit hooks flag ([#19900](https://github.com/facebook/react/pull/19900)) //<Brian Vaughn>//
- **[1faf9e3dd](https://github.com/facebook/react/commit/1faf9e3dd )**: Suspense for CPU-bound trees ([#19936](https://github.com/facebook/react/pull/19936)) //<Andrew Clark>//
- **[7f08e908b](https://github.com/facebook/react/commit/7f08e908b )**: Fix missing context to componentDidMount() when double-invoking lifecycles ([#19935](https://github.com/facebook/react/pull/19935)) //<Brian Vaughn>//
- **[9198a5cec](https://github.com/facebook/react/commit/9198a5cec )**: Refactor layout effect methods ([#19895](https://github.com/facebook/react/pull/19895)) //<Brian Vaughn>//
- **[ba82eea38](https://github.com/facebook/react/commit/ba82eea38 )**: Remove disableSchedulerTimeoutInWorkLoop flag ([#19902](https://github.com/facebook/react/pull/19902)) //<Andrew Clark>//
- **[c63741fb3](https://github.com/facebook/react/commit/c63741fb3 )**: offscreen double invoke effects ([#19523](https://github.com/facebook/react/pull/19523)) //<Luna Ruan>//
- **[c6917346f](https://github.com/facebook/react/commit/c6917346f )**: Fixed broken Profiler test ([#19894](https://github.com/facebook/react/pull/19894)) //<Brian Vaughn>//
- **[87c023b1c](https://github.com/facebook/react/commit/87c023b1c )**: Profiler onRender only called when we do work ([#19885](https://github.com/facebook/react/pull/19885)) //<Brian Vaughn>//
- **[81aaee56a](https://github.com/facebook/react/commit/81aaee56a )**: Don't call onCommit et al if there are no effects ([#19863](https://github.com/facebook/react/pull/19863)) //<Andrew Clark>//
- **[7355bf575](https://github.com/facebook/react/commit/7355bf575 )**: Consolidate commit phase hook functions ([#19864](https://github.com/facebook/react/pull/19864)) //<Andrew Clark>//
- **[bc6b7b6b1](https://github.com/facebook/react/commit/bc6b7b6b1 )**: Don't trigger lazy in DEV during element creation ([#19871](https://github.com/facebook/react/pull/19871)) //<Dan Abramov>//
- **[a774502e0](https://github.com/facebook/react/commit/a774502e0 )**: Use single quotes in getComponentName return ([#19873](https://github.com/facebook/react/pull/19873)) //<Gustavo Saiani>//
- **[8b2d3783e](https://github.com/facebook/react/commit/8b2d3783e )**: Use Passive flag to schedule onPostCommit ([#19862](https://github.com/facebook/react/pull/19862)) //<Andrew Clark>//
- **[50d9451f3](https://github.com/facebook/react/commit/50d9451f3 )**: Improve DevTools editing interface ([#19774](https://github.com/facebook/react/pull/19774)) //<Brian Vaughn>//
- **[6fddca27e](https://github.com/facebook/react/commit/6fddca27e )**: Remove passive intervention flag ([#19849](https://github.com/facebook/react/pull/19849)) //<Dan Abramov>//
- **[36df9185c](https://github.com/facebook/react/commit/36df9185c )**: chore(docs): Removed outdated comment about fb.me link  ([#19830](https://github.com/facebook/react/pull/19830)) //<Adnaan Bheda>//
- **[16fb2b6f9](https://github.com/facebook/react/commit/16fb2b6f9 )**: Moved resetChildLanes into complete work ([#19836](https://github.com/facebook/react/pull/19836)) //<Brian Vaughn>//
- **[cc581065d](https://github.com/facebook/react/commit/cc581065d )**: eslint-plugin-react-hooks@4.1.2 //<Dan Abramov>//
- **[0044805c8](https://github.com/facebook/react/commit/0044805c8 )**: Update CHANGELOG.md //<Dan Abramov>//
- **[0f70d4dd6](https://github.com/facebook/react/commit/0f70d4dd6 )**: Consider components in jsx as missing dependencies in typescript-eslint/parser@4.x ([#19815](https://github.com/facebook/react/pull/19815)) //<Sebastian Silbermann>//
- **[84558c61b](https://github.com/facebook/react/commit/84558c61b )**: Don't visit passive effects during layout phase ([#19809](https://github.com/facebook/react/pull/19809)) //<Andrew Clark>//
- **[ad8a0a8cd](https://github.com/facebook/react/commit/ad8a0a8cd )**: eslint-plugin-react-hooks@4.1.1 //<Dan Abramov>//
- **[77544a0d6](https://github.com/facebook/react/commit/77544a0d6 )**: Update CHANGELOG.md //<Dan Abramov>//
- **[ed4fdfc73](https://github.com/facebook/react/commit/ed4fdfc73 )**: test(eslint-plugin-react-hooks): Run with TS parsers >= 2.x ([#19792](https://github.com/facebook/react/pull/19792)) //<Sebastian Silbermann>//
- **[cd75f93c0](https://github.com/facebook/react/commit/cd75f93c0 )**: eslint-plugin-react-hooks: fix compatibility with typescript-eslint/parser@4.0.0+ ([#19751](https://github.com/facebook/react/pull/19751)) //<Matthias Schiffer>//
- **[781212aab](https://github.com/facebook/react/commit/781212aab )**: Remove double space in test name ([#19762](https://github.com/facebook/react/pull/19762)) //<Gustavo Saiani>//
- **[e7b255341](https://github.com/facebook/react/commit/e7b255341 )**: Internal `act`: Flush timers at end of scope ([#19788](https://github.com/facebook/react/pull/19788)) //<Andrew Clark>//
- **[d17086c7c](https://github.com/facebook/react/commit/d17086c7c )**: Decouple public, internal act implementation ([#19745](https://github.com/facebook/react/pull/19745)) //<Andrew Clark>//
- **[d38ec17b1](https://github.com/facebook/react/commit/d38ec17b1 )**: [Flight] Set dispatcher for duration of performWork() ([#19776](https://github.com/facebook/react/pull/19776)) //<Joseph Savona>//
- **[4f3f7eeb7](https://github.com/facebook/react/commit/4f3f7eeb7 )**: Bugfix: Effect clean up when deleting suspended tree ([#19752](https://github.com/facebook/react/pull/19752)) //<Andrew Clark>//
- **[7baf9d412](https://github.com/facebook/react/commit/7baf9d412 )**: Combine Flags and SubtreeFlags types ([#19775](https://github.com/facebook/react/pull/19775)) //<Andrew Clark>//
- **[166544360](https://github.com/facebook/react/commit/166544360 )**: Rename effect fields ([#19755](https://github.com/facebook/react/pull/19755)) //<Andrew Clark>//
- **[708fa77a7](https://github.com/facebook/react/commit/708fa77a7 )**: Decrease expiration time of input updates ([#19772](https://github.com/facebook/react/pull/19772)) //<Andrew Clark>//
- **[36df483af](https://github.com/facebook/react/commit/36df483af )**: Add feature flag to disable scheduler timeout in work loop ([#19771](https://github.com/facebook/react/pull/19771)) //<Ricky>//
- **[bcc0aa463](https://github.com/facebook/react/commit/bcc0aa463 )**: Revert "Revert "Remove onScroll bubbling flag ([#19535](https://github.com/facebook/react/pull/19535))" ([#19655](https://github.com/facebook/react/pull/19655))" ([#19761](https://github.com/facebook/react/pull/19761)) //<Dan Abramov>//
- **[99cae887f](https://github.com/facebook/react/commit/99cae887f )**: Add failing test for passive effect cleanup functions and memoized components ([#19750](https://github.com/facebook/react/pull/19750)) //<Brian Vaughn>//
- **[2cfd73c4d](https://github.com/facebook/react/commit/2cfd73c4d )**: Fix typo in comment (Noticable→Noticeable) ([#19737](https://github.com/facebook/react/pull/19737)) //<Ikko Ashimine>//
- **[53e622ca7](https://github.com/facebook/react/commit/53e622ca7 )**: Fix instances of function declaration after return ([#19733](https://github.com/facebook/react/pull/19733)) //<Bhumij Gupta>//
- **[b7d18c4da](https://github.com/facebook/react/commit/b7d18c4da )**: Support Babel's envName option in React Refresh plugin ([#19009](https://github.com/facebook/react/pull/19009)) //<Kevin Weber>//
- **[1f38dcff6](https://github.com/facebook/react/commit/1f38dcff6 )**: Remove withSuspenseConfig ([#19724](https://github.com/facebook/react/pull/19724)) //<Andrew Clark>//
- **[1396e4a8f](https://github.com/facebook/react/commit/1396e4a8f )**: Fixes eslint warning when node type is ChainExpression ([#19680](https://github.com/facebook/react/pull/19680)) //<Pascal Fong Kye>//
- **[a8500be89](https://github.com/facebook/react/commit/a8500be89 )**: Add `startTransition` as a known stable method ([#19720](https://github.com/facebook/react/pull/19720)) //<Andrew Clark>//
- **[380dc95de](https://github.com/facebook/react/commit/380dc95de )**: Revert "Append text string to <Text> error message ([#19581](https://github.com/facebook/react/pull/19581))" ([#19723](https://github.com/facebook/react/pull/19723)) //<Timothy Yung>//
- **[ddd1faa19](https://github.com/facebook/react/commit/ddd1faa19 )**: Remove config argument from useTransition ([#19719](https://github.com/facebook/react/pull/19719)) //<Andrew Clark>//
- **[92fcd46cc](https://github.com/facebook/react/commit/92fcd46cc )**: Replace SuspenseConfig object with an integer ([#19706](https://github.com/facebook/react/pull/19706)) //<Andrew Clark>//
- **[b754caaaf](https://github.com/facebook/react/commit/b754caaaf )**: Enable eager listeners in open source ([#19716](https://github.com/facebook/react/pull/19716)) //<Dan Abramov>//
- **[c1ac05215](https://github.com/facebook/react/commit/c1ac05215 )**: [Flight] Support more element types and Hooks for Server and Hybrid Components ([#19711](https://github.com/facebook/react/pull/19711)) //<Dan Abramov>//
- **[1eaafc9ad](https://github.com/facebook/react/commit/1eaafc9ad )**: Clean up timeoutMs-related implementation details ([#19704](https://github.com/facebook/react/pull/19704)) //<Andrew Clark>//
- **[8da0da093](https://github.com/facebook/react/commit/8da0da093 )**: Disable timeoutMs argument ([#19703](https://github.com/facebook/react/pull/19703)) //<Andrew Clark>//
- **[60ba723bf](https://github.com/facebook/react/commit/60ba723bf )**: Add SuspenseList to devTools ([#19684](https://github.com/facebook/react/pull/19684)) //<Ben Pernick>//
- **[5564f2c95](https://github.com/facebook/react/commit/5564f2c95 )**: Add React.startTransition ([#19696](https://github.com/facebook/react/pull/19696)) //<Ricky>//
- **[c4e0768d7](https://github.com/facebook/react/commit/c4e0768d7 )**: Remove unused argument from `finishConcurrentRender` ([#19689](https://github.com/facebook/react/pull/19689)) //<inottn>//
- **[848bb2426](https://github.com/facebook/react/commit/848bb2426 )**: Attach Listeners Eagerly to Roots and Portal Containers ([#19659](https://github.com/facebook/react/pull/19659)) //<Dan Abramov>//
- **[d2e914ab4](https://github.com/facebook/react/commit/d2e914ab4 )**: Remove remaining references to effect list ([#19673](https://github.com/facebook/react/pull/19673)) //<Andrew Clark>//
- **[d6e433899](https://github.com/facebook/react/commit/d6e433899 )**: Use Global Render Timeout for CPU Suspense ([#19643](https://github.com/facebook/react/pull/19643)) //<Sebastian Markbåge>//
- **[64ddef44c](https://github.com/facebook/react/commit/64ddef44c )**: Revert "Remove onScroll bubbling flag ([#19535](https://github.com/facebook/react/pull/19535))" ([#19655](https://github.com/facebook/react/pull/19655)) //<Dan Abramov>//
- **[dd651df05](https://github.com/facebook/react/commit/dd651df05 )**: Keep onTouchStart, onTouchMove, and onWheel passive ([#19654](https://github.com/facebook/react/pull/19654)) //<Dan Abramov>//
- **[b8fa09e9e](https://github.com/facebook/react/commit/b8fa09e9e )**: provide profiling bundle for react-reconciler ([#19559](https://github.com/facebook/react/pull/19559)) //<Julien Gilli>//
- **[23595ff59](https://github.com/facebook/react/commit/23595ff59 )**: Add missing param to safelyCallDestroy() ([#19638](https://github.com/facebook/react/pull/19638)) //<Brian Vaughn>//
- **[ee409ea3b](https://github.com/facebook/react/commit/ee409ea3b )**: change destroy to safelyCallDestroy ([#19605](https://github.com/facebook/react/pull/19605)) //<Luna Ruan>//
- **[bcca5a6ca](https://github.com/facebook/react/commit/bcca5a6ca )**: Always skip unmounted/unmounting error boundaries ([#19627](https://github.com/facebook/react/pull/19627)) //<Brian Vaughn>//
- **[1a41a196b](https://github.com/facebook/react/commit/1a41a196b )**: Append text string to <Text> error message ([#19581](https://github.com/facebook/react/pull/19581)) //<Timothy Yung>//
- **[e4afb2fdd](https://github.com/facebook/react/commit/e4afb2fdd )**: eslint-plugin-react-hooks@4.1.0 //<Dan Abramov>//
- **[ced05c46c](https://github.com/facebook/react/commit/ced05c46c )**: Update CHANGELOG.md //<Dan Abramov>//
- **[702fad4b1](https://github.com/facebook/react/commit/702fad4b1 )**: refactor fb.me redirect link to reactjs.org/link ([#19598](https://github.com/facebook/react/pull/19598)) //<CY Lim>//
- **[49cd77d24](https://github.com/facebook/react/commit/49cd77d24 )**: fix: leak strict mode with UMD builds ([#19614](https://github.com/facebook/react/pull/19614)) //<Toru Kobayashi>//
- **[ffb749c95](https://github.com/facebook/react/commit/ffb749c95 )**: Improve error boundary handling for unmounted subtrees ([#19542](https://github.com/facebook/react/pull/19542)) //<Brian Vaughn>//
- **[9b35dd2fc](https://github.com/facebook/react/commit/9b35dd2fc )**: Permanently removed component stacks from scheduling profiler data ([#19615](https://github.com/facebook/react/pull/19615)) //<Brian Vaughn>//
- **[3f8115cdd](https://github.com/facebook/react/commit/3f8115cdd )**: Remove `didTimeout` check from work loop //<Andrew Clark>//
- **[9abc2785c](https://github.com/facebook/react/commit/9abc2785c )**: Remove wasteful checks from `shouldYield` //<Andrew Clark>//
- **[1d5e10f70](https://github.com/facebook/react/commit/1d5e10f70 )**: [eslint-plugin-react-hooks] Report constant constructions ([#19590](https://github.com/facebook/react/pull/19590)) //<Jordan Eldredge>//
- **[dab0854c5](https://github.com/facebook/react/commit/dab0854c5 )**: Move commit passive unmount/mount to CommitWork ([#19599](https://github.com/facebook/react/pull/19599)) //<Sebastian Markbåge>//
- **[ccb6c3945](https://github.com/facebook/react/commit/ccb6c3945 )**: Remove unused argument ([#19600](https://github.com/facebook/react/pull/19600)) //<inottn>//
- **[629125555](https://github.com/facebook/react/commit/629125555 )**: [Scheduler] Re-throw unhandled errors ([#19595](https://github.com/facebook/react/pull/19595)) //<Andrew Clark>//
- **[b8ed6a1aa](https://github.com/facebook/react/commit/b8ed6a1aa )**: [Scheduler] Call postTask directly ([#19551](https://github.com/facebook/react/pull/19551)) //<Andrew Clark>//
- **[ce37bfad5](https://github.com/facebook/react/commit/ce37bfad5 )**: Remove resolutions from test renderer package.json ([#19577](https://github.com/facebook/react/pull/19577)) //<Dan Abramov>//
- **[2704bb537](https://github.com/facebook/react/commit/2704bb537 )**: Add ReactVersion to SchedulingProfiler render scheduled marks ([#19553](https://github.com/facebook/react/pull/19553)) //<Kartik Choudhary>//
- **[0c52e24cb](https://github.com/facebook/react/commit/0c52e24cb )**: Support inner component _debugOwner in memo ([#19556](https://github.com/facebook/react/pull/19556)) //<Brian Vaughn>//
- **[0cd9a6de5](https://github.com/facebook/react/commit/0cd9a6de5 )**: Parallelize Jest in CI ([#19552](https://github.com/facebook/react/pull/19552)) //<Andrew Clark>//
- **[a63893ff3](https://github.com/facebook/react/commit/a63893ff3 )**: Warn about undefined return value for memo and forwardRef ([#19550](https://github.com/facebook/react/pull/19550)) //<Brian Vaughn>//
- **[32ff42868](https://github.com/facebook/react/commit/32ff42868 )**: Add feature flag for setting update lane priority ([#19401](https://github.com/facebook/react/pull/19401)) //<Ricky>//
- **[5bdd4c8c6](https://github.com/facebook/react/commit/5bdd4c8c6 )**: Remove unused argument from call to jest method ([#19546](https://github.com/facebook/react/pull/19546)) //<Gustavo Saiani>//
- **[a5fed98a9](https://github.com/facebook/react/commit/a5fed98a9 )**: Register more node types that are used later as JSXIdentifiers ([#19514](https://github.com/facebook/react/pull/19514)) //<Mateusz Burzyński>//
- **[f77c7b9d7](https://github.com/facebook/react/commit/f77c7b9d7 )**: Re-add discrete flushing timeStamp heuristic (behind flag) ([#19540](https://github.com/facebook/react/pull/19540)) //<Dominic Gannaway>//

Changelog: [general] [feature] Upgrade to React 17

Reviewed By: cpojer

Differential Revision: D24491201

fbshipit-source-id: c947da9dcccbd614e9dc58f3339b63e24829aca7
2020-10-26 20:28:00 -07:00
simek 6c21f15d71 Lint: fix few "no-unused-var" warnings for imports (#30157)
Summary:
This small PR fixes few "no-unused-var" issues and  and removes two old entries for no longer existing files from the `.eslintignore`.

## Changelog

[Internal] [Fixed] - Lint: fix few "no-unused-var" warnings for imports

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

Test Plan: Successfully run of `yarn lint` script. Warnings count has been reduced from `61` to `58`.

Reviewed By: yungsters

Differential Revision: D24288226

Pulled By: appden

fbshipit-source-id: 06e4ef015a331e3f2eac3b9aa6f757a3764e3ed9
2020-10-26 17:19:14 -07:00
Ramanpreet Nara 09d4cb7b9f Remove @react-native/codegen lint ignores
Summary:
There's no reason for us to have lint ignores for `react-native/codegen/react-native-modules`. This diff removes all such ignores. I'll address any actual problems with the specs in subsequent diffs.

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D24529238

fbshipit-source-id: bbd2f4fb5dace65d803a8f93bd0d9a1c5a1cfb34
2020-10-26 16:23:03 -07:00
Joshua Gross 2ff1d4c041 Fix NativeAnimated queueing
Summary:
I believe the old method of queueing these operations for Fabric is causing crashes because "connectNode" is on a separate JS queue from setting up nodes.

In hindsight, this seems silly. We must ensure that nodes are created before they're connected, and we weren't doing that?

Using a single queue is conceptually simpler, should be easier to reason about, and should fix some crashes.

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D24521951

fbshipit-source-id: f6c38ac0023faa28414063d8b96daf32ba95524d
2020-10-24 00:02:21 -07:00
Paige Sun edb6fa7979 Synchronize RCTImageLoader loaders initialization
Summary:
The method `imageURLLoaderForURL` can be called from multiple threads. This adds a mutex to make sure that _loaders is initialized with a non-nil value only once.

We'll only lock this mutex at one point in time as long as `_loadersProvider()` gives a value, so the mutex doesn't affect performance.

Changelog: [iOS][Fixed] Synchronize RCTImageLoader loaders initialization

Reviewed By: fkgozali

Differential Revision: D24513083

fbshipit-source-id: b89ef8a82729eda508162b01f7fdaa8a291f40d0
2020-10-23 19:12:53 -07:00
Rubén Norte 74fc285c58 Allow specifying custom timestamps in performance logger spans
Summary: Changelog: [internal] Allow specifying custom timestamps in {start/stop}Timestamp in performance loggers

Reviewed By: lunaleaps

Differential Revision: D24474631

fbshipit-source-id: 48d8e69af8ba79ef1638cd5d03bac33af84f7881
2020-10-23 07:14:59 -07:00
Rubén Norte 5c498e3d6b Migrate createPerformanceLogger to ESM and export getCurrentTimestamp
Summary: Changelog: [internal]

Reviewed By: lunaleaps

Differential Revision: D24476172

fbshipit-source-id: 5afa58935a6a3a8e1d2d0d0bb8b3b28840fc17f4
2020-10-23 07:14:59 -07:00
Samuel Susla 6eed1e4f80 Remove iOS gating to fix sticky header
Summary:
Changelog: [internal]

The comment talks about jankiness which isn't there anymore.
Not setting translateY breaks Fabric's measure infra.

Reviewed By: JoshuaGross

Differential Revision: D24482016

fbshipit-source-id: 8188caa5bee5b8d2b1e686b289f5fd1ccc9e4a65
2020-10-23 04:22:31 -07:00
Tim Yung a911efaecd Text: Refine Exported Flow Type
Summary:
Refines the exported type of `Text` so that it is more accurate.

Instead of `HostComponent<TextProps>` (which is not exactly accurate), we use the recently introduced types: `NativText` and `NativeVirtualText`.

Changelog:
[Changed][General] - Refined Flow type for `Text` component.

Reviewed By: nadiia

Differential Revision: D24486720

fbshipit-source-id: fad114fd14335933ebc2f7430d7b8b7838b6b523
2020-10-22 20:01:39 -07:00
Héctor Ramos 9218e0c2e6 iOS: Generate FBReactNativeSpec ObjC++ files at build time
Summary:
Removes the generated FBReactNativeSpec files from source control.

## Generating FBReactNativeSpec files

The files will be generated automatically by CocoaPods when the `RNTesterPods` Xcode workspace is generated:

```
cd packages/rn-tester
pod install
```

The spec files can be re-generated by invoking the script directly:
```
./scripts/generate-native-modules-specs.sh
```

Changelog: [Internal]

Reviewed By: RSNara

Differential Revision: D24261167

fbshipit-source-id: acb7ac856e5e519932e4f587f79e24f49cd84a91
2020-10-21 20:47:09 -07:00
Hugo Cuvillier 403d6f4401 Migrate remaining call sites to `CKOverlayLayoutComponent` to Builder
Summary:
Ditto

Changelog: [Internal]

Reviewed By: aCorrado

Differential Revision: D24395872

fbshipit-source-id: 38260ed7ce154036d8e40493cfe81506cf3054e8
2020-10-20 05:58:21 -07:00
Xuan Huang 0a28b34dac Conditionalize Promise Polyfill for Hermes
Summary:
On Hermes, RN can directly use the Promise from global w/o the need of polyfilling it.

PromiseRejectionTrackingOptions are extracted to its own file so it can be shared by
both codepaths and preserve the behaviors that it's only imported on dev.
Some zero-overhead type gymnastics are used to flow-type it properly.

Changelog:
[General] - made promise polyfill conditionalized on Hermes

Reviewed By: cpojer

Differential Revision: D24068716

fbshipit-source-id: 3e0b1675493908324f27cc5b7300d8cc42a03acc
2020-10-19 15:24:38 -07:00
Pieter Vanderwerff 500bdf74d2 Deploy Flow v0.136.0
Summary: Changelog: [Internal]

Reviewed By: dsainati1

Differential Revision: D24364950

fbshipit-source-id: 42a81b155d803c3580cfac7d56c98f93a310d0fc
2020-10-18 20:30:55 -07:00
Kevin Gozali 76098831fd Codegen: exclude NativeModules that are not for the specific platform
Summary:
If a native module schema has `excludedPlatforms` defined, honor it and skip the module that doesn't belong to the platform.

E.g. NativeImagePickerIOS shouldn't generate anything for Android codegen output.
Similarly, IntentAndroid shouldn't generate anything for iOS codegen output.

Changelog: [Internal]

Reviewed By: RSNara

Differential Revision: D24373092

fbshipit-source-id: cfeb455a18c92f60191d988af2e9ce7ea5021304
2020-10-17 02:45:48 -07:00
Dmytro Voronkevych 213b02b378 Adding support for boolean annotations for UserFlow@RN
Summary: Adding support for boolean annotation in UserFlow API.

Reviewed By: cdinh

Differential Revision: D24337853

fbshipit-source-id: 52ed295c64a5650afbb02890f918939fb9d020d6
2020-10-16 11:32:22 -07:00
Dmytro Voronkevych 1bbe40ae0b Adding pointData support to UserFlow
Summary:
Adding support to the pointData to Android React Native
Changelog: [internal]

Reviewed By: swillard13

Differential Revision: D24256346

fbshipit-source-id: b970f771047cff580d9ebe7d6e2ad737394d6416
2020-10-16 11:32:22 -07:00
Ramanpreet Nara c4f23354fd Update Module Generators to follow new NativeModuleSchema
Summary:
NOTE: Flow and Jest won't pass on this diff. Sandcastle, should, however, be green on D24236405 (i.e: the tip of this stack).

## Changes
1. NativeModule generators now use the new RN Codegen NativeModule schema.
2. Tangential: We're no longer removing the `Native` prefix from the NativeModule filename, assuming that that's the module name (problem: wrong), and prefixing again with Native (problem: redundant), when we're generating code. Instead, like the internal codegen, we simply pass the filename to the Codegen output. Our linters enforce that all NativeModule specs are contained with files that start off with `Native`.
3. `GenerateModuleCpp` was fixed to use the actual module name as opposed to the spec name. I added a comment inline.

Changelog: [Internal]

(Note: this ignores all push blocking failures!)

Reviewed By: PeteTheHeat

Differential Revision: D24236405

fbshipit-source-id: ccd6b5674d252c350be0ec8a86e7ca5f2f614778
2020-10-15 22:53:56 -07:00
Ramanpreet Nara b70152cdef Fix NativeLinking split
Summary:
In D24324247 (56c363e39a), I split NativeLinking into NativeLinkingManager and NativeIntentAndroid. There was this line in NativeLinking.js, that I didn't migrate correctly:

```
export default ((Platform.OS === 'android'
  ? TurboModuleRegistry.getEnforcing<Spec>('IntentAndroid')
  : TurboModuleRegistry.getEnforcing<Spec>('LinkingManager')): Spec);
```

I separated this conditional statement into two others:
```
export default TurboModuleRegistry.getEnforcing<Spec>('IntentAndroid');
export default TurboModuleRegistry.getEnforcing<Spec>('LinkingManager');
```

The problem here is that now on iOS, we're hard requiring IntentAndroid, and on Android, we're hard requiring LinkingManager. Understandably, this started throwing errors in our e2e infra. This diff fixes this problem by:
1. Changing the relevant `getEnforcing` calls into `get` calls.
2. Wrapping all usages of NativeIntentAndroid, and NativeLinkingManager, which are already guarded by `Platform.OS` checks, by a nullthrows. This should satisfy flow. **Note:** NativeIntentAndroid is only used on Android, where it must be available. Similarly, NativeLinkingManager is only used on iOS, where it must be available.

Changelog: [Internal]

build-break
overriding_review_checks_triggers_an_audit_and_retroactive_review

Oncall Short Name: fbandroid_sheriff

Differential Revision: D24338558

fbshipit-source-id: b0d22cba77e67837834269deaa317dc73d2457dc
2020-10-15 11:49:19 -07:00
Ramanpreet Nara 5a57a538c9 Split NativeAsyncStorage into NativeAsyncLocalStorage and NativeAsyncSQLiteDBStorage
Summary:
Although the interface for both NativeModules is the same, we'd like to enforce 1 `TurboModuleRegistry.get` call per NativeModule spec file. Therefore this diff splits the one spec into two.

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D24325260

fbshipit-source-id: f18718e4235b7b8ccbfc44a7e48571ecf483a36c
2020-10-15 08:49:28 -07:00
Ramanpreet Nara 56c363e39a Split NativeLinking into NativeIntentManager and NativeLinkingManager
Summary:
The iOS and Android NativeModules are very different. It's better to split the two interfaces, than to have one merged interface.

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D24324247

fbshipit-source-id: 097273829ffc719eff006ed2dde55f0dd6bd7d95
2020-10-15 08:49:28 -07:00
Ramanpreet Nara 20e7a40b9c Remove TVNavigationEventEmitter
Summary:
This NativeModule is actualy not used! Removing this now.

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D24324362

fbshipit-source-id: 1322c5e072961f1c6c54bfc6dbd562d42f9e5b3f
2020-10-15 08:49:28 -07:00
Ramanpreet Nara dabca52f77 Stop calling RCTNetworking.(add|remove)Listeners?
Summary:
RCTNetworking.startObserving and RCTNetworking.stopObserving don't exist. The main purpose of RCTEventEmitter.addListener is to call these methods, and increment the `_listeners` counter, so that we can start dispatching events when `_listeners > 0`. In D24272560, I made RCTEventEmitter dispatch events even when _listeners <= 0. This is sufficient for us to stop calling these two RCTNetworking methods entirely.

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D24272663

fbshipit-source-id: de9c968bc71e6e6d69a22b934644e6dfa3266b3f
2020-10-14 21:05:38 -07:00
Ramanpreet Nara 82187bfb6b Dispatch events even when there are no listeners
Summary:
## Rationale
For every 1 call to RCTNetworking.sendRequest, we execute 6 calls to RCTNetworking.addListener. This is followed by at least one call to RCTNetworking.removeListeners. Aside from incrementing and decrementing the `_listeners` integer, these two methods accomplish nothing else: RCTNetworking doesn't implement the `startObserving` and `stopObserving` methods.

This diff makes RCTEventEmitter dispatch events without looking at the listeners integer. In the future, this will allow us to stop making these ~8 unnecessary NativeModule calls for every Network request we send.

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D24272560

fbshipit-source-id: 7996eba5abfa4669a89c43a3ffa536c0faa214a8
2020-10-14 21:05:38 -07:00
Paige Sun cd6ebcdd82 Set MobileConfig for Fabric logging in FBReactModule
Summary: Changelog: [RN][iOS] Allow gate to be set for Fabric logging from the React Module

Reviewed By: fkgozali

Differential Revision: D24256546

fbshipit-source-id: 7b290efb9abd3035559f743e6e5b6701e02053e1
2020-10-14 03:15:19 -07:00
Lulu Wu ea93151f21 Make RCTEventDispatcher TurboModule-compatible
Summary:
This diff ended up being a bit more complicated than I anticipated, since the source files in `ReactInternal` were depending on `RCTEventDispatcher`. I made the following changes:
1. Make `RCTEventDispatcher` a `protocol`, keep it in `ReactInternal`.
2. Rename the `RCTEventDispatcher` NativeModule to `RCTEventDispatcherModule`, make it conform to the `RCTEventEmitter` `protocol`, and move it to `CoreModules`.
3. Where necessary, replace categories of `RCTEventDispatcher` with functions.

Changelog:
[iOS][Added] - Make RCTEventDispatcher TurboModule-comaptible

Reviewed By: fkgozali

Differential Revision: D18439488

fbshipit-source-id: b3da15c29459fddf884519f33b0c3b8c036b5539
2020-10-14 02:40:10 -07:00
Peter Argany 8f45db3b9e RCTPicker handwritten view config
Summary: This completes the Picker stack. Use a handwritten view config to avoid calling `requireNativeComponent` in Bridgeless mode.

Differential Revision: D23663596

fbshipit-source-id: 5d0811014fd6f66956803a1db5fee8fd1119d5bc
2020-10-13 11:19:30 -07:00
Peter Argany 3113e47b9b Remove type union in PickeriOS/PickerNativeComponent
Summary:
This builds on the last diff to remove type a type union from Picker. This diff focuses on Picker internals.

Changelog: [JS] Remove type union in PickeriOS/PickerNativeComponent

Reviewed By: sammy-SC

Differential Revision: D24254615

fbshipit-source-id: f788a2e123135c1e8b9909870c40f53b2dea0227
2020-10-13 11:19:29 -07:00
Peter Argany b05d90e8bb Remove type union in Picker.js
Summary:
Flow type unions don't play well with Fabric components. This diff removes a union in `Picker.js` and fixes all the flow errors.

Before this diff, all these surfaces would crash with the new Fabric Picker impl, because the impl asserts that this field is a string.

Reviewed By: sammy-SC

Differential Revision: D24236317

fbshipit-source-id: 6e646c84fcd16658aaabe5e93507f5f33b346a65
2020-10-13 11:19:29 -07:00
Luna Wei f9dec99284 Introduce multi-flush logger
Summary:
Changelog:
[Internal][Changed] - export types of performance logger

Reviewed By: rubennorte

Differential Revision: D24099293

fbshipit-source-id: 023459baa3754fb8bfaf6bf7a9061873af5756f9
2020-10-10 02:06:06 -07:00
Panagiotis Vekris 254d455103 Add type annotations to prevent issues with planned Flow changes
Summary:
We're planning a fix in Flow (D24112595) that uncovers some existing errors that were
previously suppressed. Adding these annotations prevents them from surfacing during the
deploy of the fix.

Changelog: [Internal]

Reviewed By: dsainati1

Differential Revision: D24147994

fbshipit-source-id: fef59a9427da6db79d4824e39768dd5ad0a8d1a3
2020-10-09 15:52:21 -07:00
Héctor Ramos b581bcaae0 TurboModule iOS: Use react-native-codegen FBReactNativeSpec output
Summary:
Use the ObjC++ native modules files generated by `react-native-codegen` for the FBReactNativeSpec library.

People working with the core native modules may now re-generate these ObjC++ files using `USE_CODEGEN=1 pod install` or `scripts/generate-native-modules-specs.sh`.

Changelog: [Internal]

Reviewed By: RSNara

Differential Revision: D22249978

fbshipit-source-id: a12db23defacdba36099a24ce0b8475c8973bd6d
2020-10-09 00:15:16 -07:00
Valentin Shergin 7ebb71a32f Back out "Align multi-line TextInput onSubmitEditing behavior"
Summary:
This is a revert of D22488870 (521b16730d). (https://github.com/facebook/react-native/pull/29177)
We have to revert it because we realized that it's a breaking change without a very good reason. We have to figure out a better way to unify platform behaviors.

Changelog:
[iOS][Fixed] - Reverted recent change in TextInput (#29177)

Reviewed By: fkgozali

Differential Revision: D24200517

fbshipit-source-id: af0e561a6b8d9ade487be6b197a5d79d326442b6
2020-10-08 16:08:24 -07:00
Luna Wei 88174991d9 Close globalLogger when creating scopedLogger
Summary:
# Changelog:
[Internal][Changed] - Close the global perf logger when we create the scoped performance logger and absorb the global perf logger into the scoped logger

Reviewed By: rubennorte

Differential Revision: D23898621

fbshipit-source-id: 0d9bfd95175e660c0bd0bc74974126f92fe409b2
2020-10-06 12:31:31 -07:00
Tim Yung 291668a40c RN: Omit Unused Platform-Specific Code
Summary:
Our Babel plugin that strips irrelevant platform-specific code does not currently know how to deal with early return statements.

This minor change to a couple call sites enables the output bundle for Android to omit code specific to iOS.

Changelog:
[Internal]

Reviewed By: ejanzer

Differential Revision: D24139922

fbshipit-source-id: 467c0c38dd45679b889a8a94d85f73fd969e5b36
2020-10-06 11:19:00 -07:00
Chris Dinh 77f7658e4e Export FlowId type
Summary:
The UserFlow API takes in a FlowId as a parameter on all of its calls. However, this type is currently not exported so consumers cannot store a generated FlowId without creating their own matching type.

Changelog: [Internal]

Reviewed By: dmitry-voronkevich

Differential Revision: D24115983

fbshipit-source-id: 63afbca01343a31aa60042db3693a96a6b854939
2020-10-05 16:28:42 -07:00
Valentin Shergin a977ad0071 Removing outdated warning from View Config infra
Summary:
In theory, view configs can be hierarchical (one can depend on another), at least it was semi-supported on iOS once. And AFAIK there is only one component that seems to use this feature - `RCTComponentHostingView`, all other components essentially inherit RCTView or nothing. At the same time, RCTComponentHostingView does not really need it because RCTComponentHostingView itself does not expose any props.

Changelog: [Internal] Removed outdated warning

Reviewed By: kacieb

Differential Revision: D24095348

fbshipit-source-id: 5629c7433f151b72aae8201c58dd42062990b77e
2020-10-04 11:22:40 -07:00
Dmytro Voronkevych 923b77aef9 Renaming UserFlow methods
Summary: Renaming methods in UserFlow to match other APIs

Reviewed By: swillard13

Differential Revision: D24078270

fbshipit-source-id: c3a65d440e389d7b3c76de7706372265584353c8
2020-10-02 08:09:05 -07:00
Dmytro Voronkevych 2c6d010a50 Adding UserFlow.compleWithFail to RN
Summary: Adding method UserFlow.completeWithFail.

Reviewed By: swillard13

Differential Revision: D24052851

fbshipit-source-id: 1baa30a2d7dfb9ef4e457a74b66fd24e4ffbf21f
2020-10-02 08:09:05 -07:00
Dmytro Voronkevych c4629f7cce UserFlow API for ReactNative
Summary: Creating UserFlow API to track reliability of user interactions

Reviewed By: swillard13

Differential Revision: D23937121

fbshipit-source-id: 83701b8216c9b18c9c3d8c332efa84942ac26ba6
2020-10-02 08:09:05 -07:00
simek 8a31dfe567 chore: update RNTester example link in PanResponder comment (#30051)
Summary:
This PR fixes a small leftover after the RNTester migration to the monorepo package - an invalid link in the `PanResponder` comment.

Refs:
* https://github.com/facebook/react-native/issues/29567
* facebook/react-native-website#2177 (the similar correction was a part of merged PR in the RN docs)

## 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] PanResponder: correct example link in comment

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

Test Plan: N/A

Reviewed By: fkgozali

Differential Revision: D24025065

Pulled By: hramos

fbshipit-source-id: 190486e458fb8e83a35fa2d3c62f4483f3a4334d
2020-09-30 14:36:59 -07:00
Tommy Nguyen 521b16730d Align multi-line TextInput onSubmitEditing behavior (#29177)
Summary:
Aligns behavior to be consistent with Android and the [documentation](https://reactnative.dev/docs/textinput#bluronsubmit). `onSubmitEditing` should not be called when `blurOnSubmit=false`.

## Changelog

[iOS] [Fixed] - Align multi-line TextInput onSubmitEditing behavior

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

Test Plan: ![textinput-blur-align](https://user-images.githubusercontent.com/4123478/85121116-85b4b200-b224-11ea-86c5-065e9e6d22ba.gif)

Reviewed By: shergin

Differential Revision: D22488870

Pulled By: hramos

fbshipit-source-id: 2dec3a55da6384389a8358896ef1fbfd806d0304
2020-09-29 15:57:52 -07:00
Ramanpreet Nara c267b8de72 Rewrite ObjC++ module generator
Summary:
## Misc. Improvements

* We now have 95%+ flow coverage in all generator files. Henceforth, we can make changes to these files with more confidence, and trust flow to catch more errors. This should also improve the DevX of working on these files.
* Better templates: Instead of doing string replace with RegExps, we instead use functions and leverage JS template literals to generate our code. A few benefits: (1) data dependencies of templates are clearly visible, and statically checked by flow, (2) the templates are more readable in VSCode.
* Merged the GenerateModuleHObjCpp.js and GenerateModuleMm.js generators. They can share a lot of logic, so it's not a good idea to keep them separate.
* The ObjC++ module generator no longer generates “dead” structs (i.e structs that aren’t used by type-safety infra). In fact, it explicitly only supports the types in our Wiki. (I know this wasn’t the case with the legacy codegen, because we were generating native code for enums in the legacy codegen). This is a mixed bag. The test to verify correctness will be more difficult to write. However, keeping structs in the codegen needlessly complicates the parsers + generators, and creates technical debt for us to clean up later.

## Abstractions
- **StructCollector:** As we serialize NativeModule methods, when we detect an ObjectTypeAnnotation in the return type of `getConstants()` or inside a method param, we must create a Struct JS object for it. When we detect a type-alias (also in the same locations), we must look up that type-alias and create a Struct from its RHS. A Struct is basically an ObjectTypeAnnotation with a context (i.e: used in getConstants() vs as a method param), that cannot contain other ObjectTypeAnnotations.
- **serializeMethod.js** Given a NativeModule method type annotation, output the protocol method, JS return type, selector, a record of which params were structs, and which structs. Basically, this is all the information necessary to generate the declaration and implementation codegen for a partiular NativeModule method.
- **serializeStruct/*.js**: After creating all these Structs, we need to loop over all of them, and tranform them into ObjC++ code.
  - **serializeStruct.js**: Depending on the struct context, calls either `serializeRegularStruct.js` or `serializeConstantsStruct.js`. Both of these files have the same layout/abstractions. They look very similar.
- **serializeModule.js:** Outputs RCTCxxConvert categories for transforming `NSDictionary *` into C++ structs. Outputs ObjCTurboModule subclass.

## Algorithm
```
for spec in NativeModuleSpecs
  structCollector = new StructCollector
  resolveAlias = (aliasName) => nullthrows(spec.aliases[aliasName])

  methodDatas = []
  for method in methods(spec)
    methodData.push(serializeMethod(method, structCollector, resolveAlias))
  end

  structs = structCollector.getStructs()

  output generateImplCodegen(methodDatas, structs)
  output generateHeaderCodegen(methodDatas, structs)
end
```

Changelog: [Internal]

Reviewed By: hramos

Differential Revision: D23633940

fbshipit-source-id: 7c29f458b65434f4865ef1993061b0f0dc7d04ce
2020-09-29 14:39:40 -07:00
Ramanpreet Nara ef145adb9d Split NativeImageStore into iOS and Android counterparts
Summary:
Split the two specs, so that that we don't have to use Flow unions in the merged spec.

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D23800841

fbshipit-source-id: 28b67578832ebd733bd080877e4ab763c013fded
2020-09-29 14:39:37 -07:00
Paige Sun a7c026e667 Remove unused Fabric image instrumentation
Summary:
Remove the older implementation of image instrumentation in Fabric by removing, RCTImageInstrumentationProxy, ImageInstrumentation from ImageRequest, and trackURLImageContentDidSetForRequest from RCTImageLoaderWithAttributionProtocol.

Changelog: [RN][Fabric][Image] Remove unused Fabric image instrumentation

Reviewed By: fkgozali

Differential Revision: D23990606

fbshipit-source-id: 004d04025d031af11377a73e5bfb64b1e0449962
2020-09-29 14:19:09 -07:00
Lulu Wu 121141c86b Convert AndroidDialogPicker to JS view configs
Summary:
Convert AndroidDialogPicker to JS view configs

Changelog: [Internal]

Reviewed By: ejanzer

Differential Revision: D23911673

fbshipit-source-id: d5fefa997432f0096308ab5593ba74c2c07b71e1
2020-09-29 05:16:48 -07:00
simek 2160377574 remove most of tvOS remnants from the code (#29407)
Summary:
Refs: [0.62 release](https://reactnative.dev/blog/#moving-apple-tv-to-react-native-tvos), https://github.com/facebook/react-native/issues/28706, https://github.com/facebook/react-native/issues/28743, https://github.com/facebook/react-native/issues/29018

This PR removes most of the tvOS remnants in the code. Most of the changes are related to the tvOS platform removal from `.podspec` files, tvOS specific conditionals removal (Obj-C + JS) or tvOS CI/testing pipeline related code.

In addition to the changes listed above I have removed the deprecated `Platform.isTVOS` method. I'm not sure how `Platform.isTV` method is correlated with Android TV devices support which is technically not deprecated in the core so I left this method untouched for now.

## 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] [Removed]** - remove most of tvOS remnants from the code:
  * `TVEventHandler`, `TVTouchable`, `RCTTVView`, `RCTTVRemoteHandler` and `RCTTVNavigationEventEmitter`
* **[Internal] [Removed]** - remove `TARGET_TV_OS` flag and all the usages
* **[iOS] [Removed]** - remove deprecated `Platform.isTVOS` method
* **[iOS] [Removed]** - remove deprecated and TV related props from View:
  * `isTVSelectable`, `hasTVPreferredFocus` and `tvParallaxProperties`
* **[iOS] [Removed]** - remove `BackHandler` utility implementation

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

Test Plan: Local tests (and iOS CI run) do not yield any errors, but I'm not sure how the CI pipeline would react to those changes. That is the reason why this PR is being posted as Draft. Some tweaks and code adjustment could be required.

Reviewed By: PeteTheHeat

Differential Revision: D22619441

Pulled By: shergin

fbshipit-source-id: 9aaf3840c5e8bd469c2cfcfa7c5b441ef71b30b6
2020-09-28 21:26:41 -07:00
Tim Yung 06ce643565 Text: Cleanup Native Component Configuration
Summary:
Cleans up the native component configuration for `RCTText` and `RCTVirtualText`.

This //does// lead to a breaking change because `Text.viewConfig` will no longer exist. However, I think this is acceptable because `viewConfig` has already long stopped being an exported prop on other core components (e.g. `View`).

Changelog:
[General][Removed] - `Text.viewConfig` is no longer exported.

Reviewed By: shergin

Differential Revision: D23708205

fbshipit-source-id: 1ad0b0772735834d9162a65d9434a9bbbd142416
2020-09-28 17:23:49 -07:00
Tim Yung 9da4d87798 Pressability: Support Lazy Hook Initialization
Summary:
Changes `usePressability` so that it accepts a nullable `config` argument.

This makes it possible for a component to use `usePressability` and lazily allocate the `config` and subsequent instance of `Pressability`. This can be useful for components that are commonly allocated but seldom pressed because it lets many usages of `usePressability` avoid allocating many extraneous objects.

Changelog:
[Internal]

Reviewed By: kacieb

Differential Revision: D23708206

fbshipit-source-id: 4a5063067131ce8c957fb16c49a2045e8c0b19fa
2020-09-28 17:23:49 -07:00
Luna Wei b85b4f46af Update PerformanceLogger to nullable timespans, points, extras
Summary: Changelog: [Internal][Fixed] - When we close performance loggers (D23845307 (aebb97b9c6)) we cannot rely that a timespan/point/extra will be in perf logger. Update types to reflect that.

Reviewed By: rubennorte

Differential Revision: D23907741

fbshipit-source-id: 63673aa69cd8c76253e4fee3463e37c86265cf7b
2020-09-28 10:53:55 -07:00
Valentin Shergin 27378b7f10 Animated: Early detection of division by zero in AnimatedDivision
Summary:
Same as D20969087 (be78673755) but a bit more sophisticated.

We currently see a lot of errors happens because of division by zero in AnimatedDivision module. We already have a check for that in the module but it happens during the animation tick where the context of execution is already lost and it's hard to find why exactly it happens.
Adding an additional check to the constructor should trigger an error right inside render function which should make the error actionable.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: fkgozali

Differential Revision: D23908993

fbshipit-source-id: d21be9a72ec04fe4ff0740777d9ff49cf1bcde73
2020-09-26 17:23:15 -07:00
Rob Walker 14042fb76f Don't crash when promise task is cancelled before its resolved (#29969)
Summary:
This pull request fixes a potential `TypeError` in TaskQueue.js, that happens if a promise is added to the task queue, which is cancelled between the promise starting and resolving.

The exact error this resolves is
```js
TypeError: TaskQueue: Error resolving Promise in task gen1: Cannot set property ‘popable’ of undefined
      167 |           queueStackSize: this._queueStack.length,
      168 |         });
    > 169 |       this._queueStack[stackIdx].popable = true;
          |                                              ^
      170 |       this.hasTasksToProcess() && this._onMoreTasks();
      171 |     })
      172 |     .catch(ex => {
      at Libraries/Interaction/TaskQueue.js:169:46
```

This specific error was also reported in https://github.com/facebook/react-native/issues/16321

## Changelog

[General] [Fixed] - Prevent TypeError in TaskQueue when cancelling a started but not resolved promise.

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

Test Plan:
The added test demonstrates the error, if run without the fixed applied to TaskQueue.js.
This is a race condition error, so is difficult to replicate!

Reviewed By: yungsters

Differential Revision: D23785972

Pulled By: appden

fbshipit-source-id: ddb8d06b37d296ee934ff39815cf5c9026d73871
2020-09-25 19:21:56 -07:00
Stanisław Chmiela 663b5a878b Do not override decoders to RCTImageLoader (#29711)
Summary:
I (actually, [we](https://github.com/expo/expo/issues/9858)) noticed GIFs are no longer animating in Expo client after [enabling TurboModules](https://github.com/expo/expo/pull/9687).

## Changelog

[iOS] [Fixed] - Fix `RCTImageLoader` not using decoders provided.

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

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

Test Plan:
![cat](https://user-images.githubusercontent.com/1151041/90775800-90112c00-e2f9-11ea-95cd-ab95a97068f4.gif)

The cat is moving! Before applying this commit `RCTGIFDecoder` provided in the initalizer is removed from the `_decoders` array in the

```objc
_decoders = [_bridge modulesConformingToProtocol:protocol(RCTImageDataDecoder)];
```

Also, compare

8f306cd66a/Libraries/Image/RCTImageLoader.mm (L243-L250)

and

8f306cd66a/Libraries/Image/RCTImageLoader.mm (L177-L184)

This PR makes `_decoders` behave the same as `_loaders`.

Reviewed By: PeteTheHeat

Differential Revision: D23908238

Pulled By: fkgozali

fbshipit-source-id: 1d7a6e0d180277f23d8c28916734713bc1833b8b
2020-09-24 10:36:16 -07:00
Samuel Susla 64ac01dbbe Prevent change of delegate in RCTUITextView
Summary:
Changelog: [internal]

# Problem

`[RCTUITextView setDelegate]` is a public method and if something changes the delegate, appropriate events won't be called on the component (onTextChange, onSelectionChange and the others).

# Solution

Prevent setting of delegate from outside of the class. Ideally we would want to hide `setDelegate` altogether but that would require a rewrite of `RCTUITextView`.

Reviewed By: JoshuaGross, shergin

Differential Revision: D23813095

fbshipit-source-id: 8b76ac86727d262d0f9b81adfc8e75157847284c
2020-09-24 01:02:40 -07:00
Luna Wei aebb97b9c6 Add close() to IPerformanceLogger
Summary:
To represent a final state where a logger should no longer be used

Changelog: [Internal] - To represent a final state where a logger should no longer be used

Reviewed By: rubennorte

Differential Revision: D23845307

fbshipit-source-id: 4b2bfda4f7425ba6bc8e5e1233d9baea60dd8667
2020-09-23 15:49:38 -07:00
Luna Wei 6d355c0abd Sort logger alphabetically
Summary:
Rearranging to alphabetically sort, no functionality changes

Changelog: [Internal]

Reviewed By: rubennorte, motiz88

Differential Revision: D23836997

fbshipit-source-id: 00232b88379e44920ecb74fa6ff43f36d941d93b
2020-09-23 15:49:38 -07:00
Ramanpreet Nara 3a6327a5d9 Open source react-native-modules ESLint rule
Summary:
Open source this ESLint rule so that we can lint our open source NativeModule specs.

Changelog: [Internal]

Reviewed By: shergin, cpojer

Differential Revision: D23791748

fbshipit-source-id: e44444bc87eaa9dc9b7f2b3ed03151798a35e8a5
2020-09-22 11:32:37 -07:00
Scott Kyle 23717e48af Call stopObserving on correct queue
Summary:
Since `dealloc` can be called from any thread, this would result `stopObserving` being called on a different thread/queue than the specified `methodQueue`. We specifically encountered this issue with a module needing the main queue having its `stopObserving` called on a background queue.

Changelog:
[iOS][Fixed] - Call [RCTEventEmitter stopObserving] on specified method queue

Reviewed By: RSNara

Differential Revision: D23821741

fbshipit-source-id: 693c3be6876f863da6dd214a829af2cc13a09c3f
2020-09-21 17:30:34 -07:00
Andrei Shikov 22b5f32f74 Add extras to timespan and points in performance logger
Summary:
Changelog:
[Internal][Added] Added point-level extras to performance logger

Reviewed By: lunaleaps, rubennorte

Differential Revision: D23730275

fbshipit-source-id: 285c5d7ac769bd109df7ce0294da024401edf7d3
2020-09-21 07:37:40 -07:00
Kevin Gozali 7c93f5b001 Move TurboModule Core from ReactCommon/turbomodule to ReactCommon/react/nativemodule
Summary:
This diff moves the code of TurboModule Core from ReactCommon/turbomodule to ReactCommon/react/nativemodule

For iOS: Pod spec name stays as "ReactCommon/turbomodule/..." for now, only the source/header location is affected. The target will be renamed/restructured closer to TurboModule rollout.

changelog: [internal] Internal

Reviewed By: RSNara

Differential Revision: D23362253

fbshipit-source-id: c2c8207578e50821c7573255d4319b9051b58a37
2020-09-19 00:42:30 -07:00
Samuel Susla d1b695d343 Propagate nativeID in createAnimatedComponent
Summary:
Changelog: [internal]

https://our.intern.facebook.com/intern/diffusion/FBS/browse/master/xplat/js/react-native-github/Libraries/Animated/createAnimatedComponent.js?commit=1b6ce6c3a69a&lines=82-112

`_isFabric` in `createAnimatedComponent` returns false for Fabric component, that's why nativeID was not being assigned and view got flattened.

To fix this, props.nativeID is propagated. SnackBar already has nativeID https://our.intern.facebook.com/intern/diffusion/FBS/browse/master/xplat/js/RKJSModules/Libraries/FDS/FDSLightweightFeedback/DEPRECATED_FDSSnackBar.js?commit=1b6ce6c3a69a&lines=277

Reviewed By: PeteTheHeat

Differential Revision: D23757304

fbshipit-source-id: 9e4b4599c95b8af8767793bc8cdce717a347a273
2020-09-18 07:44:37 -07:00
Rubén Norte f1b84ddf2c Remove update option from stopTimestamp method in performance loggers
Summary:
Changelog:
[Internal][Changed] Removed `update` option from `stopTimestamp` method in performance loggers

Reviewed By: lunaleaps

Differential Revision: D23759138

fbshipit-source-id: bb83b6f5ff2f640733c2e508779b3bc52800e4f6
2020-09-18 07:14:17 -07:00
Rubén Norte fc4f667cde Remove unnecessary addTimeAnnotation method from performance logger
Summary:
Changelog:
[Internal][Removed] Removed `addTimeAnnotation` method from performance loggers

Reviewed By: lunaleaps

Differential Revision: D23758816

fbshipit-source-id: 98e0abae25266f3dcc5953f25f20cde8e3dac190
2020-09-18 07:14:16 -07:00
Rubén Norte 4d842963fa Remove unused timespan descriptions from performance loggers
Summary:
The `description` parameter is never used so we can simplify the API.

Changelog:
[Internal][Changed] Removed `description` option from performance logger timespans

Reviewed By: lunaleaps

Differential Revision: D23758829

fbshipit-source-id: 10900f86effc3e1f54a408cf8f9fbc9b3b52f569
2020-09-18 07:14:16 -07:00
Rubén Norte 2788ee8ba9 Improve performance logger definition and type safety
Summary:
The way the performance logger is defined now is very unsafe regarding type safety, as all accesses to its properties is untyped (`any`) and it uses several `mixed` types in cases that could be more refined.

This migrates the creation of performance loggers to instances of a class to improve its type safety. If there's an impact in performance, it's expected to be positive.

Changelog:
[Internal][Changed] - Replaced object literals with class instances to create performance loggers

Reviewed By: lunaleaps

Differential Revision: D23758609

fbshipit-source-id: 0734742eb97d92a4a53f7b66a8ca45a2ae90946c
2020-09-18 07:14:16 -07:00
Emily Janzer b352e2da81 Create a ClickableSpan for nested Text components
Summary:
Right now nested Text components are not accessible on Android. This is because we only create a native ReactTextView for the parent component; the styling and touch handling for the child component are handled using spans. In order for TalkBack to announce the link, we need to linkify the text using a ClickableSpan.

This diff adds ReactClickableSpan, which TextLayoutManager uses to linkify a span of text when its corresponding React component has `accessibilityRole="link"`. For example:

  <Text>
    A paragraph with some
    <Text accessible={true} accessibilityRole="link" onPress={onPress} onClick={onClick}>links</Text>
    surrounded by other text.
  </Text>

With this diff, the child Text component will be announced by TalkBack ('links available') and exposed as an option in the context menu. Clicking on the link in the context menu fires the Text component's onClick, which we're explicitly forwarding to onPress in Text.js (for now - ideally this would probably use a separate event, but that would involve wiring it up in the renderer as well).

ReactClickableSpan also applies text color from React if it exists; this is to override the default Android link styling (teal + underline).

Changelog: [Android][Fixed] Make nested Text components accessible as links

Reviewed By: yungsters, mdvacca

Differential Revision: D23553222

fbshipit-source-id: a962b2833d73ec81047e86cfb41846513c486d87
2020-09-15 17:34:35 -07:00
S. Weatherall 9c353b5ab0 Fix typo in invariant message (#29913)
Summary:
Fix a typo in the invariant message presented when ActionSheetManager does not exist (typo was found in 2 places)

## Changelog

[General] [Fixed] - Fix typo in invariant message

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

Test Plan: Run ActionSheetIOS.showActionSheetWithOptions(...) on an Android emulator to get this invariant message to appear.

Reviewed By: hramos

Differential Revision: D23691048

Pulled By: appden

fbshipit-source-id: 469db65a42bf547c7818b45729befa214b5791f2
2020-09-14 16:42:43 -07:00
Tim Yung bdf3c79110 RN: Fix TouchableHighlight w/o `onLongPress`
Summary:
When `TouchableHighlight` was migrated to use `Pressability`, a bug was introduced due to `onLongPress` being unconditionally supplied as a callback. This bug leads to `onPress` not firing if the element is pressed for longer than 500ms, even when `onLongPress` is not supplied.

Closes #29040.

Changelog:
[General][Fixed] - TouchableHighlight fires `onPress` when pressed for >500ms, when `onLongPress` is not supplied.

Reviewed By: TheSavior

Differential Revision: D23664365

fbshipit-source-id: 3a0e92e276871eedd303888346a13433be15ac47
2020-09-11 19:05:54 -07:00
Paige Sun acda299453 6/6 Log image-rendered for Fabric image logging
Reviewed By: fkgozali

Differential Revision: D23450649

fbshipit-source-id: 58265a2c7855a2f4371d68637f09a07921821adf
2020-09-11 15:09:12 -07:00
Paige Sun 13759f192d 3/6 Add IGviewpoint for image visibility callbacks
Summary: Changelog: [Internal] Add IGviewpoint to get image visibility callbacks for when an UIImageView is in or out of view

Reviewed By: fkgozali

Differential Revision: D23428528

fbshipit-source-id: 87e4cee8fbe3c6b7da5153f87bbb530b2f990d96
2020-09-11 15:09:12 -07:00
Tim Yung 0c392bc405 Pressability: Consistently Fire `onPress{In,Out}` w/o `onPress`
Summary:
Currently any component using `Pressability` is quickly tapped and released (i.e. responder grant followed only by reponder release), we fire `onPressIn` and `onPressOut` immediately to ensure that any visual feedback for the interactive element is momentarily visible.

Currently, we were mistakenly skipping this logic if `onPress` was null.

This fixes it so that we fire `onPressIn` and `onPressOut` consistently, even if `onPress` is null.

Changelog:
[General][Fixed] - Pressability now consistently fires `onPressIn` and `onPressOut`, even without an `onPress`.

Reviewed By: lunaleaps

Differential Revision: D23613254

fbshipit-source-id: e316707cbb2a4814262dea4eb1ddf6e3780268d1
2020-09-10 17:04:26 -07:00
Tim Yung a6395d5406 Pressable: Add `unstable_pressDelay` Prop
Summary:
Adds a new `unstable_pressDelay` prop to `Pressable`.

This is intended to be used to experiment with adding a delay for when `onPressIn` fires. The intended purpose of this delay is to prevent `Pressable` elements from activating (i.e. `onPressIn` firing) if a touch gesture is immediately canceled by an enclosing native component (e.g. `ScrollView`).

Changelog:
[General][Added] - Added `unstable_pressDelay` prop to `Pressable`.

Reviewed By: lunaleaps

Differential Revision: D23604581

fbshipit-source-id: 5ce5d15a996c8a7aabaa465aa02fa8bad1044227
2020-09-10 17:04:26 -07:00
Tim Yung 86ffb9c41e Pressability: Remove Default Press Delay
Summary:
Removes the default press delay from `Pressability`, which was introduced in 0.63 and affected `Pressable`. Fixes #29376.

In a subsequent commit, I will bring it back as an `unstable_pressDelay` prop.

Changelog:
[General][Changed] - Removed default 130ms delay from Pressability and Pressable.

Reviewed By: lunaleaps

Differential Revision: D23604582

fbshipit-source-id: c21c72bf8b59fed028f5905ca4f805bb3fa79399
2020-09-10 17:04:26 -07:00
Jayme Deffenbaugh cb719a16cc Fix Xcode warnings in React-Core pod (#29622)
Summary:
With the upgrade to React Native 0.63, we started running into nullability warnings that were breaking our build. This PR fixes those nullability warnings as well as a few other warnings in React-Core.

## Changelog

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

[iOS] [Fixed] - Fix xcodebuild warnings in React-Core

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

Test Plan:
- Nullability annotations should only affect compilation, but even though RNTester compiles, I'm not fully convinced that this won't break projects downstream. It would be good to get another opinion on this.
- The change in `RCTAllocateRootViewTag` is the only real logic change in this PR. We throw an exception if the root view tag is not in the correct format, so this change seems safe after some basic manual testing in RNTester.

Reviewed By: shergin

Differential Revision: D23386678

Pulled By: appden

fbshipit-source-id: a74875195a4614c3248e8f968aa98602e3ee2de0
2020-09-09 12:48:09 -07:00
Tim Yung b7b0e23202 TextInput: Add `onPressIn` and `onPressOut`
Summary:
Introduces support for `onPressIn` and `onPressOut` on the `TextInput` component.

This makes it possible to add visual feedback when users touch interact with `TextInput` components.

Changelog:
[General][Added] - TextInput now supports `onPressIn` and `onPressOut`.

Reviewed By: TheSavior

Differential Revision: D23514333

fbshipit-source-id: 1790e977b78f1c293d5476aef8613547f27d6731
2020-09-08 15:57:07 -07:00
Tommy Nguyen aaeffdb49a Fix "'RCTBlobPlugins.h' file not found" on iOS (#29684)
Summary:
Fixes iOS builds failing with the following error in certain setups:

```
/~/Pods/React-RCTBlob/Libraries/Blob/RCTBlobPlugins.mm:14:9: fatal error: 'RCTBlobPlugins.h' file not found
#import "RCTBlobPlugins.h"
        ^~~~~~~~~~~~~~~~~~
1 error generated.
```

## Changelog

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

[iOS] [Fixed] - "'RCTBlobPlugins.h' file not found" when building iOS

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

Test Plan:
- Existing builds should not fail
- Tested this change internally where we are seeing this build failure

cc hramos

Reviewed By: fkgozali

Differential Revision: D23581090

Pulled By: appden

fbshipit-source-id: 89d2088c362bfbd22df5cd098b110a43d76e784f
2020-09-08 12:56:43 -07:00
Tim Yung 49015b0f5b Text: Remove Extraneous `onResponderGrant` Argument
Summary:
This argument for the `onResponderGrant` event callback on `Text` is extraneous.

Changelog:
[General][Fixed] - Remove extraneous argument for `onResponderGrant` Flow type on `Text`.

Reviewed By: TheSavior

Differential Revision: D23513190

fbshipit-source-id: c4057cf534f4cdf73967e4324db64acc8cf323d0
2020-09-04 16:10:57 -07:00
Tim Yung b11d6ecbb8 EventEmitter: Replace `listeners()` with `listenerCount()`
Summary:
Replaces the `listeners()` method on `EventEmitter` with a `listenerCount()` method.

Changelog:
[General][Removed] - Removed `listeners()` from `DeviceEventEmitter` and `NativeEventEmitter`.
[General][Added] - Added `listenerCount()` to `DeviceEventEmitter` and `NativeEventEmitter`.

Reviewed By: cpojer

Differential Revision: D22204156

fbshipit-source-id: 15029525aeef55de9934a4f319910e666ecbe1d8
2020-09-03 15:21:11 -07:00
Rubén Norte 38062cf8a7 Log renderApplication_React_render timespan to scoped performance logger if available
Summary: Changelog: [Changed] Used scoped performance logger to mark the beginning and end of the call to the renderer, instead of using `GlobalPerformanceLogger`.

Reviewed By: lunaleaps

Differential Revision: D23240784

fbshipit-source-id: 7099f1a4b5da3f29596fcee289a715d295ae0a65
2020-09-03 06:46:09 -07:00
Rubén Norte 57b10f759e Allow setting a custom performance logger in XMLHttpRequest
Summary: Changelog: [Added] Added custom method `setPerformanceLogger` to `XMLHttpRequest`

Reviewed By: lunaleaps

Differential Revision: D23129945

fbshipit-source-id: 7a295945eee2b2f81dc0a46f764ffb1d9b14af15
2020-09-03 06:46:09 -07:00
Rubén Norte b90f4d978f Refactor IPerformanceLogger as an interface
Summary:
This type makes more sense as an interface, given a class would be a common implementation (and object types aren't supported in that case).

It also adds the names of the parameters so it's easier to understand for implementers.

Changelog:
[General][Changed] - Changed type definition of IPerformanceLogger from object to interface

Reviewed By: lunaleaps

Differential Revision: D23449816

fbshipit-source-id: be872748827b123587f3f397da20f5545b0aae07
2020-09-03 06:46:09 -07:00
Rick Hanlon 87b91c057c Clean up eager component stack regexes
Summary:
Clean up from a previous diff.

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D23475250

fbshipit-source-id: 3f390134e684bbe95b584dc01b8272a29cecc0af
2020-09-02 10:01:13 -07:00
Lulu Wu b5b4a70410 Set caretHidden to true to fix the Xiaomi crash
Summary:
After monitoring scuba for a few days,  previous fixes(D23301714 D23331828 (07a597ad18)) don't work as expected.

I managed to test this issue on a Xiaomi device, the crash didn't happen but the there was a popup "Frequetly used email" on top of email edit text:

{F317216473}

Getting rid of the popup probably be the right fix.

For more context see https://github.com/facebook/react-native/issues/27204

Changelog: [Android] - Set caretHidden to true to fix the Xiaomi crash

Reviewed By: mdvacca

Differential Revision: D23451929

fbshipit-source-id: 521931422f3a46a056a9faa4b10fe93cf4732db0
2020-09-02 05:28:49 -07:00
Emily Janzer 045d8fe8c3 Revert D23426786: Prevent ScrollView From Stealing Responder Capture When Using Physical Keyboard
Differential Revision:
D23426786 (93e7a7a70d)

Original commit changeset: 7138ef0bc450

fbshipit-source-id: 363d18e68390c2cbc3dabd3cba343ddd313a8b23
2020-09-01 16:47:14 -07:00
Nick Gerleman 93e7a7a70d Prevent ScrollView From Stealing Responder Capture When Using Physical Keyboard (#29798)
Summary:
Fixes https://github.com/microsoft/react-native-windows/issues/5867

ScrollResponder has logic so that the first tap exiting out of a soft keyboard is captured instead of leaking to its children. This state is checked by testing if `TextInputState.currentlyFocusedInput()` is non-null. This also fires in cases a soft keyboard is not present (e.g. on Desktop where a physical keyboard is in use). This presents to users as clicks/taps not being registered when moving from a TextInput to something esle.

Instead of checking TextInputState to see if the softKeyboard is open, check `this.keyboardWillOpenTo`, which is tied to keyboard open and close events.

## Changelog

[General] [Fixed] - Prevent ScrollView From Stealing Responder Capture When Using Physical Keyboard

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

Test Plan: Validated that on react-native-windows, ScrollView will capture responder events when tapped and a soft-keyboard is open, but will not capture events when clicking from a TextView to a child of a ScrollView and no soft keyboard is open.

Reviewed By: kacieb

Differential Revision: D23426786

Pulled By: TheSavior

fbshipit-source-id: 7138ef0bc4508aaec5531f455b022b105b5d858a
2020-08-31 14:51:39 -07:00
Peter Argany b231e3ab41 Fix CircleCI breakage in RCTPropsAnimatedNode (#29800)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/29800

I changed this line in D23272735 (700960c9f1), to conform to normal ObjC semantics: impl files can import their header by file name.

I forgot that their's some special linking logic happening in this directory that doesn't allow for this import type.

This diff just reverts one line to fix CircleCI builds.

Changelog: [Internal]

Reviewed By: shergin

Differential Revision: D23399893

fbshipit-source-id: 976199c659522effd632aaeb38616d0d6c962f1f
2020-08-31 11:39:54 -07:00
Tim Yung 54e19a6b7f RN: Remove `fbjs` Dependency
Summary:
Removes `fbjs` dependency from `react-native` because it is no longer referenced.

Changelog:
[General][Changed] - Removed `fbjs` dependency from `react-native`.

Reviewed By: cpojer

Differential Revision: D23358201

fbshipit-source-id: 1945590d2e7ea853434c716a151fc1058718d471
2020-08-28 12:16:26 -07:00
Lulu Wu 07a597ad18 Fix Xiaomi TextInput crash in native
Summary:
Long term fix in native for Error: android_crash:java.lang.NullPointerException:android.widget.Editor$SelectionModifierCursorController.access$300

For more detail please see T68183343 D23301714

Changelog:
[Android][Changed] - Fix Xiaomi TextInput crash in native

Reviewed By: mdvacca

Differential Revision: D23331828

fbshipit-source-id: 914f2d431772f49711b940d47a2b3ef57ab82cdc
2020-08-28 01:44:37 -07:00
Tim Yung 9a5ab9e366 EventEmitter: Default Export `{Native,RCTDevice}EventEmitter`
Summary:
Refactors `NativeEventEmitter` and `RCTDeviceEventEmitter` to be default exports.

Changelog:
[Internal]

Reviewed By: RSNara

Differential Revision: D22203918

fbshipit-source-id: 575b2baf1604d1a8a1bffd6d108c12f3f8415e0a
2020-08-27 17:52:44 -07:00
Agastya Darma 8d198ee5b9 Removing unused import on RCTMultilineTextInputNativeComponent & RCTSingelineTextInputNativeComponent spec. (#29652)
Summary:
This pr removes unused import on RCTMultilineTextInputNativeComponent & RCTSingelineTextInputNativeComponent spec.

## Changelog

[General] [Changed] - Removing unused import on RCTMultilineTextInputNativeComponent & RCTSingelineTextInputNativeComponent spec.

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

Test Plan: TODO

Reviewed By: shergin

Differential Revision: D23346830

Pulled By: sammy-SC

fbshipit-source-id: 59e8cb83a6c1e987e98ba00786a4c54744012466
2020-08-27 15:39:35 -07:00
Tim Yung a0dc252dc8 RN: Cleanup `ImageSource` Flow Type
Summary:
Cleans up the documentation and types for `ImageSource`.

The only material changes here are:

-  `ImageSource`'s array variant will now be `$ReadOnlyArray` instead of `Array`.
- `ImageURISource.headers` is now an object of string properties.

Changelog:
[General][Changed] - Refined `ImageSource` Flow type for array-variant and headers.

Reviewed By: kacieb

Differential Revision: D23355812

fbshipit-source-id: c3407db037dfb1d3514a028d1a237eb76ee6fedd
2020-08-27 15:20:09 -07:00
Emily Janzer 39f694a748 Re-enable animations on Android
Summary:
We disabled animations on Android because native driver animations weren't working yet. After recent changes in NativeAnimatedModule, animations are now working as expected. This diff re-enables animations for bridgeless mode on Android.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D22605612

fbshipit-source-id: 7a7078bf23bb88e7745fc899e1a5ff551425dbad
2020-08-27 15:08:48 -07:00
Eloy Durán 941bc0ec19 Upstream RN macOS Hermes integration bits (#29748)
Summary:
Microsoft’s RN for macOS fork supports the Hermes engine nowadays https://github.com/microsoft/react-native-macos/pull/473. As a longer term work item, we’ve started moving bits that are not invasive for iOS but _are_ a maintenance burden on us—mostly when merging—upstream. Seeing as this one is a recent addition, it seemed like a good candidate to start with.

As to the actual changes, these include:

* Sharing Android’s Hermes executor with the objc side of the codebase.
* Adding a CocoaPods subspec to build the Hermes inspector source and its dependencies (`Folly/Futures`, `libevent`).
* Adding the bits to the Xcode build phase script that creates the JS bundle for release builds to compile Hermes bytecode and source-maps…
* …coincidentally it turns out that the Xcode build phase script did _not_ by default output source-maps for iOS, which is now fixed too.

All of the Hermes bits are automatically enabled, on macOS, when providing the `hermes-engine-darwin` [npm package](https://www.npmjs.com/package/hermes-engine-darwin) and enabling the Hermes pods.

## Changelog

[General] [Added] - Upstream RN macOS Hermes integration bits

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

Test Plan:
Building RNTester for iOS and Android still works as before.

To test the actual changes themselves, you’ll have to use the macOS target in RNTester in the macOS fork, or create a new application from `master`:

<img width="812" alt="Screenshot 2020-08-18 at 16 55 06" src="https://user-images.githubusercontent.com/2320/90547606-160f6480-e18c-11ea-9a98-edbbaa755800.png">

Reviewed By: TheSavior

Differential Revision: D23304618

Pulled By: fkgozali

fbshipit-source-id: 4ef0e0f60d909f3c59f9cfc87c667189df656a3b
2020-08-27 01:18:33 -07:00
Luna Wei e3845f44ea Clean up unused methods of IPerformanceLogger
Summary:
Changelog:
[Internal][Removed] - Remove unused performance logger methods and merged all the logs to `logEverything`

Reviewed By: cpojer

Differential Revision: D23284721

fbshipit-source-id: 91f948302bb36bb45ceb3c9510392029faa59605
2020-08-27 01:09:26 -07:00
Luna Wei affac5ab30 Fix addTimespanAnnotations
Summary:
Changelog:
[Internal][Fixed] - Fix call for addTimespanAnnotations to call addTimespanAnnotation.

I'm not sure why Flow didn't catch this?

Reviewed By: motiz88

Differential Revision: D23284722

fbshipit-source-id: 054446f5e1bd9881eddb0c0252797142026717ef
2020-08-27 01:09:25 -07:00
Andy Matuschak 694e22de84 Fix Catalyst text rendering by disabling inappropriate subpixel-antialiasing (#29609)
Summary:
I noticed when porting my iOS app to macOS via Catalyst that the text rendering was somewhat different on the two platforms. Text looked blurry and over-weight on macOS, even when disabling the Catalyst scaling transform.

I hazily remembered that I'd seen this problem before in my old Cocoa development days: this kind of blurring occurs when rendering text with sub-pixel anti-aliasing into an offscreen buffer which will then be traditionally composited, because when the SPAA algorithm attempts to blend with the underlying content (i.e. in the offscreen buffer), there isn't any. SPAA is disabled on iOS, so the issue wouldn't appear there. On macOS, typical approachs to displaying text (e.g. `CATextLayer`) normally disable SPAA, since it's been incompatible with the platform's compositing strategy since the transition to layer-backed views some years ago. But React Native uses `NSLayoutManager` to rasterize text (rather than relying on the system render server via `CATextLayer`), and that class doesn't touch the context's font smoothing bit before drawing.

This change makes macOS/Catalyst text rendering consistent with iOS text rendering by disabling SPAA.

It appears that the code I've modified is in the process of being refactored (for Fabric?). It looks like [this](8d6b41e9bc/ReactCommon/react/renderer/textlayoutmanager/platform/ios/RCTTextLayoutManager.mm (L111)) is the corresponding place in the new code (sammy-SC, is that right?). I'm happy to include a change to the new renderer in this patch if someone can point me at how to test that change.

## Changelog

[iOS] [Fixed] - Improved text rendering on macOS Catalyst

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

Test Plan:
1. Prepare RNTester for running on macOS (or apply [this patch](https://gist.github.com/andymatuschak/d0f5b4fc1a28efc4f860801aa1deddcd) to handle parts 1 and 2, but you'll still need to do part 3):
   1. Open the workspace, navigate to the `RNTester` target's configuration, and check the "Mac" checkbox under "Deployment Info.
   2. Flipper doesn't yet compile for Catalyst (https://github.com/facebook/react-native/issues/27845), so you must disable it by: a) commenting out `use_flipper!` and `flipper_post_install` in the Podfile, then running `pod install`; and b) removing the `FB_SONARKIT_ENABLED` preprocessor flags in the Xcode project.
   3. macOS has different signing rules from iOS; you must set a development team in the "Signing & Capabilities" tab of the `RNTester` target configuration pane. Unfortunately, you must also do this in the `Pods` project for the `React-Core-AccessibilityResources` target ([this is an issue which CocoaPods must fix](https://github.com/CocoaPods/CocoaPods/issues/8891)).
2. Run RNTester with and without the patch. You'll see that the font hinting is overweight without the patch; see screenshots below (incorrect rendering above, correct rendering below; note that fonts still remain slightly blurred because of Catalyst's window scaling transform, but that's removed on Big Sur).

![Screen Shot 2020-08-12 at 10 03 50 AM](https://user-images.githubusercontent.com/2771/90045523-0374c700-dc84-11ea-8945-2d9830bccbd1.png)
![Screen Shot 2020-08-12 at 10 03 15 AM](https://user-images.githubusercontent.com/2771/90045547-0bcd0200-dc84-11ea-88af-37a8879b4efd.png)

Reviewed By: PeteTheHeat

Differential Revision: D23344751

Pulled By: sammy-SC

fbshipit-source-id: 1bbf682b681e381a8a90e152245d9b0df8ec7697
2020-08-26 18:22:54 -07:00
Tim Yung 206ea36253 RN: Delete `Animated/polyfills`
Summary:
Deletes `Animated/polyfills` which is no longer necessary (and only creates extra configuration burden).

Changelog:
[Internal]

Reviewed By: cpojer

Differential Revision: D22451963

fbshipit-source-id: 7a9a48b96b3783f2f6340226bdafd2eaa43f32e7
2020-08-25 14:15:35 -07:00
Tim Yung 9c9e677918 RN: Remove `react-animated` Legacy Package
Summary:
Removes the legacy `react-animated` package configuration and collapses the `Animated/src/` directory into `Animated/`.

Also, reconfigures all references to `Animated/src/` to just be `Animated/`.

Changelog:
[Internal]

Reviewed By: cpojer

Differential Revision: D22450848

fbshipit-source-id: 9fd4861e9f357d817d82e9fec71967a2936a3830
2020-08-25 14:15:35 -07:00
Tim Yung 982272932c RN: Remove `fbjs/warning` Dependency
Summary:
Replaces `fbjs/warning` call sites in React Native with `console.warn`. A few warnings will now log as warnings without the "Warning:" prefix.

Changelog:
[General][Changed] - Some warnings changed to use `console.warn` without the "Warning:" prefix.

Reviewed By: TheSavior, cpojer

Differential Revision: D22445946

fbshipit-source-id: 96b01e1bdee52b89ff3b808bc9d6cd494f6787f5
2020-08-25 14:15:35 -07:00
Jordan Brown 4aa69e634d 0.132 for xplat
Summary:
Changelog: [Internal]

0.132 for xplat/js

allow-large-files

Reviewed By: mroch

Differential Revision: D23298358

fbshipit-source-id: 0c75746c0cc2895f63ebc034df386217ffb64c61
2020-08-25 07:33:13 -07:00
Peter Argany 75197dbb16 Pass RCTSurfacePresenter into RCTNativeAnimatedNodesManager in bridgeless
Summary:
This diff ties the stack together. It completes the long chain of RCTSurfacePresenter ownership:

`FBReactModule` -> `RCTNativeAnimatedTurboModule` (this diff and D23272746)
`RCTNativeAnimatedTurboModule` -> `RCTNativeAnimatedNodesManager` (this diff)
`RCTNativeAnimatedNodesManager` -> `RCTPropsAnimatedNode` (D23272735)

It completes animations working without the bridge.

Changelog: [Internal]

Differential Revision: D23272755

fbshipit-source-id: 137f7ff89993a2cb644bd67869eb685afcec4068
2020-08-24 16:37:50 -07:00
Peter Argany 700960c9f1 Pass SurfacePresenter directly instead of relying on bridge
Summary:
`RCTPropsAnimatedNode` uses the bridge to access it's current surface presenter to perform animations.

In bridgeless mode, the surface presenter is not owned by the bridge. Instead, pass the surface presenter through the ownership chain:
`RCTNativeAnimated*Module` -> `RCTNativeAnimatedNodesManager` -> `RCTPropsAnimatedNode`

`RCTSurfacePresenter` should not be strongly held by any of these animation internals. If it gets destroyed at a higher level, animations should not be completed.

Changelog: [Internal]

Differential Revision: D23272735

fbshipit-source-id: ce08ee3b59ac2ba70e31cebb7ba8e9f3a644c848
2020-08-24 16:37:49 -07:00
Peter Argany e1d53ce697 Create init method for RCTNativeAnimatedModule and it's TM fork
Summary:
The animated native module relies on `setBridge` to perform generic setup which doesn't rely on the bridge at all. This diff refactors that setup code to an `init` function.

Changelog: [Internal]

Differential Revision: D23272427

fbshipit-source-id: 0c9c5522c9044283f4db25360010465ff42aba25
2020-08-24 16:37:49 -07:00
Tim Yung 8edd2e3ef6 RN: Extract `ScrollViewContext`
Summary:
Extracts `ScrollViewContext` so that other components can use it without requiring `ScrollView` as a dependency.

Changelog:
[Internal]

Reviewed By: kacieb

Differential Revision: D22670035

fbshipit-source-id: 7f902697ad2a60cd1869438e9a2b77e479a18065
2020-08-24 15:24:49 -07:00
Joshua Gross 19c45ba709 NativeAnimatedModule: allow JS to control queueing of Animated operations (JS Side)
Summary:
This is the JS side of D23010844 (73242b45a9).

In the past I tried a few heuristics to guess when a batch of Animated Operations were ready, and none of these were super reliable. But it turns out we can safely allow JS to manage that explicitly.

Non-Fabric still uses the old behavior which seems fine.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D23010937

fbshipit-source-id: 4a513672c166ceaa8b6daa387e46a2a95b60ce53
2020-08-24 01:20:47 -07:00
David Vacca 62de5c001c Migrate AndroidProgressBarComponent to Fabric
Summary:
This diff migrates AndroidProgressBar component to Fabric

changeLog: [internal] internal

Reviewed By: sammy-SC

Differential Revision: D23227857

fbshipit-source-id: c5cbbdcc36e63226286cd714d601f0d4690496b2
2020-08-22 01:46:03 -07:00
Lulu Wu f0ebfe380c Convert RCTFileReaderModule to avoid using bridge
Summary:
Changelog:
[iOS][Changed] - DescriptionConvert RCTFileReaderModule to avoid using bridge

Reviewed By: PeteTheHeat

Differential Revision: D23264211

fbshipit-source-id: 7d92749238aa45b4ff1b39c961e1b471f15df252
2020-08-21 17:18:50 -07:00
Peter Argany 4231551270 Lazily create NativeTVNavigationEventEmitter
Summary:
Every single RN iOS application is initializing this native module on first bundle load, regardless if it is used or not. This wrapperModule makes it lazy.

Changelog: [Internal]

Reviewed By: TheSavior

Differential Revision: D23175668

fbshipit-source-id: 0424a62d6c0b4fe7d5ce95f6c96e641a03b5fb2c
2020-08-17 17:01:40 -07:00
Agastya Darma d1f217e829 chore: use es6 import for DrawerLayoutAndroid (#29639)
Summary:
Migrating DrawerLayoutAndroid component to use ES6 import

Slowly migrate each file to use es6 import/exports to make this discussion happen
react-native-community/discussions-and-proposals#201 (comment)

## Changelog
[General] [Changed] - Use ES6 import/export syntax for DrawerLayoutAndroid component

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

Test Plan: Manual RNTester for Android

Reviewed By: TheSavior

Differential Revision: D23110137

Pulled By: mdvacca

fbshipit-source-id: a43b4f3981335c9f532185cec8957e46f35aac7b
2020-08-17 12:52:40 -07:00
Rick Hanlon abba44de1e Re-land React Sync b5c6dd2...a437f3ff3
Summary:
This is attempt 3 of upgrading React for React Native.

Changelog: [Internal]

Reviewed By: gaearon

Differential Revision: D23162240

fbshipit-source-id: b1f2659481e9f13df8683a34178a46dd64373bf7
2020-08-17 11:49:03 -07:00
Rick Hanlon 208ebed074 Switch TextInput to useLayoutEffect
Summary:
This diff fixes an issue in `TextInput` where `TextInputState.currentlyFocusedInputRef` could maintain a ref to a view that no longer exists. This issue was exposed when upgrading React, where cleanups for passive effects are deferred. This change means that `inputRef.current` would no longer reference the host view *to be* destroyed; it would be null because the view was *already destroyed*.

There are two fixes here that would independently fix the bug and fix the issue better together.

First, we convert `useEffect` to `useLayoutEffect`. `useLayoutEffect` is intended to fire synchronously after all host view mutations, and the cleanup function is intended to fire synchronously before the host view is destroyed, similar to the behavior assumed before. This change is now the correct function to use semantically. However, if we made this change without the second then any change in the order the effects fire would surface the same bug.

So second, move the `inputRefValue).blur()` call to the same effect as unregistering. This is because we currently require the `blur` effect to be called to null out `currentlyFocusedInputRef` in addition to calling `unregisterInput`. That makes the semantic ordering of effects in `TextInput` meaningful. Instead, when a TextInput is unregistered we should always `blur` to clear the `currentlyFocusedInputRef`, which will prevent dispatching events to a view that doesn't exist. If we made this change without the first then there's would be a race condition between calling blur on a TextInput and when that TextInput has been unregistered.

Changelog: [Internal]

Reviewed By: JoshuaGross

Differential Revision: D23035358

fbshipit-source-id: ab686b8046d85e2becd8b879b0b4b7e69e672754
2020-08-13 20:02:22 -07:00
Vojtech Novak e27d656ef3 improve "not a registered callable module" error message (#28913)
Summary:
Motivation:

`Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication).` is an error that happens rarely, and most SO answers end up recommending to use `react-native bundle` to work around. I stumbled upon this error the other day and it took me a while to figure out that the error was caused by the fact that my `entryFile` path was pointing to an existing but invalid file. I figured it would be nice to mention this because I believe this will be a frequent cause of the error.

## 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] - improve "not a registered callable module error message"

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

Test Plan:
tested locally with RNTester, prints

```
[Sun May 17 2020 18:15:55.396]  ERROR    Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication). This can happen when the application entry file path is incorrect.
      On Android, verify 'getJSMainModuleName()' in 'MainApplication.java' and 'project.ext.react.entryFile' in 'android/app/build.gradle'.
      On iOS, verify '- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge' in 'AppDelegate.m' and 'ENTRY_FILE' env. variable passed to 'react-native-xcode.sh' (if any) in 'Build Phases' -> 'Bundle React Native code and images'.
```

in metro logs

Reviewed By: mdvacca

Differential Revision: D23107228

Pulled By: fkgozali

fbshipit-source-id: 0712ed7e593ba96b041578bafdbefcd09a3994b7
2020-08-13 18:30:38 -07:00
Christoph Nakazawa 1f15b8b6c2 Create a `metro-runtime` module
Summary: Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D23053465

fbshipit-source-id: 17cc3153c2bfddf06099821af9e63c184a53b1de
2020-08-13 11:58:38 -07:00
Joshua Gross 4c0d802b4f Ensure that Pressability no longer calls configured callbacks after unmount
Summary:
Previously `reset` was not doing anything about configured callbacks, and after unmount (especially in Fabric) it was possible for callbacks to be called on unmounted nodes due to race conditions.

Changelog: [Internal]

Reviewed By: lunaleaps

Differential Revision: D23041046

fbshipit-source-id: eb9ebc8e99a0d244a2033e97178bf8ede8b5c7b2
2020-08-10 16:43:49 -07:00
Joshua Gross 862e029068 Fix crash that occurs by checking for NativeAnimatedModule too early
Summary:
In D22801173 (9e6ba9ddb8) I introduced a mechanism to queue Animated operations on the JS side until all mounting effects were finished. I also added an unnecessary check that the NativeAnimated module is loaded, and it seems like if it's called too early, before the NM is initialized, it will crash.

It's not necessary in these two methods, so we just delete the invariant check.

Changelog: [Internal]

Reviewed By: lunaleaps

Differential Revision: D23040331

fbshipit-source-id: e70ec887695b9abefa0f01408a4a1c2749946d1c
2020-08-10 16:43:49 -07:00
Samuel Susla 8fc8cd9aea Add todo notes for nativeID hack
Summary: Changelog: [internal]

Reviewed By: JoshuaGross

Differential Revision: D23003735

fbshipit-source-id: 7814de9e1d280604842e47a969ab3e8d453c50a8
2020-08-10 15:37:12 -07:00
Joshua Gross 73242b45a9 NativeAnimatedModule: allow JS to control queueing of Animated operations
Summary:
In the past I tried a few heuristics to guess when a batch of Animated Operations were ready, and none of these were super reliable. But it turns out we can safely allow JS to manage that explicitly.

Non-Fabric still uses the old behavior which seems fine.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D23010844

fbshipit-source-id: 4c688d3a61460118557a4971e549ec7457f3eb8f
2020-08-09 01:39:29 -07:00
Samuel Susla d1b507a5c3 Fix animation of PDP dismissal
Summary:
Changelog: [Internal]

If animated component is managed by Fabric, prevent view flattening by setting nativeID.

Reviewed By: shergin

Differential Revision: D22998746

fbshipit-source-id: b9645537454f11fce3bb0e268db91219f5c6dc42
2020-08-07 08:36:55 -07:00