Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose the testID to black-box testing frameworks on Android #29610

Closed
wants to merge 3 commits into from

Conversation

jdeff
Copy link
Contributor

@jdeff jdeff commented Aug 10, 2020

Summary

There has been a long-standing issue where black-box testing frameworks like Appium and Xamarin UITest have not been able to access the testID view prop for Android (see #7135). A natural place for this to be exposed is via a view's resource-id. The resource-id is what I have used when working on UIAutomator-based tests for native Android apps and is a non-localized, development-only identifier. As mentioned in the linked ticket, you can dynamically set the resource-id using the view's AccessibilityNodeInfo. This change simply checks to see if a testID is provided for a view and then exposes it through the view's accessibility node delegate.

Changelog

[Android] [Fixed] - Fixes #7135, #9942, and #16137. Display the testID as the resource-id for black-box testing frameworks

Test Plan

I used the uiautomatorviewer tool to verify that the resource-id is populated with the testID of a few different views of the RNTester app.
Screen Shot 2020-08-10 at 3 38 27 PM
Screen Shot 2020-08-10 at 3 40 41 PM

@facebook-github-bot
Copy link
Contributor

Hi @jdeff!

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file.

In order for us to review and merge your code, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!

@jdeff jdeff force-pushed the jdeff/test-id-as-resource-id branch from 92b459e to 88e3b35 Compare August 10, 2020 21:34
@react-native-bot react-native-bot added Bug Platform: Android Android applications. labels Aug 10, 2020
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Aug 10, 2020
@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@analysis-bot
Copy link

analysis-bot commented Aug 10, 2020

Platform Engine Arch Size (bytes) Diff
ios - universal n/a --

Base commit: 2a175b1

@analysis-bot
Copy link

analysis-bot commented Aug 10, 2020

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 7,389,897 0
android hermes armeabi-v7a 7,017,213 0
android hermes x86 7,832,109 0
android hermes x86_64 7,721,595 0
android jsc arm64-v8a 9,536,198 0
android jsc armeabi-v7a 9,151,226 0
android jsc x86 9,400,874 0
android jsc x86_64 9,982,584 0

Base commit: 5a57a53

@jdeff jdeff force-pushed the jdeff/test-id-as-resource-id branch from 88e3b35 to b2eff28 Compare August 10, 2020 22:42
@jdeff
Copy link
Contributor Author

jdeff commented Aug 12, 2020

Also fixes #9777 and #16137

@jdeff
Copy link
Contributor Author

jdeff commented Aug 19, 2020

Should be a simple, low-risk change. Let me know if there is anything else I can do/provide to move this through.

@jdeff
Copy link
Contributor Author

jdeff commented Aug 26, 2020

Quick ping on this PR. Thoughts?

@jlipps
Copy link

jlipps commented Aug 26, 2020

Thanks for this @jdeff, can't speak for RN but from the Appium side it looks like it would remove a lot of headaches for our users!

@jdeff
Copy link
Contributor Author

jdeff commented Aug 31, 2020

Just another friendly ping.

@jdeff
Copy link
Contributor Author

jdeff commented Sep 2, 2020

Thanks @alshamiri5!

@frankitox
Copy link

Hi @jdeff! I was planning on using this PR with patch-package but the resource-id is just not showing up in the UI Automator Viewer. I simply copied the code to the corresponding file in node_modules. Am I missing something? I started the Metro server resetting the cache (react-native start --reset-cache).

@jdeff
Copy link
Contributor Author

jdeff commented Sep 15, 2020

Hi @frankitox! I think react-native start --reset-cache only affects javascript files. One thing to try would be cleaning and rebuilding the native code as well (e.g. cd android && ./gradlew clean) as this code change is in native-land.

@frankitox
Copy link

Huh, no luck with it. Still thanks for the hint 👍 ! I hope they merge this one or something similar to fix this problem. For the moment I'll just create a separate appium environment and conditionally change :accessibilityLabel's value.

@jdeff
Copy link
Contributor Author

jdeff commented Sep 15, 2020

@frankitox what version of Android are you using? Also, are you able to share the patch file you have and the component where you are setting the testID?

@bitcrumb
Copy link

Would also be interested in seeing this being adopted :) 👍

@tri-fraga
Copy link

I also would really like to see this happen. Any reason why this is not accepted yet?

@jdeff
Copy link
Contributor Author

jdeff commented Oct 15, 2020

@alloy any idea who I should reach out to get these changes merged? It's been a couple months and I don't want this to get stale.

@alloy
Copy link
Contributor

alloy commented Oct 22, 2020

I’ll ask around, but can’t promise anything.

@jdeff
Copy link
Contributor Author

jdeff commented Oct 22, 2020

Thank you!

@simoreira
Copy link

Any news about this?

@tmadej
Copy link

tmadej commented Nov 17, 2020

To support @jdeff, this solves a huge industry problem for cross-platform test automation, especially users of appium & webdriverio. I know at least 40+ devs that would benefit from this. When can we get this merged in?

@facebook-github-bot
Copy link
Contributor

@fkgozali merged this pull request in 381fb39.

@facebook-github-bot facebook-github-bot added the Merged This PR has been merged. label Jan 6, 2021
grabbou pushed a commit that referenced this pull request Jan 23, 2021
Summary:
There has been a long-standing issue where black-box testing frameworks like Appium and Xamarin UITest have not been able to access the `testID` view prop for Android (see #7135). A natural place for this to be exposed is via a view's `resource-id`. The `resource-id` is what I have used when working on UIAutomator-based tests for native Android apps and is a non-localized, development-only identifier. As mentioned in the linked ticket, you can dynamically set the resource-id using the view's AccessibilityNodeInfo. This change simply checks to see if a testID is provided for a view and then exposes it through the view's accessibility node delegate.

## 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] - Fixes #7135,  #9942, and #16137. Display the `testID` as the `resource-id` for black-box testing frameworks

Pull Request resolved: #29610

Test Plan:
I used the `uiautomatorviewer` tool to verify that the resource-id is populated with the `testID` of a few different views of the RNTester app.
<img width="912" alt="Screen Shot 2020-08-10 at 3 38 27 PM" src="https://user-images.githubusercontent.com/875498/89838534-55044100-db20-11ea-9be2-ba507a81f6fb.png">
<img width="1096" alt="Screen Shot 2020-08-10 at 3 40 41 PM" src="https://user-images.githubusercontent.com/875498/89838542-5897c800-db20-11ea-9895-462c6fea1130.png">

Reviewed By: JoshuaGross

Differential Revision: D25799550

Pulled By: fkgozali

fbshipit-source-id: e64ff1b90fb66b427fce7af533aa94792cfbcad3
@jocimarcan
Copy link

@jdeff Thank you for that contribution!
This works perfectly on most components, except for the TextInput component. Did you get to test for TextInput? Was it expected to work for that component as well?

@hubastard
Copy link
Contributor

@jocimarcan I've also noticed that the testID is not working for the EditText and the Slider components.

The issue

The issue is that both the EditText and Slider components are using AccessibilityDelegateCompat instead of ReactAccessibilityDelegate.

The fixes

In ReactEditText.java, you must replace this line with new ReactAccessibilityDelegate() instead of new AccessibilityDelegateCompat()

In ReactSliderManager.java, you must replace this line with extends ReactAccessibilityDelegate instead of extends AccessibilityDelegateCompat

@MrLoh
Copy link

MrLoh commented Apr 7, 2021

Is there a PR out for this already to get it into the next RN release?

@jocimarcan
Copy link

@hubastard thanks for the detailed suggestion!
I replaced these lines in react-native 0.64.0, but TextInput testID is not getting mapped into EditText resource-id yet.
I also tried to add some imports like import com.facebook.react.uimanager.ReactAccessibilityDelegate;, but without success.
Do you have some public branch repo with these changes?

@jdeff jdeff deleted the jdeff/test-id-as-resource-id branch April 16, 2021 17:01
@sasmit
Copy link

sasmit commented Apr 21, 2021

@TwFlem as per your comment above #29610 (comment)

  1. First I tried by following the steps from https://github.com/facebook/react-native/wiki/Building-from-source but there was some ndk related issue. so I gave up this approach
  2. Second I tried is "use the community docker container mentioned in this building from source documentation". Below are the things I did so far
    a) Download the "docker desktop" software for windows
    b) Ran below command
    docker run --rm --name rn-build -v $PWD:/pwd -w /pwd reactnativecommunity/react-native-android:2020-4-1 /bin/sh -c "./gradlew installArchives"

