metro-runtime 0.84.3 → 0.85.0
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "metro-runtime",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.85.0",
|
|
4
4
|
"description": "🚇 Module required for evaluating Metro bundles.",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./package.json": "./package.json",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
},
|
|
16
16
|
"repository": {
|
|
17
17
|
"type": "git",
|
|
18
|
-
"url": "git+https://github.com/
|
|
18
|
+
"url": "git+https://github.com/react/metro.git",
|
|
19
19
|
"directory": "packages/metro-runtime"
|
|
20
20
|
},
|
|
21
21
|
"scripts": {
|
|
@@ -34,6 +34,6 @@
|
|
|
34
34
|
"react-test-renderer": "19.2.3"
|
|
35
35
|
},
|
|
36
36
|
"engines": {
|
|
37
|
-
"node": "^
|
|
37
|
+
"node": "^22.13.0 || ^24.3.0 || >= 26.0.0"
|
|
38
38
|
}
|
|
39
39
|
}
|
|
@@ -12,15 +12,15 @@
|
|
|
12
12
|
export type ModuleMap = ReadonlyArray<[number, string]>;
|
|
13
13
|
|
|
14
14
|
export type Bundle = {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
readonly modules: ModuleMap,
|
|
16
|
+
readonly post: string,
|
|
17
|
+
readonly pre: string,
|
|
18
18
|
};
|
|
19
19
|
|
|
20
20
|
export type DeltaBundle = {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
readonly added: ModuleMap,
|
|
22
|
+
readonly modified: ModuleMap,
|
|
23
|
+
readonly deleted: ReadonlyArray<number>,
|
|
24
24
|
};
|
|
25
25
|
|
|
26
26
|
export type BundleVariant =
|
|
@@ -28,49 +28,49 @@ export type BundleVariant =
|
|
|
28
28
|
| Readonly<{...DeltaBundle, base: false, revisionId: string}>;
|
|
29
29
|
|
|
30
30
|
export type BundleMetadata = {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
readonly pre: number,
|
|
32
|
+
readonly post: number,
|
|
33
|
+
readonly modules: ReadonlyArray<[number, number]>,
|
|
34
34
|
};
|
|
35
35
|
|
|
36
36
|
export type FormattedError = {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
readonly type: string,
|
|
38
|
+
readonly message: string,
|
|
39
|
+
readonly errors: Array<{description: string, ...}>,
|
|
40
40
|
};
|
|
41
41
|
|
|
42
42
|
export type HmrModule = {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
readonly module: [number, string],
|
|
44
|
+
readonly sourceMappingURL: string,
|
|
45
|
+
readonly sourceURL: string,
|
|
46
46
|
};
|
|
47
47
|
|
|
48
48
|
export type HmrUpdate = {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
49
|
+
readonly added: ReadonlyArray<HmrModule>,
|
|
50
|
+
readonly deleted: ReadonlyArray<number>,
|
|
51
|
+
readonly isInitialUpdate: boolean,
|
|
52
|
+
readonly modified: ReadonlyArray<HmrModule>,
|
|
53
|
+
readonly revisionId: string,
|
|
54
54
|
};
|
|
55
55
|
|
|
56
56
|
export type HmrUpdateMessage = {
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
readonly type: 'update',
|
|
58
|
+
readonly body: HmrUpdate,
|
|
59
59
|
};
|
|
60
60
|
|
|
61
61
|
export type HmrErrorMessage = {
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
readonly type: 'error',
|
|
63
|
+
readonly body: FormattedError,
|
|
64
64
|
};
|
|
65
65
|
|
|
66
66
|
export type HmrClientMessage =
|
|
67
67
|
| {
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
readonly type: 'register-entrypoints',
|
|
69
|
+
readonly entryPoints: Array<string>,
|
|
70
70
|
}
|
|
71
71
|
| {
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
readonly type: 'log',
|
|
73
|
+
readonly level:
|
|
74
74
|
| 'trace'
|
|
75
75
|
| 'info'
|
|
76
76
|
| 'warn'
|
|
@@ -79,31 +79,31 @@ export type HmrClientMessage =
|
|
|
79
79
|
| 'groupCollapsed'
|
|
80
80
|
| 'groupEnd'
|
|
81
81
|
| 'debug',
|
|
82
|
-
|
|
82
|
+
readonly data: Array<unknown>,
|
|
83
83
|
}
|
|
84
84
|
| {
|
|
85
|
-
|
|
85
|
+
readonly type: 'log-opt-in',
|
|
86
86
|
}
|
|
87
87
|
| {
|
|
88
|
-
|
|
88
|
+
readonly type: 'heartbeat',
|
|
89
89
|
};
|
|
90
90
|
|
|
91
91
|
export type HmrMessage =
|
|
92
92
|
| {
|
|
93
|
-
|
|
93
|
+
readonly type: 'bundle-registered',
|
|
94
94
|
}
|
|
95
95
|
| {
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
96
|
+
readonly type: 'update-start',
|
|
97
|
+
readonly body: {
|
|
98
|
+
readonly isInitialUpdate: boolean,
|
|
99
99
|
},
|
|
100
100
|
}
|
|
101
101
|
| {
|
|
102
|
-
|
|
103
|
-
|
|
102
|
+
readonly type: 'update-done',
|
|
103
|
+
readonly body?: {readonly changeId?: string},
|
|
104
104
|
}
|
|
105
105
|
| HmrUpdateMessage
|
|
106
106
|
| HmrErrorMessage
|
|
107
107
|
| {
|
|
108
|
-
|
|
108
|
+
readonly type: 'heartbeat',
|
|
109
109
|
};
|
|
@@ -20,9 +20,10 @@ declare var __METRO_GLOBAL_PREFIX__: string;
|
|
|
20
20
|
// A simpler $ArrayLike<T>. Not iterable and doesn't have a `length`.
|
|
21
21
|
// This is compatible with actual arrays as well as with objects that look like
|
|
22
22
|
// {0: 'value', 1: '...'}
|
|
23
|
-
type ArrayIndexable<T> =
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
type ArrayIndexable<T> = Readonly<{
|
|
24
|
+
[indexer: number]: T,
|
|
25
|
+
...
|
|
26
|
+
}>;
|
|
26
27
|
type DependencyMap = Readonly<
|
|
27
28
|
ArrayIndexable<ModuleID> & {
|
|
28
29
|
paths?: {[id: ModuleID]: string},
|