metro-runtime 0.70.1 → 0.71.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.71.0",
|
|
4
4
|
"description": "🚇 Module required for evaluating Metro bundles.",
|
|
5
5
|
"main": "src",
|
|
6
6
|
"repository": {
|
|
@@ -12,6 +12,9 @@
|
|
|
12
12
|
"cleanup-release": "test ! -e build && mv src build && mv src.real src"
|
|
13
13
|
},
|
|
14
14
|
"license": "MIT",
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"@babel/runtime": "^7.0.0"
|
|
17
|
+
},
|
|
15
18
|
"devDependencies": {
|
|
16
19
|
"@babel/core": "^7.14.0"
|
|
17
20
|
}
|
|
@@ -13,70 +13,70 @@
|
|
|
13
13
|
export type ModuleMap = $ReadOnlyArray<[number, string]>;
|
|
14
14
|
export type BytecodeModuleMap = $ReadOnlyArray<[number, Array<Buffer>]>;
|
|
15
15
|
|
|
16
|
-
export type Bundle = {
|
|
16
|
+
export type Bundle = {
|
|
17
17
|
+modules: ModuleMap,
|
|
18
18
|
+post: string,
|
|
19
19
|
+pre: string,
|
|
20
|
-
|
|
20
|
+
};
|
|
21
21
|
|
|
22
|
-
export type BytecodeBundle = {
|
|
22
|
+
export type BytecodeBundle = {
|
|
23
23
|
+modules: BytecodeModuleMap,
|
|
24
24
|
+post: Array<Buffer>,
|
|
25
25
|
+pre: Array<Buffer>,
|
|
26
|
-
|
|
26
|
+
};
|
|
27
27
|
|
|
28
|
-
export type DeltaBundle = {
|
|
28
|
+
export type DeltaBundle = {
|
|
29
29
|
+added: ModuleMap,
|
|
30
30
|
+modified: ModuleMap,
|
|
31
31
|
+deleted: $ReadOnlyArray<number>,
|
|
32
|
-
|
|
32
|
+
};
|
|
33
33
|
|
|
34
34
|
export type BundleVariant =
|
|
35
|
-
| {
|
|
36
|
-
| {
|
|
35
|
+
| {+base: true, +revisionId: string, ...Bundle}
|
|
36
|
+
| {+base: false, +revisionId: string, ...DeltaBundle};
|
|
37
37
|
|
|
38
|
-
export type BundleMetadata = {
|
|
38
|
+
export type BundleMetadata = {
|
|
39
39
|
+pre: number,
|
|
40
40
|
+post: number,
|
|
41
41
|
+modules: $ReadOnlyArray<[number, number]>,
|
|
42
|
-
|
|
42
|
+
};
|
|
43
43
|
|
|
44
|
-
export type FormattedError = {
|
|
44
|
+
export type FormattedError = {
|
|
45
45
|
+type: string,
|
|
46
46
|
+message: string,
|
|
47
47
|
+errors: Array<{description: string, ...}>,
|
|
48
|
-
|
|
48
|
+
};
|
|
49
49
|
|
|
50
|
-
export type HmrModule = {
|
|
50
|
+
export type HmrModule = {
|
|
51
51
|
+module: [number, string],
|
|
52
52
|
+sourceMappingURL: string,
|
|
53
53
|
+sourceURL: string,
|
|
54
|
-
|
|
54
|
+
};
|
|
55
55
|
|
|
56
|
-
export type HmrUpdate = {
|
|
56
|
+
export type HmrUpdate = {
|
|
57
57
|
+added: $ReadOnlyArray<HmrModule>,
|
|
58
58
|
+deleted: $ReadOnlyArray<number>,
|
|
59
59
|
+isInitialUpdate: boolean,
|
|
60
60
|
+modified: $ReadOnlyArray<HmrModule>,
|
|
61
61
|
+revisionId: string,
|
|
62
|
-
|
|
62
|
+
};
|
|
63
63
|
|
|
64
|
-
export type HmrUpdateMessage = {
|
|
64
|
+
export type HmrUpdateMessage = {
|
|
65
65
|
+type: 'update',
|
|
66
66
|
+body: HmrUpdate,
|
|
67
|
-
|
|
67
|
+
};
|
|
68
68
|
|
|
69
|
-
export type HmrErrorMessage = {
|
|
69
|
+
export type HmrErrorMessage = {
|
|
70
70
|
+type: 'error',
|
|
71
71
|
+body: FormattedError,
|
|
72
|
-
|
|
72
|
+
};
|
|
73
73
|
|
|
74
74
|
export type HmrClientMessage =
|
|
75
|
-
| {
|
|
75
|
+
| {
|
|
76
76
|
+type: 'register-entrypoints',
|
|
77
77
|
+entryPoints: Array<string>,
|
|
78
|
-
|
|
79
|
-
| {
|
|
78
|
+
}
|
|
79
|
+
| {
|
|
80
80
|
+type: 'log',
|
|
81
81
|
+level:
|
|
82
82
|
| 'trace'
|
|
@@ -89,23 +89,23 @@ export type HmrClientMessage =
|
|
|
89
89
|
| 'debug',
|
|
90
90
|
+data: Array<mixed>,
|
|
91
91
|
+mode: 'BRIDGE' | 'NOBRIDGE',
|
|
92
|
-
|
|
93
|
-
| {
|
|
92
|
+
}
|
|
93
|
+
| {
|
|
94
94
|
+type: 'log-opt-in',
|
|
95
|
-
|
|
95
|
+
};
|
|
96
96
|
|
|
97
97
|
export type HmrMessage =
|
|
98
|
-
| {
|
|
98
|
+
| {
|
|
99
99
|
+type: 'bundle-registered',
|
|
100
|
-
|
|
101
|
-
| {
|
|
100
|
+
}
|
|
101
|
+
| {
|
|
102
102
|
+type: 'update-start',
|
|
103
|
-
+body: {
|
|
103
|
+
+body: {
|
|
104
104
|
+isInitialUpdate: boolean,
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
| {
|
|
105
|
+
},
|
|
106
|
+
}
|
|
107
|
+
| {
|
|
108
108
|
+type: 'update-done',
|
|
109
|
-
|
|
109
|
+
}
|
|
110
110
|
| HmrUpdateMessage
|
|
111
111
|
| HmrErrorMessage;
|
|
@@ -28,13 +28,13 @@ type FactoryFn = (
|
|
|
28
28
|
dependencyMap: ?DependencyMap,
|
|
29
29
|
) => void;
|
|
30
30
|
type HotModuleReloadingCallback = () => void;
|
|
31
|
-
type HotModuleReloadingData = {
|
|
31
|
+
type HotModuleReloadingData = {
|
|
32
32
|
_acceptCallback: ?HotModuleReloadingCallback,
|
|
33
33
|
_disposeCallback: ?HotModuleReloadingCallback,
|
|
34
34
|
_didAccept: boolean,
|
|
35
35
|
accept: (callback?: HotModuleReloadingCallback) => void,
|
|
36
36
|
dispose: (callback?: HotModuleReloadingCallback) => void,
|
|
37
|
-
|
|
37
|
+
};
|
|
38
38
|
type ModuleID = number;
|
|
39
39
|
type Module = {
|
|
40
40
|
id?: ModuleID,
|
|
@@ -42,7 +42,7 @@ type Module = {
|
|
|
42
42
|
hot?: HotModuleReloadingData,
|
|
43
43
|
...
|
|
44
44
|
};
|
|
45
|
-
type ModuleDefinition = {
|
|
45
|
+
type ModuleDefinition = {
|
|
46
46
|
dependencyMap: ?DependencyMap,
|
|
47
47
|
error?: any,
|
|
48
48
|
factory: FactoryFn,
|
|
@@ -54,7 +54,7 @@ type ModuleDefinition = {|
|
|
|
54
54
|
path?: string,
|
|
55
55
|
publicModule: Module,
|
|
56
56
|
verboseName?: string,
|
|
57
|
-
|
|
57
|
+
};
|
|
58
58
|
type ModuleList = {
|
|
59
59
|
[number]: ?ModuleDefinition,
|
|
60
60
|
__proto__: null,
|
|
@@ -240,7 +240,7 @@ function metroImportAll(moduleId: ModuleID | VerboseModuleNameForDev | number) {
|
|
|
240
240
|
if (exports && exports.__esModule) {
|
|
241
241
|
importedAll = exports;
|
|
242
242
|
} else {
|
|
243
|
-
importedAll = {};
|
|
243
|
+
importedAll = ({}: {[string]: any});
|
|
244
244
|
|
|
245
245
|
// Refrain from using Object.assign, it has to work in ES3 environments.
|
|
246
246
|
if (exports) {
|