Skip to content

Commit 39f3273

Browse files
authored
chore: Upgrade metro dependencies to 0.76.2 (#1910)
1 parent ef9b2fc commit 39f3273

File tree

6 files changed

+138
-276
lines changed

6 files changed

+138
-276
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
"jest-snapshot-serializer-raw": "^1.1.0",
5252
"lerna": "^4.0.0",
5353
"lint-staged": "^13.1.0",
54-
"metro-memory-fs": "0.76.0",
54+
"metro-memory-fs": "0.76.2",
5555
"micromatch": "^4.0.4",
5656
"rimraf": "^3.0.2",
5757
"slash": "^3.0.0",

packages/cli-plugin-metro/package.json

+7-11
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,16 @@
1111
"@react-native-community/cli-tools": "12.0.0-alpha.2",
1212
"chalk": "^4.1.2",
1313
"execa": "^5.0.0",
14-
"metro": "0.76.0",
15-
"metro-config": "0.76.0",
16-
"metro-core": "0.76.0",
17-
"metro-react-native-babel-transformer": "0.76.0",
18-
"metro-resolver": "0.76.0",
19-
"metro-runtime": "0.76.0",
14+
"metro": "0.76.2",
15+
"metro-config": "0.76.2",
16+
"metro-core": "0.76.2",
17+
"metro-react-native-babel-transformer": "0.76.2",
18+
"metro-resolver": "0.76.2",
19+
"metro-runtime": "0.76.2",
2020
"readline": "^1.3.0"
2121
},
2222
"devDependencies": {
23-
"@react-native-community/cli-types": "12.0.0-alpha.2",
24-
"@types/metro": "^0.76.0",
25-
"@types/metro-config": "^0.76.1",
26-
"@types/metro-core": "^0.76.0",
27-
"@types/metro-resolver": "^0.76.1"
23+
"@react-native-community/cli-types": "12.0.0-alpha.2"
2824
},
2925
"files": [
3026
"build",

packages/cli-plugin-metro/src/commands/bundle/buildBundle.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import Server from 'metro/src/Server';
1010
// @ts-ignore - no typed definition for the package
1111
const outputBundle = require('metro/src/shared/output/bundle');
12-
import type {BundleOptions} from 'metro/shared/types';
12+
import type {BundleOptions} from 'metro/src/shared/types';
1313
import type {ConfigT} from 'metro-config';
1414
import path from 'path';
1515
import chalk from 'chalk';

packages/cli-plugin-metro/src/commands/start/runServer.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
// @ts-ignore untyped metro
99
import Metro from 'metro';
10-
import type {Server} from 'metro';
10+
import type Server from 'metro/src/Server';
1111
import type {Middleware} from 'metro-config';
1212
import {Terminal} from 'metro-core';
1313
import path from 'path';
@@ -101,7 +101,6 @@ async function runServer(_argv: Array<string>, ctx: Config, args: Args) {
101101
secure: args.https,
102102
secureCert: args.cert,
103103
secureKey: args.key,
104-
hmrEnabled: true,
105104
// @ts-ignore - ws.Server types are incompatible
106105
websocketEndpoints,
107106
});

packages/cli-plugin-metro/src/tools/loadMetroConfig.ts

+1-5
Original file line numberDiff line numberDiff line change
@@ -89,19 +89,15 @@ export default async function loadMetroConfig(
8989

9090
const projectConfig = await resolveConfig(undefined, ctx.root);
9191

92-
// @ts-ignore resolveConfig return value is mistyped
9392
if (projectConfig.isEmpty) {
9493
throw new CLIError(`No metro config found in ${ctx.root}`);
9594
}
9695

97-
// @ts-ignore resolveConfig return value is mistyped
9896
logger.debug(`Reading Metro config from ${projectConfig.filepath}`);
9997

10098
if (
10199
!/['"']@react-native\/metro-config['"']/.test(
102-
fs
103-
// @ts-ignore resolveConfig return value is mistyped
104-
.readFileSync(projectConfig.filepath, 'utf8'),
100+
fs.readFileSync(projectConfig.filepath, 'utf8'),
105101
)
106102
) {
107103
logger.warn(

0 commit comments

Comments
 (0)