@expo/metro-config 58.0.10 → 58.0.12
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/build/ExpoMetroConfig.d.ts +1 -3
- package/build/ExpoMetroConfig.js +15 -17
- package/build/ExpoMetroConfig.js.map +1 -1
- package/build/serializer/chunking/Chunk.d.ts +45 -0
- package/build/serializer/chunking/Chunk.js +409 -0
- package/build/serializer/chunking/Chunk.js.map +1 -0
- package/build/serializer/chunking/chunkingStrategy.d.ts +40 -0
- package/build/serializer/chunking/chunkingStrategy.js +155 -0
- package/build/serializer/chunking/chunkingStrategy.js.map +1 -0
- package/build/serializer/chunking/computeBitSetChunks.d.ts +49 -0
- package/build/serializer/chunking/computeBitSetChunks.js +268 -0
- package/build/serializer/chunking/computeBitSetChunks.js.map +1 -0
- package/build/serializer/{computeChunkFilenames.d.ts → chunking/computeChunkFilenames.d.ts} +1 -1
- package/build/serializer/chunking/computeChunkFilenames.js.map +1 -0
- package/build/serializer/chunking/createGranularChunkingStrategy.d.ts +2 -0
- package/build/serializer/chunking/createGranularChunkingStrategy.js +282 -0
- package/build/serializer/chunking/createGranularChunkingStrategy.js.map +1 -0
- package/build/serializer/chunking/createLegacyChunkingStrategy.d.ts +2 -0
- package/build/serializer/chunking/createLegacyChunkingStrategy.js +167 -0
- package/build/serializer/chunking/createLegacyChunkingStrategy.js.map +1 -0
- package/build/serializer/chunking/findUnsupportedWorkerAsyncDependency.d.ts +7 -0
- package/build/serializer/chunking/findUnsupportedWorkerAsyncDependency.js +54 -0
- package/build/serializer/chunking/findUnsupportedWorkerAsyncDependency.js.map +1 -0
- package/build/serializer/exportPath.d.ts +1 -0
- package/build/serializer/exportPath.js +18 -3
- package/build/serializer/exportPath.js.map +1 -1
- package/build/serializer/fork/baseJSBundle.d.ts +5 -1
- package/build/serializer/fork/baseJSBundle.js +23 -1
- package/build/serializer/fork/baseJSBundle.js.map +1 -1
- package/build/serializer/fork/js.d.ts +6 -4
- package/build/serializer/fork/js.js +11 -1
- package/build/serializer/fork/js.js.map +1 -1
- package/build/serializer/fork/processModules.d.ts +4 -14
- package/build/serializer/fork/processModules.js +2 -12
- package/build/serializer/fork/processModules.js.map +1 -1
- package/build/serializer/serializeChunks.d.ts +4 -47
- package/build/serializer/serializeChunks.js +17 -655
- package/build/serializer/serializeChunks.js.map +1 -1
- package/build/serializer/serializerAssets.d.ts +13 -1
- package/build/serializer/withExpoSerializers.js +11 -1
- package/build/serializer/withExpoSerializers.js.map +1 -1
- package/package.json +6 -5
- package/build/serializer/computeChunkFilenames.js.map +0 -1
- /package/build/serializer/{computeChunkFilenames.js → chunking/computeChunkFilenames.js} +0 -0
|
@@ -44,11 +44,9 @@ export declare function getDefaultConfig(projectRoot: string, { mode, isCSSEnabl
|
|
|
44
44
|
watchFolders: string[];
|
|
45
45
|
resolver: {
|
|
46
46
|
unstable_conditionsByPlatform: {
|
|
47
|
+
web: string[];
|
|
47
48
|
ios: string[];
|
|
48
49
|
android: string[];
|
|
49
|
-
tvos: string[];
|
|
50
|
-
macos: string[];
|
|
51
|
-
web: string[];
|
|
52
50
|
};
|
|
53
51
|
resolverMainFields: string[];
|
|
54
52
|
platforms: string[];
|
package/build/ExpoMetroConfig.js
CHANGED
|
@@ -65,6 +65,13 @@ function _exclusionList() {
|
|
|
65
65
|
};
|
|
66
66
|
return data;
|
|
67
67
|
}
|
|
68
|
+
function _platforms() {
|
|
69
|
+
const data = require("@expo/platforms");
|
|
70
|
+
_platforms = function() {
|
|
71
|
+
return data;
|
|
72
|
+
};
|
|
73
|
+
return data;
|
|
74
|
+
}
|
|
68
75
|
function _requireutils() {
|
|
69
76
|
const data = /*#__PURE__*/ _interop_require_wildcard(require("@expo/require-utils"));
|
|
70
77
|
_requireutils = function() {
|
|
@@ -162,15 +169,7 @@ function _interop_require_wildcard(obj, nodeInterop) {
|
|
|
162
169
|
}
|
|
163
170
|
let hasWarnedAboutReactNative = false;
|
|
164
171
|
function getReactNativeHostPackage(platform) {
|
|
165
|
-
|
|
166
|
-
switch(platform){
|
|
167
|
-
case 'tvos':
|
|
168
|
-
return 'react-native-tvos';
|
|
169
|
-
case 'macos':
|
|
170
|
-
return 'react-native-macos';
|
|
171
|
-
default:
|
|
172
|
-
return 'react-native';
|
|
173
|
-
}
|
|
172
|
+
return (0, _platforms().isOutOfTreePlatform)(platform) ? (0, _platforms().getReactNativeHostPackage)(platform) : 'react-native';
|
|
174
173
|
}
|
|
175
174
|
function getReactNativeHostPath(projectRoot, platform) {
|
|
176
175
|
const hostPackage = getReactNativeHostPackage(platform);
|
|
@@ -360,12 +359,12 @@ function getDefaultConfig(projectRoot, { mode, isCSSEnabled = true, unstable_bef
|
|
|
360
359
|
android: [
|
|
361
360
|
'react-native'
|
|
362
361
|
],
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
362
|
+
...Object.fromEntries(_platforms().OUT_OF_TREE_PLATFORMS.map((platform)=>[
|
|
363
|
+
platform,
|
|
364
|
+
[
|
|
365
|
+
'react-native'
|
|
366
|
+
]
|
|
367
|
+
])),
|
|
369
368
|
// This is removed for server platforms.
|
|
370
369
|
web: [
|
|
371
370
|
'browser'
|
|
@@ -379,8 +378,7 @@ function getDefaultConfig(projectRoot, { mode, isCSSEnabled = true, unstable_bef
|
|
|
379
378
|
platforms: [
|
|
380
379
|
'ios',
|
|
381
380
|
'android',
|
|
382
|
-
|
|
383
|
-
'macos'
|
|
381
|
+
..._platforms().OUT_OF_TREE_PLATFORMS
|
|
384
382
|
],
|
|
385
383
|
assetExts: metroDefaultValues.resolver.assetExts.concat(// Additional font files missing from default values
|
|
386
384
|
[
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["ExpoMetroConfig.ts"],"sourcesContent":[null],"names":["EXPO_DEBUG","INTERNAL_CALLSITES_REGEX","createStableModuleIdFactory","getDefaultConfig","internal_supervisingTransformerPath","unstable_transformerPath","hasWarnedAboutReactNative","getReactNativeHostPackage","platform","getReactNativeHostPath","projectRoot","hostPackage","path","dirname","resolveFrom","silent","patchMetroGraphToSupportUncachedModules","Graph","require","original_traverseDependencies","prototype","traverseDependencies","__patched","paths","options","dependencies","forEach","dependency","output","find","file","data","css","skipCache","includes","setOnReadonly","unstable_transformResultKey","push","call","createNumericModuleIdFactory","fileToIdMap","Map","nextId","modulePath","id","get","set","memoize","fn","cache","args","key","JSON","stringify","has","result","asMetroConfigInput","config","root","getModulePath","scope","isVirtualModule","isAbsolute","toPosixPath","relative","memoizedGetModulePath","context","env","environment","Error","mode","isCSSEnabled","unstable_beforeAssetSerializationPlugins","getDefaultMetroConfig","mergeConfig","reactNativePath","console","log","chalk","yellow","sourceExtsConfig","isTS","isReact","isModern","sourceExts","getBareExtensions","reanimatedVersion","getPkgVersion","workletsVersion","babelRuntimeVersion","sassVersion","pkg","getPackageJson","error","name","watchFolders","getWatchFolders","nodeModulesPaths","getModulesPaths","version","join","metroDefaultValues","getDefaultValues","restoredRoot","EXPO_METRO_CACHE_RESTORE_DIR","outputRoot","EXPO_METRO_CACHE_OUTPUT_DIR","cacheStores","BuildCacheStore","FileStore","os","tmpdir","serverRoot","getMetroServerRoot","routerPackageRoot","expoMetroConfig","reporter","update","resolver","unstable_conditionsByPlatform","ios","android","tvos","macos","web","resolverMainFields","platforms","assetExts","concat","filter","assetExt","blockList","exclusionList","watcher","additionalExts","serializer","isThirdPartyModule","module","test","match","createModuleIdFactory","EXPO_USE_METRO_REQUIRE","bind","getModulesRunBeforeMainModule","reactNativeHostPath","preModules","requireUtils","resolve","stdRuntime","event","metroRuntime","getExpoMetroRuntimeOptional","getPolyfills","server","rewriteRequestUrl","getRewriteRequestUrl","port","Number","RCT_METRO_PORT","unstable_serverRoot","symbolicator","customizeFrame","getDefaultCustomizeFrame","transformerPath","transformer","unstable_workerThreads","_expoRouterPath","undefined","postcssHash","getPostcssConfigHash","browserslistHash","browserslist","stableHash","toString","_expoRelativeProjectRoot","unstable_allowRequireContext","allowOptionalDependencies","babelTransformerPath","asyncRequireModulePath","getExpoOptional","assetRegistryPath","enableBabelRuntime","enableBabelRCLookup","getTransformOptions","transform","experimentalImportSupport","inlineRequires","metroConfig","useWatchman","withExpoSerializers","subModule","EXPO_METRO_RUNTIME","baseExpoRouter","baseExpo"],"mappings":"AAAA,qEAAqE;;;;;;;;;;;;;;;;;;;;QAgexDA;eAAAA;;QAHSC;eAAAA,wCAAwB;;QA3T9BC;eAAAA;;QA8CAC;eAAAA;;QAyQHC;eAAAA;;QADAC;eAAAA;;;;yBAvdkB;;;;;;;yBACuB;;;;;;;yBAC3B;;;;;;;gEAED;;;;;;;iEAQI;;;;;;;gEACZ;;;;;;;gEACH;;;;;;;gEACE;;;;;;;gEACO;;;;;;iCAEE;iCACM;gCACmC;qBAC/C;wBACE;iCACU;iCACA;mCACK;6BAEL;qCACI;yBACC;0BACT;+BACE;+BACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0B9B,IAAIC,4BAA4B;AAEhC,SAASC,0BAA0BC,QAAwB;IACzD,0FAA0F;IAC1F,OAAQA;QACN,KAAK;YACH,OAAO;QACT,KAAK;YACH,OAAO;QACT;YACE,OAAO;IACX;AACF;AAEA,SAASC,uBAAuBC,WAAmB,EAAEF,QAAwB;IAC3E,MAAMG,cAAcJ,0BAA0BC;IAC9C,iFAAiF;IACjF,OAAOI,eAAI,CAACC,OAAO,CACjBC,sBAAW,CAACC,MAAM,CAACL,aAAa,GAAGC,YAAY,aAAa,CAAC,KAC3DG,sBAAW,CAACC,MAAM,CAACL,aAAa,gCAChC;AAEN;AAEA,8EAA8E;AAC9E,uEAAuE;AACvE,SAASM;IACP,MAAM,EACJC,KAAK,EACN,GAA0DC,QAAQ;IAOnE,MAAMC,gCAAgCF,MAAMG,SAAS,CAClDC,oBAAoB;IAEvB,IAAI,CAACF,8BAA8BG,SAAS,EAAE;QAC5CH,8BAA8BG,SAAS,GAAG;QAC1C,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,WAAWnL,sBAAW,CAACC,MAAM,CAACkL,UAAUF,sBAAsBxB;AACvE"}
|
|
1
|
+
{"version":3,"sources":["ExpoMetroConfig.ts"],"sourcesContent":[null],"names":["EXPO_DEBUG","INTERNAL_CALLSITES_REGEX","createStableModuleIdFactory","getDefaultConfig","internal_supervisingTransformerPath","unstable_transformerPath","hasWarnedAboutReactNative","getReactNativeHostPackage","platform","isOutOfTreePlatform","getHostPackageForPlatform","getReactNativeHostPath","projectRoot","hostPackage","path","dirname","resolveFrom","silent","patchMetroGraphToSupportUncachedModules","Graph","require","original_traverseDependencies","prototype","traverseDependencies","__patched","paths","options","dependencies","forEach","dependency","output","find","file","data","css","skipCache","includes","setOnReadonly","unstable_transformResultKey","push","call","createNumericModuleIdFactory","fileToIdMap","Map","nextId","modulePath","id","get","set","memoize","fn","cache","args","key","JSON","stringify","has","result","asMetroConfigInput","config","root","getModulePath","scope","isVirtualModule","isAbsolute","toPosixPath","relative","memoizedGetModulePath","context","env","environment","Error","mode","isCSSEnabled","unstable_beforeAssetSerializationPlugins","getDefaultMetroConfig","mergeConfig","reactNativePath","console","log","chalk","yellow","sourceExtsConfig","isTS","isReact","isModern","sourceExts","getBareExtensions","reanimatedVersion","getPkgVersion","workletsVersion","babelRuntimeVersion","sassVersion","pkg","getPackageJson","error","name","watchFolders","getWatchFolders","nodeModulesPaths","getModulesPaths","version","join","metroDefaultValues","getDefaultValues","restoredRoot","EXPO_METRO_CACHE_RESTORE_DIR","outputRoot","EXPO_METRO_CACHE_OUTPUT_DIR","cacheStores","BuildCacheStore","FileStore","os","tmpdir","serverRoot","getMetroServerRoot","routerPackageRoot","expoMetroConfig","reporter","update","resolver","unstable_conditionsByPlatform","ios","android","Object","fromEntries","OUT_OF_TREE_PLATFORMS","map","web","resolverMainFields","platforms","assetExts","concat","filter","assetExt","blockList","exclusionList","watcher","additionalExts","serializer","isThirdPartyModule","module","test","match","createModuleIdFactory","EXPO_USE_METRO_REQUIRE","bind","getModulesRunBeforeMainModule","reactNativeHostPath","preModules","requireUtils","resolve","stdRuntime","event","metroRuntime","getExpoMetroRuntimeOptional","getPolyfills","server","rewriteRequestUrl","getRewriteRequestUrl","port","Number","RCT_METRO_PORT","unstable_serverRoot","symbolicator","customizeFrame","getDefaultCustomizeFrame","transformerPath","transformer","unstable_workerThreads","_expoRouterPath","undefined","postcssHash","getPostcssConfigHash","browserslistHash","browserslist","stableHash","toString","_expoRelativeProjectRoot","unstable_allowRequireContext","allowOptionalDependencies","babelTransformerPath","asyncRequireModulePath","getExpoOptional","assetRegistryPath","enableBabelRuntime","enableBabelRCLookup","getTransformOptions","transform","experimentalImportSupport","inlineRequires","metroConfig","useWatchman","withExpoSerializers","subModule","EXPO_METRO_RUNTIME","baseExpoRouter","baseExpo"],"mappings":"AAAA,qEAAqE;;;;;;;;;;;;;;;;;;;;QA8dxDA;eAAAA;;QAHSC;eAAAA,wCAAwB;;QA5T9BC;eAAAA;;QA8CAC;eAAAA;;QA0QHC;eAAAA;;QADAC;eAAAA;;;;yBArdkB;;;;;;;yBACuB;;;;;;;yBAC3B;;;;;;;gEAED;;;;;;;yBAYnB;;;;;;;iEACuB;;;;;;;gEACZ;;;;;;;gEACH;;;;;;;gEACE;;;;;;;gEACO;;;;;;iCAEE;iCACM;gCACmC;qBAC/C;wBACE;iCACU;iCACA;mCACK;6BAEL;qCACI;yBACC;0BACT;+BACE;+BACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0B9B,IAAIC,4BAA4B;AAEhC,SAASC,0BAA0BC,QAAwB;IACzD,OAAOC,IAAAA,gCAAmB,EAACD,YAAYE,IAAAA,sCAAyB,EAACF,YAAa;AAChF;AAEA,SAASG,uBAAuBC,WAAmB,EAAEJ,QAAwB;IAC3E,MAAMK,cAAcN,0BAA0BC;IAC9C,iFAAiF;IACjF,OAAOM,eAAI,CAACC,OAAO,CACjBC,sBAAW,CAACC,MAAM,CAACL,aAAa,GAAGC,YAAY,aAAa,CA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zC,eAAe1I,sBAAW,CAACC,MAAM,CAACL,aAAauL;IACrD,IAAIzC,cAAc;QAChB,OAAOA;IACT;IACA,wGAAwG;IACxG,wGAAwG;IACxG,uEAAuE;IACvE,MAAM0C,iBAAiBpL,sBAAW,CAACC,MAAM,CAACL,aAAa;IACvD,IAAIwL,gBAAgB;QAClB,OAAOpL,sBAAW,CAACC,MAAM,CAACmL,gBAAgBD;IAC5C;IACA,qGAAqG;IACrG,2BAA2B;IAC3B,MAAME,WAAWd,gBAAgB3K;IACjC,OAAOyL,WAAWrL,sBAAW,CAACC,MAAM,CAACoL,UAAUF,sBAAsBxB;AACvE"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { SerializerConfigT } from '@expo/metro/metro-config';
|
|
2
|
+
import type { MixedOutput, Module, ReadOnlyGraph } from '@expo/metro/metro/DeltaBundler/types';
|
|
3
|
+
import type { ExpoSerializerOptions } from '../fork/baseJSBundle';
|
|
4
|
+
import type { SerialAsset } from '../serializerAssets';
|
|
5
|
+
import type { ChunkingImplementation, SerializeChunkOptions } from './chunkingStrategy';
|
|
6
|
+
export declare function getBaseUrlOption(...args: Parameters<typeof import('../fork/baseJSBundle').getBaseUrlOption>): string;
|
|
7
|
+
export declare function getPlatformOption(...args: Parameters<typeof import('../fork/baseJSBundle').getPlatformOption>): string | null;
|
|
8
|
+
export declare class Chunk {
|
|
9
|
+
name: string;
|
|
10
|
+
entries: Set<Module<MixedOutput>>;
|
|
11
|
+
graph: ReadOnlyGraph<MixedOutput>;
|
|
12
|
+
options: ExpoSerializerOptions;
|
|
13
|
+
private readonly strategy;
|
|
14
|
+
isAsync: boolean;
|
|
15
|
+
isVendor: boolean;
|
|
16
|
+
isEntry: boolean;
|
|
17
|
+
deps: Set<Module>;
|
|
18
|
+
preModules: Set<Module>;
|
|
19
|
+
requiredChunks: Set<Chunk>;
|
|
20
|
+
/** Whether this chunk owns an isolated module registry and must retain all of its dependencies.
|
|
21
|
+
* @remarks
|
|
22
|
+
* When a chunk is sealed, its `deps` and `preModules` shouldn't be altered, and it doesn't qualify
|
|
23
|
+
* for bundle/chunk splitting. This is the case for web workers, which must form a "closed" and
|
|
24
|
+
* self-sufficient entry bundle.
|
|
25
|
+
*/
|
|
26
|
+
sealed: boolean;
|
|
27
|
+
constructor(name: string, entries: Set<Module<MixedOutput>>, graph: ReadOnlyGraph<MixedOutput>, options: ExpoSerializerOptions, strategy: ChunkingImplementation, isAsync?: boolean, isVendor?: boolean, isEntry?: boolean);
|
|
28
|
+
seal(): void;
|
|
29
|
+
private getPlatform;
|
|
30
|
+
getFilename(src: string): string;
|
|
31
|
+
getStableChunkSource(serializerConfig: Partial<SerializerConfigT>): string;
|
|
32
|
+
private serializeToCodeWithTemplates;
|
|
33
|
+
hasAbsolutePath(absolutePath: string): boolean;
|
|
34
|
+
private _asyncTargets?;
|
|
35
|
+
getAsyncChunkTargets(chunksByPath: Map<string, Chunk>): Set<Chunk>;
|
|
36
|
+
private getAdjustedSourceMapUrl;
|
|
37
|
+
private serializeToCode;
|
|
38
|
+
private boolishTransformOption;
|
|
39
|
+
serializeToAssetsAsync(serializerConfig: Partial<SerializerConfigT>, chunksByPath: Map<string, Chunk>, filenamesByChunk: Map<Chunk, string>, { includeSourceMaps, unstable_beforeAssetSerializationPlugins }: SerializeChunkOptions): Promise<SerialAsset[]>;
|
|
40
|
+
private supportsBytecode;
|
|
41
|
+
isHermesEnabled(): boolean;
|
|
42
|
+
}
|
|
43
|
+
export declare function getSortedModules(modules: Module<MixedOutput>[], { createModuleId, }: {
|
|
44
|
+
createModuleId: (path: string) => number;
|
|
45
|
+
}): readonly Module<any>[];
|
|
@@ -0,0 +1,409 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
0 && (module.exports = {
|
|
6
|
+
Chunk: null,
|
|
7
|
+
getBaseUrlOption: null,
|
|
8
|
+
getPlatformOption: null,
|
|
9
|
+
getSortedModules: null
|
|
10
|
+
});
|
|
11
|
+
function _export(target, all) {
|
|
12
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: Object.getOwnPropertyDescriptor(all, name).get
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
_export(exports, {
|
|
18
|
+
get Chunk () {
|
|
19
|
+
return Chunk;
|
|
20
|
+
},
|
|
21
|
+
get getBaseUrlOption () {
|
|
22
|
+
return getBaseUrlOption;
|
|
23
|
+
},
|
|
24
|
+
get getPlatformOption () {
|
|
25
|
+
return getPlatformOption;
|
|
26
|
+
},
|
|
27
|
+
get getSortedModules () {
|
|
28
|
+
return getSortedModules;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
function _bundleToString() {
|
|
32
|
+
const data = /*#__PURE__*/ _interop_require_default(require("@expo/metro/metro/lib/bundleToString"));
|
|
33
|
+
_bundleToString = function() {
|
|
34
|
+
return data;
|
|
35
|
+
};
|
|
36
|
+
return data;
|
|
37
|
+
}
|
|
38
|
+
function _assert() {
|
|
39
|
+
const data = /*#__PURE__*/ _interop_require_default(require("assert"));
|
|
40
|
+
_assert = function() {
|
|
41
|
+
return data;
|
|
42
|
+
};
|
|
43
|
+
return data;
|
|
44
|
+
}
|
|
45
|
+
function _path() {
|
|
46
|
+
const data = /*#__PURE__*/ _interop_require_default(require("path"));
|
|
47
|
+
_path = function() {
|
|
48
|
+
return data;
|
|
49
|
+
};
|
|
50
|
+
return data;
|
|
51
|
+
}
|
|
52
|
+
const _filePath = require("../../utils/filePath");
|
|
53
|
+
const _debugId = require("../debugId");
|
|
54
|
+
const _exportPath = require("../exportPath");
|
|
55
|
+
const _sourceMap = require("../sourceMap");
|
|
56
|
+
function _interop_require_default(obj) {
|
|
57
|
+
return obj && obj.__esModule ? obj : {
|
|
58
|
+
default: obj
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
// Lazy-loaded to avoid pulling in metro-source-map at startup
|
|
62
|
+
let _buildHermesBundleAsync;
|
|
63
|
+
function getBuildHermesBundleAsync() {
|
|
64
|
+
if (!_buildHermesBundleAsync) {
|
|
65
|
+
_buildHermesBundleAsync = require('../exportHermes').buildHermesBundleAsync;
|
|
66
|
+
}
|
|
67
|
+
return _buildHermesBundleAsync;
|
|
68
|
+
}
|
|
69
|
+
let _baseJSBundleWithDependencies;
|
|
70
|
+
function getBaseJSBundleWithDependencies() {
|
|
71
|
+
if (!_baseJSBundleWithDependencies) {
|
|
72
|
+
_baseJSBundleWithDependencies = require('../fork/baseJSBundle').baseJSBundleWithDependencies;
|
|
73
|
+
}
|
|
74
|
+
return _baseJSBundleWithDependencies;
|
|
75
|
+
}
|
|
76
|
+
let _getBaseUrlOption;
|
|
77
|
+
function getBaseUrlOption(...args) {
|
|
78
|
+
if (!_getBaseUrlOption) {
|
|
79
|
+
_getBaseUrlOption = require('../fork/baseJSBundle').getBaseUrlOption;
|
|
80
|
+
}
|
|
81
|
+
return _getBaseUrlOption(...args);
|
|
82
|
+
}
|
|
83
|
+
let _getPlatformOption;
|
|
84
|
+
function getPlatformOption(...args) {
|
|
85
|
+
if (!_getPlatformOption) {
|
|
86
|
+
_getPlatformOption = require('../fork/baseJSBundle').getPlatformOption;
|
|
87
|
+
}
|
|
88
|
+
return _getPlatformOption(...args);
|
|
89
|
+
}
|
|
90
|
+
class Chunk {
|
|
91
|
+
name;
|
|
92
|
+
entries;
|
|
93
|
+
graph;
|
|
94
|
+
options;
|
|
95
|
+
strategy;
|
|
96
|
+
isAsync;
|
|
97
|
+
isVendor;
|
|
98
|
+
isEntry;
|
|
99
|
+
deps = new Set();
|
|
100
|
+
preModules = new Set();
|
|
101
|
+
// Chunks that are required to be loaded synchronously before this chunk.
|
|
102
|
+
// These are included in the HTML as <script> tags.
|
|
103
|
+
requiredChunks = new Set();
|
|
104
|
+
/** Whether this chunk owns an isolated module registry and must retain all of its dependencies.
|
|
105
|
+
* @remarks
|
|
106
|
+
* When a chunk is sealed, its `deps` and `preModules` shouldn't be altered, and it doesn't qualify
|
|
107
|
+
* for bundle/chunk splitting. This is the case for web workers, which must form a "closed" and
|
|
108
|
+
* self-sufficient entry bundle.
|
|
109
|
+
*/ sealed = false;
|
|
110
|
+
constructor(name, entries, graph, options, strategy, isAsync = false, isVendor = false, isEntry = false){
|
|
111
|
+
this.name = name;
|
|
112
|
+
this.entries = entries;
|
|
113
|
+
this.graph = graph;
|
|
114
|
+
this.options = options;
|
|
115
|
+
this.strategy = strategy;
|
|
116
|
+
this.isAsync = isAsync;
|
|
117
|
+
this.isVendor = isVendor;
|
|
118
|
+
this.isEntry = isEntry;
|
|
119
|
+
this.deps = new Set(entries);
|
|
120
|
+
}
|
|
121
|
+
seal() {
|
|
122
|
+
this.sealed = true;
|
|
123
|
+
}
|
|
124
|
+
getPlatform() {
|
|
125
|
+
(0, _assert().default)(this.graph.transformOptions.platform, "platform is required to be in graph's transformOptions");
|
|
126
|
+
return this.graph.transformOptions.platform;
|
|
127
|
+
}
|
|
128
|
+
getFilename(src) {
|
|
129
|
+
return !this.options.serializerOptions?.exporting ? this.name : (0, _exportPath.getExportPathForDependencyWithOptions)(this.name, {
|
|
130
|
+
platform: this.getPlatform(),
|
|
131
|
+
src,
|
|
132
|
+
serverRoot: this.options.serverRoot
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
getStableChunkSource(serializerConfig) {
|
|
136
|
+
return this.options.dev ? '' : this.serializeToCodeWithTemplates(serializerConfig, {
|
|
137
|
+
// Disable source maps when creating a sha to reduce the number of possible changes that could
|
|
138
|
+
// influence the cache hit.
|
|
139
|
+
serializerOptions: {
|
|
140
|
+
includeSourceMaps: false
|
|
141
|
+
},
|
|
142
|
+
sourceMapUrl: undefined,
|
|
143
|
+
debugId: undefined
|
|
144
|
+
}).code;
|
|
145
|
+
}
|
|
146
|
+
serializeToCodeWithTemplates(serializerConfig, options = {}) {
|
|
147
|
+
const entryFile = this.name;
|
|
148
|
+
// TODO: Disable all debugId steps when a dev server is enabled. This is an export-only feature.
|
|
149
|
+
const preModules = [
|
|
150
|
+
...(options.preModules ?? this.preModules).values()
|
|
151
|
+
];
|
|
152
|
+
const dependencies = [
|
|
153
|
+
...this.deps
|
|
154
|
+
];
|
|
155
|
+
const jsSplitBundle = getBaseJSBundleWithDependencies()(entryFile, preModules, dependencies, {
|
|
156
|
+
...this.options,
|
|
157
|
+
runBeforeMainModule: serializerConfig?.getModulesRunBeforeMainModule?.(_path().default.relative(this.options.projectRoot, entryFile)) ?? [],
|
|
158
|
+
runModule: this.options.runModule && !this.isVendor && (this.isEntry || !this.isAsync),
|
|
159
|
+
modulesOnly: this.options.modulesOnly || preModules.length === 0,
|
|
160
|
+
platform: this.getPlatform(),
|
|
161
|
+
baseUrl: getBaseUrlOption(this.graph, this.options),
|
|
162
|
+
splitChunks: !!this.options.serializerOptions?.splitChunks,
|
|
163
|
+
skipWrapping: true,
|
|
164
|
+
computedAsyncModulePaths: null,
|
|
165
|
+
...this.strategy.getStableSerializationOptions(this),
|
|
166
|
+
...options
|
|
167
|
+
});
|
|
168
|
+
return {
|
|
169
|
+
code: (0, _bundleToString().default)(jsSplitBundle).code,
|
|
170
|
+
paths: jsSplitBundle.paths
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
hasAbsolutePath(absolutePath) {
|
|
174
|
+
for (const dep of this.deps){
|
|
175
|
+
if (dep.path === absolutePath) {
|
|
176
|
+
return true;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
return false;
|
|
180
|
+
}
|
|
181
|
+
_asyncTargets;
|
|
182
|
+
getAsyncChunkTargets(chunksByPath) {
|
|
183
|
+
return this._asyncTargets ??= this.strategy.getAsyncChunkTargets(this, chunksByPath);
|
|
184
|
+
}
|
|
185
|
+
getAdjustedSourceMapUrl(filename) {
|
|
186
|
+
// Metro really only accounts for development, so we'll use the defaults here.
|
|
187
|
+
if (this.options.dev) {
|
|
188
|
+
return this.options.sourceMapUrl ?? null;
|
|
189
|
+
}
|
|
190
|
+
if (this.options.serializerOptions?.includeSourceMaps !== true) {
|
|
191
|
+
return null;
|
|
192
|
+
}
|
|
193
|
+
if (this.options.inlineSourceMap || !this.options.sourceMapUrl) {
|
|
194
|
+
return this.options.sourceMapUrl ?? null;
|
|
195
|
+
}
|
|
196
|
+
const platform = this.getPlatform();
|
|
197
|
+
const isAbsolute = platform !== 'web';
|
|
198
|
+
const baseUrl = getBaseUrlOption(this.graph, this.options);
|
|
199
|
+
const isAbsoluteBaseUrl = !!baseUrl?.match(/https?:\/\//);
|
|
200
|
+
const pathname = (isAbsoluteBaseUrl ? '' : baseUrl.replace(/\/+$/, '')) + '/' + filename.replace(/^\/+$/, '') + '.map';
|
|
201
|
+
let adjustedSourceMapUrl = this.options.sourceMapUrl;
|
|
202
|
+
// Metro has lots of issues...
|
|
203
|
+
if (this.options.sourceMapUrl.startsWith('//localhost')) {
|
|
204
|
+
adjustedSourceMapUrl = 'http:' + this.options.sourceMapUrl;
|
|
205
|
+
}
|
|
206
|
+
try {
|
|
207
|
+
const parsed = new URL(pathname, isAbsoluteBaseUrl ? baseUrl : adjustedSourceMapUrl);
|
|
208
|
+
if (isAbsoluteBaseUrl || isAbsolute) {
|
|
209
|
+
return parsed.href;
|
|
210
|
+
}
|
|
211
|
+
return parsed.pathname;
|
|
212
|
+
} catch (error) {
|
|
213
|
+
// NOTE: export:embed that don't use baseUrl will use file paths instead of URLs.
|
|
214
|
+
if (!this.options.dev && isAbsolute) {
|
|
215
|
+
return adjustedSourceMapUrl;
|
|
216
|
+
}
|
|
217
|
+
console.error(`Failed to link source maps because the source map URL "${this.options.sourceMapUrl}" is corrupt:`, error);
|
|
218
|
+
return null;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
serializeToCode(serializerConfig, { debugId, chunksByPath, filenamesByChunk, filename, preModules }) {
|
|
222
|
+
return this.serializeToCodeWithTemplates(serializerConfig, {
|
|
223
|
+
skipWrapping: false,
|
|
224
|
+
sourceMapUrl: this.getAdjustedSourceMapUrl(filename) ?? undefined,
|
|
225
|
+
debugId,
|
|
226
|
+
preModules,
|
|
227
|
+
...this.strategy.getSerializationOptions(this, chunksByPath, filenamesByChunk)
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
boolishTransformOption(name) {
|
|
231
|
+
const value = this.graph.transformOptions?.customTransformOptions?.[name];
|
|
232
|
+
return value === true || value === 'true' || value === '1';
|
|
233
|
+
}
|
|
234
|
+
async serializeToAssetsAsync(serializerConfig, chunksByPath, filenamesByChunk, { includeSourceMaps, unstable_beforeAssetSerializationPlugins }) {
|
|
235
|
+
const outputFile = filenamesByChunk.get(this);
|
|
236
|
+
(0, _assert().default)(outputFile, 'Precomputed filename missing for chunk: ' + this.name);
|
|
237
|
+
// We already use a stable hash for the output filename, so we'll reuse that for the debugId.
|
|
238
|
+
const debugId = (0, _debugId.stringToUUID)(_path().default.basename(outputFile, _path().default.extname(outputFile)));
|
|
239
|
+
let finalPreModules = [
|
|
240
|
+
...this.preModules
|
|
241
|
+
];
|
|
242
|
+
if (unstable_beforeAssetSerializationPlugins) {
|
|
243
|
+
for (const plugin of unstable_beforeAssetSerializationPlugins){
|
|
244
|
+
finalPreModules = plugin({
|
|
245
|
+
graph: this.graph,
|
|
246
|
+
premodules: finalPreModules,
|
|
247
|
+
debugId
|
|
248
|
+
});
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
const jsCode = this.serializeToCode(serializerConfig, {
|
|
252
|
+
chunksByPath,
|
|
253
|
+
filenamesByChunk,
|
|
254
|
+
filename: outputFile,
|
|
255
|
+
debugId,
|
|
256
|
+
preModules: new Set(finalPreModules)
|
|
257
|
+
});
|
|
258
|
+
const relativeEntry = _path().default.relative(this.options.projectRoot, this.name);
|
|
259
|
+
const { modulePaths, ...chunkMetadata } = this.strategy.getMetadata(this, filenamesByChunk);
|
|
260
|
+
const jsAsset = {
|
|
261
|
+
filename: outputFile,
|
|
262
|
+
originFilename: relativeEntry,
|
|
263
|
+
type: 'js',
|
|
264
|
+
metadata: {
|
|
265
|
+
...chunkMetadata,
|
|
266
|
+
isAsync: this.isAsync,
|
|
267
|
+
requires: [
|
|
268
|
+
...this.requiredChunks.values()
|
|
269
|
+
].map((chunk)=>{
|
|
270
|
+
const filename = filenamesByChunk.get(chunk);
|
|
271
|
+
(0, _assert().default)(filename, 'Precomputed filename missing for required chunk: ' + chunk.name);
|
|
272
|
+
return filename;
|
|
273
|
+
}),
|
|
274
|
+
// Provide a list of module paths that can be used for matching chunks to routes.
|
|
275
|
+
// TODO: Move HTML serializing closer to this code so we can reduce passing this much data around.
|
|
276
|
+
modulePaths,
|
|
277
|
+
paths: jsCode.paths,
|
|
278
|
+
expoDomComponentReferences: collectOutputReferences(this.deps, 'expoDomComponentReference'),
|
|
279
|
+
reactClientReferences: collectOutputReferences(this.deps, 'reactClientReference'),
|
|
280
|
+
reactServerReferences: collectOutputReferences(this.deps, 'reactServerReference'),
|
|
281
|
+
loaderReferences: collectOutputReferences(this.deps, 'loaderReference')
|
|
282
|
+
},
|
|
283
|
+
source: jsCode.code
|
|
284
|
+
};
|
|
285
|
+
const assets = [
|
|
286
|
+
jsAsset
|
|
287
|
+
];
|
|
288
|
+
// debugId is passed into `sourceMapString` so the bundler-map path
|
|
289
|
+
// emits it inline rather than a JSON.parse + JSON.stringify
|
|
290
|
+
// roundtrip; the Hermes branch below has to splice into a finished
|
|
291
|
+
// JSON string because `buildHermesBundleAsync` is opaque.
|
|
292
|
+
// NOTE: skipped for inline source maps since they don't need
|
|
293
|
+
// disambiguation. We only emit `debugId` (Sentry also reads
|
|
294
|
+
// `debug_id`, but bun doesn't).
|
|
295
|
+
if (// Only include the source map if the `options.sourceMapUrl` option is provided and we are exporting a static build.
|
|
296
|
+
includeSourceMaps && !this.options.inlineSourceMap && this.options.sourceMapUrl) {
|
|
297
|
+
const modules = [
|
|
298
|
+
...finalPreModules,
|
|
299
|
+
...getSortedModules([
|
|
300
|
+
...this.deps
|
|
301
|
+
], {
|
|
302
|
+
createModuleId: this.options.createModuleId
|
|
303
|
+
})
|
|
304
|
+
].map((module1)=>{
|
|
305
|
+
// TODO: Make this user-configurable.
|
|
306
|
+
// Make all paths relative to the server root to prevent the entire user filesystem from being exposed.
|
|
307
|
+
if (_path().default.isAbsolute(module1.path)) {
|
|
308
|
+
return {
|
|
309
|
+
...module1,
|
|
310
|
+
path: '/' + (0, _filePath.toPosixPath)(_path().default.relative(this.options.serverRoot ?? this.options.projectRoot, module1.path))
|
|
311
|
+
};
|
|
312
|
+
}
|
|
313
|
+
return module1;
|
|
314
|
+
});
|
|
315
|
+
// TODO: We may not need to set `debugId` on the bundler sourcemap when
|
|
316
|
+
// Hermes is enabled, since we ship a separate `.hbc.map` for that case.
|
|
317
|
+
const sourceMap = (0, _sourceMap.sourceMapString)(modules, {
|
|
318
|
+
excludeSource: false,
|
|
319
|
+
...this.options,
|
|
320
|
+
debugId
|
|
321
|
+
});
|
|
322
|
+
assets.push({
|
|
323
|
+
filename: this.options.dev ? jsAsset.filename + '.map' : outputFile + '.map',
|
|
324
|
+
originFilename: jsAsset.originFilename,
|
|
325
|
+
type: 'map',
|
|
326
|
+
metadata: {},
|
|
327
|
+
source: sourceMap
|
|
328
|
+
});
|
|
329
|
+
}
|
|
330
|
+
if (this.boolishTransformOption('bytecode') && this.isHermesEnabled()) {
|
|
331
|
+
const adjustedSource = jsAsset.source.replace(/^\/\/# (sourceMappingURL)=(.*)$/gm, (...props)=>{
|
|
332
|
+
if (props[1] === 'sourceMappingURL') {
|
|
333
|
+
const mapName = props[2].replace(/\.js\.map$/, '.hbc.map');
|
|
334
|
+
return `//# ${props[1]}=` + mapName;
|
|
335
|
+
}
|
|
336
|
+
return '';
|
|
337
|
+
});
|
|
338
|
+
// TODO: Generate hbc for each chunk
|
|
339
|
+
const hermesBundleOutput = await getBuildHermesBundleAsync()({
|
|
340
|
+
projectRoot: this.options.projectRoot,
|
|
341
|
+
filename: this.name,
|
|
342
|
+
code: adjustedSource,
|
|
343
|
+
map: assets[1] ? assets[1].source : null,
|
|
344
|
+
// TODO: Maybe allow prod + no minify.
|
|
345
|
+
minify: true
|
|
346
|
+
});
|
|
347
|
+
if (hermesBundleOutput.hbc) {
|
|
348
|
+
// TODO: Unclear if we should add multiple assets, link the assets, or mutate the first asset.
|
|
349
|
+
// jsAsset.metadata.hbc = hermesBundleOutput.hbc;
|
|
350
|
+
// @ts-expect-error: TODO
|
|
351
|
+
jsAsset.source = hermesBundleOutput.hbc;
|
|
352
|
+
jsAsset.filename = jsAsset.filename.replace(/\.js$/, '.hbc');
|
|
353
|
+
// Replace mappings with hbc
|
|
354
|
+
if (jsAsset.metadata.paths) {
|
|
355
|
+
jsAsset.metadata.paths = Object.fromEntries(Object.entries(jsAsset.metadata.paths).map(([key, value])=>[
|
|
356
|
+
key,
|
|
357
|
+
Object.fromEntries(Object.entries(value).map(([key, value])=>{
|
|
358
|
+
(0, _assert().default)(value == null || typeof value === 'string', 'Hermes async paths must remain scalar.');
|
|
359
|
+
return [
|
|
360
|
+
key,
|
|
361
|
+
value ? value.replace(/\.js$/, '.hbc') : value
|
|
362
|
+
];
|
|
363
|
+
}))
|
|
364
|
+
]));
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
if (assets[1] && hermesBundleOutput.sourcemap) {
|
|
368
|
+
assets[1].source = debugId ? (0, _sourceMap.appendDebugIdToSourceMap)(hermesBundleOutput.sourcemap, debugId) : hermesBundleOutput.sourcemap;
|
|
369
|
+
assets[1].filename = assets[1].filename.replace(/\.js\.map$/, '.hbc.map');
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
return assets;
|
|
373
|
+
}
|
|
374
|
+
supportsBytecode() {
|
|
375
|
+
return this.getPlatform() !== 'web';
|
|
376
|
+
}
|
|
377
|
+
isHermesEnabled() {
|
|
378
|
+
// TODO: Revisit.
|
|
379
|
+
// TODO: There could be an issue with having the serializer for export:embed output hermes since the native scripts will
|
|
380
|
+
// also create hermes bytecode. We may need to disable in one of the two places.
|
|
381
|
+
return !this.options.dev && this.supportsBytecode() && this.graph.transformOptions.customTransformOptions?.engine === 'hermes';
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
function getSortedModules(modules, { createModuleId }) {
|
|
385
|
+
// Assign IDs to modules in a consistent order
|
|
386
|
+
for (const module1 of modules){
|
|
387
|
+
createModuleId(module1.path);
|
|
388
|
+
}
|
|
389
|
+
// Sort by IDs
|
|
390
|
+
return modules.sort((a, b)=>createModuleId(a.path) - createModuleId(b.path));
|
|
391
|
+
}
|
|
392
|
+
function collectOutputReferences(modules, key) {
|
|
393
|
+
return [
|
|
394
|
+
...new Set([
|
|
395
|
+
...modules
|
|
396
|
+
].map((module1)=>{
|
|
397
|
+
return module1.output.map((output)=>{
|
|
398
|
+
// TODO: This is a mess. This needs to be properly typed
|
|
399
|
+
const data = output.data;
|
|
400
|
+
if (key in data && typeof data[key] === 'string') {
|
|
401
|
+
return data[key];
|
|
402
|
+
}
|
|
403
|
+
return undefined;
|
|
404
|
+
});
|
|
405
|
+
}).flat())
|
|
406
|
+
].filter((value)=>typeof value === 'string');
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
//# sourceMappingURL=Chunk.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["serializer/chunking/Chunk.ts"],"sourcesContent":[null],"names":["Chunk","getBaseUrlOption","getPlatformOption","getSortedModules","_buildHermesBundleAsync","getBuildHermesBundleAsync","require","buildHermesBundleAsync","_baseJSBundleWithDependencies","getBaseJSBundleWithDependencies","baseJSBundleWithDependencies","_getBaseUrlOption","args","_getPlatformOption","deps","Set","preModules","requiredChunks","sealed","name","entries","graph","options","strategy","isAsync","isVendor","isEntry","seal","getPlatform","assert","transformOptions","platform","getFilename","src","serializerOptions","exporting","getExportPathForDependencyWithOptions","serverRoot","getStableChunkSource","serializerConfig","dev","serializeToCodeWithTemplates","includeSourceMaps","sourceMapUrl","undefined","debugId","code","entryFile","values","dependencies","jsSplitBundle","runBeforeMainModule","getModulesRunBeforeMainModule","path","relative","projectRoot","runModule","modulesOnly","length","baseUrl","splitChunks","skipWrapping","computedAsyncModulePaths","getStableSerializationOptions","bundleToString","paths","hasAbsolutePath","absolutePath","dep","_asyncTargets","getAsyncChunkTargets","chunksByPath","getAdjustedSourceMapUrl","filename","inlineSourceMap","isAbsolute","isAbsoluteBaseUrl","match","pathname","replace","adjustedSourceMapUrl","startsWith","parsed","URL","href","error","console","serializeToCode","filenamesByChunk","getSerializationOptions","boolishTransformOption","value","customTransformOptions","serializeToAssetsAsync","unstable_beforeAssetSerializationPlugins","outputFile","get","stringToUUID","basename","extname","finalPreModules","plugin","premodules","jsCode","relativeEntry","modulePaths","chunkMetadata","getMetadata","jsAsset","originFilename","type","metadata","requires","map","chunk","expoDomComponentReferences","collectOutputReferences","reactClientReferences","reactServerReferences","loaderReferences","source","assets","modules","createModuleId","module","toPosixPath","sourceMap","sourceMapString","excludeSource","push","isHermesEnabled","adjustedSource","props","mapName","hermesBundleOutput","minify","hbc","Object","fromEntries","key","sourcemap","appendDebugIdToSourceMap","supportsBytecode","engine","sort","a","b","output","data","flat","filter"],"mappings":";;;;;;;;;;;;;;;;;QAuDaA;eAAAA;;QAnBGC;eAAAA;;QAUAC;eAAAA;;QAsYAC;eAAAA;;;;gEAlbW;;;;;;;gEACR;;;;;;;gEACF;;;;;;0BAEW;yBACC;4BACyB;2BAGI;;;;;;AAO1D,8DAA8D;AAC9D,IAAIC;AACJ,SAASC;IACP,IAAI,CAACD,yBAAyB;QAC5BA,0BAA0BE,QAAQ,mBAAmBC,sBAAsB;IAC7E;IACA,OAAOH;AACT;AAEA,IAAII;AACJ,SAASC;IACP,IAAI,CAACD,+BAA+B;QAClCA,gCAAgCF,QAAQ,wBAAwBI,4BAA4B;IAC9F;IACA,OAAOF;AACT;AAEA,IAAIG;AACG,SAASV,iBACd,GAAGW,IAAwE;IAE3E,IAAI,CAACD,mBAAmB;QACtBA,oBAAoBL,QAAQ,wBAAw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T,IAAI,KAAK,UAAU;oBAChD,OAAOS,IAAI,CAACT,IAAI;gBAClB;gBACA,OAAO/F;YACT;QACF,GACCyG,IAAI;KAEV,CAACC,MAAM,CAAC,CAAC3D,QAA2B,OAAOA,UAAU;AACxD"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { SerializerConfigT } from '@expo/metro/metro-config';
|
|
2
|
+
import type { Module, ReadOnlyGraph, ResolvedDependency } from '@expo/metro/metro/DeltaBundler/types';
|
|
3
|
+
import type { ExpoSerializerOptions } from '../fork/baseJSBundle';
|
|
4
|
+
import type { ChunkingStrategy, SerialAsset } from '../serializerAssets';
|
|
5
|
+
import type { SerializerConfigOptions } from '../withExpoSerializers';
|
|
6
|
+
import { Chunk } from './Chunk';
|
|
7
|
+
export type SerializeChunkOptions = {
|
|
8
|
+
includeSourceMaps: boolean;
|
|
9
|
+
splitChunks: boolean;
|
|
10
|
+
chunkingStrategy: ChunkingStrategy;
|
|
11
|
+
} & SerializerConfigOptions;
|
|
12
|
+
export type ChunkingContext = {
|
|
13
|
+
serializerConfig: Partial<SerializerConfigT>;
|
|
14
|
+
serializeChunkOptions: SerializeChunkOptions;
|
|
15
|
+
entryFile: string;
|
|
16
|
+
preModules: readonly Module[];
|
|
17
|
+
graph: ReadOnlyGraph;
|
|
18
|
+
options: ExpoSerializerOptions;
|
|
19
|
+
};
|
|
20
|
+
export type ChunkSerializationOptions = Partial<Parameters<typeof import('../fork/baseJSBundle').baseJSBundleWithDependencies>[3]>;
|
|
21
|
+
type ChunkStrategySerializationOptions = Pick<ChunkSerializationOptions, 'computedAsyncModulePaths' | 'includeAsyncPaths' | 'includeChunkCompletion' | 'unstable_getAsyncDependencyPath'>;
|
|
22
|
+
export type ChunkingImplementation = {
|
|
23
|
+
serializeAsync(): Promise<SerialAsset[]>;
|
|
24
|
+
/**
|
|
25
|
+
* Chunks referenced by emitted async URLs, used to calculate filename hashes.
|
|
26
|
+
* Must match the targets used by getSerializationOptions.
|
|
27
|
+
*/
|
|
28
|
+
getAsyncChunkTargets(chunk: Chunk, chunksByPath: Map<string, Chunk>): Set<Chunk>;
|
|
29
|
+
/**
|
|
30
|
+
* Options used before dependency filenames are known, including for filename hashing.
|
|
31
|
+
* Final serialization also uses these as defaults.
|
|
32
|
+
*/
|
|
33
|
+
getStableSerializationOptions(chunk: Chunk): ChunkStrategySerializationOptions;
|
|
34
|
+
getSerializationOptions(chunk: Chunk, chunksByPath: Map<string, Chunk>, filenamesByChunk: Map<Chunk, string>): ChunkStrategySerializationOptions;
|
|
35
|
+
getMetadata(chunk: Chunk, filenamesByChunk: Map<Chunk, string>): Pick<SerialAsset['metadata'], 'chunkingStrategy' | 'entryPaths' | 'entryChunks' | 'modulePaths'>;
|
|
36
|
+
};
|
|
37
|
+
export declare function createChunkCollector({ graph, options, preModules: runtimePremodules }: ChunkingContext, strategy: ChunkingImplementation, chunks: Set<Chunk>, shouldTraverseDependency: (dependency: ResolvedDependency) => boolean): (entryPath: string, preModules: readonly Module[], isAsync?: boolean, isEntry?: boolean) => Chunk | undefined;
|
|
38
|
+
export declare function createRuntimeChunk(entryChunk: Chunk, chunks: Set<Chunk>, strategy: ChunkingImplementation, requiredBy?: Iterable<Chunk>): void;
|
|
39
|
+
export declare function serializeChunksAsync(chunks: Set<Chunk>, { serializerConfig, serializeChunkOptions, options }: ChunkingContext): Promise<SerialAsset[]>;
|
|
40
|
+
export {};
|