11 Commits
Author SHA1 Message Date
Alex Hunt 97727ba67f Fix compat with extensionless scripts/* imports (#57718)
Summary:
Pull Request resolved: https://github.com/react/react-native/pull/57718

**Context**

Replaces https://github.com/react/react-native/pull/57709, which identified a real bug in 0.87 from the combination of:

- https://github.com/react/react-native/pull/57276
- https://github.com/react/react-native/pull/57652

```
$ npx react-native spm add
error Cannot find module '.../node_modules/react-native/scripts/setup-apple-spm'

$ npx react-native codegen
error Cannot find module '.../node_modules/react-native/scripts/codegen/generate-artifacts-executor'
```

**This diff**

- Fix — and exclusively switch to — extensionless imports rather than requiring `.js`.
- Update in-repo consumers.

The previous single mapping is now an extension-aware mapping:
- `./scripts/*` now appends `.js`, so `react-native/scripts/foo` resolves to `foo.js`.
- `.sh` and `.rb` stay reachable via explicit `./scripts/*.sh` and `./scripts/*.rb` passthrough patterns.

**Impact**

- Explicit `react-native/scripts/*.js` specifiers no longer resolve, so JavaScript paths must be imported without an extension.
- Files under `scripts/` with extensions other than `.js`, `.sh`, or `.rb` are no longer exposed through `./scripts/*`.
    - These have no open source consumers.

Changelog:
[General][Fixed] - (RC4 only, drop for main changelog): `react-native/scripts/*` imports once again expand `.js` extensions
[General][Breaking] - Extensionless `react-native/scripts/*` imports are now **mandated**; explicit `.js` import specifiers are rejected.

Reviewed By: rubennorte

Differential Revision: D113898792

fbshipit-source-id: d72f60be2c08ab97871e336645856c9029e74ae2
2026-07-28 09:03:20 -07:00
Alex Hunt 89300acb9c Migrate Node.js builtin imports to node: scheme (#57611)
Summary:
Pull Request resolved: https://github.com/react/react-native/pull/57611

Directly follows D112733139 (Metro).

**Motivation**

- New Node builtins are *only* available under the prefix (e.g. `node:sqlite`), as this allows Node to introduce them without ecosystem-breaking changes, so this is the direction of travel and the only choice that'll allow consistency.
- Encouraging them and grouping them separately makes it easier to reason about a module's 3rd party dependencies.

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D112803684

fbshipit-source-id: 40668d746a7151b3aa4800ff8af997902a18d198
2026-07-21 09:01:41 -07:00
Rob Hogan fe511aba7c Bump Metro to 0.87.0 (#57534)
Summary:
Pull Request resolved: https://github.com/react/react-native/pull/57534

Bump Metro to 0.87.0

Changelog:
[General][Changed] Bump Metro to 0.87.0

Reviewed By: huntie

Differential Revision: D111711509

fbshipit-source-id: 800fa83127d88db77948dab20b3edb574ecb5fc0
2026-07-13 11:06:41 -07:00
Rob Hogan 2b0107e0aa Bump Metro to 0.86.0 (#57453)
Summary:
Pull Request resolved: https://github.com/react/react-native/pull/57453

Metro release notes:

https://github.com/react/metro/releases/tag/v0.86.0

Changelog:
[General][Changed] Metro to 0.86.0

Reviewed By: huntie

Differential Revision: D110789092

fbshipit-source-id: 4b999bf533c3c61b7915a73366ff3ca13257c3dc
2026-07-07 02:20:23 -07:00
Alex Hunt ae6a3afb22 Upgrade Metro to ^0.85.0 (#57335)
Summary:
Pull Request resolved: https://github.com/react/react-native/pull/57335

Changelog: [Internal] - Node 22 requirement is synchronised with RN for 0.87

Reviewed By: robhogan

Differential Revision: D109699796

fbshipit-source-id: 642373a6babc37ce3e9bc83676abd0aa09f54a85
2026-06-25 10:31:30 -07:00
Rob Hogan 27e83d0a95 Stop publishing @react-native/core-cli-utils (#57288)
Summary:
Pull Request resolved: https://github.com/react/react-native/pull/57288

https://github.com/facebook/react-native/pull/56922 intended to prevent this package publishing to npm but didn't - we've been continuing to publish it in nightlies.

`scripts/shared/monorepoUtils.js` filters with `packageJson.private !== true || includePrivate`, i.e. the `private` field is load-bearing, not the path. All other packages in `private/` have `package.json#private: true`.

Changelog: [Internal] - the breaking change is already noted in https://github.com/react/react-native/pull/56922 , no release / cut since.

Reviewed By: cortinico

Differential Revision: D109153641

fbshipit-source-id: f86ed921dbc7a6b020c57e7d18e6cae5c57b5f1e
2026-06-19 09:40:30 -07:00
Rob Hogan 0fc122c830 Add repository metadata to @react-native/core-cli-utils
Summary:
This package is published to npm, despite being under `private` - so I missed adding `repository` metadata to it as requried by trusted publish.

Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D109031681

fbshipit-source-id: 19ec7fbc63a50d13fbebf8e3c42f439038399ea5
2026-06-18 10:20:26 -07:00
Sam Zhou e0ed406590 Redo modern syntax rollout in react-native (#57034)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/57034

With D107165685, it should work this time.

Changelog: [Internal]

Reviewed By: gkz

Differential Revision: D107111468

fbshipit-source-id: 326b2911088d7c87c3564a578125eeaab9d0b8cc
2026-06-03 07:21:54 -07:00
Rubén Norte 833144fcec Revert recent Flow syntax codemods in react-native-github (#56998)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56998

Reverts the recent Flow syntax codemods applied across `packages/`, `private/`, and `scripts/` in react-native-github. Specifically restores the previous form for:

- `+T` / `+Instance` style variance annotations on generic type parameters that had been converted to the newer `out T` / `in T` keyword form.
- `+field:` covariant object/interface properties that had been converted to the `readonly field:` modifier form.
- `+[K in keyof T]:` mapped-type covariance that had been converted to `readonly [K in keyof T]:`.

These are purely Flow type-annotation changes with no runtime behavior impact, restoring the form that the rest of the toolchain (in particular Fantom) already supports.

Changelog: [Internal]

Reviewed By: christophpurrer

Differential Revision: D106813102

fbshipit-source-id: 6bf915d530e130eba9c9d96a2b6c3dc8853594d1
2026-05-29 14:09:58 -07:00
Marco Wang 88857d22f9 manually fix a few more files (#56983)
Summary:
X-link: https://github.com/facebook/metro/pull/1719

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

X-link: https://github.com/facebook/relay/pull/5300

skipped by codemod. Fixing them manually

Changelog: [Internal]

Reviewed By: gkz

Differential Revision: D106557702

fbshipit-source-id: 9228e5f8f855a362f72249117770d33d97bd4191
2026-05-28 17:37:32 -07:00
Alex Hunt 9c3fddf9cd Move core-cli-utils to private/ as a reference implementation (#56922)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/56922

Move `react-native/core-cli-utils` from `packages/` to `private/`, stop publishing it to npm, and reframe it as a reference implementation of React Native CLI tooling.

The package has no known external consumers and is only used internally by `private/helloworld/` and `packages/rn-tester/`. Publishing it to npm creates a maintenance surface for a package that serves no external users.

See https://github.com/react-native-community/discussions-and-proposals/pull/1002.

#### Changes

- Move `packages/core-cli-utils/` to `private/core-cli-utils/`.
- Convert all source files to CJS (require/module.exports) with Flow comment syntax (/*:: */), eliminating the runtime Babel dependency.
 - Remove from the JS build pipeline (`scripts/build/config.js`).
 - Remove the defunct `patchCoreCLIUtilsPackageJSON()` runtime patching from both `helloworld/cli.js` and `rn-tester/cli.js`, and delete both `monorepo.js` files that contained it.
  - Add as `devDependency` to `rn-tester` and `helloworld`.
  - Skip `"*"` version deps in `_prepareHelloWorld()` so they aren't rewritten to the Verdaccio-published version.
  - Remove redundant desktop import ignore entry (`private/**` already covers it).
  - Rewrite README as reference implementation documentation.

Changelog:
[General][Breaking] - The `react-native/core-cli-utils` package is no longer published. It remains available in the React Native repo as a reference implementation.

Reviewed By: cortinico

Differential Revision: D105959855

fbshipit-source-id: 42e439a45273bdeca76029eff306cdf2451308e2
2026-05-22 12:36:57 -07:00