metro 0.82.0 → 0.82.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +17 -17
- package/src/IncrementalBundler.js.flow +1 -1
- package/src/Server/symbolicate.js.flow +1 -1
- package/src/lib/TerminalReporter.js +8 -5
- package/src/lib/TerminalReporter.js.flow +16 -8
- package/src/lib/getPrependedScripts.js.flow +1 -4
- package/src/shared/types.flow.js.flow +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "metro",
|
|
3
|
-
"version": "0.82.
|
|
3
|
+
"version": "0.82.1",
|
|
4
4
|
"description": "🚇 The JavaScript bundler for React Native.",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"bin": "src/cli.js",
|
|
@@ -42,18 +42,18 @@
|
|
|
42
42
|
"jest-worker": "^29.7.0",
|
|
43
43
|
"jsc-safe-url": "^0.2.2",
|
|
44
44
|
"lodash.throttle": "^4.1.1",
|
|
45
|
-
"metro-babel-transformer": "0.82.
|
|
46
|
-
"metro-cache": "0.82.
|
|
47
|
-
"metro-cache-key": "0.82.
|
|
48
|
-
"metro-config": "0.82.
|
|
49
|
-
"metro-core": "0.82.
|
|
50
|
-
"metro-file-map": "0.82.
|
|
51
|
-
"metro-resolver": "0.82.
|
|
52
|
-
"metro-runtime": "0.82.
|
|
53
|
-
"metro-source-map": "0.82.
|
|
54
|
-
"metro-symbolicate": "0.82.
|
|
55
|
-
"metro-transform-plugins": "0.82.
|
|
56
|
-
"metro-transform-worker": "0.82.
|
|
45
|
+
"metro-babel-transformer": "0.82.1",
|
|
46
|
+
"metro-cache": "0.82.1",
|
|
47
|
+
"metro-cache-key": "0.82.1",
|
|
48
|
+
"metro-config": "0.82.1",
|
|
49
|
+
"metro-core": "0.82.1",
|
|
50
|
+
"metro-file-map": "0.82.1",
|
|
51
|
+
"metro-resolver": "0.82.1",
|
|
52
|
+
"metro-runtime": "0.82.1",
|
|
53
|
+
"metro-source-map": "0.82.1",
|
|
54
|
+
"metro-symbolicate": "0.82.1",
|
|
55
|
+
"metro-transform-plugins": "0.82.1",
|
|
56
|
+
"metro-transform-worker": "0.82.1",
|
|
57
57
|
"mime-types": "^2.1.27",
|
|
58
58
|
"nullthrows": "^1.1.1",
|
|
59
59
|
"serialize-error": "^2.1.0",
|
|
@@ -65,14 +65,14 @@
|
|
|
65
65
|
"devDependencies": {
|
|
66
66
|
"@babel/plugin-transform-flow-strip-types": "^7.25.2",
|
|
67
67
|
"@babel/plugin-transform-modules-commonjs": "^7.24.8",
|
|
68
|
-
"@react-native/babel-preset": "0.
|
|
69
|
-
"@react-native/metro-babel-transformer": "0.
|
|
68
|
+
"@react-native/babel-preset": "0.78.0",
|
|
69
|
+
"@react-native/metro-babel-transformer": "0.78.0",
|
|
70
70
|
"babel-jest": "^29.7.0",
|
|
71
71
|
"dedent": "^0.7.0",
|
|
72
72
|
"jest-snapshot": "^29.7.0",
|
|
73
73
|
"jest-snapshot-serializer-raw": "^1.2.0",
|
|
74
|
-
"metro-babel-register": "0.82.
|
|
75
|
-
"metro-memory-fs": "0.82.
|
|
74
|
+
"metro-babel-register": "0.82.1",
|
|
75
|
+
"metro-memory-fs": "0.82.1",
|
|
76
76
|
"mock-req": "^0.2.0",
|
|
77
77
|
"mock-res": "^0.6.0",
|
|
78
78
|
"stack-trace": "^0.0.10"
|
|
@@ -36,7 +36,7 @@ export opaque type RevisionId: string = string;
|
|
|
36
36
|
export type OutputGraph = Graph<>;
|
|
37
37
|
|
|
38
38
|
type OtherOptions = $ReadOnly<{
|
|
39
|
-
onProgress:
|
|
39
|
+
onProgress: DeltaBundlerOptions<>['onProgress'],
|
|
40
40
|
shallow: boolean,
|
|
41
41
|
lazy: boolean,
|
|
42
42
|
}>;
|
|
@@ -38,7 +38,7 @@ export type StackFrameOutput = $ReadOnly<{
|
|
|
38
38
|
...IntermediateStackFrame,
|
|
39
39
|
...
|
|
40
40
|
}>;
|
|
41
|
-
type ExplodedSourceMapModule =
|
|
41
|
+
type ExplodedSourceMapModule = ExplodedSourceMap[number];
|
|
42
42
|
type Position = {+line1Based: number, column0Based: number};
|
|
43
43
|
|
|
44
44
|
function createFunctionNameGetter(
|
|
@@ -55,8 +55,7 @@ class TerminalReporter {
|
|
|
55
55
|
chalk.reset.dim(` ${path.dirname(localPath)}/`) +
|
|
56
56
|
chalk.bold(path.basename(localPath)) +
|
|
57
57
|
" " +
|
|
58
|
-
progress
|
|
59
|
-
"\n"
|
|
58
|
+
progress
|
|
60
59
|
);
|
|
61
60
|
}
|
|
62
61
|
_logBundleBuildDone(buildID) {
|
|
@@ -241,9 +240,13 @@ class TerminalReporter {
|
|
|
241
240
|
if (currentProgress == null) {
|
|
242
241
|
return;
|
|
243
242
|
}
|
|
244
|
-
const
|
|
245
|
-
|
|
246
|
-
|
|
243
|
+
const ratio = Math.min(
|
|
244
|
+
Math.max(
|
|
245
|
+
Math.pow(transformedFileCount / Math.max(totalFileCount, 10), 2),
|
|
246
|
+
currentProgress.ratio
|
|
247
|
+
),
|
|
248
|
+
0.999
|
|
249
|
+
);
|
|
247
250
|
Object.assign(currentProgress, {
|
|
248
251
|
ratio,
|
|
249
252
|
transformedFileCount,
|
|
@@ -146,8 +146,7 @@ class TerminalReporter {
|
|
|
146
146
|
chalk.reset.dim(` ${path.dirname(localPath)}/`) +
|
|
147
147
|
chalk.bold(path.basename(localPath)) +
|
|
148
148
|
' ' +
|
|
149
|
-
progress
|
|
150
|
-
'\n'
|
|
149
|
+
progress
|
|
151
150
|
);
|
|
152
151
|
}
|
|
153
152
|
|
|
@@ -355,9 +354,12 @@ class TerminalReporter {
|
|
|
355
354
|
}
|
|
356
355
|
|
|
357
356
|
/**
|
|
358
|
-
*
|
|
359
|
-
*
|
|
360
|
-
*
|
|
357
|
+
* Because we know the `totalFileCount` is going to progressively increase
|
|
358
|
+
* starting with 1:
|
|
359
|
+
* - We use Math.max(totalFileCount, 10) to prevent the ratio to raise too
|
|
360
|
+
* quickly when the total file count is low. (e.g 1/2 5/6)
|
|
361
|
+
* - We prevent the ratio from going backwards.
|
|
362
|
+
* - Instead, we use Math.pow(ratio, 2) to as a conservative measure of progress.
|
|
361
363
|
*/
|
|
362
364
|
_updateBundleProgress({
|
|
363
365
|
buildID,
|
|
@@ -373,9 +375,15 @@ class TerminalReporter {
|
|
|
373
375
|
if (currentProgress == null) {
|
|
374
376
|
return;
|
|
375
377
|
}
|
|
376
|
-
|
|
377
|
-
const
|
|
378
|
-
|
|
378
|
+
|
|
379
|
+
const ratio = Math.min(
|
|
380
|
+
Math.max(
|
|
381
|
+
Math.pow(transformedFileCount / Math.max(totalFileCount, 10), 2),
|
|
382
|
+
currentProgress.ratio,
|
|
383
|
+
),
|
|
384
|
+
0.999, // make sure not to go above 99.9% to not get rounded to 100%,
|
|
385
|
+
);
|
|
386
|
+
|
|
379
387
|
Object.assign(currentProgress, {
|
|
380
388
|
ratio,
|
|
381
389
|
transformedFileCount,
|
|
@@ -26,10 +26,7 @@ const defaults = require('metro-config/src/defaults/defaults');
|
|
|
26
26
|
|
|
27
27
|
async function getPrependedScripts(
|
|
28
28
|
config: ConfigT,
|
|
29
|
-
options:
|
|
30
|
-
TransformInputOptions,
|
|
31
|
-
{type: $PropertyType<TransformInputOptions, 'type'>, ...},
|
|
32
|
-
>,
|
|
29
|
+
options: Omit<TransformInputOptions, 'type'>,
|
|
33
30
|
resolverOptions: ResolverInputOptions,
|
|
34
31
|
bundler: Bundler,
|
|
35
32
|
deltaBundler: DeltaBundler<>,
|
|
@@ -98,7 +98,7 @@ export type SplitBundleOptions = {
|
|
|
98
98
|
+transformOptions: TransformInputOptions,
|
|
99
99
|
+serializerOptions: SerializerOptions,
|
|
100
100
|
+graphOptions: GraphOptions,
|
|
101
|
-
+onProgress:
|
|
101
|
+
+onProgress: DeltaBundlerOptions<>['onProgress'],
|
|
102
102
|
};
|
|
103
103
|
|
|
104
104
|
export type ModuleGroups = {
|