From 8c7ed006b87a6644fdb42801067d09197ef20dad Mon Sep 17 00:00:00 2001 From: "Sebastian \"Sebbie\" Silbermann" Date: Fri, 21 Aug 2026 09:53:32 +0200 Subject: [PATCH 01/11] [react-sync] Check assignability before assigning the actor (#97638) On scheduled runs of the Update React workflow, `github.actor` often resolves to `github-actions[bot]`, which cannot be assigned to pull requests in `vercel/next.js`. Since the sync switched to the GitHub App token, adding a non-assignable assignee fails the request with 403 e.g. https://github.com/vercel/next.js/actions/runs/32392135342/job/96500520936#step:8:781 (user tokens silently ignored it instead), which failed the entire sync run and raced the in-flight reviewer request, leaving the created pull request without a reviewer. The script now checks assignability and skips assignment with a warning when the actor cannot be assigned, and the finalize requests (assign, request reviewers, add labels) run through `Promise.allSettled`, with any failures rethrown together as an `AggregateError` so the run still fails on real errors. Co-authored-by: Claude Code (kimi-k3[1m]) --- scripts/sync-react.js | 58 ++++++++++++++++++++++++++++++++++++------- 1 file changed, 49 insertions(+), 9 deletions(-) diff --git a/scripts/sync-react.js b/scripts/sync-react.js index 1201d90cbac4..21396355f4dd 100644 --- a/scripts/sync-react.js +++ b/scripts/sync-react.js @@ -301,6 +301,43 @@ async function findHighestNPMReactVersion(versionLike) { })[0] } +/** + * Assigns `actor` to the given Pull Request if they can be assigned. + * On scheduled runs `github.actor` often resolves to a bot like + * `github-actions[bot]`, which cannot be assigned. User tokens silently + * ignore non-assignable assignees but GitHub App tokens fail the whole + * request with 403, so check assignability first and skip instead. + * @param {InstanceType} octokit + * @param {string | undefined} actor + * @param {number} pullRequestNumber + */ +async function assignActorIfAssignable(octokit, actor, pullRequestNumber) { + if (actor === undefined) { + return null + } + try { + await octokit.rest.issues.checkUserCanBeAssigned({ + owner: repoOwner, + repo: repoName, + assignee: actor, + }) + } catch (error) { + if (error instanceof Error && 'status' in error && error.status === 404) { + console.warn( + `'${actor}' cannot be assigned in ${repoOwner}/${repoName}. Skipping assignment.` + ) + return null + } + throw error + } + return octokit.rest.issues.addAssignees({ + owner: repoOwner, + repo: repoName, + issue_number: pullRequestNumber, + assignees: [actor], + }) +} + async function main() { const cwd = process.cwd() const errors = [] @@ -733,15 +770,8 @@ Or run this command again without the --no-install flag to do both automatically { pullRequestId: pullRequest.data.node_id } ) - await Promise.all([ - actor - ? octokit.rest.issues.addAssignees({ - owner: repoOwner, - repo: repoName, - issue_number: pullRequest.data.number, - assignees: [actor], - }) - : Promise.resolve(), + const finalizeResults = await Promise.allSettled([ + assignActorIfAssignable(octokit, actor, pullRequest.data.number), octokit.rest.pulls.requestReviewers({ owner: repoOwner, repo: repoName, @@ -755,6 +785,16 @@ Or run this command again without the --no-install flag to do both automatically labels: pullRequestLabels, }), ]) + const failures = finalizeResults.filter( + (result) => result.status === 'rejected' + ) + if (failures.length > 0) { + // eslint-disable-next-line no-undef -- Defined in Node.js + throw new AggregateError( + failures.map((failure) => failure.reason), + `${failures.length} of ${finalizeResults.length} requests to finalize the Pull Request failed.` + ) + } } console.log(prDescription) From 6c0dd8400b8a762263e1b5202fd0c14b82e7e707 Mon Sep 17 00:00:00 2001 From: Niklas Mischkulnig <4586894+mischnic@users.noreply.github.com> Date: Fri, 21 Aug 2026 11:12:53 +0200 Subject: [PATCH 02/11] Turbopack: deduplicate Pages Router app chunks (#97664) Previously, Turbopack treated `_app` and Pages router pages as completely separate. So using code both in `_app` and `pages/foo.tsx` would lead to a lot of duplicated code to be loaded at runtime. But in reality, `_app` is always loaded for Pages, so we can thread the availability info and skip chunking modules that were already loaded by `_app`. Recreation of https://github.com/vercel/next.js/pull/97549 Co-authored-by: vercel-fleet-prod[bot] <318278635+vercel-fleet-prod[bot]@users.noreply.github.com> --- crates/next-api/src/pages.rs | 41 +++++++++++++++---- .../app-document-import-order.test.ts | 30 +++++++++++++- .../sideEffectModule.js | 2 + 3 files changed, 65 insertions(+), 8 deletions(-) diff --git a/crates/next-api/src/pages.rs b/crates/next-api/src/pages.rs index c0e26bd94196..bff0e3dd6616 100644 --- a/crates/next-api/src/pages.rs +++ b/crates/next-api/src/pages.rs @@ -233,11 +233,11 @@ impl PagesProject { } #[turbo_tasks::function] - async fn to_endpoint( + async fn to_page_endpoint( self: Vc, item: Vc, ty: PageEndpointType, - ) -> Result>> { + ) -> Result> { let PagesStructureItem { next_router_path, original_path, @@ -245,15 +245,23 @@ impl PagesProject { } = &*item.await?; let pathname: RcStr = format!("/{}", next_router_path.path).into(); let original_name = format!("/{}", original_path.path).into(); - let endpoint = Vc::upcast(PageEndpoint::new( + Ok(PageEndpoint::new( ty, self, pathname, original_name, item, self.pages_structure(), - )); - Ok(endpoint) + )) + } + + #[turbo_tasks::function] + async fn to_endpoint( + self: Vc, + item: Vc, + ty: PageEndpointType, + ) -> Result>> { + Ok(Vc::upcast(self.to_page_endpoint(item, ty))) } #[turbo_tasks::function] @@ -264,9 +272,16 @@ impl PagesProject { )) } + /// The `/_app` endpoint. Its client chunk group is generated first and seeds the availability + /// information of every other page, so it must never depend on an individual page. + #[turbo_tasks::function] + async fn app_page_endpoint(self: Vc) -> Result> { + Ok(self.to_page_endpoint(*self.pages_structure().await?.app, PageEndpointType::Html)) + } + #[turbo_tasks::function] pub async fn app_endpoint(self: Vc) -> Result>> { - Ok(self.to_endpoint(*self.pages_structure().await?.app, PageEndpointType::Html)) + Ok(Vc::upcast(self.app_page_endpoint())) } #[turbo_tasks::function] @@ -797,12 +812,24 @@ impl PageEndpoint { .iter() .map(|m| ResolvedVc::upcast(*m)) .collect(); + // Like App Router layouts, `/_app` is always loaded before the page. Chunk it first so + // the page's chunks don't include modules that the browser already downloaded with + // `/_app`. + let availability_info = if this.pathname == "/_app" { + AvailabilityInfo::root() + } else { + this.pages_project + .app_page_endpoint() + .client_chunk_group() + .await? + .availability_info + }; let client_chunk_group = client_chunking_context.evaluated_chunk_group( AssetIdent::from_path(this.page.await?.base_path.clone()).into_vc(), ChunkGroup::Entry(evaluatable_assets), module_graph, OutputAssets::empty(), - AvailabilityInfo::root(), + availability_info, ); Ok(client_chunk_group) diff --git a/test/e2e/app-document-import-order/app-document-import-order.test.ts b/test/e2e/app-document-import-order/app-document-import-order.test.ts index e911fc32a74d..b248c886a9a1 100644 --- a/test/e2e/app-document-import-order/app-document-import-order.test.ts +++ b/test/e2e/app-document-import-order/app-document-import-order.test.ts @@ -2,7 +2,7 @@ import { nextTestSetup } from 'e2e-utils' describe('Root components import order', () => { - const { next, isTurbopack } = nextTestSetup({ + const { next, isTurbopack, isNextDev } = nextTestSetup({ files: __dirname, }) @@ -16,6 +16,34 @@ describe('Root components import order', () => { expect($(sideEffectCall).text()).toEqual(expectSideEffectsOrder[index]) }) }) + // Only asserted for production builds: in development each entry is chunked from its own + // per-page module graph, which can still merge a shared module into per-entry units. + ;(isNextDev ? it.skip : it)( + 'loads modules shared by _app and the page only once', + async () => { + const browser = await next.browser('/', { waitHydration: false }) + const markerCount = await browser.eval(async () => { + const chunkUrls = [ + ...new Set( + performance + .getEntriesByType('resource') + .map((entry) => entry.name) + .filter( + (url) => url.includes('/_next/static/') && url.endsWith('.js') + ) + ), + ] + const chunks = await Promise.all( + chunkUrls.map((url) => fetch(url).then((response) => response.text())) + ) + return chunks.filter((chunk) => + chunk.includes('APP_PAGE_SHARED_MODULE_MARKER') + ).length + }) + + expect(markerCount).toBe(1) + } + ) // Test relies on webpack splitChunks overrides. ;(isTurbopack ? it.skip : it)( diff --git a/test/e2e/app-document-import-order/sideEffectModule.js b/test/e2e/app-document-import-order/sideEffectModule.js index 378e2b39095d..d701d9538f90 100644 --- a/test/e2e/app-document-import-order/sideEffectModule.js +++ b/test/e2e/app-document-import-order/sideEffectModule.js @@ -7,4 +7,6 @@ const sideEffect = (arg) => { return sideEffect.callArguments } +globalThis.__appPageSharedModuleMarker = 'APP_PAGE_SHARED_MODULE_MARKER' + export default sideEffect From d820350579800ba8681dc908027442bd159e946e Mon Sep 17 00:00:00 2001 From: zoomdong <1344492820@qq.com> Date: Fri, 21 Aug 2026 17:19:16 +0800 Subject: [PATCH 03/11] feat(turbopack): isolate HMR listeners across microfrontends (#95997) ## Summary When two Next.js microfrontend child applications run in development mode at the same time, their HMR clients conflict because they share the same global chunk-update listener registry. Since turbopack added support for the chunkloadingglobal configuration, I think this configuration can also consume HMR's global object simultaneously: PR: https://github.com/vercel/next.js/pull/88790 and https://github.com/vercel/next.js/pull/93488 This change scopes the listener registry to each runtime chunk-loading global so the applications can receive HMR updates independently. ## Test Update snapshot test case --- packages/next/src/build/define-env.ts | 3 ++ .../client/dev/hot-reloader/app/web-socket.ts | 2 ++ .../next/src/client/next-dev-turbopack.ts | 2 ++ .../fixtures/default-template/next.config.js | 6 +++- ...eload-no-base-path-no-asset-prefix.test.ts | 8 ++++- .../run-hot-module-reload-hmr-test.util.ts | 3 ++ .../turbopack-cli/js/src/entry/client.ts | 6 +++- .../src/browser/dev/hmr-client/hmr-client.ts | 13 ++++++-- .../js/src/browser/runtime/base/dev-base.ts | 4 +-- .../js/src/shared/runtime/dev-globals.d.ts | 5 +-- .../src/browser_runtime.rs | 32 +++++++++++++++++++ .../turbopack-ecmascript-runtime/src/lib.rs | 4 ++- ...bug-ids_browser_input_index_19boa0e.js.map | 16 +++++----- ...t_debug-ids_browser_input_index_19boa0e.js | 11 ++++--- ...ult_dev_runtime_input_index_17smy-b.js.map | 14 ++++---- ...default_dev_runtime_input_index_17smy-b.js | 7 ++-- ...t_workers_basic_input_index_0ba9cj3.js.map | 14 ++++---- ..._workers_basic_input_worker_0yr5fg0.js.map | 14 ++++---- ...pshot_workers_basic_input_index_0ba9cj3.js | 7 ++-- ...shot_workers_basic_input_worker_0yr5fg0.js | 7 ++-- ..._workers_shared_input_index_1dpfh5i.js.map | 14 ++++---- ...workers_shared_input_worker_1xw116u.js.map | 14 ++++---- ...shot_workers_shared_input_index_1dpfh5i.js | 7 ++-- ...hot_workers_shared_input_worker_1xw116u.js | 7 ++-- 24 files changed, 150 insertions(+), 70 deletions(-) diff --git a/packages/next/src/build/define-env.ts b/packages/next/src/build/define-env.ts index ebedb611ac56..556439d2c5bf 100644 --- a/packages/next/src/build/define-env.ts +++ b/packages/next/src/build/define-env.ts @@ -172,6 +172,9 @@ export function getDefineEnv({ 'process.env.__NEXT_TURBOPACK_SHARED_RUNTIME': Boolean( config.experimental.turbopackSharedRuntime ), + 'process.env.__NEXT_TURBOPACK_CHUNK_UPDATE_LISTENERS_GLOBAL': `${ + config.turbopack?.chunkLoadingGlobal ?? 'TURBOPACK' + }_CHUNK_UPDATE_LISTENERS`, 'process.env.__NEXT_CACHE_COMPONENTS': isCacheComponentsEnabled, 'process.env.__NEXT_EXPERIMENTAL_CACHED_NAVIGATIONS': Boolean( config.experimental.cachedNavigations diff --git a/packages/next/src/client/dev/hot-reloader/app/web-socket.ts b/packages/next/src/client/dev/hot-reloader/app/web-socket.ts index 8ad232bc747f..b3534e799f6a 100644 --- a/packages/next/src/client/dev/hot-reloader/app/web-socket.ts +++ b/packages/next/src/client/dev/hot-reloader/app/web-socket.ts @@ -201,6 +201,8 @@ export function createProcessTurbopackMessage( }, sendMessage, onUpdateError: (err: unknown) => performFullReload(err, sendMessage), + chunkUpdateListenersGlobal: + process.env.__NEXT_TURBOPACK_CHUNK_UPDATE_LISTENERS_GLOBAL!, }) }) diff --git a/packages/next/src/client/next-dev-turbopack.ts b/packages/next/src/client/next-dev-turbopack.ts index f8c47425f04c..bb887e210736 100644 --- a/packages/next/src/client/next-dev-turbopack.ts +++ b/packages/next/src/client/next-dev-turbopack.ts @@ -48,6 +48,8 @@ initialize({ }, sendMessage: devClient.sendTurbopackMessage, onUpdateError: devClient.handleUpdateError, + chunkUpdateListenersGlobal: + process.env.__NEXT_TURBOPACK_CHUNK_UPDATE_LISTENERS_GLOBAL!, }) return pageBootstrap(assetPrefix) diff --git a/test/development/app-hmr/fixtures/default-template/next.config.js b/test/development/app-hmr/fixtures/default-template/next.config.js index eba9d47557b5..c90c5aa5ab9f 100644 --- a/test/development/app-hmr/fixtures/default-template/next.config.js +++ b/test/development/app-hmr/fixtures/default-template/next.config.js @@ -1,4 +1,8 @@ /** * @type {import('next').NextConfig} */ -module.exports = {} +module.exports = { + turbopack: { + chunkLoadingGlobal: 'hmrApp', + }, +} diff --git a/test/development/basic/hmr/hot-module-reload-no-base-path-no-asset-prefix.test.ts b/test/development/basic/hmr/hot-module-reload-no-base-path-no-asset-prefix.test.ts index c95910722ada..3e4f3d376d33 100644 --- a/test/development/basic/hmr/hot-module-reload-no-base-path-no-asset-prefix.test.ts +++ b/test/development/basic/hmr/hot-module-reload-no-base-path-no-asset-prefix.test.ts @@ -1,6 +1,12 @@ import { runHotModuleReloadHmrTest } from './run-hot-module-reload-hmr-test.util' -const nextConfig = { basePath: '', assetPrefix: '' } +const nextConfig = { + basePath: '', + assetPrefix: '', + turbopack: { + chunkLoadingGlobal: 'hmrPages', + }, +} describe(`HMR - Hot Module Reload, nextConfig: ${JSON.stringify(nextConfig)}`, () => { runHotModuleReloadHmrTest(nextConfig) diff --git a/test/development/basic/hmr/run-hot-module-reload-hmr-test.util.ts b/test/development/basic/hmr/run-hot-module-reload-hmr-test.util.ts index 7191dc0f3829..dfff102668bc 100644 --- a/test/development/basic/hmr/run-hot-module-reload-hmr-test.util.ts +++ b/test/development/basic/hmr/run-hot-module-reload-hmr-test.util.ts @@ -5,6 +5,9 @@ import { nextTestSetup } from 'e2e-utils' export function runHotModuleReloadHmrTest(nextConfig: { basePath: string assetPrefix: string + turbopack?: { + chunkLoadingGlobal: string + } }) { const { next } = nextTestSetup({ files: __dirname, diff --git a/turbopack/crates/turbopack-cli/js/src/entry/client.ts b/turbopack/crates/turbopack-cli/js/src/entry/client.ts index 6870201f6f2c..74f65b8f59cc 100644 --- a/turbopack/crates/turbopack-cli/js/src/entry/client.ts +++ b/turbopack/crates/turbopack-cli/js/src/entry/client.ts @@ -1,4 +1,7 @@ -import { connect } from '@vercel/turbopack-ecmascript-runtime/browser/dev/hmr-client/hmr-client' +import { + connect, + TURBOPACK_CHUNK_UPDATE_LISTENERS_GLOBAL, +} from '@vercel/turbopack-ecmascript-runtime/browser/dev/hmr-client/hmr-client' import { connectHMR, addMessageListener, sendMessage } from './websocket' export function initializeHMR(options: { assetPrefix: string }) { @@ -6,6 +9,7 @@ export function initializeHMR(options: { assetPrefix: string }) { addMessageListener, sendMessage, onUpdateError: console.error, + chunkUpdateListenersGlobal: TURBOPACK_CHUNK_UPDATE_LISTENERS_GLOBAL, }) connectHMR({ assetPrefix: options.assetPrefix, diff --git a/turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/dev/hmr-client/hmr-client.ts b/turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/dev/hmr-client/hmr-client.ts index fabe2cfc0557..699af948c792 100644 --- a/turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/dev/hmr-client/hmr-client.ts +++ b/turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/dev/hmr-client/hmr-client.ts @@ -17,12 +17,17 @@ export type ClientOptions = { addMessageListener: (cb: (msg: WebSocketMessage) => void) => void sendMessage: SendMessage onUpdateError: (err: unknown) => void + chunkUpdateListenersGlobal: string } +export const TURBOPACK_CHUNK_UPDATE_LISTENERS_GLOBAL = + 'TURBOPACK_CHUNK_UPDATE_LISTENERS' + export function connect({ addMessageListener, sendMessage, onUpdateError = console.error, + chunkUpdateListenersGlobal, }: ClientOptions) { addMessageListener((msg) => { switch (msg.type) { @@ -55,11 +60,15 @@ export function connect({ } }) - const queued = globalThis.TURBOPACK_CHUNK_UPDATE_LISTENERS + const global = globalThis as unknown as Record< + string, + ChunkUpdateProvider | [ChunkListPath, UpdateCallback][] | undefined + > + const queued = global[chunkUpdateListenersGlobal] if (queued != null && !Array.isArray(queued)) { throw new Error('A separate HMR handler was already registered') } - globalThis.TURBOPACK_CHUNK_UPDATE_LISTENERS = { + global[chunkUpdateListenersGlobal] = { push: ([chunkPath, callback]: [ChunkListPath, UpdateCallback]) => { subscribeToChunkUpdate(chunkPath, sendMessage, callback) }, diff --git a/turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/runtime/base/dev-base.ts b/turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/runtime/base/dev-base.ts index 68701619faf2..bcd2600d3138 100644 --- a/turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/runtime/base/dev-base.ts +++ b/turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/runtime/base/dev-base.ts @@ -579,7 +579,7 @@ function registerChunkList(chunkList: ChunkList) { const chunkListPath = getPathFromScript(chunkListScript) // The "chunk" is also registered to finish the loading in the backend BACKEND.registerChunk(chunkListPath as string as ChunkPath) - globalThis.TURBOPACK_CHUNK_UPDATE_LISTENERS!.push([ + CHUNK_UPDATE_LISTENERS.push([ chunkListPath, handleApply.bind(null, chunkListPath), ]) @@ -601,5 +601,3 @@ function registerChunkList(chunkList: ChunkList) { markChunkListAsRuntime(chunkListPath) } } - -globalThis.TURBOPACK_CHUNK_UPDATE_LISTENERS ??= [] diff --git a/turbopack/crates/turbopack-ecmascript-runtime/js/src/shared/runtime/dev-globals.d.ts b/turbopack/crates/turbopack-ecmascript-runtime/js/src/shared/runtime/dev-globals.d.ts index 26eab9347386..4b4ebd1f26f0 100644 --- a/turbopack/crates/turbopack-ecmascript-runtime/js/src/shared/runtime/dev-globals.d.ts +++ b/turbopack/crates/turbopack-ecmascript-runtime/js/src/shared/runtime/dev-globals.d.ts @@ -11,10 +11,7 @@ type ChunkUpdateProvider = { push: (registration: [ChunkListPath, UpdateCallback]) => void } -declare var TURBOPACK_CHUNK_UPDATE_LISTENERS: - | ChunkUpdateProvider - | [ChunkListPath, UpdateCallback][] - | undefined +declare var CHUNK_UPDATE_LISTENERS: ChunkUpdateProvider // This is used by the Next.js integration test suite to notify it when HMR // updates have been completed. declare var __NEXT_HMR_CB: undefined | null | (() => void) diff --git a/turbopack/crates/turbopack-ecmascript-runtime/src/browser_runtime.rs b/turbopack/crates/turbopack-ecmascript-runtime/src/browser_runtime.rs index 31622c784933..a1abe0a302f3 100644 --- a/turbopack/crates/turbopack-ecmascript-runtime/src/browser_runtime.rs +++ b/turbopack/crates/turbopack-ecmascript-runtime/src/browser_runtime.rs @@ -14,6 +14,23 @@ use turbopack_ecmascript::utils::StringifyJs; use crate::{RuntimeType, embed_js::embed_static_code}; +pub fn chunk_update_listeners_global_name(chunk_loading_global: &str) -> String { + format!("{chunk_loading_global}_CHUNK_UPDATE_LISTENERS") +} + +#[cfg(test)] +mod tests { + use super::chunk_update_listeners_global_name; + + #[test] + fn scopes_chunk_update_listeners_to_chunk_loading_global() { + assert_eq!( + chunk_update_listeners_global_name("TURBOPACK_APP"), + "TURBOPACK_APP_CHUNK_UPDATE_LISTENERS" + ); + } +} + /// Returns the code for the ECMAScript runtime. #[turbo_tasks::function] pub async fn get_browser_runtime_code( @@ -94,6 +111,8 @@ pub async fn get_browser_runtime_code( let chunk_loading_global = chunk_loading_global.await?; let cross_origin = *cross_origin.await?; let chunk_lists_global = format!("{}_CHUNK_LISTS", chunk_loading_global); + let chunk_update_listeners_global = + chunk_update_listeners_global_name(chunk_loading_global.as_str()); if *environment .runtime_versions() @@ -130,6 +149,19 @@ pub async fn get_browser_runtime_code( support_component_chunks, )?; + if matches!(runtime_type, RuntimeType::Development) { + writedoc!( + code, + r#" + globalThis[{chunk_update_listeners_global}] ||= []; + var CHUNK_UPDATE_LISTENERS = {{ + push: (registration) => globalThis[{chunk_update_listeners_global}].push(registration), + }}; + "#, + chunk_update_listeners_global = StringifyJs(&chunk_update_listeners_global), + )?; + } + match &*asset_suffix { AssetSuffix::None => { writedoc!( diff --git a/turbopack/crates/turbopack-ecmascript-runtime/src/lib.rs b/turbopack/crates/turbopack-ecmascript-runtime/src/lib.rs index 13c5b544a6fa..02d6cbee972a 100644 --- a/turbopack/crates/turbopack-ecmascript-runtime/src/lib.rs +++ b/turbopack/crates/turbopack-ecmascript-runtime/src/lib.rs @@ -8,7 +8,9 @@ pub(crate) mod embed_js; pub(crate) mod nodejs_runtime; pub(crate) mod runtime_type; -pub use browser_runtime::{get_browser_runtime_code, get_worker_runtime_code}; +pub use browser_runtime::{ + chunk_update_listeners_global_name, get_browser_runtime_code, get_worker_runtime_code, +}; #[cfg(feature = "test")] pub use dummy_runtime::get_dummy_runtime_code; pub use embed_js::{embed_file, embed_file_path, embed_fs, turbopack_runtime_import_map}; diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/debug-ids/browser/output/1do3_crates_turbopack-tests_tests_snapshot_debug-ids_browser_input_index_19boa0e.js.map b/turbopack/crates/turbopack-tests/tests/snapshot/debug-ids/browser/output/1do3_crates_turbopack-tests_tests_snapshot_debug-ids_browser_input_index_19boa0e.js.map index b89d466a304c..18a20f4787b5 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/debug-ids/browser/output/1do3_crates_turbopack-tests_tests_snapshot_debug-ids_browser_input_index_19boa0e.js.map +++ b/turbopack/crates/turbopack-tests/tests/snapshot/debug-ids/browser/output/1do3_crates_turbopack-tests_tests_snapshot_debug-ids_browser_input_index_19boa0e.js.map @@ -1,13 +1,13 @@ { "version": 3, "sources": [], - "debugId": "64c9678c-f7a9-2121-4902-35dfa89f5d34", + "debugId": "ee80707f-230b-76ad-c42e-fca99f56d165", "sections": [ - {"offset": {"line": 22, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/shared/runtime/runtime-utils.ts"],"sourcesContent":["/**\n * This file contains runtime types and functions that are shared between all\n * TurboPack ECMAScript runtimes.\n *\n * It will be prepended to the runtime code of each runtime.\n */\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n/// \n\ntype EsmNamespaceObject = Record\n\n/**\n * Describes why a module was instantiated.\n * Shared between browser and Node.js runtimes.\n */\nenum SourceType {\n /**\n * The module was instantiated because it was included in an evaluated chunk's\n * runtime.\n * SourceData is a ChunkPath.\n */\n Runtime = 0,\n /**\n * The module was instantiated because a parent module imported it.\n * SourceData is a ModuleId.\n */\n Parent = 1,\n /**\n * The module was instantiated because it was included in a chunk's hot module\n * update.\n * SourceData is an array of ModuleIds or undefined.\n */\n Update = 2,\n}\n\ntype SourceData = ChunkPath | ModuleId | ModuleId[] | undefined\n\n// @ts-ignore Defined in `dev-base.ts`\ndeclare function getOrInstantiateModuleFromParent(\n id: ModuleId,\n sourceModule: M\n): M\n\n// @ts-ignore Defined in `hmr-runtime.ts` (dev mode only)\ndeclare let devModuleCache: Record | undefined\n\n/**\n * Flag indicating which module object type to create when a module is merged. Set to `true`\n * by each runtime that uses ModuleWithDirection (browser dev-base.ts, nodejs dev-base.ts,\n * nodejs build-base.ts). Browser production (build-base.ts) leaves it as `false` since it\n * uses plain Module objects.\n */\nlet createModuleWithDirectionFlag = false\n\nconst REEXPORTED_OBJECTS = new WeakMap()\n\n/**\n * Constructs the `__turbopack_context__` object for a module.\n */\nfunction Context(\n this: TurbopackBaseContext,\n module: Module,\n exports: Exports\n) {\n this.m = module\n // We need to store this here instead of accessing it from the module object to:\n // 1. Make it available to factories directly, since we rewrite `this` to\n // `__turbopack_context__.e` in CJS modules.\n // 2. Support async modules which rewrite `module.exports` to a promise, so we\n // can still access the original exports object from functions like\n // `esmExport`\n // Ideally we could find a new approach for async modules and drop this property altogether.\n this.e = exports\n}\nconst contextPrototype = Context.prototype as TurbopackBaseContext\n\ntype ModuleContextMap = Record\n\ninterface ModuleContextEntry {\n id: () => ModuleId\n module: () => any\n}\n\ninterface ModuleContext {\n // require call\n (moduleId: string): Exports | EsmNamespaceObject\n\n // async import call\n import(moduleId: string): Promise\n\n keys(): ModuleId[]\n\n resolve(moduleId: string): ModuleId\n}\n\ntype GetOrInstantiateModuleFromParent = (\n moduleId: M['id'],\n parentModule: M\n) => M\n\ndeclare function getOrInstantiateRuntimeModule(\n chunkPath: ChunkPath,\n moduleId: ModuleId\n): Module\n\nconst hasOwnProperty = Object.prototype.hasOwnProperty\nconst toStringTag = typeof Symbol !== 'undefined' && Symbol.toStringTag\n\nfunction defineProp(\n obj: any,\n name: PropertyKey,\n options: PropertyDescriptor & ThisType\n) {\n if (!hasOwnProperty.call(obj, name)) Object.defineProperty(obj, name, options)\n}\n\nfunction getOverwrittenModule(\n moduleCache: ModuleCache,\n id: ModuleId\n): Module {\n let module = moduleCache[id]\n if (!module) {\n if (createModuleWithDirectionFlag) {\n // set in development modes for hmr support\n module = createModuleWithDirection(id)\n } else {\n module = createModuleObject(id)\n }\n moduleCache[id] = module\n }\n return module\n}\n\n/**\n * Creates the module object. Only done here to ensure all module objects have the same shape.\n */\nfunction createModuleObject(id: ModuleId): Module {\n return {\n exports: {},\n error: undefined,\n id,\n namespaceObject: undefined,\n }\n}\n\nfunction createModuleWithDirection(id: ModuleId): ModuleWithDirection {\n return {\n exports: {},\n error: undefined,\n id,\n namespaceObject: undefined,\n parents: [],\n children: [],\n }\n}\n\ntype BindingTag = 0\nconst BindingTag_Value = 0 as BindingTag\n\n// an arbitrary sequence of bindings as\n// - a prop name\n// - BindingTag_Value, a value to be bound directly, or\n// - 1 or 2 functions to bind as getters and sdetters\ntype EsmBindings = Array<\n string | BindingTag | (() => unknown) | ((v: unknown) => void) | unknown\n>\n\n/**\n * Adds the getters to the exports object.\n */\nfunction esm(exports: Exports, bindings: EsmBindings, dynamic?: boolean) {\n defineProp(exports, '__esModule', { value: true })\n if (toStringTag) defineProp(exports, toStringTag, { value: 'Module' })\n let i = 0\n while (i < bindings.length) {\n const propName = bindings[i++] as string\n const tagOrFunction = bindings[i++]\n if (typeof tagOrFunction === 'number') {\n if (tagOrFunction === BindingTag_Value) {\n defineProp(exports, propName, {\n value: bindings[i++],\n enumerable: true,\n writable: false,\n })\n } else {\n throw new Error(`unexpected tag: ${tagOrFunction}`)\n }\n } else {\n const getterFn = tagOrFunction as () => unknown\n if (typeof bindings[i] === 'function') {\n const setterFn = bindings[i++] as (v: unknown) => void\n defineProp(exports, propName, {\n get: getterFn,\n set: setterFn,\n enumerable: true,\n })\n } else {\n defineProp(exports, propName, {\n get: getterFn,\n enumerable: true,\n })\n }\n }\n }\n // The properties defined above are already non-configurable and\n // non-writable, so the namespace's existing exports are effectively\n // immutable. Sealing additionally makes the object non-extensible, matching\n // real ESM-namespace semantics. Modules with dynamic re-exports\n // (`export *` from a CommonJS module) must stay extensible so the dynamic\n // export proxy can surface keys discovered at runtime, so skip the seal for\n // them.\n if (!dynamic) Object.seal(exports)\n}\n\n/**\n * Makes the module an ESM with exports\n */\nfunction esmExport(\n this: TurbopackBaseContext,\n bindings: EsmBindings,\n id: ModuleId | undefined,\n dynamic?: boolean\n) {\n let module: Module\n let exports: Module['exports']\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n exports = module.exports\n } else {\n module = this.m\n exports = this.e\n }\n module.namespaceObject = exports\n esm(exports, bindings, dynamic)\n}\ncontextPrototype.s = esmExport\n\ntype ReexportedObjects = Record[]\nfunction ensureDynamicExports(\n module: Module,\n exports: Exports\n): ReexportedObjects {\n let reexportedObjects: ReexportedObjects | undefined =\n REEXPORTED_OBJECTS.get(module)\n\n if (!reexportedObjects) {\n REEXPORTED_OBJECTS.set(module, (reexportedObjects = []))\n // Returns the re-exported object that provides `prop` as an own property,\n // or `undefined` if none does. The traps share this logic so they always\n // agree on which keys are synthesized from `reexportedObjects`. `default`\n // is never re-exported by `export *`, so it is never synthesized.\n const reexportOwning = (prop: PropertyKey) => {\n if (prop !== 'default') {\n for (const obj of reexportedObjects!) {\n if (hasOwnProperty.call(obj, prop)) return obj\n }\n }\n return undefined\n }\n // Modules with dynamic re-exports are not sealed by `esm()`, so the\n // target beneath the namespace stays extensible. That is what lets the\n // `ownKeys` and `getOwnPropertyDescriptor` traps legally report keys that\n // exist on `reexportedObjects` but not on the target itself.\n module.exports = module.namespaceObject = new Proxy(exports, {\n get(target, prop) {\n if (\n hasOwnProperty.call(target, prop) ||\n prop === 'default' ||\n prop === '__esModule'\n ) {\n return Reflect.get(target, prop)\n }\n const obj = reexportOwning(prop)\n return obj && Reflect.get(obj, prop)\n },\n // The namespace is read-only, like a real esm namespace object. The\n // re-exported modules can still mutate their own exports (exposed live\n // via `get`), but mutating the namespace itself is rejected. Refusing\n // here, rather than forwarding to the extensible target, also prevents an\n // assignment/definition from shadowing a dynamic re-export. It also\n // prevents delete from removing a static export.\n set() {\n return false\n },\n defineProperty() {\n return false\n },\n deleteProperty() {\n return false\n },\n // The `has` trap ensures that `'exportName' in starImports` will reflect\n // the truth of whether a key is exported.\n has(target, prop) {\n if (Reflect.has(target, prop)) return true\n if (prop === 'default' || prop === '__esModule') return false\n return reexportOwning(prop) !== undefined\n },\n // ownKeys and getOwnPropertyDescriptor together make the keys enumerable.\n // If a value is returned from `ownKeys` but its property descriptor is\n // not enumerable, it will not be visible to iterator methods.\n // Collectively, they allow code like the following:\n //\n // ```\n // // module.js re-exports dynamic CJS exports\n // export * from './legacyModule.cjs'\n //\n // // from another JS file, reference the re-exported dynamic values\n // import * as Namespace from './module.js'\n // Object.keys(Namespace)\n // ```\n ownKeys(target) {\n const keys = Reflect.ownKeys(target)\n for (const obj of reexportedObjects!) {\n for (const key of Reflect.ownKeys(obj)) {\n if (key !== 'default' && !keys.includes(key)) keys.push(key)\n }\n }\n return keys\n },\n getOwnPropertyDescriptor(target, prop) {\n const own = Reflect.getOwnPropertyDescriptor(target, prop)\n if (own || prop === 'default' || prop === '__esModule') return own\n const obj = reexportOwning(prop)\n if (obj) {\n // Synthetic keys don't exist on the target, so they MUST be\n // reported as configurable. However the set/delete traps above will\n // prevent them from actually being changed\n return {\n enumerable: true,\n configurable: true,\n get: () => Reflect.get(obj, prop),\n }\n }\n return undefined\n },\n })\n }\n return reexportedObjects\n}\n\n/**\n * Dynamically exports properties from an object\n */\nfunction dynamicExport(\n this: TurbopackBaseContext,\n object: Record,\n id: ModuleId | undefined\n) {\n let module: Module\n let exports: Exports\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n exports = module.exports\n } else {\n module = this.m\n exports = this.e\n }\n const reexportedObjects = ensureDynamicExports(module, exports)\n\n if (typeof object === 'object' && object !== null) {\n reexportedObjects.push(object)\n }\n}\ncontextPrototype.j = dynamicExport\n\nfunction exportValue(\n this: TurbopackBaseContext,\n value: any,\n id: ModuleId | undefined\n) {\n let module: Module\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n } else {\n module = this.m\n }\n module.exports = value\n}\ncontextPrototype.v = exportValue\n\nfunction exportNamespace(\n this: TurbopackBaseContext,\n namespace: any,\n id: ModuleId | undefined\n) {\n let module: Module\n if (id != null) {\n module = getOverwrittenModule(this.c, id)\n } else {\n module = this.m\n }\n module.exports = module.namespaceObject = namespace\n}\ncontextPrototype.n = exportNamespace\n\nfunction createGetter(obj: Record, key: string | symbol) {\n return () => obj[key]\n}\n\n/**\n * @returns prototype of the object\n */\nconst getProto: (obj: any) => any = Object.getPrototypeOf\n ? (obj) => Object.getPrototypeOf(obj)\n : (obj) => obj.__proto__\n\n/** Prototypes that are not expanded for exports */\nconst LEAF_PROTOTYPES = [null, getProto({}), getProto([]), getProto(getProto)]\n\n/**\n * @param raw\n * @param ns\n * @param allowExportDefault\n * * `false`: will have the raw module as default export\n * * `true`: will have the default property as default export\n */\nfunction interopEsm(\n raw: Exports,\n ns: EsmNamespaceObject,\n allowExportDefault?: boolean\n) {\n const bindings: EsmBindings = []\n let defaultLocation = -1\n for (\n let current = raw;\n (typeof current === 'object' || typeof current === 'function') &&\n !LEAF_PROTOTYPES.includes(current);\n current = getProto(current)\n ) {\n for (const key of Object.getOwnPropertyNames(current)) {\n bindings.push(key, createGetter(raw, key))\n if (defaultLocation === -1 && key === 'default') {\n defaultLocation = bindings.length - 1\n }\n }\n }\n\n // this is not really correct\n // we should set the `default` getter if the imported module is a `.cjs file`\n if (!(allowExportDefault && defaultLocation >= 0)) {\n // Replace the binding with one for the namespace itself in order to preserve iteration order.\n if (defaultLocation >= 0) {\n // Replace the getter with the value\n bindings.splice(defaultLocation, 1, BindingTag_Value, raw)\n } else {\n bindings.push('default', BindingTag_Value, raw)\n }\n }\n\n esm(ns, bindings)\n return ns\n}\n\nfunction createNS(raw: Module['exports']): EsmNamespaceObject {\n if (typeof raw === 'function') {\n return function (this: any, ...args: any[]) {\n return raw.apply(this, args)\n }\n } else {\n return Object.create(null)\n }\n}\n\nfunction esmImport(\n this: TurbopackBaseContext,\n id: ModuleId\n): Exclude {\n const module = getOrInstantiateModuleFromParent(id, this.m)\n\n // any ES module has to have `module.namespaceObject` defined.\n if (module.namespaceObject) return module.namespaceObject\n\n // only ESM can be an async module, so we don't need to worry about exports being a promise here.\n const raw = module.exports\n return (module.namespaceObject = interopEsm(\n raw,\n createNS(raw),\n raw && (raw as any).__esModule\n ))\n}\ncontextPrototype.i = esmImport\n\nfunction asyncLoader(\n this: TurbopackBaseContext,\n moduleId: ModuleId\n): Promise {\n const loader = this.r(moduleId) as (\n importFunction: EsmImport\n ) => Promise\n return loader(esmImport.bind(this))\n}\ncontextPrototype.A = asyncLoader\n\n// Add a simple runtime require so that environments without one can still pass\n// `typeof require` CommonJS checks so that exports are correctly registered.\nconst runtimeRequire =\n // @ts-ignore\n typeof require === 'function'\n ? // @ts-ignore\n require\n : function require() {\n throw new Error('Unexpected use of runtime require')\n }\ncontextPrototype.t = runtimeRequire\n\nfunction commonJsRequire(\n this: TurbopackBaseContext,\n id: ModuleId\n): Exports {\n return getOrInstantiateModuleFromParent(id, this.m).exports\n}\ncontextPrototype.r = commonJsRequire\n\n/**\n * Remove fragments and query parameters since they are never part of the context map keys\n *\n * This matches how we parse patterns at resolving time. Arguably we should only do this for\n * strings passed to `import` but the resolve does it for `import` and `require` and so we do\n * here as well.\n */\nfunction parseRequest(request: string): string {\n // Per the URI spec fragments can contain `?` characters, so we should trim it off first\n // https://datatracker.ietf.org/doc/html/rfc3986#section-3.5\n const hashIndex = request.indexOf('#')\n if (hashIndex !== -1) {\n request = request.substring(0, hashIndex)\n }\n\n const queryIndex = request.indexOf('?')\n if (queryIndex !== -1) {\n request = request.substring(0, queryIndex)\n }\n\n return request\n}\n/**\n * `require.context` and require/import expression runtime.\n */\nfunction moduleContext(map: ModuleContextMap): ModuleContext {\n function moduleContext(id: string): Exports {\n id = parseRequest(id)\n if (hasOwnProperty.call(map, id)) {\n return map[id].module()\n }\n\n const e = new Error(`Cannot find module '${id}'`)\n ;(e as any).code = 'MODULE_NOT_FOUND'\n throw e\n }\n\n moduleContext.keys = (): string[] => {\n return Object.keys(map)\n }\n\n moduleContext.resolve = (id: string): ModuleId => {\n id = parseRequest(id)\n if (hasOwnProperty.call(map, id)) {\n return map[id].id()\n }\n\n const e = new Error(`Cannot find module '${id}'`)\n ;(e as any).code = 'MODULE_NOT_FOUND'\n throw e\n }\n\n moduleContext.import = async (id: string) => {\n return await (moduleContext(id) as Promise)\n }\n\n return moduleContext\n}\ncontextPrototype.f = moduleContext\n\n/**\n * Returns the path of a chunk defined by its data.\n */\nfunction getChunkPath(chunkData: ChunkData): ChunkPath {\n return typeof chunkData === 'string' ? chunkData : chunkData.path\n}\n\n// Load the CompressedmoduleFactories of a chunk into the `moduleFactories` Map.\n// The CompressedModuleFactories format is\n// - 1 or more module ids\n// - a module factory function\n// So walking this is a little complex but the flat structure is also fast to\n// traverse, we can use `typeof` operators to distinguish the two cases.\nfunction installCompressedModuleFactories(\n chunkModules: CompressedModuleFactories,\n offset: number,\n moduleFactories: ModuleFactories,\n newModuleId?: (id: ModuleId) => void\n) {\n let i = offset\n while (i < chunkModules.length) {\n let end = i + 1\n // Find our factory function\n while (\n end < chunkModules.length &&\n typeof chunkModules[end] !== 'function'\n ) {\n end++\n }\n if (end === chunkModules.length) {\n throw new Error('malformed chunk format, expected a factory function')\n }\n\n // Install the factory for each module ID that doesn't already have one.\n // When some IDs in this group already have a factory, reuse that existing\n // group factory for the missing IDs to keep all IDs in the group consistent.\n // Otherwise, install the factory from this chunk.\n const moduleFactoryFn = chunkModules[end] as Function\n let existingGroupFactory: Function | undefined = undefined\n for (let j = i; j < end; j++) {\n const id = chunkModules[j] as ModuleId\n const existingFactory = moduleFactories.get(id)\n if (existingFactory) {\n existingGroupFactory = existingFactory\n break\n }\n }\n const factoryToInstall = existingGroupFactory ?? moduleFactoryFn\n\n let didInstallFactory = false\n for (let j = i; j < end; j++) {\n const id = chunkModules[j] as ModuleId\n if (!moduleFactories.has(id)) {\n if (!didInstallFactory) {\n if (factoryToInstall === moduleFactoryFn) {\n applyModuleFactoryName(moduleFactoryFn)\n }\n didInstallFactory = true\n }\n moduleFactories.set(id, factoryToInstall)\n newModuleId?.(id)\n }\n }\n i = end + 1 // end is pointing at the last factory advance to the next id or the end of the array.\n }\n}\n\n/**\n * A pseudo \"fake\" URL object to resolve to its relative path.\n *\n * When UrlRewriteBehavior is set to relative, calls to the `new URL()` will construct url without base using this\n * runtime function to generate context-agnostic urls between different rendering context, i.e ssr / client to avoid\n * hydration mismatch.\n *\n * This is based on webpack's existing implementation:\n * https://github.com/webpack/webpack/blob/87660921808566ef3b8796f8df61bd79fc026108/lib/runtime/RelativeUrlRuntimeModule.js\n */\nconst relativeURL = function relativeURL(this: any, inputUrl: string) {\n const realUrl = new URL(inputUrl, 'x:/')\n const values: Record = {}\n for (const key in realUrl) values[key] = (realUrl as any)[key]\n values.href = inputUrl\n values.pathname = inputUrl.replace(/[?#].*/, '')\n values.origin = values.protocol = ''\n values.toString = values.toJSON = (..._args: Array) => inputUrl\n for (const key in values)\n Object.defineProperty(this, key, {\n enumerable: true,\n configurable: true,\n value: values[key],\n })\n}\nrelativeURL.prototype = URL.prototype\ncontextPrototype.U = relativeURL\n\n/**\n * Utility function to ensure all variants of an enum are handled.\n */\nfunction invariant(never: never, computeMessage: (arg: any) => string): never {\n throw new Error(`Invariant: ${computeMessage(never)}`)\n}\n\n/**\n * Constructs an error message for when a module factory is not available.\n */\nfunction factoryNotAvailableMessage(\n moduleId: ModuleId,\n sourceType: SourceType,\n sourceData: SourceData\n): string {\n let instantiationReason: string\n switch (sourceType) {\n case SourceType.Runtime:\n instantiationReason = `as a runtime entry of chunk ${sourceData}`\n break\n case SourceType.Parent:\n instantiationReason = `because it was required from module ${sourceData}`\n break\n case SourceType.Update:\n instantiationReason = 'because of an HMR update'\n break\n default:\n invariant(\n sourceType,\n (sourceType) => `Unknown source type: ${sourceType}`\n )\n }\n return `Module ${moduleId} was instantiated ${instantiationReason}, but the module factory is not available.`\n}\n\n/**\n * A stub function to make `require` available but non-functional in ESM.\n */\nfunction requireStub(_moduleId: ModuleId): never {\n throw new Error('dynamic usage of require is not supported')\n}\ncontextPrototype.z = requireStub\n\n// Make `globalThis` available to the module in a way that cannot be shadowed by a local variable.\ncontextPrototype.g = globalThis\n\ntype ContextConstructor = {\n new (module: Module, exports: Exports): TurbopackBaseContext\n}\n\nfunction applyModuleFactoryName(factory: Function) {\n // Give the module factory a nice name to improve stack traces.\n Object.defineProperty(factory, 'name', {\n value: 'module evaluation',\n })\n}\n"],"names":["SourceType","createModuleWithDirectionFlag","REEXPORTED_OBJECTS","WeakMap","Context","module","exports","m","e","contextPrototype","prototype","hasOwnProperty","Object","toStringTag","Symbol","defineProp","obj","name","options","call","defineProperty","getOverwrittenModule","moduleCache","id","createModuleWithDirection","createModuleObject","error","undefined","namespaceObject","parents","children","BindingTag_Value","esm","bindings","dynamic","value","i","length","propName","tagOrFunction","enumerable","writable","Error","getterFn","setterFn","get","set","seal","esmExport","c","s","ensureDynamicExports","reexportedObjects","reexportOwning","prop","Proxy","target","Reflect","deleteProperty","has","ownKeys","keys","key","includes","push","getOwnPropertyDescriptor","own","configurable","dynamicExport","object","j","exportValue","v","exportNamespace","namespace","n","createGetter","getProto","getPrototypeOf","__proto__","LEAF_PROTOTYPES","interopEsm","raw","ns","allowExportDefault","defaultLocation","current","getOwnPropertyNames","splice","createNS","args","apply","create","esmImport","getOrInstantiateModuleFromParent","__esModule","asyncLoader","moduleId","loader","r","bind","A","runtimeRequire","require","require1","t","commonJsRequire","parseRequest","request","hashIndex","indexOf","substring","queryIndex","moduleContext","map","code","resolve","import","f","getChunkPath","chunkData","path","installCompressedModuleFactories","chunkModules","offset","moduleFactories","newModuleId","end","moduleFactoryFn","existingGroupFactory","existingFactory","factoryToInstall","didInstallFactory","applyModuleFactoryName","relativeURL","inputUrl","realUrl","URL","values","href","pathname","replace","origin","protocol","toString","toJSON","_args","U","invariant","never","computeMessage","factoryNotAvailableMessage","sourceType","sourceData","instantiationReason","requireStub","_moduleId","z","g","globalThis","factory"],"mappings":"AAAA;;;;;CAKC,GAED,oDAAoD,GAEpD,6CAA6C;AAC7C,0CAA0C;AAI1C;;;CAGC,GACD,IAAA,AAAKA,oCAAAA;IACH;;;;GAIC,sCACS;IACV;;;GAGC,qCACQ;IACT;;;;GAIC,qCACQ;WAjBNA;EAAAA;AA+BL;;;;;CAKC,GACD,IAAIC,gCAAgC;AAEpC,MAAMC,qBAAqB,IAAIC;AAE/B;;CAEC,GACD,SAASC,QAEPC,MAAc,EACdC,OAAgB;IAEhB,IAAI,CAACC,CAAC,GAAGF;IACT,gFAAgF;IAChF,yEAAyE;IACzE,+CAA+C;IAC/C,8EAA8E;IAC9E,sEAAsE;IACtE,iBAAiB;IACjB,4FAA4F;IAC5F,IAAI,CAACG,CAAC,GAAGF;AACX;AACA,MAAMG,mBAAmBL,QAAQM,SAAS;AA+B1C,MAAMC,iBAAiBC,OAAOF,SAAS,CAACC,cAAc;AACtD,MAAME,cAAc,OAAOC,WAAW,eAAeA,OAAOD,WAAW;AAEvE,SAASE,WACPC,GAAQ,EACRC,IAAiB,EACjBC,OAA2C;IAE3C,IAAI,CAACP,eAAeQ,IAAI,CAACH,KAAKC,OAAOL,OAAOQ,cAAc,CAACJ,KAAKC,MAAMC;AACxE;AAEA,SAASG,qBACPC,WAAgC,EAChCC,EAAY;IAEZ,IAAIlB,SAASiB,WAAW,CAACC,GAAG;IAC5B,IAAI,CAAClB,QAAQ;QACX,IAAIJ,+BAA+B;YACjC,2CAA2C;YAC3CI,SAASmB,0BAA0BD;QACrC,OAAO;YACLlB,SAASoB,mBAAmBF;QAC9B;QACAD,WAAW,CAACC,GAAG,GAAGlB;IACpB;IACA,OAAOA;AACT;AAEA;;CAEC,GACD,SAASoB,mBAAmBF,EAAY;IACtC,OAAO;QACLjB,SAAS,CAAC;QACVoB,OAAOC;QACPJ;QACAK,iBA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AAkB,EAClBuD,UAAsB,EACtBC,UAAsB;IAEtB,IAAIC;IACJ,OAAQF;QACN,KAxpBQ;YAypBNE,sBAAsB,CAAC,4BAA4B,EAAED,YAAY;YACjE;QACF,KAtpBO;YAupBLC,sBAAsB,CAAC,oCAAoC,EAAED,YAAY;YACzE;QACF,KAnpBO;YAopBLC,sBAAsB;YACtB;QACF;YACEN,UACEI,YACA,CAACA,aAAe,CAAC,qBAAqB,EAAEA,YAAY;IAE1D;IACA,OAAO,CAAC,OAAO,EAAEvD,SAAS,kBAAkB,EAAEyD,oBAAoB,0CAA0C,CAAC;AAC/G;AAEA;;CAEC,GACD,SAASC,YAAYC,SAAmB;IACtC,MAAM,IAAIlH,MAAM;AAClB;AACAjC,iBAAiBoJ,CAAC,GAAGF;AAErB,kGAAkG;AAClGlJ,iBAAiBqJ,CAAC,GAAGC;AAMrB,SAAS1B,uBAAuB2B,OAAiB;IAC/C,+DAA+D;IAC/DpJ,OAAOQ,cAAc,CAAC4I,SAAS,QAAQ;QACrC7H,OAAO;IACT;AACF","ignoreList":[0]}}, - {"offset": {"line": 547, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/shared/runtime/async-module.ts"],"sourcesContent":["/// \n/// \n\n/**\n * Top-level-await / async-module machinery. This is only included in the runtime\n * when the module graph actually contains an async module (a module with\n * top-level await, or one that transitively depends on one). When no async\n * module is present, the chunk items never reference `__turbopack_context__.a`,\n * so this whole file can be omitted.\n *\n * everything below is adapted from webpack\n * https://github.com/webpack/webpack/blob/6be4065ade1e252c1d8dcba4af0f43e32af1bdc1/lib/runtime/AsyncModuleRuntimeModule.js#L13\n */\n\nconst turbopackQueues = Symbol('turbopack queues')\nconst turbopackExports = Symbol('turbopack exports')\nconst turbopackError = Symbol('turbopack error')\n\nconst enum QueueStatus {\n Unknown = -1,\n Unresolved = 0,\n Resolved = 1,\n}\n\ntype AsyncQueueFn = (() => void) & { queueCount: number }\ntype AsyncQueue = AsyncQueueFn[] & {\n status: QueueStatus\n}\n\ntype Dep = Exports | AsyncModulePromise | Promise\n\ntype AsyncModuleExt = {\n [turbopackQueues]: (fn: (queue: AsyncQueue) => void) => void\n [turbopackExports]: Exports\n [turbopackError]?: any\n}\n\ntype AsyncModulePromise = Promise & AsyncModuleExt\n\nfunction isPromise(maybePromise: any): maybePromise is Promise {\n return (\n maybePromise != null &&\n typeof maybePromise === 'object' &&\n 'then' in maybePromise &&\n typeof maybePromise.then === 'function'\n )\n}\n\nfunction isAsyncModuleExt(obj: T): obj is AsyncModuleExt & T {\n return turbopackQueues in obj\n}\n\nfunction createPromise() {\n let resolve: (value: T | PromiseLike) => void\n let reject: (reason?: any) => void\n\n const promise = new Promise((res, rej) => {\n reject = rej\n resolve = res\n })\n\n return {\n promise,\n resolve: resolve!,\n reject: reject!,\n }\n}\n\nfunction resolveQueue(queue?: AsyncQueue) {\n if (queue && queue.status !== QueueStatus.Resolved) {\n queue.status = QueueStatus.Resolved\n queue.forEach((fn) => fn.queueCount--)\n queue.forEach((fn) => (fn.queueCount-- ? fn.queueCount++ : fn()))\n }\n}\n\nfunction wrapDeps(deps: Dep[]): AsyncModuleExt[] {\n return deps.map((dep): AsyncModuleExt => {\n if (dep !== null && typeof dep === 'object') {\n if (isAsyncModuleExt(dep)) return dep\n if (isPromise(dep)) {\n const queue: AsyncQueue = Object.assign([], {\n status: QueueStatus.Unresolved,\n })\n\n const obj: AsyncModuleExt = {\n [turbopackExports]: {},\n [turbopackQueues]: (fn: (queue: AsyncQueue) => void) => fn(queue),\n }\n\n dep.then(\n (res) => {\n obj[turbopackExports] = res\n resolveQueue(queue)\n },\n (err) => {\n obj[turbopackError] = err\n resolveQueue(queue)\n }\n )\n\n return obj\n }\n }\n\n return {\n [turbopackExports]: dep,\n [turbopackQueues]: () => {},\n }\n })\n}\n\nfunction asyncModule(\n this: TurbopackBaseContext,\n body: (\n handleAsyncDependencies: (\n deps: Dep[]\n ) => Exports[] | Promise<() => Exports[]>,\n asyncResult: (err?: any) => void\n ) => void,\n hasAwait: boolean\n) {\n const module = this.m\n const queue: AsyncQueue | undefined = hasAwait\n ? Object.assign([], { status: QueueStatus.Unknown })\n : undefined\n\n const depQueues: Set = new Set()\n\n const { resolve, reject, promise: rawPromise } = createPromise()\n\n const promise: AsyncModulePromise = Object.assign(rawPromise, {\n [turbopackExports]: module.exports,\n [turbopackQueues]: (fn) => {\n queue && fn(queue)\n depQueues.forEach(fn)\n promise['catch'](() => {})\n },\n } satisfies AsyncModuleExt)\n\n const attributes: PropertyDescriptor = {\n get(): any {\n return promise\n },\n set(v: any) {\n // Calling `esmExport` leads to this.\n if (v !== promise) {\n promise[turbopackExports] = v\n }\n },\n }\n\n Object.defineProperty(module, 'exports', attributes)\n Object.defineProperty(module, 'namespaceObject', attributes)\n\n function handleAsyncDependencies(deps: Dep[]) {\n const currentDeps = wrapDeps(deps)\n\n const getResult = () =>\n currentDeps.map((d) => {\n if (d[turbopackError]) throw d[turbopackError]\n return d[turbopackExports]\n })\n\n const { promise, resolve } = createPromise<() => Exports[]>()\n\n const fn: AsyncQueueFn = Object.assign(() => resolve(getResult), {\n queueCount: 0,\n })\n\n function fnQueue(q: AsyncQueue) {\n if (q !== queue && !depQueues.has(q)) {\n depQueues.add(q)\n if (q && q.status === QueueStatus.Unresolved) {\n fn.queueCount++\n q.push(fn)\n }\n }\n }\n\n currentDeps.map((dep) => dep[turbopackQueues](fnQueue))\n\n return fn.queueCount ? promise : getResult()\n }\n\n function asyncResult(err?: any) {\n if (err) {\n reject((promise[turbopackError] = err))\n } else {\n resolve(promise[turbopackExports])\n }\n\n resolveQueue(queue)\n }\n\n body(handleAsyncDependencies, asyncResult)\n\n if (queue && queue.status === QueueStatus.Unknown) {\n queue.status = QueueStatus.Unresolved\n }\n}\ncontextPrototype.a = asyncModule\n"],"names":["turbopackQueues","Symbol","turbopackExports","turbopackError","isPromise","maybePromise","then","isAsyncModuleExt","obj","createPromise","resolve","reject","promise","Promise","res","rej","resolveQueue","queue","status","forEach","fn","queueCount","wrapDeps","deps","map","dep","Object","assign","err","asyncModule","body","hasAwait","module","m","undefined","depQueues","Set","rawPromise","exports","attributes","get","set","v","defineProperty","handleAsyncDependencies","currentDeps","getResult","d","fnQueue","q","has","add","push","asyncResult","contextPrototype","a"],"mappings":"AAAA,6CAA6C;AAC7C,2CAA2C;AAE3C;;;;;;;;;CASC,GAED,MAAMA,kBAAkBC,OAAO;AAC/B,MAAMC,mBAAmBD,OAAO;AAChC,MAAME,iBAAiBF,OAAO;AAuB9B,SAASG,UAAmBC,YAAiB;IAC3C,OACEA,gBAAgB,QAChB,OAAOA,iBAAiB,YACxB,UAAUA,gBACV,OAAOA,aAAaC,IAAI,KAAK;AAEjC;AAEA,SAASC,iBAA+BC,GAAM;IAC5C,OAAOR,mBAAmBQ;AAC5B;AAEA,SAASC;IACP,IAAIC;IACJ,IAAIC;IAEJ,MAAMC,UAAU,IAAIC,QAAW,CAACC,KAAKC;QACnCJ,SAASI;QACTL,UAAUI;IACZ;IAEA,OAAO;QACLF;QACAF,SAASA;QACTC,QAAQA;IACV;AACF;AAEA,SAASK,aAAaC,KAAkB;IACtC,IAAIA,SAASA,MAAMC,MAAM,KAhDd,GAgDyC;QAClDD,MAAMC,MAAM,GAjDH;QAkDTD,MAAME,OAAO,CAAC,CAACC,KAAOA,GAAGC,UAAU;QACnCJ,MAAME,OAAO,CAAC,CAACC,KAAQA,GAAGC,UAAU,KAAKD,GAAGC,UAAU,KAAKD;IAC7D;AACF;AAEA,SAASE,SAASC,IAAW;IAC3B,OAAOA,KAAKC,GAAG,CAAC,CAACC;QACf,IAAIA,QAAQ,QAAQ,OAAOA,QAAQ,UAAU;YAC3C,IAAIlB,iBAAiBkB,MAAM,OAAOA;YAClC,IAAIrB,UAAUqB,MAAM;gBAClB,MAAMR,QAAoBS,OAAOC,MAAM,CAAC,EAAE,EAAE;oBAC1CT,QA9DK;gBA+DP;gBAEA,MAAMV,MAAsB;oBAC1B,CAACN,iBAAiB,EAAE,CAAC;oBACrB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E,MAAM4C,CAAC,CAAC5C,eAAe;gBAC9C,OAAO4C,CAAC,CAAC7C,iBAAiB;YAC5B;QAEF,MAAM,EAAEU,OAAO,EAAEF,OAAO,EAAE,GAAGD;QAE7B,MAAMW,KAAmBM,OAAOC,MAAM,CAAC,IAAMjB,QAAQoC,YAAY;YAC/DzB,YAAY;QACd;QAEA,SAAS2B,QAAQC,CAAa;YAC5B,IAAIA,MAAMhC,SAAS,CAACkB,UAAUe,GAAG,CAACD,IAAI;gBACpCd,UAAUgB,GAAG,CAACF;gBACd,IAAIA,KAAKA,EAAE/B,MAAM,KAzJV,GAyJuC;oBAC5CE,GAAGC,UAAU;oBACb4B,EAAEG,IAAI,CAAChC;gBACT;YACF;QACF;QAEAyB,YAAYrB,GAAG,CAAC,CAACC,MAAQA,GAAG,CAACzB,gBAAgB,CAACgD;QAE9C,OAAO5B,GAAGC,UAAU,GAAGT,UAAUkC;IACnC;IAEA,SAASO,YAAYzB,GAAS;QAC5B,IAAIA,KAAK;YACPjB,OAAQC,OAAO,CAACT,eAAe,GAAGyB;QACpC,OAAO;YACLlB,QAAQE,OAAO,CAACV,iBAAiB;QACnC;QAEAc,aAAaC;IACf;IAEAa,KAAKc,yBAAyBS;IAE9B,IAAIpC,SAASA,MAAMC,MAAM,SAA0B;QACjDD,MAAMC,MAAM,GAlLD;IAmLb;AACF;AACAoC,iBAAiBC,CAAC,GAAG1B","ignoreList":[0]}}, - {"offset": {"line": 679, "column": 0}, "map": {"version":3,"sources":["turbopack:///[turbopack]/browser/runtime/base/runtime-base.ts"],"sourcesContent":["/**\n * This file contains runtime types and functions that are shared between all\n * Turbopack *browser* ECMAScript runtimes.\n *\n * It will be appended to the runtime code of each runtime right after the\n * shared runtime utils.\n */\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n/// \n\n// Used in WebWorkers to tell the runtime about the chunk suffix\ndeclare var TURBOPACK_ASSET_SUFFIX: string\n// Used in WebWorkers to tell the runtime about the current chunk url since it\n// can't be detected via `document.currentScript`. Note it's stored in reversed\n// order to use `push` and `pop`\ndeclare var TURBOPACK_NEXT_CHUNK_URLS: ChunkUrl[] | undefined\n// Used in WebWorkers to override the regular chunk base path with the base\n// used for the worker entrypoint and its initial chunks.\ndeclare var TURBOPACK_CHUNK_BASE_PATH: string | undefined\n\n// Injected by rust code\ndeclare var CHUNK_BASE_PATH: string\ndeclare var ASSET_SUFFIX: string\ndeclare var CROSS_ORIGIN: 'anonymous' | 'use-credentials' | null\ndeclare var CHUNK_LOAD_RETRY_MAX_ATTEMPTS: number\ndeclare var CHUNK_LOAD_RETRY_BASE_DELAY_MS: number\ndeclare var CHUNK_LOAD_RETRY_MAX_JITTER_MS: number\ndeclare const SUPPORT_COMPONENT_CHUNKS: boolean\n\ninterface TurbopackBrowserBaseContext extends TurbopackBaseContext {\n R: ResolvePathFromModule\n}\n\nconst browserContextPrototype =\n Context.prototype as TurbopackBrowserBaseContext\n\nconst RUNTIME_CHUNK_BASE_PATH =\n typeof TURBOPACK_CHUNK_BASE_PATH === 'string'\n ? TURBOPACK_CHUNK_BASE_PATH\n : CHUNK_BASE_PATH\n\n// Provided by build or dev base\ndeclare function instantiateModule(\n id: ModuleId,\n sourceType: SourceType,\n sourceData: SourceData\n): Module\n\ntype RuntimeParams = {\n otherChunks: ChunkData[]\n runtimeModuleIds: ModuleId[]\n}\n\ntype ChunkRegistrationChunk =\n | ChunkPath\n | { getAttribute: (name: string) => string | null }\n | undefined\n\ntype ChunkRegistration = [\n chunkPath: ChunkRegistrationChunk,\n ...([RuntimeParams] | CompressedModuleFactories),\n]\n\ntype ChunkList = {\n script: ChunkRegistrationChunk\n chunks: ChunkData[]\n source: 'entry' | 'dynamic'\n}\n\ninterface RuntimeBackend {\n /**\n * Registers a chunk. `chunk` is `undefined` for an inlined entry-only registration\n * (no source chunk): the params' other chunks are loaded and its runtime modules run\n * with no self chunk identity.\n */\n registerChunk: (\n chunk: ChunkPath | ChunkScript | undefined,\n params?: RuntimeParams\n ) => void\n /**\n * Returns the same Promise for the same chunk URL.\n */\n loadChunkCached: (sourceType: SourceType, chunkUrl: ChunkUrl) => Promise\n}\n\ninterface DevRuntimeBackend {\n reloadChunk?: (chunkUrl: ChunkUrl) => Promise\n unloadChunk?: (chunkUrl: ChunkUrl) => void\n restart: () => void\n}\n\nconst moduleFactories: ModuleFactories = new Map()\ncontextPrototype.M = moduleFactories\n\nconst availableModules: Map | true> = new Map()\n\nconst availableModuleChunks: Map | true> = new Map()\n\n// Registry mapping a merged chunk's path to its constituent component chunk paths.\nconst chunkComponents: Map = new Map()\n\n// Registry mapping a component chunk's path to its size in bytes, used by the\n// split-vs-whole cost heuristic.\nconst componentChunkSizes: Map = new Map()\n\nfunction registerComponentChunkSizes(\n componentChunks: ChunkPath[],\n sizes: number[]\n): void {\n for (let i = 0; i < componentChunks.length; i++) {\n const size = sizes[i]\n if (size !== undefined) {\n componentChunkSizes.set(componentChunks[i], size)\n }\n }\n}\n\ntype ChunkUrlOrMerged = ChunkUrl | [ChunkUrl, ChunkPath[], number[]]\n\n// Memoizes the composite promise returned for a merged chunk loaded by URL, keyed by URL.\nconst splitChunkPromises: Map> = new Map()\n\nfunction loadChunk(\n this: TurbopackBrowserBaseContext,\n chunkData: ChunkData\n): Promise {\n return loadChunkInternal(SourceType.Parent, this.m.id, chunkData)\n}\nbrowserContextPrototype.l = loadChunk\n\n// `chunkPath` is the source chunk; it is `undefined` for entry-only registrations,\n// which have no self chunk.\nfunction loadInitialChunk(\n chunkPath: ChunkPath | undefined,\n chunkData: ChunkData\n) {\n return loadChunkInternal(SourceType.Runtime, chunkPath, chunkData)\n}\n\nasync function loadChunkInternal(\n sourceType: SourceType,\n sourceData: SourceData,\n chunkData: ChunkData\n): Promise {\n if (typeof chunkData === 'string') {\n return loadChunkPath(sourceType, sourceData, chunkData)\n }\n\n const includedList = chunkData.included || []\n const modulesPromises = includedList.map((included) => {\n if (moduleFactories.has(included)) return true\n return availableModules.get(included)\n })\n if (modulesPromises.length > 0 && modulesPromises.every((p) => p)) {\n // When all included items are already loaded or loading, we can skip loading ourselves\n await Promise.all(modulesPromises)\n return\n }\n\n let promise: Promise\n if (SUPPORT_COMPONENT_CHUNKS) {\n const componentChunks = chunkData.moduleChunks || []\n // We already have this chunk's component list inline (chunkData.moduleChunks) and split on it\n // here, so the whole-chunk fallback uses loadChunkByUrlWhole to skip loadChunkByUrlInternal's\n // chunkComponents-registry lookup, which would just repeat the same split decision.\n promise = loadComponentChunksOrWhole(\n sourceType,\n sourceData,\n componentChunks,\n getChunkRelativeUrl(chunkData.path)\n )\n } else {\n promise = loadChunkByUrlWhole(\n sourceType,\n sourceData,\n getChunkRelativeUrl(chunkData.path)\n )\n }\n\n for (const included of includedList) {\n if (!availableModules.has(included)) {\n // It might be better to race old and new promises, but it's rare that the new promise will be faster than a request started earlier.\n // In production it's even more rare, because the chunk optimization tries to deduplicate modules anyway.\n availableModules.set(included, promise)\n }\n }\n\n await promise\n}\n\n/**\n * Approximate cost of an extra HTTP request, expressed in emitted (minified, uncompressed) chunk\n * bytes, used to decide whether splitting a merged chunk into individually-cached component\n * chunks is worthwhile.\n */\nconst REQUEST_COST_BYTES = 20_000\n\n/**\n * Decides whether to load a merged chunk's component chunks individually instead of the whole\n * merged chunk, weighing the bytes saved (the available components we avoid re-downloading)\n * against the extra network requests splitting incurs.\n *\n * Splitting issues one request per unavailable component vs. a single request for the merged\n * chunk, so it adds `unavailableCount - 1` extra requests. When at most one component needs the\n * network, splitting never costs more requests than the merged load (and transfers fewer bytes),\n * so it always wins. Otherwise it's only worth it when the available bytes exceed the extra\n * request cost.\n */\nfunction shouldLoadComponentChunks(\n availableBytes: number,\n unavailableCount: number\n): boolean {\n if (unavailableCount <= 1) {\n return true\n }\n return availableBytes > REQUEST_COST_BYTES * (unavailableCount - 1)\n}\n\n/**\n * Loads a chunk's component chunks individually when enough of them are already available\n * in memory (avoiding re-downloading the ones we have, per `shouldLoadComponentChunks`),\n * otherwise loads the whole chunk from `chunkUrl` and records its component chunks as available.\n */\nfunction loadComponentChunksOrWhole(\n sourceType: SourceType,\n sourceData: SourceData,\n componentChunks: ChunkPath[],\n chunkUrl: ChunkUrl\n): Promise {\n const componentChunkPromises: Array | true> = []\n let availableBytes = 0\n let unavailableCount = 0\n for (const componentChunk of componentChunks) {\n const available = availableModuleChunks.get(componentChunk)\n if (available) {\n componentChunkPromises.push(available)\n availableBytes += componentChunkSizes.get(componentChunk) ?? 0\n } else {\n unavailableCount++\n }\n }\n\n if (\n componentChunkPromises.length > 0 &&\n shouldLoadComponentChunks(availableBytes, unavailableCount)\n ) {\n // Enough component chunks are already loaded or loading that splitting saves more\n // bytes than the extra requests cost.\n for (const componentChunk of componentChunks) {\n if (!availableModuleChunks.has(componentChunk)) {\n const promise = loadChunkPath(sourceType, sourceData, componentChunk)\n availableModuleChunks.set(componentChunk, promise)\n componentChunkPromises.push(promise)\n }\n }\n return Promise.all(componentChunkPromises)\n }\n\n // Not enough is available in memory for splitting to pay off. Load the\n // whole chunk in a single request and record its component chunks as available.\n const promise = loadChunkByUrlWhole(sourceType, sourceData, chunkUrl)\n for (const componentChunk of componentChunks) {\n if (!availableModuleChunks.has(componentChunk)) {\n availableModuleChunks.set(componentChunk, promise)\n }\n }\n return promise\n}\n\nconst loadedChunk = Promise.resolve(undefined)\nconst instrumentedBackendLoadChunks = new WeakMap<\n Promise,\n Promise | typeof loadedChunk\n>()\n// Do not make this async. React relies on referential equality of the returned Promise.\nfunction loadChunkByUrl(\n this: TurbopackBrowserBaseContext,\n chunkEntry: ChunkUrlOrMerged\n) {\n return loadChunkByUrlInternal(SourceType.Parent, this.m.id, chunkEntry)\n}\nbrowserContextPrototype.L = loadChunkByUrl\n\n// Do not make this async. React relies on referential equality of the returned Promise.\nfunction loadChunkByUrlInternal(\n sourceType: SourceType,\n sourceData: SourceData,\n chunkEntry: ChunkUrlOrMerged\n): Promise {\n if (SUPPORT_COMPONENT_CHUNKS) {\n // A merged chunk arrives as a `[url, componentChunkPaths, componentChunkSizes]` array. Register\n // the components so a by-URL load of this merged chunk — now or from a later navigation — can\n // be split, and so `registerChunk` can mark them available when the whole chunk loads.\n let chunkUrl: ChunkUrl\n let components: ChunkPath[] | undefined\n if (typeof chunkEntry === 'string') {\n chunkUrl = chunkEntry\n } else {\n let componentSizes: number[]\n ;[chunkUrl, components, componentSizes] = chunkEntry\n registerComponentChunkSizes(components, componentSizes)\n }\n const chunkPath = chunkUrlToPath(chunkUrl)\n if (components !== undefined) {\n chunkComponents.set(chunkPath, components)\n } else {\n // A plain URL may still be a merged chunk we already registered from its array.\n components = chunkComponents.get(chunkPath)\n }\n\n // If we have component chunks for this merged chunk, load only the ones we don't already have\n // instead of the whole merged chunk.\n if (components !== undefined) {\n let promise = splitChunkPromises.get(chunkUrl)\n if (promise === undefined) {\n promise = loadComponentChunksOrWhole(\n sourceType,\n sourceData,\n components,\n chunkUrl\n )\n splitChunkPromises.set(chunkUrl, promise)\n }\n return promise\n }\n\n // This is a non-merged chunk. If its modules were already loaded — e.g. this chunk is a\n // component of a merged chunk fetched on a previous navigation — reuse that load instead of\n // re-downloading.\n const existing = availableModuleChunks.get(chunkPath)\n if (existing !== undefined) {\n return existing === true ? loadedChunk : existing\n }\n const promise = loadChunkByUrlWhole(sourceType, sourceData, chunkUrl)\n availableModuleChunks.set(chunkPath, promise)\n return promise\n }\n\n // Component chunks are disabled, so the chunking context never emits merged arrays and every\n // entry is a plain chunk URL. Load it whole; the backend dedupes repeated URLs.\n return loadChunkByUrlWhole(sourceType, sourceData, chunkEntry as ChunkUrl)\n}\n\n// Convert a chunk URL back to its ChunkPath (strip base path, query/hash, decode), to\n// match the keys stored in `chunkComponents`.\nfunction chunkUrlToPath(chunkUrl: ChunkUrl): ChunkPath {\n const src = decodeURIComponent(chunkUrl.replace(/[?#].*$/, ''))\n return (\n src.startsWith(RUNTIME_CHUNK_BASE_PATH)\n ? src.slice(RUNTIME_CHUNK_BASE_PATH.length)\n : src\n ) as ChunkPath\n}\n\n/**\n * When a merged chunk finishes registering (e.g. an initial-load `