Skip to content

chore: Upgrade Metro to 0.78.0#2047

Merged
thymikee merged 1 commit into
react-native-community:mainfrom
motiz88:metro-0.78.0
Aug 9, 2023
Merged

chore: Upgrade Metro to 0.78.0#2047
thymikee merged 1 commit into
react-native-community:mainfrom
motiz88:metro-0.78.0

Conversation

@motiz88

@motiz88 motiz88 commented Aug 7, 2023

Copy link
Copy Markdown
Collaborator

Upgrades Metro to 0.78.0, removes the unreferenced dependencies on metro-react-native-babel-transformer and metro-runtime, and demotes metro-resolver to a devDependency (as it is used only for types).

Metro 0.78.0 contains the following breaking changes that we do not believe are breaking for CLI users:

  • [Breaking] Update default server port to 8081. (react/metro@891fe96 by @huntie)
  • [Breaking] Remove metro-react-native-babel-transformer and metro-react-native-babel-preset, which will be published as @react-native/metro-babel-transformer and @react-native/babel-preset going forward. (react/metro@799aa0a by @dmytrorykun)
  • [Breaking] Remove runInspectorProxy option from server. (react/metro@2b0b15d by @huntie)
  • [Breaking]: DependencyGraph.resolveDependency now takes a dependency object instead of a string. (react/metro@fbdd295 by @motiz88)
  • [Breaking]: Stop passing inlineRequires and nonInlinedRequires to Babel transformers. (react/metro@e339c8f by @motiz88)
    • Note that this merely removes a confusing, dead API from Metro. It does not functionally change how inline requires work in React Native.

See https://github.com/facebook/metro/releases/tag/v0.78.0 for the full changelog.

As a reminder, when updating the CLI version in React Native, metro-runtime and other Metro dependencies declared directly by React Native must be updated and pinned to the exact version used in the CLI (e.g. here "0.78.0").

@szymonrybczak

Copy link
Copy Markdown
Collaborator

Since the default port is 8081, do we want to delete adding default port on CLI side?

@huntie

huntie commented Aug 8, 2023

Copy link
Copy Markdown
Collaborator

@szymonrybczak Yes, we can :). I haven't tackled this personally yet as there is the .packager.env/RCT_METRO_PORT setup which people may rely on (note: this may be slightly simplified since react/react-native#38242). But we can certainly remove any internally set defaults from CLI 👍🏻. Non-urgent.

@thymikee thymikee merged commit 9f45bea into react-native-community:main Aug 9, 2023
huntie added a commit to huntie/react-native that referenced this pull request Aug 15, 2023
Summary:
Pull Request resolved: react#38944

- Update `cli-commands` package to reflect latest source `react-native-community/cli-plugin-metro` changes.
	- react-native-community/cli#2021
	- react-native-community/cli#2024
	- react-native-community/cli#2043
	- react-native-community/cli#2047

### To do

WARNING: ~~This PR is non-functional until the next CLI alpha is published and bumped in `package.json` — since it depends on corresponding new APIs in `react-native-community/cli-tools` (react-native-community/cli#2021). This package (and the upcoming work which integrates it) has been tested against locally linked copies of latest CLI.~~

- [x] Bump CLI dependencies when next alpha published.
- [x] Ensure Metro bump from `0.77.0` to `0.78.0` is consistently applied with this.

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D48066179

fbshipit-source-id: 393a6ebb06be94fb331908a47c8d409f64e63f77
facebook-github-bot pushed a commit to react/react-native that referenced this pull request Aug 15, 2023
Summary:
Pull Request resolved: #38944

- Update `cli-commands` package to reflect latest source `react-native-community/cli-plugin-metro` changes.
	- react-native-community/cli#2021
	- react-native-community/cli#2024
	- react-native-community/cli#2043
	- react-native-community/cli#2047

### To do

WARNING: ~~This PR is non-functional until the next CLI alpha is published and bumped in `package.json` — since it depends on corresponding new APIs in `react-native-community/cli-tools` (react-native-community/cli#2021). This package (and the upcoming work which integrates it) has been tested against locally linked copies of latest CLI.~~

- [x] Bump CLI dependencies when next alpha published.
- [x] Ensure Metro bump from `0.77.0` to `0.78.0` is consistently applied with this.

Changelog: [Internal]

Reviewed By: motiz88

Differential Revision: D48066179

fbshipit-source-id: b3dc8891cf33e537788f942dcaddff4d2f11a31f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants