metro 0.76.1 → 0.76.3
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 +21 -23
- package/src/DeltaBundler/Graph.js +6 -19
- package/src/DeltaBundler/Graph.js.flow +8 -15
- package/src/DeltaBundler/Serializers/baseJSBundle.js +1 -0
- package/src/DeltaBundler/Serializers/baseJSBundle.js.flow +1 -0
- package/src/DeltaBundler/Serializers/helpers/js.js +22 -6
- package/src/DeltaBundler/Serializers/helpers/js.js.flow +24 -6
- package/src/DeltaBundler/Serializers/helpers/processModules.js +2 -0
- package/src/DeltaBundler/Serializers/helpers/processModules.js.flow +3 -0
- package/src/DeltaBundler/Serializers/hmrJSBundle.js +1 -0
- package/src/DeltaBundler/Serializers/hmrJSBundle.js.flow +1 -0
- package/src/DeltaBundler/types.d.ts +5 -3
- package/src/DeltaBundler/types.flow.js.flow +1 -1
- package/src/HmrServer.js +3 -3
- package/src/HmrServer.js.flow +5 -3
- package/src/IncrementalBundler.js +7 -6
- package/src/IncrementalBundler.js.flow +8 -6
- package/src/Server/symbolicate.js +33 -5
- package/src/Server/symbolicate.js.flow +40 -9
- package/src/Server.js +19 -11
- package/src/Server.js.flow +31 -16
- package/src/index.d.ts +16 -6
- package/src/index.flow.js +15 -2
- package/src/index.flow.js.flow +29 -4
- package/{types/lib/getGraphId.d.ts → src/integration_tests/basic_bundle/loadBundleAsyncForTest.js} +7 -2
- package/src/integration_tests/basic_bundle/loadBundleAsyncForTest.js.flow +20 -0
- package/src/integration_tests/execBundle.js +3 -0
- package/src/integration_tests/execBundle.js.flow +4 -1
- package/src/integration_tests/metro.config.js +5 -0
- package/src/lib/getGraphId.js +2 -7
- package/src/lib/getGraphId.js.flow +3 -3
- package/src/lib/getPrependedScripts.js +1 -2
- package/src/lib/getPrependedScripts.js.flow +1 -2
- package/src/lib/parseOptionsFromUrl.js +1 -0
- package/src/lib/parseOptionsFromUrl.js.flow +1 -0
- package/src/lib/splitBundleOptions.js +1 -0
- package/src/lib/splitBundleOptions.js.flow +1 -0
- package/src/lib/transformHelpers.js +1 -2
- package/src/lib/transformHelpers.js.flow +1 -2
- package/src/node-haste/DependencyGraph.js +6 -1
- package/src/node-haste/DependencyGraph.js.flow +7 -1
- package/src/shared/types.d.ts +2 -0
- package/src/shared/types.flow.js.flow +2 -1
- package/types/Asset.d.ts +0 -25
- package/types/Bundler.d.ts +0 -39
- package/types/DeltaBundler/Graph.d.ts +0 -40
- package/types/DeltaBundler/Serializers/getRamBundleInfo.d.ts +0 -18
- package/types/DeltaBundler/Worker.d.ts +0 -47
- package/types/DeltaBundler/types.d.ts +0 -167
- package/types/DeltaBundler.d.ts +0 -58
- package/types/IncrementalBundler.d.ts +0 -97
- package/types/ModuleGraph/worker/collectDependencies.d.ts +0 -27
- package/types/Server/MultipartResponse.d.ts +0 -31
- package/types/Server.d.ts +0 -113
- package/types/index.d.ts +0 -151
- package/types/lib/CountingSet.d.ts +0 -48
- package/types/lib/TerminalReporter.d.ts +0 -27
- package/types/lib/contextModule.d.ts +0 -22
- package/types/lib/reporting.d.ts +0 -140
- package/types/node-haste/DependencyGraph.d.ts +0 -59
- package/types/shared/output/bundle.d.ts +0 -31
- package/types/shared/types.d.ts +0 -138
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
* @format
|
|
8
|
-
* @oncall react_native
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import {EventEmitter} from 'events';
|
|
12
|
-
import {ConfigT} from 'metro-config';
|
|
13
|
-
import {ResolverInputOptions} from '../shared/types';
|
|
14
|
-
import {BundlerResolution} from '../DeltaBundler/types';
|
|
15
|
-
|
|
16
|
-
export default class DependencyGraph extends EventEmitter {
|
|
17
|
-
constructor(
|
|
18
|
-
config: ConfigT,
|
|
19
|
-
options?: Readonly<{
|
|
20
|
-
hasReducedPerformance?: boolean;
|
|
21
|
-
watch?: boolean;
|
|
22
|
-
}>,
|
|
23
|
-
);
|
|
24
|
-
|
|
25
|
-
ready(): Promise<void>;
|
|
26
|
-
|
|
27
|
-
/** @deprecated Use the constructor + `ready()` directly */
|
|
28
|
-
load(
|
|
29
|
-
config: ConfigT,
|
|
30
|
-
options?: Readonly<{hasReducedPerformance?: boolean; watch?: boolean}>,
|
|
31
|
-
): Promise<DependencyGraph>;
|
|
32
|
-
|
|
33
|
-
getAllFiles(): string[];
|
|
34
|
-
getSha1(filename: string): string;
|
|
35
|
-
getWatcher(): EventEmitter;
|
|
36
|
-
end(): void;
|
|
37
|
-
|
|
38
|
-
/** Given a search context, return a list of file paths matching the query. */
|
|
39
|
-
matchFilesWithContext(
|
|
40
|
-
from: string,
|
|
41
|
-
context: Readonly<{
|
|
42
|
-
/* Should search for files recursively. */
|
|
43
|
-
recursive: boolean;
|
|
44
|
-
/* Filter relative paths against a pattern. */
|
|
45
|
-
filter: RegExp;
|
|
46
|
-
}>,
|
|
47
|
-
): string[];
|
|
48
|
-
|
|
49
|
-
resolveDependency(
|
|
50
|
-
from: string,
|
|
51
|
-
to: string,
|
|
52
|
-
platform: string | null,
|
|
53
|
-
resolverOptions: ResolverInputOptions,
|
|
54
|
-
options: {assumeFlatNodeModules: boolean},
|
|
55
|
-
): BundlerResolution;
|
|
56
|
-
|
|
57
|
-
getHasteName(filePath: string): string;
|
|
58
|
-
getDependencies(filePath: string): string[];
|
|
59
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
* @format
|
|
8
|
-
* @oncall react_native
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import {OutputOptions, RequestOptions} from '../../shared/types';
|
|
12
|
-
import Server from '../../Server';
|
|
13
|
-
|
|
14
|
-
export function build(
|
|
15
|
-
packagerClient: Server,
|
|
16
|
-
requestOptions: RequestOptions,
|
|
17
|
-
): Promise<{
|
|
18
|
-
code: string;
|
|
19
|
-
map: string;
|
|
20
|
-
}>;
|
|
21
|
-
|
|
22
|
-
export function save(
|
|
23
|
-
bundle: {
|
|
24
|
-
code: string;
|
|
25
|
-
map: string;
|
|
26
|
-
},
|
|
27
|
-
options: OutputOptions,
|
|
28
|
-
log: (...args: string[]) => void,
|
|
29
|
-
): Promise<unknown>;
|
|
30
|
-
|
|
31
|
-
export const formatName: string;
|
package/types/shared/types.d.ts
DELETED
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
* @format
|
|
8
|
-
* @oncall react_native
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import type {TransformProfile} from 'metro-babel-transformer';
|
|
12
|
-
import type {CustomResolverOptions} from 'metro-resolver';
|
|
13
|
-
|
|
14
|
-
import type {
|
|
15
|
-
MetroSourceMapSegmentTuple,
|
|
16
|
-
MixedSourceMap,
|
|
17
|
-
} from 'metro-source-map';
|
|
18
|
-
import type {
|
|
19
|
-
CustomTransformOptions,
|
|
20
|
-
MinifierOptions,
|
|
21
|
-
} from 'metro-transform-worker';
|
|
22
|
-
import type {
|
|
23
|
-
Options as DeltaBundlerOptions,
|
|
24
|
-
TransformInputOptions,
|
|
25
|
-
} from '../DeltaBundler/types';
|
|
26
|
-
|
|
27
|
-
export type BundleType =
|
|
28
|
-
| 'bundle'
|
|
29
|
-
| 'delta'
|
|
30
|
-
| 'meta'
|
|
31
|
-
| 'map'
|
|
32
|
-
| 'ram'
|
|
33
|
-
| 'cli'
|
|
34
|
-
| 'hmr'
|
|
35
|
-
| 'todo'
|
|
36
|
-
| 'graph';
|
|
37
|
-
|
|
38
|
-
type MetroSourceMapOrMappings = MixedSourceMap | MetroSourceMapSegmentTuple[];
|
|
39
|
-
|
|
40
|
-
export interface BundleOptions {
|
|
41
|
-
bundleType: BundleType;
|
|
42
|
-
readonly customResolverOptions: CustomResolverOptions;
|
|
43
|
-
customTransformOptions: CustomTransformOptions;
|
|
44
|
-
dev: boolean;
|
|
45
|
-
entryFile: string;
|
|
46
|
-
readonly excludeSource: boolean;
|
|
47
|
-
readonly hot: boolean;
|
|
48
|
-
readonly inlineSourceMap: boolean;
|
|
49
|
-
minify: boolean;
|
|
50
|
-
readonly modulesOnly: boolean;
|
|
51
|
-
onProgress?: (doneCont: number, totalCount: number) => unknown;
|
|
52
|
-
readonly platform?: string;
|
|
53
|
-
readonly runModule: boolean;
|
|
54
|
-
runtimeBytecodeVersion?: number;
|
|
55
|
-
readonly shallow: boolean;
|
|
56
|
-
sourceMapUrl?: string;
|
|
57
|
-
sourceUrl?: string;
|
|
58
|
-
createModuleIdFactory?: () => (path: string) => number;
|
|
59
|
-
readonly unstable_transformProfile: TransformProfile;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
export interface ResolverInputOptions {
|
|
63
|
-
readonly customResolverOptions?: CustomResolverOptions;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export interface SerializerOptions {
|
|
67
|
-
readonly sourceMapUrl: string | null;
|
|
68
|
-
readonly sourceUrl: string | null;
|
|
69
|
-
readonly runModule: boolean;
|
|
70
|
-
readonly excludeSource: boolean;
|
|
71
|
-
readonly inlineSourceMap: boolean;
|
|
72
|
-
readonly modulesOnly: boolean;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
export interface GraphOptions {
|
|
76
|
-
readonly shallow: boolean;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
// Stricter representation of BundleOptions.
|
|
80
|
-
export interface SplitBundleOptions {
|
|
81
|
-
readonly entryFile: string;
|
|
82
|
-
readonly resolverOptions: ResolverInputOptions;
|
|
83
|
-
readonly transformOptions: TransformInputOptions;
|
|
84
|
-
readonly serializerOptions: SerializerOptions;
|
|
85
|
-
readonly graphOptions: GraphOptions;
|
|
86
|
-
readonly onProgress: DeltaBundlerOptions['onProgress'];
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
export interface ModuleGroups {
|
|
90
|
-
groups: Map<number, Set<number>>;
|
|
91
|
-
modulesById: Map<number, ModuleTransportLike>;
|
|
92
|
-
modulesInGroups: Set<number>;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
export interface ModuleTransportLike {
|
|
96
|
-
readonly code: string;
|
|
97
|
-
readonly id: number;
|
|
98
|
-
readonly map: MetroSourceMapOrMappings | null;
|
|
99
|
-
readonly name?: string;
|
|
100
|
-
readonly sourcePath: string;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
export interface ModuleTransportLikeStrict {
|
|
104
|
-
readonly code: string;
|
|
105
|
-
readonly id: number;
|
|
106
|
-
readonly map: MetroSourceMapOrMappings | null;
|
|
107
|
-
readonly name?: string;
|
|
108
|
-
readonly sourcePath: string;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
export interface RamModuleTransport extends ModuleTransportLikeStrict {
|
|
112
|
-
readonly source: string;
|
|
113
|
-
readonly type: string;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
export interface OutputOptions {
|
|
117
|
-
bundleOutput: string;
|
|
118
|
-
bundleEncoding?: 'utf8' | 'utf16le' | 'ascii';
|
|
119
|
-
dev?: boolean;
|
|
120
|
-
indexedRamBundle?: boolean;
|
|
121
|
-
platform: string;
|
|
122
|
-
sourcemapOutput?: string;
|
|
123
|
-
sourcemapSourcesRoot?: string;
|
|
124
|
-
sourcemapUseAbsolutePath?: boolean;
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
export interface RequestOptions {
|
|
128
|
-
entryFile: string;
|
|
129
|
-
inlineSourceMap?: boolean;
|
|
130
|
-
sourceMapUrl?: string;
|
|
131
|
-
dev?: boolean;
|
|
132
|
-
minify: boolean;
|
|
133
|
-
platform: string;
|
|
134
|
-
createModuleIdFactory?: () => (path: string) => number;
|
|
135
|
-
onProgress?: (transformedFileCount: number, totalFileCount: number) => void;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
export type {MinifierOptions};
|