Next step for me is https://github.com/facebook/react-native/wiki/Building-from-source#publishing-to-a-git-fork-dependency
but i am not able to find the binary image which it generated at step 2(b).
I just see this in docker desktop tool

image

any clue ?

@hubastard
Copy link
Contributor

@sasmit I've also used docker to generate a new version and it generated an Android folder inside my react-native repo at the root. You should find the .aar and .jar files in there.

@sasmit
Copy link

sasmit commented Apr 21, 2021

@sasmit I've also used docker to generate a new version and it generated an Android folder inside my react-native repo at the root. You should find the .aar and .jar files in there.

@hubastard If I understood correctly then I must run the docker command (docker run --rm --name rn-build -v $PWD:/pwd -w /pwd reactnativecommunity/react-native-android:2020-4-1 /bin/sh -c "./gradlew installArchives") from react-native repo folder ?
If thats the case then its my bad I did not run the command from there

@hubastard
Copy link
Contributor

Yes in my case I ran the docker command from the root of my react-native fork. Also, you can look at the logs of the docker command to see if the android build was successful.

@sasmit
Copy link

sasmit commented Apr 21, 2021

@hubastard Thanks for your quick response .
I will do that now.

It would be really helpfull for me if you just point out the next steps you did afte running the docker command.
I am new to react-native and struggling at same point from last 3 days.

@sasmit
Copy link

sasmit commented Apr 21, 2021

I also ran the docker command from the root of my react-native fork. but I did not see the Android folder generated there. Below is the logs

C:\Sasmit\Work\Project\fork\Twfl\react-native>docker run --rm --name rn-build -v $PWD:/pwd -w /pwd reactnativecommunity/react-native-android:2020-4-1 /bin/sh -c "./gradlew installArchives"
Unable to find image 'reactnativecommunity/react-native-android:2020-4-1' locally
2020-4-1: Pulling from reactnativecommunity/react-native-android
5bed26d33875: Pull complete
f11b29a9c730: Pull complete
930bda195c84: Pull complete
78bf9a5ad49e: Pull complete
7c10d6954d08: Pull complete
64ab726f9d7a: Pull complete
15977c5df74e: Pull complete
4dc52d9ee7ae: Pull complete
c153bb21d243: Pull complete
Digest: sha256:6aebebd3cdaf580c996a5a5965d05e8702750bc26039226c18b7b22d8764d197
Status: Downloaded newer image for reactnativecommunity/react-native-android:2020-4-1
docker: Error response from daemon: create $PWD: "$PWD" includes invalid characters for a local volume name, only "[a-zA-Z0-9][a-zA-Z0-9_.-]" are allowed. If you intended to pass a host directory, use absolute path.
See 'docker run --help'.

@sasmit
Copy link

sasmit commented Apr 23, 2021

Created a sample app with testID to resource-id implementation on react-native 0.64.0 version. verified many components and its working fine. Thanks a lot to @jdeff

link : https://github.com/sasmit/sampleAppTestidToResourceId

@codedaemon12
Copy link

codedaemon12 commented May 24, 2021

Is it working with TouchableOpacity ? I created one and added testID but don't seem to find resource-id. I am seeing resource id for labels.

@iseki0
Copy link

iseki0 commented Jun 21, 2021

Now I have the same problem as appium/appium#15354 . The behaviour is real strange. What's the best practice when I facing the problem?

@liweijian
Copy link

@jocimarcan I've also noticed that the testID is not working for the EditText and the Slider components.

The issue

The issue is that both the EditText and Slider components are using AccessibilityDelegateCompat instead of ReactAccessibilityDelegate.

The fixes

In ReactEditText.java, you must replace this line with new ReactAccessibilityDelegate() instead of new AccessibilityDelegateCompat()

In ReactSliderManager.java, you must replace this line with extends ReactAccessibilityDelegate instead of extends AccessibilityDelegateCompat

Just out of curiosity , is there any PR on fixing these components' testID ?

@hubastard
Copy link
Contributor

@liweijian Yeah, I forgot to create one back then, here is the PR now #31865

facebook-github-bot pushed a commit that referenced this pull request Jul 23, 2021
…1865)

Summary:
With the advent of #29610, we are now able to use the `testID` view prop on Android in black-box testing framework through the  view's `resource-id`.

But after testing it, I noticed that on the `TextInput`, `Slider` and `ScrollView` components, the `testID` prop was not exposed as  the `resource-id` properly. The main issue was that those component was using the `AccessibilityDelegateCompat` instead of the `ReactAccessibilityDelegate`.

## Changelog

[Android] [Fixed] - Fix `testID` prop for `TextInput`, `Slider` and `ScrollView` components

Pull Request resolved: #31865

