@expo/metro-config 0.17.0 → 0.17.2
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 +13 -2
- package/build/ExpoMetroConfig.js +5 -2
- package/build/ExpoMetroConfig.js.map +1 -1
- package/build/serializer/serializeChunks.d.ts +3 -5
- package/build/serializer/serializeChunks.js +40 -18
- package/build/serializer/serializeChunks.js.map +1 -1
- package/build/serializer/withExpoSerializers.d.ts +12 -5
- package/build/serializer/withExpoSerializers.js +26 -14
- package/build/serializer/withExpoSerializers.js.map +1 -1
- package/package.json +6 -5
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Reporter } from 'metro';
|
|
1
|
+
import { MixedOutput, Module, ReadOnlyGraph, Reporter } from 'metro';
|
|
2
2
|
import { ConfigT as MetroConfig, InputConfigT } from 'metro-config';
|
|
3
3
|
import { INTERNAL_CALLSITES_REGEX } from './customizeFrame';
|
|
4
4
|
export interface LoadOptions {
|
|
@@ -18,7 +18,18 @@ export interface DefaultConfigOptions {
|
|
|
18
18
|
* is subject to change, and native support for CSS Modules may be added in the future during a non-major SDK release.
|
|
19
19
|
*/
|
|
20
20
|
isCSSEnabled?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* **Experimental:** Modify premodules before a code asset is serialized
|
|
23
|
+
*
|
|
24
|
+
* This is an experimental feature and may change in the future. The underlying implementation
|
|
25
|
+
* is subject to change.
|
|
26
|
+
*/
|
|
27
|
+
unstable_beforeAssetSerializationPlugins?: ((serializationInput: {
|
|
28
|
+
graph: ReadOnlyGraph<MixedOutput>;
|
|
29
|
+
premodules: Module[];
|
|
30
|
+
debugId?: string;
|
|
31
|
+
}) => Module[])[];
|
|
21
32
|
}
|
|
22
|
-
export declare function getDefaultConfig(projectRoot: string, { mode, isCSSEnabled }?: DefaultConfigOptions): InputConfigT;
|
|
33
|
+
export declare function getDefaultConfig(projectRoot: string, { mode, isCSSEnabled, unstable_beforeAssetSerializationPlugins }?: DefaultConfigOptions): InputConfigT;
|
|
23
34
|
export { MetroConfig, INTERNAL_CALLSITES_REGEX };
|
|
24
35
|
export declare const EXPO_DEBUG: boolean;
|
package/build/ExpoMetroConfig.js
CHANGED
|
@@ -200,7 +200,8 @@ function patchMetroGraphToSupportUncachedModules() {
|
|
|
200
200
|
}
|
|
201
201
|
function getDefaultConfig(projectRoot, {
|
|
202
202
|
mode,
|
|
203
|
-
isCSSEnabled = true
|
|
203
|
+
isCSSEnabled = true,
|
|
204
|
+
unstable_beforeAssetSerializationPlugins
|
|
204
205
|
} = {}) {
|
|
205
206
|
const {
|
|
206
207
|
getDefaultConfig: getDefaultMetroConfig,
|
|
@@ -352,7 +353,9 @@ function getDefaultConfig(projectRoot, {
|
|
|
352
353
|
})
|
|
353
354
|
}
|
|
354
355
|
});
|
|
355
|
-
return (0, _withExpoSerializers().withExpoSerializers)(metroConfig
|
|
356
|
+
return (0, _withExpoSerializers().withExpoSerializers)(metroConfig, {
|
|
357
|
+
unstable_beforeAssetSerializationPlugins
|
|
358
|
+
});
|
|
356
359
|
}
|
|
357
360
|
|
|
358
361
|
// re-export for use in config files.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpoMetroConfig.js","names":["_config","data","require","_paths","runtimeEnv","_interopRequireWildcard","_jsonFile","_interopRequireDefault","_chalk","_metroCache","_metroConfig","_os","_path","_resolveFrom","_customizeFrame","_env2","_fileStore","_getModulesPaths","_getWatchFolders","_rewriteRequestUrl","_withExpoSerializers","_postcss","_metroConfig2","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","debug","getAssetPlugins","projectRoot","hashAssetFilesPath","resolveFrom","silent","Error","hasWarnedAboutExotic","patchMetroGraphToSupportUncachedModules","Graph","original_traverseDependencies","traverseDependencies","__patched","paths","options","dependencies","forEach","dependency","output","find","file","_file$data$css","css","skipCache","includes","path","unstable_transformResultKey","push","getDefaultConfig","mode","isCSSEnabled","getDefaultMetroConfig","mergeConfig","importMetroConfig","isExotic","env","EXPO_USE_EXOTIC","console","log","chalk","gray","bold","reactNativePath","dirname","babelPresetFbjsPath","process","EXPO_METRO_CACHE_KEY_VERSION","String","version","sourceExtsConfig","isTS","isReact","isModern","sourceExts","getBareExtensions","reanimatedVersion","getPkgVersion","sassVersion","envFiles","getFiles","NODE_ENV","pkg","getPackageJson","watchFolders","getWatchFolders","nodeModulesPaths","getModulesPaths","EXPO_DEBUG","join","reporter","metroDefaultValues","getDefaultValues","cacheStore","FileStore","root","os","tmpdir","metroConfig","resolver","unstable_conditionsByPlatform","ios","android","web","unstable_conditionNames","resolverMainFields","platforms","assetExts","concat","filter","assetExt","cacheStores","watcher","additionalExts","map","replace","serializer","getModulesRunBeforeMainModule","preModules","resolve","stdRuntime","metroRuntime","getPolyfills","server","rewriteRequestUrl","getRewriteRequestUrl","port","Number","RCT_METRO_PORT","unstable_serverRoot","getServerRoot","symbolicator","customizeFrame","getDefaultCustomizeFrame","transformerPath","transformer","postcssHash","getPostcssConfigHash","browserslistHash","browserslist","stableHash","JSON","stringify","toString","unstable_allowRequireContext","allowOptionalDependencies","babelTransformerPath","asyncRequireModulePath","assetRegistryPath","assetPlugins","getTransformOptions","transform","experimentalImportSupport","inlineRequires","withExpoSerializers","exports","pkgName","targetPkg","targetPkgJson","findUpPackageJson","JsonFile","read","pkgVersion","cwd","sep","found"],"sources":["../src/ExpoMetroConfig.ts"],"sourcesContent":["// Copyright 2023-present 650 Industries (Expo). All rights reserved.\nimport { getPackageJson } from '@expo/config';\nimport { getBareExtensions } from '@expo/config/paths';\nimport * as runtimeEnv from '@expo/env';\nimport JsonFile from '@expo/json-file';\nimport chalk from 'chalk';\nimport { Reporter } from 'metro';\nimport { stableHash } from 'metro-cache';\nimport { ConfigT as MetroConfig, InputConfigT } from 'metro-config';\nimport os from 'os';\nimport path from 'path';\nimport resolveFrom from 'resolve-from';\n\nimport { getDefaultCustomizeFrame, INTERNAL_CALLSITES_REGEX } from './customizeFrame';\nimport { env } from './env';\nimport { FileStore } from './file-store';\nimport { getModulesPaths, getServerRoot } from './getModulesPaths';\nimport { getWatchFolders } from './getWatchFolders';\nimport { getRewriteRequestUrl } from './rewriteRequestUrl';\nimport { JSModule } from './serializer/getCssDeps';\nimport { withExpoSerializers } from './serializer/withExpoSerializers';\nimport { getPostcssConfigHash } from './transform-worker/postcss';\nimport { importMetroConfig } from './traveling/metro-config';\nconst debug = require('debug')('expo:metro:config') as typeof console.log;\n\nexport interface LoadOptions {\n config?: string;\n maxWorkers?: number;\n port?: number;\n reporter?: Reporter;\n resetCache?: boolean;\n}\n\nexport interface DefaultConfigOptions {\n /** @deprecated */\n mode?: 'exotic';\n /**\n * **Experimental:** Enable CSS support for Metro web, and shim on native.\n *\n * This is an experimental feature and may change in the future. The underlying implementation\n * is subject to change, and native support for CSS Modules may be added in the future during a non-major SDK release.\n */\n isCSSEnabled?: boolean;\n}\n\nfunction getAssetPlugins(projectRoot: string): string[] {\n const hashAssetFilesPath = resolveFrom.silent(projectRoot, 'expo-asset/tools/hashAssetFiles');\n\n if (!hashAssetFilesPath) {\n throw new Error(`The required package \\`expo-asset\\` cannot be found`);\n }\n\n return [hashAssetFilesPath];\n}\n\nlet hasWarnedAboutExotic = false;\n\n// Patch Metro's graph to support always parsing certain modules. This enables\n// things like Tailwind CSS which update based on their own heuristics.\nfunction patchMetroGraphToSupportUncachedModules() {\n const { Graph } = require('metro/src/DeltaBundler/Graph');\n\n const original_traverseDependencies = Graph.prototype.traverseDependencies;\n if (!original_traverseDependencies.__patched) {\n original_traverseDependencies.__patched = true;\n\n Graph.prototype.traverseDependencies = function (paths: string[], options: unknown) {\n this.dependencies.forEach((dependency: JSModule) => {\n // Find any dependencies that have been marked as `skipCache` and ensure they are invalidated.\n // `skipCache` is set when a CSS module is found by PostCSS.\n if (\n dependency.output.find((file) => file.data.css?.skipCache) &&\n !paths.includes(dependency.path)\n ) {\n // Ensure we invalidate the `unstable_transformResultKey` (input hash) so the module isn't removed in\n // the Graph._processModule method.\n dependency.unstable_transformResultKey = dependency.unstable_transformResultKey + '.';\n\n // Add the path to the list of modified paths so it gets run through the transformer again,\n // this will ensure it is passed to PostCSS -> Tailwind.\n paths.push(dependency.path);\n }\n });\n // Invoke the original method with the new paths to ensure the standard behavior is preserved.\n return original_traverseDependencies.call(this, paths, options);\n };\n // Ensure we don't patch the method twice.\n Graph.prototype.traverseDependencies.__patched = true;\n }\n}\n\nexport function getDefaultConfig(\n projectRoot: string,\n { mode, isCSSEnabled = true }: DefaultConfigOptions = {}\n): InputConfigT {\n const { getDefaultConfig: getDefaultMetroConfig, mergeConfig } = importMetroConfig(projectRoot);\n\n if (isCSSEnabled) {\n patchMetroGraphToSupportUncachedModules();\n }\n\n const isExotic = mode === 'exotic' || env.EXPO_USE_EXOTIC;\n\n if (isExotic && !hasWarnedAboutExotic) {\n hasWarnedAboutExotic = true;\n console.log(\n chalk.gray(`\\u203A Feature ${chalk.bold`EXPO_USE_EXOTIC`} is no longer supported.`)\n );\n }\n\n const reactNativePath = path.dirname(resolveFrom(projectRoot, 'react-native/package.json'));\n\n try {\n // Set the `EXPO_METRO_CACHE_KEY_VERSION` variable for use in the custom babel transformer.\n // This hack is used because there doesn't appear to be anyway to resolve\n // `babel-preset-fbjs` relative to the project root later (in `metro-expo-babel-transformer`).\n const babelPresetFbjsPath = resolveFrom(projectRoot, 'babel-preset-fbjs/package.json');\n process.env.EXPO_METRO_CACHE_KEY_VERSION = String(require(babelPresetFbjsPath).version);\n } catch {\n // noop -- falls back to a hardcoded value.\n }\n\n const sourceExtsConfig = { isTS: true, isReact: true, isModern: true };\n const sourceExts = getBareExtensions([], sourceExtsConfig);\n\n // Add support for cjs (without platform extensions).\n sourceExts.push('cjs');\n\n const reanimatedVersion = getPkgVersion(projectRoot, 'react-native-reanimated');\n\n let sassVersion: string | null = null;\n if (isCSSEnabled) {\n sassVersion = getPkgVersion(projectRoot, 'sass');\n // Enable SCSS by default so we can provide a better error message\n // when sass isn't installed.\n sourceExts.push('scss', 'sass', 'css');\n }\n\n const envFiles = runtimeEnv.getFiles(process.env.NODE_ENV, { silent: true });\n\n const pkg = getPackageJson(projectRoot);\n const watchFolders = getWatchFolders(projectRoot);\n const nodeModulesPaths = getModulesPaths(projectRoot);\n if (env.EXPO_DEBUG) {\n console.log();\n console.log(`Expo Metro config:`);\n try {\n console.log(`- Version: ${require('../package.json').version}`);\n } catch {}\n console.log(`- Extensions: ${sourceExts.join(', ')}`);\n console.log(`- React Native: ${reactNativePath}`);\n console.log(`- Watch Folders: ${watchFolders.join(', ')}`);\n console.log(`- Node Module Paths: ${nodeModulesPaths.join(', ')}`);\n console.log(`- Env Files: ${envFiles}`);\n console.log(`- Sass: ${sassVersion}`);\n console.log(`- Reanimated: ${reanimatedVersion}`);\n console.log();\n }\n\n const {\n // Remove the default reporter which metro always resolves to be the react-native-community/cli reporter.\n // This prints a giant React logo which is less accessible to users on smaller terminals.\n reporter,\n ...metroDefaultValues\n } = getDefaultMetroConfig.getDefaultValues(projectRoot);\n\n const cacheStore = new FileStore<any>({\n root: path.join(os.tmpdir(), 'metro-cache'),\n });\n\n // Merge in the default config from Metro here, even though loadConfig uses it as defaults.\n // This is a convenience for getDefaultConfig use in metro.config.js, e.g. to modify assetExts.\n const metroConfig: Partial<MetroConfig> = mergeConfig(metroDefaultValues, {\n watchFolders,\n resolver: {\n unstable_conditionsByPlatform: {\n ios: ['react-native'],\n android: ['react-native'],\n // This is removed for server platforms.\n web: ['browser'],\n },\n unstable_conditionNames: ['require', 'import'],\n resolverMainFields: ['react-native', 'browser', 'main'],\n platforms: ['ios', 'android'],\n assetExts: metroDefaultValues.resolver.assetExts\n .concat(\n // Add default support for `expo-image` file types.\n ['heic', 'avif']\n )\n .filter((assetExt) => !sourceExts.includes(assetExt)),\n sourceExts,\n nodeModulesPaths,\n },\n cacheStores: [cacheStore],\n watcher: {\n // strip starting dot from env files\n additionalExts: envFiles.map((file: string) => file.replace(/^\\./, '')),\n },\n serializer: {\n getModulesRunBeforeMainModule: () => {\n const preModules: string[] = [\n // MUST be first\n require.resolve(path.join(reactNativePath, 'Libraries/Core/InitializeCore')),\n ];\n\n const stdRuntime = resolveFrom.silent(projectRoot, 'expo/build/winter');\n if (stdRuntime) {\n preModules.push(stdRuntime);\n }\n\n // We need to shift this to be the first module so web Fast Refresh works as expected.\n // This will only be applied if the module is installed and imported somewhere in the bundle already.\n const metroRuntime = resolveFrom.silent(projectRoot, '@expo/metro-runtime');\n if (metroRuntime) {\n preModules.push(metroRuntime);\n }\n\n return preModules;\n },\n getPolyfills: () => require('@react-native/js-polyfills')(),\n },\n server: {\n rewriteRequestUrl: getRewriteRequestUrl(projectRoot),\n port: Number(env.RCT_METRO_PORT) || 8081,\n // NOTE(EvanBacon): Moves the server root down to the monorepo root.\n // This enables proper monorepo support for web.\n unstable_serverRoot: getServerRoot(projectRoot),\n },\n symbolicator: {\n customizeFrame: getDefaultCustomizeFrame(),\n },\n transformerPath: require.resolve('./transform-worker/transform-worker'),\n transformer: {\n // Custom: These are passed to `getCacheKey` and ensure invalidation when the version changes.\n // @ts-expect-error: not on type.\n postcssHash: getPostcssConfigHash(projectRoot),\n browserslistHash: pkg.browserslist\n ? stableHash(JSON.stringify(pkg.browserslist)).toString('hex')\n : null,\n sassVersion,\n // Ensure invalidation when the version changes due to the Babel plugin.\n reanimatedVersion,\n\n // `require.context` support\n unstable_allowRequireContext: true,\n allowOptionalDependencies: true,\n babelTransformerPath: require.resolve('./babel-transformer'),\n // See: https://github.com/facebook/react-native/blob/v0.73.0/packages/metro-config/index.js#L72-L74\n asyncRequireModulePath: resolveFrom(\n reactNativePath,\n metroDefaultValues.transformer.asyncRequireModulePath\n ),\n assetRegistryPath: '@react-native/assets-registry/registry',\n assetPlugins: getAssetPlugins(projectRoot),\n getTransformOptions: async () => ({\n transform: {\n experimentalImportSupport: false,\n inlineRequires: false,\n },\n }),\n },\n });\n\n return withExpoSerializers(metroConfig);\n}\n\n// re-export for use in config files.\nexport { MetroConfig, INTERNAL_CALLSITES_REGEX };\n\n// re-export for legacy cases.\nexport const EXPO_DEBUG = env.EXPO_DEBUG;\n\nfunction getPkgVersion(projectRoot: string, pkgName: string): string | null {\n const targetPkg = resolveFrom.silent(projectRoot, pkgName);\n if (!targetPkg) return null;\n const targetPkgJson = findUpPackageJson(targetPkg);\n if (!targetPkgJson) return null;\n const pkg = JsonFile.read(targetPkgJson);\n\n debug(`${pkgName} package.json:`, targetPkgJson);\n const pkgVersion = pkg.version;\n if (typeof pkgVersion === 'string') {\n return pkgVersion;\n }\n\n return null;\n}\n\nfunction findUpPackageJson(cwd: string): string | null {\n if (['.', path.sep].includes(cwd)) return null;\n\n const found = resolveFrom.silent(cwd, './package.json');\n if (found) {\n return found;\n }\n return findUpPackageJson(path.dirname(cwd));\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AACA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAE,OAAA;EAAA,MAAAF,IAAA,GAAAC,OAAA;EAAAC,MAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAG,WAAA;EAAA,MAAAH,IAAA,GAAAI,uBAAA,CAAAH,OAAA;EAAAE,UAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAK,UAAA;EAAA,MAAAL,IAAA,GAAAM,sBAAA,CAAAL,OAAA;EAAAI,SAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,OAAA;EAAA,MAAAP,IAAA,GAAAM,sBAAA,CAAA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equireWildcard","_jsonFile","_interopRequireDefault","_chalk","_metroCache","_metroConfig","_os","_path","_resolveFrom","_customizeFrame","_env2","_fileStore","_getModulesPaths","_getWatchFolders","_rewriteRequestUrl","_withExpoSerializers","_postcss","_metroConfig2","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","debug","getAssetPlugins","projectRoot","hashAssetFilesPath","resolveFrom","silent","Error","hasWarnedAboutExotic","patchMetroGraphToSupportUncachedModules","Graph","original_traverseDependencies","traverseDependencies","__patched","paths","options","dependencies","forEach","dependency","output","find","file","_file$data$css","css","skipCache","includes","path","unstable_transformResultKey","push","getDefaultConfig","mode","isCSSEnabled","unstable_beforeAssetSerializationPlugins","getDefaultMetroConfig","mergeConfig","importMetroConfig","isExotic","env","EXPO_USE_EXOTIC","console","log","chalk","gray","bold","reactNativePath","dirname","babelPresetFbjsPath","process","EXPO_METRO_CACHE_KEY_VERSION","String","version","sourceExtsConfig","isTS","isReact","isModern","sourceExts","getBareExtensions","reanimatedVersion","getPkgVersion","sassVersion","envFiles","getFiles","NODE_ENV","pkg","getPackageJson","watchFolders","getWatchFolders","nodeModulesPaths","getModulesPaths","EXPO_DEBUG","join","reporter","metroDefaultValues","getDefaultValues","cacheStore","FileStore","root","os","tmpdir","metroConfig","resolver","unstable_conditionsByPlatform","ios","android","web","unstable_conditionNames","resolverMainFields","platforms","assetExts","concat","filter","assetExt","cacheStores","watcher","additionalExts","map","replace","serializer","getModulesRunBeforeMainModule","preModules","resolve","stdRuntime","metroRuntime","getPolyfills","server","rewriteRequestUrl","getRewriteRequestUrl","port","Number","RCT_METRO_PORT","unstable_serverRoot","getServerRoot","symbolicator","customizeFrame","getDefaultCustomizeFrame","transformerPath","transformer","postcssHash","getPostcssConfigHash","browserslistHash","browserslist","stableHash","JSON","stringify","toString","unstable_allowRequireContext","allowOptionalDependencies","babelTransformerPath","asyncRequireModulePath","assetRegistryPath","assetPlugins","getTransformOptions","transform","experimentalImportSupport","inlineRequires","withExpoSerializers","exports","pkgName","targetPkg","targetPkgJson","findUpPackageJson","JsonFile","read","pkgVersion","cwd","sep","found"],"sources":["../src/ExpoMetroConfig.ts"],"sourcesContent":["// Copyright 2023-present 650 Industries (Expo). All rights reserved.\nimport { getPackageJson } from '@expo/config';\nimport { getBareExtensions } from '@expo/config/paths';\nimport * as runtimeEnv from '@expo/env';\nimport JsonFile from '@expo/json-file';\nimport chalk from 'chalk';\nimport { MixedOutput, Module, ReadOnlyGraph, Reporter } from 'metro';\nimport { stableHash } from 'metro-cache';\nimport { ConfigT as MetroConfig, InputConfigT } from 'metro-config';\nimport os from 'os';\nimport path from 'path';\nimport resolveFrom from 'resolve-from';\n\nimport { getDefaultCustomizeFrame, INTERNAL_CALLSITES_REGEX } from './customizeFrame';\nimport { env } from './env';\nimport { FileStore } from './file-store';\nimport { getModulesPaths, getServerRoot } from './getModulesPaths';\nimport { getWatchFolders } from './getWatchFolders';\nimport { getRewriteRequestUrl } from './rewriteRequestUrl';\nimport { JSModule } from './serializer/getCssDeps';\nimport { withExpoSerializers } from './serializer/withExpoSerializers';\nimport { getPostcssConfigHash } from './transform-worker/postcss';\nimport { importMetroConfig } from './traveling/metro-config';\nconst debug = require('debug')('expo:metro:config') as typeof console.log;\n\nexport interface LoadOptions {\n config?: string;\n maxWorkers?: number;\n port?: number;\n reporter?: Reporter;\n resetCache?: boolean;\n}\n\nexport interface DefaultConfigOptions {\n /** @deprecated */\n mode?: 'exotic';\n /**\n * **Experimental:** Enable CSS support for Metro web, and shim on native.\n *\n * This is an experimental feature and may change in the future. The underlying implementation\n * is subject to change, and native support for CSS Modules may be added in the future during a non-major SDK release.\n */\n isCSSEnabled?: boolean;\n\n /**\n * **Experimental:** Modify premodules before a code asset is serialized\n *\n * This is an experimental feature and may change in the future. The underlying implementation\n * is subject to change.\n */\n unstable_beforeAssetSerializationPlugins?: ((serializationInput: {\n graph: ReadOnlyGraph<MixedOutput>;\n premodules: Module[];\n debugId?: string;\n }) => Module[])[];\n}\n\nfunction getAssetPlugins(projectRoot: string): string[] {\n const hashAssetFilesPath = resolveFrom.silent(projectRoot, 'expo-asset/tools/hashAssetFiles');\n\n if (!hashAssetFilesPath) {\n throw new Error(`The required package \\`expo-asset\\` cannot be found`);\n }\n\n return [hashAssetFilesPath];\n}\n\nlet hasWarnedAboutExotic = false;\n\n// Patch Metro's graph to support always parsing certain modules. This enables\n// things like Tailwind CSS which update based on their own heuristics.\nfunction patchMetroGraphToSupportUncachedModules() {\n const { Graph } = require('metro/src/DeltaBundler/Graph');\n\n const original_traverseDependencies = Graph.prototype.traverseDependencies;\n if (!original_traverseDependencies.__patched) {\n original_traverseDependencies.__patched = true;\n\n Graph.prototype.traverseDependencies = function (paths: string[], options: unknown) {\n this.dependencies.forEach((dependency: JSModule) => {\n // Find any dependencies that have been marked as `skipCache` and ensure they are invalidated.\n // `skipCache` is set when a CSS module is found by PostCSS.\n if (\n dependency.output.find((file) => file.data.css?.skipCache) &&\n !paths.includes(dependency.path)\n ) {\n // Ensure we invalidate the `unstable_transformResultKey` (input hash) so the module isn't removed in\n // the Graph._processModule method.\n dependency.unstable_transformResultKey = dependency.unstable_transformResultKey + '.';\n\n // Add the path to the list of modified paths so it gets run through the transformer again,\n // this will ensure it is passed to PostCSS -> Tailwind.\n paths.push(dependency.path);\n }\n });\n // Invoke the original method with the new paths to ensure the standard behavior is preserved.\n return original_traverseDependencies.call(this, paths, options);\n };\n // Ensure we don't patch the method twice.\n Graph.prototype.traverseDependencies.__patched = true;\n }\n}\n\nexport function getDefaultConfig(\n projectRoot: string,\n { mode, isCSSEnabled = true, unstable_beforeAssetSerializationPlugins }: DefaultConfigOptions = {}\n): InputConfigT {\n const { getDefaultConfig: getDefaultMetroConfig, mergeConfig } = importMetroConfig(projectRoot);\n\n if (isCSSEnabled) {\n patchMetroGraphToSupportUncachedModules();\n }\n\n const isExotic = mode === 'exotic' || env.EXPO_USE_EXOTIC;\n\n if (isExotic && !hasWarnedAboutExotic) {\n hasWarnedAboutExotic = true;\n console.log(\n chalk.gray(`\\u203A Feature ${chalk.bold`EXPO_USE_EXOTIC`} is no longer supported.`)\n );\n }\n\n const reactNativePath = path.dirname(resolveFrom(projectRoot, 'react-native/package.json'));\n\n try {\n // Set the `EXPO_METRO_CACHE_KEY_VERSION` variable for use in the custom babel transformer.\n // This hack is used because there doesn't appear to be anyway to resolve\n // `babel-preset-fbjs` relative to the project root later (in `metro-expo-babel-transformer`).\n const babelPresetFbjsPath = resolveFrom(projectRoot, 'babel-preset-fbjs/package.json');\n process.env.EXPO_METRO_CACHE_KEY_VERSION = String(require(babelPresetFbjsPath).version);\n } catch {\n // noop -- falls back to a hardcoded value.\n }\n\n const sourceExtsConfig = { isTS: true, isReact: true, isModern: true };\n const sourceExts = getBareExtensions([], sourceExtsConfig);\n\n // Add support for cjs (without platform extensions).\n sourceExts.push('cjs');\n\n const reanimatedVersion = getPkgVersion(projectRoot, 'react-native-reanimated');\n\n let sassVersion: string | null = null;\n if (isCSSEnabled) {\n sassVersion = getPkgVersion(projectRoot, 'sass');\n // Enable SCSS by default so we can provide a better error message\n // when sass isn't installed.\n sourceExts.push('scss', 'sass', 'css');\n }\n\n const envFiles = runtimeEnv.getFiles(process.env.NODE_ENV, { silent: true });\n\n const pkg = getPackageJson(projectRoot);\n const watchFolders = getWatchFolders(projectRoot);\n const nodeModulesPaths = getModulesPaths(projectRoot);\n if (env.EXPO_DEBUG) {\n console.log();\n console.log(`Expo Metro config:`);\n try {\n console.log(`- Version: ${require('../package.json').version}`);\n } catch {}\n console.log(`- Extensions: ${sourceExts.join(', ')}`);\n console.log(`- React Native: ${reactNativePath}`);\n console.log(`- Watch Folders: ${watchFolders.join(', ')}`);\n console.log(`- Node Module Paths: ${nodeModulesPaths.join(', ')}`);\n console.log(`- Env Files: ${envFiles}`);\n console.log(`- Sass: ${sassVersion}`);\n console.log(`- Reanimated: ${reanimatedVersion}`);\n console.log();\n }\n\n const {\n // Remove the default reporter which metro always resolves to be the react-native-community/cli reporter.\n // This prints a giant React logo which is less accessible to users on smaller terminals.\n reporter,\n ...metroDefaultValues\n } = getDefaultMetroConfig.getDefaultValues(projectRoot);\n\n const cacheStore = new FileStore<any>({\n root: path.join(os.tmpdir(), 'metro-cache'),\n });\n\n // Merge in the default config from Metro here, even though loadConfig uses it as defaults.\n // This is a convenience for getDefaultConfig use in metro.config.js, e.g. to modify assetExts.\n const metroConfig: Partial<MetroConfig> = mergeConfig(metroDefaultValues, {\n watchFolders,\n resolver: {\n unstable_conditionsByPlatform: {\n ios: ['react-native'],\n android: ['react-native'],\n // This is removed for server platforms.\n web: ['browser'],\n },\n unstable_conditionNames: ['require', 'import'],\n resolverMainFields: ['react-native', 'browser', 'main'],\n platforms: ['ios', 'android'],\n assetExts: metroDefaultValues.resolver.assetExts\n .concat(\n // Add default support for `expo-image` file types.\n ['heic', 'avif']\n )\n .filter((assetExt) => !sourceExts.includes(assetExt)),\n sourceExts,\n nodeModulesPaths,\n },\n cacheStores: [cacheStore],\n watcher: {\n // strip starting dot from env files\n additionalExts: envFiles.map((file: string) => file.replace(/^\\./, '')),\n },\n serializer: {\n getModulesRunBeforeMainModule: () => {\n const preModules: string[] = [\n // MUST be first\n require.resolve(path.join(reactNativePath, 'Libraries/Core/InitializeCore')),\n ];\n\n const stdRuntime = resolveFrom.silent(projectRoot, 'expo/build/winter');\n if (stdRuntime) {\n preModules.push(stdRuntime);\n }\n\n // We need to shift this to be the first module so web Fast Refresh works as expected.\n // This will only be applied if the module is installed and imported somewhere in the bundle already.\n const metroRuntime = resolveFrom.silent(projectRoot, '@expo/metro-runtime');\n if (metroRuntime) {\n preModules.push(metroRuntime);\n }\n\n return preModules;\n },\n getPolyfills: () => require('@react-native/js-polyfills')(),\n },\n server: {\n rewriteRequestUrl: getRewriteRequestUrl(projectRoot),\n port: Number(env.RCT_METRO_PORT) || 8081,\n // NOTE(EvanBacon): Moves the server root down to the monorepo root.\n // This enables proper monorepo support for web.\n unstable_serverRoot: getServerRoot(projectRoot),\n },\n symbolicator: {\n customizeFrame: getDefaultCustomizeFrame(),\n },\n transformerPath: require.resolve('./transform-worker/transform-worker'),\n transformer: {\n // Custom: These are passed to `getCacheKey` and ensure invalidation when the version changes.\n // @ts-expect-error: not on type.\n postcssHash: getPostcssConfigHash(projectRoot),\n browserslistHash: pkg.browserslist\n ? stableHash(JSON.stringify(pkg.browserslist)).toString('hex')\n : null,\n sassVersion,\n // Ensure invalidation when the version changes due to the Babel plugin.\n reanimatedVersion,\n\n // `require.context` support\n unstable_allowRequireContext: true,\n allowOptionalDependencies: true,\n babelTransformerPath: require.resolve('./babel-transformer'),\n // See: https://github.com/facebook/react-native/blob/v0.73.0/packages/metro-config/index.js#L72-L74\n asyncRequireModulePath: resolveFrom(\n reactNativePath,\n metroDefaultValues.transformer.asyncRequireModulePath\n ),\n assetRegistryPath: '@react-native/assets-registry/registry',\n assetPlugins: getAssetPlugins(projectRoot),\n getTransformOptions: async () => ({\n transform: {\n experimentalImportSupport: false,\n inlineRequires: false,\n },\n }),\n },\n });\n\n return withExpoSerializers(metroConfig, { unstable_beforeAssetSerializationPlugins });\n}\n\n// re-export for use in config files.\nexport { MetroConfig, INTERNAL_CALLSITES_REGEX };\n\n// re-export for legacy cases.\nexport const EXPO_DEBUG = env.EXPO_DEBUG;\n\nfunction getPkgVersion(projectRoot: string, pkgName: string): string | null {\n const targetPkg = resolveFrom.silent(projectRoot, pkgName);\n if (!targetPkg) return null;\n const targetPkgJson = findUpPackageJson(targetPkg);\n if (!targetPkgJson) return null;\n const pkg = JsonFile.read(targetPkgJson);\n\n debug(`${pkgName} package.json:`, targetPkgJson);\n const pkgVersion = pkg.version;\n if (typeof pkgVersion === 'string') {\n return pkgVersion;\n }\n\n return null;\n}\n\nfunction findUpPackageJson(cwd: string): string | null {\n if (['.', path.sep].includes(cwd)) return null;\n\n const found =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D,IAAI,CAACC,aAAa,EAAE,OAAO,IAAI;EAC/B,MAAM5E,GAAG,GAAG8E,mBAAQ,CAACC,IAAI,CAACH,aAAa,CAAC;EAExC1I,KAAK,CAAE,GAAEwI,OAAQ,gBAAe,EAAEE,aAAa,CAAC;EAChD,MAAMI,UAAU,GAAGhF,GAAG,CAACb,OAAO;EAC9B,IAAI,OAAO6F,UAAU,KAAK,QAAQ,EAAE;IAClC,OAAOA,UAAU;EACnB;EAEA,OAAO,IAAI;AACb;AAEA,SAASH,iBAAiBA,CAACI,GAAW,EAAiB;EACrD,IAAI,CAAC,GAAG,EAAEtH,eAAI,CAACuH,GAAG,CAAC,CAACxH,QAAQ,CAACuH,GAAG,CAAC,EAAE,OAAO,IAAI;EAE9C,MAAME,KAAK,GAAG7I,sBAAW,CAACC,MAAM,CAAC0I,GAAG,EAAE,gBAAgB,CAAC;EACvD,IAAIE,KAAK,EAAE;IACT,OAAOA,KAAK;EACd;EACA,OAAON,iBAAiB,CAAClH,eAAI,CAACmB,OAAO,CAACmG,GAAG,CAAC,CAAC;AAC7C"}
|
|
@@ -2,12 +2,13 @@ import { AssetData, MetroConfig, MixedOutput, Module, ReadOnlyGraph } from 'metr
|
|
|
2
2
|
import { ConfigT, SerializerConfigT } from 'metro-config';
|
|
3
3
|
import { ExpoSerializerOptions } from './fork/baseJSBundle';
|
|
4
4
|
import { SerialAsset } from './serializerAssets';
|
|
5
|
+
import { SerializerConfigOptions } from './withExpoSerializers';
|
|
5
6
|
type Serializer = NonNullable<ConfigT['serializer']['customSerializer']>;
|
|
6
7
|
type SerializerParameters = Parameters<Serializer>;
|
|
7
8
|
export type SerializeChunkOptions = {
|
|
8
9
|
includeSourceMaps: boolean;
|
|
9
10
|
includeBytecode: boolean;
|
|
10
|
-
};
|
|
11
|
+
} & SerializerConfigOptions;
|
|
11
12
|
export declare function graphToSerialAssetsAsync(config: MetroConfig, serializeChunkOptions: SerializeChunkOptions, ...props: SerializerParameters): Promise<{
|
|
12
13
|
artifacts: SerialAsset[] | null;
|
|
13
14
|
assets: AssetData[];
|
|
@@ -32,10 +33,7 @@ export declare class Chunk {
|
|
|
32
33
|
private getComputedPathsForAsyncDependencies;
|
|
33
34
|
private getAdjustedSourceMapUrl;
|
|
34
35
|
private serializeToCode;
|
|
35
|
-
serializeToAssetsAsync(serializerConfig: Partial<SerializerConfigT>, chunks: Chunk[], { includeSourceMaps, includeBytecode, }:
|
|
36
|
-
includeSourceMaps?: boolean;
|
|
37
|
-
includeBytecode?: boolean;
|
|
38
|
-
}): Promise<SerialAsset[]>;
|
|
36
|
+
serializeToAssetsAsync(serializerConfig: Partial<SerializerConfigT>, chunks: Chunk[], { includeSourceMaps, includeBytecode, unstable_beforeAssetSerializationPlugins, }: SerializeChunkOptions): Promise<SerialAsset[]>;
|
|
39
37
|
private supportsBytecode;
|
|
40
38
|
isHermesEnabled(): boolean;
|
|
41
39
|
}
|
|
@@ -34,13 +34,6 @@ function _path() {
|
|
|
34
34
|
};
|
|
35
35
|
return data;
|
|
36
36
|
}
|
|
37
|
-
function _pathToRegexp() {
|
|
38
|
-
const data = _interopRequireDefault(require("path-to-regexp"));
|
|
39
|
-
_pathToRegexp = function () {
|
|
40
|
-
return data;
|
|
41
|
-
};
|
|
42
|
-
return data;
|
|
43
|
-
}
|
|
44
37
|
function _debugId() {
|
|
45
38
|
const data = require("./debugId");
|
|
46
39
|
_debugId = function () {
|
|
@@ -91,6 +84,17 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
91
84
|
* LICENSE file in the root directory of this source tree.
|
|
92
85
|
*/
|
|
93
86
|
|
|
87
|
+
// Convert file paths to regex matchers.
|
|
88
|
+
function pathToRegex(path) {
|
|
89
|
+
// Escape regex special characters, except for '*'
|
|
90
|
+
let regexSafePath = path.replace(/[-[\]{}()+?.,\\^$|#\s]/g, '\\$&');
|
|
91
|
+
|
|
92
|
+
// Replace '*' with '.*' to act as a wildcard in regex
|
|
93
|
+
regexSafePath = regexSafePath.replace(/\*/g, '.*');
|
|
94
|
+
|
|
95
|
+
// Create a RegExp object with the modified string
|
|
96
|
+
return new RegExp('^' + regexSafePath + '$');
|
|
97
|
+
}
|
|
94
98
|
async function graphToSerialAssetsAsync(config, serializeChunkOptions, ...props) {
|
|
95
99
|
var _config$serializer, _baseUrl$replace, _config$transformer$a, _config$transformer, _getPlatformOption;
|
|
96
100
|
const [entryFile, preModules, graph, options] = props;
|
|
@@ -102,7 +106,7 @@ async function graphToSerialAssetsAsync(config, serializeChunkOptions, ...props)
|
|
|
102
106
|
// Create chunks for splitting.
|
|
103
107
|
const chunks = new Set();
|
|
104
108
|
[{
|
|
105
|
-
test: (
|
|
109
|
+
test: pathToRegex(entryFile)
|
|
106
110
|
}].map(chunkSettings => gatherChunks(chunks, chunkSettings, preModules, graph, options, false));
|
|
107
111
|
|
|
108
112
|
// Get the common modules and extract them into a separate chunk.
|
|
@@ -152,6 +156,18 @@ async function graphToSerialAssetsAsync(config, serializeChunkOptions, ...props)
|
|
|
152
156
|
// entryChunk.requiredChunks.add(commonChunk);
|
|
153
157
|
// chunks.add(commonChunk);
|
|
154
158
|
}
|
|
159
|
+
|
|
160
|
+
// TODO: Optimize this pass more.
|
|
161
|
+
// Remove all dependencies from async chunks that are already in the common chunk.
|
|
162
|
+
for (const chunk of [...chunks.values()]) {
|
|
163
|
+
if (chunk !== entryChunk) {
|
|
164
|
+
for (const dep of chunk.deps) {
|
|
165
|
+
if (entryChunk.deps.has(dep)) {
|
|
166
|
+
chunk.deps.delete(dep);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
155
171
|
}
|
|
156
172
|
const jsAssets = await serializeChunksAsync(chunks, (_config$serializer = config.serializer) !== null && _config$serializer !== void 0 ? _config$serializer : {}, serializeChunkOptions);
|
|
157
173
|
|
|
@@ -312,12 +328,24 @@ class Chunk {
|
|
|
312
328
|
}
|
|
313
329
|
async serializeToAssetsAsync(serializerConfig, chunks, {
|
|
314
330
|
includeSourceMaps,
|
|
315
|
-
includeBytecode
|
|
331
|
+
includeBytecode,
|
|
332
|
+
unstable_beforeAssetSerializationPlugins
|
|
316
333
|
}) {
|
|
317
334
|
// Create hash without wrapping to prevent it changing when the wrapping changes.
|
|
318
335
|
const outputFile = this.getFilenameForConfig(serializerConfig);
|
|
319
336
|
// We already use a stable hash for the output filename, so we'll reuse that for the debugId.
|
|
320
337
|
const debugId = (0, _debugId().stringToUUID)(_path().default.basename(outputFile, _path().default.extname(outputFile)));
|
|
338
|
+
let premodules = [...this.preModules];
|
|
339
|
+
if (unstable_beforeAssetSerializationPlugins) {
|
|
340
|
+
for (const plugin of unstable_beforeAssetSerializationPlugins) {
|
|
341
|
+
premodules = plugin({
|
|
342
|
+
graph: this.graph,
|
|
343
|
+
premodules,
|
|
344
|
+
debugId
|
|
345
|
+
});
|
|
346
|
+
}
|
|
347
|
+
this.preModules = new Set(premodules);
|
|
348
|
+
}
|
|
321
349
|
const jsCode = this.serializeToCode(serializerConfig, {
|
|
322
350
|
chunks,
|
|
323
351
|
debugId
|
|
@@ -459,7 +487,7 @@ function gatherChunks(chunks, settings, preModules, graph, options, isAsync = fa
|
|
|
459
487
|
// Support disabling multiple chunks.
|
|
460
488
|
splitChunks) {
|
|
461
489
|
gatherChunks(chunks, {
|
|
462
|
-
test: (
|
|
490
|
+
test: pathToRegex(dependency.absolutePath)
|
|
463
491
|
}, [], graph, options, true);
|
|
464
492
|
} else {
|
|
465
493
|
const module = graph.dependencies.get(dependency.absolutePath);
|
|
@@ -478,17 +506,11 @@ function gatherChunks(chunks, settings, preModules, graph, options, isAsync = fa
|
|
|
478
506
|
}
|
|
479
507
|
return chunks;
|
|
480
508
|
}
|
|
481
|
-
async function serializeChunksAsync(chunks, serializerConfig, {
|
|
482
|
-
includeSourceMaps,
|
|
483
|
-
includeBytecode
|
|
484
|
-
}) {
|
|
509
|
+
async function serializeChunksAsync(chunks, serializerConfig, options) {
|
|
485
510
|
const jsAssets = [];
|
|
486
511
|
const chunksArray = [...chunks.values()];
|
|
487
512
|
await Promise.all(chunksArray.map(async chunk => {
|
|
488
|
-
jsAssets.push(...(await chunk.serializeToAssetsAsync(serializerConfig, chunksArray,
|
|
489
|
-
includeSourceMaps,
|
|
490
|
-
includeBytecode
|
|
491
|
-
})));
|
|
513
|
+
jsAssets.push(...(await chunk.serializeToAssetsAsync(serializerConfig, chunksArray, options)));
|
|
492
514
|
}));
|
|
493
515
|
return jsAssets;
|
|
494
516
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serializeChunks.js","names":["_assert","data","_interopRequireDefault","require","_sourceMapString","_bundleToString","_path","_pathToRegexp","_debugId","_exportHermes","_exportPath","_baseJSBundle","_getCssDeps","_getAssets","obj","__esModule","default","graphToSerialAssetsAsync","config","serializeChunkOptions","props","_config$serializer","_baseUrl$replace","_config$transformer$a","_config$transformer","_getPlatformOption","entryFile","preModules","graph","options","cssDeps","getCssSerialAssets","dependencies","projectRoot","processModuleFilter","chunks","Set","test","pathToRegExp","map","chunkSettings","gatherChunks","entryChunk","values","find","chunk","isAsync","hasAbsolutePath","dep","deps","has","delete","toCompare","commonDependencies","length","shift","chunk2","commonDeps","filter","push","add","jsAssets","serializeChunksAsync","serializer","isExporting","baseUrl","getBaseUrlOption","serializerOptions","assetPublicUrl","replace","publicPath","transformOptions","platform","metroAssets","getMetroAssets","assetPlugins","transformer","getPlatformOption","artifacts","assets","Chunk","requiredChunks","constructor","name","entries","isVendor","getPlatform","assert","getFilename","src","dev","getExportPathForDependencyWithOptions","serverRoot","getStableChunkSource","serializerConfig","serializeToCodeWithTemplates","includeSourceMaps","sourceMapUrl","undefined","debugId","getFilenameForConfig","_serializerConfig$get","_serializerConfig$get2","jsSplitBundle","baseJSBundleWithDependencies","runBeforeMainModule","getModulesRunBeforeMainModule","call","path","relative","runModule","modulesOnly","size","splitChunks","getSplitChunksOption","skipWrapping","computedAsyncModulePaths","bundleToString","code","absolutePath","some","module","getComputedPathsForAsyncDependencies","includeAsyncPaths","forEach","dependency","asyncType","chunkContainingModule","moduleIdName","getAdjustedSourceMapUrl","_this$options$seriali","_this$options$sourceM","inlineSourceMap","_this$options$sourceM2","isAbsolute","filename","isAbsoluteBaseUrl","match","pathname","adjustedSourceMapUrl","startsWith","parsed","URL","href","error","console","serializeToCode","_this$getAdjustedSour","serializeToAssetsAsync","includeBytecode","outputFile","stringToUUID","basename","extname","jsCode","relativeEntry","jsAsset","originFilename","type","metadata","requires","modulePaths","source","mutateSourceMapWithDebugId","sourceMap","sourceMapObject","JSON","parse","stringify","modules","getSortedModules","createModuleId","_this$options$serverR","sourceMapString","excludeSource","isHermesEnabled","adjustedSource","mapName","hermesBundleOutput","buildHermesBundleAsync","minify","hbc","sourcemap","supportsBytecode","_this$graph$transform","customTransformOptions","engine","exports","getEntryModulesForChunkSettings","settings","chunkIdForModules","sort","join","entryModules","existingChunks","includes","includeModule","entryModule","get","chunksArray","Promise","all","a","b"],"sources":["../../src/serializer/serializeChunks.ts"],"sourcesContent":["/**\n * Copyright © 2023 650 Industries.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport assert from 'assert';\nimport {\n AssetData,\n MetroConfig,\n MixedOutput,\n Module,\n ReadOnlyGraph,\n SerializerOptions,\n} from 'metro';\nimport sourceMapString from 'metro/src/DeltaBundler/Serializers/sourceMapString';\nimport bundleToString from 'metro/src/lib/bundleToString';\nimport { ConfigT, SerializerConfigT } from 'metro-config';\nimport path from 'path';\nimport pathToRegExp from 'path-to-regexp';\n\nimport { stringToUUID } from './debugId';\nimport { buildHermesBundleAsync } from './exportHermes';\nimport { getExportPathForDependencyWithOptions } from './exportPath';\nimport {\n ExpoSerializerOptions,\n baseJSBundleWithDependencies,\n getBaseUrlOption,\n getPlatformOption,\n getSplitChunksOption,\n} from './fork/baseJSBundle';\nimport { getCssSerialAssets } from './getCssDeps';\nimport { SerialAsset } from './serializerAssets';\nimport getMetroAssets from '../transform-worker/getAssets';\n\ntype Serializer = NonNullable<ConfigT['serializer']['customSerializer']>;\n\ntype SerializerParameters = Parameters<Serializer>;\n\ntype ChunkSettings = {\n /** Match the initial modules. */\n test: RegExp;\n};\n\nexport type SerializeChunkOptions = {\n includeSourceMaps: boolean;\n includeBytecode: boolean;\n};\n\nexport async function graphToSerialAssetsAsync(\n config: MetroConfig,\n serializeChunkOptions: SerializeChunkOptions,\n ...props: SerializerParameters\n): Promise<{ artifacts: SerialAsset[] | null; assets: AssetData[] }> {\n const [entryFile, preModules, graph, options] = props;\n\n const cssDeps = getCssSerialAssets<MixedOutput>(graph.dependencies, {\n projectRoot: options.projectRoot,\n processModuleFilter: options.processModuleFilter,\n });\n\n // Create chunks for splitting.\n const chunks = new Set<Chunk>();\n\n [\n {\n test: pathToRegExp(entryFile),\n },\n ].map((chunkSettings) => gatherChunks(chunks, chunkSettings, preModules, graph, options, false));\n\n // Get the common modules and extract them into a separate chunk.\n const entryChunk = [...chunks.values()].find(\n (chunk) => !chunk.isAsync && chunk.hasAbsolutePath(entryFile)\n );\n if (entryChunk) {\n for (const chunk of chunks.values()) {\n if (chunk !== entryChunk && chunk.isAsync) {\n for (const dep of chunk.deps.values()) {\n if (entryChunk.deps.has(dep)) {\n // Remove the dependency from the async chunk since it will be loaded in the main chunk.\n chunk.deps.delete(dep);\n }\n }\n }\n }\n\n const toCompare = [...chunks.values()];\n\n const commonDependencies = [];\n\n while (toCompare.length) {\n const chunk = toCompare.shift()!;\n for (const chunk2 of toCompare) {\n if (chunk !== chunk2 && chunk.isAsync && chunk2.isAsync) {\n const commonDeps = [...chunk.deps].filter((dep) => chunk2.deps.has(dep));\n\n for (const dep of commonDeps) {\n chunk.deps.delete(dep);\n chunk2.deps.delete(dep);\n }\n\n commonDependencies.push(...commonDeps);\n }\n }\n }\n\n // If common dependencies were found, extract them to the entry chunk.\n // TODO: Extract the metro-runtime to a common chunk apart from the entry chunk then load the common dependencies before the entry chunk.\n if (commonDependencies.length) {\n for (const dep of commonDependencies) {\n entryChunk.deps.add(dep);\n }\n // const commonDependenciesUnique = [...new Set(commonDependencies)];\n // const commonChunk = new Chunk(\n // chunkIdForModules(commonDependenciesUnique),\n // commonDependenciesUnique,\n // graph,\n // options,\n // false,\n // true\n // );\n // entryChunk.requiredChunks.add(commonChunk);\n // chunks.add(commonChunk);\n }\n }\n\n const jsAssets = await serializeChunksAsync(\n chunks,\n config.serializer ?? {},\n serializeChunkOptions\n );\n\n // TODO: Can this be anything besides true?\n const isExporting = true;\n const baseUrl = getBaseUrlOption(graph, { serializerOptions: serializeChunkOptions });\n const assetPublicUrl = (baseUrl.replace(/\\/+$/, '') ?? '') + '/assets';\n const publicPath = isExporting\n ? graph.transformOptions.platform === 'web'\n ? `/assets?export_path=${assetPublicUrl}`\n : assetPublicUrl\n : '/assets/?unstable_path=.';\n\n // TODO: Convert to serial assets\n // TODO: Disable this call dynamically in development since assets are fetched differently.\n const metroAssets = (await getMetroAssets(graph.dependencies, {\n processModuleFilter: options.processModuleFilter,\n assetPlugins: config.transformer?.assetPlugins ?? [],\n platform: getPlatformOption(graph, options) ?? 'web',\n projectRoot: options.projectRoot, // this._getServerRootDir(),\n publicPath,\n })) as AssetData[];\n\n return { artifacts: [...jsAssets, ...cssDeps], assets: metroAssets };\n}\n\nexport class Chunk {\n public deps: Set<Module> = new Set();\n public preModules: Set<Module> = new Set();\n\n // Chunks that are required to be loaded synchronously before this chunk.\n // These are included in the HTML as <script> tags.\n public requiredChunks: Set<Chunk> = new Set();\n\n constructor(\n public name: string,\n public entries: Module<MixedOutput>[],\n public graph: ReadOnlyGraph<MixedOutput>,\n public options: ExpoSerializerOptions,\n public isAsync: boolean = false,\n public isVendor: boolean = false\n ) {\n this.deps = new Set(entries);\n }\n\n private getPlatform() {\n assert(\n this.graph.transformOptions.platform,\n \"platform is required to be in graph's transformOptions\"\n );\n return this.graph.transformOptions.platform;\n }\n\n private getFilename(src: string) {\n return this.options.dev\n ? this.name\n : getExportPathForDependencyWithOptions(this.name, {\n platform: this.getPlatform(),\n src,\n serverRoot: this.options.serverRoot,\n });\n }\n\n private getStableChunkSource(serializerConfig: Partial<SerializerConfigT>) {\n return this.options.dev\n ? ''\n : this.serializeToCodeWithTemplates(serializerConfig, {\n // Disable source maps when creating a sha to reduce the number of possible changes that could\n // influence the cache hit.\n serializerOptions: {\n includeSourceMaps: false,\n },\n sourceMapUrl: undefined,\n debugId: undefined,\n });\n }\n\n private getFilenameForConfig(serializerConfig: Partial<SerializerConfigT>) {\n return this.getFilename(this.getStableChunkSource(serializerConfig));\n }\n\n private serializeToCodeWithTemplates(\n serializerConfig: Partial<SerializerConfigT>,\n options: Partial<Parameters<typeof baseJSBundleWithDependencies>[3]> = {}\n ) {\n const entryFile = this.name;\n\n // TODO: Disable all debugId steps when a dev server is enabled. This is an export-only feature.\n\n const preModules = [...this.preModules.values()];\n const dependencies = [...this.deps];\n\n const jsSplitBundle = baseJSBundleWithDependencies(entryFile, preModules, dependencies, {\n ...this.options,\n runBeforeMainModule:\n serializerConfig?.getModulesRunBeforeMainModule?.(\n path.relative(this.options.projectRoot, entryFile)\n ) ?? [],\n runModule: !this.isVendor && !this.isAsync,\n modulesOnly: this.preModules.size === 0,\n platform: this.getPlatform(),\n baseUrl: getBaseUrlOption(this.graph, this.options),\n splitChunks: getSplitChunksOption(this.graph, this.options),\n skipWrapping: true,\n computedAsyncModulePaths: null,\n ...options,\n });\n\n return bundleToString(jsSplitBundle).code;\n }\n\n hasAbsolutePath(absolutePath: string): boolean {\n return [...this.deps].some((module) => module.path === absolutePath);\n }\n\n private getComputedPathsForAsyncDependencies(\n serializerConfig: Partial<SerializerConfigT>,\n chunks: Chunk[]\n ) {\n const baseUrl = getBaseUrlOption(this.graph, this.options);\n // Only calculate production paths when all chunks are being exported.\n if (this.options.includeAsyncPaths) {\n return null;\n }\n const computedAsyncModulePaths: Record<string, string> = {};\n\n this.deps.forEach((module) => {\n module.dependencies.forEach((dependency) => {\n if (dependency.data.data.asyncType === 'async') {\n const chunkContainingModule = chunks.find((chunk) =>\n chunk.hasAbsolutePath(dependency.absolutePath)\n );\n assert(\n chunkContainingModule,\n 'Chunk containing module not found: ' + dependency.absolutePath\n );\n const moduleIdName = chunkContainingModule.getFilenameForConfig(serializerConfig);\n computedAsyncModulePaths![dependency.absolutePath] = (baseUrl ?? '/') + moduleIdName;\n }\n });\n });\n return computedAsyncModulePaths;\n }\n\n private getAdjustedSourceMapUrl(serializerConfig: Partial<SerializerConfigT>): string | null {\n // Metro really only accounts for development, so we'll use the defaults here.\n if (this.options.dev) {\n return this.options.sourceMapUrl ?? null;\n }\n\n if (this.options.serializerOptions?.includeSourceMaps !== true) {\n return null;\n }\n\n if (this.options.inlineSourceMap || !this.options.sourceMapUrl) {\n return this.options.sourceMapUrl ?? null;\n }\n\n const isAbsolute = this.getPlatform() !== 'web';\n\n const baseUrl = getBaseUrlOption(this.graph, this.options);\n const filename = this.getFilenameForConfig(serializerConfig);\n const isAbsoluteBaseUrl = !!baseUrl?.match(/https?:\\/\\//);\n const pathname =\n (isAbsoluteBaseUrl ? '' : baseUrl.replace(/\\/+$/, '')) +\n '/' +\n filename.replace(/^\\/+$/, '') +\n '.map';\n\n let adjustedSourceMapUrl = this.options.sourceMapUrl;\n // Metro has lots of issues...\n if (this.options.sourceMapUrl.startsWith('//localhost')) {\n adjustedSourceMapUrl = 'http:' + this.options.sourceMapUrl;\n }\n\n try {\n const parsed = new URL(pathname, isAbsoluteBaseUrl ? baseUrl : adjustedSourceMapUrl);\n\n if (isAbsoluteBaseUrl || isAbsolute) {\n return parsed.href;\n }\n\n return parsed.pathname;\n } catch (error) {\n console.error(\n `Failed to link source maps because the source map URL \"${this.options.sourceMapUrl}\" is corrupt:`,\n error\n );\n return null;\n }\n }\n\n private serializeToCode(\n serializerConfig: Partial<SerializerConfigT>,\n { debugId, chunks }: { debugId: string; chunks: Chunk[] }\n ) {\n return this.serializeToCodeWithTemplates(serializerConfig, {\n skipWrapping: false,\n sourceMapUrl: this.getAdjustedSourceMapUrl(serializerConfig) ?? undefined,\n computedAsyncModulePaths: this.getComputedPathsForAsyncDependencies(serializerConfig, chunks),\n debugId,\n });\n }\n\n async serializeToAssetsAsync(\n serializerConfig: Partial<SerializerConfigT>,\n chunks: Chunk[],\n {\n includeSourceMaps,\n includeBytecode,\n }: { includeSourceMaps?: boolean; includeBytecode?: boolean }\n ): Promise<SerialAsset[]> {\n // Create hash without wrapping to prevent it changing when the wrapping changes.\n const outputFile = this.getFilenameForConfig(serializerConfig);\n // We already use a stable hash for the output filename, so we'll reuse that for the debugId.\n const debugId = stringToUUID(path.basename(outputFile, path.extname(outputFile)));\n const jsCode = this.serializeToCode(serializerConfig, { chunks, debugId });\n\n const relativeEntry = path.relative(this.options.projectRoot, this.name);\n\n const jsAsset: SerialAsset = {\n filename: outputFile,\n originFilename: relativeEntry,\n type: 'js',\n metadata: {\n isAsync: this.isAsync,\n requires: [...this.requiredChunks.values()].map((chunk) =>\n chunk.getFilenameForConfig(serializerConfig)\n ),\n // Provide a list of module paths that can be used for matching chunks to routes.\n // TODO: Move HTML serializing closer to this code so we can reduce passing this much data around.\n modulePaths: [...this.deps].map((module) => module.path),\n },\n source: jsCode,\n };\n\n const assets: SerialAsset[] = [jsAsset];\n\n const mutateSourceMapWithDebugId = (sourceMap: string) => {\n // TODO: Upstream this so we don't have to parse the source map back and forth.\n if (!debugId) {\n return sourceMap;\n }\n // NOTE: debugId isn't required for inline source maps because the source map is included in the same file, therefore\n // we don't need to disambiguate between multiple source maps.\n const sourceMapObject = JSON.parse(sourceMap);\n sourceMapObject.debugId = debugId;\n // NOTE: Sentry does this, but bun does not.\n // sourceMapObject.debug_id = debugId;\n return JSON.stringify(sourceMapObject);\n };\n\n if (\n // Only include the source map if the `options.sourceMapUrl` option is provided and we are exporting a static build.\n includeSourceMaps &&\n !this.options.inlineSourceMap &&\n this.options.sourceMapUrl\n ) {\n const modules = [\n ...this.preModules,\n ...getSortedModules([...this.deps], {\n createModuleId: this.options.createModuleId,\n }),\n ].map((module) => {\n // TODO: Make this user-configurable.\n\n // Make all paths relative to the server root to prevent the entire user filesystem from being exposed.\n if (module.path.startsWith('/')) {\n return {\n ...module,\n path:\n '/' + path.relative(this.options.serverRoot ?? this.options.projectRoot, module.path),\n };\n }\n return module;\n });\n\n // TODO: We may not need to mutate the original source map with a `debugId` when hermes is enabled since we'll have different source maps.\n const sourceMap = mutateSourceMapWithDebugId(\n sourceMapString(modules, {\n excludeSource: false,\n ...this.options,\n })\n );\n\n assets.push({\n filename: this.options.dev ? jsAsset.filename + '.map' : outputFile + '.map',\n originFilename: jsAsset.originFilename,\n type: 'map',\n metadata: {},\n source: sourceMap,\n });\n }\n\n if (includeBytecode && this.isHermesEnabled()) {\n const adjustedSource = jsAsset.source.replace(\n /^\\/\\/# (sourceMappingURL)=(.*)$/gm,\n (...props) => {\n if (props[1] === 'sourceMappingURL') {\n const mapName = props[2].replace(/\\.js\\.map$/, '.hbc.map');\n return `//# ${props[1]}=` + mapName;\n }\n return '';\n }\n );\n\n // TODO: Generate hbc for each chunk\n const hermesBundleOutput = await buildHermesBundleAsync({\n filename: this.name,\n code: adjustedSource,\n map: assets[1] ? assets[1].source : null,\n // TODO: Maybe allow prod + no minify.\n minify: true, //!this.options.dev,\n });\n\n if (hermesBundleOutput.hbc) {\n // TODO: Unclear if we should add multiple assets, link the assets, or mutate the first asset.\n // jsAsset.metadata.hbc = hermesBundleOutput.hbc;\n // @ts-expect-error: TODO\n jsAsset.source = hermesBundleOutput.hbc;\n jsAsset.filename = jsAsset.filename.replace(/\\.js$/, '.hbc');\n }\n if (assets[1] && hermesBundleOutput.sourcemap) {\n assets[1].source = mutateSourceMapWithDebugId(hermesBundleOutput.sourcemap);\n assets[1].filename = assets[1].filename.replace(/\\.js\\.map$/, '.hbc.map');\n }\n }\n\n return assets;\n }\n\n private supportsBytecode() {\n return this.getPlatform() !== 'web';\n }\n\n isHermesEnabled() {\n // TODO: Revisit.\n // TODO: There could be an issue with having the serializer for export:embed output hermes since the native scripts will\n // also create hermes bytecode. We may need to disable in one of the two places.\n return (\n !this.options.dev &&\n this.supportsBytecode() &&\n this.graph.transformOptions.customTransformOptions?.engine === 'hermes'\n );\n }\n}\n\nfunction getEntryModulesForChunkSettings(graph: ReadOnlyGraph, settings: ChunkSettings) {\n return [...graph.dependencies.entries()]\n .filter(([path]) => settings.test.test(path))\n .map(([, module]) => module);\n}\n\nfunction chunkIdForModules(modules: Module[]) {\n return modules\n .map((module) => module.path)\n .sort()\n .join('=>');\n}\n\nfunction gatherChunks(\n chunks: Set<Chunk>,\n settings: ChunkSettings,\n preModules: readonly Module[],\n graph: ReadOnlyGraph,\n options: SerializerOptions<MixedOutput>,\n isAsync: boolean = false\n): Set<Chunk> {\n let entryModules = getEntryModulesForChunkSettings(graph, settings);\n\n const existingChunks = [...chunks.values()];\n\n entryModules = entryModules.filter((module) => {\n return !existingChunks.find((chunk) => chunk.entries.includes(module));\n });\n\n // Prevent processing the same entry file twice.\n if (!entryModules.length) {\n return chunks;\n }\n\n const entryChunk = new Chunk(\n chunkIdForModules(entryModules),\n entryModules,\n graph,\n options,\n isAsync\n );\n\n // Add all the pre-modules to the first chunk.\n if (preModules.length) {\n // On native, use the preModules in insert code in the entry chunk.\n for (const module of preModules.values()) {\n entryChunk.preModules.add(module);\n }\n }\n\n chunks.add(entryChunk);\n\n const splitChunks = getSplitChunksOption(graph, options);\n\n function includeModule(entryModule: Module<MixedOutput>) {\n for (const dependency of entryModule.dependencies.values()) {\n if (\n dependency.data.data.asyncType === 'async' &&\n // Support disabling multiple chunks.\n splitChunks\n ) {\n gatherChunks(\n chunks,\n { test: pathToRegExp(dependency.absolutePath) },\n [],\n graph,\n options,\n true\n );\n } else {\n const module = graph.dependencies.get(dependency.absolutePath);\n if (module) {\n // Prevent circular dependencies from creating infinite loops.\n if (!entryChunk.deps.has(module)) {\n entryChunk.deps.add(module);\n includeModule(module);\n }\n }\n }\n }\n }\n\n for (const entryModule of entryModules) {\n includeModule(entryModule);\n }\n\n return chunks;\n}\n\nasync function serializeChunksAsync(\n chunks: Set<Chunk>,\n serializerConfig: Partial<SerializerConfigT>,\n { includeSourceMaps, includeBytecode }: SerializeChunkOptions\n) {\n const jsAssets: SerialAsset[] = [];\n\n const chunksArray = [...chunks.values()];\n await Promise.all(\n chunksArray.map(async (chunk) => {\n jsAssets.push(\n ...(await chunk.serializeToAssetsAsync(serializerConfig, chunksArray, {\n includeSourceMaps,\n includeBytecode,\n }))\n );\n })\n );\n\n return jsAssets;\n}\n\nexport function getSortedModules(\n modules: Module<MixedOutput>[],\n {\n createModuleId,\n }: {\n createModuleId: (path: string) => number;\n }\n): readonly Module<any>[] {\n // Assign IDs to modules in a consistent order\n for (const module of modules) {\n createModuleId(module.path);\n }\n // Sort by IDs\n return modules.sort(\n (a: Module<any>, b: Module<any>) => createModuleId(a.path) - createModuleId(b.path)\n );\n}\n"],"mappings":";;;;;;;;AAMA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AASA,SAAAG,iBAAA;EAAA,MAAAH,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAC,gBAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,gBAAA;EAAA,MAAAJ,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAE,eAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAK,MAAA;EAAA,MAAAL,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAG,KAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,cAAA;EAAA,MAAAN,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAI,aAAA,YAAAA,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AG,CAAC,GAAGpK,MAAM,CAACQ,MAAM,CAAC,CAAC,CAAC;EACxC,MAAM6J,OAAO,CAACC,GAAG,CACfF,WAAW,CAAChK,GAAG,CAAC,MAAOM,KAAK,IAAK;IAC/BgB,QAAQ,CAACF,IAAI,CACX,IAAI,MAAMd,KAAK,CAACuG,sBAAsB,CAACtD,gBAAgB,EAAEyG,WAAW,EAAE;MACpEvG,iBAAiB;MACjBqD;IACF,CAAC,CAAC,CACJ,CAAC;EACH,CAAC,CACH,CAAC;EAED,OAAOxF,QAAQ;AACjB;AAEO,SAAS6G,gBAAgBA,CAC9BD,OAA8B,EAC9B;EACEE;AAGF,CAAC,EACuB;EACxB;EACA,KAAK,MAAMlD,MAAM,IAAIgD,OAAO,EAAE;IAC5BE,cAAc,CAAClD,MAAM,CAACb,IAAI,CAAC;EAC7B;EACA;EACA,OAAO6D,OAAO,CAACsB,IAAI,CACjB,CAACW,CAAc,EAAEC,CAAc,KAAKhC,cAAc,CAAC+B,CAAC,CAAC9F,IAAI,CAAC,GAAG+D,cAAc,CAACgC,CAAC,CAAC/F,IAAI,CACpF,CAAC;AACH"}
|
|
1
|
+
{"version":3,"file":"serializeChunks.js","names":["_assert","data","_interopRequireDefault","require","_sourceMapString","_bundleToString","_path","_debugId","_exportHermes","_exportPath","_baseJSBundle","_getCssDeps","_getAssets","obj","__esModule","default","pathToRegex","path","regexSafePath","replace","RegExp","graphToSerialAssetsAsync","config","serializeChunkOptions","props","_config$serializer","_baseUrl$replace","_config$transformer$a","_config$transformer","_getPlatformOption","entryFile","preModules","graph","options","cssDeps","getCssSerialAssets","dependencies","projectRoot","processModuleFilter","chunks","Set","test","map","chunkSettings","gatherChunks","entryChunk","values","find","chunk","isAsync","hasAbsolutePath","dep","deps","has","delete","toCompare","commonDependencies","length","shift","chunk2","commonDeps","filter","push","add","jsAssets","serializeChunksAsync","serializer","isExporting","baseUrl","getBaseUrlOption","serializerOptions","assetPublicUrl","publicPath","transformOptions","platform","metroAssets","getMetroAssets","assetPlugins","transformer","getPlatformOption","artifacts","assets","Chunk","requiredChunks","constructor","name","entries","isVendor","getPlatform","assert","getFilename","src","dev","getExportPathForDependencyWithOptions","serverRoot","getStableChunkSource","serializerConfig","serializeToCodeWithTemplates","includeSourceMaps","sourceMapUrl","undefined","debugId","getFilenameForConfig","_serializerConfig$get","_serializerConfig$get2","jsSplitBundle","baseJSBundleWithDependencies","runBeforeMainModule","getModulesRunBeforeMainModule","call","relative","runModule","modulesOnly","size","splitChunks","getSplitChunksOption","skipWrapping","computedAsyncModulePaths","bundleToString","code","absolutePath","some","module","getComputedPathsForAsyncDependencies","includeAsyncPaths","forEach","dependency","asyncType","chunkContainingModule","moduleIdName","getAdjustedSourceMapUrl","_this$options$seriali","_this$options$sourceM","inlineSourceMap","_this$options$sourceM2","isAbsolute","filename","isAbsoluteBaseUrl","match","pathname","adjustedSourceMapUrl","startsWith","parsed","URL","href","error","console","serializeToCode","_this$getAdjustedSour","serializeToAssetsAsync","includeBytecode","unstable_beforeAssetSerializationPlugins","outputFile","stringToUUID","basename","extname","premodules","plugin","jsCode","relativeEntry","jsAsset","originFilename","type","metadata","requires","modulePaths","source","mutateSourceMapWithDebugId","sourceMap","sourceMapObject","JSON","parse","stringify","modules","getSortedModules","createModuleId","_this$options$serverR","sourceMapString","excludeSource","isHermesEnabled","adjustedSource","mapName","hermesBundleOutput","buildHermesBundleAsync","minify","hbc","sourcemap","supportsBytecode","_this$graph$transform","customTransformOptions","engine","exports","getEntryModulesForChunkSettings","settings","chunkIdForModules","sort","join","entryModules","existingChunks","includes","includeModule","entryModule","get","chunksArray","Promise","all","a","b"],"sources":["../../src/serializer/serializeChunks.ts"],"sourcesContent":["/**\n * Copyright © 2023 650 Industries.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport assert from 'assert';\nimport {\n AssetData,\n MetroConfig,\n MixedOutput,\n Module,\n ReadOnlyGraph,\n SerializerOptions,\n} from 'metro';\nimport sourceMapString from 'metro/src/DeltaBundler/Serializers/sourceMapString';\nimport bundleToString from 'metro/src/lib/bundleToString';\nimport { ConfigT, SerializerConfigT } from 'metro-config';\nimport path from 'path';\n\nimport { stringToUUID } from './debugId';\nimport { buildHermesBundleAsync } from './exportHermes';\nimport { getExportPathForDependencyWithOptions } from './exportPath';\nimport {\n ExpoSerializerOptions,\n baseJSBundleWithDependencies,\n getBaseUrlOption,\n getPlatformOption,\n getSplitChunksOption,\n} from './fork/baseJSBundle';\nimport { getCssSerialAssets } from './getCssDeps';\nimport { SerialAsset } from './serializerAssets';\nimport { SerializerConfigOptions } from './withExpoSerializers';\nimport getMetroAssets from '../transform-worker/getAssets';\n\ntype Serializer = NonNullable<ConfigT['serializer']['customSerializer']>;\n\ntype SerializerParameters = Parameters<Serializer>;\n\ntype ChunkSettings = {\n /** Match the initial modules. */\n test: RegExp;\n};\n\nexport type SerializeChunkOptions = {\n includeSourceMaps: boolean;\n includeBytecode: boolean;\n} & SerializerConfigOptions;\n\n// Convert file paths to regex matchers.\nfunction pathToRegex(path: string) {\n // Escape regex special characters, except for '*'\n let regexSafePath = path.replace(/[-[\\]{}()+?.,\\\\^$|#\\s]/g, '\\\\$&');\n\n // Replace '*' with '.*' to act as a wildcard in regex\n regexSafePath = regexSafePath.replace(/\\*/g, '.*');\n\n // Create a RegExp object with the modified string\n return new RegExp('^' + regexSafePath + '$');\n}\n\nexport async function graphToSerialAssetsAsync(\n config: MetroConfig,\n serializeChunkOptions: SerializeChunkOptions,\n ...props: SerializerParameters\n): Promise<{ artifacts: SerialAsset[] | null; assets: AssetData[] }> {\n const [entryFile, preModules, graph, options] = props;\n\n const cssDeps = getCssSerialAssets<MixedOutput>(graph.dependencies, {\n projectRoot: options.projectRoot,\n processModuleFilter: options.processModuleFilter,\n });\n\n // Create chunks for splitting.\n const chunks = new Set<Chunk>();\n\n [\n {\n test: pathToRegex(entryFile),\n },\n ].map((chunkSettings) => gatherChunks(chunks, chunkSettings, preModules, graph, options, false));\n\n // Get the common modules and extract them into a separate chunk.\n const entryChunk = [...chunks.values()].find(\n (chunk) => !chunk.isAsync && chunk.hasAbsolutePath(entryFile)\n );\n if (entryChunk) {\n for (const chunk of chunks.values()) {\n if (chunk !== entryChunk && chunk.isAsync) {\n for (const dep of chunk.deps.values()) {\n if (entryChunk.deps.has(dep)) {\n // Remove the dependency from the async chunk since it will be loaded in the main chunk.\n chunk.deps.delete(dep);\n }\n }\n }\n }\n\n const toCompare = [...chunks.values()];\n\n const commonDependencies = [];\n\n while (toCompare.length) {\n const chunk = toCompare.shift()!;\n for (const chunk2 of toCompare) {\n if (chunk !== chunk2 && chunk.isAsync && chunk2.isAsync) {\n const commonDeps = [...chunk.deps].filter((dep) => chunk2.deps.has(dep));\n\n for (const dep of commonDeps) {\n chunk.deps.delete(dep);\n chunk2.deps.delete(dep);\n }\n\n commonDependencies.push(...commonDeps);\n }\n }\n }\n\n // If common dependencies were found, extract them to the entry chunk.\n // TODO: Extract the metro-runtime to a common chunk apart from the entry chunk then load the common dependencies before the entry chunk.\n if (commonDependencies.length) {\n for (const dep of commonDependencies) {\n entryChunk.deps.add(dep);\n }\n // const commonDependenciesUnique = [...new Set(commonDependencies)];\n // const commonChunk = new Chunk(\n // chunkIdForModules(commonDependenciesUnique),\n // commonDependenciesUnique,\n // graph,\n // options,\n // false,\n // true\n // );\n // entryChunk.requiredChunks.add(commonChunk);\n // chunks.add(commonChunk);\n }\n\n // TODO: Optimize this pass more.\n // Remove all dependencies from async chunks that are already in the common chunk.\n for (const chunk of [...chunks.values()]) {\n if (chunk !== entryChunk) {\n for (const dep of chunk.deps) {\n if (entryChunk.deps.has(dep)) {\n chunk.deps.delete(dep);\n }\n }\n }\n }\n }\n\n const jsAssets = await serializeChunksAsync(\n chunks,\n config.serializer ?? {},\n serializeChunkOptions\n );\n\n // TODO: Can this be anything besides true?\n const isExporting = true;\n const baseUrl = getBaseUrlOption(graph, { serializerOptions: serializeChunkOptions });\n const assetPublicUrl = (baseUrl.replace(/\\/+$/, '') ?? '') + '/assets';\n const publicPath = isExporting\n ? graph.transformOptions.platform === 'web'\n ? `/assets?export_path=${assetPublicUrl}`\n : assetPublicUrl\n : '/assets/?unstable_path=.';\n\n // TODO: Convert to serial assets\n // TODO: Disable this call dynamically in development since assets are fetched differently.\n const metroAssets = (await getMetroAssets(graph.dependencies, {\n processModuleFilter: options.processModuleFilter,\n assetPlugins: config.transformer?.assetPlugins ?? [],\n platform: getPlatformOption(graph, options) ?? 'web',\n projectRoot: options.projectRoot, // this._getServerRootDir(),\n publicPath,\n })) as AssetData[];\n\n return { artifacts: [...jsAssets, ...cssDeps], assets: metroAssets };\n}\n\nexport class Chunk {\n public deps: Set<Module> = new Set();\n public preModules: Set<Module> = new Set();\n\n // Chunks that are required to be loaded synchronously before this chunk.\n // These are included in the HTML as <script> tags.\n public requiredChunks: Set<Chunk> = new Set();\n\n constructor(\n public name: string,\n public entries: Module<MixedOutput>[],\n public graph: ReadOnlyGraph<MixedOutput>,\n public options: ExpoSerializerOptions,\n public isAsync: boolean = false,\n public isVendor: boolean = false\n ) {\n this.deps = new Set(entries);\n }\n\n private getPlatform() {\n assert(\n this.graph.transformOptions.platform,\n \"platform is required to be in graph's transformOptions\"\n );\n return this.graph.transformOptions.platform;\n }\n\n private getFilename(src: string) {\n return this.options.dev\n ? this.name\n : getExportPathForDependencyWithOptions(this.name, {\n platform: this.getPlatform(),\n src,\n serverRoot: this.options.serverRoot,\n });\n }\n\n private getStableChunkSource(serializerConfig: Partial<SerializerConfigT>) {\n return this.options.dev\n ? ''\n : this.serializeToCodeWithTemplates(serializerConfig, {\n // Disable source maps when creating a sha to reduce the number of possible changes that could\n // influence the cache hit.\n serializerOptions: {\n includeSourceMaps: false,\n },\n sourceMapUrl: undefined,\n debugId: undefined,\n });\n }\n\n private getFilenameForConfig(serializerConfig: Partial<SerializerConfigT>) {\n return this.getFilename(this.getStableChunkSource(serializerConfig));\n }\n\n private serializeToCodeWithTemplates(\n serializerConfig: Partial<SerializerConfigT>,\n options: Partial<Parameters<typeof baseJSBundleWithDependencies>[3]> = {}\n ) {\n const entryFile = this.name;\n\n // TODO: Disable all debugId steps when a dev server is enabled. This is an export-only feature.\n\n const preModules = [...this.preModules.values()];\n const dependencies = [...this.deps];\n\n const jsSplitBundle = baseJSBundleWithDependencies(entryFile, preModules, dependencies, {\n ...this.options,\n runBeforeMainModule:\n serializerConfig?.getModulesRunBeforeMainModule?.(\n path.relative(this.options.projectRoot, entryFile)\n ) ?? [],\n runModule: !this.isVendor && !this.isAsync,\n modulesOnly: this.preModules.size === 0,\n platform: this.getPlatform(),\n baseUrl: getBaseUrlOption(this.graph, this.options),\n splitChunks: getSplitChunksOption(this.graph, this.options),\n skipWrapping: true,\n computedAsyncModulePaths: null,\n ...options,\n });\n\n return bundleToString(jsSplitBundle).code;\n }\n\n hasAbsolutePath(absolutePath: string): boolean {\n return [...this.deps].some((module) => module.path === absolutePath);\n }\n\n private getComputedPathsForAsyncDependencies(\n serializerConfig: Partial<SerializerConfigT>,\n chunks: Chunk[]\n ) {\n const baseUrl = getBaseUrlOption(this.graph, this.options);\n // Only calculate production paths when all chunks are being exported.\n if (this.options.includeAsyncPaths) {\n return null;\n }\n const computedAsyncModulePaths: Record<string, string> = {};\n\n this.deps.forEach((module) => {\n module.dependencies.forEach((dependency) => {\n if (dependency.data.data.asyncType === 'async') {\n const chunkContainingModule = chunks.find((chunk) =>\n chunk.hasAbsolutePath(dependency.absolutePath)\n );\n assert(\n chunkContainingModule,\n 'Chunk containing module not found: ' + dependency.absolutePath\n );\n const moduleIdName = chunkContainingModule.getFilenameForConfig(serializerConfig);\n computedAsyncModulePaths![dependency.absolutePath] = (baseUrl ?? '/') + moduleIdName;\n }\n });\n });\n return computedAsyncModulePaths;\n }\n\n private getAdjustedSourceMapUrl(serializerConfig: Partial<SerializerConfigT>): string | null {\n // Metro really only accounts for development, so we'll use the defaults here.\n if (this.options.dev) {\n return this.options.sourceMapUrl ?? null;\n }\n\n if (this.options.serializerOptions?.includeSourceMaps !== true) {\n return null;\n }\n\n if (this.options.inlineSourceMap || !this.options.sourceMapUrl) {\n return this.options.sourceMapUrl ?? null;\n }\n\n const isAbsolute = this.getPlatform() !== 'web';\n\n const baseUrl = getBaseUrlOption(this.graph, this.options);\n const filename = this.getFilenameForConfig(serializerConfig);\n const isAbsoluteBaseUrl = !!baseUrl?.match(/https?:\\/\\//);\n const pathname =\n (isAbsoluteBaseUrl ? '' : baseUrl.replace(/\\/+$/, '')) +\n '/' +\n filename.replace(/^\\/+$/, '') +\n '.map';\n\n let adjustedSourceMapUrl = this.options.sourceMapUrl;\n // Metro has lots of issues...\n if (this.options.sourceMapUrl.startsWith('//localhost')) {\n adjustedSourceMapUrl = 'http:' + this.options.sourceMapUrl;\n }\n\n try {\n const parsed = new URL(pathname, isAbsoluteBaseUrl ? baseUrl : adjustedSourceMapUrl);\n\n if (isAbsoluteBaseUrl || isAbsolute) {\n return parsed.href;\n }\n\n return parsed.pathname;\n } catch (error) {\n console.error(\n `Failed to link source maps because the source map URL \"${this.options.sourceMapUrl}\" is corrupt:`,\n error\n );\n return null;\n }\n }\n\n private serializeToCode(\n serializerConfig: Partial<SerializerConfigT>,\n { debugId, chunks }: { debugId: string; chunks: Chunk[] }\n ) {\n return this.serializeToCodeWithTemplates(serializerConfig, {\n skipWrapping: false,\n sourceMapUrl: this.getAdjustedSourceMapUrl(serializerConfig) ?? undefined,\n computedAsyncModulePaths: this.getComputedPathsForAsyncDependencies(serializerConfig, chunks),\n debugId,\n });\n }\n\n async serializeToAssetsAsync(\n serializerConfig: Partial<SerializerConfigT>,\n chunks: Chunk[],\n {\n includeSourceMaps,\n includeBytecode,\n unstable_beforeAssetSerializationPlugins,\n }: SerializeChunkOptions\n ): Promise<SerialAsset[]> {\n // Create hash without wrapping to prevent it changing when the wrapping changes.\n const outputFile = this.getFilenameForConfig(serializerConfig);\n // We already use a stable hash for the output filename, so we'll reuse that for the debugId.\n const debugId = stringToUUID(path.basename(outputFile, path.extname(outputFile)));\n\n let premodules = [...this.preModules];\n if (unstable_beforeAssetSerializationPlugins) {\n for (const plugin of unstable_beforeAssetSerializationPlugins) {\n premodules = plugin({ graph: this.graph, premodules, debugId });\n }\n this.preModules = new Set(premodules);\n }\n\n const jsCode = this.serializeToCode(serializerConfig, { chunks, debugId });\n\n const relativeEntry = path.relative(this.options.projectRoot, this.name);\n\n const jsAsset: SerialAsset = {\n filename: outputFile,\n originFilename: relativeEntry,\n type: 'js',\n metadata: {\n isAsync: this.isAsync,\n requires: [...this.requiredChunks.values()].map((chunk) =>\n chunk.getFilenameForConfig(serializerConfig)\n ),\n // Provide a list of module paths that can be used for matching chunks to routes.\n // TODO: Move HTML serializing closer to this code so we can reduce passing this much data around.\n modulePaths: [...this.deps].map((module) => module.path),\n },\n source: jsCode,\n };\n\n const assets: SerialAsset[] = [jsAsset];\n\n const mutateSourceMapWithDebugId = (sourceMap: string) => {\n // TODO: Upstream this so we don't have to parse the source map back and forth.\n if (!debugId) {\n return sourceMap;\n }\n // NOTE: debugId isn't required for inline source maps because the source map is included in the same file, therefore\n // we don't need to disambiguate between multiple source maps.\n const sourceMapObject = JSON.parse(sourceMap);\n sourceMapObject.debugId = debugId;\n // NOTE: Sentry does this, but bun does not.\n // sourceMapObject.debug_id = debugId;\n return JSON.stringify(sourceMapObject);\n };\n\n if (\n // Only include the source map if the `options.sourceMapUrl` option is provided and we are exporting a static build.\n includeSourceMaps &&\n !this.options.inlineSourceMap &&\n this.options.sourceMapUrl\n ) {\n const modules = [\n ...this.preModules,\n ...getSortedModules([...this.deps], {\n createModuleId: this.options.createModuleId,\n }),\n ].map((module) => {\n // TODO: Make this user-configurable.\n\n // Make all paths relative to the server root to prevent the entire user filesystem from being exposed.\n if (module.path.startsWith('/')) {\n return {\n ...module,\n path:\n '/' + path.relative(this.options.serverRoot ?? this.options.projectRoot, module.path),\n };\n }\n return module;\n });\n\n // TODO: We may not need to mutate the original source map with a `debugId` when hermes is enabled since we'll have different source maps.\n const sourceMap = mutateSourceMapWithDebugId(\n sourceMapString(modules, {\n excludeSource: false,\n ...this.options,\n })\n );\n\n assets.push({\n filename: this.options.dev ? jsAsset.filename + '.map' : outputFile + '.map',\n originFilename: jsAsset.originFilename,\n type: 'map',\n metadata: {},\n source: sourceMap,\n });\n }\n\n if (includeBytecode && this.isHermesEnabled()) {\n const adjustedSource = jsAsset.source.replace(\n /^\\/\\/# (sourceMappingURL)=(.*)$/gm,\n (...props) => {\n if (props[1] === 'sourceMappingURL') {\n const mapName = props[2].replace(/\\.js\\.map$/, '.hbc.map');\n return `//# ${props[1]}=` + mapName;\n }\n return '';\n }\n );\n\n // TODO: Generate hbc for each chunk\n const hermesBundleOutput = await buildHermesBundleAsync({\n filename: this.name,\n code: adjustedSource,\n map: assets[1] ? assets[1].source : null,\n // TODO: Maybe allow prod + no minify.\n minify: true, //!this.options.dev,\n });\n\n if (hermesBundleOutput.hbc) {\n // TODO: Unclear if we should add multiple assets, link the assets, or mutate the first asset.\n // jsAsset.metadata.hbc = hermesBundleOutput.hbc;\n // @ts-expect-error: TODO\n jsAsset.source = hermesBundleOutput.hbc;\n jsAsset.filename = jsAsset.filename.replace(/\\.js$/, '.hbc');\n }\n if (assets[1] && hermesBundleOutput.sourcemap) {\n assets[1].source = mutateSourceMapWithDebugId(hermesBundleOutput.sourcemap);\n assets[1].filename = assets[1].filename.replace(/\\.js\\.map$/, '.hbc.map');\n }\n }\n\n return assets;\n }\n\n private supportsBytecode() {\n return this.getPlatform() !== 'web';\n }\n\n isHermesEnabled() {\n // TODO: Revisit.\n // TODO: There could be an issue with having the serializer for export:embed output hermes since the native scripts will\n // also create hermes bytecode. We may need to disable in one of the two places.\n return (\n !this.options.dev &&\n this.supportsBytecode() &&\n this.graph.transformOptions.customTransformOptions?.engine === 'hermes'\n );\n }\n}\n\nfunction getEntryModulesForChunkSettings(graph: ReadOnlyGraph, settings: ChunkSettings) {\n return [...graph.dependencies.entries()]\n .filter(([path]) => settings.test.test(path))\n .map(([, module]) => module);\n}\n\nfunction chunkIdForModules(modules: Module[]) {\n return modules\n .map((module) => module.path)\n .sort()\n .join('=>');\n}\n\nfunction gatherChunks(\n chunks: Set<Chunk>,\n settings: ChunkSettings,\n preModules: readonly Module[],\n graph: ReadOnlyGraph,\n options: SerializerOptions<MixedOutput>,\n isAsync: boolean = false\n): Set<Chunk> {\n let entryModules = getEntryModulesForChunkSettings(graph, settings);\n\n const existingChunks = [...chunks.values()];\n\n entryModules = entryModules.filter((module) => {\n return !existingChunks.find((chunk) => chunk.entries.includes(module));\n });\n\n // Prevent processing the same entry file twice.\n if (!entryModules.length) {\n return chunks;\n }\n\n const entryChunk = new Chunk(\n chunkIdForModules(entryModules),\n entryModules,\n graph,\n options,\n isAsync\n );\n\n // Add all the pre-modules to the first chunk.\n if (preModules.length) {\n // On native, use the preModules in insert code in the entry chunk.\n for (const module of preModules.values()) {\n entryChunk.preModules.add(module);\n }\n }\n\n chunks.add(entryChunk);\n\n const splitChunks = getSplitChunksOption(graph, options);\n\n function includeModule(entryModule: Module<MixedOutput>) {\n for (const dependency of entryModule.dependencies.values()) {\n if (\n dependency.data.data.asyncType === 'async' &&\n // Support disabling multiple chunks.\n splitChunks\n ) {\n gatherChunks(\n chunks,\n { test: pathToRegex(dependency.absolutePath) },\n [],\n graph,\n options,\n true\n );\n } else {\n const module = graph.dependencies.get(dependency.absolutePath);\n if (module) {\n // Prevent circular dependencies from creating infinite loops.\n if (!entryChunk.deps.has(module)) {\n entryChunk.deps.add(module);\n includeModule(module);\n }\n }\n }\n }\n }\n\n for (const entryModule of entryModules) {\n includeModule(entryModule);\n }\n\n return chunks;\n}\n\nasync function serializeChunksAsync(\n chunks: Set<Chunk>,\n serializerConfig: Partial<SerializerConfigT>,\n options: SerializeChunkOptions\n) {\n const jsAssets: SerialAsset[] = [];\n\n const chunksArray = [...chunks.values()];\n await Promise.all(\n chunksArray.map(async (chunk) => {\n jsAssets.push(\n ...(await chunk.serializeToAssetsAsync(serializerConfig, chunksArray, options))\n );\n })\n );\n\n return jsAssets;\n}\n\nexport function getSortedModules(\n modules: Module<MixedOutput>[],\n {\n createModuleId,\n }: {\n createModuleId: (path: string) => number;\n }\n): readonly Module<any>[] {\n // Assign IDs to modules in a consistent order\n for (const module of modules) {\n createModuleId(module.path);\n }\n // Sort by IDs\n return modules.sort(\n (a: Module<any>, b: Module<any>) => createModuleId(a.path) - createModuleId(b.path)\n );\n}\n"],"mappings":";;;;;;;;AAMA,SAAAA,QAAA;EAAA,MAAAC,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAH,OAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AASA,SAAAG,iBAAA;EAAA,MAAAH,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAC,gBAAA,YAAAA,CAAA;IAAA,OAAAH,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,gBAAA;EAAA,MAAAJ,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAE,eAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAK,MAAA;EAAA,MAAAL,IAAA,GAAAC,sBAAA,CAAAC,OAAA;EAAAG,KAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAM,SAAA;EAAA,MAAAN,IAAA,GAAAE,OAAA;EAAAI,QAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAO,cAAA;EAAA,MAAAP,IAAA,GAAAE,OAAA;EAAAK,aAAA,YAAAA,CAAA;IAAA,OAAAP,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAQ,YAAA;EAAA,MAAAR,IAAA,GAAAE,OAAA;EAAAM,WAAA,YAAAA,CAAA;IAAA,OAAAR,IAAA;EAAA;EAAA,OAAAA,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, Module, ReadOnlyGraph } from 'metro';
|
|
1
|
+
import { MetroConfig, MixedOutput, Module, ReadOnlyGraph } from 'metro';
|
|
2
2
|
import { ConfigT, InputConfigT } from 'metro-config';
|
|
3
3
|
import { ExpoSerializerOptions } from './fork/baseJSBundle';
|
|
4
4
|
import { SerialAsset } from './serializerAssets';
|
|
@@ -9,9 +9,16 @@ export type SerializerParameters = [
|
|
|
9
9
|
ReadOnlyGraph,
|
|
10
10
|
ExpoSerializerOptions
|
|
11
11
|
];
|
|
12
|
+
export type SerializerConfigOptions = {
|
|
13
|
+
unstable_beforeAssetSerializationPlugins?: ((serializationInput: {
|
|
14
|
+
graph: ReadOnlyGraph<MixedOutput>;
|
|
15
|
+
premodules: Module[];
|
|
16
|
+
debugId?: string;
|
|
17
|
+
}) => Module[])[];
|
|
18
|
+
};
|
|
12
19
|
export type SerializerPlugin = (...props: SerializerParameters) => SerializerParameters;
|
|
13
|
-
export declare function withExpoSerializers(config: InputConfigT): InputConfigT;
|
|
14
|
-
export declare function withSerializerPlugins(config: InputConfigT, processors: SerializerPlugin[]): InputConfigT;
|
|
15
|
-
export declare function createDefaultExportCustomSerializer(config: Partial<MetroConfig
|
|
16
|
-
export declare function createSerializerFromSerialProcessors(config: MetroConfig, processors: (SerializerPlugin | undefined)[], originalSerializer
|
|
20
|
+
export declare function withExpoSerializers(config: InputConfigT, options?: SerializerConfigOptions): InputConfigT;
|
|
21
|
+
export declare function withSerializerPlugins(config: InputConfigT, processors: SerializerPlugin[], options?: SerializerConfigOptions): InputConfigT;
|
|
22
|
+
export declare function createDefaultExportCustomSerializer(config: Partial<MetroConfig>, configOptions?: SerializerConfigOptions): Serializer;
|
|
23
|
+
export declare function createSerializerFromSerialProcessors(config: MetroConfig, processors: (SerializerPlugin | undefined)[], originalSerializer: Serializer | null, options?: SerializerConfigOptions): Serializer;
|
|
17
24
|
export { SerialAsset };
|
|
@@ -84,29 +84,29 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
|
|
|
84
84
|
* LICENSE file in the root directory of this source tree.
|
|
85
85
|
*/
|
|
86
86
|
|
|
87
|
-
function withExpoSerializers(config) {
|
|
87
|
+
function withExpoSerializers(config, options = {}) {
|
|
88
88
|
const processors = [];
|
|
89
89
|
processors.push(_environmentVariableSerializerPlugin().serverPreludeSerializerPlugin);
|
|
90
90
|
if (!_env().env.EXPO_NO_CLIENT_ENV_VARS) {
|
|
91
91
|
processors.push(_environmentVariableSerializerPlugin().environmentVariableSerializerPlugin);
|
|
92
92
|
}
|
|
93
|
-
return withSerializerPlugins(config, processors);
|
|
93
|
+
return withSerializerPlugins(config, processors, options);
|
|
94
94
|
}
|
|
95
95
|
|
|
96
96
|
// There can only be one custom serializer as the input doesn't match the output.
|
|
97
97
|
// Here we simply run
|
|
98
|
-
function withSerializerPlugins(config, processors) {
|
|
98
|
+
function withSerializerPlugins(config, processors, options = {}) {
|
|
99
99
|
var _config$serializer;
|
|
100
100
|
const originalSerializer = (_config$serializer = config.serializer) === null || _config$serializer === void 0 ? void 0 : _config$serializer.customSerializer;
|
|
101
101
|
return {
|
|
102
102
|
...config,
|
|
103
103
|
serializer: {
|
|
104
104
|
...config.serializer,
|
|
105
|
-
customSerializer: createSerializerFromSerialProcessors(config, processors, originalSerializer)
|
|
105
|
+
customSerializer: createSerializerFromSerialProcessors(config, processors, originalSerializer !== null && originalSerializer !== void 0 ? originalSerializer : null, options)
|
|
106
106
|
}
|
|
107
107
|
};
|
|
108
108
|
}
|
|
109
|
-
function createDefaultExportCustomSerializer(config) {
|
|
109
|
+
function createDefaultExportCustomSerializer(config, configOptions = {}) {
|
|
110
110
|
return async (entryPoint, preModules, graph, options) => {
|
|
111
111
|
var _config$serializer2;
|
|
112
112
|
const isPossiblyDev = graph.transformOptions.hot;
|
|
@@ -127,11 +127,12 @@ function createDefaultExportCustomSerializer(config) {
|
|
|
127
127
|
debugId = (0, _debugId().stringToUUID)(outputCode);
|
|
128
128
|
return debugId;
|
|
129
129
|
};
|
|
130
|
+
let premodulesToBundle = [...preModules];
|
|
130
131
|
let bundleCode = null;
|
|
131
132
|
let bundleMap = null;
|
|
132
133
|
if ((_config$serializer2 = config.serializer) !== null && _config$serializer2 !== void 0 && _config$serializer2.customSerializer) {
|
|
133
134
|
var _config$serializer3;
|
|
134
|
-
const bundle = await ((_config$serializer3 = config.serializer) === null || _config$serializer3 === void 0 ? void 0 : _config$serializer3.customSerializer(entryPoint,
|
|
135
|
+
const bundle = await ((_config$serializer3 = config.serializer) === null || _config$serializer3 === void 0 ? void 0 : _config$serializer3.customSerializer(entryPoint, premodulesToBundle, graph, options));
|
|
135
136
|
if (typeof bundle === 'string') {
|
|
136
137
|
bundleCode = bundle;
|
|
137
138
|
} else {
|
|
@@ -139,9 +140,19 @@ function createDefaultExportCustomSerializer(config) {
|
|
|
139
140
|
bundleMap = bundle.map;
|
|
140
141
|
}
|
|
141
142
|
} else {
|
|
142
|
-
|
|
143
|
+
const debugId = loadDebugId();
|
|
144
|
+
if (configOptions.unstable_beforeAssetSerializationPlugins) {
|
|
145
|
+
for (const plugin of configOptions.unstable_beforeAssetSerializationPlugins) {
|
|
146
|
+
premodulesToBundle = plugin({
|
|
147
|
+
graph,
|
|
148
|
+
premodules: [...premodulesToBundle],
|
|
149
|
+
debugId
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
bundleCode = (0, _bundleToString().default)((0, _baseJSBundle().baseJSBundle)(entryPoint, premodulesToBundle, graph, {
|
|
143
154
|
...options,
|
|
144
|
-
debugId
|
|
155
|
+
debugId
|
|
145
156
|
})).code;
|
|
146
157
|
}
|
|
147
158
|
if (isPossiblyDev) {
|
|
@@ -157,7 +168,7 @@ function createDefaultExportCustomSerializer(config) {
|
|
|
157
168
|
// Exports....
|
|
158
169
|
|
|
159
170
|
if (!bundleMap) {
|
|
160
|
-
bundleMap = (0, _sourceMapString().default)([...
|
|
171
|
+
bundleMap = (0, _sourceMapString().default)([...premodulesToBundle, ...(0, _serializeChunks().getSortedModules)([...graph.dependencies.values()], options)], {
|
|
161
172
|
// TODO: Surface this somehow.
|
|
162
173
|
excludeSource: false,
|
|
163
174
|
// excludeSource: options.serializerOptions?.excludeSource,
|
|
@@ -186,8 +197,8 @@ function createDefaultExportCustomSerializer(config) {
|
|
|
186
197
|
};
|
|
187
198
|
};
|
|
188
199
|
}
|
|
189
|
-
function getDefaultSerializer(config, fallbackSerializer) {
|
|
190
|
-
const defaultSerializer = fallbackSerializer !== null && fallbackSerializer !== void 0 ? fallbackSerializer : createDefaultExportCustomSerializer(config);
|
|
200
|
+
function getDefaultSerializer(config, fallbackSerializer, configOptions = {}) {
|
|
201
|
+
const defaultSerializer = fallbackSerializer !== null && fallbackSerializer !== void 0 ? fallbackSerializer : createDefaultExportCustomSerializer(config, configOptions);
|
|
191
202
|
return async (...props) => {
|
|
192
203
|
const [,,, options] = props;
|
|
193
204
|
const customSerializerOptions = options.serializerOptions;
|
|
@@ -225,7 +236,8 @@ function getDefaultSerializer(config, fallbackSerializer) {
|
|
|
225
236
|
};
|
|
226
237
|
const assets = await (0, _serializeChunks().graphToSerialAssetsAsync)(config, {
|
|
227
238
|
includeSourceMaps: !!serializerOptions.includeSourceMaps,
|
|
228
|
-
includeBytecode: !!serializerOptions.includeBytecode
|
|
239
|
+
includeBytecode: !!serializerOptions.includeBytecode,
|
|
240
|
+
...configOptions
|
|
229
241
|
}, ...props);
|
|
230
242
|
if (supportsNonSerialReturn) {
|
|
231
243
|
// @ts-expect-error: this is future proofing for adding assets to the output as well.
|
|
@@ -234,8 +246,8 @@ function getDefaultSerializer(config, fallbackSerializer) {
|
|
|
234
246
|
return JSON.stringify(assets);
|
|
235
247
|
};
|
|
236
248
|
}
|
|
237
|
-
function createSerializerFromSerialProcessors(config, processors, originalSerializer) {
|
|
238
|
-
const finalSerializer = getDefaultSerializer(config, originalSerializer);
|
|
249
|
+
function createSerializerFromSerialProcessors(config, processors, originalSerializer, options = {}) {
|
|
250
|
+
const finalSerializer = getDefaultSerializer(config, originalSerializer, options);
|
|
239
251
|
return (...props) => {
|
|
240
252
|
for (const processor of processors) {
|
|
241
253
|
if (processor) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withExpoSerializers.js","names":["_jscSafeUrl","data","require","_sourceMapString","_interopRequireDefault","_bundleToString","_debugId","_environmentVariableSerializerPlugin","_baseJSBundle","_serializeChunks","_serializerAssets","_env","obj","__esModule","default","withExpoSerializers","config","processors","push","serverPreludeSerializerPlugin","env","EXPO_NO_CLIENT_ENV_VARS","environmentVariableSerializerPlugin","withSerializerPlugins","_config$serializer","originalSerializer","serializer","customSerializer","createSerializerFromSerialProcessors","createDefaultExportCustomSerializer","entryPoint","preModules","graph","options","_config$serializer2","isPossiblyDev","transformOptions","hot","enableDebugId","inlineSourceMap","debugId","loadDebugId","bundle","baseJSBundle","undefined","outputCode","bundleToString","code","stringToUUID","bundleCode","bundleMap","_config$serializer3","map","sourceMapString","getSortedModules","dependencies","values","excludeSource","processModuleFilter","shouldAddToIgnoreList","mutateSourceMapWithDebugId","sourceMap","sourceMapObject","JSON","parse","stringify","getDefaultSerializer","fallbackSerializer","defaultSerializer","props","customSerializerOptions","serializerOptions","supportsNonSerialReturn","output","includeBytecode","outputMode","includeSourceMaps","sourceUrl","isJscSafeUrl","toNormalUrl","url","URL","searchParams","get","assets","graphToSerialAssetsAsync","finalSerializer","processor"],"sources":["../../src/serializer/withExpoSerializers.ts"],"sourcesContent":["/**\n * Copyright © 2022 650 Industries.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { isJscSafeUrl, toNormalUrl } from 'jsc-safe-url';\nimport { MetroConfig, MixedOutput, Module, ReadOnlyGraph, SerializerOptions } from 'metro';\nimport sourceMapString from 'metro/src/DeltaBundler/Serializers/sourceMapString';\nimport bundleToString from 'metro/src/lib/bundleToString';\nimport { ConfigT, InputConfigT } from 'metro-config';\n\nimport { stringToUUID } from './debugId';\nimport {\n environmentVariableSerializerPlugin,\n serverPreludeSerializerPlugin,\n} from './environmentVariableSerializerPlugin';\nimport { ExpoSerializerOptions, baseJSBundle } from './fork/baseJSBundle';\nimport { getSortedModules, graphToSerialAssetsAsync } from './serializeChunks';\nimport { SerialAsset } from './serializerAssets';\nimport { env } from '../env';\n\nexport type Serializer = NonNullable<ConfigT['serializer']['customSerializer']>;\n\nexport type SerializerParameters = [\n string,\n readonly Module[],\n ReadOnlyGraph,\n ExpoSerializerOptions,\n];\n\n// A serializer that processes the input and returns a modified version.\n// Unlike a serializer, these can be chained together.\nexport type SerializerPlugin = (...props: SerializerParameters) => SerializerParameters;\n\nexport function withExpoSerializers(config: InputConfigT): InputConfigT {\n const processors: SerializerPlugin[] = [];\n processors.push(serverPreludeSerializerPlugin);\n if (!env.EXPO_NO_CLIENT_ENV_VARS) {\n processors.push(environmentVariableSerializerPlugin);\n }\n\n return withSerializerPlugins(config, processors);\n}\n\n// There can only be one custom serializer as the input doesn't match the output.\n// Here we simply run\nexport function withSerializerPlugins(\n config: InputConfigT,\n processors: SerializerPlugin[]\n): InputConfigT {\n const originalSerializer = config.serializer?.customSerializer;\n\n return {\n ...config,\n serializer: {\n ...config.serializer,\n customSerializer: createSerializerFromSerialProcessors(\n config,\n processors,\n originalSerializer\n ),\n },\n };\n}\n\nexport function createDefaultExportCustomSerializer(config: Partial<MetroConfig>): Serializer {\n return async (\n entryPoint: string,\n preModules: readonly Module<MixedOutput>[],\n graph: ReadOnlyGraph<MixedOutput>,\n options: SerializerOptions<MixedOutput>\n ): Promise<string | { code: string; map: string }> => {\n const isPossiblyDev = graph.transformOptions.hot;\n // TODO: This is a temporary solution until we've converged on using the new serializer everywhere.\n const enableDebugId = options.inlineSourceMap !== true && !isPossiblyDev;\n\n let debugId: string | undefined;\n const loadDebugId = () => {\n if (!enableDebugId || debugId) {\n return debugId;\n }\n\n // TODO: Perform this cheaper.\n const bundle = baseJSBundle(entryPoint, preModules, graph, {\n ...options,\n debugId: undefined,\n });\n const outputCode = bundleToString(bundle).code;\n debugId = stringToUUID(outputCode);\n return debugId;\n };\n\n let bundleCode: string | null = null;\n let bundleMap: string | null = null;\n\n if (config.serializer?.customSerializer) {\n const bundle = await config.serializer?.customSerializer(\n entryPoint,\n preModules,\n graph,\n options\n );\n if (typeof bundle === 'string') {\n bundleCode = bundle;\n } else {\n bundleCode = bundle.code;\n bundleMap = bundle.map;\n }\n } else {\n bundleCode = bundleToString(\n baseJSBundle(entryPoint, preModules, graph, {\n ...options,\n debugId: loadDebugId(),\n })\n ).code;\n }\n\n if (isPossiblyDev) {\n if (bundleMap == null) {\n return bundleCode;\n }\n return {\n code: bundleCode,\n map: bundleMap,\n };\n }\n\n // Exports....\n\n if (!bundleMap) {\n bundleMap = sourceMapString(\n [...preModules, ...getSortedModules([...graph.dependencies.values()], options)],\n {\n // TODO: Surface this somehow.\n excludeSource: false,\n // excludeSource: options.serializerOptions?.excludeSource,\n processModuleFilter: options.processModuleFilter,\n shouldAddToIgnoreList: options.shouldAddToIgnoreList,\n }\n );\n }\n\n if (enableDebugId) {\n const mutateSourceMapWithDebugId = (sourceMap: string) => {\n // NOTE: debugId isn't required for inline source maps because the source map is included in the same file, therefore\n // we don't need to disambiguate between multiple source maps.\n const sourceMapObject = JSON.parse(sourceMap);\n sourceMapObject.debugId = loadDebugId();\n // NOTE: Sentry does this, but bun does not.\n // sourceMapObject.debug_id = debugId;\n return JSON.stringify(sourceMapObject);\n };\n\n return {\n code: bundleCode,\n map: mutateSourceMapWithDebugId(bundleMap),\n };\n }\n\n return {\n code: bundleCode,\n map: bundleMap,\n };\n };\n}\n\nfunction getDefaultSerializer(\n config: MetroConfig,\n fallbackSerializer?: Serializer | null\n): Serializer {\n const defaultSerializer = fallbackSerializer ?? createDefaultExportCustomSerializer(config);\n\n return async (\n ...props: SerializerParameters\n ): Promise<string | { code: string; map: string }> => {\n const [, , , options] = props;\n\n const customSerializerOptions = options.serializerOptions;\n\n // Custom options can only be passed outside of the dev server, meaning\n // we don't need to stringify the results at the end, i.e. this is `npx expo export` or `npx expo export:embed`.\n const supportsNonSerialReturn = !!customSerializerOptions?.output;\n\n const serializerOptions = (() => {\n if (customSerializerOptions) {\n return {\n includeBytecode: customSerializerOptions.includeBytecode,\n outputMode: customSerializerOptions.output,\n includeSourceMaps: customSerializerOptions.includeSourceMaps,\n };\n }\n if (options.sourceUrl) {\n const sourceUrl = isJscSafeUrl(options.sourceUrl)\n ? toNormalUrl(options.sourceUrl)\n : options.sourceUrl;\n\n const url = new URL(sourceUrl, 'https://expo.dev');\n\n return {\n outputMode: url.searchParams.get('serializer.output'),\n includeSourceMaps: url.searchParams.get('serializer.map') === 'true',\n includeBytecode: url.searchParams.get('serializer.bytecode') === 'true',\n };\n }\n return null;\n })();\n\n if (serializerOptions?.outputMode !== 'static') {\n return defaultSerializer(...props);\n }\n\n // Mutate the serializer options with the parsed options.\n options.serializerOptions = {\n ...options.serializerOptions,\n ...serializerOptions,\n };\n\n const assets = await graphToSerialAssetsAsync(\n config,\n {\n includeSourceMaps: !!serializerOptions.includeSourceMaps,\n includeBytecode: !!serializerOptions.includeBytecode,\n },\n ...props\n );\n\n if (supportsNonSerialReturn) {\n // @ts-expect-error: this is future proofing for adding assets to the output as well.\n return assets;\n }\n\n return JSON.stringify(assets);\n };\n}\n\nexport function createSerializerFromSerialProcessors(\n config: MetroConfig,\n processors: (SerializerPlugin | undefined)[],\n originalSerializer?: Serializer | null\n): Serializer {\n const finalSerializer = getDefaultSerializer(config, originalSerializer);\n return (...props: SerializerParameters): ReturnType<Serializer> => {\n for (const processor of processors) {\n if (processor) {\n props = processor(...props);\n }\n }\n\n return finalSerializer(...props);\n };\n}\n\nexport { SerialAsset };\n"],"mappings":";;;;;;;;;;;;;;;AAMA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAE,iBAAA;EAAA,MAA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ClD,MAAM,EAAES,kBAAkB,CAAC;EACxE,OAAO,CAAC,GAAG4C,KAA2B,KAA6B;IACjE,KAAK,MAAMkB,SAAS,IAAItE,UAAU,EAAE;MAClC,IAAIsE,SAAS,EAAE;QACblB,KAAK,GAAGkB,SAAS,CAAC,GAAGlB,KAAK,CAAC;MAC7B;IACF;IAEA,OAAOiB,eAAe,CAAC,GAAGjB,KAAK,CAAC;EAClC,CAAC;AACH"}
|
|
1
|
+
{"version":3,"file":"withExpoSerializers.js","names":["_jscSafeUrl","data","require","_sourceMapString","_interopRequireDefault","_bundleToString","_debugId","_environmentVariableSerializerPlugin","_baseJSBundle","_serializeChunks","_serializerAssets","_env","obj","__esModule","default","withExpoSerializers","config","options","processors","push","serverPreludeSerializerPlugin","env","EXPO_NO_CLIENT_ENV_VARS","environmentVariableSerializerPlugin","withSerializerPlugins","_config$serializer","originalSerializer","serializer","customSerializer","createSerializerFromSerialProcessors","createDefaultExportCustomSerializer","configOptions","entryPoint","preModules","graph","_config$serializer2","isPossiblyDev","transformOptions","hot","enableDebugId","inlineSourceMap","debugId","loadDebugId","bundle","baseJSBundle","undefined","outputCode","bundleToString","code","stringToUUID","premodulesToBundle","bundleCode","bundleMap","_config$serializer3","map","unstable_beforeAssetSerializationPlugins","plugin","premodules","sourceMapString","getSortedModules","dependencies","values","excludeSource","processModuleFilter","shouldAddToIgnoreList","mutateSourceMapWithDebugId","sourceMap","sourceMapObject","JSON","parse","stringify","getDefaultSerializer","fallbackSerializer","defaultSerializer","props","customSerializerOptions","serializerOptions","supportsNonSerialReturn","output","includeBytecode","outputMode","includeSourceMaps","sourceUrl","isJscSafeUrl","toNormalUrl","url","URL","searchParams","get","assets","graphToSerialAssetsAsync","finalSerializer","processor"],"sources":["../../src/serializer/withExpoSerializers.ts"],"sourcesContent":["/**\n * Copyright © 2022 650 Industries.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { isJscSafeUrl, toNormalUrl } from 'jsc-safe-url';\nimport { MetroConfig, MixedOutput, Module, ReadOnlyGraph, SerializerOptions } from 'metro';\nimport sourceMapString from 'metro/src/DeltaBundler/Serializers/sourceMapString';\nimport bundleToString from 'metro/src/lib/bundleToString';\nimport { ConfigT, InputConfigT } from 'metro-config';\n\nimport { stringToUUID } from './debugId';\nimport {\n environmentVariableSerializerPlugin,\n serverPreludeSerializerPlugin,\n} from './environmentVariableSerializerPlugin';\nimport { ExpoSerializerOptions, baseJSBundle } from './fork/baseJSBundle';\nimport { getSortedModules, graphToSerialAssetsAsync } from './serializeChunks';\nimport { SerialAsset } from './serializerAssets';\nimport { env } from '../env';\n\nexport type Serializer = NonNullable<ConfigT['serializer']['customSerializer']>;\n\nexport type SerializerParameters = [\n string,\n readonly Module[],\n ReadOnlyGraph,\n ExpoSerializerOptions,\n];\n\nexport type SerializerConfigOptions = {\n unstable_beforeAssetSerializationPlugins?: ((serializationInput: {\n graph: ReadOnlyGraph<MixedOutput>;\n premodules: Module[];\n debugId?: string;\n }) => Module[])[];\n};\n\n// A serializer that processes the input and returns a modified version.\n// Unlike a serializer, these can be chained together.\nexport type SerializerPlugin = (...props: SerializerParameters) => SerializerParameters;\n\nexport function withExpoSerializers(\n config: InputConfigT,\n options: SerializerConfigOptions = {}\n): InputConfigT {\n const processors: SerializerPlugin[] = [];\n processors.push(serverPreludeSerializerPlugin);\n if (!env.EXPO_NO_CLIENT_ENV_VARS) {\n processors.push(environmentVariableSerializerPlugin);\n }\n\n return withSerializerPlugins(config, processors, options);\n}\n\n// There can only be one custom serializer as the input doesn't match the output.\n// Here we simply run\nexport function withSerializerPlugins(\n config: InputConfigT,\n processors: SerializerPlugin[],\n options: SerializerConfigOptions = {}\n): InputConfigT {\n const originalSerializer = config.serializer?.customSerializer;\n\n return {\n ...config,\n serializer: {\n ...config.serializer,\n customSerializer: createSerializerFromSerialProcessors(\n config,\n processors,\n originalSerializer ?? null,\n options\n ),\n },\n };\n}\n\nexport function createDefaultExportCustomSerializer(\n config: Partial<MetroConfig>,\n configOptions: SerializerConfigOptions = {}\n): Serializer {\n return async (\n entryPoint: string,\n preModules: readonly Module<MixedOutput>[],\n graph: ReadOnlyGraph<MixedOutput>,\n options: SerializerOptions<MixedOutput>\n ): Promise<string | { code: string; map: string }> => {\n const isPossiblyDev = graph.transformOptions.hot;\n // TODO: This is a temporary solution until we've converged on using the new serializer everywhere.\n const enableDebugId = options.inlineSourceMap !== true && !isPossiblyDev;\n\n let debugId: string | undefined;\n const loadDebugId = () => {\n if (!enableDebugId || debugId) {\n return debugId;\n }\n\n // TODO: Perform this cheaper.\n const bundle = baseJSBundle(entryPoint, preModules, graph, {\n ...options,\n debugId: undefined,\n });\n const outputCode = bundleToString(bundle).code;\n debugId = stringToUUID(outputCode);\n return debugId;\n };\n\n let premodulesToBundle = [...preModules];\n\n let bundleCode: string | null = null;\n let bundleMap: string | null = null;\n\n if (config.serializer?.customSerializer) {\n const bundle = await config.serializer?.customSerializer(\n entryPoint,\n premodulesToBundle,\n graph,\n options\n );\n if (typeof bundle === 'string') {\n bundleCode = bundle;\n } else {\n bundleCode = bundle.code;\n bundleMap = bundle.map;\n }\n } else {\n const debugId = loadDebugId();\n if (configOptions.unstable_beforeAssetSerializationPlugins) {\n for (const plugin of configOptions.unstable_beforeAssetSerializationPlugins) {\n premodulesToBundle = plugin({ graph, premodules: [...premodulesToBundle], debugId });\n }\n }\n bundleCode = bundleToString(\n baseJSBundle(entryPoint, premodulesToBundle, graph, {\n ...options,\n debugId,\n })\n ).code;\n }\n\n if (isPossiblyDev) {\n if (bundleMap == null) {\n return bundleCode;\n }\n return {\n code: bundleCode,\n map: bundleMap,\n };\n }\n\n // Exports....\n\n if (!bundleMap) {\n bundleMap = sourceMapString(\n [...premodulesToBundle, ...getSortedModules([...graph.dependencies.values()], options)],\n {\n // TODO: Surface this somehow.\n excludeSource: false,\n // excludeSource: options.serializerOptions?.excludeSource,\n processModuleFilter: options.processModuleFilter,\n shouldAddToIgnoreList: options.shouldAddToIgnoreList,\n }\n );\n }\n\n if (enableDebugId) {\n const mutateSourceMapWithDebugId = (sourceMap: string) => {\n // NOTE: debugId isn't required for inline source maps because the source map is included in the same file, therefore\n // we don't need to disambiguate between multiple source maps.\n const sourceMapObject = JSON.parse(sourceMap);\n sourceMapObject.debugId = loadDebugId();\n // NOTE: Sentry does this, but bun does not.\n // sourceMapObject.debug_id = debugId;\n return JSON.stringify(sourceMapObject);\n };\n\n return {\n code: bundleCode,\n map: mutateSourceMapWithDebugId(bundleMap),\n };\n }\n\n return {\n code: bundleCode,\n map: bundleMap,\n };\n };\n}\n\nfunction getDefaultSerializer(\n config: MetroConfig,\n fallbackSerializer?: Serializer | null,\n configOptions: SerializerConfigOptions = {}\n): Serializer {\n const defaultSerializer =\n fallbackSerializer ?? createDefaultExportCustomSerializer(config, configOptions);\n\n return async (\n ...props: SerializerParameters\n ): Promise<string | { code: string; map: string }> => {\n const [, , , options] = props;\n\n const customSerializerOptions = options.serializerOptions;\n\n // Custom options can only be passed outside of the dev server, meaning\n // we don't need to stringify the results at the end, i.e. this is `npx expo export` or `npx expo export:embed`.\n const supportsNonSerialReturn = !!customSerializerOptions?.output;\n\n const serializerOptions = (() => {\n if (customSerializerOptions) {\n return {\n includeBytecode: customSerializerOptions.includeBytecode,\n outputMode: customSerializerOptions.output,\n includeSourceMaps: customSerializerOptions.includeSourceMaps,\n };\n }\n if (options.sourceUrl) {\n const sourceUrl = isJscSafeUrl(options.sourceUrl)\n ? toNormalUrl(options.sourceUrl)\n : options.sourceUrl;\n\n const url = new URL(sourceUrl, 'https://expo.dev');\n\n return {\n outputMode: url.searchParams.get('serializer.output'),\n includeSourceMaps: url.searchParams.get('serializer.map') === 'true',\n includeBytecode: url.searchParams.get('serializer.bytecode') === 'true',\n };\n }\n return null;\n })();\n\n if (serializerOptions?.outputMode !== 'static') {\n return defaultSerializer(...props);\n }\n\n // Mutate the serializer options with the parsed options.\n options.serializerOptions = {\n ...options.serializerOptions,\n ...serializerOptions,\n };\n\n const assets = await graphToSerialAssetsAsync(\n config,\n {\n includeSourceMaps: !!serializerOptions.includeSourceMaps,\n includeBytecode: !!serializerOptions.includeBytecode,\n ...configOptions,\n },\n ...props\n );\n\n if (supportsNonSerialReturn) {\n // @ts-expect-error: this is future proofing for adding assets to the output as well.\n return assets;\n }\n\n return JSON.stringify(assets);\n };\n}\n\nexport function createSerializerFromSerialProcessors(\n config: MetroConfig,\n processors: (SerializerPlugin | undefined)[],\n originalSerializer: Serializer | null,\n options: SerializerConfigOptions = {}\n): Serializer {\n const finalSerializer = getDefaultSerializer(config, originalSerializer, options);\n return (...props: SerializerParameters): ReturnType<Serializer> => {\n for (const processor of processors) {\n if (processor) {\n props = processor(...props);\n }\n }\n\n return finalSerializer(...props);\n };\n}\n\nexport { SerialAsset };\n"],"mappings":";;;;;;;;;;;;;;;AAMA,SAAAA,YAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,WAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAEA,SAAAE,iBAAA;EAAA,MAAAF,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAC,gBAAA,YAAAA,CAAA;IAAA,OAAAF,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAI,gBAAA;EAAA,MAAAJ,IAAA,GAAAG,sBAAA,CAAAF,OAAA;EAAAG,eAAA,YAAAA,CAAA;IAAA,OAAAJ,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAGA,SAAAK,SAAA;EAAA,MAAAL,IAAA,GAAAC,OAAA;EAAAI,QAAA,YAAAA,CAAA;IAAA,OAAAL,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AACA,SAAAM,qCAAA;EAAA,MAAAN,IAAA,GAAAC,OAAA;EAAAK,oCAAA,YAAAA,CAAA;IAAA,OAAAN,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAIA,SAAAO,cAAA;EAAA,MAAAP,IAAA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CAAC,CAAC,EACzB;EACZ,MAAM0E,eAAe,GAAGpB,oBAAoB,CAACvD,MAAM,EAAEU,kBAAkB,EAAET,OAAO,CAAC;EACjF,OAAO,CAAC,GAAGyD,KAA2B,KAA6B;IACjE,KAAK,MAAMkB,SAAS,IAAI1E,UAAU,EAAE;MAClC,IAAI0E,SAAS,EAAE;QACblB,KAAK,GAAGkB,SAAS,CAAC,GAAGlB,KAAK,CAAC;MAC7B;IACF;IAEA,OAAOiB,eAAe,CAAC,GAAGjB,KAAK,CAAC;EAClC,CAAC;AACH"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expo/metro-config",
|
|
3
|
-
"version": "0.17.
|
|
3
|
+
"version": "0.17.2",
|
|
4
4
|
"description": "A Metro config for running React Native projects with the Metro bundler",
|
|
5
5
|
"main": "build/ExpoMetroConfig.js",
|
|
6
6
|
"scripts": {
|
|
@@ -41,15 +41,17 @@
|
|
|
41
41
|
"@expo/config": "~8.5.0",
|
|
42
42
|
"@expo/env": "~0.2.0",
|
|
43
43
|
"@expo/json-file": "~8.3.0",
|
|
44
|
+
"@expo/spawn-async": "^1.7.2",
|
|
44
45
|
"babel-preset-fbjs": "^3.4.0",
|
|
45
46
|
"chalk": "^4.1.0",
|
|
46
47
|
"debug": "^4.3.2",
|
|
47
48
|
"find-yarn-workspace-root": "~2.0.0",
|
|
49
|
+
"fs-extra": "^9.1.0",
|
|
48
50
|
"getenv": "^1.0.0",
|
|
51
|
+
"glob": "^7.2.3",
|
|
49
52
|
"jsc-safe-url": "^0.2.4",
|
|
50
53
|
"lightningcss": "~1.19.0",
|
|
51
|
-
"
|
|
52
|
-
"postcss": "~8.4.21",
|
|
54
|
+
"postcss": "~8.4.32",
|
|
53
55
|
"resolve-from": "^5.0.0",
|
|
54
56
|
"sucrase": "^3.20.0"
|
|
55
57
|
},
|
|
@@ -58,12 +60,11 @@
|
|
|
58
60
|
},
|
|
59
61
|
"devDependencies": {
|
|
60
62
|
"@jridgewell/trace-mapping": "^0.3.20",
|
|
61
|
-
"@types/path-to-regexp": "^1.7.0",
|
|
62
63
|
"expo-module-scripts": "^3.3.0",
|
|
63
64
|
"sass": "^1.60.0"
|
|
64
65
|
},
|
|
65
66
|
"publishConfig": {
|
|
66
67
|
"access": "public"
|
|
67
68
|
},
|
|
68
|
-
"gitHead": "
|
|
69
|
+
"gitHead": "4a0457eb4024f4461be4f351b91ea06c37120806"
|
|
69
70
|
}
|