Skip to content

Commit afa2a60

Browse files
huntiemeta-codesync[bot]
authored andcommitted
Restore react-native/setup-env references on main (#57560)
Summary: Pull Request resolved: #57560 Reverts D112002434. This fix was needed on `0.87-stable` but not on `main`, since the `setup-env`-in-bundle-graph fix (#57492) was already present, see file at time of D112002434: https://github.com/react/react-native/blob/08c323346be6c0fbbd70900d48435f977a78a1bb/packages/react-native/Libraries/Core/InitializeCore.js#L30-L37 See #57559 for more info. Changelog: [Internal] Reviewed By: zeyap Differential Revision: D112101450 fbshipit-source-id: 435a24e72415e18b5e3d6a5144ed805adc415a95
1 parent 62a2b38 commit afa2a60

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,15 @@ function getCommunityCliDefaultConfig(
5858
return {
5959
resolver,
6060
serializer: {
61-
// We can include multiple copies of InitializeCore here because metro will
61+
// We can include multiple copies of setup-env here because Metro will
6262
// only add ones that are already part of the bundle
6363
getModulesRunBeforeMainModule: () => [
64-
require.resolve('react-native/Libraries/Core/InitializeCore', {
64+
require.resolve('react-native/setup-env', {
6565
paths: [ctx.root],
6666
}),
6767
...outOfTreePlatforms.map(platform =>
6868
require.resolve(
69-
`${ctx.platforms[platform].npmPackageName}/Libraries/Core/InitializeCore`,
69+
`${ctx.platforms[platform].npmPackageName}/setup-env`,
7070
{paths: [ctx.root]},
7171
),
7272
),

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export function getDefaultConfig(projectRoot: string): ConfigT {
6161
serializer: {
6262
// NOTE: Overridden in community-cli-plugin
6363
getModulesRunBeforeMainModule: () => [
64-
require.resolve('react-native/Libraries/Core/InitializeCore'),
64+
require.resolve('react-native/setup-env'),
6565
],
6666
getPolyfills: () => require('@react-native/js-polyfills')(),
6767
isThirdPartyModule({path: modulePath}: Readonly<{path: string, ...}>) {

0 commit comments

Comments
 (0)