Commit Graph

67 Commits

Author SHA1 Message Date
Vitali Zaidman 5cdfec9843 update metro version in react-native (#46264)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46264

React-native was not in sync with metro changes that RN relies on

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D61982240

fbshipit-source-id: 63b1f53174ab0ec663a537569a032c62c431eb83
2024-08-30 05:26:34 -07:00
Alex Hunt 94e7a87f23 Remove --experimental-debugger option (#46231)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/46231

Removes this option from `npx react-native start`. Flipper will no longer be the default launch flow in 0.76.

The debugger frontend variant remains controlled by `target.reactNative.capabilities?.prefersFuseboxFrontend`. This will always be Fusebox, since D60893243.

Changelog:
[General][Changed] Remove `--experimental-debugger` option from start command

Reviewed By: robhogan

Differential Revision: D61852415

fbshipit-source-id: 3351f0e12c24717916a70dd1ea28f8690bb5509f
2024-08-28 03:20:17 -07:00
Szymon Rybczak 396bdd87d8 fix: ensure --build-output destination exists (#45182)
Summary:
Replicates https://github.com/react-native-community/cli/commit/48d4c29bba4e8b16cbc8307bd1b4c5349f3651d8, which landed inside `cli-plugin-metro` inside RNC CLI, but because of migration of code to `community-cli-plugin` it looks like apparently the fix wasn't replicated.

## Changelog:

[GENERAL] [FIXED] - Ensure `--build-output` destination exists

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

Test Plan:
Specify a new directory that doesn't exists inside `--build-output`:

`npx react-native bundle --build-output dist/new-dir/index.bundle`

and this command shouldn't fail.

Reviewed By: christophpurrer

Differential Revision: D61850942

Pulled By: huntie

fbshipit-source-id: 90e57f19c661ace8206162d6fa2e6a27acb31e20
2024-08-27 09:04:14 -07:00
Blake Friedman 2ac997abcc Remove references to old template (#46082)
Summary:
## Summary
There are old references to the react-native/template. This code has
moved to react-native-community/template.

Changelog: [Internal]

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

Test Plan:
CI

closes facebook/metro#1324

Reviewed By: cipolleschi

Differential Revision: D61472439

Pulled By: blakef

fbshipit-source-id: fc40145c03002a7c3117b72d07981a96aa3d8760
2024-08-19 09:19:35 -07:00
wh201906 6390cf67d0 Add upper case keys to the debug key handler (#45559)
Summary:
The CLI of Metro bundler only accepts key presses when the Caps Lock is off. This is somehow inconvenient because the developers might think the Metro bundler doesn't response when the Caps Lock is on.

## Changelog:

<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
-->

[GENERAL] [ADDED] - Add upper case keys to the debug key handler

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

Test Plan: n/a

Reviewed By: huntie

Differential Revision: D60107316

Pulled By: dmytrorykun

fbshipit-source-id: 045dcd382d84c4781dff75a1ff913cd3ccc8d288
2024-07-23 03:57:39 -07:00
Blake Friedman 24997dc5ae allow use without @react-native-community/cli-server-api (#45311)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45311

Allows Gradle and Xcode builds to continue without the rnc dependency.

Reviewed By: cipolleschi

Differential Revision: D59377223

fbshipit-source-id: b0daddae7377b8a0d2ee2a25b2ff10124e5db549
2024-07-15 09:28:58 -07:00
Blake Friedman 9aaadd9b2e remove rnc/cli-tools version & errors deps (#45380)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45380

Removed the use of version checking and error code that is in react-native-community/cli-tools.

Changelog:
[Internal] [Changed] - Removed community-cli-plugin version & error dependencies

Reviewed By: robhogan

Differential Revision: D59378012

fbshipit-source-id: b009edc615b873ff2bff31296ac5d87a4482944f
2024-07-15 04:35:26 -07:00
Blake Friedman 6547b157b5 Remove dependency on rnc/cli-tools logger (#45381)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45381

Removing the remaining dependencies from the react-native-community/*. This
inlines a copy of the logger.

Changelog:
[Internal][Changed] Removed react-native-community/cli-tools logger dependency

Reviewed By: cipolleschi

Differential Revision: D59378011

fbshipit-source-id: ef93d9fff1c623658e33c36b6329f5d548f649e8
2024-07-15 04:35:26 -07:00
szymonrybczak d1bf828398 fix(cli): replace querystring with URLSearchParam (#45125)
Summary:
[`querystring`](https://www.npmjs.com/package/querystring) package is deprecated. In this Pull Request I've replaced usage of `querystring` with `URLSearchParam` what is recommended by Node.js.

It's also causing a warning when installing dependencies inside a React Native app:
```
warning react-native > react-native/community-cli-plugin > querystring@0.2.1: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
```

## Changelog:

[INTERNAL] [FIXED] - Replace `querystring` package with `URLSearchParam`

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

Test Plan:
Params should be parsed in the same way and warning shouldn't be presented.

js1 jest xplat/js/tools/metro/packages/metro/src/cli/__tests__/parseKeyValueParamArray-test.js

Reviewed By: cipolleschi

Differential Revision: D58948498

Pulled By: GijsWeterings

fbshipit-source-id: 79b1f7b3feae230d2d3641205c513b98b3fda511
2024-07-04 08:04:56 -07:00
Sam Zhou 3c6762a5f8 Pre-suppress errors ahead of v0.239 release
Summary: Changelog: [Internal]

Reviewed By: mvitousek

Differential Revision: D59308716

fbshipit-source-id: d741ee004e153810fc913da96505706e43814ec1
2024-07-02 23:37:15 -07:00
Riccardo Cipolleschi c0b5e2e031 Bump CLI dependencies to alpha.11 (#45179)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45179

## Changelog:
[General][Changed] - Bumps the CLI to alpha 11

Reviewed By: cortinico

Differential Revision: D59055459

fbshipit-source-id: 3bebe80d0cf6e7af8d7f74f3a5e4e2ccc91cf419
2024-06-27 04:11:44 -07:00
Alex Hunt ebf1a7b79b Bump packages for next major release (#45015)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45015

Set package versions to `0.76.0-main` (`0.75-stable` branch was cut).

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D58687399

fbshipit-source-id: 27ed987e4557705845d57d64e7547cddbd982a03
2024-06-26 07:59:49 -07:00
Nicola Corti 61b3c95b45 Bump CLI to 14 alpha9 (#45121)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/45121

As the title says

Changelog:
[Internal] [Changed] - Bump CLI to 14 alpha9

Reviewed By: cipolleschi, blakef

Differential Revision: D58945983

fbshipit-source-id: 227b56bb0441a60ce247524ac8361e5eb8674c3c
2024-06-24 06:51:29 -07:00
Afonso 0950916846 Fix custom port listening configuration through metro.config.js (#44957)
Summary:
After updating my project to 0.73.2 I noticed that even though I had a specific port set in my `metro.config.js`, every time I'd start my project, it was running on port 8081. Passing the `--port` argument would allow me to change the port, but the config from metro did not.  I checked if the metro config was being properly applied, using `--verbose` and it was.

So I dug a bit, trying to figure out what had changed and noticed the coalescing of the value, whenever the argument `--port` is not present. That seemed odd since it meant that there's always a port defined for the `options` of `loadMetroConfig`, which would always be used in the `loadConfig` step.

To confirm I was on the right track I went to the [cli-plugin-metro](https://github.com/react-native-community/cli/blob/v11.3.10/packages/cli-plugin-metro) repo, to the last release before the move here, and noticed that there was [no coalescing in the same method](https://github.com/react-native-community/cli/blob/v11.3.10/packages/cli-plugin-metro/src/commands/start/runServer.ts#L60).

In this PR, I remove the coalescing of the port from `runServer.js` from the `community-cli-plugin`, to allow the port configuration through `metro.config.js`.

## Changelog:
[INTERNAL] [FIXED] - Fix server port configuration via `metro.config.js`
<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests

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

Test Plan:
Running `yarn start` and verifying that:
- it would listen to port `8081` if no argument nor a custom port was set in `metro.config.js`
- it would listen to port `8082` if that one was defined in `metro.config.js`
- it would listend to port `8083` if that port was passed as an argument to the command (i.e. `yarn start --port 8083` even though port 8082 was defined in `metro.config.js`

Reviewed By: cortinico

Differential Revision: D58605152

Pulled By: robhogan

fbshipit-source-id: 9cf7a8b6a0d9de3af1ca4092906b4c648acee373
2024-06-17 05:52:16 -07:00
Alex Hunt a569c82eb5 Back out "chore(dev-middleware): add localhost as default host in start command config" (#44800)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44800

This is a revert of https://github.com/facebook/react-native/pull/44244, as we've observed [breaking behaviour](https://github.com/facebook/react-native/pull/44244#issuecomment-2078957734) where Android emulators could not connect to the dev server with default settings.

The team doesn't have bandwidth/prio to figure this out with the default `host` value just now, so we are reverting.

Changelog: [Internal] (Nullifies c402dcf)

Reviewed By: cipolleschi

Differential Revision: D58192651

fbshipit-source-id: dd2183d6baa6499ab59e21365adfe62e7a786dfc
2024-06-05 09:48:16 -07:00
Blake Friedman 3ddf509924 Back out "conditional Babel registration no longer necessary"
Summary:
Original commit changeset: 6bec706c639f

Original Phabricator Diff: D56839521

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D57052476

fbshipit-source-id: 7c598f43b23959f1accf555be38abc95e4ef35fd
2024-05-07 08:36:04 -07:00
Blake Friedman 47848ad15f conditional Babel registration no longer necessary (#44362)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44362

Packages that are built and directly run in the monorepo no longer need to worry about
conditionally registering themselves to transpile Flow -> JS at runtime. Our build step
strips this file now.

Changelog: [Internal] changes in published packages no longer require conditional calls to Babel register.

Reviewed By: huntie

Differential Revision: D56839521

fbshipit-source-id: 6bec706c639f1ab4138e0b790be8a07654333046
2024-05-07 03:16:00 -07:00
Blake Friedman c754755cd8 CLI supports ordering of tasks
Summary:
This gives Frameworks more control in selecting specific tasks and integrating the return types data in their UI.  For example piping `stdout` to the user or using packages like [Listr2](https://www.npmjs.com/package/listr2) to run tasks in parallel and show progress.

The ordering is suggestive (but also enforced by some assertions).  Frameworks are free to do what they want.

The order was implicit in the previous data structure with lists of Tasks, but made it difficult to tap into each async task.

I've also had to rework how we transpile the code if directly executed from the monorepo.  This keeps our:
- flow types valid,
- allows the core-cli-utils package to be built (to generate TypeScript types and a valid npm module), and
- allows direct transpiled execution as a yarn script.

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D56242487

fbshipit-source-id: a1a18f14a4aef53a98770462c8ebdef4111f0ab4
2024-04-29 05:04:26 -07:00
szymonrybczak c402dcfe57 chore(dev-middleware): add localhost as default host in start command config (#44244)
Summary:
Inside [Re.Pack](https://github.com/callstack/repack) we consume command's options, to reduce the amount of assumptions that 3rd party tools need to make - we can move assigning default value to config command level, so default values will be aligned across tools.

For default `start` command this change doesn't change any behaviour.

## Changelog:

[INTERNAL] [CHANGED] - Add `localhost` as default host in `start` command config

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

Test Plan: `start` command should work the same way as before.

Reviewed By: huntie

Differential Revision: D56567793

Pulled By: blakef

fbshipit-source-id: fe8f3686ae39a3d2996de11930a0d03364692adc
2024-04-25 03:01:51 -07:00
szymonrybczak 32c2322668 Upgrade @react-native-community/cli to v14.0.0-alpha.2 (#43682)
Summary:
Upgrade `react-native-community/cli` to v14.0.0-alpha.2

## Changelog:

[GENERAL] [CHANGED] - Upgrade `react-native-community/cli` to v14.0.0-alpha.2

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

Test Plan: CI

Reviewed By: cortinico

Differential Revision: D55430957

Pulled By: zeyap

fbshipit-source-id: 5b715b4b1e79ee81df922be6ab2b5b8b2315456d
2024-03-28 07:40:16 -07:00
Blake Friedman a380ea55fb Summary: minor fix found in nightly logs from Publish NPM job (#43519)
Summary:
Minor fix to package.json which newer version of npm warn about when publishing, after running `npm pkg fix -ws` on the workspace.

{F1470070110}

## Changelog: [Internal] npm pkg fix -ws

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

Test Plan: eyescloseddog

Reviewed By: cortinico

Differential Revision: D55012872

Pulled By: blakef

fbshipit-source-id: ff3c63a3eefaf56d369219a3d4b32d44d6d842c9
2024-03-18 08:29:10 -07:00
szymonrybczak 7a00623947 Update @react-native-community/cli to 14.0.0-alpha.0 (#43415)
Summary:
Updates CLI to 14.0.0-alpha.0

## Changelog:

[GENERAL] [CHANGED] - Update `react-native-community/cli` to 14.0.0-alpha.0

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

Test Plan: CI

Reviewed By: cortinico

Differential Revision: D54760054

Pulled By: huntie

fbshipit-source-id: c4e29e2122c5de0ff60f9c52bd6f9a86ce0a5560
2024-03-12 06:18:30 -07:00
Alex Hunt f57be12977 Bump packages for next major release (#43132)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43132

Command run:

```
node scripts/releases/set-version 0.75.0-main --skip-react-native-version
```

Changelog: [Internal]

Reviewed By: lunaleaps, cipolleschi

Differential Revision: D54006327

fbshipit-source-id: 7afe9e7ca3020faf399fdba2221fab8a102c56c7
2024-03-04 07:54:37 -08:00
Blake Friedman 58b45e86a6 Remove RFC-0759 ram-bundle command from cli (#43292)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43292

The ram-bundle command isn't necessary now that Hermes is our default VM.  The RFC specifically calls for the CLI command to be removed [1].

[1] https://github.com/react-native-community/discussions-and-proposals/blob/main/proposals/0759-react-native-frameworks.md#commands-to-be-removed

Changelog:
[General][Removed] - RFC-0759 remove ram-bundle command.

Reviewed By: NickGerleman, cipolleschi

Differential Revision: D54430289

fbshipit-source-id: 49d519c007b739f89ffe9032fec905c56ea49f4a
2024-03-04 04:47:34 -08:00
Nicola Corti 2647dc8c39 Bump CLI to 13.6.1 (#43153)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/43153

This contains an hotfix for the CLI needed for 0.74

Changelog:
[Internal] [Changed] - Bump CLI to 13.6.1

Reviewed By: huntie

Differential Revision: D54073715

fbshipit-source-id: a5fdf02f47c5e144efc58e6b7fd355669a21e07b
2024-02-23 06:14:29 -08:00
szymonrybczak c99d96b7a1 Bump CLI to 13.6.0 (#43093)
Summary:
Bump CLI version to 13.6.0

## Changelog:

[GENERAL] [CHANGED] - Bump CLI to 13.6.0

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

Test Plan: CI

Reviewed By: cipolleschi

Differential Revision: D53920559

Pulled By: cortinico

fbshipit-source-id: 7c95345f47c80864881fff7fce5adb35195ec723
2024-02-20 07:04:33 -08:00
Edmond Chui 635732aa8f Fix order of Metro hotkey console messages (#42896)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42896

Changelog:
[General][Fixed] Fix order of Metro hotkey console messages

# Existing

Key handler is printing messages to the console _after_ it has been processed, this causes error messages to appear before the `info` message.

# In this PR

The `info` messages are logged before the event is processed.

Reviewed By: GijsWeterings

Differential Revision: D53479732

fbshipit-source-id: 25af47450662de4eb03d0dfd52af5af014ef3e49
2024-02-07 07:44:24 -08:00
Tommy Nguyen e350859d72 fix: cannot find module react-native-*/Libraries/Core/InitializeCore (#42875)
Summary:
`react-native/community-cli-plugin` is unable to resolve out-of-tree platforms in monorepos because the package may not be hoisted to the same location. For example, if `react-native/community-cli-plugin` was hoisted:

```
/~/node_modules/react-native/community-cli-plugin/dist/utils
```

It may never find `react-native-macos` if it wasn't hoisted:

```
/~/packages/my-app/node_modules/react-native-macos
```

## Changelog:

[GENERAL] [FIXED] - Fix `react-native/community-cli-plugin` is unable to resolve out-of-tree platforms in monorepos

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

Test Plan: Tested in an internal project.

Reviewed By: cipolleschi

Differential Revision: D53426607

Pulled By: robhogan

fbshipit-source-id: 29b9fe92d5773d0160bba375d2e92ec688652e3e
2024-02-05 09:56:10 -08:00
HoonJoo 6f7e8e17e2 fix: community cli plugin homepage url in package.json (#42696)
Summary:
fixed homepage url in package.json file of community cli plugin.

## Changelog:
[GENERAL][CHANGED] - changed community cli plugin homepage url.
<!-- Help reviewers and the release process by writing your own changelog entry.

Pick one each for the category and type tags:

[ANDROID|GENERAL|IOS|INTERNAL] [BREAKING|ADDED|CHANGED|DEPRECATED|REMOVED|FIXED|SECURITY] - Message

For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests

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

Test Plan: community-cli-plugin homepage url must be opened correctly.

Reviewed By: rubennorte

Differential Revision: D53179709

Pulled By: huntie

fbshipit-source-id: 7949a897d4fe1da228fce323fa8bb32640194273
2024-01-29 07:36:45 -08:00
szymonrybczak 78967b33c0 Bump CLI to 13.5.1 (#42183)
Summary:
Updates CLI to v13.5.1.

## Changelog:

[GENERAL] [CHANGED] - Bump CLI to 13.5.1

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

Test Plan: CI

Reviewed By: christophpurrer

Differential Revision: D52600707

Pulled By: huntie

fbshipit-source-id: f314a405d8d7e9200595b42b62d354e61f0a2964
2024-01-25 02:32:45 -08:00
Alex Hunt 4e92f87dfd Align parsing of custom resolver options, rename arg (#42392)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42392

Follow-up to https://github.com/facebook/react-native/pull/42333 following internal feedback. We are now aligning this to match the [`metro build` command](https://github.com/facebook/metro/blob/702e1b8fc7ab8b973bcd53f1a41f7e797cbf7dca/packages/metro/src/commands/build.js#L85-L91). This also improves validation on parsing (done after initial `commander` arg parsing as variadic string).

Changelog: [Internal]
(same as https://github.com/facebook/react-native/pull/42333)

Reviewed By: motiz88

Differential Revision: D52911017

fbshipit-source-id: 54049aa20c9db344a0f485fddf62fb267e672376
2024-01-22 10:31:51 -08:00
Saad Najmi 6d77d7b895 Format package.json files in the monorepo (#42256)
Summary:
Over in React Native macOS land, I opened https://github.com/microsoft/react-native-macos/pull/2030 to update our mono repo to use Yarn 4. As a side effect, all the `package.json` files are formatted as a side effect of running `yarn install`. So that React Native macOS doesn't maintain this diff (and because they should only be good / no harm), let's upstream the formatting changes.

## Changelog:

[INTERNAL] [CHANGED] - Format package.json files in the monorepo

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

Test Plan: This change should be a no-op, CI should pass.

Reviewed By: cortinico

Differential Revision: D52727623

Pulled By: huntie

fbshipit-source-id: 67862b16d576b0903abd91e016d7add4c19853dc
2024-01-22 07:15:05 -08:00
Szymon Rybczak 31a162f48c feat: add --custom-resolver-options to bundle command (#42333)
Summary:
Added `--custom-resolver-options` to `--bundle` command. This options is also [available](https://github.com/facebook/metro/blob/main/docs/CLI.md#options) in Metro's CLI.

## Changelog:

[INTERNAL] [ADDED] - Add `--resolver-options` to `bundle` command

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

Test Plan:
1. Build all packages by running `yarn build` in the root
2. Go to `packages/rn-tester` and run `npx react-native bundle --custom-resolver-options key=value` and the options should be passed to the Config.

Reviewed By: blakef

Differential Revision: D52869452

Pulled By: huntie

fbshipit-source-id: 9a2c2d94b72cfb47477cf58b9c0472c5a8551c84
2024-01-18 04:51:39 -08:00
Alex Hunt 16dff523b0 Bump Metro to ^0.80.3 (#42139)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42139

Bump to the latest Metro release.

Metro release notes: https://github.com/facebook/metro/releases/tag/v0.80.3

Changelog:
[General][Changed] - Bump Metro to ^v0.80.3

Reviewed By: GijsWeterings

Differential Revision: D52520542

fbshipit-source-id: 3c089e3f033a4d0597e9adb50d3377f1ad822743
2024-01-05 03:06:03 -08:00
Luna Wei 6e5bc33b3c Remove caret from monorepo dependencies (#42086)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/42086

Changelog: [General][Changed] - Update monorepo dependency versions to remove ^

This change will remove the caret for now as we already perform an "align" step everytime we bump a monorepo library. This prevents monorepo library updates to affect existing releases.

The "align" step updates all monorepo libraries to use the updated bumped version: https://fburl.com/code/xfistiph

Reviewed By: huntie

Differential Revision: D52440454

fbshipit-source-id: ff071032f04bc554903dde153c594991163dfe2f
2024-01-02 13:02:29 -08:00
Janic Duplessis d5114a4b9f Fix cleanAssetCatalog error (#41865)
Summary:
There is currently an error when building in release on iOS when using asset catalogs (experimental feature that is partially merged https://github.com/facebook/react-native/pull/30129)

This was probably incorrectly migrated from the community cli repo. `.imageset` is actually folders so it needs to be removed with `{recursive: true, force: true}`. I also renamed the variable `files` which is confusing since its folders.

## Changelog:

[IOS] [FIXED] - Fix cleanAssetCatalog error

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

Test Plan: Tested in an app that uses asset catalogs

Reviewed By: NickGerleman

Differential Revision: D52032258

Pulled By: huntie

fbshipit-source-id: 1dc0ca09e0da0d514b03d7d72707bdcaef03301d
2023-12-12 13:34:19 -08:00
Michał Pierzchała 6e88d67b8c Bump CLI to 13.0.0 (#41722)
Summary:
Updates the RN CLI to v13.0.0, which targets main and future 0.74

## Changelog:

[GENERAL] [CHANGED] - Bump CLI to v13.0.0

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

Reviewed By: robhogan

Differential Revision: D51809848

Pulled By: huntie

fbshipit-source-id: 653d747526bec5c4f766c22ffd3fcae8eac620a0
2023-12-10 18:13:00 -08:00
Oskar Kwaśniewski 4ccd6e1242 feat: allow OOT platforms to use custom resolver.resolveRequest (#41697)
Summary:
Currently, when we have an additional platform in `react-native.config.js`, users cannot use custom `resolver.resolveRequest` functions as they are overwritten by `reactNativePlatformResolver`. Goal of this PR is to allow OOT platforms to use additional custom resolvers besides remapping react native imports.

## Changelog:

[GENERAL] [FIXED] - Allow Out Of Tree platforms to pass custom resolvers

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

Test Plan:
1. Add additional platform in `react-native.config.js`
2. Pass custom resolver to `metro.config.js`:

```js
resolveRequest: (context, moduleName, platform) => {
      console.log('resolveRequest', moduleName, platform);
      return context.resolveRequest(context, moduleName, platform);
 }
```
3. Check if user's `resolveRequest` function is called.

Reviewed By: huntie

Differential Revision: D51659721

Pulled By: robhogan

fbshipit-source-id: 952589b59a6fa34e9406d36c900be53a7c1a79c3
2023-11-29 05:53:54 -08:00
Moti Zilberman d6e0bc714a Enable lint/sort-imports everywhere (#41334)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41334

TSIA.

Changelog: [Internal]

Reviewed By: robhogan

Differential Revision: D51025812

fbshipit-source-id: e10d437be775a6b80946483aa96460f34927f870
2023-11-06 12:59:38 -08:00
szymonrybczak d077239fff Upgrade CLI to v12.0.0 (#41249)
Summary:
Related https://github.com/react-native-community/cli/issues/2143

## Changelog:

[General] [Changed] - Upgrade CLI to v12.0.0

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

Test Plan: CI

Reviewed By: NickGerleman

Differential Revision: D50810438

Pulled By: lunaleaps

fbshipit-source-id: de96015557019446d268489c5ae534c255b3ddc8
2023-11-04 00:04:33 -07:00
Rob Hogan 7853b06929 Update Metro to ^0.80.0 - don't pin to exact version (#41219)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/41219

Bump to the latest Metro release. This includes minor breaking changes to Metro subpackages that should *not* be visible to RN users.

Metro release notes: https://github.com/facebook/metro/releases/tag/v0.80.0

## Moving to unpinned versioning
Metro is a multi-package project, and not pinning to an exact version means multiple versions of `metro*` packages may appear in an RN project.

This isn't unusual in the NPM ecosystem and *shouldn't* be a problem, but historically has caused issues (eg https://github.com/facebook/react-native/issues/34714, https://github.com/facebook/metro/issues/1017). The root cause of all of these issues, as far as we know, was fixed in https://github.com/facebook/metro/commit/6d46078e74ae9a43aa90bed46dbd6610e2696cd0, a bug where Node hierarchical resolution was effectively sidestepped via a relative worker path, resulting in a mismatch between transformer and host process.

In addition, the fact that `react-refresh`, `metro-react-native-babel-transformer` and `metro-react-native-babel-preset` are now fully moved into the `react-native/` scope and versioned with React Native means there are no circular dependencies between React Native and Metro, explicit or implicit, and we're much more clearly decoupled.

So, we're moving to caret versioning to allow React Native users to pick up Metro fixes and features without requiring React Native releases and user upgrades.

Changelog:
[General][Changed] - Update Metro to ^v0.80.0, stop pinning to an exact version

Reviewed By: GijsWeterings

Differential Revision: D50731999

fbshipit-source-id: 57b07bf73c0b31f392c4d36376ca48b48a8bd598
2023-10-27 10:42:46 -07:00
Alex Hunt 8c36aaa2db Add "Hermes only" to open debugger key prompt
Summary: Changelog: [Internal]

Reviewed By: cortinico

Differential Revision: D50327180

fbshipit-source-id: 6ee08fadd313828ddbc7702d5b3b1174a91b1ac1
2023-10-17 02:57:55 -07:00
Alex Hunt fb6ac26e40 Refactor dev server URL creation creation to use url.format (#39503)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39503

Changelog: [Internal]

Reviewed By: blakef

Differential Revision: D49317314

fbshipit-source-id: 85b71340686a1cd19d63a7e73a5388a803d22c42
2023-10-16 09:42:52 -07:00
Alex Hunt 79ded77fcd Disable --experimental-debugger by default (#40795)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/40795

Changelog: [Internal]

Reviewed By: hoxyq

Differential Revision: D50178494

fbshipit-source-id: b833b6accadd2902d97a45e030cd48d1b62ac438
2023-10-12 05:26:11 -07:00
Alex Hunt f40bb9331c Bump package versions for next major (#39764)
Summary:
#publish-packages-to-npm

Bump all package versions to `0.74.0` (next major release) for `main`, following instructions at https://reactnative.dev/contributing/release-branch-cut-and-rc0#12-bump-minor-version-of-all-monorepo-packages-in-main.

```sh
yarn bump-all-updated-packages --release-branch-cutoff
```

Changelog: [Internal]

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

Test Plan: —

Reviewed By: robhogan

Differential Revision: D49871039

Pulled By: huntie

fbshipit-source-id: f4df6efeae4d8a9209e7aae7b9e6fea3d15793b5
2023-10-11 08:36:23 -07:00
Alex Hunt 9e068ac163 Add --experimental-debugger-frontend flag, restore 0.72 flow as base (#40766)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/40766

This changeset allows users to opt into the new debugger frontend experience by passing `--experimental-debugger` to `react-native start`. **We are defaulting this option to `true`** for now, but will continue to evaluate this feature before 0.73 ships. It restores Flipper (via `flipper://`) as the default handling for `/open-debugger` (matching 0.72 behaviour) when this flag is not enabled.

Detailed changes:

- Replaces `enableCustomDebuggerFrontend` experiment in `dev-middleware` with `enableNewDebugger`. The latter now hard-swaps between the Flipper and new launch flows.
    - Removes now-unused switching of `devtoolsFrontendUrl`.
- Implements `deprecated_openFlipperMiddleware` (matching previous RN CLI implementation).
- Disables "`j` to debug" key handler by default.
- Marks "`j` to debug" and `/open-debugger` console logs as experimental.

Changelog:
[Changed][General] Gate new debugger frontend behind `--experimental-debugger` flag, restore Flipper as base launch flow

Reviewed By: motiz88

Differential Revision: D50084590

fbshipit-source-id: 5234634f20110cb7933b1787bd2c86f645411fff
2023-10-10 09:37:41 -07:00
Alex Hunt e1f21fcc4c Fix start command exit behaviour (#39788)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39788

Hotfix for exiting `npx react-native start` when a session is connected. Partially reverts D49422206.

This lines back up with the original RN CLI and Expo implementations — explicitly calling `process.exit()`. We still aim to follow this up with graceful server shutdown.

Changelog: [Internal]

Reviewed By: lunaleaps

Differential Revision: D49880226

fbshipit-source-id: d2c76b2de21b9172dfd892141d1f679b808e043d
2023-10-03 16:21:58 -07:00
Alex Hunt 1e44a5f518 Bump CLI to 12.0.0-alpha.15 (#39576)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39576

Changelog: [Internal]

Reviewed By: cipolleschi

Differential Revision: D49496981

fbshipit-source-id: bae2a5fed9d795afcd58e8e24c3ff47c01707d4e
2023-09-21 10:18:51 -07:00
Alex Hunt 196b3f9ef9 Improve start command interactive behaviour (#39544)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39544

Misc improvements to `npx react-native start` interactive behaviour:

- Attaches key handlers on Metro `initialize_done` event — printing key command info earlier (once the server starts listening to bundle requests).
- Shutdown behaviour:
    - Awaits closing of Metro's HTTP server.
    - Pauses key listener while awaiting shutdown (dependency on `cli-tools` `addInteractionListener` dropped).
    - Now observes `ctrl+d` (`ctrl+z` pause behaviour removed).
- Updates reload handler message to 'Reloading connected app(s)...' (since ).
- Adds newline below key commands printout (even spacing).

Changelog: [Internal]

Reviewed By: NickGerleman

Differential Revision: D49422206

fbshipit-source-id: 8963b22ddb182df7a1116906fc63cc65bfe982fc
2023-09-20 03:47:13 -07:00
Arushi Kesarwani 982f6f99d4 Upgrade Metro to 0.79.1 in RN (#39273)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/39273

Upgrade Metro dependencies to 0.79.1 in `react-native`

This includes Metro breaking changes for disabling global package resolution by default and adds features like: Haste packages, enable resolution through symlinks and passing custom customTransformOptions and customResolverOptions to bundle_build_started log event so as to refine the bundling message. It also fixes arbitrary transformation of Babel plugins during registration in `metro-babel-register` and fixes "unexpected null" crash when handling a batch of file changes and symlinks with indirections.

**Full Metro Changelog:** https://github.com/facebook/metro/releases/tag/v0.79.1
https://github.com/facebook/metro/releases/tag/v0.79.0

Changelog:
[General][Changed] Upgraded Metro to 0.79.1

Reviewed By: motiz88, mdvacca

Differential Revision: D48922815

fbshipit-source-id: 37aea6194fe587e0d094c96ceec1122c588f0fbb
2023-09-19 21:42:33 -07:00