Skip to content

Commit

Permalink
feat(react-native): upgrade metro to 0.70.3 (#10307)
Browse files Browse the repository at this point in the history
  • Loading branch information
xiongemi committed May 18, 2022
1 parent 8c803c1 commit 0bee597
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 15 deletions.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -179,7 +179,7 @@
"license-webpack-plugin": "^4.0.2",
"loader-utils": "1.2.3",
"memfs": "^3.0.1",
"metro-resolver": "^0.70.2",
"metro-resolver": "^0.70.3",
"mime": "2.4.4",
"mini-css-extract-plugin": "~2.4.7",
"minimatch": "3.0.4",
Expand Down
33 changes: 33 additions & 0 deletions packages/react-native/migrations.json
Expand Up @@ -562,6 +562,39 @@
"alwaysAddToPackageJson": false
}
}
},
"14.1.8": {
"version": "14.1.8-beta.0",
"packages": {
"metro": {
"version": "0.70.3",
"alwaysAddToPackageJson": false
},
"metro-resolver": {
"version": "0.70.3",
"alwaysAddToPackageJson": false
},
"metro-babel-register": {
"version": "0.70.3",
"alwaysAddToPackageJson": false
},
"metro-config": {
"version": "0.70.3",
"alwaysAddToPackageJson": false
},
"metro-react-native-babel-preset": {
"version": "0.70.3",
"alwaysAddToPackageJson": false
},
"@types/react-native": {
"version": "0.67.7",
"alwaysAddToPackageJson": false
},
"react-test-renderer": {
"version": "18.1.0",
"alwaysAddToPackageJson": false
}
}
}
}
}
2 changes: 1 addition & 1 deletion packages/react-native/package.json
Expand Up @@ -35,7 +35,7 @@
"enhanced-resolve": "^5.8.3",
"fs-extra": "^10.1.0",
"ignore": "^5.0.4",
"metro-resolver": "^0.70.2",
"metro-resolver": "^0.70.3",
"node-fetch": "^2.6.7",
"tsconfig-paths": "^3.9.0"
},
Expand Down
12 changes: 6 additions & 6 deletions packages/react-native/plugins/metro-resolver.ts
Expand Up @@ -27,7 +27,7 @@ export function getResolveRequest(extensions: string[]) {
const { resolveRequest, ...context } = _context;

const resolvedPath =
defaultMetroResolver(context, moduleName, platform, DEBUG) ||
defaultMetroResolver(context, realModuleName, platform, DEBUG) ||
tsconfigPathsResolver(
context,
extensions,
Expand All @@ -50,17 +50,17 @@ export function getResolveRequest(extensions: string[]) {
*/
function defaultMetroResolver(
context: any,
moduleName: string,
realModuleName: string,
platform: string,
debug: boolean
) {
try {
return metroResolver.resolve(context, moduleName, platform);
return metroResolver.resolve(context, realModuleName, platform);
} catch {
if (debug)
console.log(
chalk.cyan(
`[Nx] Unable to resolve with default Metro resolver: ${moduleName}`
`[Nx] Unable to resolve with default Metro resolver: ${realModuleName}`
)
);
}
Expand Down Expand Up @@ -141,13 +141,13 @@ let matcher: MatchPath;
let absoluteBaseUrl: string;
let paths: Record<string, string[]>;

function getMatcher(DEBUG: boolean) {
function getMatcher(debug: boolean) {
if (!matcher) {
const result = loadConfig();
if (result.resultType === 'success') {
absoluteBaseUrl = result.absoluteBaseUrl;
paths = result.paths;
if (DEBUG) {
if (debug) {
console.log(
chalk.cyan(`[Nx] Located tsconfig at ${chalk.bold(absoluteBaseUrl)}`)
);
Expand Down
6 changes: 3 additions & 3 deletions packages/react-native/src/utils/versions.ts
@@ -1,11 +1,11 @@
export const nxVersion = '*';

export const reactNativeVersion = '0.68.1';
export const typesReactNativeVersion = '0.67.6';
export const typesReactNativeVersion = '0.67.7';

export const typesNodeVersion = '16.11.7';

export const metroVersion = '0.70.2';
export const metroVersion = '0.70.3';

export const reactNativeCommunityCli = '7.0.3';
export const reactNativeCommunityCliIos = '7.0.1';
Expand All @@ -19,7 +19,7 @@ export const testingLibraryJestNativeVersion = '4.0.4';

export const jestReactNativeVersion = '18.0.0';

export const reactTestRendererVersion = '18.0.0';
export const reactTestRendererVersion = '18.1.0';

export const reactNativeSvgTransformerVersion = '1.0.0';
export const reactNativeSvgVersion = '12.3.0';
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Expand Up @@ -15615,10 +15615,10 @@ methods@~1.1.2:
resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee"
integrity sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=

metro-resolver@^0.70.2:
version "0.70.2"
resolved "https://registry.yarnpkg.com/metro-resolver/-/metro-resolver-0.70.2.tgz#fb7f70634e3832ee2dde37e28df8901a8ae0fec2"
integrity sha512-fYuEOTSB+ri0y2kOLL8PuqblD1/3h3tZ8G02wNFeB5oCbEqZ1jhSAG/f6hj/qy7xUA18oyG5qJqiHtiRDFO6yg==
metro-resolver@^0.70.3:
version "0.70.3"
resolved "https://registry.yarnpkg.com/metro-resolver/-/metro-resolver-0.70.3.tgz#c64fdd6d0a88fa62f3f99f87e539b5f603bd47bf"
integrity sha512-5Pc5S/Gs4RlLbziuIWtvtFd9GRoILlaRC8RZDVq5JZWcWHywKy/PjNmOBNhpyvtRlzpJfy/ssIfLhu8zINt1Mw==
dependencies:
absolute-path "^0.0.0"

Expand Down

1 comment on commit 0bee597

@vercel
Copy link

@vercel vercel bot commented on 0bee597 May 18, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

nx-dev – ./

nx-five.vercel.app
nx-dev-nrwl.vercel.app
nx.dev
nx-dev-git-master-nrwl.vercel.app

Please sign in to comment.