Test Plan: ![test-screenshot](https://user-images.githubusercontent.com/69216913/125802180-c0791a8c-a740-4657-a44f-42b1885eee39.png)

Reviewed By: mdvacca

Differential Revision: D29765333

Pulled By: yungsters

fbshipit-source-id: 2b8e362257e3e5fdcd20330280c588dabb44f28a
HeyImChris pushed a commit to microsoft/react-native-macos that referenced this pull request Oct 26, 2021
* chore: ignore broken Hermes job

* Upgrade metro to 0.64.0

Summary:
Upgrade metro to 0.64.0

Changelog: [Internal]

Reviewed By: cpojer

Differential Revision: D24753886

fbshipit-source-id: af679ec912c5cd8049a998d045ce8a75bf30e5d3

* Build rn-codegen in a temporary directory (facebook#30292)

Summary:
When running yarn install from the codegen directory it will reinstall all dependencies for the react-native workspace inside the react-native package. In my case this caused issues with metro because it would now have 2 copies of it (node_modules/metro and node_modules/react-native/node_modules/metro).

To avoid this copy the react-native-codegen source in a temporary directory and yarn install from there, then copy the built files back.

## Changelog

[Internal] - Build rn-codegen in a temporary directory

Pull Request resolved: facebook#30292

Test Plan: Tested the script in an app with codegen enabled. Fresh install with rn-codegen not built, made sure no extra modules are installed under node_modules/react-native/node_modules.

Reviewed By: yungsters

Differential Revision: D24893216

Pulled By: fkgozali

fbshipit-source-id: 2c372b755632ea6f50ad5d4562248612b349a9a6

* Android OSS: fixed unbound variable error for codegen build script

Summary:
If $FBSOURCE_ENV isn't set, this failed with `/root/react-native/packages/react-native-codegen/android/../scripts/oss/build.sh: line 20: FBSOURCE_ENV: unbound variable`.

This commit fixes https://app.circleci.com/pipelines/github/facebook/react-native/7080/workflows/5cf18a1f-e6d2-4648-8217-d42e9a61fef1/jobs/176451

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D24912950

fbshipit-source-id: 113e3dd7f78c75fc3adea0b21c9e38910be8c065

* Use codegen from source in default iOS template apps

Summary:
Add the `react-native-codegen` source to the `react-native` npm package.
Instead of using `react-native-codegen` from npm, the iOS app template will now build the package from source. Doing so removes the need to carefully time `react-native-codegen` npm releases to oss `react-native` releases, as the codegen and the oss release will be cut at the same time.

Changelog: [Internal] - Removed react-native-codegen dependency from iOS app template

Reviewed By: TheSavior

Differential Revision: D24904655

fbshipit-source-id: a07932bc748e2afb9359de584181bcb9dd0810ea

* Fix :ReactAndroid:androidJavadoc task (facebook#30417)

Summary:
Fixes facebook#30415

This is a quick and dirty fix to unblock publish, of excluding a class from Javadoc generation that is importing a class current build logic cannot handle. This is not a long-term fix for the issue.

## 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 :ReactAndroid:androidJavadoc task

Pull Request resolved: facebook#30417

Test Plan: Tested that the task now completes locally.

Reviewed By: lunaleaps

Differential Revision: D25041282

Pulled By: fkgozali

fbshipit-source-id: f774ab30a09db473178e2a51c77860e4985dd8e3

* fix android npm (facebook#30452)

* fix: pin hermes-engine to 0.7.x

* Use react-native-codegen@0.0.6 in new app template

Summary:
Use pre-built react-native-codegen library from npm in the iOS app template.
Built react-native-codegen from source when used with RNTester.
Published react-native-codegen@0.0.6.

Changelog:
[iOS][Added] - Use react-native-codegen in iOS app template
[Internal] - Bump react-native-codegen: 0.0.6

Reviewed By: fkgozali

Differential Revision: D25128036

fbshipit-source-id: f294c23b9b911aae6f404edc01b62426fb578477

* chore: updated url of deprecated modules (facebook#30422)

Summary:
Part of react-native-community/releases#207

Migrate warnings in index.js to point to new lean core repos

NOTE: some npm modules has been transferred to new nom namespace, such as `react-native-picker/picker` `react-native-async-storage/async-storage` `react-native-masked-view/masked-view`.
Some lean core repo has been transferred to new repo, but its npm namespace remains the same. ex: clipboard module exists in react-native-clipboard/clipboard repo, but npm package name is still `react-native-community/clipboard` (they're planned to be migrated in the future)

## 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] - Migrate warnings in index.js to point to new lean core repos

Pull Request resolved: facebook#30422

Test Plan:
- Updated repo URL can be accessed
- Updated npm package can be installed

Reviewed By: rickhanlonii

Differential Revision: D25077750

Pulled By: cpojer

fbshipit-source-id: b736ea449835bdf3d2a2f85e5c86e5253b90db78

* Add possibility to disable buttons in action sheet ios (facebook#28979)

Summary:
_**Fixed**_ version of [the previous PR](facebook#28792) after reverting [changes](facebook@c8d678a#commitcomment-39299254)

----

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

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

`ActionSheetIOS` documentation - PR facebook/react-native-website#1898

## Changelog

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

Pull Request resolved: facebook#28979

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

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

Reviewed By: sammy-SC

Differential Revision: D21727497

Pulled By: PeteTheHeat

fbshipit-source-id: 749b6c623eb8a44fe2bd96829ce89be5310e2368

* [0.64.0-rc.0] Bump version numbers

* chore: revert changes to test-manual-e2e.sh

* fix: android artifacts in publish-npm.js

* chore: Bump CLI to ^5.0.1-alpha.0 (facebook#30420)

Summary:
Upgrading CLI to latest. This diff is intended to be cherry-picked to 0.64.

cc grabbou kelset alloy

[Internal] [Changed] - Bump CLI to ^5.0.1-alpha.0

Pull Request resolved: facebook#30420

Test Plan: None

Reviewed By: MichaReiser

Differential Revision: D25063261

Pulled By: cpojer

fbshipit-source-id: e1788fd40db2b00daaf888e7b2afaf708ade5451

* [0.64.0-rc.1] Bump version numbers

* Fix cannot working Modal's onDismiss. (facebook#29882)

Summary:
Fixes: facebook#29455

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

## Changelog

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

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

Pull Request resolved: facebook#29882

Test Plan:
Tested on iOS with this change:

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

Reviewed By: shergin

Differential Revision: D24648412

Pulled By: hramos

fbshipit-source-id: acf28fef21420117c845d3aed97e47b5dd4e9390

* Integrate Native Module codegen into Xcode build pipeline (facebook#30449)

Summary:
Move the codegen invocation out of Podfiles and into the FBReactNativeSpec Pod itself. With this change, developers do not need to modify their existing project's Podfiles, and yet the codegen will be integrated into their projects automatically by way of the FBReactNativeSpec Pod.

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

The codegen will thus be invoked in these situations:

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

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

Pull Request resolved: facebook#30449

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

Reviewed By: fkgozali

Differential Revision: D25138896

fbshipit-source-id: 4779f822459cea2c30fd544eee19a49e8d80153d

* Fix Circle CI iOS Tests: Make FBReactNativeSpec dir as needed

Summary:
Quick fix for Circle CI: Ensure FBReactNativeSpec dir exists before touching files.

Changelog:
[Internal]

Reviewed By: fkgozali

Differential Revision: D25285573

fbshipit-source-id: 8dec496856c90accc687648d7068aadfea24d72b

* Fix path to react-native-codegen

Summary:
The wrong value for the path to react-native-codegen was being used. The issue was introduced during the refactoring of this script for use in FBReactNativeSpec.podspec.

Changelog: [Internal]

Motivation:

Reviewed By: fkgozali

Differential Revision: D25290355

fbshipit-source-id: 5a46c680e7ea41157b03cf54a640a8816fb682b3

* Update template devDependencies (facebook#30489)

Summary:
Update template devDependencies before 0.64.0 release

[JavaScript] [Changed] - Update devDependencies (`babel/core` to `7.12.9`, `babel/runtime` to `7.12.5`, `react-native-community/eslint-config` to `2.0.0`, `babel-jest` to `26.6.3`, `eslint` to `7.14.0` and `jest` to `26.6.3`)

Pull Request resolved: facebook#30489

Test Plan:
- [ ] Check babel
- [ ] Check eslint
- [ ] Check jest

Reviewed By: lunaleaps

Differential Revision: D25377357

Pulled By: TheSavior

fbshipit-source-id: fd8e1992860a7fbae710898fbee249e9c36d2229

* Add instructions to template/ios/Podfile for enabling hermes (facebook#30461)

Summary:
Just thought I'd add these instructions so devs don't have to check the docs. Also, it makes iOS match Android with instructions in the configuration files
## Changelog
N/A (in my opinion)

Pull Request resolved: facebook#30461

Test Plan: N/A (because not a code change)

Reviewed By: hramos

Differential Revision: D25309687

Pulled By: TheSavior

fbshipit-source-id: a1907089b9d2e7fe6f2498ce27129c3ae65f7c9a

* Bump Hermes to 0.7.2

https://github.com/facebook/hermes/releases/tag/v0.7.2 is out so we can bump the pod version 🎉

Question:
Is `~> 0.7.2` too strict? Would `>= 0.7.2` be better?
Also, It doesn't look like we are restricting any version on the trunk?

* fix: default template on iOS (facebook#30571)

Summary:
Recently introduced steps to run Hermes accidentally removed `!` from the `use_react_native`, causing `pod install` to fail with an error.

## Changelog

[INTERNAL] [iOS] - Fix Podfle in default template

Pull Request resolved: facebook#30571

Test Plan: Run `pod install` with this file and it should work.

Reviewed By: appden

Differential Revision: D25537263

Pulled By: TheSavior

fbshipit-source-id: da7f21775cbe641e34aded87a92c696539f4d5c3

* fix: building in release mode for simulator (facebook#30543)

Summary:
Fixes facebook#29984

Right now, running a React Native application with Xcode 12 in Release mode on an iPhone Simulator will fail with something like below:

> [some file path], building for iOS Simulator, but linking in object file built for iOS, file '[some file path]' for architecture arm64

The best explanation of this issue has been provided by alloy in facebook#29984:

> This issue has started coming up with Xcode 12 and support for the new ARM based Macs, as `arm64` now no longer can be assumed to _only_ be for iOS devices. This means Xcode 12 will now also build for `arm64` simulator SDKs and it has become ambiguous if an arch slice in a prebuilt binary is meant for a simulator or device.
>
> In any case, for now this means that you can configure your Xcode project to exclude `arm64` when building for any iOS simulator SDK.

This PR implements aforementioned workaround.

## Changelog

[FIX] [IOS] - Fix running React Native project with Xcode 12 in Release on iPhone Simulator

Pull Request resolved: facebook#30543

Test Plan: Switch your scheme to Release and run the app on simulator. Will complete w/o issues.

Reviewed By: appden

Differential Revision: D25537295

Pulled By: TheSavior

fbshipit-source-id: 2dc05cb80e59f1d95d2a84ab55ed6a5b5446411c

* Exclude `i386` from valid architectures when building with Hermes on iOS (facebook#30592)

Summary:
When building React Native application in Release mode for an iPhone Simulator _and_ targeting `armv7`, Xcode will build all architectures (due to `ONLY_ACTIVE_ARCH` set to `false`, unlike in Debug mode). As a result, Xcode will try building for `i386` (32-bit iPhone Simulator), which fails as we don’t build Hermes binaries for `i386`.

Fix is to disable `i386`, since it is not supported by `Hermes` and certain `Folly` features.

## Changelog

[IOS] [BREAKING] - `i386` architecture will be automatically disabled when Hermes is being used. This might be potentially breaking for your workflow if you target `armv7` devices, as you will no longer be able to test on the simulator.
[IOS] [FEATURE] - Replace `flipper_post_install` with `react_native_post_install` hook. Will automatically detect if Flipper is enabled.

Pull Request resolved: facebook#30592

Test Plan: Run React Native application with Hermes enabled (or Flipper) in Release mode and it should work just fine.

Reviewed By: appden

Differential Revision: D25564738

Pulled By: TheSavior

fbshipit-source-id: e786ab73fb0a77de5869cf9e5999726c7d29f1d4

* Fix infinite loop in KeyboardAvoidingView

Summary:
Changelog: [General][Fixed] Fix stalling UI due to a bug in KeyboardAvoidingView

I introduced this bug in D22764192 (facebook@b08fff6).

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

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

Resolves:
facebook#30495
facebook#30532

Reviewed By: TheSavior

Differential Revision: D25522362

fbshipit-source-id: 602e540bb1c40ae4f421b3e6ebc5a047cd920c17

* [0.64.0-rc.2] Bump version numbers

* Expose the testID to black-box testing frameworks on Android (facebook#29610)

Summary:
There has been a long-standing issue where black-box testing frameworks like Appium and Xamarin UITest have not been able to access the `testID` view prop for Android (see facebook#7135). A natural place for this to be exposed is via a view's `resource-id`. The `resource-id` is what I have used when working on UIAutomator-based tests for native Android apps and is a non-localized, development-only identifier. As mentioned in the linked ticket, you can dynamically set the resource-id using the view's AccessibilityNodeInfo. This change simply checks to see if a testID is provided for a view and then exposes it through the view's accessibility node delegate.

## 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] - Fixes facebook#7135,  facebook#9942, and facebook#16137. Display the `testID` as the `resource-id` for black-box testing frameworks

Pull Request resolved: facebook#29610

Test Plan:
I used the `uiautomatorviewer` tool to verify that the resource-id is populated with the `testID` of a few different views of the RNTester app.
<img width="912" alt="Screen Shot 2020-08-10 at 3 38 27 PM" src="https://user-images.githubusercontent.com/875498/89838534-55044100-db20-11ea-9be2-ba507a81f6fb.png">
<img width="1096" alt="Screen Shot 2020-08-10 at 3 40 41 PM" src="https://user-images.githubusercontent.com/875498/89838542-5897c800-db20-11ea-9895-462c6fea1130.png">

Reviewed By: JoshuaGross

Differential Revision: D25799550

Pulled By: fkgozali

fbshipit-source-id: e64ff1b90fb66b427fce7af533aa94792cfbcad3

* Remove dependency on Folly in TurboModuleUtils.h (facebook#30672)

Summary:
The TurboModuleUtils.h includes "folly/Optional.h" which is not used and creates an unnecessary dependency on Folly.
In this PR we remove this unnecessary include.

It is required for the microsoft/react-native-windows#6804 where we add an experimental support for the C++ TurboModules. While the C++ TurboModules use the same JSI and TurboModule code defined in react-native, we provide a layer that let them to work over the ABI-safe Microsoft.ReactNative.dll boundary. The RNW Nuget distribution with DLL files includes a few source files to create native/turbo modules that work through the ABI-safe API. The TurboModuleUtils.h is one of such files. By removing the dependency on Folly we reduce requirements for the native module code. After this PR is merged we will remove the fork of the TurboModuleUtils.h  added in microsoft/react-native-windows#6804.

## Changelog

[Internal] [Fixed] - Remove dependency on Folly in TurboModuleUtils.h

Pull Request resolved: facebook#30672

Test Plan:
The change does not bring any functional changes. It may only affect code compilation where some code may depend on TurboModuleUtils.h when it needs the "folly/Optional.h". The fix is add the `#include <folly/Optional.h>` there explicitly.

I had run the iOS tests and they passed:
```
yarn
pod install in packages\rn-tester
./scripts/objc-test.sh test
```

Reviewed By: mdvacca

Differential Revision: D25758927

Pulled By: fkgozali

fbshipit-source-id: 347d8f6bc333a3df67095ea0dc7221c818432fab

* Avoid eating clicks/taps into ScrollView when using physical keyboard (facebook#30374)

Summary:
This is an extension of facebook#29798 which was reverted due to cases where the soft keyboard could not be dismissed.

## Changelog

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

[General] [Fixed] - Avoid eating clicks/taps into ScrollView when using physical keyboard

Pull Request resolved: facebook#30374

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

Reviewed By: kacieb

Differential Revision: D24935077

Pulled By: lyahdav

fbshipit-source-id: 19d9cf64547e40a35f9363896e3abbdccb95b546

* Update iOS Fabric-related files to compile on OSS (facebook#29810)

Summary:
Original PR contents:

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

The following changes have been made:

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

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

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

Pull Request resolved: facebook#29810

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

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

Reviewed By: fkgozali

Differential Revision: D24058507

Pulled By: hramos

fbshipit-source-id: 8b2ea3694e6cb9aa23f83f087e2995fd4320e2bb

* Use Fabric builds in iOS tests (facebook#30639)

Summary:
Pull Request resolved: facebook#30639

# Changelog:
[Internal] Enable Fabric builds in iOS tests on Circle CI and Sandcastle.

Reviewed By: fkgozali

Differential Revision: D25700257

fbshipit-source-id: a250dbc9904efec9ded130912a993638f0992373

* Add use_react_native_codegen!

Summary:
Consolidate CocoaPods codegen scripts under a single `use_react_native_codegen!` method in `react_native_pods.rb`.

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

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

## Usage

The `use_react_native_codegen!` method has two arguments:

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

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D25728053

fbshipit-source-id: feec587b656d5b220598ce6196ea6bb34a9580a9

* Optionally override codegen script defaults via envvars

Summary:
The codegen helper script, `generate-specs.sh`, is being used to generate code for the FBReactNativeSpec and React-Fabric/rncore pods. The script now supports overriding several defaults by setting the following environment variables:

- SRCS_DIR: Path to JavaScript sources, defaults to $RN_DIR/Libraries/
- LIBRARY_NAME: Defaults to FBReactNativeSpec
- MODULES_OUTPUT_DIR: Defaults to Libraries/$LIBRARY_NAME/$LIBRARY_NAME
- COMPONENTS_LIBRARY_NAME: Defaults to rncore
- COMPONENTS_OUTPUT_DIR: Defaults to ReactCommon/react/renderer/components/$COMPONENTS_LIBRARY_NAME

The CocoaPods codegen integration has been updated to take advantage of these.

**Example CocoaPods usage:**

```
# packages/rn-tester/NativeModuleExample/RNTesterSpecs.podspec
Pod::Spec.new do |s|
  s.name = "RNTesterSpec"
  # ...
  use_react_native_codegen!(s, { :srcs_dir => __dir__, :modules_output_dir => __dir__ })
end
```

Changelog:
[Internal]

Reviewed By: fkgozali

Differential Revision: D25738466

fbshipit-source-id: c68f5a3cd0996283a7af287e992e2f973024f44c

* Make codegen more reliable on iOS (facebook#30792)

Summary:
This addesses a few issues I noticed while migrating my app to the new build-time codegen on iOS.

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

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

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

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

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

Pull Request resolved: facebook#30792

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

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

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

Note: Did not test fabric

Reviewed By: fkgozali

Differential Revision: D26104213

Pulled By: hramos

fbshipit-source-id: e18d9a0b9ada7c0c2e608d29ffe88087f04605b4

* Invoke `node` directly in generate-specs.sh (facebook#30781)

Summary:
Currently, Codegen bash wrapper (`generate-specs.sh`) for Xcode invokes JS-based Codegen tooling via `yarn --silent node <...>`. This breaks both:

- when Yarn is not installed (if NPM is used), for obvious reasons
- when Yarn v2 ("Berry") is active

This PR changes the way `generate-specs.sh` locates `node` executable to the following algorithm:

- use the path provided in the `NODE_BINARY` env var
- if `NODE_BINARY` env var is not defined, find `node` with `command -v node`

## Changelog

[iOS] [Fixed] - Fix Codegen silently failing when Yarn is not installed, or when Yarn v2 is active.

Pull Request resolved: facebook#30781

Test Plan:
### Case 1 (no Yarn installed)

1. Ensure `yarn` is not present in PATH
2. Run Xcode build
3. Check that Codegen artifacts are produced

### Case 2 (Yarn v2 is used)

1. Ensure `yarn` is running in the v2 ("Berry") mode
2. Run Xcode build
3. Check that Codegen artifacts are produced

Reviewed By: fkgozali

Differential Revision: D26187081

Pulled By: hramos

fbshipit-source-id: 77d3089f523b8c976d8223b77ff9553cb6cf68a5

* chore: bump codegen script

* [0.64.0-rc.3] Bump version numbers

* Update flipper in RNTester and template (facebook#31010)

Summary:
allow-large-files

RN Tester is using an old version of Flipper. This will help testing regressions in the latest version (which is installed when starting a new project). This also fixes an issue where libevent is incompatible between the one in flipper and when using hermes on iOS. To fix it I changed to use the version published on cocoapods instead of using a local podspec (see facebook/flipper#1916).

[General] [Changed] - Update flipper

Pull Request resolved: facebook#31010

Test Plan:
- Tested that RN tester builds and flipper works with hermes enabled / disabled and fabric on iOS
- Tested that RN tester builds and flipper works on Android

Reviewed By: fkgozali

Differential Revision: D26592317

Pulled By: PeteTheHeat

fbshipit-source-id: 2cd278c7a51b1859dab0465846b061221f07d3f6

* Generalize node search logic

* fix: React Native CodeGen integration for 0.64-stable (facebook#31027)

* fix: disable fabric

* chore: fix conflict in Podfile.lock

* [0.64.0-rc.4] Bump version numbers

* Fix RefreshControl layout when removed from window (facebook#31024)

Summary:
Since iOS 14 refresh control is sometimes visible when it shouldn't. It seems to happen when it is removed and added back to the window. This repros easily when using react-native-screens with react-navigation tabs. Inactive tabs are detached from the window to save resources.

Calling endRefreshing when refresh control is added to the window fixes the layout. It will also be called on first mount where it is not necessary, but should be a no-op and didn't cause any issues. I also decided to call it for all ios versions, although it is only needed on iOS 14+ to avoid forking behavior more.

## Changelog

[iOS] [Fixed] - Fix RefreshControl layout when removed from window

Pull Request resolved: facebook#31024

Test Plan:
Before:

https://user-images.githubusercontent.com/2677334/108666197-93ea5a80-74a4-11eb-839b-8a4916967bf8.mov

After:

https://user-images.githubusercontent.com/2677334/108666223-9ea4ef80-74a4-11eb-8489-4e5d257299c8.mov

Reviewed By: shergin

Differential Revision: D26590759

Pulled By: PeteTheHeat

fbshipit-source-id: b8c06068a24446b261cbeb88ff166289724031f1

* fix: restore refresh control fix

* chore: Update React.podspec to require cocoapods >= 1.10.1

* Fixing the git attrs for all the people and all the files and all future 🙌

* [0.64.0] Bump version numbers

* Upgrade react-hooks rules

Summary:
Upgrades the `react-hooks` eslint-rules to `4.2.0`

Changelog:
[Internal]

Reviewed By: GijsWeterings

Differential Revision: D26366235

fbshipit-source-id: 04628e8f2a6c56eacba516d877df143c6c81adb8

* Some more changes for bringing up RN64 in devmain Android (#861)

* Build & Packaging changes for bringing up RN64 in devmain

* Fixing gradle clean

* Disable gradle clean in PR builds

* Add explicit dependency on fbjs to RNTester

This is needed after upgrading to v5.0.1-alpha.0 of the CLI tools.

* Fix for submit button disappearing bug in comments (#862)

* Add the missing android folder to files in package.json

* Fix for submit button disappear bug in comments

Co-authored-by: Mayuresh Gharpure <Mayuresh.Gharpure@microsoft.com>

* Update Android patches

Co-authored-by: Mike Grabowski <grabbou@gmail.com>
Co-authored-by: Micha Reiser <mreiser@fb.com>
Co-authored-by: Janic Duplessis <janicduplessis@gmail.com>
Co-authored-by: Kevin Gozali <fkg@fb.com>
Co-authored-by: Nick Gerleman <nick@nickgerleman.com>
Co-authored-by: Dulmandakh <dulmandakh@gmail.com>
Co-authored-by: Héctor Ramos <hramos@fb.com>
Co-authored-by: Jesse Katsumata <jesse.katsumata@gmail.com>
Co-authored-by: Luke Walczak <lukasz.walczak.pwr@gmail.com>
Co-authored-by: Michał Pierzchała <thymikee@gmail.com>
Co-authored-by: Koichi Nagaoka <emmeleia@me.com>
Co-authored-by: Dmitriy Shishkin <6ast3r@gmail.com>
Co-authored-by: Steven Conaway <steven.conaway@icloud.com>
Co-authored-by: Xuan Huang (黄玄) <jsx@fb.com>
Co-authored-by: Samuel Susla <samuelsusla@fb.com>
Co-authored-by: Jayme Deffenbaugh <jdeffenbaugh@me.com>
Co-authored-by: Vladimir Morozov <vmorozov@microsoft.com>
Co-authored-by: empyrical <empyrical@outlook.com>
Co-authored-by: Ivan Moskalev <ivan.moskalev@gmail.com>
Co-authored-by: Anandraj <anandrag@microsoft.com>
Co-authored-by: Mayuresh Gharpure <gharpuremayuresh@gmail.com>
Co-authored-by: Mayuresh Gharpure <Mayuresh.Gharpure@microsoft.com>
HeyImChris added a commit to microsoft/react-native-macos that referenced this pull request Jan 25, 2022
* Adding metadata to React Native QPL points

Summary:
Changelog:
[General][Added] - Added data field to markerPoint to allow callers to add additional arbitrary string data to logged points

Reviewed By: dmitry-voronkevich

Differential Revision: D29764274

fbshipit-source-id: b0d21e3b20a5353351424afb10c950f3e8689887

* Resolve some XCode warnings (#31883)

Summary:
UIAccessibilityVoiceOverStatusChanged deprecated (iOS 11+) in favor for UIAccessibilityVoiceOverStatusDidChangeNotification ref: https://developer.apple.com/documentation/uikit/uiaccessibilityvoiceoverstatuschanged?language=objc

topLayoutGuide/bottomLayoutGuide deprecated (iOS 11+) in favor for safeAreaLayoutGuide ref: https://developer.apple.com/documentation/uikit/uiviewcontroller/1621367-toplayoutguide

This block declaration is not a prototype warnings fixed by adding void to specify no parameters ref: https://stackoverflow.com/questions/47916585/objective-c-block-parameter-issue-this-block-declaration-is-not-a-prototype

## 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] - Resolved some deprecations

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

Test Plan: Tests should pass, no functionality should change.

Reviewed By: fkgozali

Differential Revision: D29822033

Pulled By: mdvacca

fbshipit-source-id: dec8d612885634aca090ac3372cd4c7bf8a197ee

* Migrate to androidx.autofill.HintConstants & Support all constant types (#28008)

Summary:
Fix for https://github.com/facebook/react-native/issues/27952.

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

## Changelog

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

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

Reviewed By: sturmen

Differential Revision: D29766235

Pulled By: mdvacca

fbshipit-source-id: d5171aef8092d37716fddcb6f3443637a4af8481

* Fix mislabelled polyfills for Object.entries and Object.values (#31880)

Summary:
The polyfills for `Object.entries` and `Object.values` are in a file named `Object.es7.js` when these APIs form part of ES8/ES2017 (https://en.wikipedia.org/wiki/ECMAScript#8th_Edition_–_ECMAScript_2017).

The docs (https://reactnative.dev/docs/javascript-environment#polyfills) list these correctly as ES8 so I thought it might reduce confusion if anyone starts looking into the polyfills in the future like I did.

## 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 filename to include correct ECMA spec

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

Test Plan: All unit tests pass.

Reviewed By: yungsters

Differential Revision: D29820165

Pulled By: ShikaSD

fbshipit-source-id: 2a4eb58bed7b7a4089406665c5c9115cb1773ff6

* integrate RCTImpressionTrackingView into Fabric on Android

Summary:
This diff integrates RCTImpressionTrackingView into Fabric on Android

Following
https://www.internalfb.com/intern/wiki/React_Native/Migration_of_RN_Renderer_(Fabric)/
and
https://fb.quip.com/T8AtArEVcb0Z

Changelog: [Internal]

Reviewed By: bearzx

Differential Revision: D29804625

fbshipit-source-id: 16e89d629390093ace51d3b25725c37a49a08a39

* Implement textTransform prop

Summary:
Added to C++ props, but realized this is already implemented using C++ state in Android, so added to C++ state to keep this diff simpler. Keeping the C++ props change for future use.

Changelog: [Internal]

Reviewed By: JoshuaGross

Differential Revision: D29805267

fbshipit-source-id: c1fe2dc34af8bc69352ee48a5d60ba998194e3f7

* Manually some remove existential types from xplat/js

Summary:
Manually remove some existential types.

Changelog: [Internal]

Reviewed By: gkz

Differential Revision: D29724881

fbshipit-source-id: e21558dc033fa07d0b8a188eb64e14ddcf7df2ac

* Remove existential types from xplat/js

Summary: Changelog: [Internal]

Reviewed By: pieterv

Differential Revision: D29724915

fbshipit-source-id: 97cbeefbba2ddc2e1088dfe19db14fa545213549

* Deploy 0.156.0 to xplat

Summary: Changelog: [Internal]

Reviewed By: gkz

Differential Revision: D29833943

fbshipit-source-id: cb0260e1f4119b4208d42ef1267e253f6f84ff19

* RN: 5s Delay in `ReactAppInstrumentationTestCase`

Summary:
Tests like `CatalystSubviewsClippingTestCase` are intermittently failing due to registered callable modules not yet being registered.

Increasing the timeout to wait for the bundle execution to mitigate these intermittent failures.

Changelog:
[Internal]

Reviewed By: mdvacca

Differential Revision: D29835227

fbshipit-source-id: c9fe03202ad4028d3785216d50c6c173a56c6d84

* Wrong warning message

Summary:
* it says focusTextInput but the function name is blurTextInput
* probably the message was copy-pasted from `focusTextInput` where is the same error message.

Changelog: [Internal]

Reviewed By: arhelmus

Differential Revision: D29845922

fbshipit-source-id: 21fd3e572c32779c13f6909556153d07dc7a416f

* Add flow, flowfixmes to RNTesterModuleContainer and Animation examples

Summary: Changelog: [Internal] - RNTester: Add flow to RNTesterModuleContainer, render example as component, remove flowfixmes from Animation examples

Reviewed By: yungsters

Differential Revision: D29783772

fbshipit-source-id: 64ec6f247822b25c8cc6f64b192d17081be9c1f9

* Add useNativeDriver toggle UI

Summary:
Changelog: [Internal] - Update Animation examples to toggle useNativeDriver

There are issues when we toggle the native driver on and off. Where once off, the animations don't seem to update anymore, until we turn nativeDriver back on. See videos in testplan

Reviewed By: yungsters

Differential Revision: D29774939

fbshipit-source-id: cf6d70c1b574a87bb803510196dfb273b36de5e1

* Downgrade warning of view illegally being added to parent to Soft Exception

Summary: - This is crashing too much in debug, which is good signal but making it harder to test, and test unrelated features.

Reviewed By: JoshuaGross

Differential Revision: D29857626

fbshipit-source-id: c52cfb6131747ae420b27de0591620fe79f47359

* Add INFO, and MENU key event support to Android TV (#31884)

Summary:
Add INFO, and MENU key event support to Android TV

## Changelog

[Android] [Added] - Add INFO, and MENU key event support to Android TV

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

Test Plan: We develop application that utilizes aforementioned events, we've made a build against react-native fork with these changes and it was working as expected. These changes just add 2 more button mappings, so I don't think it requires some extensive testing.

Reviewed By: mdvacca

Differential Revision: D29821996

Pulled By: yungsters

fbshipit-source-id: 5f97c29c9c29d6e3bafed352b8b65f0cb02f3f1d

* Bump Flipper to 0.99.0 (#31896)

Summary:
Includes fix included in a Flipper Pod for incorrect timestamps in the Network viewer with iOS apps
https://github.com/facebook/flipper/commit/1cf745613390e5ce87b72e09016c42784cb0566a

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

[CATEGORY] [TYPE] - Message

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

Reviewed By: fkgozali

Differential Revision: D29881218

Pulled By: mdvacca

fbshipit-source-id: a206faa3d7b969a708d286884cff83bed5453d22

* Fix testID support for TextInput, Slider and ScrollView component (#31865)

Summary:
With the advent of https://github.com/facebook/react-native/issues/29610, we are now able to use the `testID` view prop on Android in black-box testing framework through the  view's `resource-id`.

But after testing it, I noticed that on the `TextInput`, `Slider` and `ScrollView` components, the `testID` prop was not exposed as  the `resource-id` properly. The main issue was that those component was using the `AccessibilityDelegateCompat` instead of the `ReactAccessibilityDelegate`.

## Changelog

[Android] [Fixed] - Fix `testID` prop for `TextInput`, `Slider` and `ScrollView` components

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

Test Plan: ![test-screenshot](https://user-images.githubusercontent.com/69216913/125802180-c0791a8c-a740-4657-a44f-42b1885eee39.png)

Reviewed By: mdvacca

Differential Revision: D29765333

Pulled By: yungsters

fbshipit-source-id: 2b8e362257e3e5fdcd20330280c588dabb44f28a

* EditText: maintain cursor position when text changes

Summary:
Similar to D29786190 (https://github.com/facebook/react-native/commit/b0e39b2ed9b66b378eb75bee9e692fc801431ddd) on iOS, keeps cursor position constant to the end of the text whenever text changes without selection updates.

Changelog: [Internal]

Reviewed By: mdvacca

Differential Revision: D29879663

fbshipit-source-id: da1b50a99ae3b9ef796423146ba49e4172e286df

* Expose new API RuntimeExecutor.executeSynchronouslyOnSameThread_CAN_DEADLOCK

Summary:
This diff exposes a new API Expose new API RuntimeExecutor.executeSynchronouslyOnSameThread_CAN_DEADLOCK. This API will be used by the next diffs of the stack

changelog: [internal] internal

Reviewed By: JoshuaGross

Differential Revision: D29764996

fbshipit-source-id: e6cd6799e16f2e47a353b7504d58d80aa49447d8

* Expose new struct InspectorData

Summary:
This diff exposes a new struct InspectorData that will be used by FabricUIManager.getInspectorDataForInstance to return metadata of stacktraces.

See next diffs of the stack

changelog: [internal] internal

Reviewed By: JoshuaGross

Differential Revision: D29764995

fbshipit-source-id: 6a2ab819623e379795e59002be0e4d40ac73b9a6

* Expose new API FabricUIManager.getInspectorDataForInstance

Summary:
This diff exposes a new API in FabricUIManager called getInspectorDataForInstance. The goal of this method is to return React metadata for a Native view.

This data will be used from partner teams to build tools that uses React metadata in RN

Data returned from React: P429701924

changelog: [internal] internal

allow-large-files

Reviewed By: JoshuaGross

Differential Revision: D29747864

fbshipit-source-id: 8cb55573be08cb530f7e3c83eed8b4fcf43e7781

* React Native sync for revisions 568dc35...cae6350

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

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

jest_e2e[run_all_tests]

Reviewed By: JoshuaGross, ShikaSD

Differential Revision: D29555979

fbshipit-source-id: 0afc869cc007bce417f0020d3ee4dc8b0ea5beb9

* Before removing a task from queue, make sure it was executed

Summary:
Changelog: [internal]

If task that is being executed schedules a new task with higher priority, the new task will be dropped from the queue. To fix this, we always check if the top of the queue is what was executed and only then remove it.

Example:
Let's say there is task A with priority "normal".

When we execute task A (which is not removed from the queue until later), it adds a task B with "immediate" priority.
So priority queue now has two tasks: [1: B, 2: A]

After task A finishes, inside workLoop, it will pop from top of the priority queue. But task A is no longer top of the priority queue (this is the bug) and it pops B. B is never executed and A is executed twice.

Reviewed By: ShikaSD

Differential Revision: D29841433

fbshipit-source-id: b2f1474fdfc7b3e2d42bae5b7f4ac7e6c3a37b54

* Make mHybridData thread safe for EventEmitterWrapper

Summary:
In T94154173, when calling ```EventEmitterWrapper->invoke()```, hybrid function ```invokeEvent``` is null, even if we checked that ```mHybridData``` is valid before calling ```invokeEvent```.

**Theory:**

```invoke()``` is called from ```mqt_js``` thread, ```desotry()``` is called from ```main``` thread, which cause multi-thread access of```mHybridData```.

So if ```desotry()``` is called after ```isValid()``` check and before calling ```invokeEvent()```, ```invokeEvent``` could be destroyed and is null.

I can reproduce with above theory:

{F633411001}

**Fix:**

Make functions synchronized so ```mHybridData``` can be thread safe.

Changelog:
[Android][Fixed] - Make mHybridData thread safe

Reviewed By: RSNara

Differential Revision: D29792453

fbshipit-source-id: 8b4c754d53ece933be7b2cf99c6cd026b39e24ad

* Make initializeMessageQueueThreads() thread safe

Summary:
**Context:**
Issue:
```java.lang.IllegalStateException: Message queue threads already initialized
	at com.facebook.react.bridge.ReactContext.initializeMessageQueueThreads(ReactContext.java:100)
```

Possible root cause:
1, ReactContext.initializeMessageQueueThreads() can be called from different threads, so it's not thread safe
2, ReactContext.initializeMessageQueueThreads() is called again without detroying the threads.

**Fix:**
Make initializeMessageQueueThreads() thread safe. If this won't fix T93983690, I'll continue investigating with possible root cause 2.

Changelog:
[Android][Changed] - Make initializeMessageQueueThreads() thread safe

Reviewed By: GijsWeterings

Differential Revision: D29877386

fbshipit-source-id: 11b32c7184e9e8d6f882474fd607538df12276b7

* Handle OSS renderers in sync script

Summary: Changelog: [Internal]

Reviewed By: ShikaSD

Differential Revision: D29896358

fbshipit-source-id: 83a9c124a01945706c4bdced8cf6e997e14f831c

* Back out "Use atomic pointer to prevent race during teardown"

Summary:
Changelog: [internal]

Original commit changeset: 390e773283a7

Original diff didn't resolve crash T82119127. Let's back this out and investigate again.

Reviewed By: mdvacca

Differential Revision: D29909878

fbshipit-source-id: 54b054f4a5c97b8f6369f8790c2cf32a56c4fbd2

* Back out "Use atomic pointer for animationDelegate_ to prevent race during teardown"

Summary:
Changelog: [internal]

Original commit changeset: 6cb898caf7c2

This change doesn't fix LayoutAnimation crashes. Let's back it out.

Reviewed By: fkgozali

Differential Revision: D29909973

fbshipit-source-id: 34926ace220e6b269bb938a3da72c977b0608187

* add persistentScrollbar option example for ScrollView (#31895)

Summary:
There was an unused example in ScrollView example, so I've added the example to RNTester App

## Changelog

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

[Internal] [Added] - Added persistentScrollbar option example for ScrollView in RNTester App

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

Test Plan: - RNTester App builds and shows example properly on Android

Reviewed By: sshic

Differential Revision: D29881126

Pulled By: mdvacca

fbshipit-source-id: 9e7e61c9d3f712cb767a78e729469fc95cb9953e

* chore: fix dead link in comment (#31902)

Summary:
Fixed a link in a comment that lead to dead link

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

## Changelog

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

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

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

Test Plan: - [ ] Changed URL opens properly

Reviewed By: charlesbdudley

Differential Revision: D29915170

Pulled By: lunaleaps

fbshipit-source-id: 00b69db82f51d16cf887cd4540a159132ad7d771

* Remove gating for on demand view mounting

Summary:
Changelog: [internal]

This feature has shipped. I remove gating here.

Reviewed By: mdvacca

Differential Revision: D29906460

fbshipit-source-id: 23433cfd4d618633b135d8c858ce6cf90cfe9fa1

* Add RNTester cases for Animated Easing API

Summary:
- Update `RNTesterNavBar` to be positioned relatively to allow for scroll views to not be clipped
- Add EasingExample with example animations taken from https://reactnative.dev/docs/easing

Changelog: [Internal]

Reviewed By: lunaleaps

Differential Revision: D29744160

fbshipit-source-id: d0e2112769d74dd34e11477f1d3b1f8f0ffebc03

* Animated Transform Styles Example

Summary: Changelog: [Internal] - Add an example to demo all the transform properties.

Reviewed By: charlesbdudley

Differential Revision: D29865790

fbshipit-source-id: 79174457071de8fca9b0aab8bf8dcc543ea9a0a3

* 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 (https://github.com/facebook/react-native/commit/5c0da011cbaa788c52519f8091157ca6d87d8abb) and D9173758 (https://github.com/facebook/react-native/commit/8b5e3fc16b1e58441318b6ada629dcff572dd120)

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 (https://github.com/facebook/react-native/commit/3d1afbbda301d48a75e45f73b96cd51ae5105dd8).

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 https://github.com/facebook/react-native/commit/d4ee734f3297463fe7b54af6d69e4ea151cf4cf9.

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 https://github.com/facebook/react-native/commit/df9cd05621f58fe5c67f889b741bfff20c780b0e

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](https://github.com/facebook/react-native/commit/a8337785539d572009d2cc4263aef7755ae03097)

## 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 i…
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. DX Issues concerning how the developer experience can be improved. Merged This PR has been merged. Platform: Android Android applications.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

testID information not visible on UIAutomator in Appium.