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

6 Коммитов

Автор SHA1 Сообщение Дата
HeyImChris 793ebb8ba8
Merge 0.66 into master (#951)
* Rename immediate to ReactNativeMicrotask in Bridge

Summary:
Changelog: [Internal]

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

Note that this diff is part of a larger refactoring.

Reviewed By: RSNara

Differential Revision: D29785430

fbshipit-source-id: 7325d2a7358a6c9baa3e9abb8acf90414de5072f

* Implement View.removeClippedSubviews prop

Summary:
Changelog: [internal]

Fabric didn't have prop [removeClippedSubviews](https://reactnative.dev/docs/view#removeclippedsubviews) implemented. This diff adds it. It is

Reviewed By: JoshuaGross

Differential Revision: D29906458

fbshipit-source-id: 5851fa41d7facea9aab73ca131b4a0d23a2411ea

* Add "Use Native Driver" control to RNTester Animated Composing example

Summary: Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D29832704

fbshipit-source-id: dfd37d08d0f25fe86716a21682648894e8adad8b

* docs: Fix dead links in README for rn-tester (#31901)

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

~Updated link in README that was pointing to master branch to main branch~

Realized that link in rn-tester README and ReactAndroid README leads to a dead link, so I've fixed the links

## Changelog

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

[INTERNAL] [FIXED] - Fix dead links in README

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

Test Plan: - [ ] Updated link directs you to appropriate page

Reviewed By: PeteTheHeat

Differential Revision: D29933044

Pulled By: GijsWeterings

fbshipit-source-id: c1f301626acbb2995d74f78d8bc19214c70e9319

* docs: update links to forwarded page (#31903)

Summary:
Some of the links in `CONTRIBUTING.md` redirects you to a different page.
I've fixed the links so each link would directly send users to the appropriate page.

## Changelog

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

[INTERNAL] [Changed] - update links in CONTRIBUTING.md

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

Test Plan: - [ ] Change links shows the appropriate content

Reviewed By: lunaleaps

Differential Revision: D29933105

Pulled By: GijsWeterings

fbshipit-source-id: b5be74181f8a8e88d8f43e44c469337b7393dedf

* Remove redundant warnings for RCTMountingManager

Summary:
Changelog: [internal]

The warnings are in-actionable for product engineers.

Reviewed By: JoshuaGross

Differential Revision: D29911438

fbshipit-source-id: f0f81588e8cbe88059e531c8be302ab19b8eb83f

* Ignore when a text string or number is supplied as a child.

Summary:
Currently, React Native throws an invariant violation error when a text string or number is supplied as a child. This is undesirable because core library components should be fault-tolerant and degrade gracefully (with soft errors, if relevant).

This change will work when a change in the host configs are landed (https://github.com/facebook/react/pull/21953).

Changelog: [internal]

Reviewed By: yungsters, sammy-SC

Differential Revision: D29894182

fbshipit-source-id: 827ff299991a476b57981382d196c7ee1396ec28

* React Native sync for revisions cae6350...419cc9c

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

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

jest_e2e[run_all_tests]

Reviewed By: JoshuaGross

Differential Revision: D29913856

fbshipit-source-id: 58e4903766a312a64a17cfba0b0f684cf4bcacb0

* Remove option to make measure calls asynchronous

Summary:
Changelog: [internal]

Making measure calls asynchronous in Fabric regresses core metrics, let's remove the option.

Reviewed By: JoshuaGross

Differential Revision: D29909385

fbshipit-source-id: eea3fefc8da757c8db82cb0af340650e2ce6a947

* Fix android view dimensions

Summary:
This diff fixes the Android View dimensions in VR

PixelUtil.toSPFromPixel and PixelUtil.getDisplayMetricDensity() are both using getScreenDisplayMetrics() to perform conversion of dimensions. This is not correct because we should take into consideration the density of the Context / Activity instead of the Screen. This problem didn't raise before in Fabric Android because it seems that android OS on phones usually share the scale between the screen and the Activity?

These two methods are only used in Fabric and they were introduced by D9583972 (5c0da011cb) and D9173758 (8b5e3fc16b)

As part of this diff I'm also deleting the method toSPFromPixel in favor of toDIPFromPixel because I noticed the usages of these methods are meant to use toDIPFromPixel()

changelog: [Internal] internal

Reviewed By: JoshuaGross

Differential Revision: D29864944

fbshipit-source-id: a0a093c120bde21a6cf9e1043a83c31e870d4368

* Refactor DevServerHelper to separate checking if packager running

Summary:
Changelog: [Internal]
Separate the functionality of the  isPackagerRunning() function into a new class PackagerStatusCheck with the intention of being able to use this without needing a DevServerHelper

Reviewed By: makovkastar, ShikaSD

Differential Revision: D29933318

fbshipit-source-id: d708bb987b08634015d6ee6b6c8989faba416c5a

* Introduce queueMicrotask API

Summary:
Changelog:
[General][Added] - Add global.queueMicrotask

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

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

Reviewed By: RSNara

Differential Revision: D29838852

fbshipit-source-id: 8c4378b1b713fb8b0da5e67f92ba2ea9838766f7

* Shim Immediate APIs when Promise is queueing to JSVM

Summary:
Changelog: [Internal]

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

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

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

Reviewed By: RSNara

Differential Revision: D29845305

fbshipit-source-id: c2ed3fed426a5316b1e0dfbfaad51706d1765d4d

* Attempt to fix undefined instance handle in EventTarget

Summary:
changelog: [internal]

Completion block can retain `_eventEmitter` beyond existence of the component. To fix this, do not retain `_eventEmitter` by block but try to acquire it inside it.

Reviewed By: JoshuaGross

Differential Revision: D29969189

fbshipit-source-id: 456c42f816acc160f9d6bbd3f9c8c55d611940b2

* Makes "force" property available to Apple Pencil based events. (#31780)

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

For more detailed explanation, see issue https://github.com/facebook/react-native/issues/31779

React Native touch handler events (onTouchStart, onTouchMoved, etc..) are intended to have "force" properties when used on devices which support pressure input (3D Touch & Apple Pencil events). However, due to a check in RCTForceTouchAvailable() function which checks for UITraitCollection's "forceTouchCapability" to be equal to UIForceTouchCapabilityAvailable, the check returns NO on iPad-based devices, due to iPad devices returning UIForceTouchCapabilityUnavailable at all times. This causes "force" values of Apple Pencils to never be passed on to React Native.
Since simply passing 0 as a value for force across the RN bridge for every touch event seemed like a change that might seem jarring to some, I decided that a simple additional boolean check if the touch event's type is UITouchTypePencil (this is the same as UITouchTypeStylus) should also suffice.

## 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] - Fixed "force" property of touch events for Apple Pencil/Stylus devices.
[iOS] [Feature] - Added "altitudeAngle" property to touch events from Apple Pencil/Stylus devices.

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

Test Plan:
The code compiles and runs, and trying a simple handler for a View like
````
  touchMove = (e: GestureResponderEvent) => {
    console.log(`pressure, altitude (${e.nativeEvent.force}, ${e.nativeEvent.altitudeAngle})`);
````
results in
<img width="424" alt="Screen Shot 2564-06-28 at 17 13 22" src="https://user-images.githubusercontent.com/5000572/123621055-0b563f00-d835-11eb-9eff-526ba27fdf7b.png">
and when pencil is oriented perpendicular to the screen and pressed with full force shows
<img width="412" alt="Screen Shot 2564-06-28 at 17 13 58" src="https://user-images.githubusercontent.com/5000572/123621139-1c06b500-d835-11eb-8207-68a49720d708.png">

Reviewed By: sammy-SC

Differential Revision: D29964102

Pulled By: sota000

fbshipit-source-id: 5a1f41d64c6fe325afbd2b9579eaf20a522e92dc

* Fix typo in VirtualizedList-test.js (#31756)

Summary:
occured -> occurred

## Changelog

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

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

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

Test Plan: NONE

Reviewed By: lunaleaps

Differential Revision: D29975153

Pulled By: charlesbdudley

fbshipit-source-id: 966d90df0bf015b4a6a2e3b1bf88c66b61161a7a

* Pass context through to all prop parser (core changes)

Summary:
Unfortunately, parsing some props requires stateful context - namely, PlatformColor on Android. We explored several different options but they all seemed inferior to the approach of using ContextContainer, and most would require using global state.

By introducing this change everywhere as early as possible, we can avoid later pain. It is likely that some prop, on some platform, will require this mechanism. We'll be ready for it!

Because we can pass a constref of the ContextContainer through to all props and because the context and context data is never retained by prop parsers, perf and memory hit should be ~0.

This diff contains core changes only. Leaf changes to all props structs and conversions files will be in next diff(s).

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D29838789

fbshipit-source-id: f5090e7f02eb6e8fbe0ef4dd201e7d12104a3e3c

* Pass context through to all prop parser (props structs changes)

Summary:
See previous diffs for context. This updates all of the relevant props structs.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D29855426

fbshipit-source-id: 30177c3380ef82ecf8f2a4321f128cfbe8a576e0

* Pass context through to all prop parser (conversions.h)

Summary:
See previous diffs for context. This updates all conversions.h files.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D29855425

fbshipit-source-id: d5751ddfc2724392e3a35f5e22bb68574e95e737

* Pass PropsParserContext to prop parsing layer

Summary: Changelog: [internal]

Reviewed By: mdvacca

Differential Revision: D29921232

fbshipit-source-id: ba045f545b564aedf1b287045a0e75428de30a0f

* Fix typo in Constants.h (#31049)

Summary:
controling -> controlling

## Changelog

[Internal] [Fixed] - Fixed typo in comment

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

Test Plan: NONE

Reviewed By: lunaleaps

Differential Revision: D29980007

Pulled By: charlesbdudley

fbshipit-source-id: 419f28f08d74faa07db18a07ab41b62c41776344

* Daily `arc lint --take CLANGFORMAT`

Reviewed By: zertosh

Differential Revision: D29983521

fbshipit-source-id: bebd38e79180c544c8c1986605cc1af4b1f4df98

* Update Dimension.js typo (#29858)

Summary:
preferred instead of preffered

## Changelog

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

[CATEGORY] [TYPE] - Message

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

Reviewed By: charlesbdudley

Differential Revision: D29998754

Pulled By: sota000

fbshipit-source-id: f13fef58e9154ddf8087944d53e022fb9afa6b1b

* Make existential type an error in xplat

Summary:
This diff updates the xplat flowconfigs to make existential types an error.

Changelog: [Internal]

Reviewed By: pieterv

Differential Revision: D29967838

fbshipit-source-id: f08bbafe2a0269adb2c9afa4572b7a34fd254a4d

* Remove unused import (#30544)

Summary:
Remove unused import

## 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] [performance] - Remove unused import

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

Test Plan: Should build on CI

Reviewed By: lunaleaps

Differential Revision: D30000901

Pulled By: charlesbdudley

fbshipit-source-id: 3d3310917823b7af57564ca1ea397cd32cd0c4d5

* Updated TextInput autoCompleteType prop to autoComplete 1/2 (#26010)

Summary:
Fix for bug https://github.com/facebook/react-native/issues/26003 Rename TextInput prop "autoCompleteType" to "autoComplete".

## Changelog

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

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

Test Plan:
Test Pass

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

Reviewed By: mdvacca

Differential Revision: D29980220

Pulled By: lunaleaps

fbshipit-source-id: 3c9e7d3250b5f95b0dbd523fdb0d917a039cd6a9

* Implement PlatformColor in Fabric Android

Summary:
This diff implements PlatformColor in Fabric Android

changelog: [internal] internal

Reviewed By: JoshuaGross

Differential Revision: D29841461

fbshipit-source-id: 63a523626b021c634bc399e749b639b55730391a

* Allows to set individual (left,top,right,bottom) dotted/dashed borders (#29099)

Summary:
This issue:

fixes https://github.com/facebook/react-native/issues/24224 fixes https://github.com/facebook/react-native/issues/28695 fixes https://github.com/facebook/react-native/issues/23651 fixes https://github.com/facebook/react-native/issues/23475  fixes https://github.com/facebook/react-native/issues/22256 fixes https://github.com/facebook/react-native/issues/22226 fixes https://github.com/facebook/react-native/issues/19234 fixes  https://github.com/facebook/react-native/issues/18285  fixes https://github.com/facebook/react-native/issues/17344 fixes https://github.com/facebook/react-native/issues/17343 fixes https://github.com/facebook/react-native/issues/17251 fixes https://github.com/facebook/react-native/issues/12817 fixes https://github.com/facebook/react-native/issues/12403 fixes https://github.com/facebook/react-native/issues/11042 fixes https://github.com/facebook/react-native/issues/9343 fixes https://github.com/facebook/react-native/issues/8236 fixes https://github.com/facebook/react-native/issues/8105 fixes https://github.com/facebook/react-native/issues/7838 fixes https://github.com/facebook/react-native/issues/6721 fixes https://github.com/facebook/react-native/issues/5411 fixes https://github.com/facebook/react-native/issues/3159 fixes https://github.com/facebook/react-native/issues/2335 fixes https://github.com/facebook/react-native/issues/840 fixes https://github.com/facebook/react-native/issues/27133 fixes https://github.com/facebook/react-native/issues/28695

Allows to set individual (left,top,right,bottom) dotted/dashed borders.

If a single border is specified and the borderStyle is dotted or dashed, each border will be drawn with moveTo and lineTo taking in consideration of the border style and thickness.

## Changelog

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

[Android] [Fixed] - Quickfix individual border style dotted or dashed rendering as solid

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

Test Plan:
**<details><summary>CLICK TO OPEN TESTS RESULTS</summary>**
<p>

| **AFTER** | **AFTER** |
|:-------------------------:|:-------------------------:|
| <img src="https://user-images.githubusercontent.com/24992535/84158300-05e05800-aa6c-11ea-96a3-40007b2ca611.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158309-07aa1b80-aa6c-11ea-973b-51e8e68b5808.png"  width="300" height="" /> |

| **AFTER** | **AFTER** |
|:-------------------------:|:-------------------------:|
| <img src="https://user-images.githubusercontent.com/24992535/84158320-0d9ffc80-aa6c-11ea-9d7f-dfba49fbfe41.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158334-11cc1a00-aa6c-11ea-8422-cd5b9384f391.png"  width="300" height="" /> |

| **AFTER** | **AFTER** |
|:-------------------------:|:-------------------------:|
| <img src="https://user-images.githubusercontent.com/24992535/84158556-4c35b700-aa6c-11ea-9a4d-eea791b3813a.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158574-51930180-aa6c-11ea-8e84-526cfb168f49.png"  width="300" height="" /> |

| **AFTER** | **AFTER** |
|:-------------------------:|:-------------------------:|
| <img src="https://user-images.githubusercontent.com/24992535/84158586-55268880-aa6c-11ea-9540-51d79a8e4cb0.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158601-5952a600-aa6c-11ea-82e7-85d54b858f1a.png"  width="300" height="" /> |

| **AFTER** | **AFTER** |
|:-------------------------:|:-------------------------:|
| <img src="https://user-images.githubusercontent.com/24992535/84158638-62dc0e00-aa6c-11ea-8765-ecba0d9d126f.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158652-67a0c200-aa6c-11ea-8336-e6eb8aa52e96.png"  width="300" height="" /> |

| **AFTER** | **AFTER** |
|:-------------------------:|:-------------------------:|
| <img src="https://user-images.githubusercontent.com/24992535/84158690-738c8400-aa6c-11ea-9cf1-edec72d27cb7.png" width="300" height="" /> | <img src="https://user-images.githubusercontent.com/24992535/84158912-b6e6f280-aa6c-11ea-94a7-0ee0db685f38.png"  width="300" height="" /> |

</p>
</details>

Reviewed By: mdvacca

Differential Revision: D28688914

Pulled By: RSNara

fbshipit-source-id: 34781d63265dcf55e30f11c014e6b4a35d67dcbd

* Correct error message in getViewState method

Summary:
Changelog: [internal]

Here, getting `viewState` has failed, not its view property.

Reviewed By: mdvacca

Differential Revision: D30042652

fbshipit-source-id: 42831b577f17db1f64860e68be33870f5be27207

* Clean up RAIICallbackManager experiment

Summary:
This experiment was shipped in D27436402 (3d1afbbda3).

Changelog: [Internal]

Reviewed By: JoshuaGross

Differential Revision: D30023039

fbshipit-source-id: 5f7335f2ddaf6f4e2d876a917aaff2cf3d906b5c

* Stop sharing LongLivedObjectCollection with the bridge

Summary:
## Context
Previously, when you'd call TurboModule methods with JavaScript callbacks, we'd [store the callbacks](https://www.internalfb.com/code/fbsource/[c503ff1b38621aebca87b2bbebeae088b01886c4]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/platform/ios/RCTTurboModule.mm?lines=173%2C248-249) into [this global LongLivedObjectCollection collection](https://www.internalfb.com/code/fbsource/[c503ff1b38621aebca87b2bbebeae088b01886c4]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleUtils.h?lines=65). Then, when React Native's JavaScript VM got torn down, we'd [clear the global collection](https://www.internalfb.com/code/fbsource/[e26f476ce208c578f05b1edb7639d1dad5612c7d]/xplat/js/react-native-github/ReactCommon/react/nativemodule/core/ReactCommon/TurboModuleBinding.cpp?lines=49), which would ensure that we deleted all held jsi::Functions, before deleting the jsi::Runtime.

## Problem
With bridgeless mode enabled, there can be two TurboModule systems. Further, it is possible to tear down bridgeless mode, or the bridge, without tearing down the other initialization infra. In this scenario, the jsi::Function for the other initialization infra would also get deleted, which could lead to mysterious problems.

## Fix
In this diff, I refactored the jsi::Function cleanup in the TurboModule system. Now, there are 3 modes:
- kGlobalScope: Everything works as it did before
- kRCTGlobalScopeUsingRetainJSCallback: We still use the global LongLivedObjectCollection, but we do it through invoking a block passed to every ObjCTurboModule by the TurboModuleManager. This group exists to assess the impact of having each TurboModule retain/use the block. I suspect this will be negligible, but it'd be good to have actual data to back this claim.
- kRCTTurboModuleManagerScope: Every TurboModule uses a LongLivedObjectCollection that is owned by its TurboModuleManager. This should effectively fix the problem I outlined above.

Changelog: [Internal]

Reviewed By: p-sun

Differential Revision: D30019833

fbshipit-source-id: da50d884c7e37190107f570d8ed70eeda7d9ae83

* Stop sharing LongLivedObjectCollection with the bridge

Summary:
This is the Android analogue to D30019833.

Changelog: [Internal]

Reviewed By: p-sun

Differential Revision: D30029295

fbshipit-source-id: 13df0dfb915697eeedcc527dcdb6c246e89afb0c

* setup fragment based tab bar navigation

Summary: `Changelog: [Android] [Changed] - Make ReactFragment variables protected instead of private, create getter for ReactDelegate`

Reviewed By: keoskate

Differential Revision: D29981436

fbshipit-source-id: 3e5df811cd07edccf37f72c9f917f9ea0882be0b

* Remove 'using namespace facebook::jni'

Summary:
Ez diff to remove 'using namespace facebook::jni'

changelog: [internal] internal

Reviewed By: sshic

Differential Revision: D30046080

fbshipit-source-id: 52100970a408d772854cc0783fa13edd0cc39235

* Add TODO to fix and enable 'generated_tests-codegen_testsAndroid'

Summary:
Add TODO to fix and enable 'generated_tests-codegen_testsAndroid'

changelog: [internal] internal

Reviewed By: JoshuaGross

Differential Revision: D30046143

fbshipit-source-id: dbeba6f1d51b32c069bda8bb9ca976014d299dae

* Move RNTester Buck library to GitHub (#31435)

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

Moves the Facebook-internal Buck target definition for RNTester closer to the actual source files. This does not affect how RNTester is built in open source.

Changelog: [Internal]

Reviewed By: GijsWeterings

Differential Revision: D27942209

fbshipit-source-id: 66c970a5464a9329597d155ceeca78fb7f4834e8

* Move react-native Buck library to GitHub

Summary:
Moves the Facebook-internal Buck target definition for React Native closer to the actual JS source files. This does not affect how React Native is built in open source.

Changelog: [Internal]

Reviewed By: GijsWeterings

Differential Revision: D27942687

fbshipit-source-id: 328febb661ed6597feafdfd8efb2a95365325348

* Extract feature detection as an utilitiy module

Summary:
Changelog: [Internal]

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

Reviewed By: RSNara

Differential Revision: D29986750

fbshipit-source-id: 6e48e38d92ceccb35eead3c52e00e1eecb81b5b0

* Conditionalize the Regenerator Setup

Summary:
Changelog: [Internal]

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

This should save some work during the Core initialization.

Reviewed By: motiz88

Differential Revision: D29986751

fbshipit-source-id: 129f5122e8e4c05535ee2aa5da6970a66843e8cd

* Protect against crashes when over-releasing a TouchEvent

Summary:
It seems that, possibly due to optimizations and refactoring elsewhere in the event system, some TouchEvents are being over-disposed.

This doesn't really pose a problem besides performance; and could even indicate that an Event was in a pool but never properly initialized. In these
cases it seems perfectly reasonable to silently continue, and to log a soft exception. This WILL still crash in debug mode, so we can gather more information
if we find a good repro; otherwise we will continue to get production data from this soft exception if it's an issue and we can investigate further.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D30061178

fbshipit-source-id: 05d1f60afc382ce0a202ac8f3de34770cf9a760d

* Co-locate Buck targets for JS polyfills with their sources

Summary: Changelog: [Internal]

Reviewed By: GijsWeterings

Differential Revision: D30032230

fbshipit-source-id: 0d714b4e0a79a9c5c1c21e79f782635d8bd9c5f1

* chore: update Dimensions API Flow types (#31898)

Summary:
This small PR updates the Flow types used in Dimensions. The following changes has been made:
* generic types has been replaced with types from `NativeDeviceInfo` (which already were used in event subscription update)
* ~simplification of `DisplayMetricsAndroid` by spreading via intersection with `DisplayMetrics` type and removing shared properties~
  > I have tried both notations, but according to the lint, it looks like a Native Modules typing limitation which requires redundancy / code duplication in cases like this.

## Changelog

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

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

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

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

Reviewed By: yungsters

Differential Revision: D29932940

Pulled By: GijsWeterings

fbshipit-source-id: bf97bb972964c585207e2450ccf71d932555e291

* Fix order of calls for Native Animated Module

Summary:
Changelog: [internal]

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

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

Reviewed By: JoshuaGross

Differential Revision: D30035911

fbshipit-source-id: bbd698a96cada5d2b1312a1a689ca99b04a07cdc

* Merge BUCK file at Libraries/ into root

Summary:
Merges the Facebook-internal Buck target definitions in `Libraries/` into the BUCK file at the root of the repo (which is currently not synced to GitHub at all). This does not affect how React Native is built in open source.

Changelog: [Internal]

Reviewed By: GijsWeterings

Differential Revision: D27967499

fbshipit-source-id: 39c51a544b3868242598072d24cb6cfb5a6e2d8c

* Fix Buck package boundary violation in core components schema

Summary: Changelog: [Internal]

Reviewed By: GijsWeterings

Differential Revision: D29996246

fbshipit-source-id: e560c7261c4274da5219dc1e2d59d46b60e7549e

* Allow resolving view from FabricUIManager

Summary: Changelog: [Internal]

Reviewed By: JoshuaGross

Differential Revision: D30043188

fbshipit-source-id: d8675754b29fb58a28a06777f602098da6dbc27f

* Flush operations queue when animation starts

Summary:
changelog: [internal]

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

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

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

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

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

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

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

Reviewed By: JoshuaGross, p-sun

Differential Revision: D30053890

fbshipit-source-id: b7fe24861d5300f9cfefa813a53df8330fa56d86

* iOS: Log error when invalid NSNull data is passed to RCTAsyncLocalStorage

Summary: Changelog: [Internal]

Differential Revision: D30081478

fbshipit-source-id: 7d425e71b020eaeb4eb1b33b500fbf5df7ea9c29

* fbshipit-source-id: 909b2667480ed96ae376896d966f6c27f5e73964

* Update OSS Buck definitions (#31948)

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

Changelog: [Internal]

Adds necessary shims to bring our BUCK files closer to parsing/building correctly in open source. This is part of fixing the Buck-based tests on CircleCI which were broken by d4ee734f32.

Reviewed By: sammy-SC

Differential Revision: D30072866

fbshipit-source-id: 4aebd9f67dd0a102516603915d9a021032611279

* Update Android Dockerfile to include root BUCK file (#31950)

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

Changelog: [Internal]

Adds the root BUCK file to the Docker image we use to test RNTester on CircleCI. See df9cd05621

Reviewed By: ShikaSD

Differential Revision: D30099261

fbshipit-source-id: 936c505a0f4e7b791743901a06fa3b14c40b183e

* Check for negative `numberOfLines` in TextView

Summary:
Negative `numberOfLines` prop is not supported by Android and causes a crash during layout measurement. This change adds a check in JS to catch the error earlier.

Changelog: [Internal]

Reviewed By: GijsWeterings

Differential Revision: D30047103

fbshipit-source-id: 4248a0f573c3b6facd25c7ae6ce007a357a1469b

* Fix NPE when hierarchy return null values

Summary:
This diff fixes a NullPointer that was being thorwn when hierarchy values are null

changelog: [internal] internal

Reviewed By: sammy-SC

Differential Revision: D30095407

fbshipit-source-id: b0a13661b4506cf94eeb5d99923d4c12cba0f972

* Extend getInspectorDataForInstance to return props

Summary:
This diff extends the FabricUIManager.getInspectorDataForInstance to return the props of the React Native component associated to the view passed as a parameter.

changelog: [internal] internal

Reviewed By: sammy-SC

Differential Revision: D30095406

fbshipit-source-id: 50fdba6636a1f5042dbc113e341c3cb2534a1b04

* Add documentation for FabricUIManager.getInspectorDataForInstance

Summary:
Add documentation for FabricUIManager.getInspectorDataForInstance

changelog: [internal] internal

Reviewed By: sammy-SC

Differential Revision: D30095818

fbshipit-source-id: dfe8590598099e7581460ca45bc0e779690463a6

* chore: remove FlowFixMe (#29468)

Summary:
Removed FlowFixMe that has been fixed

## 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] - Removed FlowFixMe that has been fixed

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

Test Plan: flow check passes

Reviewed By: JoshuaGross

Differential Revision: D29967702

Pulled By: lunaleaps

fbshipit-source-id: 541279287ba6f21c5c7290bcba7c282f092126ff

* Move RCT* Buck targets to GitHub

Summary: Changelog: [Internal]

Reviewed By: GijsWeterings

Differential Revision: D30030454

fbshipit-source-id: 02a4c36f5c5ca519e4de3d1a3d79708d0d0b6d01

* Move integration test Buck targets to GitHub

Summary: Changelog: [Internal]

Reviewed By: GijsWeterings

Differential Revision: D30032467

fbshipit-source-id: 56e293c821f02e78fe13f5e7f22bcb2b2050019a

* Move RNTester unit/integration test Buck targets to GitHub

Summary: Changelog: [Internal]

Reviewed By: GijsWeterings

Differential Revision: D30032476

fbshipit-source-id: d1f9a39a6d2fc92f69b9ee931c2a0f3ba37687f6

* Move RCTTestApple into packages/rn-tester

Summary: Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D30056021

fbshipit-source-id: 9012ca6934f95946ff157ca472aa6a6e84d7d7e9

* React Native sync for revisions 419cc9c...19092ac

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

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

jest_e2e[run_all_tests]

Reviewed By: JoshuaGross

Differential Revision: D30092460

fbshipit-source-id: 9f118db2419a9a5db26a9b873868f91ab88f2f89

* refactor!: drop deprecated `StatusBarIOS` (#31466)

Summary:
This component has been merged with `StatusBar` and deprecated since [Jun 24, 2019](a833778553)

## Changelog

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

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

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

Test Plan: Warning when user imports `StatusBarIOS`

Reviewed By: yungsters

Differential Revision: D30109324

Pulled By: lunaleaps

fbshipit-source-id: fa2d3aa2cf35206ed8a196e09f12af57d3b61ccc

* Fix OSS Buck parsing errors (#31957)

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

Changelog: [Internal]

Some fixes for the GitHub shims for FB-internal Buck macros. Should fix the Buck-related breakages in the `test_android` and `test_docker` CI jobs.

Also adds license headers to some recently-added files that didn't have them.

Reviewed By: mdvacca

Differential Revision: D30114177

fbshipit-source-id: 88a24fa7130bd98dd60568566bde51fcfc89df60

* Fix Buck package boundary violation involving RCTEventDispatcher.h (#31965)

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

Changelog: [Internal]

Reviewed By: GijsWeterings

Differential Revision: D30030580

fbshipit-source-id: 3b4140a831c7ad7282aae0ff79c54014dcd82615

* Remove package boundary exceptions in OSS Buck config

Summary: Changelog: [Internal]

Reviewed By: stepancheg

Differential Revision: D30102445

fbshipit-source-id: 571ab5dc41379e01d4482f64418f6383f660dbfa

* Update JSLoader.cpp (#29270)

Summary:
Since react-native-cli is deprecated, the correct command should be `npx react-native start`

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

Reviewed By: sammy-SC

Differential Revision: D30017028

Pulled By: sota000

fbshipit-source-id: cfcf9e1d150f51750a4e86133bd3167506ee7348

* Warn when negative `numberOfLines` prop set on <Text/> component

Summary:
Updates previous variant that was crashing a surface to the non-crashing variant.
Now it prints error in console and modifies value to be 0.

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

Reviewed By: yungsters

Differential Revision: D30129658

fbshipit-source-id: fda47a262365573514d3e1e4bf8a26f6d30cdae0

* Make So loading inside generated TMM delegates less confusing

Summary:
## Rationale
Inlining the maybeLoadSoLibrary private static method makes following the So load chain from TurboModuleManagerDelegate through ReactPackageTurboModuleManagerDelegate to each app's TurboModuleManagerDelegate much easier to understand.

Changelog: [Internal]

Reviewed By: sshic

Differential Revision: D30082675

fbshipit-source-id: ff467d6ac8c792317dd9bdcd91844d3b480cbb60

* Add TODOs to unify component names between JS - Android - iOS - C++

Summary:
EZ diff that adds a few TODOs to unify component names between JS - Android - iOS - C++
see task: T97384889

changelog: [internal] internal

Reviewed By: sammy-SC

Differential Revision: D30139942

fbshipit-source-id: 91f51d04e7e7ecba7f059f94a121be43d820647d

* Replace Paper -> old renderer

Summary:
Replace Paper -> old renderer

changelog: [internal] internal

Reviewed By: sammy-SC

Differential Revision: D30139941

fbshipit-source-id: 3bb1e81a3df018aa669f3dba1de445107d70116c

* Fix Deadlock in RCTi18nUtil (iOS) (#31032)

Summary:
Note: PR to react-native-macos here https://github.com/microsoft/react-native-macos/pull/733

Internally in Microsoft code, we ran into a deadlock where the main queue and the UIManager queue were both trying to access `[RCTI18nUtil sharedInstance]`, and were blocked on each other. This is similar to an earlier issue with RCTScreenScale decsribed [here](https://github.com/facebook/react-native/issues/18096).

To summarize:
1- RCTShadowView (on the UIManager queue) and RCTView (on the main queue) both try to access `[RCTI18nUtil sharedInstance]`
2- The UIManager thread gets there first, and lazily initializes the sharedInstance. Meanwhile, the main thread is waiting on a lock possessed by the UIManager thread
3- As part of the initialization, we set an NSUserDefault, which seems to require the (blocked) main thread.
4- Deadlock.

For whatever reason, this only happens on debug. I did not figure out why, but I do know based on [this comment](https://github.com/facebook/react-native/issues/18096#issuecomment-368718081), that the UIManagerQueue should never block the main queue.

The fix is to not use NSUserDefaults, and simpy use atomic properties instead. We get the thread safety for free, and it also simplifies the code somewhat without changing the public API. The downside is values aren't persisted anymore, but I do not think that was necessary / intended.

## Changelog

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

[iOS] [Fixed] - Fix deadlock on RCTi18nUtil

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

Test Plan:
Ran the RTLExample in RNTester, and ensured switching to RTL still worked, and that setting forceRTL would still work after reloading the bundle.

https://user-images.githubusercontent.com/6722175/108775429-aefdae80-7526-11eb-9a89-3114f7ddc2af.mov

Reviewed By: javache

Differential Revision: D29522152

Pulled By: RSNara

fbshipit-source-id: 160840f63a7b1d6721b0fd8294fb11990a4509fa

* Codegen: Always prepare filesystem

Summary:
For any Pod that uses the codegen, create references to code-gen'd files in local filesystem regardless of Pod install status by invoking the same command used by `prepare_command` whenever `pod install` is run.

This works around the issue where CocoaPods may decide to skip running `prepare_command`. While this is expected CocoaPods behavior, external factors may result in the deletion of the original code-gen'd files in which case we need to make sure that running `pod install` will bring these files back.

See Test Plan for more details on how to reproduce the issue being fixed.

Fixes T97404254.

Changelog:

[Internal] Codegen invoked with every `pod install` regardless of pod install status

Differential Revision: D30116640

fbshipit-source-id: 81db5dff1d4c4f8ae22b5dbe822609c770789ac8

* - Bump CLI to ^6.0.0 (#31971)

Summary:
Upgrade CLI to the v6 stable. [Changelog](https://github.com/react-native-community/cli/releases/tag/v6.0.0)

## 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] [Fix] - Bump CLI to ^6.0.0

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

Test Plan: cc kelset grabbou

Reviewed By: TheSavior

Differential Revision: D30158170

Pulled By: ShikaSD

fbshipit-source-id: 392e22cb112a830778149b4a2b4a19198facf42b

* Fix to make taps on views outside parent bounds work on Android (#29039)

Summary:
By default, Views in React Native have `overflow: visible`. When a child view is outside of the parent view's boundaries, it's visible on Android, but not tappable. This behaviour is incorrect, and doesn't match iOS behaviour.

- Taps on Views outside the bounds of a parent with `overflow: visible` (or unset) should register
- Taps on Views outside the bounds of a parent with `overflow: hidden` should continue to not register

Related issues:

- fixes https://github.com/facebook/react-native/issues/21455
- fixes https://github.com/facebook/react-native/issues/27061
- fixes https://github.com/facebook/react-native/issues/27232

### Fix

- Made `findTouchTargetView` not check that the touch was in the bounds of the immediate children, but instead
  - Check that the touch is in its own bounds when returning itself
  - Check that the touch for a child is in its own bounds only when `overflow: hidden` is set
- Modified related code to adjust to this change
- Added RNTesterApp test

## Changelog

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

[Android] [Fixed] - Allow taps on views outside the bounds of a parent with `overflow: hidden`

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

Test Plan:
This can be tested with 2 examples added to the bottom of the PointerEvents page of the RNTesterApp:

| Before | After |
| --- | --- |
| ![Before](https://user-images.githubusercontent.com/2937410/83610933-19079b00-a535-11ea-8add-22daae0191e1.gif) | ![After](https://user-images.githubusercontent.com/2937410/83610583-8830bf80-a534-11ea-97e2-71e180a70343.gif) |

Reviewed By: ShikaSD

Differential Revision: D30104853

Pulled By: JoshuaGross

fbshipit-source-id: 644a109706258bfe829096354dfe477599e2db23

* Create slider accessibility delegate in createViewInstance (#31942)

Summary:
Recent change in https://github.com/facebook/react-native/pull/31865 made it so if `ReactSliderManager` is created on the react context creation thread it will crash with the following error. This happens because `ReactAccessibilityDelegate` tries to create a handler on a thread without a looper.

This seems to happen because react-native-reanimated tries to get the UIManager module during its initialization which will cause view managers to be created and explains why the crash probably does not happens in RNTester or using only RN bundled modules.

```
08-03 14:44:56.318 21206 21360 E AndroidRuntime: FATAL EXCEPTION: create_react_context
08-03 14:44:56.318 21206 21360 E AndroidRuntime: Process: com.th3rdwave, PID: 21206
08-03 14:44:56.318 21206 21360 E AndroidRuntime: java.lang.ExceptionInInitializerError
08-03 14:44:56.318 21206 21360 E AndroidRuntime: 	at com.facebook.react.shell.MainReactPackage.createViewManagers(MainReactPackage.java:166)
08-03 14:44:56.318 21206 21360 E AndroidRuntime: 	at com.facebook.react.ReactInstanceManager.getOrCreateViewManagers(ReactInstanceManager.java:882)
08-03 14:44:56.318 21206 21360 E AndroidRuntime: 	at com.facebook.react.CoreModulesPackage.createUIManager(CoreModulesPackage.java:137)
08-03 14:44:56.318 21206 21360 E AndroidRuntime: 	at com.facebook.react.CoreModulesPackage.getModule(CoreModulesPackage.java:102)
08-03 14:44:56.318 21206 21360 E AndroidRuntime: 	at com.facebook.react.TurboReactPackage$ModuleHolderProvider.get(TurboReactPackage.java:159)
08-03 14:44:56.318 21206 21360 E AndroidRuntime: 	at com.facebook.react.TurboReactPackage$ModuleHolderProvider.get(TurboReactPackage.java:147)
08-03 14:44:56.318 21206 21360 E AndroidRuntime: 	at com.facebook.react.bridge.ModuleHolder.create(ModuleHolder.java:191)
08-03 14:44:56.318 21206 21360 E AndroidRuntime: 	at com.facebook.react.bridge.ModuleHolder.getModule(ModuleHolder.java:156)
08-03 14:44:56.318 21206 21360 E AndroidRuntime: 	at com.facebook.react.bridge.NativeModuleRegistry.getModule(NativeModuleRegistry.java:153)
08-03 14:44:56.318 21206 21360 E AndroidRuntime: 	at com.facebook.react.bridge.CatalystInstanceImpl.getNativeModule(CatalystInstanceImpl.java:486)
08-03 14:44:56.318 21206 21360 E AndroidRuntime: 	at com.facebook.react.bridge.CatalystInstanceImpl.getNativeModule(CatalystInstanceImpl.java:462)
08-03 14:44:56.318 21206 21360 E AndroidRuntime: 	at com.facebook.react.bridge.ReactContext.getNativeModule(ReactContext.java:176)
08-03 14:44:56.318 21206 21360 E AndroidRuntime: 	at com.swmansion.reanimated.NodesManager.<init>(NodesManager.java:153)
08-03 14:44:56.318 21206 21360 E AndroidRuntime: 	at com.swmansion.reanimated.ReanimatedModule.getNodesManager(ReanimatedModule.java:101)
08-03 14:44:56.318 21206 21360 E AndroidRuntime: 	at com.swmansion.reanimated.ReanimatedJSIModulePackage.getJSIModules(ReanimatedJSIModulePackage.java:17)
08-03 14:44:56.318 21206 21360 E AndroidRuntime: 	at com.th3rdwave.MainApplication$1$1.getJSIModules(MainApplication.java:135)
08-03 14:44:56.318 21206 21360 E AndroidRuntime: 	at com.facebook.react.ReactInstanceManager.createReactContext(ReactInstanceManager.java:1329)
08-03 14:44:56.318 21206 21360 E AndroidRuntime: 	at com.facebook.react.ReactInstanceManager.access$1100(ReactInstanceManager.java:136)
08-03 14:44:56.318 21206 21360 E AndroidRuntime: 	at com.facebook.react.ReactInstanceManager$5.run(ReactInstanceManager.java:1058)
08-03 14:44:56.318 21206 21360 E AndroidRuntime: 	at java.lang.Thread.run(Thread.java:923)
08-03 14:44:56.318 21206 21360 E AndroidRuntime: Caused by: java.lang.RuntimeException: Can't create handler inside thread Thread[create_react_context,5,main] that has not called Looper.prepare()
08-03 14:44:56.318 21206 21360 E AndroidRuntime: 	at android.os.Handler.<init>(Handler.java:227)
08-03 14:44:56.318 21206 21360 E AndroidRuntime: 	at android.os.Handler.<init>(Handler.java:129)
08-03 14:44:56.318 21206 21360 E AndroidRuntime: 	at com.facebook.react.uimanager.ReactAccessibilityDelegate$1.<init>(ReactAccessibilityDelegate.java:185)
08-03 14:44:56.318 21206 21360 E AndroidRuntime: 	at com.facebook.react.uimanager.ReactAccessibilityDelegate.<init>(ReactAccessibilityDelegate.java:184)
08-03 14:44:56.318 21206 21360 E AndroidRuntime: 	at com.facebook.react.views.slider.ReactSliderManager$ReactSliderAccessibilityDelegate.<init>(ReactSliderManager.java:281)
08-03 14:44:56.318 21206 21360 E AndroidRuntime: 	at com.facebook.react.views.slider.ReactSliderManager.<clinit>(ReactSliderManager.java:301)
```

To fix it I changed the delegate creation to be done in `createViewInstance` which will be called on main thread. This is also more in line with how other accessibility delegates are created for other view managers. Since Slider is probably not used a lot, creating more delegate instance won't be an issue.

Another alternative could be to initialize a Looper on the thread that creates the react context, but it seems more involved and probably not needed.

## Changelog

[Android] [Fixed] - Create slider accessibility delegate in createViewInstance

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

Test Plan: Reproduced the crash in an app and made sure this patch fixes it.

Reviewed By: JoshuaGross

Differential Revision: D30167451

Pulled By: p-sun

fbshipit-source-id: 5327130064db52ac0086e1ae5541a1b3e3954f15

* Flush operations queue when animation starts in RCTNativeAnimatedModule

Summary:
changelog: [internal]

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

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

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

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

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

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

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

Reviewed By: RSNara

Differential Revision: D30099010

fbshipit-source-id: d3fc021dd4346d1cbbda3b49ecd9d982c543e705

* Add Flow libdefs for `global`

Summary:
Changelog: [Internal]

Currently, `global` is typed as `any` and any `global` properties
accesses are untyped. This diff add a flow libdefs for the `global`
object as a start point.

Reviewed By: yungsters

Differential Revision: D30000895

fbshipit-source-id: ab6988d01921a3c2a3434b534b2f69083570fb6d

* Feat/dynamic color borders (#31140)

Summary:
Following up my issue https://github.com/facebook/react-native/issues/30377 I decided to have a look myself and contribute.

On iOS, border colors using `PlatformColor` or `DynamicColorIOS` do not update on the fly when the system appearance updates.
When the component mounts, the color is correct for the current appearance, but a component unmout/remount is required in order to see the color changing after a system appearance change.

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

## 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] - Added `PlatformColor` and `DynamicColorIOS` examples to RNTester

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

Test Plan:
I added 2 border examples, one using `PlatformColor` and the other using `DynamicColorIOS`. I recorded the following before/after videos showing the effect of my changes:

https://user-images.githubusercontent.com/4186230/110828711-9c5dd600-8297-11eb-8bc8-bdc9054b6b44.mov

https://user-images.githubusercontent.com/4186230/110828800-b4cdf080-8297-11eb-9d23-07f69dc3a702.mov

Reviewed By: lunaleaps

Differential Revision: D30073335

Pulled By: charlesbdudley

fbshipit-source-id: 2990a6ed40dd08fc2b1f20e93d6f21ec3d8980da

* Cleanup warnings in the NDK build

Summary:
This diff is cleaning up some configurations in the `Android.mk` files
of the native build. Specifically I simplified some of the rules and removed
a duplicate file specification.

Changelog:
Internal - Cleanup warnings in the NDK build

Reviewed By: ShikaSD

Differential Revision: D30220715

fbshipit-source-id: a100953fe977879a6d28cb0a2ef4b3358fb7c774

* Back out "Flush operations queue when animation starts in RCTNativeAnimatedModule"

Summary:
Changelog: [internal]

Original commit changeset: d3fc021dd434

Reviewed By: motiz88

Differential Revision: D30223203

fbshipit-source-id: 8edf79e109858855d13a36fabab2bcae36180df2

* Fix Undefined symbol: __swift_FORCE_LOAD_$_swiftFileProvider when building with Xcode 13

Summary:
Changelog: Fix Xcode 13 build error in HelloWorld template

Error:
{F640400959}

Fix:
Embed `libswiftFileProvider.tbd` in app.

Reviewed By: hramos

Differential Revision: D30192423

fbshipit-source-id: 59dbde441e61bc6ab870e2324e5202f4772bee8e

* introduce RCTPlatformColorUtils

Summary:
Changelog: [Internal]

in this diff, we add the logic to handle converting PlatformColor strings to their corresponding RGBA values, using `UIColor`'s API as the source of truth of these colors.

functionality not covered yet:
- customColor
- iOS Dynamic Colors
- Variant Colors

Reviewed By: sammy-SC

Differential Revision: D30103451

fbshipit-source-id: 7d7be0f08dc2fb95b606b8f5d73784766787a574

* hook up PlatformColorParser to RCTPlatformColorUtils

Summary:
Changelog: [Internal]

in this diff, we iterate through the list of color passed down in the props, and write the RGBA value of the first valid UIColor

Reviewed By: sammy-SC

Differential Revision: D30110297

fbshipit-source-id: c6730110129d0fe1f784fa89cd26b46d3dda7f28

* replace SharedColor alias with class for more reliable template deduction

Summary:
Changelog: [Internal]

when we try to write a `SharedColor` type prop in the renderer, the template function we match to is the following:

https://www.internalfb.com/intern/diffusion/FBS/browsefile/master/xplat/js/react-native-github/ReactCommon/react/renderer/core/propsConversions.h?commit=28dacb972cda702d37dedd4612bc67c212d4d9eb&lines=108-132

this is because `SharedColor` is an alias of `better::optional<Color>`. ultimately, this causes a crash in L130 - the template deduction in L130 interprets the T as an `int`, rather than `SharedColor`, but our `rawValue` is pointing to `SharedColor`.

there was a number of options i considered, but didn't feel the most correct:
- wrapping `SharedColor` in another `better::optional` - this felt like a hack and didn't really provide any real benefits of the `optional` wrapper.
- writing a template specialization on SharedColor - this didn't seem future proof because we could introduce another type that could potentially wrap an integer, which doesn't seem impossible in the future - then we would get some conflict with our `SharedColor` conversion, which is custom to the behavior of colors.
- coercing the template during the function call - from an engineering perspective, this didn't seem like a great idea since it isn't clear to the engineer that this would be necessary and they would most likely only find out to do this after seeing a crash on their builds.

i ultimately decided to convert `SharedColor` to a simple class wrapper, similar to the implementation already used in Android. this alleviates all of the concerns with the other options above.

Reviewed By: sammy-SC

Differential Revision: D30149880

fbshipit-source-id: 7e8abafcd9fd7465b13ef227d140e859f8df6ecd

* Deploy 0.157.0 to xplat

Summary: Changelog: [Internal]

Reviewed By: gkz

Differential Revision: D30148513

fbshipit-source-id: 7eb17353c3620d6f99d547dd6a781ac0a13a9a72

* General Logging Util (stab) class for native errors (#31998)

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

Overall Context: We want to add a way to log errors (e.g. mustfix, warn, etc on the server with stack trace) without crashing the app (e.g. react_native_assert crashes the app).

This diff: I am writing very simple logger functions which will get resolved at build time depending on the platforms/apps.

Changelog: [internal]

Reviewed By: JoshuaGross

Differential Revision: D30174404

fbshipit-source-id: 2e5bc865dd8576c5a758c56e080a1e582a8c3ada

* Documenting UserFlow.endFailure

Summary:
We had some confusion lately, where errorName was used to dump "error message". This caused problems in Scuba.
This doc should add some clarity on what is expected from endFailure users.

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

Reviewed By: mityal

Differential Revision: D30192127

fbshipit-source-id: d057668aab714a9342131c83daf41cbe9372cb39

* iOS: When RCTSyncImageManager image times out, log warning instead of error

Reviewed By: fkgozali

Differential Revision: D30255710

fbshipit-source-id: e5238f718420718265823dd0fb93507d472d3cff

* Un-deprecate ReactSoftException

Summary:
After creating and using this utility, we learned that (1) it's really useful, and (2) its interface is good enough. So, let's un-deprecate this utility.

Changelog: [Internal]

Reviewed By: JoshuaGross

Differential Revision: D30251651

fbshipit-source-id: d1ecf81484f865587a5552d5ddf0e68da86397d9

* Rename ReactSoftException to ReactSoftExceptionLogger

Summary:
ReactSoftException makes it seem like the class is an Exception, when it's actually a logger. This rename I think is more appropriate.

Changelog: [Internal]

Reviewed By: JoshuaGross

Differential Revision: D30251735

fbshipit-source-id: 550bd543388e698774ec31753200bd3f722d8c17

* Updated TextInput autoCompleteType prop to autoComplete 2/2 (#26010)

Summary:
Fix for bug https://github.com/facebook/react-native/issues/26003 Rename TextInput prop "autoCompleteType" to "autoComplete".

## Changelog

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

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

Test Plan: Sandcastle

Reviewed By: mdvacca

Differential Revision: D29795575

Pulled By: lunaleaps

fbshipit-source-id: 6eba7030968e9b7384529a43a6cd1b3c9e8b2a2c

* Remove autoCompleteType as a native component prop

Summary: Changelog: [Android][Internal] - Cleanup `autoCompleteType` prop from Android native component.

Reviewed By: charlesbdudley

Differential Revision: D30057497

fbshipit-source-id: c80dd5682b314112ae70551bf8135372bb1ddc8b

* Match native*.js and Native*.js srcs

Summary:
Globbing is case sensitive only when eden is enabled. This causes Android cold builds to regress by 2 minutes because a large number of react native targets have to be built and fetched.

This change causes srcs to match with and without eden.

Changelog: [Internal]

Reviewed By: cute-jumper

Differential Revision: D30266076

fbshipit-source-id: 39ac2cbfa146fcdda1d8d3a6f40b0ec41bfb3c2f

* Fix TextInput Cursor jumping to the right when the placeholder null (#28995)

Summary:
This issue fixes https://github.com/facebook/react-native/issues/28794 fixes https://github.com/facebook/react-native/issues/27658
Flow type ?Stringish allows to set the placeholder value to null. The null value causes the cursor to jump to the right in a TextInput. The fix replaces the placeholder null value with an empty string which avoid calling setHint(null) as causes the placeholder to jump to the right.

## Changelog

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

[Android] [Fixed] - avoid calling setHint with a null parameter causing cursor to jump to the right

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

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

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

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

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

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

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

</p>
</details>

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

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

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

</p>
</details>

Reviewed By: charlesbdudley

Differential Revision: D30095877

Pulled By: lunaleaps

fbshipit-source-id: 38a3e788443a22d48a4335063cd4315638bd8e97

* Bump AGP to 4.2.2

Summary:
This is just a minor bump in the Android Gradle plugin.

Changelog:
[Android][Changed] - Bumped AGP to 4.2.2

allow-large-files

Reviewed By: ShikaSD

Differential Revision: D30220591

fbshipit-source-id: 217a21e4935bcd258ac3bcd45c7fb1ff5c0a1ead

* Flatten the `react-native-codegen` included build. (#32007)

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

This Diff simplifies the codegen Gradle build.
Previously the build used to have a 2-level nesting of included build.

Turns out that the `react-native-codegen/android/build.gradle` build
is just providing a task and including an inner build that contains the codegen
Gradle plugin. I've moved such plugin to the outer build.

This will also make sure that the Gradle plugin files are properly index by the
IDE when opening the build (as nested included build are not yet supported).

Changelog:
Internal - Flatten the `react-native-codegen` Gradle included build

Reviewed By: fkgozali, ShikaSD

Differential Revision: D30227784

fbshipit-source-id: af304afeeba1926f8b7b5b47cf69889d3f808f5f

* iOS: Log image url in test environment when image times out

Reviewed By: fkgozali

Differential Revision: D30280757

fbshipit-source-id: 57385d3fd64f564f1de9ad86ffb2c0064e941df9

* Fix BorderExample for DynamicColorIOS

Summary:
Changelog:
[Internal] - Fix border example for RNTester

Reviewed By: charlesbdudley

Differential Revision: D30262957

fbshipit-source-id: 677e7a9346bc2f1dc67ec7cc9ad7e36af34ffa60

* Add a flag to warn whenever the legacy NativeModule system is used

Summary:
When true, this flag will cause React Native to start logging soft exceptions, whenever the legacy NativeModule system is used. This flag is independent of useTurboModules. In practice, it's only enabled when TurboModules is enabled.

Changelog: [Internal]

Reviewed By: JoshuaGross

Differential Revision: D30250363

fbshipit-source-id: f610567c5b99a4fbf8252c3962908668f483d028

* Log SoftExceptions when the legacy NativeModule system is used

Summary:
When ReactFeatureFlags.warnOnLegacyNativeModuleSystemUse is true, we will log a SoftException, whenever:
1. A Java/Cxx NativeModule is created by the legacy system.
2. Any method on the Java NativeModule is executed, including getConstants().

NOTE: Logs to CXXModule use incoming.

Changelog: [Internal]

Reviewed By: JoshuaGross

Differential Revision: D30252953

fbshipit-source-id: 570929624d0114bb298c593ba909e5cdbd54bd6c

* Introduce JReactSoftExceptionLogger to log SoftExceptions from C++

Summary:
When the TurboModule system is enabled, C++ NativeModules shouldn't be used in production. We'll use this JReactSoftExceptionLogger to log soft exceptions from C++ NativeModules this scenario.

Changelog: [Internal]

Reviewed By: JoshuaGross

Differential Revision: D30272694

fbshipit-source-id: 8dadcfe51bcbc353d438d1a403e74da5e2cb9546

* Warn whenever CxxNativeModules are used

Summary:
After this diff, when ReactFeatureFlags.warnOnLegacyNativeModuleSystemUse is enabled, the legacy NativeModule infra will log soft exceptions whenever legacy NativeModules are accessed/used.

Changelog: [Internal]

Reviewed By: p-sun

Differential Revision: D30272695

fbshipit-source-id: 7111402c1d8b883a600dcb4559e9ff1d56447070

* Fix typo in RCTConvert.m (#31067)

Summary:
seperated -> separated

## Changelog

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

[Internal] [Fixed] - Fixed typo in comment

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

Test Plan: NONE

Reviewed By: sammy-SC

Differential Revision: D30176244

Pulled By: sota000

fbshipit-source-id: 617607aaa7eb5f613344773c4bbbc09a8c5096c1

* Allow Modal to handle hardware escape key in the same way the back button is handled (#31564)

Summary:
On Android, when a hardware keyboard is connected pressing the escape key will partially dismiss an active `<Modal>` without calling the `onRequestClose` callback. The modal will disappear, but I beleive the underlying activity may still be present, blocking interaction with the main app below and leaving things in a partially broken state.

This code change allows the escape key to be handled in the same way as the hardware back button, calling the `onRequestClose` and allowing the developer to decide the behaviour.

This issue isn't present on iOS, so no change is required there.

## Changelog

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

[Android] [Fixed] - Fix Modal being dismissed incorrectly when pressing escape on a hardware keyboard

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

Test Plan: I've tested this manually locally, but unsure if it's possible to test in an automated way as the emulator didn't respond to a hardware escape key in the same way as a physical device.

Reviewed By: ShikaSD

Differential Revision: D28953718

Pulled By: lunaleaps

fbshipit-source-id: 5547bc5d894da0d3d9daf4515b1af9c2407815db

* Nullable ReconnectingWebSocket params

Summary: Changelog: [Internal] - Annotated the MessageCallback and ConnectionCallback params of the ReconnectingWebSocket with Nullable

Reviewed By: makovkastar

Differential Revision: D30298832

fbshipit-source-id: 4e0a6ea339d1d8b25fb7bb24dfbada93d5cebc96

* Clean up unbatched only experiment

Summary:
changelog: [internal]

The experiment isn't shipping.

Reviewed By: JoshuaGross

Differential Revision: D30303379

fbshipit-source-id: 80b89d3738c1640f6abefcad161f95397c88ee04

* Clean up AsyncEventBeatV2 experiment

Summary:
changelog: [internal]

This experiment is abandoned. It regressed engagement metrics.

Reviewed By: JoshuaGross

Differential Revision: D30303383

fbshipit-source-id: 1d86eb5c7c257d4b369632007d0bda23e80c88ab

* Back out "Fix Undefined symbol: __swift_FORCE_LOAD_$_swiftFileProvider when building with Xcode 13"

Summary:
Changelog: Backout "Fix Xcode 13 build error in HelloWorld template"

Original commit changeset: 59dbde441e61

This change breaks the template for Xcode 12.5:

{F642871165}

Reviewed By: philIip

Differential Revision: D30301800

fbshipit-source-id: 4fcd9a5413dafb2cedb2194d5b68ddfd46edd974

* Include Swift lib in LIBRARY_SEARCH_PATHS

Summary:
changelog: Fix Xcode 13 build error in HelloWorld template

Including `usr/lib/swift` fixes error:
{F642876047}

Reviewed By: p-sun

Differential Revision: D30301799

fbshipit-source-id: b93eb51ec5dd929ddc46574fc11bc89934eadeaf

* fix#29319 - ios dismiss modal (#31500)

Summary:
This PR aims to resolve iOS can't dismiss Modal on swipe gesture.
https://github.com/facebook/react-native/issues/29319

When modal presentationStyle is pageSheet, iOS allows to dismiss the modal using swipe gesture. This PR adds support for that feature
## Changelog

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

[iOS] [Added] - Support for onRequestClose for iOS Modal component.

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

Test Plan:
- If onRequestClose updates the visibility state, modal will be closed.

```
<Modal
    visible={visible}
    animationType="slide"
    presentationStyle="pageSheet"
    onRequestClose={dismiss}>
</Modal>
```

https://user-images.githubusercontent.com/23293248/117590263-36cd7f00-b14c-11eb-940c-86e700c0b8e7.mov

## Notes
- In this PR, only support for partial drag is added. i.e. user can't drag the modal up and down completely. I added full user dragging but reverted in this [commit](bb65b9a60d) to support controllable onRequestClose. If someone has any suggestion to have full draggable support + controllable onRequestClose, please let me know.

<!--

 the code is solid. Example: The exact commands you ran and their output, screenshots / videos if the pull request changes the user interface. -->

Reviewed By: p-sun

Differential Revision: D30041625

Pulled By: sammy-SC

fbshipit-source-id: 9675da760bd5c070c4f0e1d30271c8af5c50b998

* Fix selectionColor doesn't style Android TextInput selection handles (#31007)

Summary:
This issue fixes https://github.com/facebook/react-native/issues/30283 selectionColor does not change the handles color.

The method setCursorColor changes the cursor color of field `mCursorDrawable` using a reflection for Android Devices lower then API 28. This fix adds a reflection to change color of the left, center and right handles of a selection (mTextSelectHandleLeftRes, mTextSelectHandleRes and mTextSelectHandleRightRes).

## Changelog

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

[Android] [Fixed] - Fix selectionColor doesn't style Android TextInput selection handles

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

Test Plan:
This changes fix the Java API for which I can not write Java tests as explained in commit 709a441ecf
The java TextInputTest was excluded from the test suite in commit 709a441ecf as they need the Yoga libraries to run

**<details><summary>CLICK TO OPEN TESTS RESULTS - API 22</summary>**
<p>

left/right handles do not change color with the cursor

| **BEFORE** |
|:-------------------------:|
| <img src="https://user-images.githubusercontent.com/24992535/108241887-98351180-714c-11eb-9c7b-7c693ea0bb06.png" width="250" height="" /> |

center Handle color does not change color

| **BEFORE** |
|:-------------------------:|
| <img src="https://user-images.githubusercontent.com/24992535/108241904-9ec38900-714c-11eb-9fc3-dbd26f83b979.png" width="250" height="" /> |

The left and right handle change color with the cursor color

| **AFTER** |
|:-------------------------:|
| <img src="https://user-images.githubusercontent.com/24992535/108241796-805d8d80-714c-11eb-9d90-6871ddaea86f.png" width="250" height="" /> |

The center handle color is correctly updated

| **AFTER** |
|:-------------------------:|
| <img src="https://user-images.githubusercontent.com/24992535/108241571-45f3f080-714c-11eb-8475-86e6dea64d73.png" width="250" height="" /> |

`setCursorColor` changes correctly the cursor color

| **AFTER** |
|:-------------------------:|
| <img src="https://user-images.githubusercontent.com/24992535/108241484-2d83d600-714c-11eb-8a0c-80a847f28537.png" width="250" height="" /> |

Default Colors do not have issues

| **AFTER** |
|:-------------------------:|
| <img src="https://user-images.githubusercontent.com/24992535/108241346-04634580-714c-11eb-933e-0dce504498a8.png" width="250" height="" /> |

| **AFTER** |
|:-------------------------:|
| <img src="https://user-images.githubusercontent.com/24992535/108241347-04fbdc00-714c-11eb-902a-fc057cf94986.png" width="250" height="" /> |

</p>
</details>

Reviewed By: ShikaSD

Differential Revision: D28682935

Pulled By: sota000

fbshipit-source-id: ff037c93f36bbf20c915373b995bbfd8e8ca92d0

* Fixing CI error "Entry file RNTester/js/RNTesterApp.ios.js does not exist" (#29263)

Summary:
PRs are failing with the error "Entry file RNTester/js/RNTesterApp.ios.js does not exist", despite it existing. The if statement around the checker will always trigger because when it looks to see if RNTester/js/RNTesterApp.ios.js exists it's inside of RNTester instead of root. I've added a "../" to solve this.

## Changelog

[Internal] [Fixed] - Fixing CI error "Entry file RNTester/js/RNTesterApp.ios.js does not exist"

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

Test Plan:
![Screen Shot 2020-07-01 at 11 25 03](https://user-images.githubusercontent.com/65255457/86278790-cc43ce00-bb8d-11ea-8098-9f4a751667ae.png)
![Screen Shot 2020-07-01 at 11 26 52](https://user-images.githubusercontent.com/65255457/86278796-ccdc6480-bb8d-11ea-9d73-63801f77e840.png)

Reviewed By: sammy-SC

Differential Revision: D30176138

Pulled By: sota000

fbshipit-source-id: 41510b31d3f1a34de7b0b5218ab670ac99409622

* Fix dashed/dotted border drawing when border-radius is 0 (#28359)

Summary:
This PR fixes the border-style that is not respected when drawing a border with 0 border-radius on Android. This would cause the faster `drawRectangularBackgroundWithBorders` path to be used, but that uses rectangular drawing and doesn't support dashed/dotted stroke patterns.
This PR changes the behavior to use the generic `drawRoundedBackgroundWithBorders` code-path which does support dashed/dotted border-styles.

## Changelog

`[Android] [Fixed] - Fix dashed/dotted border-drawing when border-radius is 0`

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

Test Plan:
**Faulty situation:**

![Screenshot_1584721992](https://user-images.githubusercontent.com/6184593/77184987-e838cd80-6ad0-11ea-9585-058eafbd361a.png)

**After the fix:**

![Screenshot_1584721410](https://user-images.githubusercontent.com/6184593/77184801-9d1eba80-6ad0-11ea-92a7-7212f40ace73.png)

Reviewed By: lunaleaps

Differential Revision: D20590739

Pulled By: charlesbdudley

fbshipit-source-id: 18657ea21e54f763e22c623bf979b3500c1bdcbd

* Add a way to bind log function to the unified react native logger.

Summary:
In this diff:
1. Convert the ReactNativeLogger to c function for the future compatibility.
2. Bind the log function from Catalyst app
3. Update the call site

Changelog: [internal]

Reviewed By: JoshuaGross

Differential Revision: D30271863

fbshipit-source-id: 4c0ea704cf19f53468a3b72631353959ea999884

* React Native sync for revisions 19092ac...5634ed1

Summary:
This sync includes the following changes:
- **[424fe5870](https://github.com/facebook/react/commit/424fe5870 )**: Revert "Show a soft error when a text string or number is supplied as a child to non text wrappers ([#21953](https://github.com/facebook/react/pull/21953))" ([#22108](https://github.com/facebook/react/pull/22108)) //<Sota>//
- **[aebf3b456](https://github.com/facebook/react/commit/aebf3b456 )**: [Scheduler] Check for continuous input events ([#22107](https://github.com/facebook/react/pull/22107)) //<Andrew Clark>//
- **[e9b2028b3](https://github.com/facebook/react/commit/e9b2028b3 )**: Show a soft error when a text string or number is supplied as a child to non text wrappers ([#21953](https://github.com/facebook/react/pull/21953)) //<Sota>//
- **[ecd73e17b](https://github.com/facebook/react/commit/ecd73e17b )**: Enable enableSuspenseLayoutEffectSemantics flag statically for Facebook ([#22050](https://github.com/facebook/react/pull/22050)) //<Brian Vaughn>//
- **[a8725a3e6](https://github.com/facebook/react/commit/a8725a3e6 )**: Scheduling profiler: Added lane labels and durations to React measures ([#22029](https://github.com/facebook/react/pull/22029)) //<Brian Vaughn>//

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

jest_e2e[run_all_tests]

Reviewed By: kacieb

Differential Revision: D30225923

fbshipit-source-id: 562895d3e0d264f40770dadb89d4a16241967c4c

* Exclude nativeImageSource.js instead of matching [Nn]

Summary:
The change to this glob by D30266076 (f1b4748a7c) lines up suspiciously to a non-reproducible failure in the sources to the rules that use this glob. Changing to see if it mitigates the issue.

See https://fb.workplace.com/groups/askbuck/posts/6473961645985729/?comment_id=6476777799037447&reply_comment_id=6477737555608138

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D30361375

fbshipit-source-id: af7b7fe553364fc1d7012bea8d00bf02ee2804fa

* Revert D20590739

Summary:
This diff is reverting D20590739 (3e5998e651)
D20590739 (3e5998e651) is making the following tests to fail and this revert diff is either the revert of the blame diff or the revert of the stack of diffs that need to be reverted to revert the blame diff
Tests affected:
- https://www.internalfb.com/intern/test/281475012591721/
Multisect link:
https://www.internalfb.com/intern/testinfra/multisect/476214

## Changelog

`[Android] [Fixed] - Revert: Fix dashed/dotted border-drawing when border-radius is 0`

Reviewed By: charlesbdudley

Differential Revision: D30361262

fbshipit-source-id: 21dd507deb5817dda1063a267a38749c77e7ae1a

* Fix irregular indent in template (#29871)

Summary:
Fix irregular indent in template/android/app/build.gradle

![image](https://user-images.githubusercontent.com/26166657/92319046-46417900-f04f-11ea-9051-cb4d7bcc3049.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
-->

[Internal] [Fixed] - Fix irregular indent in template

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

Test Plan: N/A

Reviewed By: passy, cortinico

Differential Revision: D30360839

Pulled By: sota000

fbshipit-source-id: 7a92890007716c6e244ceffaa697cdd5ad1a0504

* JS: Fix "Modal | Basic" Test's Layout

Summary:
Fix the CSS on the main Modal test

Move the warning message for the "Transparent" switch to below the switch, since warnings messages are usually under the field they're warning.

Move Presentation Style to be before Transparent, since Transparent is a modifier of "overFullScreen" Presentation Style.

Reviewed By: lunaleaps

Differential Revision: D30323087

fbshipit-source-id: b13d6c958145096da95c9888181ff457b093fb49

* replace testing-support-lib with androidx buck targets in RN

Summary: Changelog: [Internal] - codemod testing library Buck redirect to actual dependency

Reviewed By: jiawei-lyu

Differential Revision: D30379180

fbshipit-source-id: eb9a22569230d07732bd0aa63dddfcfff7c3800f

* `Android/ColorProps`: ColorProps with value null should be defaultColor instead of transparent (#29830)

Summary:
This pr:
- Fixes: https://github.com/facebook/react-native/issues/30183
- Fixes: https://github.com/facebook/react-native/issues/30056
- Fixes: https://github.com/facebook/react-native/issues/29950
- Fixes: https://github.com/facebook/react-native/issues/29717
- Fixes: https://github.com/facebook/react-native/issues/29495
- Fixes: https://github.com/facebook/react-native/issues/29412
- Fixes: https://github.com/facebook/react-native/issues/29378

Because most of ReactProps(name = ViewProps.COLOR) accept @ Nullable Integer.
For example:
abb6433f50/ReactAndroid/src/main/java/com/facebook/react/views/text/ReactBaseTextShadowNode.java (L472-L479)

After update to react-native 0.63.2 to make PlatformColor work, there is a new ColorPropSetter.
abb6433f50/ReactAndroid/src/main/java/com/facebook/react/uimanager/ViewManagersPropertyCache.java (L194-L215)

But ColorPropSetter won't return an nullable value with getValueOrDefault, it will always return it's defaultValue which is 0.
And 0 is equal to TRANSPARENT, will cause <Text /> disappear.
## Changelog

[Android] [Fixed] - ColorProps with value null should be defaultColor instead of transparent

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

Test Plan:
Please initiated a new project and replaced the app with the following code:
```
import * as React from 'react';
import {Text, View, TouchableOpacity, PlatformColor} from 'react-native';

export default function App() {
  const [active, setActive] = React.useState(false);

  return (
    <View>
      <Text style={active ? {color: 'green'} : null}>Example</Text>
      <Text
        style={
          active ? {color: PlatformColor('android:color/holo_purple')} : null
        }>
        Example2
      </Text>
      <TouchableOpacity onPress={() => setActive(!active)}>
        <Text>Toggle Active</Text>
      </TouchableOpacity>
    </View>
  );
}
```

Thanks you so much for your code review!

Reviewed By: JoshuaGross

Differential Revision: D30209262

Pulled By: lunaleaps

fbshipit-source-id: bc223f84a92f742266cb7b40eb26722551940d76

* Fix Dimensions not updating on Android (#31973)

Summary:
When retrieving the device dimensions through the JS `Dimensions` utility, the result of `Dimensions.get` can be incorrect on Android.

### Related issues

- https://github.com/facebook/react-native/issues/29105
- https://github.com/facebook/react-native/issues/29451
- https://github.com/facebook/react-native/issues/29323

The issue is caused by the Android `DeviceInfoModule` that provides initial screen dimensions and then subsequently updates those by emitting `didUpdateDimensions` events. The assumption in that implementation is that the initial display metrics will not have changed prior to the first check for updated metrics. However that is not the case as the device may be rotated (as shown in the attached video).

The solution in this PR is to keep track of the initial dimensions for comparison at the first check for updated metrics.

## Changelog

[Android] [Fixed] - Fix Dimensions not updating

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

Test Plan:
### Steps to reproduce
1. Install the RNTester app on Android from the `main` branch.
2. Set the device auto-rotation to ON
3. Start the RNTester app
4. While the app is loading, rotate the device
5. Navigate to the `Dimensions` screen
6. Either
 a. Observe the screen width and height are reversed, or
 b. Quit the app and return to step 3.

### Verifying the fix

#### Manually
Using the above steps, the issue should no longer be reproducible.

#### Automatically
See unit tests in `ReactAndroid/src/test/java/com/facebook/react/modules/deviceinfo/DeviceInfoModuleTest.java`

### Video

https://user-images.githubusercontent.com/4940864/128485453-2ae04724-4ac5-4267-a59a-140cc3af626b.mp4

Reviewed By: JoshuaGross

Differential Revision: D30319919

Pulled By: lunaleaps

fbshipit-source-id: 52a2faeafc522b1c2a196ca40357027eafa1a84b

* refactor: remove DefaultProps from the StatusBar Component (#31631)

Summary:
Issue https://github.com/facebook/react-native/issues/31607. defaultProps makes it difficult to migrate components to functional.

## Changelog

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

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

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

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

Reviewed By: sota000

Differential Revision: D30259324

Pulled By: lunaleaps

fbshipit-source-id: 0c8841691198761589fdd029cab36629f7dfa757

* fix AGP 7 compatibility (#32030)

Summary:
Android Gradle Plugin 7 removed dependency configurations, and it includes compile. Below is a snipped from release notes https://developer.android.com/studio/releases/gradle-plugin

I can confirm that RN 0.65.0 app is running as expected on Android with the patch.

> **compile**
Depending on use case, this has been replaced by api or implementation.
Also applies to *Compile variants, for example: debugCompile.

## Changelog

[Android] [Changed] - Android Gradle Plugin 7 compatibility

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

Test Plan: Create a project with RN 0.65.0 and upgrade Android Gradle Plugin to 7.0.0, and Gradle to 7.0.2. It'll fail to sync. Then apply the change, and it'll sync as normal, and build the app.

Reviewed By: passy, ShikaSD

Differential Revision: D30394238

Pulled By: cortinico

fbshipit-source-id: cabc25754b9cd176a7d6c119d009728f2e5a93d9

* Clean up Fabric startSurface API used in Venice

Summary:
Update FabricUIManager methods for `SurfaceHandler` to start usual rendering or prerendering based on presence of the view instead of using two methods with same logic.

Changelog: [Internal]

Reviewed By: sshic

Differential Revision: D30346502

fbshipit-source-id: 297f2b4a16dc7af7c36379252bd73e6dc953ff59

* Expose "unreserved" trait constants that can be mapped per-component

Summary:
Fabric core uses a lot of traits - I am reserving a few more for core usage, and also exposing a few "unreserved" traits.

It is recommended that all custom components that do use traits rely on these constants instead of hard-coding any trait values. That way, in the unlikely event that these values change in the future, it will not break components.

Changelog: [Internal]

Reviewed By: cortinico, RSNara

Differential Revision: D30401743

fbshipit-source-id: fb2e8f5cf33c94e31a0c25a89055acfc4eccf066

* Call super.onActivityResult in ReactActivity

Summary:
This change allows native activities and fragments to also handle onActivityResult callbacks, in addition to sending the result to React Native.

Changelog:
[Android][Changed] - Call super.onActivityResult in ReactActivity's onActivityResult()

Reviewed By: JoshuaGross

Differential Revision: D30232449

fbshipit-source-id: cb080d6f2eff57dcf839660ee715cb4068ffcdd5

* Move react_native_log out of utils (#32042)

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

This diff moves react_native_log out of utils to make it easier/possible to import from modules.
Changelog: [internal]

Reviewed By: JoshuaGross

Differential Revision: D30411247

fbshipit-source-id: 5482761b259600df051a88c6eff1834c882e7230

* fix: Resolve NODE_BINARY *after* finding the path to node (#32029)

Summary:
We want to resolve `NODE_BINARY` **after** `find-node.sh` runs and sets up any node version manager that we need to setup, otherwise `NODE_BINARY` is always undefined.

## Changelog

[Internal] [Fixed] - Resolve NODE_BINARY after finding the right path to node

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

Reviewed By: TheSavior

Differential Revision: D30401213

Pulled By: yungsters

fbshipit-source-id: 386ffeff15b5f371a452488ed078d3adebe0f211

* Ship "Disable 'virtual view' preallocation" experiment in code

Summary:
The impact of this has proven impressive, and safe. Ship in code and remove feature-flag.

Changelog: [Internal]

Reviewed By: philIip

Differential Revision: D30269561

fbshipit-source-id: 9bb72567cfd881928d14d9bee43cf32b390664fb

* Emit soft error for warning

Summary:
This diff adds a default behavior for the unified logger on Android.

Added the call site in the CXXNativeModule.

Changelog: [internal]

Reviewed By: JoshuaGross

Differential Revision: D30377767

fbshipit-source-id: 000014828f2f245dc9492e3617218895d9a33536

* Enable ktfmt

Summary: Changelog: [internal]

Reviewed By: zertosh

Differential Revision: D30423755

fbshipit-source-id: 8ae27b3666214f5144ef8b5ef7fe868afc19b4b9

* Pass configFile: false to Babel parser

Summary:
Changelog: [Internal]

Disables implicit `babel.config.js` lookup in a `parse()` call that does not need any user-specified config.

Reviewed By: javache

Differential Revision: D30396331

fbshipit-source-id: 9b07c361eae53cdffc6a76ba30f1146a7af65a10

* Passing the scheme field throughout all the metro connection pipeline to allow different scheme other than the default hardcoded http

Reviewed By: lunaleaps

Differential Revision: D30218490

fbshipit-source-id: 3832c731156a4f88ad1c55be0a0e4f68fa3e1d48

* Adding activity check to enable Dev mode

Summary:
It is assumed that there will always be an activity associated on enabling the dev support which is not the case. Hence adding that null check.

Changelog:
[Android][Fixed] - Added null check for activity in onHostResume()

Reviewed By: javache

Differential Revision: D30411311

fbshipit-source-id: 8936be2df7f16c355693163347d5e1d94c5ce2e1

* Deploy 0.158.0 to xplat

Summary: Changelog: [Internal]

Reviewed By: dsainati1

Differential Revision: D30426571

fbshipit-source-id: 70689323d066e3b25bf720f454d2146d195df8b3

* - Fix broken Circle CI due to missing BUCK rule for androidx:tests (#32052)

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

Changelog: Update the OSS React Native dependencies to match the internal dependency structure.

Reviewed By: cortinico

Differential Revision: D30397818

fbshipit-source-id: a70e26d764729f6ead9eb6a4d689e32d25243571

* Remove BUILD FILE SYNTAX from build files

Summary: Changelog: [Internal]

Reviewed By: zertosh

Differential Revision: D30410441

fbshipit-source-id: 62deebb502121f23270bfa18286b155ad161af2d

* Apply new buildifier fixes

Summary: Changelog: [Internal]

Reviewed By: zertosh

Differential Revision: D30407205

fbshipit-source-id: 022a02829d59a900764b228afb9856ed1ba2cf8c

* Remove redundant includes

Summary:
changelog: internal

Removing unused headers. Fewer headers = faster compilation

Reviewed By: p-sun

Differential Revision: D30398600

fbshipit-source-id: a64801e49d283ad1e2d0cb9c9d688445e30bf0ed

* Provide logger to YGConfig

Summary:
Changelog: [internal]

Logger needs to be supplied to YGConfig, otherwise the app crashes when Yoga tries to log.

Reviewed By: fkgozali

Differential Revision: D30394676

fbshipit-source-id: bda464a4e43cb815c00650e1fedf43fe0a06f973

* Set initial maximum surface size to viewport size

Summary:
Changelog: [internal]

There is a possibility of race between JavaScript sending "completeRoot" and maximum size set on surface. To prevent this race, we set the initial maximum size to be equal to the viewport size.

Alternative solution is to set maximumSize to {0, 0} initially instead of infinity. This is what old architecture does, even though not explicitly.

Reviewed By: fkgozali

Differential Revision: D30402207

fbshipit-source-id: 44427404eaf060a81de257797823edf971ffc1bb

* iOS: Don't display LogBox in Dev if Bridge was invalided

Summary: Bridge can get invalidated during tear down. If a JS error is thrown then, don't display a LogBox so we don't hit the invalid bridge assert in RCTSurface.

Reviewed By: fkgozali

Differential Revision: D30464848

fbshipit-source-id: 87a8daa95fd06342d194a4805ecfa97279820f2e

* Update ImageBackground.js (#32055)

Summary:
Currently ImageBackGround component has optional style props, but if you don't pass it as prop, it still "thinks" you pass style and crushes.
In this pr, I made width and height inside component to be optional so it won't crush.

## Changelog

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

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

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

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

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

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

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

Reviewed By: charlesbdudley

Differential Revision: D30452297

Pulled By: sshic

fbshipit-source-id: b7071aa457dba443ed2f627c2458ea84fd24b36d

* Fix typo and grammar (#31916)

Summary:
> Always leave the campground cleaner than you found it.

Fixing:
* typo in _dismissed_
* make the subject agree with the verb

## Changelog

[Internal] [Fixed] - A typo in a comment

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

Test Plan: Grammarly says it's better now.

Reviewed By: lunaleaps

Differential Revision: D29967403

Pulled By: yungsters

fbshipit-source-id: 6cb33328e99e3fceba5f19f4baaa9446340fbbcc

* Added Selection prop to TextInputProps

Summary:
Changelog: [iOS][Added]
1. Added new primitive type "Selection" to C++
2. Added property "selection" to TextInputProps
3. Added parser for that

Reviewed By: sammy-SC

Differential Revision: D30043256

fbshipit-source-id: eefa67ca23759761901cba1d2ab3052877a153a7

* Selection prop is applied for TextInput when component is mounting

Summary:
Changelog: [Internal]
TextInput's predefined "selection" prop is now applied when view did move to window, and when attributed string is set.

Reviewed By: sammy-SC

Differential Revision: D30045271

fbshipit-source-id: e5495171b07a25e1e822421ff1627a8686cd0904

* use correct gradle packageTask and asserts dir for android libraries (#32026)

Summary:
Fixes https://github.com/facebook/react-native/issues/29577 and https://github.com/react-native-community/upgrade-support/issues/93, when building an android library the package task has a different name, which was not handled correctly in the react.gradle file. The fix uses the existing `packageTask` variable which is correctly set for applications and libraries. This PR also copies the bundled js file into the correct assets directory, which is different from the assets directory of applications.

## Changelog

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

[Android] [Fixed] - Fixed Android library builds with react.gradle file

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

Test Plan: Tested with my android library build which includes the `react.gradle` file and the build succeeded.

Reviewed By: sshic, ShikaSD

Differential Revision: D30368771

Pulled By: cortinico

fbshipit-source-id: 8f0df8c4d0fa38d85f7c0b9af56d88799571191d

* Codegen: Add codegen.js wrapper around generate-specs.sh

Summary:
Adds a simple wrapper around the generate-specs.sh bash script.
Supports optional flags.

Usage:
`node ./codegen.js --srcs ./js --modules_library_name FBReactNativeSpec`

Remove unused `USE_FABRIC` envvar code from `generate-specs.sh`.

Changelog:
[Internal]

Reviewed By: fkgozali

Differential Revision: D30439132

fbshipit-source-id: 07099c1d899606ac2e679fac6d32ea2fa4af40fc

* Add Flow libdefs for HermesInternalType

Summary:
Changelog: [Internal]

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

Reviewed By: yungsters

Differential Revision: D29986749

fbshipit-source-id: a94be7919f989b5085f6b264e55145a85020fea9

* Add support for the UIAccessibilityTraitsTabBar

Summary:
Changelog:
Add the capability to set tabbar accessibilityRole which maps to the iOS's UIAccessibilityTraitsTabBar

Reviewed By: yungsters

Differential Revision: D30490752

fbshipit-source-id: f7561a8932306e133d2f65a5ab40ba0be3899ec3

* Add support for AccessibilityValue

Summary:
Changelog:
[Fabric][iOS] Add support for AccessibilityState

Specification: https://reactnative.dev/docs/accessibility#accessibilityvalue

Reviewed By: sammy-SC

Differential Revision: D30452786

fbshipit-source-id: 0d459d3a7b9c037bd1877e5c7ead40bbb42830c3

* fix typos in comments (#32061)

Summary:
Fixed some typos in the code comments.

## Changelog

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

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

Test Plan: N/A

Reviewed By: javache

Differential Revision: D30482511

Pulled By: cortinico

fbshipit-source-id: ff67bc00d57972df88e41ee7a933259673de3aa2

* Add window to jest setup (#28067)

Summary:
`window` exists in the React Native runtime, but not inside the test environment. Many libraries use `typeof window === 'undefined'` to check if code is running in SSR. Because of the difference in the real environment and test environment, tests can behave different than the real app, which is an unwanted behavior.

## Background

I'm using https://github.com/tannerlinsley/react-query in my React Native Project, which works really well. When writing tests, they wouldn't work: jest started and then seemingly did nothing. While debugging I noticed the render was stuck in an infinite loop. Then I noticed the following line inside `react-query`:

```js
const isServer = typeof window === 'undefined'
```

I didn't know that the React Native runtime has a global `window`, and thought it's a bug inside react-query. But it does have a `window`, which is not defined inside the test environment.

The infinite loop was caused by react-query thinking it is running on the server, which doesn't fetch any data. If the react-query hook mounts, it re-executes because then it should be mounted inside the client. But `isServer` was still `true`. This repeats forever.

## Changelog

[General] [Fixed] - Fix `window` not existing in jest setup

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

Test Plan: Are there tests to check if the test environment is setup correctly? �

Reviewed By: yungsters

Differential Revision: D30317021

Pulled By: charlesbdudley

fbshipit-source-id: 837ed952833ef8e70c5132c9b4152b0e0f28b4dd

* React Native sync for revisions 424fe58...bd5bf55

Summary:
Post: https://fb.workplace.com/groups/rnsyncsquad/permalink/879923262900946/

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

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

jest_e2e[run_all_tests]

Reviewed By: yungsters

Differential Revision: D30485521

fbshipit-source-id: c5b92356e9e666eae94536ed31b8de43536419f8

* Remove usages of `dynamic_casts` that are used inside assertions

Summary:
This diff is part of a bigger effort to remove the RTTI flags.
To do so we need to remove occurrences of `dynamic_cast` and other functions that rely on runtime
type informations.

Changelog:
[Internal][Changed] - Removed extra asserts relying on dynamic_cast

Reviewed By: JoshuaGross

Differential Revision: D30483554

fbshipit-source-id: 92b31281841a92c7b43e918938248431265dd654

* Fix broken CI with a run of prettier

Summary:
This Diff is fixing a broken CircleCI on OSS due to
not properly formatted .js files. See https://app.circleci.com/pipelines/github/facebook/react-native/10040/workflows/923cb408-b09c-4425-87c1-2677a7af9681/jobs/213822

The offending diff was D29986749 (ff4b33672a)

Changelog:
[Internal] - Fix broken CI due to not formatted js files

Reviewed By: ShikaSD

Differential Revision: D30515439

fbshipit-source-id: 560de04347a8746065981b534ed96f0956d94b9c

* Fixed dynamic behavior of <Text adjustsFontSizeToFit={true}> on Android (#31538)

Summary:
This PR fixes https://github.com/facebook/react-native/issues/30717, a bug in `<Text adjustsFontSizeToFit={true}>` implementation that prevents it from adjusting text size dynamically on Android.

The way `adjustsFontSizeToFit` was implemented in https://github.com/facebook/react-native/issues/26389 (and the design of ReactTextShadowNode) implies that Yoga will call `onMeasure` on every size change of a `<Text>` component, which is actually not the case (Yoga can cache the results of the measures, call the function multiple times or do not call at all inferring the size from the size constraints). The implementation of `adjustsFontSizeToFit` computes the adjusted string inside the measure function and then eventually passes that to the view layer where it's being rendered.

The proper fix of this issue requires the full redesign of the measure and rendering pipelines and separating them, and that... would be too invasive. And, I believe, this issue is already fixed in Fabric where this part is already designed this way.

Instead, this diff implements a small workaround: if `adjustsFontSizeToFit` is enabled, we manually dirty the Yoga node and mark the shadow node updated to force remeasuring.

## Changelog

[Android] [Fixed] - Fixed dynamic behavior of <Text adjustsFontSizeToFit={true}> on Android

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

Test Plan: https://user-images.githubusercontent.com/22032/118508162-8c79cc80-b6f4-11eb-853f-a1a09f82935f.mov

Reviewed By: mdvacca

Differential Revision: D28631465

Pulled By: yungsters

fbshipit-source-id: 7db1d22e2a5a464c7bf941d1d3df8e3fe8df66a2

* Bump @react-native/polyfills version (#32074)

Summary:
8a62583f79 did some renaming inside of the react-native/polyfills project, with the jest preset updated to use the new name. The new package for polyfills has not yet been published, so the jest preset in the main branch will be looking for the new name, while the old name is provided by the currently published react-native/polyfills@1.0.0. This is not hit inside the repo, since the dependency is linked instead of using the published one.

Bump react-native/polyfills to 2.0 (breaking change), in preparation for publish.

## Changelog

[Internal][Fixed] - Bump react-native/polyfills version

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

Reviewed By: lunaleaps, cortinico

Differential Revision: D30498104

Pulled By: yungsters

fbshipit-source-id: 92dcb159d76bd74cd93cfa09e2155c9c1b2c0a86

* Include Swift lib in LIBRARY_SEARCH_PATHS

Summary:
changelog: Fix Xcode 13 build error in RNTester

Including `usr/lib/swift` fixes error:
{F642876047}

Reviewed By: fkgozali

Differential Revision: D30559838

fbshipit-source-id: 65aad16b550d156c8670eaefcc8bedae99606329

* chore: prefer the local react-native-codegen package (#32096)

Summary:
Currently, the build breaks if we move `react-native-codegen` from the template's dependencies to root. This is due to `scripts/generate-specs-cli.js` using the one installed under `node_modules` instead of the local one.

## 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] - `scripts/generate-specs-cli.js` should prefer the local `react-native-codegen` package

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

Test Plan:
1. Make the following changes
   ```diff
   diff --git a/package.json b/package.json
   index 847c726a69b..78da8232988 100644
   --- a/package.json
   +++ b/package.json
   @@ -107,6 +107,7 @@
        "promise": "^8.0.3",
        "prop-types": "^15.7.2",
        "react-devtools-core": "^4.13.0",
   +    "react-native-codegen": "^0.0.7",
        "react-refresh": "^0.4.0",
        "regenerator-runtime": "^0.13.2",
        "scheduler": "^0.20.2",
   diff --git a/template/package.json b/template/package.json
   index 715614112ac..5e0762b1b25 100644
   --- a/template/package.json
   +++ b/template/package.json
   @@ -21,7 +21,6 @@
        "eslint": "7.14.0",
        "jest": "^26.6.3",
        "metro-react-native-babel-preset": "^0.66.2",
   -    "react-native-codegen": "^0.0.7",
        "react-test-renderer": "17.0.2"
      },
      "jest": {
   ```
2. Run `scripts/test-manual-e2e.sh`

## Expected Behavior

Task `:ReactAndroid:buildReactNdkLib` succeeds.

## Actual Behavior

```
> Task :ReactAndroid:buildReactNdkLib FAILED
make: Entering directory '~/Source/react-native/ReactAndroid/src/main/jni/react/jni'
fcntl(): Bad file descriptor
make: Leaving directory '~/Source/react-native/ReactAndroid/src/main/jni/react/jni'
~/Library/Android/sdk/ndk/21.4.7075529/build/core/build-binary.mk:651: Android NDK: Module react_codegen_rncore depends on undefined modules: react_render_components_view
~/Library/Android/sdk/ndk/21.4.7075529/build/core/build-binary.mk:664: *** Android NDK: Note that old versions of ndk-build silently ignored this error case. If your project worked on those versions, the missing libraries were not needed and you can remove those dependencies from the module to fix your build. Alternatively, set APP_ALLOW_MISSING_DEPS=true to allow missing dependencies.    .  Stop.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':ReactAndroid:buildReactNdkLib'.
> Process 'command '~/Library/Android/sdk/ndk/21.4.7075529/ndk-build'' finished with non-zero exit value 2

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.9/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 19s
20 actionable tasks: 20 executed
Couldn't generate artifacts
```

Reviewed By: ShikaSD

Differential Revision: D30581194

Pulled By: hramos

fbshipit-source-id: 3f7a707b33377042502e50887856ff5641fdd52c

* feat: add Android 12 BLUETOOTH_ADVERTISE to PermissionsAndroid (#32079)

Summary:
This PR adds BLUETOOTH_ADVERTISE, which showed up in the latest Android 12 Beta build as new `dangerous` permissions requiring approval for them.

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

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

## Changelog

[Android] [Changed] - Add BLUETOOTH_ADVERTISE to PermissionsAndroid

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

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

Reviewed By: cortinico

Differential Revision: D30532656

Pulled By: yungsters

fbshipit-source-id: 986ad8cbfc27913df13ab24bba36f6e13104e7d9

* Update manual testing script to also test Hermes for RNTester

Summary: Changelog: [Internal] - Update test-manual-e2e.sh to test Hermes for RNTester

Reviewed By: ShikaSD

Differential Revision: D30569403

fbshipit-source-id: fd45c8158c4c5ad93f33bc7b80464c5fc387a737

* Move react-native-codegen to root

* [0.66.0-rc.0] Bump version numbers

* Native component check in deprecatedPropType was inverted (#31164)

Summary:
While investigating an issue hit on a recent sync of [react-native-windows](https://github.com/microsoft/react-native-windows) I noticed that e68cf7cee9 appears to have accidently inverted the logic to avoid checking native components.

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

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

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

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

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

Reviewed By: hramos

Differential Revision: D30624302

Pulled By: fkgozali

fbshipit-source-id: 0f26e750283a1fa5eb5f44ecd2cf90617b6d931f

* OSS: Fix $ENTRY_FILE check for non-Debug Xcode builds

Summary:
The original $ENTRY_FILE check was added in https://github.com/facebook/react-native/pull/29012 to help catch misconfiguration for the entry JS file. That turned out breaking some RNTester builds/tests, so https://github.com/facebook/react-native/pull/29263 was added to accommodate the fact that RNTester .xcodeproj file has its own directory hierarchy.

The 2nd PR had multiple issues:
* It is incorrect to assume that the $ENTRY_FILE always exists in the parent dir of the .xcodeproj location. This caused an issue in RC 0.66: https://github.com/react-native-community/releases/issues/249#issue-983474535
* RNTester has since moved to packages/rn-tester/ (from RNTester/), hence breaking that assumption

It turns out RNTester .xcodeproj has incorrectly misconfigured this JS bundling step (not sure since when). The original script invocation passed in the correct path for `RNTesterApp.ios.js`, but as an arg to the `react-native-xcode.sh` instead of by setting `ENTRY_FILE` env var.

So this diff does 2 things:
* Undid https://github.com/facebook/react-native/pull/29263
* Fix RNTester JS bundling invocation to set the ENTRY_FILE correctly

{F659123377}

Changelog: [iOS][Fixed] Unbreak $ENTRY_FILE handling for JS bundling

Reviewed By: lunaleaps

Differential Revision: D30690900

fbshipit-source-id: 7c5802b3eac56c0456edcd4b7478bfa4af48fc27

* OSS: add Xcode 12.5 + M1 machines CocoaPods post_install workaround

Summary:
Context: there are multiple issues currently exposed by Xcode 12.5 and/or M1 machine + Flipper. To unblock the new 0.66 release, let's add this workaround in the official react_native_pods.rb recipe and make RNTester and new app Podfile's call it directly.

Changelog: [iOS][Fixed] Added workaround for Xcode 12.5 / M1 machines build issues

Reviewed By: lunaleaps

Differential Revision: D30691291

fbshipit-source-id: 8b24cc60da3d620dbc90f95c77f2345e18c28212

* Switch order of search libraries to fix M1 build error

Summary: changelog: Resolve Xcode 13 build error on M1 Macs for projects created from RN template

Reviewed By: fkgozali

Differential Revision: D30693466

fbshipit-source-id: f0b4fd471de38119d636c8e337831aa4d4599c4e

* Copy repo-config dependencies for bumping release version

Summary:
Changelog: [Internal[Fixed] - Revert, yarn workspaces only used in private packages. Copy dependencies over from repo-config instead

Original commit changeset: 1dd2adc6a036

Reviewed By: fkgozali

Differential Revision: D30599065

fbshipit-source-id: 0efffaaf38bc23bac339e6e1d917736243e1750e

* [0.66.0-rc.1] Bump version numbers

* [LOCAL] postfix timestamp to bust yarn cache

* Make JSI a dynamic library

Summary:
Ship libjsi as a standalone dynamic library. This prevents problems
with exception handling caused by duplicate typeinfo across multiple
shared libs, and reduces bundle size by removing duplicate copies of
JSI.

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D30599215

fbshipit-source-id: abad1398342a5328daa825f3f684e0067cad7a96

* Revert the Android specific max heap size GCConfig

Summary:
Changelog:
[Category][Internal]

This diff reverts the [Androids-specific heap size overrides](github.com/facebook/react-native/commit/63d20d3b1ef35cb4398d63d62f631f7f5d2935c7#diff-4c59ddca85e294a90a0e1bd15ed323ff4e130911d9642680dde44aacbcd7d32c) after
[Hermes has changed its default max heap size to 3GiB](5f2b47d0be).
You can read about more context there.

Reviewed By: yungsters

Differential Revision: D30726067

fbshipit-source-id: 1bcc93fdf4da817f3b3d60bd09c6a5a64166eb7e

* Bump Hermes npm to 0.9.0

Summary:
Changelog:
[General][Changed] - Bump Hermes to 0.9.0

allow-large-files

Reviewed By: lunaleaps

Differential Revision: D30726474

fbshipit-source-id: 742cf68b046d8768e83e00d754e8efcc97586c00

* Bump Hermes pod to 0.9.0

Summary:
Changelog:
[General][Changed] - Bump Hermes to 0.9.0

(Note: this ignores all push blocking failures!)

Reviewed By: lunaleaps

Differential Revision: D30726473

fbshipit-source-id: add4149454b3f0333f3c1cb8b5d632371fd1bd80

* Update Podfile.lock

* [0.66.0-rc.2] Bump version numbers

* Link RCT-Folly against libc++abi

Summary:
Folly now depends on libc++abi. This solves linker error for RCT-Folly.podspec like this:

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

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

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

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

Reviewed By: lunaleaps

Differential Revision: D30950944

fbshipit-source-id: 3eb146e23faa308a02363761d08849d6801e21ca

* Update rn-tester Podfile.lock to prepare for 0.66.0-rc.3

* [0.66.0-rc.3] Bump version numbers

* Don’t hard-code CocoaPods’s sandbox path (#32243)

Summary:
When running `scripts/react_native_pods.rb`, the `Pods` directory may not be in the current working directory, for example, when calling [`pod install`](https://guides.cocoapods.org/terminal/commands.html#pod_install) with `--project-directory=ios`. Therefore, `sed` fails and, ultimately, the build fails.

References:
* https://rubydoc.info/gems/cocoapods/Pod%2FInstaller:sandbox
* https://rubydoc.info/gems/cocoapods/Pod/Sandbox#root-instance_method

## Changelog

[iOS] [Fixed] - Fix build error after running `pod install` with `--project-directory=ios`

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

Test Plan:
1. `npx react-native init AwesomeProject --version 0.66.0-rc.3 --skip-install`
2. `cd AwesomeProject`
3. `yarn install`
4. `pod install --project-directory=ios`

This command prints “sed: Pods/RCT-Folly/folly/portability/Time.h: No such file or directory” but still exits with 0.

5. `npx react-native run-ios`

The build fails because of “typedef redefinition with different types” as described in https://github.com/facebook/flipper/issues/834.

6. Apply this patch using `(cd node_modules/react-native && curl ec330f756e.patch | patch -p1)`
7. Re-run `pod install --project-directory=ios`
8. Re-run `npx react-native run-ios`

The iOS app should now run successfully.

Reviewed By: sota000

Differential Revision: D31089656

Pulled By: fkgozali

fbshipit-source-id: 431898bed88f68761c7e0e6c79074dc04f43ed23

* OSS: update Podfile.lock automatically when bumping release version

Summary:
To ensure consistency of RNTester Podfile.lock:
* introduce a script to run `pod install` on the current commit
* have the script check the exact CocoaPods version to use for consistency
* have version bump script run this automatically to keep it up-to-date with the version change

To validate, have this change in `0.66-stable` branch, then try:

```
./scripts/bump-oss-version.js 0.66.0-rc.5
```

This automatically ran `pod install` which produced the Podfile.lock update.

Changelog: [Internal]

Reviewed By: TheSavior

Differential Revision: D31132867

fbshipit-source-id: 1c82653ca0cfc5471ed2c5091c09648a7acbab90

* [LOCAL] Port react-native-codegen new .gitignore from main

This is to bring c3ff336326/.gitignore (L107) to release branch

* OSS: bump-oss-version -- update Podfile.lock later in the flow

Summary:
There was some hardcoded validation logic to verify package.json and gradle.properties update. Running `pod install` before that failed this validation on release branch, so let's move the pod update a bit later in the flow.

This also restrict the version number change check to the specific files for better reliability

Changelog: [Internal]

Reviewed By: sota000

Differential Revision: D31160139

fbshipit-source-id: d32470d7dfc48c2efab1d2767f3892b33e0b77dd

* [0.66.0-rc.4] Bump version numbers

* [0.66.0] Bump version numbers

* get ios building

* remove isSelected and selectedRowIndexPath for now

* add workspace

* Restore .eslintignore to what it looks like in react-native-macos

* Fix easy eslint errors as per the `--fix` option

* Fix the rest of the yarn lint errors

* Update yarn.lock

* Add AccessibilityRole back to Button.js

* Fix flow issues on iOS and macOS

* Initialize state in VirtualizedSectionList

* Update snapshots

* Fix parseLogBoxLog tests to include native code blocks

* Specify state explicitly for DisplayOptionsStatusExample

* Disable "Text with custom accessibility actions" example

* android

* Fix AnimatedMock spring to handle animated configs

* Fix most compile issues for macOS

* Fix post_install sed script

* Changes that allow RNTester to launch on macOS

* Fix isHighContrastEnabled on RNTester accessibility page

* Bump special targets in RNTester Podfile to iOS 11

* BorderExample: use a platform color that also exists on macOS

* Disable dev mode on ship builds (#888)

* revert dev mode on ship builds

* rctuicolor

* remove unused variable

* pod install

* fix text fields on macOS

* add osx support

* image prop and scroll view build failures osx

* Fix yarn lint issues

* Update Podfile.lock

* endline changes

* Get rid of macOS RedBox in LayoutEventsExample

* fix: Apply proper accessibility role to images on macOS

* Add another macOS GH#774 tag

* fix snapshot image test failure

* upgrade ts to a compatible version

* bump podfile.lock

* Fix Android patches in fb66merge

* change cocoapods version

* update internal cocoapods requirements

* test increasing min deployable target

* min deployment error in CI, bump to 10.15 osx

* fix typedef redefinition build error in folly

* disable use_flipper in our templates

* disable USE_FRAMEWORKS for Flipper support

* Revert "disable USE_FRAMEWORKS for Flipper support"

This reverts commit c09b6c579c.

* disable post_install of flipper

* combine tempated macos post_install

* add generate-specs.sh

Co-authored-by: Xuan Huang <jsx@fb.com>
Co-authored-by: Samuel Susla <samuelsusla@fb.com>
Co-authored-by: Charles Dudley <charlesdudley@fb.com>
Co-authored-by: Jesse Katsumata <jesse.katsumata@gmail.com>
Co-authored-by: Sota Ogo <sota@fb.com>
Co-authored-by: Rick Hanlon <rickhanlonii@fb.com>
Co-authored-by: David Vacca <dvacca@fb.com>
Co-authored-by: Amy Nichol <amynichol@fb.com>
Co-authored-by: swittk <switt1995@gmail.com>
Co-authored-by: Ikko Ashimine <eltociear@gmail.com>
Co-authored-by: Joshua Gross <joshuagross@fb.com>
Co-authored-by: CodemodService FBSourceClangFormatLinterBot <>
Co-authored-by: Michael Chow <michael.chow@alumni.stanford.edu>
Co-authored-by: Evan Yeung <evanyeung@fb.com>
Co-authored-by: Jacob Parker <jacobparker1992@gmail.com>
Co-authored-by: jeswinsimon <jeswinsimon@gmail.com>
Co-authored-by: fabriziobertoglio1987 <fabrizio.bertoglio@gmail.com>
Co-authored-by: Ramanpreet Nara <ramanpreet@fb.com>
Co-authored-by: Vegas Murphy <vegasmurphy@fb.com>
Co-authored-by: Moti Zilberman <moti@fb.com>
Co-authored-by: Test User <gosimek@gmail.com>
Co-authored-by: Pieter De Baets <pieterdb@fb.com>
Co-authored-by: Paige Sun <paigesun@fb.com>
Co-authored-by: Moti Zilberman <motiz88@gmail.com>
Co-authored-by: Andrei Shikov <ashikov@fb.com>
Co-authored-by: Andrew Clark <acdlite@fb.com>
Co-authored-by: Luis Miguel Alvarado <luismiguel1730@gmail.com>
Co-authored-by: Sunny Luo <sunnylqm@gmail.com>
Co-authored-by: Saad Najmi <saadnajmi2@gmail.com>
Co-authored-by: Héctor Ramos <hramos@fb.com>
Co-authored-by: Michał Pierzchała <thymikee@gmail.com>
Co-authored-by: Harry Yu <hy.harry.yu@gmail.com>
Co-authored-by: Janic Duplessis <janicduplessis@gmail.com>
Co-authored-by: Jordan Becker <jordanbeckerfr@gmail.com>
Co-authored-by: Nicola Corti <ncor@fb.com>
Co-authored-by: Phillip Pan <phillippan@fb.com>
Co-authored-by: Dmytro Voronkevych <zloy@fb.com>
Co-authored-by: Luna Wei <luwe@fb.com>
Co-authored-by: Chris Tolliday <ctolliday@fb.com>
Co-authored-by: Levi Buzolic <levibuzolic@gmail.com>
Co-authored-by: Nishan Bende <nishanbende@gmail.com>
Co-authored-by: Matthew Gray <Matgray@microsoft.com>
Co-authored-by: Hein Rutjes <hrutjes@gmail.com>
Co-authored-by: nacam403 <satnakam@gmail.com>
Co-authored-by: Nicholas Tinsley <nicktinsley@fb.com>
Co-authored-by: hank121314 <hank121314@gmail.com>
Co-authored-by: Jonathan Andrew <jonny.andrew@protonmail.com>
Co-authored-by: alessandro <alessandro.fan@welld.ch>
Co-authored-by: Dulmandakh <dulmandakh@gmail.com>
Co-authored-by: Albert Sun <fatalsun@fb.com>
Co-authored-by: pera <santiagofermendy@gmail.com>
Co-authored-by: Carmi Grushko <carmi@fb.com>
Co-authored-by: Jimmy Zhang <jimmyzh@fb.com>
Co-authored-by: Arushi Kesarwani <arushikesarwani@fb.com>
Co-authored-by: Marshall Roch <mroch@fb.com>
Co-authored-by: Chatura Atapattu <chatatap@fb.com>
Co-authored-by: edenb-moveo <71688494+edenb-moveo@users.noreply.github.com>
Co-authored-by: pietro909 <2094604+pietro909@users.noreply.github.com>
Co-authored-by: Dmitry Rykun <dmitryrykun@fb.com>
Co-authored-by: Leon Kiefer <leon.k97@gmx.de>
Co-authored-by: Steven Bell <bell-steven@users.noreply.github.com>
Co-authored-by: Timo Mämecke <timomeh@users.noreply.github.com>
Co-authored-by: Kacie Bawiec <kacieb@fb.com>
Co-authored-by: Valentin Shergin <valentin.shergin@coinbase.com>
Co-authored-by: Nick Gerleman <ngerlem@microsoft.com>
Co-authored-by: Tommy Nguyen <4123478+tido64@users.noreply.github.com>
Co-authored-by: Connor Tumbleson <connor@sourcetoad.com>
Co-authored-by: Andrew Coates <30809111+acoates-ms@users.noreply.github.com>
Co-authored-by: Kevin Gozali <fkg@fb.com>
Co-authored-by: Neil Dhar <neildhar@fb.com>
Co-authored-by: Jakob Krigovsky <jakob@krigovsky.com>
Co-authored-by: Adam Gleitman <adam.gleitman@gmail.com>
2022-01-14 13:11:09 -08:00
Adam Gleitman b4bbd398b4
Merge from upstream through 2020-09-30 (#833)
* Fix initial padding value for TextInput

Summary:
Changelog: [internal]

# Problem

Default padding for TextEdit is top: 26, bottom: 29, left: 10, right: 10 however the default values for LayoutMetrics.contentInsets is {0, 0, 0, 0}.

If you try to construct TextEdit with padding 0, Fabric will drop padding update because padding is already 0, 0, 0, 0.

# Fix
To fix this, I added a special case to `Binding::createUpdatePaddingMountItem`, if the mutation is insert, proceed with updating padding.

Reviewed By: JoshuaGross

Differential Revision: D23731498

fbshipit-source-id: 294ab053e562c05aadf6e743fb6bf12285d50307

* Fabric: Simplifying ShadowTreeRevision implementation

Summary:
The implementation of this class is too complex for the purpose it serves. Making it simpler will make the code simpler and faster.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: sammy-SC

Differential Revision: D23725688

fbshipit-source-id: 5e1ecddb0dd3c4c4f94786e2ba0af9b67e7426ce

* Fabric: Using ShadowTreeRevision inside ShadowTree to store current commited tree

Summary:
Instead of storing tree separate instance variables, we now store a single object that contains them. We will need it to be able to postpone the mounting stage (we save all info we need for mounting inside the new instance variable).

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: sammy-SC

Differential Revision: D23725690

fbshipit-source-id: 09dd4a0912c6f5b34d805636b62f73ca12287329

* Fabric: Introducing `ShadowTree::getCurrentRevision()`

Summary:
Previously, to get a current root shadow node for a shadow tree, we called `tryCommit` method and stole a pointer from this. That was not a very straightforward method to get things done, and most importantly we need to do this to change the shape of the ShadowTreeCommitTransaction signature (remove a shared pointer from the callback) to make it simpler, faster and allow future improvements (see the next diff).

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: JoshuaGross, sammy-SC

Differential Revision: D23725689

fbshipit-source-id: 51950b843a0e401828b6c6a38e5e2aaaf21ec166

* Fabric: Removing shared_ptr from ShadowTreeCommitTransaction's argument

Summary:
We don't need a shared_ptr here and without it the code will be faster and simpler.
This change is aligned with any clone-line callbacks we have in the Core which accepts a `const &` and return `shared_ptr<>`.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: JoshuaGross, sammy-SC

Differential Revision: D23725687

fbshipit-source-id: 1cd959f4273913175d342302e2f12752f0114768

* Fabric: Using `thread_local` keyword instead on own implementation in TransactionTelemetry

Summary:
Apparently, there is C++ keyword for this.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: sammy-SC

Differential Revision: D23754284

fbshipit-source-id: 5f9bbcc72d9c586173624869d614f12d2319fb7b

* Add an explicit NDK version to Android template (#29403)

Summary:
Added an explicit NDK version to the Android template. This allows tooling to detect which NDK version to install automatically.

## 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 an explicit NDK version to Android template

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

Test Plan: Template builds as it should. NDK version gets installed with initial Android set up.

Reviewed By: passy

Differential Revision: D23752007

Pulled By: fkgozali

fbshipit-source-id: 31c33f275f94a4a62338a61e79b31c4b996969bf

* Fabric: Removing `RCTCGColorRefUnretainedFromSharedColor()`

Summary:
This diff removes `RCTCGColorRefUnretainedFromSharedColor` function because it's not compatible with future changes we plan to make.
Converting SharedColor to unretained CGColorRef is actually quite dangerous because... it's an unowned pointer.

Reviewed By: JoshuaGross

Differential Revision: D23753509

fbshipit-source-id: df030ade69b63cbb872d6bdbde51575eedc6a4a6

* Fabric: Using RCTUIColorFromSharedColor everywhere

Summary:
Even though we have wonderful helper functions converting SharedColor to UIColor and CGColorRef, in many places we still use some hardcoded things. This diff fixes that; it will be important for the next diff.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: JoshuaGross

Differential Revision: D23753508

fbshipit-source-id: 09d280b132266252753526c2735ab3e41b96c8d5

* Fabric: Color conversion functions now do not depend on internal implementations of SharedColor

Summary:
This diff changes the implementation of `RCTCreateCGColorRefFromSharedColor` and `RCTUIColorFromSharedColor` in such a way that they don't rely on the fact that SharedColor is actually a `shared_ptr<CGColorRef>`. Instead, the methods just extract color components from SharedColor and create UIColor and CGColorRef objects on demand.
This allows us to change the implementation of SharedColor without worrying much about the rest of the system, which will do in the next diff.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: JoshuaGross

Differential Revision: D23753510

fbshipit-source-id: 340127527888776ebd5d241ed60c7e5220564013

* Fabric: Using `optional<int>` instead of `CGColorRef` on iOS

Summary:
Finally, this diff changes the internal implementation of SharedColor to be `optional<int>`.

Initially, when we started working on the new renderer, it seemed like a good idea to allocated CGColor objects ahead of time and store them with Props. Now, this idea does not look so good, especially because:
* Having `SharedColor` as a `shared_ptr` is a quite big perf overhead for copying this thing. And the size of the object is not small.
* Having `SharedColor` as a `shared_ptr` creates huge interconnectedness among pieces of the core and rendering. E.g. improper releasing a pointer in some component view can cause a crash somewhere in the core (because both places might use the same shared `blackColor`.

On Android, we already use simple `int` as a representation of a color, and this works great. And this diff implements something very similar to Android, but a bit differently: here we use `optional<int>` instead of custom class with a single `int` field and some magic value that represents "empty value".

This approach should fix T75836417 because now we don't have allocation and deallocation when we simply assign color values.

If this solution works fine on iOS, I will do unify all implementations among all platforms.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: JoshuaGross

Differential Revision: D23753507

fbshipit-source-id: 42fd6cee6bf7b39c92c88536da06ba9e8cf4d4db

* Fabric: Using pre-cached UIColor objects for black, white, and clear colors

Summary:
This change maps the three most used colors (black, white, clear) to corresponding predefined values in UIColor. This should meaningfully reduce the overall amount of allocated UIColor/CGColor objects. In my non-scientific measures, it reduces the number of CGColor objects from ~1500 to ~1000. And... it no much at least in terms of kilobytes. However, I still think it's a good idea to implement this because I hope that can remove some work from memory allocation infra and maybe enable some optimizations that UIKit hopefully does for black and white colors. (I tend to believe that this optimization exists because UIKit even has a classes called UIDeviceWhiteColor and UICachedDeviceWhiteColor.)

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: JoshuaGross

Differential Revision: D23753506

fbshipit-source-id: 46e58dc7e6b0dcab3c83d29c7257c90ffbd95246

* Coalesce touchMove events

Summary:
Changelog: [Internal]

To align more closely with Paper, Fabric should coalesce touchMove events.

on iOS it happens:
https://www.internalfb.com/intern/diffusion/FBS/browsefile/master/xplat/js/react-native-github/React/Base/RCTTouchEvent.m?lines=43

Reviewed By: JoshuaGross

Differential Revision: D23734212

fbshipit-source-id: a9d324a6481884905d7be6637fcafe4e71f2bd9f

* Fix LayoutAnimations assertion on `adjustDelayedMutationIndicesForMutation`

Summary:
`adjustDelayedMutationIndicesForMutation` asserts that the mutation is either Remove or Insert. At one callsite, we weren't checking the mutation type before calling `adjustDelayedMutationIndicesForMutation`.

Changelog: [Internal]

Reviewed By: shergin

Differential Revision: D23746617

fbshipit-source-id: 6046fec2eb4821094937b1b16f40347bbc55c20e

* Fix MountingCoordinator override mode

Summary:
In MountingCoordinator override mode (used in LayoutAnimations) we must set the start and end `diff` time when no real diff happens, otherwise we will hit an assert in telemetry later.

I also ensure that the TransactionNumber is incremented in that case.

Changelog: [Internal]

Reviewed By: shergin

Differential Revision: D23746684

fbshipit-source-id: b1fe3864e453fdba89d43cc827bd37434abf7a4d

* Fix MountingCoordinator RN_SHADOW_TREE_INTROSPECTION + LayoutAnimations

Summary:
Currently, MountingCoordinator's RN_SHADOW_TREE_INTROSPECTION code will crash often because it assumes there is always a "new" tree to compare the old tree to. In the LayoutAnimations context this is not always the case - in fact, the majority of the time, LayoutAnimations is producing mutations for animation without a "new" tree.

Just check that the tree exists before trying to print it.

Changelog: [Internal]

Reviewed By: shergin

Differential Revision: D23747289

fbshipit-source-id: a1ba22aeae32ed8915a53bc33cdc199e8ce5128a

* Fix compilation for LayoutAnimations debug mode

Summary:
iOS needs this function to be marked as static.

Changelog: [internal]

Reviewed By: shergin

Differential Revision: D23749613

fbshipit-source-id: a8c160646853450fc7d849448bdbb45e02beb964

* LayoutAnimations: at the end of every animation, issue an update mutation

Summary:
LayoutAnimations: at the end of every animation, issue an update mutation - this is so that the props data on the Mounting layer/StubViewTree layer is pointer-identical to the props data on the ShadowTree.

This unblocks iOS debug mode crashes.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D23753606

fbshipit-source-id: 407e0c2746a65e6d3ee29c1cce891cd7c1013593

* Layout Events: throttle layout events sent to same node repeatedly

Summary:
Under Fabric only, we can enter an infinite layout loop where the emitted layout event oscillates between two height values that are off by a very small amount.

The cause is, in part, components that use layoutEvents to determine their dimensions: for example, using onLayout event "height" parameters to determine the height of a child. If the onLayout height changes rapidly, the child's height will change, causing another layout, ad infinitum.

This might seem like an extreme case but there are product use-cases where this is done in non-Fabric and layout stabilizes quickly. In Fabric, currently it may never stabilize.

Part of this is due to a longstanding issue that exists in Fabric and non-Fabric, that we cannot immediately fix: If in a single frame, C++ emits 100 layout events to ReactJS, ReactJS may only process 50 before committing the root. That will trigger more layout events, even though product code has only partially processed the layout events. At the next frame, the next 50 events will be processed which may again change the layout, emitting more events... etc. In most cases the tree will converge and layout values will stabilize, but in extreme cases in Fabric, it might not.

Part of this is because Fabric does not drop *stale* layout events. If 10 layout events are dispatched to the same node, it will process all 10 events in older. Non-Fabric does not have this behavior, so we're changing Fabric to drop stale events when they queue up.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D23719494

fbshipit-source-id: e44a3b3e40585b59680299db3a4efdc63cdf0de8

* Copy all blocks generated by TurboModules

Summary:
The Apple documentation states: https://developer.apple.com/library/archive/documentation/Cocoa/Conceptual/Blocks/Articles/bxUsing.html#//apple_ref/doc/uid/TP40007502-CH5-SW1

> Typically, you shouldn’t need to copy (or retain) a block. You only need to make a copy when you expect the block to be used after destruction of the scope within which it was declared. Copying moves a block to the heap.

All blocks generated in the TurboModule infra, for callbacks and promise resolve/reject handlers, can be used after the destruction of the scope within which they were declared. Therefore, let's copy them in the hopes that they mitigate T75876134.

**Note:** We copy blocks before pushing them into the `retainedObjects` array in the legacy Infra as well. Context: D2559997 (71da2917e5), D5589246 (2a6965df90)

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D23764329

fbshipit-source-id: e71360977bdff74dc570bd40f0139792860f811f

* Upgrade Hermes dependency to 0.7.0

Summary:
Use the latest published release of hermes-engine.
Changelog: [Android] [Changed] - Upgraded to Hermes 0.7.0
allow-large-files

Reviewed By: cpojer

Differential Revision: D23725129

fbshipit-source-id: 50938433147100e97699b717d77a687fbbfe892b

* Fabric: Enabling state auto-repeating for all state updates (gated)

Summary:
This enables a new state auto repeating mechanism built-in mechanism for all state updates which we already use for CK interop. This experiment is supposed to help with T74769670 and co.

This change is gated with MC.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: JoshuaGross

Differential Revision: D23762508

fbshipit-source-id: f535513c724ace9ede570177281324eb507329c5

* Stop accessing JVM in ~JavaTurboModule

Summary:
Inside JavaTurboModule, the native `CallInvoker` is used to schedule work on the NativeModules thread. So, in ~JavaTurboModule(), I scheduled some work on the NativeModules thread. This work holds a copy of the JNI global reference to the Java NativeModule object, and when it's executed, it resets this global reference to the Java NativeModule object. This should ensure that the we don't access the JVM in ~JavaTurboModule, which could crash the program.

I also removed the redundant `quitSynchronous()` in `~CatalystInstanceImpl()`, to prevent the NativeModules thread from being deleted before we delete the `jsi::Runtime`. This shouldn't cause an issue, because we delete the NativeModules thread when we call [ReactQueueConfigurationImpl.destroy()](https://fburl.com/codesearch/p7aurwn3).

Changelog: [Internal]

Reviewed By: ejanzer

Differential Revision: D23744777

fbshipit-source-id: a5c8d3f2ac4287dfef9a4b4404a04b335aa0963d

* 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

* 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

* 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

* 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

* 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

* Reintroduce experiment flag for Reparenting/Flattening Differ

Summary:
This flag was deleted in D23374948 (6729a3e0bf), reintroduce it.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D23771273

fbshipit-source-id: ae9595194bf14bc740d05b2ca6e7b5e22bdd566f

* Add cause to jsi::instrumentation::collectGarbage

Summary:
Continuing the adding of a "cause" field for logging to GCs.
This allows embedders of Hermes (such as React Native) to specify
the cause of a call to `collectGarbage`.

Notably, this allows Hermes to know when a GC is triggered by a memory warning.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D23742099

fbshipit-source-id: 99453e632328c00045b92a72f789d41c898dc518

* Update Flipper (#29787)

Summary:
The current Flipper version included in new React Native is quite old, causing some bugs to be present which have long been solved, such as freezing the UI after inspecting it.
Fixes

This fixes https://github.com/facebook/react-native/issues/29492 /
https://github.com/facebook/flipper/issues/1399

## 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] - Update Flipper to 0.54

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

Test Plan:
Updated the RN 0.63.2 based test project https://github.com/mweststrate/flipper-issue-1399-repo with `use_flipper!('Flipper' => '0.54.0')` (in `ios/Podspec`) / `FLIPPER_VERSION=0.52.1` in `gradle.properties` in the test project https://github.com/mweststrate/flipper-issue-1399-repo and verified that everything builds and connects correctly, and that the bug is no longer present.

Tried to run RN-tester project in this repo. For iOS this succeeded, on Android I got a build error:

```
make: Leaving directory '/Users/mweststrate/Desktop/react-native/ReactAndroid/src/main/jni/react/jni'
make: Entering directory '/Users/mweststrate/Desktop/react-native/ReactAndroid/src/main/jni/react/jni'
fcntl(): Bad file descriptor
[armeabi-v7a] Compile++ thumb: folly_json <= FileUtil.cpp
/Users/mweststrate/Desktop/react-native/ReactAndroid/build/third-party-ndk/folly/folly/FileUtil.cpp:37:14: error: no matching function for call to 'wrapNoInt'
make: Leaving directory '/Users/mweststrate/Desktop/react-native/ReactAndroid/src/main/jni/react/jni'
  return int(wrapNoInt(open, name, flags, mode));
             ^~~~~~~~~
/Users/mweststrate/Desktop/react-native/ReactAndroid/build/third-party-ndk/folly/folly/detail/FileUtilDetail.h:34:9: note: candidate template ignored: couldn't infer template argument 'F'
ssize_t wrapNoInt(F f, Args... args) {
        ^
1 error generated.
make: *** [/opt/android_sdk/ndk/21.3.6528147/build/core/build-binary.mk:478: /Users/mweststrate/Desktop/react-native/ReactAndroid/build/tmp/buildReactNdkLib/local/armeabi-v7a/objs/folly_json/folly/FileUtil.o] Error 1
make: *** Waiting for unfinished jobs....
fcntl(): Bad file descriptor
make: Entering directory '/Users/mweststrate/Desktop/react-native/ReactAndroid/src/main/jni/react/jni'
[armeabi-v7a] Compile++ thumb: folly_json <= Demangle.cpp
```

No idea if it is related. I guess not since without making the change I got the same error.

Reviewed By: mweststrate

Differential Revision: D23767388

Pulled By: fkgozali

fbshipit-source-id: 35f0d3ddec41942f5bbc96cb391975d84729ef5e

* Fix flattening/unflattening case on Android

Summary:
There are cases where we Delete+Create a node in the same frame. Practically, the new differ should prevent this, but we don't want to rely on that necessarily.

See comments for further justification on why deleteView can do less work overall.

In reparenting cases, this causes crashes because dropView removes *and deletes* children that shouldn't necessarily be deleted.

Changelog: [Internal]

Reviewed By: shergin

Differential Revision: D23775453

fbshipit-source-id: c577c5af8c27cfb185d527f0afd8aeb08ee3a5fe

* Have BatchMountItem log the exact item that crashes

Summary:
Because BatchMountItem executes many items, sometimes it's unclear which MountItem causes a crash. Catch and log the exact item.

This shouldn't cause perf regressions because we have a try/catch block in FabricUIManager where execute is called.

Changelog: [Internal]

Reviewed By: shergin

Differential Revision: D23775500

fbshipit-source-id: c878e085c23d3d3a7ef02a34e5aca57759376aa6

* Additional differ test: flattening differ should not produce DELETE and CREATE mutation for the same tag in the same frame

Summary:
See additional assertion. Tests still pass, so no other change was necessary.

Changelog: [Internal]

Differential Revision: D23775553

fbshipit-source-id: 57d3191f25dd55ab4da189207f6d201a31b175e0

* Fabric: Removing catching all exceptions in UIManager::completeRoot

Summary:
This is a revert of D23529233 (902611f148).
It turns out it was a bad idea. With this catch-all thing, we don't get new information. Yeah, we crash earlier now but seems we have even less information about the crash. :(

I think D23754284 (04c874bd9c) should fix the issue.

Changelog: [Internal] Fabric-specific internal change.

Original commit changeset: 7ac7fb26ac08

Reviewed By: sammy-SC

Differential Revision: D23786086

fbshipit-source-id: 86784df0193abfb7328c4d5a16a9af4214e9a161

* Fabric: Marking all JS function lambdas `noexcept` in UIManagerBinding

Summary:
Exceptions in C++ work quite differently from exceptions in other languages. To make exceptions actually work **correctly** all the code needs to be written with "exceptions in mind" (e.g., see https://www.stroustrup.com/except.pdf). In short, if the code is not "exceptions ready", throwing an exception causes memory leaks, dangling pointers, and invariant violations all over the place, which will probably cause another crashes down the road (which will be especially hard to investigate and attribute to the original issue).
Fabric Core (Layout, Props parsing, ShadowNodes management, and so on) does not use exceptions because in most (all?) the cases the exception is now recoverable. So, if a program detects some internal state invariant violation or missing some resource, *logically* it's fatal. We also don't want to pay code-size and performance tax for exception support, so that's why we don't use them. It's just not the right fit for Fabric Core.

This does not mean that exceptions don't happen though. C++ standard library can throw them... sometimes. And if our library is compiled with exceptions enabled (still the case, unfortunately), an exception can bubble to JavaScript code and losing all context down the road. And it's hard to investigate such crashes. To isolate those occasional exceptions inside C++ core we are marking all C++/JS boundaries with `noexcept` that stops the bubbling.

I hope that will give us much more informative crash reports.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: sammy-SC

Differential Revision: D23787492

fbshipit-source-id: 0822dbf36fc680c15b02b5cd0f2d87328296b642

* 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

* Notify ViewManagers when a View is deleted

Summary:
In a previous recent diff we changed Android's Delete mount instruction to *not* recursively delete the tree. This is fine, but because of that, we stopped calling `onDropViewInstance` when views are normally deleted.

Bring back that behaviour.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D23801666

fbshipit-source-id: 54e6b52ab51fff2a45102e37077fe41081499888

* Prevent calling onTextLayout with the same value

Summary:
Changelog: [internal]

In D23648430 (a315e4cd30) I made a mistake. I prevented calling `onTextLayout` unless there are attachments in the component. It fixed the problem because I unintentionally prevented `onTextLayout`  to be called. Therefore, changes from D23648430 (a315e4cd30) need to be reverted.

To prevent infinite loop in `onTextLayout`, ParagraphEventEmitter checks if `linesMeasurements` have changed before dispatching it to JS.

Reviewed By: shergin

Differential Revision: D23782717

fbshipit-source-id: 0e84ae4f46d79ce0cf4c7340cd32be6f562ae179

* TurboModule Android: compile TurboModule C++ Core into ReactAndroid

Summary:
This is to prepare for enabling TurboModule on Android. This commit compiles in all the core files (C++) into the ReactAndroid NDK build step. This doesn't yet enable TurboModule by default, just compiling in the infra, just like for iOS.

New shared libs:
* libreact_nativemodule_core.so: The TurboModule Android core
* libreact_nativemodule_manager.so: The TurboModule manager/delegate

To be compatible with `<ReactCommon/` .h include prefix, the files had to move to local `ReactCommon` subdirs.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D23805717

fbshipit-source-id: b41c392a592dd095ae003f7b2a689f4add2c37a9

* Add additional logging and asserts to StubViewTree

Summary:
Helps in testing LayoutAnimations or differ changes.

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D23797890

fbshipit-source-id: 1e612c04f9fbb256f2ace8a4a2ed9a477b4695a1

* Deleting unnecessary Differentiator code

Summary:
In the new Flattening differ, I experimentally verified that these two code paths are not hit (or redundant) and deleted them.

One of the branches did nothing and the other produced duplicate DELETE mutations for the same tag, that is handled elsewhere.

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D23806161

fbshipit-source-id: 9ad2929e2d719a7b9b34640ed35f7a696103604b

* LayoutAnimations: simplify index adjustment, (un)flattening detection

Summary:
In this diff I simplify index adjustment and add comments to rigorously describe what we're doing at each step of index adjustment.

I've also made unflattening detection more correct, robust, and slightly more efficient.

Bugs that existed before:

1) The reparenting detection that existed in the animations layer had some subtle bugs. I don't have proof that it results in any correctness issues or crashes, but I suspect it.
2) Correctness of index adjustment: there were cases where the Android mounting layer would crash because LayoutAnimations would try to remove a View at an index, but the index was wrong. This is why I sat down and diagrammed the relationships between all the bits of data we have for index readjustment - I believe this to be correct now.
3) Correctness of INSERT index adjustment: I had the insight that when we have batches of INSERTs to consecutive indices, we essentially want them to be treated as a single INSERT for adjustment purposes, so that they're all placed consecutively in the view layer. I added `ConsecutiveAdjustmentMetadata` to deal with this, and there are more comments in the code.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D23806163

fbshipit-source-id: cd9e94945034db8b840f2a806c6377034a91af61

* Deploy Flow v0.134.0

Summary: Changelog: [Internal]

Reviewed By: dsainati1

Differential Revision: D23769795

fbshipit-source-id: 520e3974a53ba5961a081219c0cbf19b7dfade06

* Daily `arc lint --take CLANGFORMAT`

Reviewed By: zertosh

Differential Revision: D23811656

fbshipit-source-id: 4104948d2e4db786998320bcfdb1598d4a497f2d

* 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

* Making Android versionCodeOverride for new apps using the template human-readable (#29808)

Summary:
The current calculation on versionCodeOverride is not human-readable.

Imagine if we have an android app with **versionName** `4.0` and **version code** `4`.

In the current implementation, the result of **versionCode** `4` for `armeabi-v7a` will be the seemingly arbitrary **1048580**. This makes the version code to be seemingly arbitrary and hard to read for humans. This PR proposes to change this calculation closer to google implementation of build number in Flutter (`abiVersionCode * 1000 + variant.versionCode`).
39d7a019c1/packages/flutter_tools/gradle/flutter.gradle (L643-L647)

With this change, our app with `versionCode 4 versionName "4.0"` for  `armeabi-v7a`  will have **1004**  as the version code instead of the seemingly arbitrary **1048580**. As you can see adopting the flutter style implementation make the version code easier to read and debug.

**1004**
**1** - The ABI Type `["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]`
**004** - Our versionCode.

Hopefully, this can prevent future issues like this https://github.com/facebook/react-native/issues/29790.

## Changelog

[Android] [Changed] - Making Android versionCodeOverride for new apps using the template human-readable

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

Reviewed By: sammy-SC

Differential Revision: D23804632

Pulled By: fkgozali

fbshipit-source-id: 89b2c196b3bfe01fa608dfb595db6d3314ca1d63

* Codegen Android: adjust JNI output to compile from Gradle

Summary:
This adjusted the C++ output for Android codegen (NativeModule specs) so we can compile it with ndk-build in Gradle:
* Use `#include` instead of `#import` for header files
* Added `#pragma once`
* Removed direct include of `<fb/fbjni.h>` -- this is not necessary
* Added generated Android.mk file based on library name

Changelog: [Internal]

Reviewed By: shergin

Differential Revision: D23809082

fbshipit-source-id: 11ddfea7b48c8b2eb6efe885641ace4fc327d50d

* Codegen Android: Compile ReactAndroid codegen C++ output

Summary:
Now that the react-native-codegen produces the Android.mk for the JNI C++ output, let's compile them into its own shared library, to be included in the ReactAndroid final deliverable: libreact_codegen_reactandroidspec.so. This is gated behind `USE_CODEGEN` env var.

Note: RNTester specific C++ spec files are not compiled here.

Changelog: [Internal]

Reviewed By: shergin

Differential Revision: D23809081

fbshipit-source-id: 7a90f420a923d5d02654facac01ffe025c321e44

* Use Element<> in FindNodeAtPointTest

Summary: Changelog: [Internal]

Reviewed By: JoshuaGross

Differential Revision: D23815171

fbshipit-source-id: bf420be172a55a966f8881371473e121c3848c78

* Fix ordering of children in LayoutableShadowNode::findNodeAtPoint

Summary:
Changelog: [internal]

`LayoutableShadowNode::findNodeAtPoint` was iterating children in incorrect order and wasn't taking zIndex into accout.

Reviewed By: JoshuaGross

Differential Revision: D23814866

fbshipit-source-id: 38eee297147a5c5912304d139bb10f8b16ae2ee1

* 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

* Pull out construction of Layout from TextLayoutManager.measureText into separate function

Summary:
Changelog: [Internal]

Construction of Layout will be needed in `TextLayoutManager.measureLines`, pulling it out into separate function prevents code duplication.

Reviewed By: shergin

Differential Revision: D23782905

fbshipit-source-id: 8ab817559ca154716a190ca1012e809c5fa2fd6e

* Wire call from C++ to Java to get lines measurements

Summary: Changelog: [Internal]

Reviewed By: shergin

Differential Revision: D23782998

fbshipit-source-id: fa9bda274c024d5bbd3ca24f394b5d76f8c07ad2

* Implement onTextLayout on Text component.

Summary:
Changelog: [Internal]

Add `Text.onTextLayout` implementation to Android's Text component.

Reviewed By: JoshuaGross

Differential Revision: D23782311

fbshipit-source-id: fdb5709aaf68efee0ab895a6661396f92cfc768a

* Fix Xcode bundler in staging and release (#29477)

Summary:
Revert "feat: improve monorepo support by removing redundant PROJECT_ROOT (https://github.com/facebook/react-native/issues/28354)"

This reverts commit a8e85026cf.

This commit a8e85026cf somehow broke the bundler when making a staging or release build in Xcode that results in unresolved files and main.jsbundle nonexistance issue. I figured this out by replacing react-native-xcode.sh from RN v0.63.2 by the one from v0.62.2 where everything works just fine and then reverting the changes line by line. It seems like this pr will fix similar issues stated here https://stackoverflow.com/questions/62806319/main-jsbundle-does-not-exist-this-must-be-a-bug-with-main-jsbundle-issue-afte/62829256#62829256 and here https://github.com/facebook/react-native/issues/29205

## Changelog

[iOS] [Fixed] - fix "main.jsbundle does not exist" issue

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

Test Plan:
With react-native-xcode.sh from RN v0.63.2
![image](https://user-images.githubusercontent.com/32848434/88342113-7ce55d80-cd47-11ea-9dab-bf41ec6d6ab5.png)

With my changes
![image](https://user-images.githubusercontent.com/32848434/88342376-f0876a80-cd47-11ea-9c08-96b892784da1.png)

Reviewed By: sammy-SC

Differential Revision: D23817847

Pulled By: hramos

fbshipit-source-id: 4b729c1231d30e89073b2520aeadee944c84421c

* New Share API Use Cases (#29856)

Summary:
* New use cases for share API in rn-tester

## Changelog
[General] [Changed] - Changed use cases for share API in rn-tester

## Test Plan
* Tested app in both Android and iOS

![Screenshot_2020-09-09-21-20-41-322_com facebook react uiapp](https://user-images.githubusercontent.com/42653703/92624772-83bf3400-f2e5-11ea-820f-a7f3d9a44a11.jpg)

![image](https://user-images.githubusercontent.com/42653703/92624985-c1bc5800-f2e5-11ea-9f30-b88ab786963b.png)

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

Reviewed By: hramos

Differential Revision: D23784222

Pulled By: rickhanlonii

fbshipit-source-id: f311201a49e0a76abb6634232106ed756143da30

* 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

* feat: enable bitcode (#365)

Summary:
Bitcode is turned on by default in React Native and so, setting it here as well.

Changelog: [iOS] [Changed] - Upgraded JSI with a new HERMES_ENABLE_BITCODE flag

Pull Request resolved: https://github.com/facebook/hermes/pull/365

Reviewed By: tmikov

Differential Revision: D23823228

Pulled By: Huxpro

fbshipit-source-id: d43638818a733f6a87b2f4a1ecadad8ea9c7a419

* Add new ReactMarkers for bridgeless init start/end

Summary: Adding two new ReactMarkers for start and end of bridgeless initialization. Creating new ones instead of reusing existing ones to make it easier to differentiate data from the bridge vs. bridgeless, and also because our existing markers 1) aren't very easy to understand, and 2) don't map cleanly to the new architecture.

Reviewed By: PeteTheHeat

Differential Revision: D23789156

fbshipit-source-id: 2ed10769e08604e591503a2bc9566aeb1d0563ed

* Set useLineSpacingFromFallbacks when measuring text

Summary:
Changelog: [internal]

When paper measures text, it sets `useLineSpacingFromFallbacks` flag on the Layout object. In Fabric this was missing and can cause incorrect layout.

Reviewed By: JoshuaGross

Differential Revision: D23845441

fbshipit-source-id: 538f440cdbbf8df2cba0458837b80db103888113

* Make React-Core compatible with Swift modules (#29995)

Summary:
Related to https://github.com/facebook/react-native/issues/29633

Support Swift based libraries using Xcode 12’s build system.

## Changelog

[iOS] [Fixed] - Support Swift based libraries using Xcode 12’s build system.

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

Test Plan:
* Building RNTester still works
* Swift based pod tested in https://github.com/mrousavy/react-native-blurhash/issues/58

Reviewed By: fkgozali

Differential Revision: D23824438

Pulled By: appden

fbshipit-source-id: 418caf9808cb6326e3d6efdc8b37131a5705e7f6

* Sort logger alphabetically

Summary:
Rearranging to alphabetically sort, no functionality changes

Changelog: [Internal]

Reviewed By: rubennorte, motiz88

Differential Revision: D23836997

fbshipit-source-id: 00232b88379e44920ecb74fa6ff43f36d941d93b

* 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

* RNTester Android: Add stub C++ for TurboModule provider (#30014)

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

This is the base setup to compile C++ as part of RNTester app. There is no dependencies on ReactAndroidNdk lib yet, just a bunch of ndkBuild setup in Gradle. Note: this is using Gradle's `nkdBuild` support instead of calling `ndk-build` manually like in ReactAndroid/build.gradle.

Reference: https://google.github.io/android-gradle-dsl/current/com.android.build.gradle.internal.dsl.ExternalNativeNdkBuildOptions.html

Note that `ANDROID_NDK` env var is honored to pick the right NDK version.

For now, this is gated behind `USE_CODEGEN` env variable.

Changelog: [Internal]

Reviewed By: JoshuaGross

Differential Revision: D23887058

fbshipit-source-id: 7a962649461d15af46999a15b900464543e5b05c

* New Button Component Use Cases (#29848)

Summary:
* New use cases for button component in rn-tester
 * E2E tests for the button component

## Changelog
[General] [Changed] - Changed use cases for button component in rn-tester

## Test Plan
![image](https://user-images.githubusercontent.com/42653703/92123053-ced6d400-ee19-11ea-8f10-c5e8529c85ca.png)
After -
![image](https://user-images.githubusercontent.com/42653703/92625569-70609880-f2e6-11ea-9fb9-f7327d842a34.png)
Before -
![image](https://user-images.githubusercontent.com/42653703/92625555-6a6ab780-f2e6-11ea-90d1-8c54ebc60062.png)

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

Reviewed By: hramos

Differential Revision: D23649694

Pulled By: rickhanlonii

fbshipit-source-id: 3590eca08ea58c771596ad731f74eb233b1a40d8

* Minor Code Improvements in RNTester (#29868)

Summary:
* Update single-letter variable names to be more descriptive
* Remove event listener on component unmount
* Add flow types
* Refactor RNTesterNavbar to use descriptive component names

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

Reviewed By: hramos

Differential Revision: D23598579

Pulled By: rickhanlonii

fbshipit-source-id: c5cfc61d7b2fcb2942bf149d0a8ba0b58b0192e6

* 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

* Fix touch handling in bridged paper components

Summary:
Changelog: [internal]

If view was bridged from Paper, hit testing would return Paper view which doesn't have reference to Fabric's event emitter.
To fix this, if the bridged view is returned from hit testing, it is swapped with interop view which has reference to event emitter.

Reviewed By: shergin

Differential Revision: D23840054

fbshipit-source-id: d4aa4ee8da4e1da80d2e2b69b79ed82d726f04e3

* TurboModule Android: add dependency on ReactAndroid codegen output to RNTester

Summary:
This adds shared libraries dependencies to RNTester so that it can call `ReactAndroidSpec_ReactAndroidSpec_ModuleProvider()` C++ lookup function. That function is generated by the react-native-codegen during build time. This does not make RNTester use TurboModule yet, just the necessary setup to link the C++ libs together.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D23901952

fbshipit-source-id: fd5ee0ca266609207962adc5ceaf814956052eec

* Fix rounding in Slider component

Summary:
Changelog: [Internal]

There was a typo in condition. We need to be comparing step prop and not value. The same condition is implemented in Paper.

Reviewed By: JoshuaGross

Differential Revision: D23903493

fbshipit-source-id: 37506d0fac63f624332041602489ab1cf378bfcc

* 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

* Fix rounding issue when setting padding

Summary:
Changelog: [Internal]

Padding needs to be rounded down (floor function), not rounded to the closest natural number.
Otherwise the content of the view might not fit.

Reviewed By: JoshuaGross

Differential Revision: D23905145

fbshipit-source-id: e84d70155b207144b98646dd0c4fea7a8c4bd876

* LayoutAnimations: force props to update when executing "final" mutations

Summary:
When an animation is completed or a conflicting animation is detected, force props, state, layout, etc to update.

Currently, when a final animation mutation is queued, some attributes can be updated but not others, causing unexpected visual glitches at least on Android.

Some of these are arguably component bugs, but it's easier to just flush all attributes by tricking the platforms into updating all attributes. This will also prevent us from having to track down more of these bugs, potentially.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D23886519

fbshipit-source-id: 8e5081bbe3b7843c16c0f283fa07fdec0e211aa8

* TurboModule Android: compile codegen C++ output into librntester_appmodules.so

Summary:
The react-native-codegen provides Android.mk in the Android C++ output, but for RNTester (or hosting apps), we should just compile the codegen output with the rest of the app-specific C++ files. This is to simplify the build configuration, and also to not add too many additional .so libs to the APK.

With this commit, `RNTesterAppModuleProvider.cpp` should be "complete" for RNTester use-case. This TurboModule lookup function is the one described in https://github.com/react-native-community/discussions-and-proposals/issues/273.

Changelog: [Internal]

Reviewed By: hramos

Differential Revision: D23913149

fbshipit-source-id: d1ca136787b87a0e8e6504318e1f0a78efef46ea

* Follow-up for fixing xiaomi NullPointer crash

Summary:
This is a follow-up for fixing the xiaomi NullPointer crash (D23331828 (07a597ad18) D23451929 (b5b4a70410)):

1, Clean up previous temporary fix in js.

2, Cover all cases including caretHidden is set and isn't set, in previous fix if caretHidden isn't set then fix won't be executed.

Changelog: [Internal]

Reviewed By: makovkastar

Differential Revision: D23816541

fbshipit-source-id: a7543f6767430abb74141a747b08391986662958

* Workaround for Date Picker in iOS14

Summary:
iOS14 has introduced new styles for date picker. The default new calendar style breaks the old spinner type style.

This is a workaround to keep the spinner style as a default, until the calendar style is properly supported. According to [this github comment](https://github.com/react-native-community/datetimepicker/issues/285) it works well.

This will fix DatePicker for both Fabric and Paper, since Fabric uses the interop layer to render it.

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D23935328

fbshipit-source-id: 1a7fadba274e0537f0ac4ced60e23e7c809d57dc

* Group accessible views using the view hierarchy

Summary: In iOS when a parent UIView returns YES on [shouldGroupAccessibilityChildren](https://developer.apple.com/documentation/objectivec/nsobject/1615143-shouldgroupaccessibilitychildren), VoiceOver groups together the accessible children of the parent view, regardless of their position on screen. In iOS this defaults to NO.

Reviewed By: sammy-SC

Differential Revision: D23844265

fbshipit-source-id: eb99bf0873ccfd9fb196f8f7b6eafe055f6ae810

* Fabric: Fixed crash in `colorComponentsFromColor()`

Summary:
This fixes a recently introduced crash in `colorComponentsFromColor()` (iOS implementation) caused by dereferencing a null pointer.

The fix is just a copy of a code fragment from a previous implementation.

Reviewed By: fkgozali

Differential Revision: D23944812

fbshipit-source-id: 977135dd75c4375affddfd75183e4890618ae819

* round up layoutWidth for Android 11 in ReactTextShadowNode

Summary:
in Android 11, there's an issue where Text content is being clipped. The root cause appears to be a breaking change in how Android 11 is measuring text. rounding up the layoutWidth calculation mitigates the issue.

Changelog: [Internal]

Reviewed By: JoshuaGross

Differential Revision: D23944772

fbshipit-source-id: 1639259da1c2c507c6bfc80fed377577316febac

* 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

* Android: consolidate various prebuilt C++ .so configuration into Android-prebuilt.mk

Summary:
To make it easier for hosting app or other lib to get access to the ReactAndroidNdk .so outputs, let's define common targets in a dedicated Android-prebuilt.mk. Hosting app's Android.mk just need to include the mk path.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D23938538

fbshipit-source-id: 850d690326d134212d5f040c6fa54ab50c53cb87

* TurboModule Android: rename libreact_nativemodule_manager to libturbomodulejsijni

Summary:
TurboModule Java files are still using the old lib name: `turbomodulejsijni`, so let's keep it that way for now.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D23946945

fbshipit-source-id: ff095ff51dca532c82e67e1c75e9a4e9be392d61

* TurboModule Android: Implement TurboModuleManagerDelegate specific to RNTester

Summary:
This provides the RNTester specific impl of the manager delegate. The class is responsible to provide module lookup during runtime for TurboModule, and the C++ impl is using the codegen-generated lookup functions from :ReactAndroid and :packages:rn-tester:android:app Gradle targets.

Note: RNTester still needs to explicitly enable TurboModule and instantiate this manager before it can activate TurboModule.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D23938537

fbshipit-source-id: 7957847ecc58fef8d9a276d9d3d477ecec36a700

* TurboModule Android: allow RNTester to activate TurboModule system

Summary:
If built with `USE_CODEGEN=1` flag set, RNTester now activates the TurboModule system, also using various codegen output from the previous commits.

Note that this is very early integration, and not thoroughly tested yet.

To verify:

```
console.warn('TM enabled?', global.__turboModuleProxy != null);
```

{F337454276}

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D23946944

fbshipit-source-id: 5838aeb9ded07b1cc0fcb069535d1c6fb3725973

* Fix passing react native path in Podfile template (#29285)

Summary:
Since e949e234b0 (diff-d1800049b92343288bcbc1c484575058) the RN cli script returns an object with `:reactNativePath` instead of just JSON. Not super familiar with how objects / JSON works in ruby but using this syntax instead works.

## Changelog

[Fixed] [iOS] - Fix passing react native path in Podfile template

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

Test Plan: Tested in a project inside a monorepo using the latest version of RN CLI that the proper react-native path is now passed.

Reviewed By: fkgozali

Differential Revision: D23941162

Pulled By: hramos

fbshipit-source-id: 0115412ec6d6bca101612d760dfc00cf89d97f1e

* 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

* Fabric: Failing early in case if a argument of `-[RCTComponentViewFactory registerComponentViewClass:]` is nil

Summary:
Subject.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: JoshuaGross

Differential Revision: D23914517

fbshipit-source-id: 1c909e7d21b12326881990ecf855e814bf957f3c

* Fabric: Adding `#pragma once` to `ImageTelemetry.h`

Summary:
Without this thing some stuff does not compile.

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: fkgozali

Differential Revision: D23948622

fbshipit-source-id: f066ada183c0fd6a7b5eec542395d44bbbfe80a3

* Make blocking people work in Dating Settings

Summary:
Blocking people didn't work in Dating Settings without the Bridge.

Changelog: [Internal]

Reviewed By: ejanzer

Differential Revision: D23904867

fbshipit-source-id: 4a68b9d99fcc812f6616783a06dc047a3bc64491

* Fix slider's initial value

Summary:
Changelog: [Internal]

value needs to be set after minimum and maximum, otherwise it gets pinned to previous minimum/maximum.

Default minimum is 0 and maximum is 1. If we set value to 20 and maximum to 50, previously the value would get pinned to 1 (maximum value).

See [Apple Docs](https://developer.apple.com/documentation/uikit/uislider/1621346-value?language=objc) for more.

Reviewed By: JoshuaGross

Differential Revision: D23903545

fbshipit-source-id: 8e9dd49ced79d43b9591c7d24de59b9eaff5bdfd

* Do not attach root view until size is available

Summary:
Changelog: [internal]

# Why is text laid out twice in Fabric?

Layout constraints (min and max size) change during startup of Fabric surface.
1. `Scheduler::startSurface` is called with max size being {inf, inf}.
2. `Scheduler::constraintSurfaceLayout` is called with max size equal to viewport.

These are two operations that don't happen one after the other and on Android, CompleteRoot is called from JS before second operation is called. This triggers layout with max size {inf, inf} and later when second operation is called. Layout happens again now with correct size.

# Fix
Make sure `Scheduler::startSurface` is called with proper values and not {inf, inf}.

Reviewed By: JoshuaGross, yungsters

Differential Revision: D23866735

fbshipit-source-id: b16307543cc75c689d0c1f0a16aa581458f7417d

* RNTester: Add TextInput example to RTL tester

Summary:
Add a TextInput to RTL screen in RNTester, to test RTL languages with TextInput.

Changelog: [Internal]

Reviewed By: shergin

Differential Revision: D23914627

fbshipit-source-id: 84c62efe7034c0dfa2ef21be3f085880292c3930

* 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

* Make the Instagram app compile again

Summary:
Wrap iOS 14 SDK code in a `#if/#endif` so that the Instagram app compiles again

Changelog: [Internal]

Reviewed By: PeteTheHeat

Differential Revision: D23948336

fbshipit-source-id: 67e6ee48d1951ae405c12b4ad39cf8c9817df627

* 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

* 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

* 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

* chore: deduplicate lock, update packages repository fields (#30044)

Summary:
This small PR includes the following changes:
* deduplicate yarn lock file using [`yarn-deduplicate`](https://github.com/atlassian/yarn-deduplicate) package
  * deduplicate script has been added as `update-lock`, let me know if you would like also to see this in [`postinstall`](https://docs.npmjs.com/misc/scripts) (to automatically optimize lock on every dependency change)
* according to the [npm docs](https://docs.npmjs.com/files/package.json#repository):
  * main `package.json` repository field has been replaced with shorthand
  * monorepo packages repository field has been extended by `directory`

The main goal of introducing deduplication script was to optimize the dependencies footprint while developing and speed up the initial installation process. Running `yarn-deduplicate` also increase the security in some way, because it enforces usage only of the latest version of the package. You can read more about the benefits in the deduplicate script [repository](https://github.com/atlassian/yarn-deduplicate#duplicated-packages).

## 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 yarn lock deduplication script

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

Test Plan: `yarn install` was successful, this also should not affect yarn workspaces in any way.

Reviewed By: GijsWeterings

Differential Revision: D23959812

Pulled By: cpojer

fbshipit-source-id: e2455e3718378e1ce6206e79463d4083f8fe5d47

* Daily `arc lint --take CLANGFORMAT`

Reviewed By: zertosh

Differential Revision: D23986055

fbshipit-source-id: 7bfe9f06f236f8866e812db060edf3d089fe253c

* 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

* Fix dismissal animation of Modal Component

Summary:
Changelog: [Internal]

Fabric removes components bottom up (from leafs to the root).
This means that by the time Fabric hides Modal, it has no content and therefore it appears as if Modal disappears without Animation.

To fix this, we snapshot contents of the Modal before any of its contents are removed.

Reviewed By: shergin

Differential Revision: D23976244

fbshipit-source-id: 01c13b74e97f82816e8946fd9d1add1db10340b1

* Allow Java classes to hook into ScrollView scroll and layout events

Summary:
For advanced interop cases.

Changelog: [Internal]

Reviewed By: sammy-SC

Differential Revision: D23984345

fbshipit-source-id: f5c2a43a1bf5937f9974bcc5c66c36ec35e679c5

* 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

* 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

* Allow NativeModule method return types to use type aliases

Summary:
We already support type-aliases in our NativeModule method params. This diff extends the support to NativeModule method returns.

**Note:** I need to see if I need to update the generators to handle this case. Will do that in this diff, after working through other higher priority stuff.

Changelog: [Internal]

Reviewed By: PeteTheHeat

Differential Revision: D22828839

fbshipit-source-id: cf5c756d3cacf067df217cdb6212946320a2d4be

* Delete NativeModuleSchemaBuilderConfig type

Summary:
Unecessary, since `NativeModuleShape` is the exact same thing.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D23119784

fbshipit-source-id: 8c4aded88a97a80aa977c13cc27e32fbe68150aa

* Restructure getTypes function

Summary:
There are two types of types we care about:
- Type aliases
- Interface Declarations

These types can be exported.

I think we should build the types dictionary from only those types. Everything else should be ignored.

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D23120241

fbshipit-source-id: 9f023081d0f9c85b45407b180ae7c3e7391eb725

* Clean up Module/Component detection logic in Flow parser

Summary:
Just broke down getConfigType into two separate functions: `isModule` and `isComponent`.
- Cleaned up `isComponent`, to check for the the AST node types.
- Re-implemented `isModule`
- Improved error messages.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D23121896

fbshipit-source-id: 3df2b2e334c4cea8eabe2e73ecb9f1f1217e7be4

* Fix parser's buildSchema's return type

Summary:
`buildSchema` delegates to two other functions: `buildComponentSchema`, or `buildComponentSchema`. Both return have a return type of *required* `SchemaType`. Therefore, `buildSchema` can have a return type of `SchemaType`.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D23135499

fbshipit-source-id: f13db17549c93b965f372d9b68d06efc2a40c6cc

* Clean up parsers/flow/modules/index.js

Summary:
Changes:
- Adding type annotations, where possible
- Delete unnecessary functions

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D23138227

fbshipit-source-id: b4b47492ddef49f496ed9fcb61ef1c000e3e8f18

* Colocate alias/method generation logic

Summary:
## Changes
- Generating the aliases was split over `parsers/flow/modules/index.js`, and `parsers/flow/modules/aliases.js`. I moved everything to the latter file.
- Generating methods was split over `parsers/flow/modules/index.js` and `parsers/flow/modules/methods.js`. I moved everything to the latter file.
- More type-safety

Changelog: [Internal]

Reviewed By: PeteTheHeat

Differential Revision: D23143382

fbshipit-source-id: e11b76bee7917a7db37ae7f1af64da5f046c5d1e

* Cleanup buildMethodSchema and introduce nullable methods

Summary:
## Changes
- Started doing cleanup under `/parsers/flow/modules/methods.js`
- Rename `NativeModuleMethodTypeShape` -> `NativeModulePropertyShape`
- Moved optional property from `FunctionTypeAnnotation` to the `NativeModulePropertyShape`
- Introduced a nullable property inside what was once `FunctionTypeAnnotation`.

Changelog: [Internal]

Reviewed By: PeteTheHeat

Differential Revision: D23146050

fbshipit-source-id: 2fe97bb9c0736242682133e4923131a54bbea54b

* Rewrite Flow module parser

Summary:
This diff:
1. Simplifies the NativeModule schema Flow types.
2. Simplifies the NativeModule Flow parser, to accomodate the modified schema, and to reduce code duplication.

**Notes:**
- If the parser detects an unrecognized type within the context of parsing an Array's element type, it'll omit the `elementType` property of the `ArrayTypeAnnotation`. Details: T72031674. **Rationale:** Basically, when an array element type is supported, we use it in our generators. When it's unsupported, we ignore it. In the unsupported case, there's no point in trying to parse the Array element type, which is why I decided to omit the `elementType` property. Ideally, our NativeModule specs would never use unsupported types, in any context. This would allow us to always parse and use the elementType. However, that seems like a it could be a hefty migration: we have > 400 specs. Since, this isn't a battle we need to fight right now, I left a TODO at the relevant lines instead.
- The legacy codegen would generate structs for each object literal type in the file. In this re-implementation of the parser, I only insert into the aliases array when we detect a usage of a type-alias to an ObjectLiteral type annotation. With this decision, we won't be able to generate these unnecessary structs. This is good because we get rid of dead code. It's bad because it might make our migration to this codegen bit more difficult.

[WARNING] This diff produces flow failures that will be addressed in subsequent diffs.

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D23201387

fbshipit-source-id: 55ce0df925a8bae0e7d5bb2a9b63167607eba461

* Add unit tests to validate module parser

Summary:
## Test Structure
- Parameter Parsing
  - For type in [optional, nullable, optional and nullable, required]:
    - Can parse Primitives
    - Can parse Object
    - Can parse Arrays
      - Can parse primitive element types
      - Can parse Object element types
      - Can parse Array element types
      - Can parse Reserved Type element types
      - Can parse Type alias element types
      - Can parse Object Literals
    - Can parse Function
    - Can parse Reserved Types (e.g: RootTag)
    - Can parse Type alias
    - Can parse Object Literals
      - For prop type in [optional, nullable, optional and nullable, required]:
        - Can parse primitive prop types
        - Can parse Object prop types
        - Can parse Array prop types
        - Can parse Reserved Type prop types
        - Can parse Type alias prop types
        - Can parse Object Literal prop types
- Return Parsing
  - For type in [nullable, required]:
    - Can parse Promises
    - Can parse Primitives
    - Can parse Object
    - Can parse Arrays
      - Can parse primitive element types
      - Can parse Object element types
      - Can parse Array element types
      - Can parse Reserved Type element types
      - Can parse Type alias element types
      - Can parse Object Literals
    - Can parse Function
    - Can parse Reserved Types (e.g: RootTag)
    - Can parse Type aliases
    - Can parse Object Literals
      - For prop type in [optional, nullable, optional and nullable, required]:
        - Can parse primitive prop types
        - Can parse Object prop types
        - Can parse Array prop types
        - Can parse Reserved Type prop types
        - Can parse Type alias prop types
        - Can parse Object Literal prop types

Changelog: [Internal]

Reviewed By: PeteTheHeat

Differential Revision: D23089925

fbshipit-source-id: 73c3b1ef33b402265c14f0ac9e364414a5d54dca

* Fix type alias nullability resolution in module parser

Summary:
Consider this case:

```
type Animal = ?{|
  name: string,
|};

type B = Animal

export interface Spec extends TurboModule {
  +greet: (animal: B) => void;
}
```

The generated output for this spec is:

```
namespace JS {
  namespace NativeSampleTurboModule {
    struct Animal {
      NSString *name() const;

      Animal(NSDictionary *const v) : _v(v) {}
    private:
      NSDictionary *_v;
    };
  }
}

protocol NativeSampleTurboModuleSpec <RCTBridgeModule, RCTTurboModule>
- (void)greet:(JS::NativeSampleTurboModule::Animal &)animal;
end
```

Observations:
  1. The codegen looks as though we wrote `+greet: (animal: ?Animal) => void;` as opposed to `+greet: (animal: B) => void;`
  2. The generated struct is called `Animal`, not `B`.

## After this diff
Whenever we detect a usage of a type alias, we recursively resolve it, keeping a track of whether the resolution will be nullable. In this example, we follow B to Animal, and then Animal to ?{|name: string|}.

Then, we:
  1. Replace the `B` in `+greet: (animal: B) => void;` with `?Animal`,
  2. Pretend that `Animal = {|name: string|}`.

Why do we make all type alias RHSs required?
 2. This design is simpler than managing nullability in both the type alias usage, and the type alias RHS.
 3. What does it mean for a C++ struct, which is what this type alias RHS will generate, to be nullable? ¯\_(ツ)_/¯. Nullability is a concept that only makes sense when talking about instances (i.e: usages) of the C++ structs. Hence, it's better to manage nullability within the actual TypeAliasTypeAnnotation nodes, and not the associated ObjectTypeAnnotations.

## Other Changes
- Whenever we use the `Animal` type-alias, the e2e jest tests validate that the type alias exists in the module schema.

Changelog: [Internal]

Reviewed By: PeteTheHeat

Differential Revision: D23225934

fbshipit-source-id: 8316dea2ec6e2d50cad90e178963c6264044f7b7

* Export module type annotations from CodegenSchema

Summary:
This diff has a few changes:
- All type annotations are now declared top-level, and exported from `CodegenSchema.js`.

Changelog: [Internal]

Reviewed By: hramos

Differential Revision: D23616473

fbshipit-source-id: 1509c304305e56674bd76c44bc49f755dfeaa332

* Refactor: Introduce Required<T> generic type

Summary:
This diff introduces a `Required<T>` generic type in CodegenSchema. Why? NativeModule aliase RHSs are basically ObjectTypeAnnotations but they have `nullable` fixed to `false`. This generic type reduces duplication in the schema flow types.

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D23645208

fbshipit-source-id: da984f64fa17d8533a3ea74b132ce10aae9aa7ed

* Refactor: Make NativeModuleAliasMap $ReadOnly

Summary:
We were using `$ReadOnly<NativeModuleAliasMap>` everywhere, so I figured we'd just make the type itself `$ReadOnly`.

Changelog: [Internal]

Reviewed By: PeteTheHeat

Differential Revision: D23645207

fbshipit-source-id: 4e018d5768f4fcfd00492def7d840a5054cb2b73

* Rename GenericPromiseTypeAnnotation to PromiseTypeAnnotation

Summary:
We have first class support for Promises in our codegen. So, it's more appropriate to just call this PromiseTypeAnnotation, as opposed to GenericPromiseTypeAnnotation.

Changelog: [Internal]

Reviewed By: hramos

Differential Revision: D23645209

fbshipit-source-id: bfc0b909750e221e18be33acf197f342a2918aa9

* Refactor: Make NativeModuleArrayTypeAnnotation elementType customizable

Summary:
In the future, we'll use `NativeModuleArrayTypeAnnotation` inside JS struct objects. Structs cannot contain `ObjectTypeAnnotations` anywhere. Therefore, we need the elementType of `NativeModuuleArrayTypeAnnotation`'s elementType customizable.

Changelog: [Internal]

Reviewed By: hramos

Differential Revision: D23645210

fbshipit-source-id: 97abb993d59536ebd68ec08b18ce7f2801c68a2d

* Update generator fixtures to comply with Schema flow types

Summary:
In diffs below, we made several changes to the NativeModule schema. This diff just ensures that the input to our generator snapshot tests, which are module schemas, are valid.

Changelog: [Internal]

Reviewed By: TheSavior

Differential Revision: D23633942

fbshipit-source-id: 444ccd60f6ec76e348a8e54b946260464ff3aeee

* Create utilities for module generators

Summary:
There are two operations we do in every NativeModule generator:
- We convert the `SchemaType` into a map of NativeModule schemas
- If the type-annotation is a TypeAliasTypeAnnotation, we resolve it by doing a lookup on the NativeModuleAliasMap. This is usually followed by an invariant to assert that the lookup didn't fail.

Both procedures have been translated into utilities for use across our generators. I also deleted `getTypeAliasTypeAnnotation` which will no longer be used.

Changelog: [Internal]

Reviewed By: hramos

Differential Revision: D23667249

fbshipit-source-id: 4e34078980e2caa4daed77c38b1168bfc161c31c

* 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

* E2E snapshot test ObjC++ generator

Summary:
NativeModule specs exist under `react-native-github/packages/react-native-codegen/src/__tests__/modules/fixtures`. `GenerateModuleObjCpp-test.js` runs the RN Codegen on those NativeModule specs, and saves the output inside a snapshot. For convenience, the folowing command runs the legacy codegen on the fixtures:

```
buck build fbsource//xplat/js/react-native-github/packages/react-native-codegen/src/__tests__/modules:RNCodegenModuleFixtures-flow-types-ios --show-output
```

Changelog: [Internal]

Reviewed By: hramos

Differential Revision: D23637708

fbshipit-source-id: 3319f319515eca42b4499682313fea6e0bdc2a06

* Fix GenerateModuleCpp

Summary:
Just updating this generator to understand the new RN Codegen Module parser flow types.

Changelog: [Internal]

Reviewed By: PeteTheHeat

Differential Revision: D23667254

fbshipit-source-id: 558dd7ac5b4541edf40248b8ab8bb50d31fa8624

* Fix GenerateModuleH

Summary:
Just updated the generator to work with the new RN Codegen Flow Parser types.

Changelog: [Internal]

Reviewed By: PeteTheHeat

Differential Revision: D23667252

fbshipit-source-id: 34404a478ddd67446d82b5f98e1051300064e95c

* Fix GenerateModuleJavaSpec

Summary:
Just updated the generator to work with the new RN Codegen Flow Parser types.

Changelog: [Internal]

Reviewed By: hramos

Differential Revision: D23667255

fbshipit-source-id: 40b7747aad89f6d5bbb9f42d59a4df9633060c66

* Fix GenerateModuleJniH

Summary:
Just updated the generator to work with the new RN Codegen Flow Parser types.

Changelog: [Internal]

Reviewed By: PeteTheHeat

Differential Revision: D23667250

fbshipit-source-id: f36b5418101c40331964d1f9ede7c6bd7924383d

* Fix GenerateModuleJniCpp

Summary:
Just updated the generator to work with the new RN Codegen Flow Parser types.

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D23667253

fbshipit-source-id: ef94e75287d37dfd7b80f61455a1bfa34bddeb28

* Fix ObjC++ module generator output

Summary:
* Removed extraneous closing brace.
* Fixed static method signature, replacing double colon with an underscore (`static facebook::jsi::Value __hostFunction_Native${moduleName}SpecJSI::${methodName}()` -> `static facebook::jsi::Value __hostFunction_Native${moduleName}SpecJSI_${methodName}()`).
* Wrap `getConstants` selector name with `selector()`.
* Pass through `getConstants` and `constantsToExport` to allow de-duping of `getConstants` method in generator output.

Note that the FBReactNativeSpec that is output by the generator still has some issues that need to be addressed before it can be used.

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D23910505

fbshipit-source-id: 37d884885b8878f38d40637377c2a74a728c3a13

* Fix ObjC++ structs and method mapping

Summary:
Adjust generated ObjC++ code to resolve a few build time and run time errors:

* Suppress CONSTANTS struct implementations
* Use type alias name as struct name when serializing arguments that involve a type alias
* Use actual number of arguments for a method when generating method map.

With these changes in place, RNTester can be built and run using the code that is generated by the new codegen.

Changelog: [Internal]

Reviewed By: hramos

Differential Revision: D23926500

fbshipit-source-id: 88fcbb795fd71dc8155eb26348db943975e13e84

* Remove header_namespace from module codegen target

Summary:
Making this change because I see this error when compiling Internationalization
```
➜  fbsource buck build //xplat/js/RKJSModules/Libraries/Internationalization:generated_objcpp_modules-InternationalizationApple
buck-out/gen/33fbdb84/xplat/js/RKJSModules/Libraries/Internationalization/generate_module_mm-Internationalization/FBReactNativeInternationalizationSpec-generated.mm:15:9: fatal error: 'FBReactNativeInternationalizationSpec.h' file not found
#import "FBReactNativeInternationalizationSpec.h"
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
Command failed with exit code 1.

command: [/Applications/Xcode_11.6.0_fb.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++, @/Users/ramanpreet/fbsource/buck-out/bin/33fbdb84/xplat/js/RKJSModules/Libraries/Internationalization/generated_objcpp_modules-InternationalizationApple#compile-FBReactNativeInternationalizationSpec-generated.mm.o...
```

Since the header namespace is "FBReactNativeInternationalizationSpec", we can only import the header file via "FBReactNativeInternationalizationSpec/FBReactNativeInternationalizationSpec.h", according to this buck documentation: https://buck.build/rule/cxx_library.html#headers. Not entirely sure how this target compiled before.

The legacy codegen buck target also set the header namespace to "": https://fburl.com/diffusion/3p85qhf9.

Changelog: [Internal]

Reviewed By: hramos

Differential Revision: D23978436

fbshipit-source-id: c9cd7c710edf94df6df10778f8603870f92275a7

* 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

* Fix mutation sorting function

Summary:
The sorting function currently forms a partial ordering, not a total ordering. This can cause problems with certain sequences of immediate or conflicting mutations, leading to UI corruption or crashes.

Changelog: [Internal]

Reviewed By: shergin

Differential Revision: D24002668

fbshipit-source-id: edc9b4c1e3104897cb0c5fd6da563ec43d800494

* TurboModule Android: properly set up RNTester ndkBuild and cleanup dependencies

Summary:
Before RNTester compilation starts, it needs to wait for :ReactAndroid NDK build to finish, so that it knows where to find the exported .so files. This tells the `preBuild` task to depends on `:ReactAndroid:prepareReactNdkLibs` task. The .so files are now copied over to the local project build dir, instead of depending on :ReactAndroid's build dir.

For cleanup, the reverse ordering is needed: before `clean` removed our temp dir to store the copied .so files, make sure the ndkBuild cleanup tasks execute beforehand.

Changelog: [Internal]

Reviewed By: hramos

Differential Revision: D23982989

fbshipit-source-id: 955d7c9bccb5855b6b066fca89764df2ede89f63

* TurboModule Android: move SampleTurboModule impl and spec to OSS

Summary:
This is the Java/JNI impl of the NativeSampleTurboModule.js, just like on iOS. The files here are supposed to be generated by the react-native-codegen, but they are checked in to the repo for easier build integration with RNTester.

Changelog: [Internal]

Reviewed By: hramos

Differential Revision: D23985746

fbshipit-source-id: 46340d778f3d964efe5b538d15ebe0f2cab04862

* TurboModule Android: install SampleTurboModule and the playground to RNTester

Summary:
This compiles SampleTurboModule into RNTester Android. It also adds the NativeModule playground to show case TurboModule system to RNTester examples, just like in iOS.

{F337854369}

Changelog: [Android][TurboModule] Added TurboModule example to RNTester when `USE_CODEGEN` is set

Reviewed By: hramos

Differential Revision: D24004711

fbshipit-source-id: b682dd51fa998ee2e60f8d6ffd8c39220d13a7fe

* TurboModule: exclude NativeSampleTurboModule in the schema

Summary:
The sample module is meant for demo only, but it lives alongside other core modules in react-native repo.

For now, exclude it in the Flow-type parsing, just like `NativeUIManager.js`

Changelog: [Internal]

Reviewed By: hramos

Differential Revision: D24005108

fbshipit-source-id: 9ef524bfe2778dd983c94d1701f9ce49da5e0a68

* Upgrade Robolectric from 4.3.1 -> 4.4

Summary: Changelog: [Internal]

Reviewed By: jiawei-lyu

Differential Revision: D23718455

fbshipit-source-id: 39c684722db1269e2179cf9680cb728be1171afb

* TurboModule iOS: Remove module filters

Summary:
These native modules are now filtered downstream in `combine-js-to-schema-cli.js`.

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D24003572

fbshipit-source-id: d858dbf4a4b6d522ed528f9c2262f37243317160

* Fix React Native Robolectric 4.4 deps (#30073)

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

Changelog: [Android][Added] - Test infra: Robolectric 4.3.1 -> 4.4 upgrade

Reviewed By: fkgozali

Differential Revision: D24009953

fbshipit-source-id: 70549187f4af0abd2ea10f6725eecadbaef7281b

* Drop old state updates

Summary:
Changelog: [internal]

Components can update state multiple times before the state update queue is flushed. This causes unnecessary layout/diff and mount passes. To solve this, drop stale state updates inside `stateUpdateQueue_ ` for specific `ShadowNodeFamily`.

Delivering stale status updates is redundant. Let's take SafeAreaView as an example. It schedules 5-6 state updates before `stateUpdateQueue_` is flushed. That's unnecessary work blocking JS thread. We only care about the latest state update. Same for TextInput and other components using state updates.

Reviewed By: JoshuaGross

Differential Revision: D23987707

fbshipit-source-id: 2e3f92cc93af61d78ac564aa40aef165af64b8c1

* Remove idx package from inspector msggen

Summary:
This was causing a crash in babel:
```
$ babel src --out-dir bin --source-maps
Error: Cannot find module 'babel-plugin-idx' from
'~/fbsource/xplat/js/react-native-github/ReactCommon/hermes/inspector/tools/msggen'
- If you want to resolve "idx", use "module:idx" {
  code: 'MODULE_NOT_FOUND'
}
```
It didn't appear that this module was used, so I deleted it.

Changelog: [Internal]

Reviewed By: neildhar

Differential Revision: D23993272

fbshipit-source-id: dd34f0fc652cb27c87c891ca37d0eba66a19a6cf

* iOS: fix ios-configure-glog.sh syntax issue

Summary:
A `cat` to file was removed accidentally, preventing the configuration script from executing successfully as part of a `pod install`.

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D24024824

fbshipit-source-id: 94af0c6e663320bfac04ee8f6fb37bd4bdc379a4

* 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

* Android: removed Robolectric 4.3.1 Buck configuration

Summary:
It was recently upgraded to 4.4, so we don't need the 4.3.1 anymore.

Changelog: [Android][Removed] Removed Robolectric 4.3.1 setup

Reviewed By: jselbo

Differential Revision: D24030822

fbshipit-source-id: 09b3c577d32028723e7bbc02f13459a7ae69b749

* Fixed incorrect assert in RCTScrollViewComponentView

Summary:
This diff removes an incorrect assert and replaces it with a debug-only verification phase that compares "what we want" with "what we get".

Changelog: [Internal] Fabric-specific internal change.

Reviewed By: PeteTheHeat

Differential Revision: D23983123

fbshipit-source-id: 03a628b4f8baa1f5fe4b55354b7c943e38b5e537

* Update Android Gradle plugin to 4.0.1 (#29013)

Summary:
This is a major version update that needs to be tested thoroughly.

Android Studio 4.0.1 is now available in the stable channel

https://androidstudio.googleblog.com/2020/05/android-studio-40-available-in-stable.html
https://developer.android.com/studio/releases/gradle-plugin#4.0.1

## Changelog

[Android] [Changed] - Update Android Gradle plugin to 4.0.1

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

Test Plan:
Build project

Closes https://github.com/facebook/react-native/issues/29044

Reviewed By: shergin

Differential Revision: D24041233

Pulled By: fkgozali

fbshipit-source-id: 68ef0f313aa773866e65796e323ed0f19f41f834

* Log View hierarchy if removeViewAt crashes

Summary:
If removeViewAt crashes, log the children of the parent view, and all of the parent's ancestors.

Changelog: [Internal]

Reviewed By: shergin

Differential Revision: D24019515

fbshipit-source-id: c5b1ca0948ebc47f2648e161770affa8542ca5dd

* Deploy Flow v0.135.0

Summary: Changelog: [Internal]

Reviewed By: mroch

Differential Revision: D24040584

fbshipit-source-id: 106caa00cadd6930685c0030ad74685c64572ba9

* Update RNTester Podfile.lock

* FIx Android patches

* 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

* Add explanation for disabling @react-native/codegen/react-native-modules

* Add TARGET_OS_OSX back to -textInputShouldReturn

Co-authored-by: Samuel Susla <samuelsusla@fb.com>
Co-authored-by: Valentin Shergin <shergin@fb.com>
Co-authored-by: Jason Safaiyeh <safaiyeh@protonmail.com>
Co-authored-by: Joshua Gross <joshuagross@fb.com>
Co-authored-by: Ramanpreet Nara <ramanpreet@fb.com>
Co-authored-by: Xuan Huang <jsx@fb.com>
Co-authored-by: Rubén Norte <rubennorte@fb.com>
Co-authored-by: Riley Dulin <dulinr@fb.com>
Co-authored-by: Michel Weststrate <mweststrate@fb.com>
Co-authored-by: Kevin Gozali <fkg@fb.com>
Co-authored-by: Mike Vitousek <mvitousek@fb.com>
Co-authored-by: generatedunixname89002005287564 <generatedunixname89002005287564@fb.com>
Co-authored-by: Andrei Shikov <ashikov@fb.com>
Co-authored-by: Agastya Darma <gedeagas22@gmail.com>
Co-authored-by: Scott Kyle <skyle@fb.com>
Co-authored-by: Makar Kotlov <m.kotlov@qlean.ru>
Co-authored-by: chirag-singhal <csinghal208@gmail.com>
Co-authored-by: grabbou <grabbou@gmail.com>
Co-authored-by: Emily Janzer <janzer@fb.com>
Co-authored-by: Eloy Durán <eloy.de.enige@gmail.com>
Co-authored-by: Luna Wei <luwe@fb.com>
Co-authored-by: Ankit Tiwari <ankitt255@gmail.com>
Co-authored-by: Stanisław Chmiela <sjchmiela@users.noreply.github.com>
Co-authored-by: Lulu Wu <luluwu@fb.com>
Co-authored-by: Peter Argany <petetheheat@fb.com>
Co-authored-by: Paige Sun <paigesun@fb.com>
Co-authored-by: Michael Yoon (LAX) <mikeyoon@fb.com>
Co-authored-by: Rob Walker <rob@papertrail.io>
Co-authored-by: Janic Duplessis <janicduplessis@gmail.com>
Co-authored-by: Martin Ortega <martega@fb.com>
Co-authored-by: Tim Yung <yungsters@fb.com>
Co-authored-by: simek <gosimek@gmail.com>
Co-authored-by: generatedunixname89002005325676 <generatedunixname89002005325676@fb.com>
Co-authored-by: Tommy Nguyen <tonguye@microsoft.com>
Co-authored-by: Joshua Selbo <jselbo@fb.com>
Co-authored-by: Héctor Ramos <hramos@fb.com>
Co-authored-by: Frieder Bluemle <frieder.bluemle@gmail.com>
Co-authored-by: Sam Goldman <samgoldman@fb.com>
2021-09-28 09:57:51 -07:00
HeyImChris 3056c4e4bf
Add some robustness to the CI and switch to Xcode 12 (#709)
* Update RCTCxxBridge.mm

* make CI xcode versioning more robust to xcode12

* update to xcode 12.4

* use apple variables file

* Update RCTCxxBridge.mm

* add quotes

* switch to catalina

* update pods to 10.15

* make CI xcode versioning more robust to xcode12

* update to xcode 12.4

* use apple variables file

* add quotes

* switch to catalina

* update pods to 10.15

* upgrade version requirements to n-2 for osx

* make CI xcode versioning more robust to xcode12

* update to xcode 12.4

* use apple variables file

* add quotes

* switch to catalina

* make CI xcode versioning more robust to xcode12

* update to xcode 12.4

* use apple variables file

* add quotes

* make CI xcode versioning more robust to xcode12

* update to xcode 12.4

* use apple variables file

* add quotes

* CI should run on PRs to future stable branches (#718)

* Pull in header's C declaration to stop symbol mangling  (#728)

* Update RCTCxxBridge.mm

* Update RCTCxxBridge.mm

* fix undefined extern c symbol

* scroll content with animation (#725)

Summary: please see test plan

Test Plan:
|Before|After|
|{F371503806}|{F371499708}|



Reviewers: skyle

Reviewed By: skyle

Subscribers: zackargyle

Differential Revision: https://phabricator.intern.facebook.com/D26354172

Tasks: T84165504

Signature: 26354172:1612920735:2cd8455b1bae06ee555bd98cfd41c4dfb29c288e

Co-authored-by: Mo Wang <mowang@fb.com>

* Fix missing props on secure text input (#719)

* Enable animated gif playback on Mac (#724)

* enable gif for mac

Summary:
I verify that it works for Zeratul as well. 

It also works regardless turbo module is enabled or not.

Test Plan: 
|{F369886201}|{F369889196}|



Reviewers: skyle

Reviewed By: skyle

Subscribers: zackargyle

Differential Revision: https://phabricator.intern.facebook.com/D26272145

Tasks: T82742678

Signature: 26272145:1612513052:520a8b0b3ab4b211c953b3225c6c96ffb8a29fc5

* bypass setImage logic when it is Mac

Summary: as titled

Test Plan:

{F370138978}

{F370139033}


Reviewers: skyle

Reviewed By: skyle

Subscribers: zackargyle

Differential Revision: https://phabricator.intern.facebook.com/D26288169

Signature: 26288169:1612565769:8f779fe01614e3399ac3e484853bb61246210ff4

* address PR comments

* address PR comments 1

Co-authored-by: Mo Wang <mowang@fb.com>

* Add explicit Tab support to keyboarding (#723)

* Update RCTCxxBridge.mm

* Update RCTCxxBridge.mm

* add explicit tab support

* missing tab validity check

* Fix Deadlock in RCTi18nUtil (iOS) (#733)

* Initial Commit

* Fix typo

* Fix default initialization of isRTLAllowed and documentation

* use BOOL, remove superfluous readwrite decorator

* Fix another typo

* Add TODO Marker

* update to macOS 10.15

* make CI xcode versioning more robust to xcode12

* update to xcode 12.4

* use apple variables file

* add quotes

* switch to catalina

* update pods to 10.15

* upgrade version requirements to n-2 for osx

* make CI xcode versioning more robust to xcode12

* update to xcode 12.4

* use apple variables file

* add quotes

* switch to catalina

* make CI xcode versioning more robust to xcode12

* update to xcode 12.4

* use apple variables file

* add quotes

* make CI xcode versioning more robust to xcode12

* update to xcode 12.4

* use apple variables file

* add quotes

* update to macOS 10.15

* update to xcode 12.4

* use apple variables file

* switch to catalina

* 10.14

* CI has to run on 10.15.4 or later

* fix up pod errors

* upgrade iphone simulator

* iphone 13

* remove old post install script

* iphone 8

* Restore Podfile.lock to see if it fixes CI

* Restore compiler flags in TurboModuleCxx-WinRTPort

* Remove macOS arm64 build divergence

* Remove building all ARCHS temporarily

* Override ONLY_ACTIVE_ARCH in release builds too

* Push iOS 14 snapshots

Co-authored-by: Andrew Coates <30809111+acoates-ms@users.noreply.github.com>
Co-authored-by: Mo <mo.hy.wang@gmail.com>
Co-authored-by: Mo Wang <mowang@fb.com>
Co-authored-by: Scott Kyle <scott@appden.com>
Co-authored-by: Saad Najmi <saadnajmi2@gmail.com>
Co-authored-by: Anand Rajeswaran <anand.rajeswaran@outlook.com>
2021-03-17 11:41:57 -07:00
Scott Kyle 02408aba7b
Support TurboModule initialization on macOS (#721) 2021-02-26 16:07:23 -08:00
Zihan Chen (MSFT) c4f4144428
Merge React-TurboModuleCxx-WinRTShared.podspec into React-TurboModuleCxx-WinRTPort.podspec (#634)
* Merge two local podspec into one

* Fix code review comment
2020-10-07 15:09:21 +00:00
Zihan Chen (MSFT) 6fc5e78fa6
Remove RNTester/RNTester-macOS/TurboModuleCxx and download files from microsoft/react-native-windows (#630)
* Update Podfile.lock

* Move TurboModule/winrt

* Delete entries in RNTester-macOS

* Add podspec

* ...

* ...

* ...

* ...

* ...

* Use the correct podfile

* ...

* Build Succeeded

* ...

* Update RNW.podspec

* ...

* ...

* ...

* Some CocoaPods related fixes (#2)

* [podspec] Fix syntax error

* [podfile] Specify local files using `:path` option

* [podspec] Fix commit hash and source dirname

* ...

* Split -MacOS to -WinRTShared and -WinRTPort

* Fix dependency from RNW to folly

* Finished RNW.podspec

* Remove unnecessary config

* Update Podfile.lock

Co-authored-by: Eloy Durán <eloy.de.enige@gmail.com>
2020-10-06 10:58:50 +02:00