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

feat: Add alternative base config check to loadMetroConfig (11.x) #1990

Conversation

huntie
Copy link
Collaborator

@huntie huntie commented Jun 29, 2023

Summary

Resolves #1987.

Adds improved check to detect if @react-native/metro-config (containing the base Metro config for all non-Expo React Native apps — and including rnx-kit) has been loaded for a given project. Paired with change:

Since we cannot expect all users to bump @react-native/metro-config in their project between 0.72.00.72.1, the previous check remains alongside this. If one of these detection methods works, no warning/fallback loading is performed.

Targets the 11.x branch (React Native 0.72).


📦 Please publish!: We'd like to get this convenience fix to users for React Native 0.72.1.


Test Plan

Remove @react-native/metro-config import from config file (existing check)

image

✅ Logs warning and falls back to legacy defaults

Load @react-native/metro-config defaults in separate file (new check needed)

image

✅ No warning logged, proceeds, builds
(Ignore unrelated newer config option warning)

@motiz88
Copy link
Collaborator

motiz88 commented Jun 29, 2023

LGTM (can I pretty please have review permissions in this repo? 😇 )

@thymikee
Copy link
Member

@motiz88 granted!

@thymikee thymikee merged commit 704b49a into react-native-community:11.x Jun 29, 2023
@motiz88 motiz88 self-requested a review June 29, 2023 14:58
@huntie huntie deleted the improve-metro-base-config-detection branch June 29, 2023 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants