Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump RN CLI, add @react-native/metro-config to template (#36623) #36697

Closed
wants to merge 1 commit into from

Conversation

huntie
Copy link
Member

@huntie huntie commented Mar 29, 2023

Clone of #36623, recreating because GitHub is no longer observing new commits on the forked repo.

Aiming to have this PR re-validate CI, then I will close.

Changelog:
[General][Changed] - The default metro.config.js in apps now extends @react-native/metro-config, and should be updated in existing apps.

Summary

Test Plan

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Facebook Partner: Facebook Partner labels Mar 29, 2023
@github-actions
Copy link

github-actions bot commented Mar 29, 2023

Warnings
⚠️ 🔒 package.json - Changes were made to package.json. This will require a manual import by a Facebook employee.

Generated by 🚫 dangerJS against 96c5216

@analysis-bot
Copy link

analysis-bot commented Mar 29, 2023

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 8,567,998 +20,323
android hermes armeabi-v7a 7,882,380 +20,327
android hermes x86 9,049,909 +20,327
android hermes x86_64 8,904,959 +20,319
android jsc arm64-v8a 9,166,319 -1,441
android jsc armeabi-v7a 8,356,735 -1,433
android jsc x86 9,222,992 -1,439
android jsc x86_64 9,480,861 -1,430

Base commit: e5dd9cd
Branch: main

Summary:
Pull Request resolved: facebook#36623

Changelog:
[General][Changed] - The default `metro.config.js` in apps now extends `react-native/metro-config`, and should be updated in existing apps.

~~`react-native/rn-get-polyfills.js` is removed and should be updated to `react-native/js-polyfills` in existing apps (this is part of the new default config).~~

#publish-packages-to-npm

## Context

### React Native Metro config → React Native repo (facebook#36502)

We (the React Native team) are aiming to relocate the default Metro config for React Native out of `react-native-community/cli-plugin-metro` and **into the React Native repo + app template** as a new `react-native/metro-config` package.

This is the first (and minimum viable) phase we can ship to separate the release process of Metro from RN CLI in order to reduce coupling and iterate faster for our users.

**See full motivation, design, and test plan (which previewed the CLI bump) here: facebook#36502

## Changes

NOTE: This PR is pending the inclusion of a bump to `react-native-community/cli`, and will be sequenced after react-native-community/cli#1875 is merged.

- Upgrade `react-native-community/cli` to `11.0.0`, upgrade all `metro` packages to `0.76.0` (version distributed in this CLI release).
- Update the `metro.config.js` file in `packages/react-native/template/`.
    - Now merges defaults from `react-native/metro-config`, and can be used with CLI >= 11.0.0.
- Update the `metro.config.js` files for `packages/react-native/` and `packages/rn-tester/` (these are integration test locations).
    - Now merges defaults from `react-native/metro-config`, and can be used with CLI >= 11.0.0.

Changes to `react-native/metro-config` — `0.72.1` (prepared but not depended on yet):

- Export `mergeConfig` util (removing direct `metro-config` dependency in consuming projects).
- Explicitly depend on `metro-react-native-babel-transformer` and `metro-runtime` (transitively included today).

Reviewed By: cortinico, blakef

Differential Revision: D44099691

fbshipit-source-id: 283f5b4a9df005034e9c671a37a3d75b825f10b8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Facebook Partner: Facebook Partner
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants