Skip to content

Commit bf691fa

Browse files
huntiemeta-codesync[bot]
authored andcommitted
Remove RN metro-config migration checks (#57648)
Summary: Pull Request resolved: #57648 Legacy check, clean up. Changelog: [Internal] ___ Differential Revision: D113396915 fbshipit-source-id: 697b65f1a02a98949f490b2cc94d0864d52d1472
1 parent 855548c commit bf691fa

2 files changed

Lines changed: 0 additions & 19 deletions

File tree

packages/community-cli-plugin/src/utils/loadMetroConfig.js

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,6 @@ export default async function loadMetroConfig(
9696

9797
// Get the RN defaults before our customisations
9898
const defaultConfig = RNMetroConfig.getDefaultConfig(ctx.root);
99-
// Unflag the config as being loaded - it must be loaded again in userland.
100-
global.__REACT_NATIVE_METRO_CONFIG_LOADED = false;
10199

102100
// Add our defaults to `@react-native/metro-config` before the user config
103101
// loads them.
@@ -119,20 +117,6 @@ export default async function loadMetroConfig(
119117

120118
debug(`Reading Metro config from ${projectConfig.filepath}`);
121119

122-
if (!global.__REACT_NATIVE_METRO_CONFIG_LOADED) {
123-
const warning = `
124-
=================================================================================================
125-
From React Native 0.73, your project's Metro config should extend '@react-native/metro-config'
126-
or it will fail to build. Please copy the template at:
127-
https://github.com/react-native-community/template/blob/main/template/metro.config.js
128-
This warning will be removed in future (https://github.com/facebook/metro/issues/1018).
129-
=================================================================================================
130-
`;
131-
132-
for (const line of warning.trim().split('\n')) {
133-
console.warn(line);
134-
}
135-
}
136120
return loadConfig({
137121
cwd,
138122
...options,

packages/metro-config/src/index.flow.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,6 @@ export function getDefaultConfig(projectRoot: string): ConfigT {
9999
watchFolders: [],
100100
};
101101

102-
// Set global hook so that the CLI can detect when this config has been loaded
103-
global.__REACT_NATIVE_METRO_CONFIG_LOADED = true;
104-
105102
const metroDefaults = getBaseConfig.getDefaultValues(projectRoot);
106103

107104
return mergeConfig(metroDefaults, reactNativeDefaults, frameworkDefaults);

0 commit comments

Comments
 (0)