Summary:
This is a long time coming effort to improve the situation around the local e2e script that in the release crew: the current bash-based script is quirky at best, and what you end up generating as a sample project is not really a true sample project. This is where this PR comes in: it migrates the flow from `./scripts/test-manual-e2e.sh` to `yarn test-e2e-local <options>`.
Here's the current shape of the options:
```sh
Options:
--help Show help [boolean]
--version Show version number [boolean]
-t, --target [choices: "RNTester", "RNTestProject"] [default: "RNTester"]
-p, --platform [choices: "iOS", "Android"] [default: "iOS"]
-h, --hermes [boolean] [default: true]
```
The idea is to change it so that you can just run the script, and it will do that one specific thing "well", without the tester needing to do anything aside from actually testing the app once it's open.
Some of the key changes:
* tries to stick to the patterns of the other established *.js based scripts, in terms of tooling and approach (and even refactor parts that can be shared with other scripts) - like the android artifacts generation
* no need to start the android emulator on the side
* no need to start Metro on the side
* RNTester iOS will open up on the simulator (no Xcode open that then you need to press)
Things that still need work:
* see the #fixme and #todo in comments
* because we rely on exec, the output sent back is not formatted/shaped correctly so it's a bit more noisy/chaotic - but can't handle it right now because the package we use doesn't allow it - see https://github.com/shelljs/shelljs/issues/86
## 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] - Migrate bash E2E local testing script to new JS based command
Pull Request resolved: https://github.com/facebook/react-native/pull/34513
Test Plan:
To test the script, you can run it passing the options showed above; this is the current situation:
* RNTester iOS Hermes ✅
* RNTester Android Hermes ✅
* RNTester iOS JSC ✅
* RNTester Android JSC ✅
* RNTestProject Android Hermes ✅
* RNTestProject iOS Hermes ✅
* RNTestProject Android JSC ✅
* RNTestProject iOS JSC ✅
Reviewed By: cortinico
Differential Revision: D39814692
Pulled By: cortinico
fbshipit-source-id: d4791798aaad764c6a3757269b7636f847ccf2ca
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/34829
I realized there is a race condition in how prefab headers are prepared and bundled. If the download of boost is not 'fast enough' the headers will be missing during prefab preparation.
This fixes it.
Changelog:
[Internal] [Changed] - Fix broken template tests due to missing boost headers
Reviewed By: cipolleschi
Differential Revision: D39968622
fbshipit-source-id: 4680f84c15f4443a16def45d41a10a1083f4f196
Summary:
This PR bumps the dep version of Metro and the RN CLI to latest, and realigns them to avoid the issue we currently have in 0.70: https://github.com/facebook/react-native/issues/34714 (this commit will be cherry-picked there)
Also, it pins it all down to precise version. See comments for reasoning.
While at it, I gave a cleanup pass to the yarn.lock with [`yarn deduplicate`](https://github.com/scinos/yarn-deduplicate#readme).
## 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] [Changed] - bump CLI to 9.1.3 and Metro to 0.72.3
Pull Request resolved: https://github.com/facebook/react-native/pull/34803
Test Plan: CI is green
Reviewed By: dmytrorykun
Differential Revision: D39967392
Pulled By: dmytrorykun
fbshipit-source-id: 799dd745834c9ba349362f70afb4bdbd1a48260e
Summary:
We need to bump & publish a new version of the Gradle Plugin.
This is needed otherwise the template will break as I start to remove
entries from the `Android-prebuilt.cmake` file
Changelog:
[Internal] [Changed] - Bump react-native-gradle-plugin to 0.71.2
Reviewed By: lunaleaps, mdvacca
Differential Revision: D39815785
fbshipit-source-id: b140187971e2f963ef459e9c83ce9a76e67c89bd
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
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
Summary:
## Changelog
[General] [Added] - Add `types` folder to house TypeScript types.
Release TypesScript types with react-native and eventually deprecate [types/react-native](https://www.npmjs.com/package/types/react-native).
The current plan is to release types/react-native for 0.70 and 0.71 while also maintaining types here. This will result in some double maintenance until 0.72 but will give community time to move off of types/react-native.
After this lands, there have been changes on `main` of types that we need to update. Then, when we release 0.71 from DefinitelyTyped, we can simply copy over the `types` folder from this repo.
Pull Request resolved: https://github.com/facebook/react-native/pull/34614
Test Plan:
`yarn run test-typescript` for linting types
* Created a new project using the TS template and my local clone of `react-native` on this branch.
`npx react-native init MyTSApp --version <path-to-my-local-rn-repo> --template react-native-template-typescript`
* Updated the `package.json` to remove `types/react-native`
* Deleted my node_modules and re-ran yarn
* Opened MyTSApp in VSCode and verified the type suggestions appeared and cmd+click to defnitions took me to the node_module dependency `react-native/types`
## Danger is failing on this PR and it's expected
as it runs off the changes on `main`. [This is expected](https://docs.github.com/en/github-ae@latest/actions/using-workflows/events-that-trigger-workflows?fbclid=IwAR2_AE0Jwndt8Gu-iTQnxGxLJq7nakbi7sz8jwZ6U62JWLSdcZuvjcQ6WvE#pull_request_target). However testing it locally passes. Once merged, and these changes are on `main`, danger will pass again.
```
$ react-native/packages/react-native-bots
❯ yarn danger pr https://github.com/facebook/react-native/pull/34614
yarn run v1.22.19
$ ..react-native/node_modules/.bin/danger pr https://github.com/facebook/react-native/pull/34614
Starting Danger PR on facebook/react-native#34614
Danger: ✓ found only warnings, not failing the build
## Warnings
🔒 package.json - <i>Changes were made to package.json. This will require a manual import by a Facebook employee.</i>
✨ Done in 13.24s.
```
Reviewed By: mdvacca
Differential Revision: D39479137
Pulled By: lunaleaps
fbshipit-source-id: 1d506f812d566b783b6e79104cd6339b077a42a7
Summary:
Update our internal tests to use Jest 27. If this sticks, we should follow up with updating the RN template.
Changelog:
[Internal][Fixed] Update Jest setup to v27.5.1
Reviewed By: motiz88
Differential Revision: D39383717
fbshipit-source-id: 0fbb5a7b1ab70ccbfaed22b2de92f445f756afe0
Summary:
Changes the React Native base ESLint configuration to consume `react-native-community/eslint-config` as a [yarn workspace](https://classic.yarnpkg.com/lang/en/docs/workspaces/), so that any dependencies of `react-native-community/eslint-config` can also be resolved from the root directory of `react-native`.
Previously, `~/.eslintrc.js` extended `react-native-community/eslint-config` using a relative file path. This is problematic because if any dependencies (notably, optional peer dependencies such as some of the TypeScript dependencies) are not already installed at the root directory of `react-native`, running ESLint could fail to resolve any required dependencies. In other words, there was an implicit dependency that `react-native/yarn.lock` would also contain any dependencies required by `react-native/packages/eslint-config-react-native-community/yarn.lock`.
With this change, running `yarn` from the root directory of `react-native` will also install any dependencies of `react-native-community/eslint-config`, and it will also symlink `react-native/node_modules/react-native-community/eslint-config` to `../../packages/eslint-config-react-native-community` (meaning any local changes to the config will still be reflected during active development).
## Changelog
[Internal]
Pull Request resolved: https://github.com/facebook/react-native/pull/34423
Test Plan:
Successfully install dependencies and run ESLint.
```
$ cd react-native
$ yarn
$ yarn lint
```
Successfully run Danger on https://github.com/facebook/react-native/pull/34401 (which would previously fail because `typescript-eslint/eslint-plugin` could not be resolved from the root directory of `react-native`):
```
$ cd react-native/bots
$ yarn
$ node ./node_modules/.bin/danger pr https://github.com/facebook/react-native/pull/34401
```
Reviewed By: NickGerleman
Differential Revision: D38710285
Pulled By: yungsters
fbshipit-source-id: a06ceea0884a90be60f6f5db9a5d42be52a951d5
Summary:
Bump CLI to latest v9 alpha so that I can then chery-pick in 0.70-stable branch for next RC
## 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] [Changed] - bump CLI to latest v9-alpha11
Pull Request resolved: https://github.com/facebook/react-native/pull/34385
Test Plan: N/A
Reviewed By: robhogan
Differential Revision: D38615615
Pulled By: dmitryrykun
fbshipit-source-id: ea5dd7b93f4ed3bb82347fd730b8e65e8a89a6ca
Summary:
Bumping main to latest version of CLI available; in particular, we want to ensure to propagate this fix https://github.com/react-native-community/cli/pull/1655.
After merging, we'll cherry-pick in the `0.70-stable` branch.
## 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] [Changed] - bump CLI to v9.0.0-alpha.5
Pull Request resolved: https://github.com/facebook/react-native/pull/34275
Test Plan: CI
Reviewed By: NickGerleman
Differential Revision: D38151383
Pulled By: dmitryrykun
fbshipit-source-id: afdafb496a159ad766dd322a4aab4bda6146edf0
Summary:
This resolves issues where the node_modules structure is not hoisted (like with pnpm). Since the template does not directly depend on the cli, it doesn't exist in the pnpm node_modules root. Moving it to the rn scripts makes sure that the relative require starts in the correct directory for both hoisted and pnpm structures.
## Changelog
[iOS] [Fixed] - Fix cocoapods cli native_modules require for pnpm node_modules
Pull Request resolved: https://github.com/facebook/react-native/pull/34215
Test Plan:
1. react-native init
2. rm -rf node_modules
3. pnpm i
4. bundle install
5. bundle exec pod install --project-directory=ios
This should succeed. Without the patch, it will fail with
```
[!] Invalid `Podfile` file: cannot load such file -- /.../node_modules/react-native-community/cli-platform-ios/native_modules.
# from /.../ios/Podfile:2
# -------------------------------------------
# require_relative '../node_modules/react-native/scripts/react_native_pods'
> require_relative '../node_modules/react-native-community/cli-platform-ios/native_modules'
#
# -------------------------------------------
```
Reviewed By: cortinico
Differential Revision: D37959152
Pulled By: cipolleschi
fbshipit-source-id: 7fa9af4a8c153cfd38360f57eca415a8c252dbd5
Summary:
Upgrade React Native's direct dependencies on Metro packages from 0.71.2 to 0.71.3
Metro release notes: https://github.com/facebook/metro/releases/tag/v0.71.3
Changelog:
[General] Update direct Metro dependencies to 0.71.3
Reviewed By: robhogan
Differential Revision: D37647746
fbshipit-source-id: cb798c2c0d0d763ce5dd2af48f3877fab8e9fc0d
Summary:
Upgrade React Native's direct dependencies on Metro packages from 0.71.1 to 0.71.2.
Metro release notes: https://github.com/facebook/metro/releases/tag/v0.71.2
Changelog:
[General] Update direct Metro dependencies to 0.71.2
Reviewed By: jacdebug
Differential Revision: D37593257
fbshipit-source-id: f56db766a6c63b74ab9feab31a9d7a1f50c5af23
Summary:
Provides necessary changes for the autolinking to work in new architecture on Android. Depends on https://github.com/react-native-community/cli/pull/1603 and is subject to change.
Upgraded the RN CLI to v9.0.0-alpha.0 so that it's testable locally.
## 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] [Change] - Adapt template to new architecture autolinking on Android
Pull Request resolved: https://github.com/facebook/react-native/pull/33777
Test Plan: CI
Reviewed By: cipolleschi
Differential Revision: D36478984
Pulled By: cortinico
fbshipit-source-id: 970fa7bcb77898d9defae18c20026a7783ba4108
Summary:
This removes the `hermes-engine` NPM package from the RN package.json.
Users are not supposed to use this package anymore as we now ship Hermes
bundled with React Native.
More on this here: https://reactnative.dev/architecture/bundled-hermes
Changelog:
[General] [Changed] - Do not depend on hermes-engine NPM package anymore
Reviewed By: neildhar
Differential Revision: D37353977
fbshipit-source-id: b049d18e945a72c1f37c3e4b040af83b5e395774
Summary:
Original commit changeset: 4c0afc95abe8
Original Phabricator Diff: D37155957 (d1321d88bd)
See attached UBN task for more details, I am reverting the whole diff now while investigating the root cause.
Changelog:
[General][Changed] - Revert "React Native sync for revisions d300ceb...256aefb"
jest_e2e[run_all_tests]
=== update
klein did a bisect for S276290, it seems Original Phabricator Diff: D37155957 (d1321d88bd) is the blame diff.
jackworden also has verified backout can fix it for both ios and android.
Reviewed By: ahujap-fb, kacieb
Differential Revision: D37205394
fbshipit-source-id: 600e6593532da064631c016aace317932f290c67
Summary:
`hermes-eslint` is built by Meta to work with the latest Flow code.
It follows the latest ESLint standards and AST, and has a true scope analyser to ensure best compatibility with core ESLint rules.
Reviewed By: motiz88
Differential Revision: D37181192
fbshipit-source-id: 1f59e01f306792e67a4977435c5c77e0000d960a
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/33978
This Diff moves part of the utilities from the `react_native_pods` file to a specific `utils.rb` file.
It adds tests for these utils and improve our test mocks.
The goal is to simplify the `react_native_pods.rb` so it's easier to work with it.
I decided to split this diff in 2 because it was becoming quite big.
## Changelog
[iOS][Changed] - Refactoring part of the react_native_pods.rb script
Reviewed By: cortinico
Differential Revision: D37004347
fbshipit-source-id: a5156f7c199d082d5d895a58af80948556c51c2a
Summary:
The sdks/.hermesversion file should be included inside the React Native NPM package.
While this file is available on the release branch, so it's effectively used during artifact preparation,
the file should also be included inside the react-native NPM package.
This commit addresses it.
Changelog:
[Internal] - Make sure sdks/.hermesversion is included inside the NPM package
Reviewed By: dmitryrykun
Differential Revision: D36785480
fbshipit-source-id: 1152de77818e92814b402a57ca5a05c235747eac
Summary:
This diff upgrades xplat to 0.178.1 and pre-suppresses errors from turning on constrained writes.
To generate this diff I:
* Modified every `env_mode=constrain_writes` to `env_mode=ssa` and made a commit (this is so our upgrade script will work)
* Ran scripts/flow/upgrade.sh 0.178.1 to upgrade all the flowconfigs to 178.1 and suppress new-env errors
* Modified arvr/js/flowconfig.ejs to use 0.178.1 and ran `scripts/gen-flowconfig/gen-flowconfig --project arvr`
* Modified xplat/js/flowconfig.ejs to use 0.178.1 and ran `scripts/gen-flowconfig/gen-flowconfig --project xplat`
* Unstacked from the commit in point 1
Reviewed By: SamChou19815
Differential Revision: D36676019
fbshipit-source-id: c3032f18ed838afc327f00de563e7f20713bdc26