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

25659 Коммитов

Автор SHA1 Сообщение Дата
Liam Potter 5e79fa8441 Remove usage of UIApplication.sharedApplication (#34787)
Summary:
Brings in line with rest of code base and avoids running into this error
```
‘sharedApplication’ is unavailable: not available on iOS (App Extension) — Use view controller based solutions where appropriate instead.
```
when `Requires Only App-Extension-Safe-API` is set to Yes.

## Changelog

[iOS] [Fixed] - Update usage of UIApplication.sharedApplication in RCTKeyCommands

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

Test Plan: Setting `Requires Only App-Extension-Safe-API` to Yes before this change means the app will not compile, after the change it does.

Reviewed By: dmytrorykun

Differential Revision: D39812410

Pulled By: cipolleschi

fbshipit-source-id: 78d185ba20301b10609e4a387f000f0cfda55663
2022-09-26 07:13:52 -07:00
Lorenzo Sciandra cc13b0273f fix(hermes): change logic in build scripts for Apple to use the right version (#34710)
Summary:
Within the `hermes-engine.podspec` contained in the RN repo (at `react-native/main/sdks/hermes-engine/`), there's a bit of logic that triggers `./utils/build-ios-framework.sh` and `./utils/build-mac-framework.sh` .

The issue is that we all thought that that  `./utils/build-ios-framework.sh` would invoke the React native version of the scripts (since the podspec file lives right next to the `utils` folder) but, in reality, it doesn't. It just so happens that the Hermes repo has a root level `utils` folder which is (you guessed it) where the Hermes variation of those build scripts live.
So, when running the pod install command in a react-native project (build from source), it will go and download the hermes source code (since the `source[:git]` gets set) but then it will use the **hermes** variation of the `build-*.sh` scripts.

[Read more here](https://github.com/facebook/react-native/pull/34513#issuecomment-1248286691).

This PR is taking kudo's proposed [patch here](https://github.com/reactwg/react-native-new-architecture/discussions/68#discussioncomment-3654191) - props for the fix go to him.

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[iOS] [Fixed] -  Change hermes logic in build scripts for Apple to use the correct files

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

Test Plan: Tested by kudo in his work, and in my PR locally - [see here](https://github.com/facebook/react-native/pull/34513#issuecomment-1249431302).

Reviewed By: cortinico

Differential Revision: D39647057

Pulled By: cipolleschi

fbshipit-source-id: 6520e248801a307ca2f8886a3853dd1ff4af193d
2022-09-26 02:02:32 -07:00
Tim Yung 5d2a400e99 JS: Update Flow Definitions for `yargs` to v17
Summary:
Changelog:
[Internal]

Reviewed By: GijsWeterings

Differential Revision: D39677869

fbshipit-source-id: 4495b0c6c5e245d20034906fff4547265c7cc157
2022-09-23 18:00:18 -07:00
Paige Sun 9a253d1864 Back out "Back out "[Venice][iOS] Fix: Install Fabric UIManager before main bundle execution""
Summary:
Changelog: [Internal][Bridgeless][iOS]

# Before diff
Be in Venice > run Metro > run FBiOS > navigate to any RN surface.

 `UIManagerBinding createAndInstallIfNeeded` happens After `ReactInstance loadScript -> evaluateJavaScript`: install Fabric UIManager before main bundle execution

Reviewed By: RSNara

Differential Revision: D39760231

fbshipit-source-id: f17bf02e9b1fb0f9b0ff24c86aa6dc9349c42192
2022-09-23 17:32:49 -07:00
Carmi Grushko 47548c1149 Update ktfmt component on FBS:master
Reviewed By: strulovich

Differential Revision: D39766800

fbshipit-source-id: a7a1ef316e3a0a17d3c3020412b025dd62937ecd
2022-09-23 15:20:33 -07:00
Pieter Vanderwerff ff14ff3d92 Add explicit React useState annotations in xplat/js
Reviewed By: SamChou19815

Differential Revision: D39756144

fbshipit-source-id: d34c86b62e82e771723714fb7896058b7f27670f
2022-09-23 15:18:54 -07:00
Héctor Ramos c557f25648 Use PRODUCTION envvar directly in hermes-engine Pod to determine build type (#34776)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/34776

CocoaPods is not used when Hermes is built in Circle CI, so we cannot rely on the React Native CocoaPods scripts to be loaded.
The get_hermes_build_type function is removed from the RN CocoaPods scripts and in its place, the ENV['PRODUCTION'] envvar is accessed directly.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D39778190

fbshipit-source-id: 12083b7b4533b4ad7bb7a08612883983a0583616
2022-09-23 13:08:15 -07:00
Tianyu Yao 1d7080264e Upgrade React DevTools deps to 4.26.0
Summary:
Changelog:
[General][Changed] - Upgraded react-devtools-core dependency to 4.26.0

Reviewed By: lunaruan

Differential Revision: D39587418

fbshipit-source-id: 1b1841b72329fd3ef4ae8a08095a30a26a0b6455
2022-09-23 12:46:33 -07:00
Héctor Ramos 2fc44ac8e1 Use debug/release tarballs in hermes-engine Pod (#34761)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/34761

Separate debug and release tarballs are built in CI. Use the appropriate Hermes artifacts tarball when building hermes-engine.

Add hermes.rb tests.

Changelog:
[iOS] [Changed] - Remove debugger from Hermes when building for release

Reviewed By: cipolleschi

Differential Revision: D39698499

fbshipit-source-id: e6b10d34c7f94c2f86fc47d8b97466011aaa75cc
2022-09-23 09:40:24 -07:00
Nicola Corti 996c7a6ad8 Add note on React 18 update to 0.69.0 in the cangelog (#34774)
Summary:
Closes https://github.com/facebook/react-native-website/issues/3339

## Changelog

[Internal] - Add note on React 18 update to 0.69.0 in the cangelog

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

Test Plan: n/a

Reviewed By: cipolleschi

Differential Revision: D39770192

Pulled By: cortinico

fbshipit-source-id: 7cc9ead2b6f84163c7eddec42a4ccf5f0c16cf2a
2022-09-23 09:19:09 -07:00
Ken Tominaga fb1f53f7dc misc: fix remaining NDK comment (#34769)
Summary:
Fix remaining NDK comment for new architecture

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[General] [Fixed] - Fix remaining NDK comment for new architecture

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

Reviewed By: cipolleschi

Differential Revision: D39762860

Pulled By: cortinico

fbshipit-source-id: 35a3c9fed58d32bd6dc16c0d6bb217a3c2849612
2022-09-23 06:30:02 -07:00
Rubén Norte 30fe6b341b Restore flags to disable Fabric background executor
Summary:
We want to fix the order of execution of layout, layout effects and passive effects in React Native, but the use of the Fabric background executor for layout complicates this (and other things).

This brings back a flag to disable this background thread to do layout synchronously in JavaScript, before the execution of layout effects and passive effects.

This is expected to regress performance on some screens, so we need to address the antipatterns in those screens before shipping this.

Changelog: [internal]

Reviewed By: javache

Differential Revision: D39727131

fbshipit-source-id: 4323b089234d3304ca3bfe5697668fb44ac64c12
2022-09-23 05:51:36 -07:00
Chenglin Liu 065db683a2 add link group label to fbios deps
Summary:
Currently, fbios link groups depend on supermodules to generate. To continue supporting
link groups while allowing us to migrate off supermodules, we'll add a `fbios_link_group` label on all fbios targets to persist the current hierarchical information.

Reviewed By: jkeljo

Differential Revision: D39543862

fbshipit-source-id: 2abe5b3ee883e77336076d88436a1c84139b5a97
2022-09-22 22:52:22 -07:00
Héctor Ramos 3046ce2421 Clean up hermes-engine Pod
Summary:
Aside from the log output, these changes do not change the behavior of the hermes-engine Pod.

Removed unused git branch checks.
Use react_native_path var to build filepaths.
Edit Hermes build from source log message to be consistent with other logs.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D39699165

fbshipit-source-id: 7e389eb5315fc5a2510b84eddac2f499a3e65157
2022-09-22 13:41:51 -07:00
Héctor Ramos ce4aa93173 Build separate tarballs for Hermes with and without debugger (#34704)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/34704

Create separate hermes-engine tarballs for release and debug builds, and only include the debugger in debug builds.
Changes the hermes-engine podspec to use a debug Hermes build by default in order to preserve the inclusion of the debugger.

Upcoming changes should split the hermes-engine Pod to allow Xcode to use release and debug builds as needed.

Changelog:
[iOS][Changed] - Use debug Hermes builds by default

Reviewed By: cipolleschi

Differential Revision: D39326467

fbshipit-source-id: 94c5fe7db80194d22fced6717c5efc7accd36d48
2022-09-22 13:41:51 -07:00
Zihan Chen (MSFT) 205cc9bc3b Handle (T) and undefined properly in turbo module component codegen (#34693)
Summary:
In `buildEventSchema` and `buildPropSchema`, they check into property types to see if the given property could be converted into an event schema or a property schema. The original implementation only handles limited cases, I refactor them and make them easier to maintain.

In `getPropertyType` in `events.js`, it handles `(T)` at a wrong place, fixed.

In `getPropertyType` in `props.js`, it doesn't handle `(T)`, fixed.

And I also fixed some other issues to make the codegen reports error better.

There are many duplicated test cases that cover every piece of the code, I changed some of them so that it tests both original cases and new cases.

## Changelog

[General] [Changed] - Handle (T) and undefined properly in turbo module component codegen

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

Test Plan: `yarn jest` passed in `packages/react-native-codegen`

Reviewed By: NickGerleman

Differential Revision: D39647075

Pulled By: cipolleschi

fbshipit-source-id: 8e1df2b54aab37b7151d0bf74260e2eba0602777
2022-09-22 11:40:38 -07:00
Vincenzo Vitale 10e47b891a Do not depend on an ENV variable when publishing and setting the RN version (#34746)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/34746

The changes made in
https://github.com/facebook/react-native/pull/34694
introduced the need to have the env variable TMP_PUBLISH_DIR for the publishing and set-rn-version scripts to work.
This break any usage of set-rn-version when the env variable is not set upfront.

With this change, we are creating a temp folder in the scope that requires it (e.g. set-rn-version.js) and then passing the path to the save/revert functions.

## Changelog
[Internal] [Added] - Do not depend on an ENV variable when publishing and setting the RN version.

Reviewed By: cipolleschi

Differential Revision: D39683565

fbshipit-source-id: 21d85d1c16c4cb7324636ceb5eba626ff8cbb775
2022-09-22 07:34:50 -07:00
Gabriel Donadel Dall'Agnol 34db2d4e93 feat: Add string support to the transform property (#34660)
Summary:
This updates the `transform` property to support string values as requested on https://github.com/facebook/react-native/issues/34425. This also updates the existing unit tests of the `processTransform` function ensuring the style processing works as expected and updates the TransformExample on RNTester in order to facilitate the manual QA of this.

## Changelog

[General] [Added] -  Add string support to the transform property

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

Test Plan:
1. Open the RNTester app and navigate to the Transforms page
2. Check the transform style through the `Transform using a string` section

https://user-images.githubusercontent.com/11707729/189550548-ee3c14dd-11c6-4fd1-bd74-f6b52ecb9eae.mov

Reviewed By: lunaleaps

Differential Revision: D39423409

Pulled By: cipolleschi

fbshipit-source-id: 0d7b79178eb33f34ae55a070ce094360b544361f
2022-09-22 07:30:34 -07:00
Riccardo Cipolleschi b7add0aadb Always generate an EmptyNativeState (#34754)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/34754

This Diff is the second step of enabling the CodeGen to parse and generate a NativeState for the components.

The feature has been largely requested by the OSS community but it could be also helpful for people in Meta.

## Changelog
[General][Added] - Always generate an empty NativeState for Fabric Components

Reviewed By: cortinico

Differential Revision: D39696435

fbshipit-source-id: e24768af78f59696c0b4db009e8065bb5c89316b
2022-09-22 06:41:44 -07:00
Riccardo Cipolleschi 69f8cf14f0 Always generate the EventEmitters (#34750)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/34750

This Diff is the first step of enabling the CodeGen  to parse and generate a NativeState for the components.

The feature has been largely requested by the OSS community but it could be also helpful for people in Meta.

To allow the generation of custom `NativeState`, we first have to always generate a `ViewEventEmitter`: that's because the `ConcreteShadowNode` template lists the Generics with this order: `Name`, `Props`, `EventEmitter`, Others...
If we skip the `EventEmitters` and we put the `State`, React Native would think that the State is actually an `EventEmitter` and the build step will fail.

## Changelog
[General][Added] - Always generate a ViewEventEmitter for Fabric Components

Reviewed By: cortinico

Differential Revision: D39509869

fbshipit-source-id: 390cc146ef013baf1ed09d55a0182a5aeb5b9d9e
2022-09-22 06:41:44 -07:00
Samuel Susla 15dbd9121d Back out "Fix: Install Fabric UIManager before main bundle execution"
Summary:
Original commit changeset: 4491d6de1109

Original Phabricator Diff: D39493654 (447be62909)

changelog: [internal]

Reviewed By: javache

Differential Revision: D39727129

fbshipit-source-id: 412a7fc5e4bf8db26cde7d420e71cf1f314cdc93
2022-09-22 06:36:59 -07:00
fortmarek 22940e4177 Use verdaccio for the template e2e test (#34577)
Summary:
This PR adds [verdaccio](https://github.com/verdaccio/verdaccio) to release packages in the `packages` directory during the E2E test on CI.

The rationale behind this is the following:
- Firstly, we wanted to push the [monorepo RFC](https://github.com/react-native-community/discussions-and-proposals/pull/480). We hit an issue when renaming the packages to follow the same convention caused by the e2e test using the template to fail. This is because the template installs packages from the live version of npm – and if you just rename a package in a given PR without releasing it, the package understandably can't be installed since it's not published, yet – as you can see [here](https://app.circleci.com/pipelines/github/facebook/react-native/15286/workflows/149df51f-f59b-4eb3-b92c-20c513111f04/jobs/282135?invite=true#step-108-283).
- Secondly, the current e2e test on `main` does not actually test the latest code of the packages in the `packages` directory as it simply downloads the latest versions from npm. This creates a divide between what's tested and what users should expect when using nightlies or when a new minor is released.

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[Internal] [Changed] - Use verdaccio for template e2e test

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

Test Plan: `test_js` CI check should pass. Additionally, I have temporarily updated the [PR](https://github.com/facebook/react-native/pull/34572) renaming `assets` to `assets-registry` to include the verdaccio changes – the `test_js` passes there, additionally proving merging this PR will unblock us with the rename PRs.

Reviewed By: cipolleschi

Differential Revision: D39723048

Pulled By: cortinico

fbshipit-source-id: aeff3811967360740df3b3dbf1df50e506fb72d8
2022-09-22 05:02:37 -07:00
Kudo Chien 3d7e1380b4 Fix port as -1 if dev server without specifying port on Android (#34705)
Summary:
when specifying dev server without port, e.g. http://www.example.com/, there are some issues.

1. redbox error
<img src="https://user-images.githubusercontent.com/46429/190540390-8ee420f2-7642-427b-9f2e-e0c6d31015f8.png" width="30%">

2. showing -1 in loading view

<img src="https://user-images.githubusercontent.com/46429/190540727-158f35ad-359f-443a-a4b0-768dd2f7e400.png" width="50%">

the root cause is coming from [`java.net.URL.getPort()` will return -1 when the url doesn't have a port](https://developer.android.com/reference/java/net/URL#getPort()). this pr replaces the parser to [`okhttp3.HttpUrl`](https://square.github.io/okhttp/4.x/okhttp/okhttp3/-http-url/#port) that it will have default port 80 for http or port 443 for https. the two call paths should only serve http/https address, not file:// address. it should be safe to change from java.net.URL to okhttp3.HttpUrl.

not fully related, in the case above, android will connect to `ws://www.example.com/:8097` for react-devtools
we should strip the trailing slash in *setUpReactDevTools.js*

## Changelog

[Android] [Fixed] - Fix port as -1 if dev server without specifying port on Android

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

Test Plan:
test on rn-tester with the following steps

1. `yarn start`
2. open another terminal and run `ngrok http 8081` and it will return a tunnel url, e.g. `71a1-114-36-194-97.jp.ngrok.io`
3. open dev setting in app and change the dev server to `71a1-114-36-194-97.jp.ngrok.io`
5. reload the app

Reviewed By: cipolleschi

Differential Revision: D39573988

Pulled By: cortinico

fbshipit-source-id: 397df90ab30533207bd87a3f069132d97c22c7fd
2022-09-22 04:20:44 -07:00
Gabriel Donadel Dall'Agnol c2b699abc5 chore: Fix RNTester typos (#34757)
Summary:
While working on https://github.com/facebook/react-native/pull/34550 I noticed that a couple of words inside the RNTester package were misspelled, this gave me the idea to test other files as well using the VS Code extension [Code Spell Checker](https://marketplace.visualstudio.com/items?itemName=streetsidesoftware.code-spell-checker) which unveiled quite a few other typos.

## Changelog

[Internal] [Fixed] - Fix RNTester typos

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

Test Plan: Shouldn't require much testing as this is just fixing some typos inside the RNTester package.

Reviewed By: dmytrorykun

Differential Revision: D39722889

Pulled By: cortinico

fbshipit-source-id: a575ab8337586c5fe2d68ce73d2aae27d24a6384
2022-09-22 03:14:51 -07:00
Rujin Cao 41c6c69aaa '@emails' -> '@oncall' (*.js)
Differential Revision: D39684030

fbshipit-source-id: 69f281e9e630334ca405a92f75b659795d9ad3e1
2022-09-21 20:47:05 -07:00
Samuel Susla 59f25da5a4 React Native sync for revisions c28f313...0cac4d5
Summary:
This sync includes the following changes:
- **[0cac4d54c](https://github.com/facebook/react/commit/0cac4d54c )**: Double invoked effects on suspended children ([#25307](https://github.com/facebook/react/pull/25307)) //<Samuel Susla>//
- **[3d615fc14](https://github.com/facebook/react/commit/3d615fc14 )**: Grammar. Removed doubles of the word "the". ([#25295](https://github.com/facebook/react/pull/25295)) //<Victoria Graf>//
- **[6e3bc8a2e](https://github.com/facebook/react/commit/6e3bc8a2e )**: [DevTools] Check if Proxy exists before creating DispatcherProxy ([#25278](https://github.com/facebook/react/pull/25278)) //<Tianyu Yao>//
- **[e7fc04b29](https://github.com/facebook/react/commit/e7fc04b29 )**: [react-dom] Reorganize react-dom internals to match react ([#25277](https://github.com/facebook/react/pull/25277)) //<Josh Story>//
- **[0b54e0047](https://github.com/facebook/react/commit/0b54e0047 )**: Handle rejections to avoid uncaught rejections ([#25272](https://github.com/facebook/react/pull/25272)) //<Sebastian Markbåge>//
- **[c5d06fdc5](https://github.com/facebook/react/commit/c5d06fdc5 )**: [Flight] Fix Webpack Chunk Loading ([#25271](https://github.com/facebook/react/pull/25271)) //<Sebastian Markbåge>//
- **[975b64464](https://github.com/facebook/react/commit/975b64464 )**: [Flight] response.readRoot() -> use(response) ([#25267](https://github.com/facebook/react/pull/25267)) //<Sebastian Markbåge>//
- **[60fbb7b14](https://github.com/facebook/react/commit/60fbb7b14 )**: [Flight] Implement FlightClient in terms of Thenable/Promises instead of throwing Promises ([#25260](https://github.com/facebook/react/pull/25260)) //<Sebastian Markbåge>//
- **[c91a1e03b](https://github.com/facebook/react/commit/c91a1e03b )**: experimental_useEvent ([#25229](https://github.com/facebook/react/pull/25229)) //<Lauren Tan>//
- **[346c7d4c4](https://github.com/facebook/react/commit/346c7d4c4 )**: straightford explicit types ([#25253](https://github.com/facebook/react/pull/25253)) //<Jan Kassens>//
- **[3401e9200](https://github.com/facebook/react/commit/3401e9200 )**: useMemoCache implementation ([#25143](https://github.com/facebook/react/pull/25143)) //<Joseph Savona>//
- **[0556bab32](https://github.com/facebook/react/commit/0556bab32 )**: [Transition Tracing] More Accurate End Time ([#25105](https://github.com/facebook/react/pull/25105)) //<Luna Ruan>//
- **[5fdcd23aa](https://github.com/facebook/react/commit/5fdcd23aa )**: Flow: upgrade to 0.140 ([#25252](https://github.com/facebook/react/pull/25252)) //<Jan Kassens>//
- **[5c43c6f02](https://github.com/facebook/react/commit/5c43c6f02 )**: Unwind the current workInProgress if it's suspended ([#25247](https://github.com/facebook/react/pull/25247)) //<Sebastian Markbåge>//
- **[e52fa4c57](https://github.com/facebook/react/commit/e52fa4c57 )**: Add early exit to strict mode ([#25235](https://github.com/facebook/react/pull/25235)) //<Samuel Susla>//
- **[6aa38e74c](https://github.com/facebook/react/commit/6aa38e74c )**: Flow: enable unsafe-addition error ([#25242](https://github.com/facebook/react/pull/25242)) //<Jan Kassens>//
- **[ba7b6f418](https://github.com/facebook/react/commit/ba7b6f418 )**: Flow: upgrade to 0.132 ([#25244](https://github.com/facebook/react/pull/25244)) //<Jan Kassens>//
- **[9328988c0](https://github.com/facebook/react/commit/9328988c0 )**: Flow: fix Fiber typed as any ([#25241](https://github.com/facebook/react/pull/25241)) //<Jan Kassens>//
- **[c739cef2f](https://github.com/facebook/react/commit/c739cef2f )**: Flow: ReactFiberHotReloading recursive type ([#25225](https://github.com/facebook/react/pull/25225)) //<Jan Kassens>//
- **[c156ecd48](https://github.com/facebook/react/commit/c156ecd48 )**: Add some test coverage for some error cases ([#25240](https://github.com/facebook/react/pull/25240)) //<Sebastian Markbåge>//
- **[3613284dc](https://github.com/facebook/react/commit/3613284dc )**: experimental_use(context) for server components and ssr ([#25226](https://github.com/facebook/react/pull/25226)) //<mofeiZ>//
- **[269c4e975](https://github.com/facebook/react/commit/269c4e975 )**: Prevent infinite re-renders in StrictMode + Offscreen ([#25203](https://github.com/facebook/react/pull/25203)) //<Samuel Susla>//
- **[8003ab9cf](https://github.com/facebook/react/commit/8003ab9cf )**: Flow: remove explicit object syntax ([#25223](https://github.com/facebook/react/pull/25223)) //<Jan Kassens>//
- **[492c6e29e](https://github.com/facebook/react/commit/492c6e29e )**: Flow: upgrade to 0.127 ([#25221](https://github.com/facebook/react/pull/25221)) //<Jan Kassens>//
- **[8a9e7b6ce](https://github.com/facebook/react/commit/8a9e7b6ce )**: Flow: implicit-inexact-object=error ([#25210](https://github.com/facebook/react/pull/25210)) //<Jan Kassens>//
- **[37cc6bf12](https://github.com/facebook/react/commit/37cc6bf12 )**: Remove useDeferredValue and useTransition from Flight subset ([#25215](https://github.com/facebook/react/pull/25215)) //<Sebastian Markbåge>//

Changelog:
[General][Changed] - React Native sync for revisions c28f313...0cac4d5

jest_e2e[run_all_tests]

Reviewed By: rickhanlonii

Differential Revision: D39696377

fbshipit-source-id: 113878d22d6244b8555b5fb86db1da5d43f7cfd9
2022-09-21 17:41:50 -07:00
Ramanpreet Nara 6529383675 Always flush in NativeAnimatedTurboModule
Summary:
## Summary
In the past, NativeAnimatedModule could animate **both** Paper **and** Fabric components.

For Fabric nodes, we needed to manually flush NativeAnimatedModule's operations queue. So, we started tracking which nodes were Fabric owned in NativeAnimatedModule.

## Changes
With bridgeless mode, all components must be Fabric-owned. So, should be able to remove this fabric ownership tracking logic and **always flush.**

## Is this safe?
In the worst case, we over-flush. This doesn't seem bad. cc sammy-SC.

## Do we still need flushing?
Arguably, all this manual flushing should be unnecessary, because we already migrated AnimatedModule's Paper integration to RCTSurfacePresenterObserver, here: D14336760 (544d9fb10b).  So, do we still need this flushing?

Yes. Here's what happens when you disable all the manual flushing in bridgeless mode: https://pxl.cl/2dqPf.

Long-term, we need to re-think this operations queuing in NativeAnimatedTurboModule. I left my thoughts in T130668424 (Investigation - Day 5).

Changelog: [Internal]

Reviewed By: p-sun

Differential Revision: D39592477

fbshipit-source-id: e971edc0d99661a37b5f430bce46c78acaa121c0
2022-09-21 12:59:09 -07:00
Saad Najmi 6ba5fa946d Update pressable hover props (#34740)
Summary:
This is a mirror of https://github.com/DefinitelyTyped/DefinitelyTyped/pull/62344 . I am updating some typescript types for props that were added with https://github.com/facebook/react-native/issues/32405

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[General] [Fixed] - Fixed missing Pressable hover props in typescript definition

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

Test Plan: Added a test case.

Reviewed By: lunaleaps

Differential Revision: D39688606

Pulled By: cortinico

fbshipit-source-id: 98ea5f64e6ac264772466455e6d5ab99a8427d3a
2022-09-21 11:50:21 -07:00
Pieter De Baets eddff32b6f Update Hermes
Summary: Changelog: [Internal]

Reviewed By: rshest

Differential Revision: D39657809

fbshipit-source-id: 21a4a39c5c21d3932db0e8513dad8f005ea46148
2022-09-21 07:16:37 -07:00
Nicola Corti 596111fabf Cleanup of ReactAndroid/build.gradle after AGP 7.3.x bump (#34747)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/34747

Just a minor cleanup after the AGP bump.

Changelog:
[Internal] [Changed] - Cleanup of ReactAndroid/build.gradle after AGP 7.3.x bump

Reviewed By: cipolleschi

Differential Revision: D39687286

fbshipit-source-id: 441e449b51b25e4152cf1e7e7e22c7c9f1432d05
2022-09-21 04:28:34 -07:00
Pieter De Baets d9f93d30e0 Disable default clipping in Fabric's SafeAreaView implementation
Summary:
This behaviour diverges from the original SafeAreaView implementation and causes issues when you try to use SafeAreaView in non-root placements (not recommended)

Changelog: [iOS][Internal]

Reviewed By: sammy-SC

Differential Revision: D39497303

fbshipit-source-id: 03bc288557f611bd4a8c16b3a6df8887e89ee9ec
2022-09-21 04:16:43 -07:00
Gianluca Spada 2f6b2127d9 Fix: Codegen template error in RCTThirdPartyFabricComponentsProvider (#34738)
Summary:
When `GenerateRCTThirdPartyFabricComponentsProviderCpp.js` generates `RCTThirdPartyFabricComponentsProvider.mm` an edge case happens in the following situation:
- The same library exports multiple modules with one component each (i.e. one component per file);
- The **first component** is excluded for iOS via the `excludedPlatforms` property in *codegenNativeComponent*.

A "loose" comma appears in the generated template, breaking the code.

```c++
Class<RCTComponentViewProtocol> RCTThirdPartyFabricComponentsProvider(const char *name) {
  static std::unordered_map<std::string, Class (*)(void)> sFabricComponentsClassMap = {
, // <-- the offending comma
    {"NativeComponent2", NativeComponent2Cls}, // rnmylibrary
  };
}
```

At some point, `GenerateRCTThirdPartyFabricComponentsProviderCpp.js` does not properly filter out empty arrays resulting from excluded components. This does not seem to be a problem when the excluded component is not the first being processed, as the comma gets added at the end of the previous line, after the comment with the name of the library.

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[iOS] [Fixed] - Fix error in the Codegen template for ThirdPartyFabricComponentsProvider

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

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

This is the schema that leads to the bug. Notice that the first component was excluded for iOS.
```json
{
  "modules": {
    "ComponentFile1": {
      "type": "Component",
      "components": {
        "NativeComponent1": {
          "excludedPlatforms": ["iOS"]
          "extendsProps": [
            {
              "type": "ReactNativeBuiltInType",
              "knownTypeName": "ReactNativeCoreViewProps"
            }
          ],
          "events": [],
          "props": [],
          "commands": []
        }
      }
    },
    "ComponentFile2": {
      "type": "Component",
      "components": {
        "NativeComponent2": {
          "extendsProps": [
            {
              "type": "ReactNativeBuiltInType",
              "knownTypeName": "ReactNativeCoreViewProps"
            }
          ],
          "events": [],
          "props": [],
          "commands": []
        }
      }
    }
  }
```

`GenerateRCTThirdPartyFabricComponentsProviderCpp.js` should generate a template without the comma in the wrong position (before NativeComponent2).

I also added an additional test case to cover this problem. All the other tests passed.

Reviewed By: sammy-SC

Differential Revision: D39686573

Pulled By: cipolleschi

fbshipit-source-id: 6054464d024218eb0b2e02974aa5cc7c8aebbbc9
2022-09-21 04:13:12 -07:00
Nenad Vojnovic 8745a148b6 Fix HERMES_ENABLED check in scripts/react-native-xcode.sh (#34675)
Summary:
Checking if Hermes is enabled is failing because there is no `podfile.lock` file in the directory where this script is executed and `USE_HERMES` will be set to `false` which will prevent building Hermes binary jsbundle.

## Changelog

[iOS] [Fixed] - `HERMES_ENABLED` check fixed in react-native-xcode.sh

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

Test Plan:
1. Enable Hermes
2. Make a release build
3. Verify the `main.jsbundle` file is Hermes binary bundle

Reviewed By: cortinico

Differential Revision: D39686608

Pulled By: cipolleschi

fbshipit-source-id: 237c77ced484d4ab77e576c7a2bb7b6826228017
2022-09-21 03:40:44 -07:00
Nicola Corti 67bc498b24 Bump AGP to 7.3.0 inside the template (#34739)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/34739

AGP 7.3.0 just got released which is glorious!
This allows us to remove a lot of unnecessary boilerplate to handle correct task ordering
inside the template

This requires "react-native-gradle-plugin" version 0.71.1 to be published on NPM.

Changelog:
[Android] [Changed] - Bump AGP to 7.3.0 inside the template

Reviewed By: mdvacca, dmytrorykun

Differential Revision: D39653419

fbshipit-source-id: 517363c952cbad2be0f2766c0a2b7daf3e75048b
2022-09-20 19:31:17 -07:00
Nicola Corti 765a4a97e4 Bump react-native-gradle-plugin to 0.71.1
Summary:
As we're shipping the AGP 7.3.x bump which requires
changes of the Gradle Plugin, I'm bumping a version so I can use it
already in the new template.

Changelog:
[Internal] [Changed] - Bump react-native-gradle-plugin to 0.71.1

Reviewed By: mdvacca, dmytrorykun

Differential Revision: D39653418

fbshipit-source-id: 9e898530345f1a3461c44c04b4cc5e7736a0f6a5
2022-09-20 19:31:17 -07:00
Nick Gerleman de8d31a5aa Fix crash in DEV when VirtualizedList_EXPERIMENTAL is loaded
Summary:
`verifyVirtualizedList` chokes on missing displayName in DEV, due to a mistake in D39648806 (a0d1585cdb). Not sure why this isn't triggered in Jest tests (maybe it is able to fill displayName via transform?), but this fixes the issue in dev mode.

Changelog:
[Internal][Fixed] - Fix crash in DEV when VirtualizedList_EXPERIMENTAL is loaded

Reviewed By: mdvacca

Differential Revision: D39670991

fbshipit-source-id: b1a784aa3fffdc5f2f025eb1f689307132aad9b6
2022-09-20 16:21:55 -07:00
Rob Hogan c27501bb87 Update to Jest 29 (#34724)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/34724

Following on from the recent upgrade from Jest 26->27, this brings us up to present day Jest 29 for tests of React Native itself, Metro, and Meta-internal code. An update to the template for RN apps will follow.

Changelog:
[Internal][Fixed] Update to Jest 29

Reviewed By: huntie

Differential Revision: D39543504

fbshipit-source-id: b47fdb678212b475881ec19085f6cd45a4530333
2022-09-20 14:15:50 -07:00
Luna Wei 6eee307778 Fix: Publish types folder (#34727)
Summary:
From changes in https://github.com/facebook/react-native/pull/34614, I forgot to actually export the types directory.

## Changelog

<!-- Help reviewers and the release process by writing your own changelog entry. For an example, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[Internal] - Add types directory as part of the npm package

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

Test Plan: Verified on [`build_npm_package_1`](https://app.circleci.com/pipelines/github/facebook/react-native/15799/workflows/4fd57bfc-0142-49d9-a1a6-83fa43f0e371/jobs/295438) job where we create the commitly, that `types` folder is included and `__typetests__` are ignored

Reviewed By: cipolleschi

Differential Revision: D39646310

Pulled By: lunaleaps

fbshipit-source-id: 361f7925fa1cdc30d0865d291933c7fce9e0fa49
2022-09-20 12:39:58 -07:00
Luna Wei bcb58089c4 Create PointerEventState
Summary: Changelog: [Internal] - A refactor to pass the object PointerEventState containing relevant state / and also properties for pointerEvent objects

Reviewed By: vincentriemer

Differential Revision: D39626285

fbshipit-source-id: e2ff5313ef03d7d2d36c35ca459950ec07650df2
2022-09-20 12:01:07 -07:00
Luna Wei 4ca089f94c Simplify Coalescing Key
Summary:
Changelog: [Internal]
Stop using `TouchEventCoalescingKeyHelper` for tracking and stop making the distinction between traditional touch events (down, up, move) vs hover only events. The only events that currently coalesce are `onpointermove` events. This change uses just one counter now that we increment whenever some non-move event is fired.

Let me know if there's a simpler way to ensure counter doesn't overflow.
This change also ensures we're overriding `getCoalescingKey` which isn't used by Fabric but for old event emitter it might be (which we use for native animations). Part of that requires the `coalescingKey` to be a short so updated to that.

There was also a bug where I forgot to pass `mLastButtonState` to one of the dispatch calls. Will be wrokign on refactor so its less argument soup.

Reviewed By: javache

Differential Revision: D39530927

fbshipit-source-id: 689fa98580b206a480cc08121971cdf96bdbbfaa
2022-09-20 12:01:07 -07:00
Nick Gerleman 773615bc9d Remove listKey from TS typings
Summary:
The prop is removed as part of D39589089 (bc5cb7cd79) (no longer does anything). Remove from the TS declarations.

Changelog:
[General][Removed] - Remove listKey from TS typings

Reviewed By: lunaleaps

Differential Revision: D39650827

fbshipit-source-id: dd9b5eccba1b9f6964a6d60ea5bae9913e8396e3
2022-09-20 11:39:05 -07:00
Rob Hogan a0483991f4 CircleCI: Remove `test_codegen` (#34733)
Summary:
The CircleCI `test_codegen` job currently runs tests under `packages/react-native-codegen`. Because it runs from that working directory, it doesn't pick up the project root's `jest.config.js`, which is a problem for https://github.com/facebook/react-native/pull/34724 (snapshot format configuration in `jest.config.js`)

`react-native-codegen` tests are *already run* by the `test_js` job, as can be seen from the CircleCI logs
https://app.circleci.com/pipelines/github/facebook/react-native/15818/workflows/41034d00-7061-46e8-a03d-abdcc7fd7e2f/jobs/295804/parallel-runs/0/steps/0-107 , so the job isn't necessary, and this PR removes it. CC cipolleschi

## Changelog

[Internal] [Fixed] - Remove redundant `test_codegen` job from CircleCI.

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

Test Plan: CircleCI!

Reviewed By: lunaleaps

Differential Revision: D39660829

Pulled By: robhogan

fbshipit-source-id: d7b09cc90a30e7604e2645e2bd0c16f840443153
2022-09-20 11:08:28 -07:00
Luna Wei 2f6e0358a9 Add id property
Summary:
Changelog: [Internal] - Apply changes from recent `id` property adds. These are changes by
gabrieldonadel from https://github.com/DefinitelyTyped/DefinitelyTyped/pull/62019

Reviewed By: cipolleschi

Differential Revision: D39646408

fbshipit-source-id: d75f2e2b5b3d157825c4aaf21775e0d5165383ee
2022-09-20 10:57:58 -07:00
Luna Wei 88bfc65803 Update Accessibility types for aria props
Summary: Changelog: [Internal] - Update the base accessibility props to include the added aria props. See https://github.com/facebook/react-native/compare/0.70-stable...main for changes.

Reviewed By: cipolleschi

Differential Revision: D39633224

fbshipit-source-id: 6c08ab8540b8b6e2b57f066a35754376c5ae3d68
2022-09-20 10:57:58 -07:00
Nicola Corti 9f6711fda0 Bump AGP to 7.3.0 inside ReactAndroid (#34707)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/34707

AGP 7.3.0 just got released which is glorious!
This allows us to remove a lot of unnecessary boilerplate to handle correct task ordering
on both React Android & the template

Changelog:
[Android] [Changed] - Bump AGP to 7.3.0

Reviewed By: mdvacca

Differential Revision: D39553534

fbshipit-source-id: 9680893e9f48cac867206aeb7eb468dbf91c1643
2022-09-20 10:30:40 -07:00
Gabriel Donadel Dall'Agnol f63d4e7deb refactor: Convert Animated directory to use ESModule imports/exports (#34539)
Summary:
This PR refactors the Animated directory to use ESModule imports/exports instead of using a mixture of the 2 module formats, as requested on https://github.com/facebook/react-native/issues/34425.

## Changelog

[Internal] [Changed] - Convert all files in the Animated directory to use ESModule imports/exports

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

Test Plan: This doesn't really add or modify any existing features so checking if CI passes should be enough

Reviewed By: yungsters

Differential Revision: D39235720

Pulled By: yungsters

fbshipit-source-id: 84b4c0a71dc9fca1ab7053263f1cf7c336df58c1
2022-09-20 10:05:48 -07:00
Nick Gerleman a0d1585cdb Move VirtualizedList_EXPERIMENTAL to ES6 import/export
Summary:
VirtualizedList uses a combination of ES6 and CommonJS imports/exports. This moves fully to ES6 imports and exports, in the experimental version (which should soon replace the original).

Changelog:
[Internal][Changed] - Move VirtualizedList_EXPERIMENTAL to ES6 import/export

Reviewed By: rshest

Differential Revision: D39648806

fbshipit-source-id: a5da40f62a6010cd5b9894b02a91af86d3a8b995
2022-09-20 05:21:08 -07:00
Nick Gerleman 8f0975a3b7 Extract VirtualizedListCellRenderer
Summary:
VirtualizedList is large and complicated, getting larger and more complicated. This splits out a subcomponent, the cell renderer into its own file, since it is relatively isolated already. This uses the copy from VirtualizedList_EXPERIMENTAL, whose only real difference is exposing focus capture events to the containing VirtualizedList.

Changelog:
[Internal][Changed] - Extract VirtualizedListCellRenderer

Reviewed By: rshest

Differential Revision: D39648087

fbshipit-source-id: bb7c2eff0c658713c256650596f86e8788019baf
2022-09-20 05:21:08 -07:00
Nick Gerleman bc5cb7cd79 Remove usages of listKey
Summary:
Now that the prop noops, remove the usages of the property. This is the point of no return for the prop.

Replaced listKey usage with a combination of `flow check`, regex replace, manual inspection.

Changelog:
[General][Removed] - Remove usages of listKey

Reviewed By: fred2028

Differential Revision: D39589089

fbshipit-source-id: 722ebb7dce038a2709656394b7d736e72f488bb7
2022-09-20 04:13:22 -07:00
Rob Hogan 408471f041 CircleCI: Use `nodejs-lts` for Windows tests (#34726)
Summary:
Currently we use `nvm install 16` in the `test_windows` CircleCI job. With the "official" non-Windows NVM, this means latest 16 (16.17.0), but that's not the case for NVM-Windows, [which simply appends `.0.0`](https://github.com/coreybutler/nvm-windows/blob/1.1.7/src/nvm.go#L384) unless [the major version is one character long](https://github.com/coreybutler/nvm-windows/blob/1.1.7/src/nvm.go#L210). The Windows orb includes NVM-Windows 1.1.7 (even on the latest 5.0.0 orb), which does not support `nvm install lts` (added 1.1.9). Updating NVM isn't trivial as the system/orb version takes precedence over any Chocolately installation.

Running tests on 16.0.0 blocks Jest 29, which requires [`^16.10.0`](https://github.com/facebook/jest/blob/v29.0.3/packages/jest-create-cache-key-function/package.json#L17).

I initially tried installing a specific Node JS version with NVM, but NVM-Windows 1.1.7 doesn't support newer Node versions due to https://github.com/npm/cli/issues/4234.

So this PR switches from using NVM-Windows to just using Chocolately Node JS packages. `nodejs-lts` tracks the latest LTS. IMO, given we're only testing against one Node JS version with Windows, the latest LTS is a good option, but versions can be specified with `--version` if we want to pin it instead.

Yarn is available through [corepack](https://nodejs.org/api/corepack.html#corepack) since 16.9, so doesn't need to be installed separately.

## Changelog

[Internal] [Fixed] - CircleCI: Update Node JS version used on Windows tests from 16.0.0 to 16.17.0

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

Test Plan: Tested via painful trial and error on my fork: https://app.circleci.com/pipelines/github/robhogan/react-native/19/workflows/0c23a77f-40d2-4c36-933b-53c14acb7907

Reviewed By: cipolleschi

Differential Revision: D39647377

Pulled By: robhogan

fbshipit-source-id: 733da49c632eab26a09ba9cd0175419b9144f9d2
2022-09-20 03:32:04 -07:00