From f226c7dc5477dec10045bc8222be788072d7166d Mon Sep 17 00:00:00 2001 From: Will Binns-Smith Date: Wed, 25 Sep 2024 17:37:52 -0700 Subject: [PATCH 01/13] Base JS runtime for builds (#70169) --- .../src/ecmascript/evaluate/chunk.rs | 2 + .../js/package.json | 6 +- .../src/browser/dev/hmr-client/hmr-client.ts | 6 +- .../js/src/browser/runtime/base/build-base.ts | 144 +++++ .../base/dev-base.ts} | 446 +++------------ .../js/src/browser/runtime/base/dev-dummy.ts | 17 + .../base/dev-extensions.ts} | 8 +- .../base/dev-globals.d.ts} | 10 - .../base/dev-protocol.d.ts} | 3 + .../browser/{dev => }/runtime/base/dummy.ts | 10 +- .../js/src/browser/runtime/base/globals.d.ts | 11 + .../src/browser/runtime/base/runtime-base.ts | 324 +++++++++++ .../{dev => }/runtime/base/tsconfig.json | 2 +- .../browser/runtime/dom/dev-backend-dom.ts | 130 +++++ .../runtime/dom/runtime-backend-dom.ts | 131 +---- .../{dev => }/runtime/dom/tsconfig.json | 2 +- .../browser/runtime/edge/dev-backend-edge.ts | 24 + .../runtime/edge/runtime-backend-edge.ts | 19 +- .../{dev => }/runtime/edge/tsconfig.json | 2 +- .../js/src/nodejs/runtime.ts | 16 +- .../js/src/shared/dummy.ts | 5 +- .../js/src/shared/runtime-types.d.ts | 32 +- .../js/src/shared/runtime-utils.ts | 40 +- .../src/browser_runtime.rs | 69 ++- .../output/[turbopack]_runtime.js | 9 +- .../output/[turbopack]_runtime.js.map | 10 +- ..._default_dev_runtime_input_index_b6426d.js | 513 +++++++++--------- ...ault_dev_runtime_input_index_b6426d.js.map | 10 +- 28 files changed, 1153 insertions(+), 848 deletions(-) create mode 100644 turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/runtime/base/build-base.ts rename turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/{dev/runtime/base/runtime-base.ts => runtime/base/dev-base.ts} (75%) create mode 100644 turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/runtime/base/dev-dummy.ts rename turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/{dev/runtime/base/extensions.d.ts => runtime/base/dev-extensions.ts} (83%) rename turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/{dev/runtime/base/globals.d.ts => runtime/base/dev-globals.d.ts} (67%) rename turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/{dev/runtime/base/protocol.d.ts => runtime/base/dev-protocol.d.ts} (96%) rename turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/{dev => }/runtime/base/dummy.ts (66%) create mode 100644 turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/runtime/base/globals.d.ts create mode 100644 turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/runtime/base/runtime-base.ts rename turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/{dev => }/runtime/base/tsconfig.json (78%) create mode 100644 turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/runtime/dom/dev-backend-dom.ts rename turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/{dev => }/runtime/dom/runtime-backend-dom.ts (57%) rename turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/{dev => }/runtime/dom/tsconfig.json (73%) create mode 100644 turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/runtime/edge/dev-backend-edge.ts rename turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/{dev => }/runtime/edge/runtime-backend-edge.ts (90%) rename turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/{dev => }/runtime/edge/tsconfig.json (76%) diff --git a/turbopack/crates/turbopack-browser/src/ecmascript/evaluate/chunk.rs b/turbopack/crates/turbopack-browser/src/ecmascript/evaluate/chunk.rs index a87a681d3e872..69ba25c6713b2 100644 --- a/turbopack/crates/turbopack-browser/src/ecmascript/evaluate/chunk.rs +++ b/turbopack/crates/turbopack-browser/src/ecmascript/evaluate/chunk.rs @@ -146,6 +146,7 @@ impl EcmascriptDevEvaluateChunk { let runtime_code = turbopack_ecmascript_runtime::get_browser_runtime_code( environment, chunking_context.chunk_base_path(), + Value::new(chunking_context.runtime_type()), Vc::cell(output_root.to_string().into()), ); code.push_code(&*runtime_code.await?); @@ -154,6 +155,7 @@ impl EcmascriptDevEvaluateChunk { let runtime_code = turbopack_ecmascript_runtime::get_browser_runtime_code( environment, chunking_context.chunk_base_path(), + Value::new(chunking_context.runtime_type()), Vc::cell(output_root.to_string().into()), ); code.push_code(&*runtime_code.await?); diff --git a/turbopack/crates/turbopack-ecmascript-runtime/js/package.json b/turbopack/crates/turbopack-ecmascript-runtime/js/package.json index e9d1421f77411..b5ff2686751c3 100644 --- a/turbopack/crates/turbopack-ecmascript-runtime/js/package.json +++ b/turbopack/crates/turbopack-ecmascript-runtime/js/package.json @@ -8,9 +8,9 @@ "check": "run-p check:*", "check:nodejs": "tsc -p src/nodejs", "check:browser-dev-client": "tsc -p src/browser/dev/hmr-client", - "check:browser-dev-runtime-base": "tsc -p src/browser/dev/runtime/base", - "check:browser-dev-runtime-dom": "tsc -p src/browser/dev/runtime/dom", - "check:browser-dev-runtime-edge": "tsc -p src/browser/dev/runtime/edge" + "check:browser-runtime-base": "tsc -p src/browser/runtime/base", + "check:browser-runtime-dom": "tsc -p src/browser/runtime/dom", + "check:browser-runtime-edge": "tsc -p src/browser/runtime/edge" }, "exports": { ".": "./src/main.js", 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 fc011843a752c..a8423a2d78fb1 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 @@ -1,7 +1,7 @@ /// -/// -/// -/// +/// +/// +/// import { addMessageListener as turboSocketAddMessageListener, diff --git a/turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/runtime/base/build-base.ts b/turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/runtime/base/build-base.ts new file mode 100644 index 0000000000000..a3968238aadc7 --- /dev/null +++ b/turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/runtime/base/build-base.ts @@ -0,0 +1,144 @@ +/// +/// + +declare var augmentContext: ((context: unknown) => unknown); + +const moduleCache: ModuleCache = {}; + +/** + * Gets or instantiates a runtime module. + */ +// @ts-ignore +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getOrInstantiateRuntimeModule( + moduleId: ModuleId, + chunkPath: ChunkPath, +): Module { + const module = moduleCache[moduleId]; + if (module) { + if (module.error) { + throw module.error; + } + return module; + } + + return instantiateModule(moduleId, { type: SourceType.Runtime, chunkPath }); +} + +/** + * Retrieves a module from the cache, or instantiate it if it is not cached. + */ +// Used by the backend +// @ts-ignore +// eslint-disable-next-line @typescript-eslint/no-unused-vars +const getOrInstantiateModuleFromParent: GetOrInstantiateModuleFromParent = ( + id, + sourceModule +) => { + const module = moduleCache[id]; + + if (module) { + return module; + } + + return instantiateModule(id, { + type: SourceType.Parent, + parentId: sourceModule.id, + }); +}; + +function instantiateModule(id: ModuleId, source: SourceInfo): Module { + const moduleFactory = moduleFactories[id]; + if (typeof moduleFactory !== "function") { + // This can happen if modules incorrectly handle HMR disposes/updates, + // e.g. when they keep a `setTimeout` around which still executes old code + // and contains e.g. a `require("something")` call. + let instantiationReason; + switch (source.type) { + case SourceType.Runtime: + instantiationReason = `as a runtime entry of chunk ${source.chunkPath}`; + break; + case SourceType.Parent: + instantiationReason = `because it was required from module ${source.parentId}`; + break; + case SourceType.Update: + instantiationReason = "because of an HMR update"; + break; + default: + invariant(source, (source) => `Unknown source type: ${source?.type}`); + } + throw new Error( + `Module ${id} was instantiated ${instantiationReason}, but the module factory is not available. It might have been deleted in an HMR update.` + ); + } + + switch (source.type) { + case SourceType.Runtime: + runtimeModules.add(id); + break; + case SourceType.Parent: + // No need to add this module as a child of the parent module here, this + // has already been taken care of in `getOrInstantiateModuleFromParent`. + break; + case SourceType.Update: + throw new Error('Unexpected') + default: + invariant(source, (source) => `Unknown source type: ${source?.type}`); + } + + const module: Module = { + exports: {}, + error: undefined, + loaded: false, + id, + namespaceObject: undefined, + }; + + moduleCache[id] = module; + + // NOTE(alexkirsz) This can fail when the module encounters a runtime error. + try { + const sourceInfo: SourceInfo = { type: SourceType.Parent, parentId: id }; + + const r = commonJsRequire.bind(null, module); + moduleFactory.call( + module.exports, + augmentContext({ + a: asyncModule.bind(null, module), + e: module.exports, + r: commonJsRequire.bind(null, module), + t: runtimeRequire, + f: moduleContext, + i: esmImport.bind(null, module), + s: esmExport.bind(null, module, module.exports), + j: dynamicExport.bind(null, module, module.exports), + v: exportValue.bind(null, module), + n: exportNamespace.bind(null, module), + m: module, + c: moduleCache, + M: moduleFactories, + l: loadChunk.bind(null, sourceInfo), + w: loadWebAssembly.bind(null, sourceInfo), + u: loadWebAssemblyModule.bind(null, sourceInfo), + g: globalThis, + P: resolveAbsolutePath, + U: relativeURL, + R: createResolvePathFromModule(r), + b: getWorkerBlobURL, + __dirname: typeof module.id === "string" ? module.id.replace(/(^|\/)\/+$/, "") : module.id + }) + ); + } catch (error) { + module.error = error as any; + throw error; + } + + module.loaded = true; + if (module.namespaceObject && module.exports !== module.namespaceObject) { + // in case of a circular dependency: cjs1 -> esm2 -> cjs1 + interopEsm(module.exports, module.namespaceObject); + } + + return module; +} + diff --git a/turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/dev/runtime/base/runtime-base.ts b/turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/runtime/base/dev-base.ts similarity index 75% rename from turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/dev/runtime/base/runtime-base.ts rename to turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/runtime/base/dev-base.ts index 69c8019a4915b..ea88ef16ed1b8 100644 --- a/turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/dev/runtime/base/runtime-base.ts +++ b/turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/runtime/base/dev-base.ts @@ -1,3 +1,7 @@ +/// +/// +/// + /** * This file contains runtime types and functions that are shared between all * Turbopack *development* ECMAScript runtimes. @@ -8,10 +12,7 @@ /* eslint-disable @typescript-eslint/no-unused-vars */ -/// -/// -/// -/// +const devModuleCache: ModuleCache = Object.create(null); // This file must not use `import` and `export` statements. Otherwise, it // becomes impossible to augment interfaces declared in ``d files @@ -21,8 +22,8 @@ type RefreshRuntimeGlobals = // Workers are loaded via blob object urls and aren't relative to the main context, this gets // prefixed to chunk urls in the worker. -declare var TURBOPACK_WORKER_LOCATION: string; -declare var CHUNK_BASE_PATH: string; +// declare var TURBOPACK_WORKER_LOCATION: string; +// declare var CHUNK_BASE_PATH: string; declare var $RefreshHelpers$: RefreshRuntimeGlobals["$RefreshHelpers$"]; declare var $RefreshReg$: RefreshRuntimeGlobals["$RefreshReg$"]; declare var $RefreshSig$: RefreshRuntimeGlobals["$RefreshSig$"]; @@ -37,74 +38,21 @@ type RefreshContext = { type RefreshHelpers = RefreshRuntimeGlobals["$RefreshHelpers$"]; -interface TurbopackDevBaseContext extends TurbopackBaseContext { +interface TurbopackDevBaseContext extends TurbopackBaseContext { k: RefreshContext; R: ResolvePathFromModule; } interface TurbopackDevContext extends TurbopackDevBaseContext {} -// string encoding of a module factory (used in hmr updates) -type ModuleFactoryString = string; - type ModuleFactory = ( this: Module["exports"], - context: TurbopackDevContext -) => undefined; - -type DevRuntimeParams = { - otherChunks: ChunkData[]; - runtimeModuleIds: ModuleId[]; -}; - -type ChunkRegistration = [ - chunkPath: ChunkPath, - chunkModules: ModuleFactories, - params: DevRuntimeParams | undefined -]; -type ChunkList = { - path: ChunkPath; - chunks: ChunkData[]; - source: "entry" | "dynamic"; -}; - -enum SourceType { - /** - * The module was instantiated because it was included in an evaluated chunk's - * runtime. - */ - Runtime = 0, - /** - * The module was instantiated because a parent module imported it. - */ - Parent = 1, - /** - * The module was instantiated because it was included in a chunk's hot module - * update. - */ - Update = 2, -} - -type SourceInfo = - | { - type: SourceType.Runtime; - chunkPath: ChunkPath; - } - | { - type: SourceType.Parent; - parentId: ModuleId; - } - | { - type: SourceType.Update; - parents?: ModuleId[]; - }; + context: TurbopackDevBaseContext +) => undefined -interface RuntimeBackend { - registerChunk: (chunkPath: ChunkPath, params?: DevRuntimeParams) => void; - loadChunk: (chunkPath: ChunkPath, source: SourceInfo) => Promise; +interface DevRuntimeBackend { reloadChunk?: (chunkPath: ChunkPath) => Promise; unloadChunk?: (chunkPath: ChunkPath) => void; - restart: () => void; } @@ -119,8 +67,6 @@ class UpdateApplyError extends Error { } } -const moduleFactories: ModuleFactories = Object.create(null); -const moduleCache: ModuleCache = Object.create(null); /** * Maps module IDs to persisted data between executions of their hot module * implementation (`hot.data`). @@ -134,161 +80,62 @@ const moduleHotState: Map = new Map(); * Modules that call `module.hot.invalidate()` (while being updated). */ const queuedInvalidatedModules: Set = new Set(); + /** - * Module IDs that are instantiated as part of the runtime of a chunk. - */ -const runtimeModules: Set = new Set(); -/** - * Map from module ID to the chunks that contain this module. - * - * In HMR, we need to keep track of which modules are contained in which so - * chunks. This is so we don't eagerly dispose of a module when it is removed - * from chunk A, but still exists in chunk B. - */ -const moduleChunksMap: Map> = new Map(); -/** - * Map from a chunk path to all modules it contains. - */ -const chunkModulesMap: Map> = new Map(); -/** - * Chunk lists that contain a runtime. When these chunk lists receive an update - * that can't be reconciled with the current state of the page, we need to - * reload the runtime entirely. - */ -const runtimeChunkLists: Set = new Set(); -/** - * Map from a chunk list to the chunk paths it contains. - */ -const chunkListChunksMap: Map> = new Map(); -/** - * Map from a chunk path to the chunk lists it belongs to. + * Gets or instantiates a runtime module. */ -const chunkChunkListsMap: Map> = new Map(); - -const availableModules: Map | true> = new Map(); - -const availableModuleChunks: Map | true> = new Map(); - -async function loadChunk( - source: SourceInfo, - chunkData: ChunkData -): Promise { - if (typeof chunkData === "string") { - return loadChunkPath(source, chunkData); - } - - const includedList = chunkData.included || []; - const modulesPromises = includedList.map((included) => { - if (moduleFactories[included]) return true; - return availableModules.get(included); - }); - if (modulesPromises.length > 0 && modulesPromises.every((p) => p)) { - // When all included items are already loaded or loading, we can skip loading ourselves - return Promise.all(modulesPromises); - } - - const includedModuleChunksList = chunkData.moduleChunks || []; - const moduleChunksPromises = includedModuleChunksList - .map((included) => { - // TODO(alexkirsz) Do we need this check? - // if (moduleFactories[included]) return true; - return availableModuleChunks.get(included); - }) - .filter((p) => p); - - let promise; - if (moduleChunksPromises.length > 0) { - // Some module chunks are already loaded or loading. - - if (moduleChunksPromises.length === includedModuleChunksList.length) { - // When all included module chunks are already loaded or loading, we can skip loading ourselves - return Promise.all(moduleChunksPromises); - } - - const moduleChunksToLoad: Set = new Set(); - for (const moduleChunk of includedModuleChunksList) { - if (!availableModuleChunks.has(moduleChunk)) { - moduleChunksToLoad.add(moduleChunk); - } +// @ts-ignore +function getOrInstantiateRuntimeModule( + moduleId: ModuleId, + chunkPath: ChunkPath, +): Module { + const module = devModuleCache[moduleId]; + if (module) { + if (module.error) { + throw module.error; } + return module; + } - for (const moduleChunkToLoad of moduleChunksToLoad) { - const promise = loadChunkPath(source, moduleChunkToLoad); - - availableModuleChunks.set(moduleChunkToLoad, promise); + // @ts-ignore + return instantiateModule(moduleId, { type: SourceType.Runtime, chunkPath }); +} - moduleChunksPromises.push(promise); - } +/** + * Retrieves a module from the cache, or instantiate it if it is not cached. + */ +// @ts-ignore Defined in `runtime-utils.ts` +const getOrInstantiateModuleFromParent: GetOrInstantiateModuleFromParent = ( + id, + sourceModule, +) => { + if (!sourceModule.hot.active) { + console.warn( + `Unexpected import of module ${id} from module ${sourceModule.id}, which was deleted by an HMR update` + ); + } - promise = Promise.all(moduleChunksPromises); - } else { - promise = loadChunkPath(source, chunkData.path); + const module = devModuleCache[id]; - // Mark all included module chunks as loading if they are not already loaded or loading. - for (const includedModuleChunk of includedModuleChunksList) { - if (!availableModuleChunks.has(includedModuleChunk)) { - availableModuleChunks.set(includedModuleChunk, promise); - } - } + if (sourceModule.children.indexOf(id) === -1) { + sourceModule.children.push(id); } - for (const included of includedList) { - if (!availableModules.has(included)) { - // 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. - // In production it's even more rare, because the chunk optimization tries to deduplicate modules anyway. - availableModules.set(included, promise); + if (module) { + if (module.parents.indexOf(sourceModule.id) === -1) { + module.parents.push(sourceModule.id); } - } - - return promise; -} -async function loadChunkPath( - source: SourceInfo, - chunkPath: ChunkPath -): Promise { - try { - await BACKEND.loadChunk(chunkPath, source); - } catch (error) { - let loadReason; - switch (source.type) { - case SourceType.Runtime: - loadReason = `as a runtime dependency of chunk ${source.chunkPath}`; - break; - case SourceType.Parent: - loadReason = `from module ${source.parentId}`; - break; - case SourceType.Update: - loadReason = "from an HMR update"; - break; - default: - invariant(source, (source) => `Unknown source type: ${source?.type}`); - } - throw new Error( - `Failed to load chunk ${chunkPath} ${loadReason}${ - error ? `: ${error}` : "" - }`, - error - ? { - cause: error, - } - : undefined - ); + return module; } -} -/** - * Returns an absolute url to an asset. - */ -function createResolvePathFromModule( - resolver: (moduleId: string) => Exports -): (moduleId: string) => string { - return function resolvePathFromModule(moduleId: string): string { - const exported = resolver(moduleId); - return exported?.default ?? exported; - }; -} + return instantiateModule(id, { + type: SourceType.Parent, + parentId: sourceModule.id, + }); +}; +// @ts-ignore Defined in `runtime-base.ts` function instantiateModule(id: ModuleId, source: SourceInfo): Module { const moduleFactory = moduleFactories[id]; if (typeof moduleFactory !== "function") { @@ -335,7 +182,7 @@ function instantiateModule(id: ModuleId, source: SourceInfo): Module { invariant(source, (source) => `Unknown source type: ${source?.type}`); } - const module: Module = { + const module: HotModule = { exports: {}, error: undefined, loaded: false, @@ -346,7 +193,7 @@ function instantiateModule(id: ModuleId, source: SourceInfo): Module { hot, }; - moduleCache[id] = module; + devModuleCache[id] = module; moduleHotState.set(module, hotState); // NOTE(alexkirsz) This can fail when the module encounters a runtime error. @@ -369,7 +216,7 @@ function instantiateModule(id: ModuleId, source: SourceInfo): Module { v: exportValue.bind(null, module), n: exportNamespace.bind(null, module), m: module, - c: moduleCache, + c: devModuleCache, M: moduleFactories, l: loadChunk.bind(null, sourceInfo), w: loadWebAssembly.bind(null, sourceInfo), @@ -399,20 +246,6 @@ function instantiateModule(id: ModuleId, source: SourceInfo): Module { return module; } -/** - * no-op for browser - * @param modulePath - */ -function resolveAbsolutePath(modulePath?: string): string { - return `/ROOT/${modulePath ?? ""}`; -} - -function getWorkerBlobURL(chunks: ChunkPath[]): string { - let bootstrap = `TURBOPACK_WORKER_LOCATION = ${JSON.stringify(location.origin)};importScripts(${chunks.map(c => (`TURBOPACK_WORKER_LOCATION + ${JSON.stringify(getChunkRelativeUrl(c))}`)).join(", ")});`; - let blob = new Blob([bootstrap], { type: "text/javascript" }); - return URL.createObjectURL(blob); -} - /** * NOTE(alexkirsz) Webpack has a "module execution" interception hook that * Next.js' React Refresh runtime hooks into to add module context to the @@ -441,44 +274,11 @@ function runModuleExecutionHooks( } } -/** - * Retrieves a module from the cache, or instantiate it if it is not cached. - */ -const getOrInstantiateModuleFromParent: GetOrInstantiateModuleFromParent = ( - id, - sourceModule -) => { - if (!sourceModule.hot.active) { - console.warn( - `Unexpected import of module ${id} from module ${sourceModule.id}, which was deleted by an HMR update` - ); - } - - const module = moduleCache[id]; - - if (sourceModule.children.indexOf(id) === -1) { - sourceModule.children.push(id); - } - - if (module) { - if (module.parents.indexOf(sourceModule.id) === -1) { - module.parents.push(sourceModule.id); - } - - return module; - } - - return instantiateModule(id, { - type: SourceType.Parent, - parentId: sourceModule.id, - }); -}; - /** * This is adapted from https://github.com/vercel/next.js/blob/3466862d9dc9c8bb3131712134d38757b918d1c0/packages/react-refresh-utils/internal/ReactRefreshModule.runtime.ts */ function registerExportsAndSetupBoundaryForReactRefresh( - module: Module, + module: HotModule, helpers: RefreshHelpers ) { const currentExports = module.exports; @@ -600,9 +400,9 @@ function computedInvalidatedModules( function computeOutdatedSelfAcceptedModules( outdatedModules: Iterable ): { moduleId: ModuleId; errorHandler: true | Function }[] { - const outdatedSelfAcceptedModules = []; + const outdatedSelfAcceptedModules: { moduleId: ModuleId; errorHandler: true | Function }[] = []; for (const moduleId of outdatedModules) { - const module = moduleCache[moduleId]; + const module = devModuleCache[moduleId]; const hotState = moduleHotState.get(module)!; if (module && hotState.selfAccepted && !hotState.selfInvalidated) { outdatedSelfAcceptedModules.push({ @@ -657,9 +457,9 @@ function disposePhase( // We also want to keep track of previous parents of the outdated modules. const outdatedModuleParents = new Map(); for (const moduleId of outdatedModules) { - const oldModule = moduleCache[moduleId]; + const oldModule = devModuleCache[moduleId]; outdatedModuleParents.set(moduleId, oldModule?.parents); - delete moduleCache[moduleId]; + delete devModuleCache[moduleId]; } // TODO(alexkirsz) Dependencies: remove outdated dependency from module @@ -674,15 +474,15 @@ function disposePhase( * Returns the persistent hot data that should be kept for the next module * instance. * - * NOTE: mode = "replace" will not remove modules from the moduleCache. + * NOTE: mode = "replace" will not remove modules from the devModuleCache * This must be done in a separate step afterwards. * This is important because all modules need to be disposed to update the - * parent/child relationships before they are actually removed from the moduleCache. + * parent/child relationships before they are actually removed from the devModuleCache. * If this was done in this method, the following disposeModule calls won't find * the module from the module id in the cache. */ function disposeModule(moduleId: ModuleId, mode: "clear" | "replace") { - const module = moduleCache[moduleId]; + const module = devModuleCache[moduleId]; if (!module) { return; } @@ -708,7 +508,7 @@ function disposeModule(moduleId: ModuleId, mode: "clear" | "replace") { // It will be added back once the module re-instantiates and imports its // children again. for (const childId of module.children) { - const child = moduleCache[childId]; + const child = devModuleCache[childId]; if (!child) { continue; } @@ -721,7 +521,7 @@ function disposeModule(moduleId: ModuleId, mode: "clear" | "replace") { switch (mode) { case "clear": - delete moduleCache[module.id]; + delete devModuleCache[module.id]; moduleHotData.delete(module.id); break; case "replace": @@ -760,7 +560,7 @@ function applyPhase( } catch (err) { if (typeof errorHandler === "function") { try { - errorHandler(err, { moduleId, module: moduleCache[moduleId] }); + errorHandler(err, { moduleId, module: devModuleCache[moduleId] }); } catch (err2) { reportError(err2); reportError(err); @@ -802,10 +602,10 @@ function applyChunkListUpdate(update: ChunkListUpdate) { BACKEND.loadChunk(chunkPath, { type: SourceType.Update }); break; case "total": - BACKEND.reloadChunk?.(chunkPath); + DEV_BACKEND.reloadChunk?.(chunkPath); break; case "deleted": - BACKEND.unloadChunk?.(chunkPath); + DEV_BACKEND.unloadChunk?.(chunkPath); break; case "partial": invariant( @@ -1019,7 +819,7 @@ function getAffectedModuleEffects(moduleId: ModuleId): ModuleEffect { }; } - const module = moduleCache[moduleId]; + const module = devModuleCache[moduleId]; const hotState = moduleHotState.get(module)!; if ( @@ -1049,7 +849,7 @@ function getAffectedModuleEffects(moduleId: ModuleId): ModuleEffect { } for (const parentId of module.parents) { - const parent = moduleCache[parentId]; + const parent = devModuleCache[parentId]; if (!parent) { // TODO(alexkirsz) Is this even possible? @@ -1084,7 +884,7 @@ function handleApply(chunkListPath: ChunkPath, update: ServerMessage) { // This indicates that there is no way to apply the update to the // current state of the application, and that the application must be // restarted. - BACKEND.restart(); + DEV_BACKEND.restart(); break; } case "notFound": { @@ -1093,7 +893,7 @@ function handleApply(chunkListPath: ChunkPath, update: ServerMessage) { // If it is a dynamic import, we simply discard all modules that the chunk has exclusive access to. // If it is a runtime chunk list, we restart the application. if (runtimeChunkLists.has(chunkListPath)) { - BACKEND.restart(); + DEV_BACKEND.restart(); } else { disposeChunkList(chunkListPath); } @@ -1184,41 +984,6 @@ function createModuleHot( return { hot, hotState }; } -/** - * Adds a module to a chunk. - */ -function addModuleToChunk(moduleId: ModuleId, chunkPath: ChunkPath) { - let moduleChunks = moduleChunksMap.get(moduleId); - if (!moduleChunks) { - moduleChunks = new Set([chunkPath]); - moduleChunksMap.set(moduleId, moduleChunks); - } else { - moduleChunks.add(chunkPath); - } - - let chunkModules = chunkModulesMap.get(chunkPath); - if (!chunkModules) { - chunkModules = new Set([moduleId]); - chunkModulesMap.set(chunkPath, chunkModules); - } else { - chunkModules.add(moduleId); - } -} - -/** - * Returns the first chunk that included a module. - * This is used by the Node.js backend, hence why it's marked as unused in this - * file. - */ -function getFirstModuleChunk(moduleId: ModuleId) { - const moduleChunkPaths = moduleChunksMap.get(moduleId); - if (moduleChunkPaths == null) { - return null; - } - - return moduleChunkPaths.values().next().value; -} - /** * Removes a module from a chunk. * Returns `true` if there are no remaining chunks including this module. @@ -1268,7 +1033,7 @@ function disposeChunkList(chunkListPath: ChunkPath): boolean { // We must also dispose of the chunk list's chunk itself to ensure it may // be reloaded properly in the future. - BACKEND.unloadChunk?.(chunkListPath); + DEV_BACKEND.unloadChunk?.(chunkListPath); return true; } @@ -1281,7 +1046,7 @@ function disposeChunkList(chunkListPath: ChunkPath): boolean { function disposeChunk(chunkPath: ChunkPath): boolean { // This should happen whether the chunk has any modules in it or not. // For instance, CSS chunks have no modules in them, but they still need to be unloaded. - BACKEND.unloadChunk?.(chunkPath); + DEV_BACKEND.unloadChunk?.(chunkPath); const chunkModules = chunkModulesMap.get(chunkPath); if (chunkModules == null) { @@ -1304,43 +1069,6 @@ function disposeChunk(chunkPath: ChunkPath): boolean { return true; } -/** - * Instantiates a runtime module. - */ -function instantiateRuntimeModule( - moduleId: ModuleId, - chunkPath: ChunkPath -): Module { - return instantiateModule(moduleId, { type: SourceType.Runtime, chunkPath }); -} - -/** - * Gets or instantiates a runtime module. - */ -function getOrInstantiateRuntimeModule( - moduleId: ModuleId, - chunkPath: ChunkPath -): Module { - const module = moduleCache[moduleId]; - if (module) { - if (module.error) { - throw module.error; - } - return module; - } - - return instantiateModule(moduleId, { type: SourceType.Runtime, chunkPath }); -} - -/** - * Returns the URL relative to the origin where a chunk can be fetched from. - */ -function getChunkRelativeUrl(chunkPath: ChunkPath): string { - return `${CHUNK_BASE_PATH}${chunkPath - .split("/") - .map((p) => encodeURIComponent(p)) - .join("/")}`; -} /** * Subscribes to chunk list updates from the update server and applies them. @@ -1372,30 +1100,6 @@ function registerChunkList( } } -/** - * Marks a chunk list as a runtime chunk list. There can be more than one - * runtime chunk list. For instance, integration tests can have multiple chunk - * groups loaded at runtime, each with its own chunk list. - */ -function markChunkListAsRuntime(chunkListPath: ChunkPath) { - runtimeChunkLists.add(chunkListPath); -} - -function registerChunk([ - chunkPath, - chunkModules, - runtimeParams, -]: ChunkRegistration) { - for (const [moduleId, moduleFactory] of Object.entries(chunkModules)) { - if (!moduleFactories[moduleId]) { - moduleFactories[moduleId] = moduleFactory; - } - addModuleToChunk(moduleId, chunkPath); - } - - return BACKEND.registerChunk(chunkPath, runtimeParams); -} - globalThis.TURBOPACK_CHUNK_UPDATE_LISTENERS ??= []; const chunkListsToRegister = globalThis.TURBOPACK_CHUNK_LISTS; diff --git a/turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/runtime/base/dev-dummy.ts b/turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/runtime/base/dev-dummy.ts new file mode 100644 index 0000000000000..0f88f5c15b3a4 --- /dev/null +++ b/turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/runtime/base/dev-dummy.ts @@ -0,0 +1,17 @@ +/** + * This file acts as a dummy implementor for the interface that + * `runtime-base.ts` expects to be available in the global scope. + * + * This interface will be implemented by runtime backends. + */ + +/* eslint-disable @typescript-eslint/no-unused-vars */ + +declare var DEV_BACKEND: DevRuntimeBackend; +declare var _eval: (code: EcmascriptModuleEntry) => any; +/** + * Adds additional properties to the `TurbopackDevBaseContext` interface. + */ +declare var augmentContext: ( + context: TurbopackDevBaseContext +) => TurbopackDevContext; diff --git a/turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/dev/runtime/base/extensions.d.ts b/turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/runtime/base/dev-extensions.ts similarity index 83% rename from turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/dev/runtime/base/extensions.d.ts rename to turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/runtime/base/dev-extensions.ts index a6f011eb863b2..5ad1ee7b9b096 100644 --- a/turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/dev/runtime/base/extensions.d.ts +++ b/turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/runtime/base/dev-extensions.ts @@ -1,3 +1,5 @@ +/// + /** * Extensions to the shared runtime types that are specific to the development * runtime (e.g. `module.hot`). @@ -13,6 +15,8 @@ interface HotData { prevExports?: Exports; } +// Used through reference comments +// eslint-disable-next-line @typescript-eslint/no-unused-vars interface HotState { selfAccepted: boolean | Function; selfDeclined: boolean; @@ -60,6 +64,8 @@ interface Hot { check: (autoApply: boolean) => Promise; } -interface Module { +// Used through reference comments +// eslint-disable-next-line @typescript-eslint/no-unused-vars +interface HotModule extends ModuleWithDirection { hot: Hot; } diff --git a/turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/dev/runtime/base/globals.d.ts b/turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/runtime/base/dev-globals.d.ts similarity index 67% rename from turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/dev/runtime/base/globals.d.ts rename to turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/runtime/base/dev-globals.d.ts index eae4e2323ee6c..97a17fee8b8aa 100644 --- a/turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/dev/runtime/base/globals.d.ts +++ b/turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/runtime/base/dev-globals.d.ts @@ -7,20 +7,10 @@ type UpdateCallback = (update: ServerMessage) => void; -type ChunkRegistry = { - push: (registration: ChunkRegistration) => void; -}; - -type ChunkListProvider = { - push: (registration: ChunkList) => void; -}; - type ChunkUpdateProvider = { push: (registration: [ChunkPath, UpdateCallback]) => void; }; -declare var TURBOPACK: ChunkRegistry | ChunkRegistration[] | undefined; -declare var TURBOPACK_CHUNK_LISTS: ChunkListProvider | ChunkList[] | undefined; declare var TURBOPACK_CHUNK_UPDATE_LISTENERS: | ChunkUpdateProvider | [ChunkPath, UpdateCallback][] diff --git a/turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/dev/runtime/base/protocol.d.ts b/turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/runtime/base/dev-protocol.d.ts similarity index 96% rename from turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/dev/runtime/base/protocol.d.ts rename to turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/runtime/base/dev-protocol.d.ts index 2123ac8e8e888..b683e3cf73c2f 100644 --- a/turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/dev/runtime/base/protocol.d.ts +++ b/turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/runtime/base/dev-protocol.d.ts @@ -9,6 +9,9 @@ type PartialServerMessage = { instruction: PartialUpdate; }; +// string encoding of a module factory (used in hmr updates) +type ModuleFactoryString = string; + type ServerMessage = { resource: ResourceIdentifier; issues: Issue[]; diff --git a/turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/dev/runtime/base/dummy.ts b/turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/runtime/base/dummy.ts similarity index 66% rename from turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/dev/runtime/base/dummy.ts rename to turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/runtime/base/dummy.ts index f839299329602..fd5e03937a0f3 100644 --- a/turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/dev/runtime/base/dummy.ts +++ b/turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/runtime/base/dummy.ts @@ -7,16 +7,10 @@ /* eslint-disable @typescript-eslint/no-unused-vars */ -/// +/// +/// declare var BACKEND: RuntimeBackend; -declare var _eval: (code: EcmascriptModuleEntry) => any; -/** - * Adds additional properties to the `TurbopackDevBaseContext` interface. - */ -declare var augmentContext: ( - context: TurbopackDevBaseContext -) => TurbopackDevContext; declare var loadWebAssembly: ( source: SourceInfo, wasmChunkPath: ChunkPath, diff --git a/turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/runtime/base/globals.d.ts b/turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/runtime/base/globals.d.ts new file mode 100644 index 0000000000000..7699194a40e35 --- /dev/null +++ b/turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/runtime/base/globals.d.ts @@ -0,0 +1,11 @@ +type ChunkRegistry = { + push: (registration: ChunkRegistration) => void; +}; + +type ChunkListProvider = { + push: (registration: ChunkList) => void; +}; + + +declare var TURBOPACK: ChunkRegistry | ChunkRegistration[] | undefined; +declare var TURBOPACK_CHUNK_LISTS: ChunkListProvider | ChunkList[] | undefined; diff --git a/turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/runtime/base/runtime-base.ts b/turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/runtime/base/runtime-base.ts new file mode 100644 index 0000000000000..36adb88621566 --- /dev/null +++ b/turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/runtime/base/runtime-base.ts @@ -0,0 +1,324 @@ +/** + * This file contains runtime types and functions that are shared between all + * Turbopack *development* ECMAScript runtimes. + * + * It will be appended to the runtime code of each runtime right after the + * shared runtime utils. + */ + +/* eslint-disable @typescript-eslint/no-unused-vars */ + +/// +/// + +declare var TURBOPACK_WORKER_LOCATION: string; +declare var CHUNK_BASE_PATH: string; +declare function instantiateModule(id: ModuleId, source: SourceInfo): Module; + +type RuntimeParams = { + otherChunks: ChunkData[]; + runtimeModuleIds: ModuleId[]; +}; + +type ChunkRegistration = [ + chunkPath: ChunkPath, + chunkModules: ModuleFactories, + params: RuntimeParams | undefined +]; + +type ChunkList = { + path: ChunkPath; + chunks: ChunkData[]; + source: "entry" | "dynamic"; +}; + +enum SourceType { + /** + * The module was instantiated because it was included in an evaluated chunk's + * runtime. + */ + Runtime = 0, + /** + * The module was instantiated because a parent module imported it. + */ + Parent = 1, + /** + * The module was instantiated because it was included in a chunk's hot module + * update. + */ + Update = 2, +} + +type SourceInfo = + | { + type: SourceType.Runtime; + chunkPath: ChunkPath; + } + | { + type: SourceType.Parent; + parentId: ModuleId; + } + | { + type: SourceType.Update; + parents?: ModuleId[]; + }; + +interface RuntimeBackend { + registerChunk: (chunkPath: ChunkPath, params?: RuntimeParams) => void; + loadChunk: (chunkPath: ChunkPath, source: SourceInfo) => Promise; +} + +interface DevRuntimeBackend { + reloadChunk?: (chunkPath: ChunkPath) => Promise; + unloadChunk?: (chunkPath: ChunkPath) => void; + restart: () => void; +} + +const moduleFactories: ModuleFactories = Object.create(null); +/** + * Module IDs that are instantiated as part of the runtime of a chunk. + */ +const runtimeModules: Set = new Set(); +/** + * Map from module ID to the chunks that contain this module. + * + * In HMR, we need to keep track of which modules are contained in which so + * chunks. This is so we don't eagerly dispose of a module when it is removed + * from chunk A, but still exists in chunk B. + */ +const moduleChunksMap: Map> = new Map(); +/** + * Map from a chunk path to all modules it contains. + */ +const chunkModulesMap: Map> = new Map(); +/** + * Chunk lists that contain a runtime. When these chunk lists receive an update + * that can't be reconciled with the current state of the page, we need to + * reload the runtime entirely. + */ +const runtimeChunkLists: Set = new Set(); +/** + * Map from a chunk list to the chunk paths it contains. + */ +const chunkListChunksMap: Map> = new Map(); +/** + * Map from a chunk path to the chunk lists it belongs to. + */ +const chunkChunkListsMap: Map> = new Map(); + +const availableModules: Map | true> = new Map(); + +const availableModuleChunks: Map | true> = new Map(); + +async function loadChunk( + source: SourceInfo, + chunkData: ChunkData +): Promise { + if (typeof chunkData === "string") { + return loadChunkPath(source, chunkData); + } + + const includedList = chunkData.included || []; + const modulesPromises = includedList.map((included) => { + if (moduleFactories[included]) return true; + return availableModules.get(included); + }); + if (modulesPromises.length > 0 && modulesPromises.every((p) => p)) { + // When all included items are already loaded or loading, we can skip loading ourselves + return Promise.all(modulesPromises); + } + + const includedModuleChunksList = chunkData.moduleChunks || []; + const moduleChunksPromises = includedModuleChunksList + .map((included) => { + // TODO(alexkirsz) Do we need this check? + // if (moduleFactories[included]) return true; + return availableModuleChunks.get(included); + }) + .filter((p) => p); + + let promise; + if (moduleChunksPromises.length > 0) { + // Some module chunks are already loaded or loading. + + if (moduleChunksPromises.length === includedModuleChunksList.length) { + // When all included module chunks are already loaded or loading, we can skip loading ourselves + return Promise.all(moduleChunksPromises); + } + + const moduleChunksToLoad: Set = new Set(); + for (const moduleChunk of includedModuleChunksList) { + if (!availableModuleChunks.has(moduleChunk)) { + moduleChunksToLoad.add(moduleChunk); + } + } + + for (const moduleChunkToLoad of moduleChunksToLoad) { + const promise = loadChunkPath(source, moduleChunkToLoad); + + availableModuleChunks.set(moduleChunkToLoad, promise); + + moduleChunksPromises.push(promise); + } + + promise = Promise.all(moduleChunksPromises); + } else { + promise = loadChunkPath(source, chunkData.path); + + // Mark all included module chunks as loading if they are not already loaded or loading. + for (const includedModuleChunk of includedModuleChunksList) { + if (!availableModuleChunks.has(includedModuleChunk)) { + availableModuleChunks.set(includedModuleChunk, promise); + } + } + } + + for (const included of includedList) { + if (!availableModules.has(included)) { + // 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. + // In production it's even more rare, because the chunk optimization tries to deduplicate modules anyway. + availableModules.set(included, promise); + } + } + + return promise; +} + +async function loadChunkPath( + source: SourceInfo, + chunkPath: ChunkPath +): Promise { + try { + await BACKEND.loadChunk(chunkPath, source); + } catch (error) { + let loadReason; + switch (source.type) { + case SourceType.Runtime: + loadReason = `as a runtime dependency of chunk ${source.chunkPath}`; + break; + case SourceType.Parent: + loadReason = `from module ${source.parentId}`; + break; + case SourceType.Update: + loadReason = "from an HMR update"; + break; + default: + invariant(source, (source) => `Unknown source type: ${source?.type}`); + } + throw new Error( + `Failed to load chunk ${chunkPath} ${loadReason}${ + error ? `: ${error}` : "" + }`, + error + ? { + cause: error, + } + : undefined + ); + } +} + +/** + * Returns an absolute url to an asset. + */ +function createResolvePathFromModule( + resolver: (moduleId: string) => Exports +): (moduleId: string) => string { + return function resolvePathFromModule(moduleId: string): string { + const exported = resolver(moduleId); + return exported?.default ?? exported; + }; +} + +/** + * no-op for browser + * @param modulePath + */ +function resolveAbsolutePath(modulePath?: string): string { + return `/ROOT/${modulePath ?? ""}`; +} + +function getWorkerBlobURL(chunks: ChunkPath[]): string { + let bootstrap = `TURBOPACK_WORKER_LOCATION = ${JSON.stringify(location.origin)};importScripts(${chunks.map(c => (`TURBOPACK_WORKER_LOCATION + ${JSON.stringify(getChunkRelativeUrl(c))}`)).join(", ")});`; + let blob = new Blob([bootstrap], { type: "text/javascript" }); + return URL.createObjectURL(blob); +} + +/** + * Adds a module to a chunk. + */ +function addModuleToChunk(moduleId: ModuleId, chunkPath: ChunkPath) { + let moduleChunks = moduleChunksMap.get(moduleId); + if (!moduleChunks) { + moduleChunks = new Set([chunkPath]); + moduleChunksMap.set(moduleId, moduleChunks); + } else { + moduleChunks.add(chunkPath); + } + + let chunkModules = chunkModulesMap.get(chunkPath); + if (!chunkModules) { + chunkModules = new Set([moduleId]); + chunkModulesMap.set(chunkPath, chunkModules); + } else { + chunkModules.add(moduleId); + } +} + +/** + * Returns the first chunk that included a module. + * This is used by the Node.js backend, hence why it's marked as unused in this + * file. + */ +function getFirstModuleChunk(moduleId: ModuleId) { + const moduleChunkPaths = moduleChunksMap.get(moduleId); + if (moduleChunkPaths == null) { + return null; + } + + return moduleChunkPaths.values().next().value; +} + +/** + * Instantiates a runtime module. + */ +function instantiateRuntimeModule( + moduleId: ModuleId, + chunkPath: ChunkPath +): Module { + return instantiateModule(moduleId, { type: SourceType.Runtime, chunkPath }); +} + +/** + * Returns the URL relative to the origin where a chunk can be fetched from. + */ +function getChunkRelativeUrl(chunkPath: ChunkPath): string { + return `${CHUNK_BASE_PATH}${chunkPath + .split("/") + .map((p) => encodeURIComponent(p)) + .join("/")}`; +} + +/** + * Marks a chunk list as a runtime chunk list. There can be more than one + * runtime chunk list. For instance, integration tests can have multiple chunk + * groups loaded at runtime, each with its own chunk list. + */ +function markChunkListAsRuntime(chunkListPath: ChunkPath) { + runtimeChunkLists.add(chunkListPath); +} + +function registerChunk([ + chunkPath, + chunkModules, + runtimeParams, +]: ChunkRegistration) { + for (const [moduleId, moduleFactory] of Object.entries(chunkModules)) { + if (!moduleFactories[moduleId]) { + moduleFactories[moduleId] = moduleFactory; + } + addModuleToChunk(moduleId, chunkPath); + } + + return BACKEND.registerChunk(chunkPath, runtimeParams); +} diff --git a/turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/dev/runtime/base/tsconfig.json b/turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/runtime/base/tsconfig.json similarity index 78% rename from turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/dev/runtime/base/tsconfig.json rename to turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/runtime/base/tsconfig.json index cc70058649bb6..5aa7968522993 100644 --- a/turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/dev/runtime/base/tsconfig.json +++ b/turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/runtime/base/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../../tsconfig.base.json", + "extends": "../../../tsconfig.base.json", "compilerOptions": { // environment, we need WebWorker for WebAssembly types "lib": ["ESNext", "WebWorker"] diff --git a/turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/runtime/dom/dev-backend-dom.ts b/turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/runtime/dom/dev-backend-dom.ts new file mode 100644 index 0000000000000..7ce31930e4ab1 --- /dev/null +++ b/turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/runtime/dom/dev-backend-dom.ts @@ -0,0 +1,130 @@ +/** + * This file contains the runtime code specific to the Turbopack development + * ECMAScript DOM runtime. + * + * It will be appended to the base development runtime code. + */ + +/* eslint-disable @typescript-eslint/no-unused-vars */ + +/// +/// +/// +/// + +let DEV_BACKEND: DevRuntimeBackend; + +(() => { + DEV_BACKEND = { + unloadChunk(chunkPath) { + deleteResolver(chunkPath); + + const chunkUrl = getChunkRelativeUrl(chunkPath); + // TODO(PACK-2140): remove this once all filenames are guaranteed to be escaped. + const decodedChunkUrl = decodeURI(chunkUrl); + + if (chunkPath.endsWith(".css")) { + const links = document.querySelectorAll( + `link[href="${chunkUrl}"],link[href^="${chunkUrl}?"],link[href="${decodedChunkUrl}"],link[href^="${decodedChunkUrl}?"]` + ); + for (const link of Array.from(links)) { + link.remove(); + } + } else if (chunkPath.endsWith(".js")) { + // Unloading a JS chunk would have no effect, as it lives in the JS + // runtime once evaluated. + // However, we still want to remove the script tag from the DOM to keep + // the HTML somewhat consistent from the user's perspective. + const scripts = document.querySelectorAll( + `script[src="${chunkUrl}"],script[src^="${chunkUrl}?"],script[src="${decodedChunkUrl}"],script[src^="${decodedChunkUrl}?"]` + ); + for (const script of Array.from(scripts)) { + script.remove(); + } + } else { + throw new Error(`can't infer type of chunk from path ${chunkPath}`); + } + }, + + reloadChunk(chunkPath) { + return new Promise((resolve, reject) => { + if (!chunkPath.endsWith(".css")) { + reject(new Error("The DOM backend can only reload CSS chunks")); + return; + } + + const chunkUrl = getChunkRelativeUrl(chunkPath); + const decodedChunkUrl = decodeURI(chunkUrl); + + const previousLinks = document.querySelectorAll( + `link[rel=stylesheet][href="${chunkUrl}"],link[rel=stylesheet][href^="${chunkUrl}?"],link[rel=stylesheet][href="${decodedChunkUrl}"],link[rel=stylesheet][href^="${decodedChunkUrl}?"]` + ); + + if (previousLinks.length === 0) { + reject(new Error(`No link element found for chunk ${chunkPath}`)); + return; + } + + const link = document.createElement("link"); + link.rel = "stylesheet"; + + if (navigator.userAgent.includes("Firefox")) { + // Firefox won't reload CSS files that were previously loaded on the current page, + // we need to add a query param to make sure CSS is actually reloaded from the server. + // + // I believe this is this issue: https://bugzilla.mozilla.org/show_bug.cgi?id=1037506 + // + // Safari has a similar issue, but only if you have a `` tag + // pointing to the same URL as the stylesheet: https://bugs.webkit.org/show_bug.cgi?id=187726 + link.href = `${chunkUrl}?ts=${Date.now()}`; + } else { + link.href = chunkUrl; + } + + link.onerror = () => { + reject(); + }; + link.onload = () => { + // First load the new CSS, then remove the old ones. This prevents visible + // flickering that would happen in-between removing the previous CSS and + // loading the new one. + for (const previousLink of Array.from(previousLinks)) + previousLink.remove(); + + // CSS chunks do not register themselves, and as such must be marked as + // loaded instantly. + resolve(); + }; + + // Make sure to insert the new CSS right after the previous one, so that + // its precedence is higher. + previousLinks[0].parentElement!.insertBefore( + link, + previousLinks[0].nextSibling + ); + }); + }, + + restart: () => self.location.reload(), + }; + + function deleteResolver(chunkPath: ChunkPath) { + chunkResolvers.delete(chunkPath); + } +})(); + +function _eval({ code, url, map }: EcmascriptModuleEntry): ModuleFactory { + code += `\n\n//# sourceURL=${encodeURI( + location.origin + CHUNK_BASE_PATH + url + )}`; + if (map) { + code += `\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,${btoa( + // btoa doesn't handle nonlatin characters, so escape them as \x sequences + // See https://stackoverflow.com/a/26603875 + unescape(encodeURIComponent(map)) + )}`; + } + + // eslint-disable-next-line no-eval + return eval(code); +} diff --git a/turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/dev/runtime/dom/runtime-backend-dom.ts b/turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/runtime/dom/runtime-backend-dom.ts similarity index 57% rename from turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/dev/runtime/dom/runtime-backend-dom.ts rename to turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/runtime/dom/runtime-backend-dom.ts index 21dfa240f74de..9e59a8fb71050 100644 --- a/turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/dev/runtime/dom/runtime-backend-dom.ts +++ b/turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/runtime/dom/runtime-backend-dom.ts @@ -7,8 +7,8 @@ /* eslint-disable @typescript-eslint/no-unused-vars */ -/// -/// +/// +/// type ChunkResolver = { resolved: boolean; @@ -19,7 +19,7 @@ type ChunkResolver = { let BACKEND: RuntimeBackend; -function augmentContext(context: TurbopackDevBaseContext): TurbopackDevContext { +function augmentContext(context: unknown): unknown { return context; } @@ -28,7 +28,7 @@ function fetchWebAssembly(wasmChunkPath: ChunkPath) { } async function loadWebAssembly( - _source: SourceInfo, + _source: unknown, wasmChunkPath: ChunkPath, importsObj: WebAssembly.Imports ): Promise { @@ -40,7 +40,7 @@ async function loadWebAssembly( } async function loadWebAssemblyModule( - _source: SourceInfo, + _source: unknown, wasmChunkPath: ChunkPath ): Promise { const req = fetchWebAssembly(wasmChunkPath); @@ -48,6 +48,11 @@ async function loadWebAssemblyModule( return await WebAssembly.compileStreaming(req); } +/** + * Maps chunk paths to the corresponding resolver. + */ +const chunkResolvers: Map = new Map(); + (() => { BACKEND = { async registerChunk(chunkPath, params) { @@ -81,104 +86,8 @@ async function loadWebAssemblyModule( loadChunk(chunkPath, source) { return doLoadChunk(chunkPath, source); }, - - unloadChunk(chunkPath) { - deleteResolver(chunkPath); - - const chunkUrl = getChunkRelativeUrl(chunkPath); - // TODO(PACK-2140): remove this once all filenames are guaranteed to be escaped. - const decodedChunkUrl = decodeURI(chunkUrl); - - if (chunkPath.endsWith(".css")) { - const links = document.querySelectorAll( - `link[href="${chunkUrl}"],link[href^="${chunkUrl}?"],link[href="${decodedChunkUrl}"],link[href^="${decodedChunkUrl}?"]` - ); - for (const link of Array.from(links)) { - link.remove(); - } - } else if (chunkPath.endsWith(".js")) { - // Unloading a JS chunk would have no effect, as it lives in the JS - // runtime once evaluated. - // However, we still want to remove the script tag from the DOM to keep - // the HTML somewhat consistent from the user's perspective. - const scripts = document.querySelectorAll( - `script[src="${chunkUrl}"],script[src^="${chunkUrl}?"],script[src="${decodedChunkUrl}"],script[src^="${decodedChunkUrl}?"]` - ); - for (const script of Array.from(scripts)) { - script.remove(); - } - } else { - throw new Error(`can't infer type of chunk from path ${chunkPath}`); - } - }, - - reloadChunk(chunkPath) { - return new Promise((resolve, reject) => { - if (!chunkPath.endsWith(".css")) { - reject(new Error("The DOM backend can only reload CSS chunks")); - return; - } - - const chunkUrl = getChunkRelativeUrl(chunkPath); - const decodedChunkUrl = decodeURI(chunkUrl); - - const previousLinks = document.querySelectorAll( - `link[rel=stylesheet][href="${chunkUrl}"],link[rel=stylesheet][href^="${chunkUrl}?"],link[rel=stylesheet][href="${decodedChunkUrl}"],link[rel=stylesheet][href^="${decodedChunkUrl}?"]` - ); - - if (previousLinks.length === 0) { - reject(new Error(`No link element found for chunk ${chunkPath}`)); - return; - } - - const link = document.createElement("link"); - link.rel = "stylesheet"; - - if (navigator.userAgent.includes("Firefox")) { - // Firefox won't reload CSS files that were previously loaded on the current page, - // we need to add a query param to make sure CSS is actually reloaded from the server. - // - // I believe this is this issue: https://bugzilla.mozilla.org/show_bug.cgi?id=1037506 - // - // Safari has a similar issue, but only if you have a `` tag - // pointing to the same URL as the stylesheet: https://bugs.webkit.org/show_bug.cgi?id=187726 - link.href = `${chunkUrl}?ts=${Date.now()}`; - } else { - link.href = chunkUrl; - } - - link.onerror = () => { - reject(); - }; - link.onload = () => { - // First load the new CSS, then remove the old ones. This prevents visible - // flickering that would happen in-between removing the previous CSS and - // loading the new one. - for (const previousLink of Array.from(previousLinks)) - previousLink.remove(); - - // CSS chunks do not register themselves, and as such must be marked as - // loaded instantly. - resolve(); - }; - - // Make sure to insert the new CSS right after the previous one, so that - // its precedence is higher. - previousLinks[0].parentElement!.insertBefore( - link, - previousLinks[0].nextSibling - ); - }); - }, - - restart: () => self.location.reload(), }; - /** - * Maps chunk paths to the corresponding resolver. - */ - const chunkResolvers: Map = new Map(); - function getOrCreateResolver(chunkPath: ChunkPath): ChunkResolver { let resolver = chunkResolvers.get(chunkPath); if (!resolver) { @@ -202,10 +111,6 @@ async function loadWebAssemblyModule( return resolver; } - function deleteResolver(chunkPath: ChunkPath) { - chunkResolvers.delete(chunkPath); - } - /** * Loads the given chunk, and returns a promise that resolves once the chunk * has been loaded. @@ -299,19 +204,3 @@ async function loadWebAssemblyModule( return resolver.promise; } })(); - -function _eval({ code, url, map }: EcmascriptModuleEntry): ModuleFactory { - code += `\n\n//# sourceURL=${encodeURI( - location.origin + CHUNK_BASE_PATH + url - )}`; - if (map) { - code += `\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,${btoa( - // btoa doesn't handle nonlatin characters, so escape them as \x sequences - // See https://stackoverflow.com/a/26603875 - unescape(encodeURIComponent(map)) - )}`; - } - - // eslint-disable-next-line no-eval - return eval(code); -} diff --git a/turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/dev/runtime/dom/tsconfig.json b/turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/runtime/dom/tsconfig.json similarity index 73% rename from turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/dev/runtime/dom/tsconfig.json rename to turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/runtime/dom/tsconfig.json index 2f29983db98d0..4908beba8e3ea 100644 --- a/turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/dev/runtime/dom/tsconfig.json +++ b/turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/runtime/dom/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../../tsconfig.base.json", + "extends": "../../../tsconfig.base.json", "compilerOptions": { // environment "lib": ["ESNext", "DOM", "WebWorker.ImportScripts"] diff --git a/turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/runtime/edge/dev-backend-edge.ts b/turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/runtime/edge/dev-backend-edge.ts new file mode 100644 index 0000000000000..4f0c15e6598dd --- /dev/null +++ b/turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/runtime/edge/dev-backend-edge.ts @@ -0,0 +1,24 @@ +/** + * This file contains the runtime code specific to the Turbopack development + * ECMAScript "None" runtime (e.g. for Edge). + * + * It will be appended to the base development runtime code. + */ + +/* eslint-disable @typescript-eslint/no-unused-vars */ + +/// + +let DEV_BACKEND: DevRuntimeBackend; + +(() => { + DEV_BACKEND = { + restart: () => { + throw new Error("restart is not supported"); + }, + }; +})(); + +function _eval(_: EcmascriptModuleEntry) { + throw new Error("HMR evaluation is not implemented on this backend"); +} diff --git a/turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/dev/runtime/edge/runtime-backend-edge.ts b/turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/runtime/edge/runtime-backend-edge.ts similarity index 90% rename from turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/dev/runtime/edge/runtime-backend-edge.ts rename to turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/runtime/edge/runtime-backend-edge.ts index 232078a3bb90b..e38695fc3d488 100644 --- a/turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/dev/runtime/edge/runtime-backend-edge.ts +++ b/turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/runtime/edge/runtime-backend-edge.ts @@ -8,8 +8,8 @@ /* eslint-disable @typescript-eslint/no-unused-vars */ /// -/// -/// +/// +/// type ChunkRunner = { requiredChunks: Set; @@ -23,15 +23,16 @@ type ExternalRequire = ( id: ModuleId, esm?: boolean ) => Exports | EsmNamespaceObject; + type ExternalImport = (id: ModuleId) => Promise; -interface TurbopackDevContext extends TurbopackDevBaseContext { +interface TurbopackEdgeContext extends TurbopackBaseContext { x: ExternalRequire; y: ExternalImport; } -function augmentContext(context: TurbopackDevBaseContext): TurbopackDevContext { - const nodejsContext = context as TurbopackDevContext; +function augmentContext(context: TurbopackBaseContext): TurbopackEdgeContext { + const nodejsContext = context as TurbopackEdgeContext; nodejsContext.x = externalRequire; nodejsContext.y = externalImport; return nodejsContext; @@ -121,10 +122,6 @@ async function loadWebAssemblyModule( loadChunk(_chunkPath, _fromChunkPath) { throw new Error("chunk loading is not supported"); }, - - restart: () => { - throw new Error("restart is not supported"); - }, }; const registeredChunks: Set = new Set(); @@ -198,7 +195,3 @@ async function loadWebAssemblyModule( } } })(); - -function _eval(_: EcmascriptModuleEntry): ModuleFactory { - throw new Error("HMR evaluation is not implemented on this backend"); -} diff --git a/turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/dev/runtime/edge/tsconfig.json b/turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/runtime/edge/tsconfig.json similarity index 76% rename from turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/dev/runtime/edge/tsconfig.json rename to turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/runtime/edge/tsconfig.json index fabb2ed16dbbb..5722142375561 100644 --- a/turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/dev/runtime/edge/tsconfig.json +++ b/turbopack/crates/turbopack-ecmascript-runtime/js/src/browser/runtime/edge/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../../tsconfig.base.json", + "extends": "../../../tsconfig.base.json", "compilerOptions": { // environment, we need WebWorker for WebAssembly types "lib": ["ESNext", "WebWorker"] diff --git a/turbopack/crates/turbopack-ecmascript-runtime/js/src/nodejs/runtime.ts b/turbopack/crates/turbopack-ecmascript-runtime/js/src/nodejs/runtime.ts index 051b9dd30916f..15ca270206cc4 100644 --- a/turbopack/crates/turbopack-ecmascript-runtime/js/src/nodejs/runtime.ts +++ b/turbopack/crates/turbopack-ecmascript-runtime/js/src/nodejs/runtime.ts @@ -41,7 +41,7 @@ function stringifySourceInfo(source: SourceInfo): string { type ExternalRequire = (id: ModuleId) => Exports | EsmNamespaceObject; type ExternalImport = (id: ModuleId) => Promise; -interface TurbopackNodeBuildContext extends TurbopackBaseContext { +interface TurbopackNodeBuildContext extends TurbopackBaseContext { R: ResolvePathFromModule; x: ExternalRequire; y: ExternalImport; @@ -57,7 +57,7 @@ const fs = require("fs/promises"); const vm = require("vm"); const moduleFactories: ModuleFactories = Object.create(null); -const moduleCache: ModuleCache = Object.create(null); +const moduleCache: ModuleCache = Object.create(null); /** * Returns an absolute path to the given module's id. @@ -177,11 +177,11 @@ function loadWebAssemblyModule(chunkPath: ChunkPath) { return compileWebAssemblyFromPath(resolved); } -function getWorkerBlobURL(_chunks: ChunkPath[]): never { +function getWorkerBlobURL(_chunks: ChunkPath[]): string { throw new Error("Worker blobs are not implemented yet for Node.js"); } -function instantiateModule(id: ModuleId, source: SourceInfo): Module { +function instantiateModule(id: ModuleId, source: SourceInfo): ModuleWithDirection { const moduleFactory = moduleFactories[id]; if (typeof moduleFactory !== "function") { // This can happen if modules incorrectly handle HMR disposes/updates, @@ -217,7 +217,7 @@ function instantiateModule(id: ModuleId, source: SourceInfo): Module { invariant(source, (source) => `Unknown source type: ${source?.type}`); } - const module: Module = { + const module: ModuleWithDirection = { exports: {}, error: undefined, loaded: false, @@ -275,10 +275,11 @@ function instantiateModule(id: ModuleId, source: SourceInfo): Module { /** * Retrieves a module from the cache, or instantiate it if it is not cached. */ +// @ts-ignore function getOrInstantiateModuleFromParent( id: ModuleId, - sourceModule: Module -): Module { + sourceModule: ModuleWithDirection +): ModuleWithDirection { const module = moduleCache[id]; if (sourceModule.children.indexOf(id) === -1) { @@ -312,6 +313,7 @@ function instantiateRuntimeModule( /** * Retrieves a module from the cache, or instantiate it as a runtime module if it is not cached. */ +// @ts-ignore TypeScript doesn't separate this module space from the browser runtime function getOrInstantiateRuntimeModule( moduleId: ModuleId, chunkPath: ChunkPath diff --git a/turbopack/crates/turbopack-ecmascript-runtime/js/src/shared/dummy.ts b/turbopack/crates/turbopack-ecmascript-runtime/js/src/shared/dummy.ts index 7a6071d133166..f60125232b9a4 100644 --- a/turbopack/crates/turbopack-ecmascript-runtime/js/src/shared/dummy.ts +++ b/turbopack/crates/turbopack-ecmascript-runtime/js/src/shared/dummy.ts @@ -7,4 +7,7 @@ * This interface will be implemented by runtimes. */ -declare var getOrInstantiateModuleFromParent: GetOrInstantiateModuleFromParent; +declare function getOrInstantiateModuleFromParent( + id: ModuleId, + sourceModule: M +): M; diff --git a/turbopack/crates/turbopack-ecmascript-runtime/js/src/shared/runtime-types.d.ts b/turbopack/crates/turbopack-ecmascript-runtime/js/src/shared/runtime-types.d.ts index f0232ff633cd0..e4cb9900931de 100644 --- a/turbopack/crates/turbopack-ecmascript-runtime/js/src/shared/runtime-types.d.ts +++ b/turbopack/crates/turbopack-ecmascript-runtime/js/src/shared/runtime-types.d.ts @@ -10,6 +10,12 @@ type ChunkPath = string; type ModuleId = string; +interface Exports { + __esModule?: boolean; + + [key: string]: any; +} + type ChunkData = | ChunkPath | { @@ -37,8 +43,8 @@ type LoadWebAssembly = ( ) => Exports; type LoadWebAssemblyModule = (wasmChunkPath: ChunkPath) => WebAssembly.Module; -type ModuleCache = Record; -type ModuleFactories = Record; +type ModuleCache = Record; +type ModuleFactories = Record; type RelativeURL = (inputUrl: string) => void; type ResolvePathFromModule = (moduleId: string) => string; @@ -56,7 +62,25 @@ type AsyncModule = ( type ResolveAbsolutePath = (modulePath?: string) => string; type GetWorkerBlobURL = (chunks: ChunkPath[]) => string; -interface TurbopackBaseContext { +interface Module { + exports: Function | Exports | Promise | AsyncModulePromise; + error: Error | undefined; + loaded: boolean; + id: ModuleId; + namespaceObject?: + | EsmNamespaceObject + | Promise + | AsyncModulePromise; + [REEXPORTED_OBJECTS]?: any[]; +} + +interface ModuleWithDirection extends Module { + children: ModuleId[]; + parents: ModuleId[]; +} + + +interface TurbopackBaseContext { a: AsyncModule; e: Module["exports"]; r: CommonJsRequire; @@ -68,7 +92,7 @@ interface TurbopackBaseContext { v: ExportValue; n: ExportNamespace; m: Module; - c: ModuleCache; + c: ModuleCache; M: ModuleFactories; l: LoadChunk; w: LoadWebAssembly; diff --git a/turbopack/crates/turbopack-ecmascript-runtime/js/src/shared/runtime-utils.ts b/turbopack/crates/turbopack-ecmascript-runtime/js/src/shared/runtime-utils.ts index f6a1ac2d744c3..61c0ceb80fd84 100644 --- a/turbopack/crates/turbopack-ecmascript-runtime/js/src/shared/runtime-utils.ts +++ b/turbopack/crates/turbopack-ecmascript-runtime/js/src/shared/runtime-utils.ts @@ -9,31 +9,15 @@ /// -interface Exports { - __esModule?: boolean; - - [key: string]: any; -} - type EsmNamespaceObject = Record; -const REEXPORTED_OBJECTS = Symbol("reexported objects"); - -interface BaseModule { - exports: Function | Exports | Promise | AsyncModulePromise; - error: Error | undefined; - loaded: boolean; - id: ModuleId; - children: ModuleId[]; - parents: ModuleId[]; - namespaceObject?: - | EsmNamespaceObject - | Promise - | AsyncModulePromise; - [REEXPORTED_OBJECTS]?: any[]; -} +// @ts-ignore Defined in `dev-base.ts` +declare function getOrInstantiateModuleFromParent( + id: ModuleId, + sourceModule: M +): M; -interface Module extends BaseModule {} +const REEXPORTED_OBJECTS = Symbol("reexported objects"); type ModuleContextMap = Record; @@ -54,10 +38,12 @@ interface ModuleContext { resolve(moduleId: ModuleId): ModuleId; } -type GetOrInstantiateModuleFromParent = ( +type GetOrInstantiateModuleFromParent = ( moduleId: ModuleId, - parentModule: Module -) => Module; + parentModule: M +) => M; + +declare function getOrInstantiateRuntimeModule(moduleId: ModuleId, chunkPath: ChunkPath): Module; const hasOwnProperty = Object.prototype.hasOwnProperty; const toStringTag = typeof Symbol !== "undefined" && Symbol.toStringTag; @@ -211,7 +197,7 @@ function interopEsm( return ns; } -function createNS(raw: BaseModule["exports"]): EsmNamespaceObject { +function createNS(raw: Module["exports"]): EsmNamespaceObject { if (typeof raw === "function") { return function (this: any, ...args: any[]) { return raw.apply(this, args); @@ -243,7 +229,9 @@ function esmImport( // Add a simple runtime require so that environments without one can still pass // `typeof require` CommonJS checks so that exports are correctly registered. const runtimeRequire = + // @ts-ignore typeof require === "function" + // @ts-ignore ? require : function require() { throw new Error("Unexpected use of runtime require"); diff --git a/turbopack/crates/turbopack-ecmascript-runtime/src/browser_runtime.rs b/turbopack/crates/turbopack-ecmascript-runtime/src/browser_runtime.rs index 3ef6e5f8f01e5..4ffbb5f7f2ba8 100644 --- a/turbopack/crates/turbopack-ecmascript-runtime/src/browser_runtime.rs +++ b/turbopack/crates/turbopack-ecmascript-runtime/src/browser_runtime.rs @@ -2,7 +2,7 @@ use std::io::Write; use anyhow::Result; use indoc::writedoc; -use turbo_tasks::{RcStr, Vc}; +use turbo_tasks::{RcStr, Value, Vc}; use turbopack_core::{ code_builder::{Code, CodeBuilder}, context::AssetContext, @@ -10,23 +10,32 @@ use turbopack_core::{ }; use turbopack_ecmascript::utils::StringifyJs; -use crate::{asset_context::get_runtime_asset_context, embed_js::embed_static_code}; +use crate::{asset_context::get_runtime_asset_context, embed_js::embed_static_code, RuntimeType}; -/// Returns the code for the development ECMAScript runtime. +/// Returns the code for the ECMAScript runtime. #[turbo_tasks::function] pub async fn get_browser_runtime_code( environment: Vc, chunk_base_path: Vc>, + runtime_type: Value, output_root: Vc, ) -> Result> { let asset_context = get_runtime_asset_context(environment); let shared_runtime_utils_code = embed_static_code(asset_context, "shared/runtime-utils.ts".into()); - let runtime_base_code = embed_static_code( - asset_context, - "browser/dev/runtime/base/runtime-base.ts".into(), - ); + + let mut runtime_base_code = vec!["browser/runtime/base/runtime-base.ts"]; + match *runtime_type { + RuntimeType::Production => runtime_base_code.push("browser/runtime/base/build-base.ts"), + RuntimeType::Development => { + runtime_base_code.push("browser/runtime/base/dev-base.ts"); + } + #[cfg(feature = "test")] + RuntimeType::Dummy => { + panic!("This configuration is not supported in the browser runtime") + } + } let chunk_loading = &*asset_context .compile_time_info() @@ -34,17 +43,33 @@ pub async fn get_browser_runtime_code( .chunk_loading() .await?; - let runtime_backend_code = embed_static_code( - asset_context, - match chunk_loading { - ChunkLoading::Edge => "browser/dev/runtime/edge/runtime-backend-edge.ts".into(), - // This case should never be hit. - ChunkLoading::NodeJs => { - panic!("Node.js runtime is not supported in the browser runtime!") - } - ChunkLoading::Dom => "browser/dev/runtime/dom/runtime-backend-dom.ts".into(), - }, - ); + let mut runtime_backend_code = vec![]; + match (chunk_loading, *runtime_type) { + (ChunkLoading::Edge, RuntimeType::Development) => { + runtime_backend_code.push("browser/runtime/edge/runtime-backend-edge.ts"); + runtime_backend_code.push("browser/runtime/edge/dev-backend-edge.ts"); + } + (ChunkLoading::Edge, RuntimeType::Production) => { + runtime_backend_code.push("browser/runtime/edge/runtime-backend-edge.ts"); + } + // This case should never be hit. + (ChunkLoading::NodeJs, _) => { + panic!("Node.js runtime is not supported in the browser runtime!") + } + (ChunkLoading::Dom, RuntimeType::Development) => { + runtime_backend_code.push("browser/runtime/dom/runtime-backend-dom.ts"); + runtime_backend_code.push("browser/runtime/dom/dev-backend-dom.ts"); + } + (ChunkLoading::Dom, RuntimeType::Production) => { + // TODO + runtime_backend_code.push("browser/runtime/dom/runtime-backend-dom.ts"); + } + + #[cfg(feature = "test")] + (_, RuntimeType::Dummy) => { + panic!("This configuration is not supported in the browser runtime") + } + }; let mut code: CodeBuilder = CodeBuilder::default(); let output_root = output_root.await?.to_string(); @@ -69,7 +94,9 @@ pub async fn get_browser_runtime_code( )?; code.push_code(&*shared_runtime_utils_code.await?); - code.push_code(&*runtime_base_code.await?); + for runtime_code in runtime_base_code { + code.push_code(&*embed_static_code(asset_context, runtime_code.into()).await?); + } if *environment.supports_commonjs_externals().await? { code.push_code( @@ -89,7 +116,9 @@ pub async fn get_browser_runtime_code( ); } - code.push_code(&*runtime_backend_code.await?); + for backend_code in runtime_backend_code { + code.push_code(&*embed_static_code(asset_context, backend_code.into()).await?); + } // Registering chunks depends on the BACKEND variable, which is set by the // specific runtime code, hence it must be appended after it. diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/runtime/default_build_runtime/output/[turbopack]_runtime.js b/turbopack/crates/turbopack-tests/tests/snapshot/runtime/default_build_runtime/output/[turbopack]_runtime.js index 927df773a7c42..187fc5127ef6b 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/runtime/default_build_runtime/output/[turbopack]_runtime.js +++ b/turbopack/crates/turbopack-tests/tests/snapshot/runtime/default_build_runtime/output/[turbopack]_runtime.js @@ -139,7 +139,8 @@ function esmImport(sourceModule, id) { } // Add a simple runtime require so that environments without one can still pass // `typeof require` CommonJS checks so that exports are correctly registered. -const runtimeRequire = typeof require === "function" ? require : function require1() { +const runtimeRequire = // @ts-ignore +typeof require === "function" ? require : function require1() { throw new Error("Unexpected use of runtime require"); }; function commonJsRequire(sourceModule, id) { @@ -620,7 +621,8 @@ function instantiateModule(id, source) { } /** * Retrieves a module from the cache, or instantiate it if it is not cached. - */ function getOrInstantiateModuleFromParent(id, sourceModule) { + */ // @ts-ignore +function getOrInstantiateModuleFromParent(id, sourceModule) { const module1 = moduleCache[id]; if (sourceModule.children.indexOf(id) === -1) { sourceModule.children.push(id); @@ -646,7 +648,8 @@ function instantiateModule(id, source) { } /** * Retrieves a module from the cache, or instantiate it as a runtime module if it is not cached. - */ function getOrInstantiateRuntimeModule(moduleId, chunkPath) { + */ // @ts-ignore TypeScript doesn't separate this module space from the browser runtime +function getOrInstantiateRuntimeModule(moduleId, chunkPath) { const module1 = moduleCache[moduleId]; if (module1) { if (module1.error) { diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/runtime/default_build_runtime/output/[turbopack]_runtime.js.map b/turbopack/crates/turbopack-tests/tests/snapshot/runtime/default_build_runtime/output/[turbopack]_runtime.js.map index 02010bdaa9aa8..e996caabffa38 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/runtime/default_build_runtime/output/[turbopack]_runtime.js.map +++ b/turbopack/crates/turbopack-tests/tests/snapshot/runtime/default_build_runtime/output/[turbopack]_runtime.js.map @@ -2,9 +2,9 @@ "version": 3, "sources": [], "sections": [ - {"offset": {"line": 3, "column": 0}, "map": {"version":3,"sources":["turbopack://[turbopack]/shared/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\ninterface Exports {\n __esModule?: boolean;\n\n [key: string]: any;\n}\n\ntype EsmNamespaceObject = Record;\n\nconst REEXPORTED_OBJECTS = Symbol(\"reexported objects\");\n\ninterface BaseModule {\n exports: Function | Exports | Promise | AsyncModulePromise;\n error: Error | undefined;\n loaded: boolean;\n id: ModuleId;\n children: ModuleId[];\n parents: ModuleId[];\n namespaceObject?:\n | EsmNamespaceObject\n | Promise\n | AsyncModulePromise;\n [REEXPORTED_OBJECTS]?: any[];\n}\n\ninterface Module extends BaseModule {}\n\ntype ModuleContextMap = Record;\n\ninterface ModuleContextEntry {\n id: () => ModuleId;\n module: () => any;\n}\n\ninterface ModuleContext {\n // require call\n (moduleId: ModuleId): Exports | EsmNamespaceObject;\n\n // async import call\n import(moduleId: ModuleId): Promise;\n\n keys(): ModuleId[];\n\n resolve(moduleId: ModuleId): ModuleId;\n}\n\ntype GetOrInstantiateModuleFromParent = (\n moduleId: ModuleId,\n parentModule: Module\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))\n Object.defineProperty(obj, name, options);\n}\n\n/**\n * Adds the getters to the exports object.\n */\nfunction esm(\n exports: Exports,\n getters: Record any) | [() => any, (v: any) => void]>\n) {\n defineProp(exports, \"__esModule\", { value: true });\n if (toStringTag) defineProp(exports, toStringTag, { value: \"Module\" });\n for (const key in getters) {\n const item = getters[key];\n if (Array.isArray(item)) {\n defineProp(exports, key, {\n get: item[0],\n set: item[1],\n enumerable: true,\n });\n } else {\n defineProp(exports, key, { get: item, enumerable: true });\n }\n }\n Object.seal(exports);\n}\n\n/**\n * Makes the module an ESM with exports\n */\nfunction esmExport(\n module: Module,\n exports: Exports,\n getters: Record any>\n) {\n module.namespaceObject = module.exports;\n esm(exports, getters);\n}\n\nfunction ensureDynamicExports(module: Module, exports: Exports) {\n let reexportedObjects = module[REEXPORTED_OBJECTS];\n\n if (!reexportedObjects) {\n reexportedObjects = module[REEXPORTED_OBJECTS] = [];\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 for (const obj of reexportedObjects!) {\n const value = Reflect.get(obj, prop);\n if (value !== undefined) return value;\n }\n return undefined;\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 });\n }\n}\n\n/**\n * Dynamically exports properties from an object\n */\nfunction dynamicExport(\n module: Module,\n exports: Exports,\n object: Record\n) {\n ensureDynamicExports(module, exports);\n\n if (typeof object === \"object\" && object !== null) {\n module[REEXPORTED_OBJECTS]!.push(object);\n }\n}\n\nfunction exportValue(module: Module, value: any) {\n module.exports = value;\n}\n\nfunction exportNamespace(module: Module, namespace: any) {\n module.exports = module.namespaceObject = namespace;\n}\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 getters: { [s: string]: () => any } = Object.create(null);\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 getters[key] = createGetter(raw, key);\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 && \"default\" in getters)) {\n getters[\"default\"] = () => raw;\n }\n\n esm(ns, getters);\n return ns;\n}\n\nfunction createNS(raw: BaseModule[\"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 sourceModule: Module,\n id: ModuleId\n): Exclude {\n const module = getOrInstantiateModuleFromParent(id, sourceModule);\n if (module.error) throw module.error;\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}\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 typeof require === \"function\"\n ? require\n : function require() {\n throw new Error(\"Unexpected use of runtime require\");\n };\n\nfunction commonJsRequire(sourceModule: Module, id: ModuleId): Exports {\n const module = getOrInstantiateModuleFromParent(id, sourceModule);\n if (module.error) throw module.error;\n return module.exports;\n}\n\n/**\n * `require.context` and require/import expression runtime.\n */\nfunction moduleContext(map: ModuleContextMap): ModuleContext {\n function moduleContext(id: ModuleId): Exports {\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 = (): ModuleId[] => {\n return Object.keys(map);\n };\n\n moduleContext.resolve = (id: ModuleId): ModuleId => {\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: ModuleId) => {\n return await (moduleContext(id) as Promise);\n };\n\n return moduleContext;\n}\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\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\n// everything below is adapted from webpack\n// https://github.com/webpack/webpack/blob/6be4065ade1e252c1d8dcba4af0f43e32af1bdc1/lib/runtime/AsyncModuleRuntimeModule.js#L13\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\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\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 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 module: Module,\n body: (\n handleAsyncDependencies: (\n deps: Dep[]\n ) => Exports[] | Promise<() => Exports[]>,\n asyncResult: (err?: any) => void\n ) => void,\n hasAwait: boolean\n) {\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}\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};\n\nrelativeURL.prototype = URL.prototype;\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 * 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}\n"],"names":[],"mappings":"AAAA;;;;;CAKC,GAED,oDAAoD,GAEpD,6CAA6C;AAU7C,MAAM,qBAAqB,OAAO;AA0ClC,MAAM,iBAAiB,OAAO,SAAS,CAAC,cAAc;AACtD,MAAM,cAAc,OAAO,WAAW,eAAe,OAAO,WAAW;AAEvE,SAAS,WACP,GAAQ,EACR,IAAiB,EACjB,OAA2C;IAE3C,IAAI,CAAC,eAAe,IAAI,CAAC,KAAK,OAC5B,OAAO,cAAc,CAAC,KAAK,MAAM;AACrC;AAEA;;CAEC,GACD,SAAS,IACP,OAAgB,EAChB,OAAoE;IAEpE,WAAW,SAAS,cAAc;QAAE,OAAO;IAAK;IAChD,IAAI,aAAa,WAAW,SAAS,aAAa;QAAE,OAAO;IAAS;IACpE,IAAK,MAAM,OAAO,QAAS;QACzB,MAAM,OAAO,OAAO,CAAC,IAAI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ACT;YACF;QACF;QAEA,YAAY,GAAG,CAAC,CAAC,MAAQ,GAAG,CAAC,gBAAgB,CAAC;QAE9C,OAAO,GAAG,UAAU,GAAG,UAAU;IACnC;IAEA,SAAS,YAAY,GAAS;QAC5B,IAAI,KAAK;YACP,OAAQ,OAAO,CAAC,eAAe,GAAG;QACpC,OAAO;YACL,QAAQ,OAAO,CAAC,iBAAiB;QACnC;QAEA,aAAa;IACf;IAEA,KAAK,yBAAyB;IAE9B,IAAI,SAAS,MAAM,MAAM,SAA0B;QACjD,MAAM,MAAM;IACd;AACF;AAEA;;;;;;;;;CASC,GACD,MAAM,cAAc,SAAS,YAAuB,QAAgB;IAClE,MAAM,UAAU,IAAI,IAAI,UAAU;IAClC,MAAM,SAA8B,CAAC;IACrC,IAAK,MAAM,OAAO,QAAS,MAAM,CAAC,IAAI,GAAG,AAAC,OAAe,CAAC,IAAI;IAC9D,OAAO,IAAI,GAAG;IACd,OAAO,QAAQ,GAAG,SAAS,OAAO,CAAC,UAAU;IAC7C,OAAO,MAAM,GAAG,OAAO,QAAQ,GAAG;IAClC,OAAO,QAAQ,GAAG,OAAO,MAAM,GAAG,CAAC,GAAG,QAAsB;IAC5D,IAAK,MAAM,OAAO,OAChB,OAAO,cAAc,CAAC,IAAI,EAAE,KAAK;QAC/B,YAAY;QACZ,cAAc;QACd,OAAO,MAAM,CAAC,IAAI;IACpB;AACJ;AAEA,YAAY,SAAS,GAAG,IAAI,SAAS;AAErC;;CAEC,GACD,SAAS,UAAU,KAAY,EAAE,cAAoC;IACnE,MAAM,IAAI,MAAM,CAAC,WAAW,EAAE,eAAe,OAAO,CAAC;AACvD;AAEA;;CAEC,GACD,SAAS,YAAY,SAAmB;IACtC,MAAM,IAAI,MAAM;AAClB"}}, - {"offset": {"line": 337, "column": 0}, "map": {"version":3,"sources":["turbopack://[turbopack]/shared-node/base-externals-utils.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n\n/// A 'base' utilities to support runtime can have externals.\n/// Currently this is for node.js / edge runtime both.\n/// If a fn requires node.js specific behavior, it should be placed in `node-external-utils` instead.\n\nasync function externalImport(id: ModuleId) {\n let raw;\n try {\n raw = await import(id);\n } catch (err) {\n // TODO(alexkirsz) This can happen when a client-side module tries to load\n // an external module we don't provide a shim for (e.g. querystring, url).\n // For now, we fail semi-silently, but in the future this should be a\n // compilation error.\n throw new Error(`Failed to load external module ${id}: ${err}`);\n }\n\n if (raw && raw.__esModule && raw.default && \"default\" in raw.default) {\n return interopEsm(raw.default, createNS(raw), true);\n }\n\n return raw;\n}\n\nfunction externalRequire(\n id: ModuleId,\n esm: boolean = false\n): Exports | EsmNamespaceObject {\n let raw;\n try {\n raw = require(id);\n } catch (err) {\n // TODO(alexkirsz) This can happen when a client-side module tries to load\n // an external module we don't provide a shim for (e.g. querystring, url).\n // For now, we fail semi-silently, but in the future this should be a\n // compilation error.\n throw new Error(`Failed to load external module ${id}: ${err}`);\n }\n\n if (!esm || raw.__esModule) {\n return raw;\n }\n\n return interopEsm(raw, createNS(raw), true);\n}\n\nexternalRequire.resolve = (\n id: string,\n options?: {\n paths?: string[];\n }\n) => {\n return require.resolve(id, options);\n};\n"],"names":[],"mappings":"AAAA,oDAAoD,GAEpD,mDAAmD;AAEnD,6DAA6D;AAC7D,sDAAsD;AACtD,qGAAqG;AAErG,eAAe,eAAe,EAAY;IACxC,IAAI;IACJ,IAAI;QACF,MAAM,MAAM,MAAM,CAAC;IACrB,EAAE,OAAO,KAAK;QACZ,0EAA0E;QAC1E,0EAA0E;QAC1E,qEAAqE;QACrE,qBAAqB;QACrB,MAAM,IAAI,MAAM,CAAC,+BAA+B,EAAE,GAAG,EAAE,EAAE,IAAI,CAAC;IAChE;IAEA,IAAI,OAAO,IAAI,UAAU,IAAI,IAAI,OAAO,IAAI,aAAa,IAAI,OAAO,EAAE;QACpE,OAAO,WAAW,IAAI,OAAO,EAAE,SAAS,MAAM;IAChD;IAEA,OAAO;AACT;AAEA,SAAS,gBACP,EAAY,EACZ,MAAe,KAAK;IAEpB,IAAI;IACJ,IAAI;QACF,MAAM,QAAQ;IAChB,EAAE,OAAO,KAAK;QACZ,0EAA0E;QAC1E,0EAA0E;QAC1E,qEAAqE;QACrE,qBAAqB;QACrB,MAAM,IAAI,MAAM,CAAC,+BAA+B,EAAE,GAAG,EAAE,EAAE,IAAI,CAAC;IAChE;IAEA,IAAI,CAAC,OAAO,IAAI,UAAU,EAAE;QAC1B,OAAO;IACT;IAEA,OAAO,WAAW,KAAK,SAAS,MAAM;AACxC;AAEA,gBAAgB,OAAO,GAAG,CACxB,IACA;IAIA,OAAO,QAAQ,OAAO,CAAC,IAAI;AAC7B"}}, - {"offset": {"line": 376, "column": 0}, "map": {"version":3,"sources":["turbopack://[turbopack]/shared-node/node-externals-utils.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\n\ndeclare var RUNTIME_PUBLIC_PATH: string;\ndeclare var OUTPUT_ROOT: string;\ndeclare var ASSET_PREFIX: string;\n\nconst path = require(\"path\");\n\nconst relativePathToRuntimeRoot = path.relative(RUNTIME_PUBLIC_PATH, \".\");\n// Compute the relative path to the `distDir`.\nconst relativePathToDistRoot = path.relative(\n path.join(OUTPUT_ROOT, RUNTIME_PUBLIC_PATH),\n \".\"\n);\nconst RUNTIME_ROOT = path.resolve(__filename, relativePathToRuntimeRoot);\n// Compute the absolute path to the root, by stripping distDir from the absolute path to this file.\nconst ABSOLUTE_ROOT = path.resolve(__filename, relativePathToDistRoot);\n\n/**\n * Returns an absolute path to the given module path.\n * Module path should be relative, either path to a file or a directory.\n *\n * This fn allows to calculate an absolute path for some global static values, such as\n * `__dirname` or `import.meta.url` that Turbopack will not embeds in compile time.\n * See ImportMetaBinding::code_generation for the usage.\n */\nfunction resolveAbsolutePath(modulePath?: string): string {\n if (modulePath) {\n return path.join(ABSOLUTE_ROOT, modulePath);\n }\n return ABSOLUTE_ROOT;\n}\n"],"names":[],"mappings":"AAAA,oDAAoD,GAMpD,MAAM,OAAO,QAAQ;AAErB,MAAM,4BAA4B,KAAK,QAAQ,CAAC,qBAAqB;AACrE,8CAA8C;AAC9C,MAAM,yBAAyB,KAAK,QAAQ,CAC1C,KAAK,IAAI,CAAC,aAAa,sBACvB;AAEF,MAAM,eAAe,KAAK,OAAO,CAAC,YAAY;AAC9C,mGAAmG;AACnG,MAAM,gBAAgB,KAAK,OAAO,CAAC,YAAY;AAE/C;;;;;;;CAOC,GACD,SAAS,oBAAoB,UAAmB;IAC9C,IAAI,YAAY;QACd,OAAO,KAAK,IAAI,CAAC,eAAe;IAClC;IACA,OAAO;AACT"}}, - {"offset": {"line": 396, "column": 0}, "map": {"version":3,"sources":["turbopack://[turbopack]/shared-node/node-wasm-utils.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n\nfunction readWebAssemblyAsResponse(path: string) {\n const { createReadStream } = require(\"fs\") as typeof import(\"fs\");\n const { Readable } = require(\"stream\") as typeof import(\"stream\");\n\n const stream = createReadStream(path);\n\n // @ts-ignore unfortunately there's a slight type mismatch with the stream.\n return new Response(Readable.toWeb(stream), {\n headers: {\n \"content-type\": \"application/wasm\",\n },\n });\n}\n\nasync function compileWebAssemblyFromPath(\n path: string\n): Promise {\n const response = readWebAssemblyAsResponse(path);\n\n return await WebAssembly.compileStreaming(response);\n}\n\nasync function instantiateWebAssemblyFromPath(\n path: string,\n importsObj: WebAssembly.Imports\n): Promise {\n const response = readWebAssemblyAsResponse(path);\n\n const { instance } = await WebAssembly.instantiateStreaming(\n response,\n importsObj\n );\n\n return instance.exports;\n}\n"],"names":[],"mappings":"AAAA,oDAAoD,GAEpD,mDAAmD;AAEnD,SAAS,0BAA0B,IAAY;IAC7C,MAAM,EAAE,gBAAgB,EAAE,GAAG,QAAQ;IACrC,MAAM,EAAE,QAAQ,EAAE,GAAG,QAAQ;IAE7B,MAAM,SAAS,iBAAiB;IAEhC,2EAA2E;IAC3E,OAAO,IAAI,SAAS,SAAS,KAAK,CAAC,SAAS;QAC1C,SAAS;YACP,gBAAgB;QAClB;IACF;AACF;AAEA,eAAe,2BACb,IAAY;IAEZ,MAAM,WAAW,0BAA0B;IAE3C,OAAO,MAAM,YAAY,gBAAgB,CAAC;AAC5C;AAEA,eAAe,+BACb,IAAY,EACZ,UAA+B;IAE/B,MAAM,WAAW,0BAA0B;IAE3C,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,YAAY,oBAAoB,CACzD,UACA;IAGF,OAAO,SAAS,OAAO;AACzB"}}, - {"offset": {"line": 417, "column": 0}, "map": {"version":3,"sources":["turbopack://[turbopack]/nodejs/runtime.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n/// \n/// \n/// \n\nenum SourceType {\n /**\n * The module was instantiated because it was included in an evaluated chunk's\n * runtime.\n */\n Runtime = 0,\n /**\n * The module was instantiated because a parent module imported it.\n */\n Parent = 1,\n}\n\ntype SourceInfo =\n | {\n type: SourceType.Runtime;\n chunkPath: ChunkPath;\n }\n | {\n type: SourceType.Parent;\n parentId: ModuleId;\n };\n\nfunction stringifySourceInfo(source: SourceInfo): string {\n switch (source.type) {\n case SourceType.Runtime:\n return `runtime for chunk ${source.chunkPath}`;\n case SourceType.Parent:\n return `parent module ${source.parentId}`;\n default:\n invariant(source, (source) => `Unknown source type: ${source?.type}`);\n }\n}\n\ntype ExternalRequire = (id: ModuleId) => Exports | EsmNamespaceObject;\ntype ExternalImport = (id: ModuleId) => Promise;\n\ninterface TurbopackNodeBuildContext extends TurbopackBaseContext {\n R: ResolvePathFromModule;\n x: ExternalRequire;\n y: ExternalImport;\n}\n\ntype ModuleFactory = (\n this: Module[\"exports\"],\n context: TurbopackNodeBuildContext\n) => undefined;\n\nconst url = require(\"url\");\nconst fs = require(\"fs/promises\");\nconst vm = require(\"vm\");\n\nconst moduleFactories: ModuleFactories = Object.create(null);\nconst moduleCache: ModuleCache = Object.create(null);\n\n/**\n * Returns an absolute path to the given module's id.\n */\nfunction createResolvePathFromModule(\n resolver: (moduleId: string) => Exports\n): (moduleId: string) => string {\n return function resolvePathFromModule(moduleId: string): string {\n const exported = resolver(moduleId);\n const exportedPath = exported?.default ?? exported;\n if (typeof exportedPath !== \"string\") {\n return exported as any;\n }\n\n const strippedAssetPrefix = exportedPath.slice(ASSET_PREFIX.length);\n const resolved = path.resolve(\n ABSOLUTE_ROOT,\n OUTPUT_ROOT,\n strippedAssetPrefix\n );\n\n return url.pathToFileURL(resolved);\n };\n}\n\nfunction loadChunk(chunkData: ChunkData, source?: SourceInfo): void {\n if (typeof chunkData === \"string\") {\n return loadChunkPath(chunkData, source);\n } else {\n return loadChunkPath(chunkData.path, source);\n }\n}\n\nfunction loadChunkPath(chunkPath: ChunkPath, source?: SourceInfo): void {\n if (!chunkPath.endsWith(\".js\")) {\n // We only support loading JS chunks in Node.js.\n // This branch can be hit when trying to load a CSS chunk.\n return;\n }\n\n try {\n const resolved = path.resolve(RUNTIME_ROOT, chunkPath);\n const chunkModules: ModuleFactories = require(resolved);\n\n for (const [moduleId, moduleFactory] of Object.entries(chunkModules)) {\n if (!moduleFactories[moduleId]) {\n moduleFactories[moduleId] = moduleFactory;\n }\n }\n } catch (e) {\n let errorMessage = `Failed to load chunk ${chunkPath}`;\n\n if (source) {\n errorMessage += ` from ${stringifySourceInfo(source)}`;\n }\n\n throw new Error(errorMessage, {\n cause: e,\n });\n }\n}\n\nasync function loadChunkAsync(\n source: SourceInfo,\n chunkData: ChunkData\n): Promise {\n const chunkPath = typeof chunkData === \"string\" ? chunkData : chunkData.path;\n if (!chunkPath.endsWith(\".js\")) {\n // We only support loading JS chunks in Node.js.\n // This branch can be hit when trying to load a CSS chunk.\n return;\n }\n\n const resolved = path.resolve(RUNTIME_ROOT, chunkPath);\n\n try {\n const contents = await fs.readFile(resolved, \"utf-8\");\n\n const module = {\n exports: {},\n };\n vm.runInThisContext(\n \"(function(module, exports, require, __dirname, __filename) {\" +\n contents +\n \"\\n})\",\n resolved\n )(module, module.exports, require, path.dirname(resolved), resolved);\n\n const chunkModules: ModuleFactories = module.exports;\n for (const [moduleId, moduleFactory] of Object.entries(chunkModules)) {\n if (!moduleFactories[moduleId]) {\n moduleFactories[moduleId] = moduleFactory;\n }\n }\n } catch (e) {\n let errorMessage = `Failed to load chunk ${chunkPath}`;\n\n if (source) {\n errorMessage += ` from ${stringifySourceInfo(source)}`;\n }\n\n throw new Error(errorMessage, {\n cause: e,\n });\n }\n}\n\nfunction loadWebAssembly(chunkPath: ChunkPath, imports: WebAssembly.Imports) {\n const resolved = path.resolve(RUNTIME_ROOT, chunkPath);\n\n return instantiateWebAssemblyFromPath(resolved, imports);\n}\n\nfunction loadWebAssemblyModule(chunkPath: ChunkPath) {\n const resolved = path.resolve(RUNTIME_ROOT, chunkPath);\n\n return compileWebAssemblyFromPath(resolved);\n}\n\nfunction getWorkerBlobURL(_chunks: ChunkPath[]): never {\n throw new Error(\"Worker blobs are not implemented yet for Node.js\");\n}\n\nfunction instantiateModule(id: ModuleId, source: SourceInfo): Module {\n const moduleFactory = moduleFactories[id];\n if (typeof moduleFactory !== \"function\") {\n // This can happen if modules incorrectly handle HMR disposes/updates,\n // e.g. when they keep a `setTimeout` around which still executes old code\n // and contains e.g. a `require(\"something\")` call.\n let instantiationReason;\n switch (source.type) {\n case SourceType.Runtime:\n instantiationReason = `as a runtime entry of chunk ${source.chunkPath}`;\n break;\n case SourceType.Parent:\n instantiationReason = `because it was required from module ${source.parentId}`;\n break;\n default:\n invariant(source, (source) => `Unknown source type: ${source?.type}`);\n }\n throw new Error(\n `Module ${id} was instantiated ${instantiationReason}, but the module factory is not available. It might have been deleted in an HMR update.`\n );\n }\n\n let parents: ModuleId[];\n switch (source.type) {\n case SourceType.Runtime:\n parents = [];\n break;\n case SourceType.Parent:\n // No need to add this module as a child of the parent module here, this\n // has already been taken care of in `getOrInstantiateModuleFromParent`.\n parents = [source.parentId];\n break;\n default:\n invariant(source, (source) => `Unknown source type: ${source?.type}`);\n }\n\n const module: Module = {\n exports: {},\n error: undefined,\n loaded: false,\n id,\n parents,\n children: [],\n namespaceObject: undefined,\n };\n moduleCache[id] = module;\n\n // NOTE(alexkirsz) This can fail when the module encounters a runtime error.\n try {\n const r = commonJsRequire.bind(null, module);\n moduleFactory.call(module.exports, {\n a: asyncModule.bind(null, module),\n e: module.exports,\n r,\n t: runtimeRequire,\n x: externalRequire,\n y: externalImport,\n f: moduleContext,\n i: esmImport.bind(null, module),\n s: esmExport.bind(null, module, module.exports),\n j: dynamicExport.bind(null, module, module.exports),\n v: exportValue.bind(null, module),\n n: exportNamespace.bind(null, module),\n m: module,\n c: moduleCache,\n M: moduleFactories,\n l: loadChunkAsync.bind(null, { type: SourceType.Parent, parentId: id }),\n w: loadWebAssembly,\n u: loadWebAssemblyModule,\n g: globalThis,\n P: resolveAbsolutePath,\n U: relativeURL,\n R: createResolvePathFromModule(r),\n b: getWorkerBlobURL,\n z: requireStub,\n __dirname: typeof module.id === \"string\" ? module.id.replace(/(^|\\/)\\/+$/, \"\") : module.id\n });\n } catch (error) {\n module.error = error as any;\n throw error;\n }\n\n module.loaded = true;\n if (module.namespaceObject && module.exports !== module.namespaceObject) {\n // in case of a circular dependency: cjs1 -> esm2 -> cjs1\n interopEsm(module.exports, module.namespaceObject);\n }\n\n return module;\n}\n\n/**\n * Retrieves a module from the cache, or instantiate it if it is not cached.\n */\nfunction getOrInstantiateModuleFromParent(\n id: ModuleId,\n sourceModule: Module\n): Module {\n const module = moduleCache[id];\n\n if (sourceModule.children.indexOf(id) === -1) {\n sourceModule.children.push(id);\n }\n\n if (module) {\n if (module.parents.indexOf(sourceModule.id) === -1) {\n module.parents.push(sourceModule.id);\n }\n\n return module;\n }\n\n return instantiateModule(id, {\n type: SourceType.Parent,\n parentId: sourceModule.id,\n });\n}\n\n/**\n * Instantiates a runtime module.\n */\nfunction instantiateRuntimeModule(\n moduleId: ModuleId,\n chunkPath: ChunkPath\n): Module {\n return instantiateModule(moduleId, { type: SourceType.Runtime, chunkPath });\n}\n\n/**\n * Retrieves a module from the cache, or instantiate it as a runtime module if it is not cached.\n */\nfunction getOrInstantiateRuntimeModule(\n moduleId: ModuleId,\n chunkPath: ChunkPath\n): Module {\n const module = moduleCache[moduleId];\n if (module) {\n if (module.error) {\n throw module.error;\n }\n return module;\n }\n\n return instantiateRuntimeModule(moduleId, chunkPath);\n}\n\nmodule.exports = {\n getOrInstantiateRuntimeModule,\n loadChunk,\n};\n"],"names":[],"mappings":"AAAA,oDAAoD,GAEpD,mDAAmD;AACnD,+DAA+D;AAC/D,+DAA+D;AAC/D,0DAA0D;;UAErD;IACH;;;GAGC;IAED;;GAEC;GARE,eAAA;AAsBL,SAAS,oBAAoB,MAAkB;IAC7C,OAAQ,OAAO,IAAI;QACjB;YACE,OAAO,CAAC,kBAAkB,EAAE,OAAO,SAAS,CAAC,CAAC;QAChD;YACE,OAAO,CAAC,cAAc,EAAE,OAAO,QAAQ,CAAC,CAAC;QAC3C;YACE,UAAU,QAAQ,CAAC,SAAW,CAAC,qBAAqB,EAAE,QAAQ,KAAK,CAAC;IACxE;AACF;AAgBA,MAAM,MAAM,QAAQ;AACpB,MAAM,KAAK,QAAQ;AACnB,MAAM,KAAK,QAAQ;AAEnB,MAAM,kBAAmC,OAAO,MAAM,CAAC;AACvD,MAAM,cAA2B,OAAO,MAAM,CAAC;AAE/C;;CAEC,GACD,SAAS,4BACP,QAAuC;IAEvC,OAAO,SAAS,sBAAsB,QAAgB;QACpD,MAAM,WAAW,SAAS;QAC1B,MAAM,eAAe,UAAU,WAAW;QAC1C,IAAI,OAAO,iBAAiB,UAAU;YACpC,OAAO;QACT;QAEA,MAAM,sBAAsB,aAAa,KAAK,CAAC,aAAa,MAAM;QAClE,MAAM,WAAW,KAAK,OAAO,CAC3B,eACA,aACA;QAGF,OAAO,IAAI,aAAa,CAAC;IAC3B;AACF;AAEA,SAAS,UAAU,SAAoB,EAAE,MAAmB;IAC1D,IAAI,OAAO,cAAc,UAAU;QACjC,OAAO,cAAc,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CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG;QAC5C,aAAa,QAAQ,CAAC,IAAI,CAAC;IAC7B;IAEA,IAAI,SAAQ;QACV,IAAI,QAAO,OAAO,CAAC,OAAO,CAAC,aAAa,EAAE,MAAM,CAAC,GAAG;YAClD,QAAO,OAAO,CAAC,IAAI,CAAC,aAAa,EAAE;QACrC;QAEA,OAAO;IACT;IAEA,OAAO,kBAAkB,IAAI;QAC3B,IAAI;QACJ,UAAU,aAAa,EAAE;IAC3B;AACF;AAEA;;CAEC,GACD,SAAS,yBACP,QAAkB,EAClB,SAAoB;IAEpB,OAAO,kBAAkB,UAAU;QAAE,IAAI;QAAsB;IAAU;AAC3E;AAEA;;CAEC,GACD,SAAS,8BACP,QAAkB,EAClB,SAAoB;IAEpB,MAAM,UAAS,WAAW,CAAC,SAAS;IACpC,IAAI,SAAQ;QACV,IAAI,QAAO,KAAK,EAAE;YAChB,MAAM,QAAO,KAAK;QACpB;QACA,OAAO;IACT;IAEA,OAAO,yBAAyB,UAAU;AAC5C;AAEA,OAAO,OAAO,GAAG;IACf;IACA;AACF"}}] + {"offset": {"line": 3, "column": 0}, "map": {"version":3,"sources":["turbopack://[turbopack]/shared/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\ntype EsmNamespaceObject = Record;\n\n// @ts-ignore Defined in `dev-base.ts`\ndeclare function getOrInstantiateModuleFromParent(\n id: ModuleId,\n sourceModule: M\n): M;\n\nconst REEXPORTED_OBJECTS = Symbol(\"reexported objects\");\n\ntype ModuleContextMap = Record;\n\ninterface ModuleContextEntry {\n id: () => ModuleId;\n module: () => any;\n}\n\ninterface ModuleContext {\n // require call\n (moduleId: ModuleId): Exports | EsmNamespaceObject;\n\n // async import call\n import(moduleId: ModuleId): Promise;\n\n keys(): ModuleId[];\n\n resolve(moduleId: ModuleId): ModuleId;\n}\n\ntype GetOrInstantiateModuleFromParent = (\n moduleId: ModuleId,\n parentModule: M\n) => M;\n\ndeclare function getOrInstantiateRuntimeModule(moduleId: ModuleId, chunkPath: ChunkPath): 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))\n Object.defineProperty(obj, name, options);\n}\n\n/**\n * Adds the getters to the exports object.\n */\nfunction esm(\n exports: Exports,\n getters: Record any) | [() => any, (v: any) => void]>\n) {\n defineProp(exports, \"__esModule\", { value: true });\n if (toStringTag) defineProp(exports, toStringTag, { value: \"Module\" });\n for (const key in getters) {\n const item = getters[key];\n if (Array.isArray(item)) {\n defineProp(exports, key, {\n get: item[0],\n set: item[1],\n enumerable: true,\n });\n } else {\n defineProp(exports, key, { get: item, enumerable: true });\n }\n }\n Object.seal(exports);\n}\n\n/**\n * Makes the module an ESM with exports\n */\nfunction esmExport(\n module: Module,\n exports: Exports,\n getters: Record any>\n) {\n module.namespaceObject = module.exports;\n esm(exports, getters);\n}\n\nfunction ensureDynamicExports(module: Module, exports: Exports) {\n let reexportedObjects = module[REEXPORTED_OBJECTS];\n\n if (!reexportedObjects) {\n reexportedObjects = module[REEXPORTED_OBJECTS] = [];\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 for (const obj of reexportedObjects!) {\n const value = Reflect.get(obj, prop);\n if (value !== undefined) return value;\n }\n return undefined;\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 });\n }\n}\n\n/**\n * Dynamically exports properties from an object\n */\nfunction dynamicExport(\n module: Module,\n exports: Exports,\n object: Record\n) {\n ensureDynamicExports(module, exports);\n\n if (typeof object === \"object\" && object !== null) {\n module[REEXPORTED_OBJECTS]!.push(object);\n }\n}\n\nfunction exportValue(module: Module, value: any) {\n module.exports = value;\n}\n\nfunction exportNamespace(module: Module, namespace: any) {\n module.exports = module.namespaceObject = namespace;\n}\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 getters: { [s: string]: () => any } = Object.create(null);\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 getters[key] = createGetter(raw, key);\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 && \"default\" in getters)) {\n getters[\"default\"] = () => raw;\n }\n\n esm(ns, getters);\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 sourceModule: Module,\n id: ModuleId\n): Exclude {\n const module = getOrInstantiateModuleFromParent(id, sourceModule);\n if (module.error) throw module.error;\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}\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 };\n\nfunction commonJsRequire(sourceModule: Module, id: ModuleId): Exports {\n const module = getOrInstantiateModuleFromParent(id, sourceModule);\n if (module.error) throw module.error;\n return module.exports;\n}\n\n/**\n * `require.context` and require/import expression runtime.\n */\nfunction moduleContext(map: ModuleContextMap): ModuleContext {\n function moduleContext(id: ModuleId): Exports {\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 = (): ModuleId[] => {\n return Object.keys(map);\n };\n\n moduleContext.resolve = (id: ModuleId): ModuleId => {\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: ModuleId) => {\n return await (moduleContext(id) as Promise);\n };\n\n return moduleContext;\n}\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\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\n// everything below is adapted from webpack\n// https://github.com/webpack/webpack/blob/6be4065ade1e252c1d8dcba4af0f43e32af1bdc1/lib/runtime/AsyncModuleRuntimeModule.js#L13\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\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\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 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 module: Module,\n body: (\n handleAsyncDependencies: (\n deps: Dep[]\n ) => Exports[] | Promise<() => Exports[]>,\n asyncResult: (err?: any) => void\n ) => void,\n hasAwait: boolean\n) {\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}\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};\n\nrelativeURL.prototype = URL.prototype;\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 * 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}\n"],"names":[],"mappings":"AAAA;;;;;CAKC,GAED,oDAAoD,GAEpD,6CAA6C;AAU7C,MAAM,qBAAqB,OAAO;AA4BlC,MAAM,iBAAiB,OAAO,SAAS,CAAC,cAAc;AACtD,MAAM,cAAc,OAAO,WAAW,eAAe,OAAO,WAAW;AAEvE,SAAS,WACP,GAAQ,EACR,IAAiB,EACjB,OAA2C;IAE3C,IAAI,CAAC,eAAe,IAAI,CAAC,KAAK,OAC5B,OAAO,cAAc,CAAC,KAAK,MAAM;AACrC;AAEA;;CAEC,GACD,SAAS,IACP,OAAgB,EAChB,OAAoE;IAEpE,WAAW,SAAS,cAAc;QAAE,OAAO;IAAK;IAChD,IAAI,aAAa,WAAW,SAAS,aAAa;QAAE,OAAO;IAAS;IACpE,IAAK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cesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n\n/// A 'base' utilities to support runtime can have externals.\n/// Currently this is for node.js / edge runtime both.\n/// If a fn requires node.js specific behavior, it should be placed in `node-external-utils` instead.\n\nasync function externalImport(id: ModuleId) {\n let raw;\n try {\n raw = await import(id);\n } catch (err) {\n // TODO(alexkirsz) This can happen when a client-side module tries to load\n // an external module we don't provide a shim for (e.g. querystring, url).\n // For now, we fail semi-silently, but in the future this should be a\n // compilation error.\n throw new Error(`Failed to load external module ${id}: ${err}`);\n }\n\n if (raw && raw.__esModule && raw.default && \"default\" in raw.default) {\n return interopEsm(raw.default, createNS(raw), true);\n }\n\n return raw;\n}\n\nfunction externalRequire(\n id: ModuleId,\n esm: boolean = false\n): Exports | EsmNamespaceObject {\n let raw;\n try {\n raw = require(id);\n } catch (err) {\n // TODO(alexkirsz) This can happen when a client-side module tries to load\n // an external module we don't provide a shim for (e.g. querystring, url).\n // For now, we fail semi-silently, but in the future this should be a\n // compilation error.\n throw new Error(`Failed to load external module ${id}: ${err}`);\n }\n\n if (!esm || raw.__esModule) {\n return raw;\n }\n\n return interopEsm(raw, createNS(raw), true);\n}\n\nexternalRequire.resolve = (\n id: string,\n options?: {\n paths?: string[];\n }\n) => {\n return require.resolve(id, options);\n};\n"],"names":[],"mappings":"AAAA,oDAAoD,GAEpD,mDAAmD;AAEnD,6DAA6D;AAC7D,sDAAsD;AACtD,qGAAqG;AAErG,eAAe,eAAe,EAAY;IACxC,IAAI;IACJ,IAAI;QACF,MAAM,MAAM,MAAM,CAAC;IACrB,EAAE,OAAO,KAAK;QACZ,0EAA0E;QAC1E,0EAA0E;QAC1E,qEAAqE;QACrE,qBAAqB;QACrB,MAAM,IAAI,MAAM,CAAC,+BAA+B,EAAE,GAAG,EAAE,EAAE,IAAI,CAAC;IAChE;IAEA,IAAI,OAAO,IAAI,UAAU,IAAI,IAAI,OAAO,IAAI,aAAa,IAAI,OAAO,EAAE;QACpE,OAAO,WAAW,IAAI,OAAO,EAAE,SAAS,MAAM;IAChD;IAEA,OAAO;AACT;AAEA,SAAS,gBACP,EAAY,EACZ,MAAe,KAAK;IAEpB,IAAI;IACJ,IAAI;QACF,MAAM,QAAQ;IAChB,EAAE,OAAO,KAAK;QACZ,0EAA0E;QAC1E,0EAA0E;QAC1E,qEAAqE;QACrE,qBAAqB;QACrB,MAAM,IAAI,MAAM,CAAC,+BAA+B,EAAE,GAAG,EAAE,EAAE,IAAI,CAAC;IAChE;IAEA,IAAI,CAAC,OAAO,IAAI,UAAU,EAAE;QAC1B,OAAO;IACT;IAEA,OAAO,WAAW,KAAK,SAAS,MAAM;AACxC;AAEA,gBAAgB,OAAO,GAAG,CACxB,IACA;IAIA,OAAO,QAAQ,OAAO,CAAC,IAAI;AAC7B"}}, + {"offset": {"line": 377, "column": 0}, "map": {"version":3,"sources":["turbopack://[turbopack]/shared-node/node-externals-utils.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\n\ndeclare var RUNTIME_PUBLIC_PATH: string;\ndeclare var OUTPUT_ROOT: string;\ndeclare var ASSET_PREFIX: string;\n\nconst path = require(\"path\");\n\nconst relativePathToRuntimeRoot = path.relative(RUNTIME_PUBLIC_PATH, \".\");\n// Compute the relative path to the `distDir`.\nconst relativePathToDistRoot = path.relative(\n path.join(OUTPUT_ROOT, RUNTIME_PUBLIC_PATH),\n \".\"\n);\nconst RUNTIME_ROOT = path.resolve(__filename, relativePathToRuntimeRoot);\n// Compute the absolute path to the root, by stripping distDir from the absolute path to this file.\nconst ABSOLUTE_ROOT = path.resolve(__filename, relativePathToDistRoot);\n\n/**\n * Returns an absolute path to the given module path.\n * Module path should be relative, either path to a file or a directory.\n *\n * This fn allows to calculate an absolute path for some global static values, such as\n * `__dirname` or `import.meta.url` that Turbopack will not embeds in compile time.\n * See ImportMetaBinding::code_generation for the usage.\n */\nfunction resolveAbsolutePath(modulePath?: string): string {\n if (modulePath) {\n return path.join(ABSOLUTE_ROOT, modulePath);\n }\n return ABSOLUTE_ROOT;\n}\n"],"names":[],"mappings":"AAAA,oDAAoD,GAMpD,MAAM,OAAO,QAAQ;AAErB,MAAM,4BAA4B,KAAK,QAAQ,CAAC,qBAAqB;AACrE,8CAA8C;AAC9C,MAAM,yBAAyB,KAAK,QAAQ,CAC1C,KAAK,IAAI,CAAC,aAAa,sBACvB;AAEF,MAAM,eAAe,KAAK,OAAO,CAAC,YAAY;AAC9C,mGAAmG;AACnG,MAAM,gBAAgB,KAAK,OAAO,CAAC,YAAY;AAE/C;;;;;;;CAOC,GACD,SAAS,oBAAoB,UAAmB;IAC9C,IAAI,YAAY;QACd,OAAO,KAAK,IAAI,CAAC,eAAe;IAClC;IACA,OAAO;AACT"}}, + {"offset": {"line": 397, "column": 0}, "map": {"version":3,"sources":["turbopack://[turbopack]/shared-node/node-wasm-utils.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n\nfunction readWebAssemblyAsResponse(path: string) {\n const { createReadStream } = require(\"fs\") as typeof import(\"fs\");\n const { Readable } = require(\"stream\") as typeof import(\"stream\");\n\n const stream = createReadStream(path);\n\n // @ts-ignore unfortunately there's a slight type mismatch with the stream.\n return new Response(Readable.toWeb(stream), {\n headers: {\n \"content-type\": \"application/wasm\",\n },\n });\n}\n\nasync function compileWebAssemblyFromPath(\n path: string\n): Promise {\n const response = readWebAssemblyAsResponse(path);\n\n return await WebAssembly.compileStreaming(response);\n}\n\nasync function instantiateWebAssemblyFromPath(\n path: string,\n importsObj: WebAssembly.Imports\n): Promise {\n const response = readWebAssemblyAsResponse(path);\n\n const { instance } = await WebAssembly.instantiateStreaming(\n response,\n importsObj\n );\n\n return instance.exports;\n}\n"],"names":[],"mappings":"AAAA,oDAAoD,GAEpD,mDAAmD;AAEnD,SAAS,0BAA0B,IAAY;IAC7C,MAAM,EAAE,gBAAgB,EAAE,GAAG,QAAQ;IACrC,MAAM,EAAE,QAAQ,EAAE,GAAG,QAAQ;IAE7B,MAAM,SAAS,iBAAiB;IAEhC,2EAA2E;IAC3E,OAAO,IAAI,SAAS,SAAS,KAAK,CAAC,SAAS;QAC1C,SAAS;YACP,gBAAgB;QAClB;IACF;AACF;AAEA,eAAe,2BACb,IAAY;IAEZ,MAAM,WAAW,0BAA0B;IAE3C,OAAO,MAAM,YAAY,gBAAgB,CAAC;AAC5C;AAEA,eAAe,+BACb,IAAY,EACZ,UAA+B;IAE/B,MAAM,WAAW,0BAA0B;IAE3C,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,YAAY,oBAAoB,CACzD,UACA;IAGF,OAAO,SAAS,OAAO;AACzB"}}, + {"offset": {"line": 418, "column": 0}, "map": {"version":3,"sources":["turbopack://[turbopack]/nodejs/runtime.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n/// \n/// \n/// \n\nenum SourceType {\n /**\n * The module was instantiated because it was included in an evaluated chunk's\n * runtime.\n */\n Runtime = 0,\n /**\n * The module was instantiated because a parent module imported it.\n */\n Parent = 1,\n}\n\ntype SourceInfo =\n | {\n type: SourceType.Runtime;\n chunkPath: ChunkPath;\n }\n | {\n type: SourceType.Parent;\n parentId: ModuleId;\n };\n\nfunction stringifySourceInfo(source: SourceInfo): string {\n switch (source.type) {\n case SourceType.Runtime:\n return `runtime for chunk ${source.chunkPath}`;\n case SourceType.Parent:\n return `parent module ${source.parentId}`;\n default:\n invariant(source, (source) => `Unknown source type: ${source?.type}`);\n }\n}\n\ntype ExternalRequire = (id: ModuleId) => Exports | EsmNamespaceObject;\ntype ExternalImport = (id: ModuleId) => Promise;\n\ninterface TurbopackNodeBuildContext extends TurbopackBaseContext {\n R: ResolvePathFromModule;\n x: ExternalRequire;\n y: ExternalImport;\n}\n\ntype ModuleFactory = (\n this: Module[\"exports\"],\n context: TurbopackNodeBuildContext\n) => undefined;\n\nconst url = require(\"url\");\nconst fs = require(\"fs/promises\");\nconst vm = require(\"vm\");\n\nconst moduleFactories: ModuleFactories = Object.create(null);\nconst moduleCache: ModuleCache = Object.create(null);\n\n/**\n * Returns an absolute path to the given module's id.\n */\nfunction createResolvePathFromModule(\n resolver: (moduleId: string) => Exports\n): (moduleId: string) => string {\n return function resolvePathFromModule(moduleId: string): string {\n const exported = resolver(moduleId);\n const exportedPath = exported?.default ?? exported;\n if (typeof exportedPath !== \"string\") {\n return exported as any;\n }\n\n const strippedAssetPrefix = exportedPath.slice(ASSET_PREFIX.length);\n const resolved = path.resolve(\n ABSOLUTE_ROOT,\n OUTPUT_ROOT,\n strippedAssetPrefix\n );\n\n return url.pathToFileURL(resolved);\n };\n}\n\nfunction loadChunk(chunkData: ChunkData, source?: SourceInfo): void {\n if (typeof chunkData === \"string\") {\n return loadChunkPath(chunkData, source);\n } else {\n return loadChunkPath(chunkData.path, source);\n }\n}\n\nfunction loadChunkPath(chunkPath: ChunkPath, source?: SourceInfo): void {\n if (!chunkPath.endsWith(\".js\")) {\n // We only support loading JS chunks in Node.js.\n // This branch can be hit when trying to load a CSS chunk.\n return;\n }\n\n try {\n const resolved = path.resolve(RUNTIME_ROOT, chunkPath);\n const chunkModules: ModuleFactories = require(resolved);\n\n for (const [moduleId, moduleFactory] of Object.entries(chunkModules)) {\n if (!moduleFactories[moduleId]) {\n moduleFactories[moduleId] = moduleFactory;\n }\n }\n } catch (e) {\n let errorMessage = `Failed to load chunk ${chunkPath}`;\n\n if (source) {\n errorMessage += ` from ${stringifySourceInfo(source)}`;\n }\n\n throw new Error(errorMessage, {\n cause: e,\n });\n }\n}\n\nasync function loadChunkAsync(\n source: SourceInfo,\n chunkData: ChunkData\n): Promise {\n const chunkPath = typeof chunkData === \"string\" ? chunkData : chunkData.path;\n if (!chunkPath.endsWith(\".js\")) {\n // We only support loading JS chunks in Node.js.\n // This branch can be hit when trying to load a CSS chunk.\n return;\n }\n\n const resolved = path.resolve(RUNTIME_ROOT, chunkPath);\n\n try {\n const contents = await fs.readFile(resolved, \"utf-8\");\n\n const module = {\n exports: {},\n };\n vm.runInThisContext(\n \"(function(module, exports, require, __dirname, __filename) {\" +\n contents +\n \"\\n})\",\n resolved\n )(module, module.exports, require, path.dirname(resolved), resolved);\n\n const chunkModules: ModuleFactories = module.exports;\n for (const [moduleId, moduleFactory] of Object.entries(chunkModules)) {\n if (!moduleFactories[moduleId]) {\n moduleFactories[moduleId] = moduleFactory;\n }\n }\n } catch (e) {\n let errorMessage = `Failed to load chunk ${chunkPath}`;\n\n if (source) {\n errorMessage += ` from ${stringifySourceInfo(source)}`;\n }\n\n throw new Error(errorMessage, {\n cause: e,\n });\n }\n}\n\nfunction loadWebAssembly(chunkPath: ChunkPath, imports: WebAssembly.Imports) {\n const resolved = path.resolve(RUNTIME_ROOT, chunkPath);\n\n return instantiateWebAssemblyFromPath(resolved, imports);\n}\n\nfunction loadWebAssemblyModule(chunkPath: ChunkPath) {\n const resolved = path.resolve(RUNTIME_ROOT, chunkPath);\n\n return compileWebAssemblyFromPath(resolved);\n}\n\nfunction getWorkerBlobURL(_chunks: ChunkPath[]): string {\n throw new Error(\"Worker blobs are not implemented yet for Node.js\");\n}\n\nfunction instantiateModule(id: ModuleId, source: SourceInfo): ModuleWithDirection {\n const moduleFactory = moduleFactories[id];\n if (typeof moduleFactory !== \"function\") {\n // This can happen if modules incorrectly handle HMR disposes/updates,\n // e.g. when they keep a `setTimeout` around which still executes old code\n // and contains e.g. a `require(\"something\")` call.\n let instantiationReason;\n switch (source.type) {\n case SourceType.Runtime:\n instantiationReason = `as a runtime entry of chunk ${source.chunkPath}`;\n break;\n case SourceType.Parent:\n instantiationReason = `because it was required from module ${source.parentId}`;\n break;\n default:\n invariant(source, (source) => `Unknown source type: ${source?.type}`);\n }\n throw new Error(\n `Module ${id} was instantiated ${instantiationReason}, but the module factory is not available. It might have been deleted in an HMR update.`\n );\n }\n\n let parents: ModuleId[];\n switch (source.type) {\n case SourceType.Runtime:\n parents = [];\n break;\n case SourceType.Parent:\n // No need to add this module as a child of the parent module here, this\n // has already been taken care of in `getOrInstantiateModuleFromParent`.\n parents = [source.parentId];\n break;\n default:\n invariant(source, (source) => `Unknown source type: ${source?.type}`);\n }\n\n const module: ModuleWithDirection = {\n exports: {},\n error: undefined,\n loaded: false,\n id,\n parents,\n children: [],\n namespaceObject: undefined,\n };\n moduleCache[id] = module;\n\n // NOTE(alexkirsz) This can fail when the module encounters a runtime error.\n try {\n const r = commonJsRequire.bind(null, module);\n moduleFactory.call(module.exports, {\n a: asyncModule.bind(null, module),\n e: module.exports,\n r,\n t: runtimeRequire,\n x: externalRequire,\n y: externalImport,\n f: moduleContext,\n i: esmImport.bind(null, module),\n s: esmExport.bind(null, module, module.exports),\n j: dynamicExport.bind(null, module, module.exports),\n v: exportValue.bind(null, module),\n n: exportNamespace.bind(null, module),\n m: module,\n c: moduleCache,\n M: moduleFactories,\n l: loadChunkAsync.bind(null, { type: SourceType.Parent, parentId: id }),\n w: loadWebAssembly,\n u: loadWebAssemblyModule,\n g: globalThis,\n P: resolveAbsolutePath,\n U: relativeURL,\n R: createResolvePathFromModule(r),\n b: getWorkerBlobURL,\n z: requireStub,\n __dirname: typeof module.id === \"string\" ? module.id.replace(/(^|\\/)\\/+$/, \"\") : module.id\n });\n } catch (error) {\n module.error = error as any;\n throw error;\n }\n\n module.loaded = true;\n if (module.namespaceObject && module.exports !== module.namespaceObject) {\n // in case of a circular dependency: cjs1 -> esm2 -> cjs1\n interopEsm(module.exports, module.namespaceObject);\n }\n\n return module;\n}\n\n/**\n * Retrieves a module from the cache, or instantiate it if it is not cached.\n */\n// @ts-ignore\nfunction getOrInstantiateModuleFromParent(\n id: ModuleId,\n sourceModule: ModuleWithDirection\n): ModuleWithDirection {\n const module = moduleCache[id];\n\n if (sourceModule.children.indexOf(id) === -1) {\n sourceModule.children.push(id);\n }\n\n if (module) {\n if (module.parents.indexOf(sourceModule.id) === -1) {\n module.parents.push(sourceModule.id);\n }\n\n return module;\n }\n\n return instantiateModule(id, {\n type: SourceType.Parent,\n parentId: sourceModule.id,\n });\n}\n\n/**\n * Instantiates a runtime module.\n */\nfunction instantiateRuntimeModule(\n moduleId: ModuleId,\n chunkPath: ChunkPath\n): Module {\n return instantiateModule(moduleId, { type: SourceType.Runtime, chunkPath });\n}\n\n/**\n * Retrieves a module from the cache, or instantiate it as a runtime module if it is not cached.\n */\n// @ts-ignore TypeScript doesn't separate this module space from the browser runtime\nfunction getOrInstantiateRuntimeModule(\n moduleId: ModuleId,\n chunkPath: ChunkPath\n): Module {\n const module = moduleCache[moduleId];\n if (module) {\n if (module.error) {\n throw module.error;\n }\n return module;\n }\n\n return instantiateRuntimeModule(moduleId, chunkPath);\n}\n\nmodule.exports = {\n getOrInstantiateRuntimeModule,\n loadChunk,\n};\n"],"names":[],"mappings":"AAAA,oDAAoD,GAEpD,mDAAmD;AACnD,+DAA+D;AAC/D,+DAA+D;AAC/D,0DAA0D;;UAErD;IACH;;;GAGC;IAED;;GAEC;GARE,eAAA;AAsBL,SAAS,oBAAoB,MAAkB;IAC7C,OAAQ,OAAO,IAAI;QACjB;YACE,OAAO,CAAC,kBAAkB,EAAE,OAAO,SAAS,CAAC,CAAC;QAChD;YACE,OAAO,CAAC,cAAc,EAAE,OAAO,QAAQ,CAAC,CAAC;QAC3C;YACE,UAAU,QAAQ,CAAC,SAAW,CAAC,qBAAqB,EAAE,QAAQ,KAAK,CAAC;IACxE;AACF;AAgBA,MAAM,MAAM,QAAQ;AACpB,MAAM,KAAK,QAAQ;AACnB,MAAM,KAAK,QAAQ;AAEnB,MAAM,kBAAmC,OAAO,MAAM,CAAC;AACvD,MAAM,cAAgD,OAAO,MAAM,CAAC;AAEpE;;CAEC,GACD,SAAS,4BACP,QAAuC;IAEvC,OAAO,SAAS,sBAAsB,QAAgB;QACpD,MAAM,WAAW,SAAS;QAC1B,MAAM,eAAe,UAAU,WAAW;QAC1C,IAAI,OAAO,iBAAiB,UAAU;YACpC,OAAO;QACT;QAEA,MAAM,sBAAsB,aAAa,KAAK,CAAC,aAAa,MAAM;QAClE,MAAM,WAAW,KAAK,OAAO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QAAO,eAAe;IACnD;IAEA,OAAO;AACT;AAEA;;CAEC,GACD,aAAa;AACb,SAAS,iCACP,EAAY,EACZ,YAAiC;IAEjC,MAAM,UAAS,WAAW,CAAC,GAAG;IAE9B,IAAI,aAAa,QAAQ,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG;QAC5C,aAAa,QAAQ,CAAC,IAAI,CAAC;IAC7B;IAEA,IAAI,SAAQ;QACV,IAAI,QAAO,OAAO,CAAC,OAAO,CAAC,aAAa,EAAE,MAAM,CAAC,GAAG;YAClD,QAAO,OAAO,CAAC,IAAI,CAAC,aAAa,EAAE;QACrC;QAEA,OAAO;IACT;IAEA,OAAO,kBAAkB,IAAI;QAC3B,IAAI;QACJ,UAAU,aAAa,EAAE;IAC3B;AACF;AAEA;;CAEC,GACD,SAAS,yBACP,QAAkB,EAClB,SAAoB;IAEpB,OAAO,kBAAkB,UAAU;QAAE,IAAI;QAAsB;IAAU;AAC3E;AAEA;;CAEC,GACD,oFAAoF;AACpF,SAAS,8BACP,QAAkB,EAClB,SAAoB;IAEpB,MAAM,UAAS,WAAW,CAAC,SAAS;IACpC,IAAI,SAAQ;QACV,IAAI,QAAO,KAAK,EAAE;YAChB,MAAM,QAAO,KAAK;QACpB;QACA,OAAO;IACT;IAEA,OAAO,yBAAyB,UAAU;AAC5C;AAEA,OAAO,OAAO,GAAG;IACf;IACA;AACF"}}] } \ No newline at end of file diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/runtime/default_dev_runtime/output/b1abf_turbopack-tests_tests_snapshot_runtime_default_dev_runtime_input_index_b6426d.js b/turbopack/crates/turbopack-tests/tests/snapshot/runtime/default_dev_runtime/output/b1abf_turbopack-tests_tests_snapshot_runtime_default_dev_runtime_input_index_b6426d.js index 1e0e81456d8c9..911c3a4dfc9f7 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/runtime/default_dev_runtime/output/b1abf_turbopack-tests_tests_snapshot_runtime_default_dev_runtime_input_index_b6426d.js +++ b/turbopack/crates/turbopack-tests/tests/snapshot/runtime/default_dev_runtime/output/b1abf_turbopack-tests_tests_snapshot_runtime_default_dev_runtime_input_index_b6426d.js @@ -149,7 +149,8 @@ function esmImport(sourceModule, id) { } // Add a simple runtime require so that environments without one can still pass // `typeof require` CommonJS checks so that exports are correctly registered. -const runtimeRequire = typeof require === "function" ? require : function require1() { +const runtimeRequire = // @ts-ignore +typeof require === "function" ? require : function require1() { throw new Error("Unexpected use of runtime require"); }; function commonJsRequire(sourceModule, id) { @@ -351,13 +352,8 @@ relativeURL.prototype = URL.prototype; * * It will be appended to the runtime code of each runtime right after the * shared runtime utils. - */ /* eslint-disable @typescript-eslint/no-unused-vars */ /// -/// -/// -/// -// This file must not use `import` and `export` statements. Otherwise, it -// becomes impossible to augment interfaces declared in ``d files -// (e.g. `Module`). Hence, the need for `import()` here. + */ /* eslint-disable @typescript-eslint/no-unused-vars */ /// +/// var SourceType; (function(SourceType) { /** @@ -372,26 +368,7 @@ var SourceType; * update. */ SourceType[SourceType["Update"] = 2] = "Update"; })(SourceType || (SourceType = {})); -class UpdateApplyError extends Error { - name = "UpdateApplyError"; - dependencyChain; - constructor(message, dependencyChain){ - super(message); - this.dependencyChain = dependencyChain; - } -} const moduleFactories = Object.create(null); -const moduleCache = Object.create(null); -/** - * Maps module IDs to persisted data between executions of their hot module - * implementation (`hot.data`). - */ const moduleHotData = new Map(); -/** - * Maps module instances to their hot module state. - */ const moduleHotState = new Map(); -/** - * Modules that call `module.hot.invalidate()` (while being updated). - */ const queuedInvalidatedModules = new Set(); /** * Module IDs that are instantiated as part of the runtime of a chunk. */ const runtimeModules = new Set(); @@ -505,6 +482,151 @@ async function loadChunkPath(source, chunkPath) { return exported?.default ?? exported; }; } +/** + * no-op for browser + * @param modulePath + */ function resolveAbsolutePath(modulePath) { + return `/ROOT/${modulePath ?? ""}`; +} +function getWorkerBlobURL(chunks) { + let bootstrap = `TURBOPACK_WORKER_LOCATION = ${JSON.stringify(location.origin)};importScripts(${chunks.map((c)=>`TURBOPACK_WORKER_LOCATION + ${JSON.stringify(getChunkRelativeUrl(c))}`).join(", ")});`; + let blob = new Blob([ + bootstrap + ], { + type: "text/javascript" + }); + return URL.createObjectURL(blob); +} +/** + * Adds a module to a chunk. + */ function addModuleToChunk(moduleId, chunkPath) { + let moduleChunks = moduleChunksMap.get(moduleId); + if (!moduleChunks) { + moduleChunks = new Set([ + chunkPath + ]); + moduleChunksMap.set(moduleId, moduleChunks); + } else { + moduleChunks.add(chunkPath); + } + let chunkModules = chunkModulesMap.get(chunkPath); + if (!chunkModules) { + chunkModules = new Set([ + moduleId + ]); + chunkModulesMap.set(chunkPath, chunkModules); + } else { + chunkModules.add(moduleId); + } +} +/** + * Returns the first chunk that included a module. + * This is used by the Node.js backend, hence why it's marked as unused in this + * file. + */ function getFirstModuleChunk(moduleId) { + const moduleChunkPaths = moduleChunksMap.get(moduleId); + if (moduleChunkPaths == null) { + return null; + } + return moduleChunkPaths.values().next().value; +} +/** + * Instantiates a runtime module. + */ function instantiateRuntimeModule(moduleId, chunkPath) { + return instantiateModule(moduleId, { + type: 0, + chunkPath + }); +} +/** + * Returns the URL relative to the origin where a chunk can be fetched from. + */ function getChunkRelativeUrl(chunkPath) { + return `${CHUNK_BASE_PATH}${chunkPath.split("/").map((p)=>encodeURIComponent(p)).join("/")}`; +} +/** + * Marks a chunk list as a runtime chunk list. There can be more than one + * runtime chunk list. For instance, integration tests can have multiple chunk + * groups loaded at runtime, each with its own chunk list. + */ function markChunkListAsRuntime(chunkListPath) { + runtimeChunkLists.add(chunkListPath); +} +function registerChunk([chunkPath, chunkModules, runtimeParams]) { + for (const [moduleId, moduleFactory] of Object.entries(chunkModules)){ + if (!moduleFactories[moduleId]) { + moduleFactories[moduleId] = moduleFactory; + } + addModuleToChunk(moduleId, chunkPath); + } + return BACKEND.registerChunk(chunkPath, runtimeParams); +} +/// +/// +/// +/** + * This file contains runtime types and functions that are shared between all + * Turbopack *development* ECMAScript runtimes. + * + * It will be appended to the runtime code of each runtime right after the + * shared runtime utils. + */ /* eslint-disable @typescript-eslint/no-unused-vars */ const devModuleCache = Object.create(null); +class UpdateApplyError extends Error { + name = "UpdateApplyError"; + dependencyChain; + constructor(message, dependencyChain){ + super(message); + this.dependencyChain = dependencyChain; + } +} +/** + * Maps module IDs to persisted data between executions of their hot module + * implementation (`hot.data`). + */ const moduleHotData = new Map(); +/** + * Maps module instances to their hot module state. + */ const moduleHotState = new Map(); +/** + * Modules that call `module.hot.invalidate()` (while being updated). + */ const queuedInvalidatedModules = new Set(); +/** + * Gets or instantiates a runtime module. + */ // @ts-ignore +function getOrInstantiateRuntimeModule(moduleId, chunkPath) { + const module = devModuleCache[moduleId]; + if (module) { + if (module.error) { + throw module.error; + } + return module; + } + // @ts-ignore + return instantiateModule(moduleId, { + type: SourceType.Runtime, + chunkPath + }); +} +/** + * Retrieves a module from the cache, or instantiate it if it is not cached. + */ // @ts-ignore Defined in `runtime-utils.ts` +const getOrInstantiateModuleFromParent = (id, sourceModule)=>{ + if (!sourceModule.hot.active) { + console.warn(`Unexpected import of module ${id} from module ${sourceModule.id}, which was deleted by an HMR update`); + } + const module = devModuleCache[id]; + if (sourceModule.children.indexOf(id) === -1) { + sourceModule.children.push(id); + } + if (module) { + if (module.parents.indexOf(sourceModule.id) === -1) { + module.parents.push(sourceModule.id); + } + return module; + } + return instantiateModule(id, { + type: SourceType.Parent, + parentId: sourceModule.id + }); +}; +// @ts-ignore Defined in `runtime-base.ts` function instantiateModule(id, source) { const moduleFactory = moduleFactories[id]; if (typeof moduleFactory !== "function") { @@ -513,13 +635,13 @@ function instantiateModule(id, source) { // and contains e.g. a `require("something")` call. let instantiationReason; switch(source.type){ - case 0: + case SourceType.Runtime: instantiationReason = `as a runtime entry of chunk ${source.chunkPath}`; break; - case 1: + case SourceType.Parent: instantiationReason = `because it was required from module ${source.parentId}`; break; - case 2: + case SourceType.Update: instantiationReason = "because of an HMR update"; break; default: @@ -531,18 +653,18 @@ function instantiateModule(id, source) { const { hot, hotState } = createModuleHot(id, hotData); let parents; switch(source.type){ - case 0: + case SourceType.Runtime: runtimeModules.add(id); parents = []; break; - case 1: + case SourceType.Parent: // No need to add this module as a child of the parent module here, this // has already been taken care of in `getOrInstantiateModuleFromParent`. parents = [ source.parentId ]; break; - case 2: + case SourceType.Update: parents = source.parents || []; break; default: @@ -558,12 +680,12 @@ function instantiateModule(id, source) { namespaceObject: undefined, hot }; - moduleCache[id] = module; + devModuleCache[id] = module; moduleHotState.set(module, hotState); // NOTE(alexkirsz) This can fail when the module encounters a runtime error. try { const sourceInfo = { - type: 1, + type: SourceType.Parent, parentId: id }; runModuleExecutionHooks(module, (refresh)=>{ @@ -580,7 +702,7 @@ function instantiateModule(id, source) { v: exportValue.bind(null, module), n: exportNamespace.bind(null, module), m: module, - c: moduleCache, + c: devModuleCache, M: moduleFactories, l: loadChunk.bind(null, sourceInfo), w: loadWebAssembly.bind(null, sourceInfo), @@ -606,21 +728,6 @@ function instantiateModule(id, source) { } return module; } -/** - * no-op for browser - * @param modulePath - */ function resolveAbsolutePath(modulePath) { - return `/ROOT/${modulePath ?? ""}`; -} -function getWorkerBlobURL(chunks) { - let bootstrap = `TURBOPACK_WORKER_LOCATION = ${JSON.stringify(location.origin)};importScripts(${chunks.map((c)=>`TURBOPACK_WORKER_LOCATION + ${JSON.stringify(getChunkRelativeUrl(c))}`).join(", ")});`; - let blob = new Blob([ - bootstrap - ], { - type: "text/javascript" - }); - return URL.createObjectURL(blob); -} /** * NOTE(alexkirsz) Webpack has a "module execution" interception hook that * Next.js' React Refresh runtime hooks into to add module context to the @@ -640,27 +747,6 @@ function getWorkerBlobURL(chunks) { cleanupReactRefreshIntercept(); } } -/** - * Retrieves a module from the cache, or instantiate it if it is not cached. - */ const getOrInstantiateModuleFromParent = (id, sourceModule)=>{ - if (!sourceModule.hot.active) { - console.warn(`Unexpected import of module ${id} from module ${sourceModule.id}, which was deleted by an HMR update`); - } - const module = moduleCache[id]; - if (sourceModule.children.indexOf(id) === -1) { - sourceModule.children.push(id); - } - if (module) { - if (module.parents.indexOf(sourceModule.id) === -1) { - module.parents.push(sourceModule.id); - } - return module; - } - return instantiateModule(id, { - type: 1, - parentId: sourceModule.id - }); -}; /** * This is adapted from https://github.com/vercel/next.js/blob/3466862d9dc9c8bb3131712134d38757b918d1c0/packages/react-refresh-utils/internal/ReactRefreshModule.runtime.ts */ function registerExportsAndSetupBoundaryForReactRefresh(module, helpers) { @@ -749,7 +835,7 @@ function computedInvalidatedModules(invalidated) { function computeOutdatedSelfAcceptedModules(outdatedModules) { const outdatedSelfAcceptedModules = []; for (const moduleId of outdatedModules){ - const module = moduleCache[moduleId]; + const module = devModuleCache[moduleId]; const hotState = moduleHotState.get(module); if (module && hotState.selfAccepted && !hotState.selfInvalidated) { outdatedSelfAcceptedModules.push({ @@ -793,9 +879,9 @@ function disposePhase(outdatedModules, disposedModules) { // We also want to keep track of previous parents of the outdated modules. const outdatedModuleParents = new Map(); for (const moduleId of outdatedModules){ - const oldModule = moduleCache[moduleId]; + const oldModule = devModuleCache[moduleId]; outdatedModuleParents.set(moduleId, oldModule?.parents); - delete moduleCache[moduleId]; + delete devModuleCache[moduleId]; } // TODO(alexkirsz) Dependencies: remove outdated dependency from module // children. @@ -809,14 +895,14 @@ function disposePhase(outdatedModules, disposedModules) { * Returns the persistent hot data that should be kept for the next module * instance. * - * NOTE: mode = "replace" will not remove modules from the moduleCache. + * NOTE: mode = "replace" will not remove modules from the devModuleCache * This must be done in a separate step afterwards. * This is important because all modules need to be disposed to update the - * parent/child relationships before they are actually removed from the moduleCache. + * parent/child relationships before they are actually removed from the devModuleCache. * If this was done in this method, the following disposeModule calls won't find * the module from the module id in the cache. */ function disposeModule(moduleId, mode) { - const module = moduleCache[moduleId]; + const module = devModuleCache[moduleId]; if (!module) { return; } @@ -836,7 +922,7 @@ function disposePhase(outdatedModules, disposedModules) { // It will be added back once the module re-instantiates and imports its // children again. for (const childId of module.children){ - const child = moduleCache[childId]; + const child = devModuleCache[childId]; if (!child) { continue; } @@ -847,7 +933,7 @@ function disposePhase(outdatedModules, disposedModules) { } switch(mode){ case "clear": - delete moduleCache[module.id]; + delete devModuleCache[module.id]; moduleHotData.delete(module.id); break; case "replace": @@ -868,7 +954,7 @@ function applyPhase(outdatedSelfAcceptedModules, newModuleFactories, outdatedMod for (const { moduleId, errorHandler } of outdatedSelfAcceptedModules){ try { instantiateModule(moduleId, { - type: 2, + type: SourceType.Update, parents: outdatedModuleParents.get(moduleId) }); } catch (err) { @@ -876,7 +962,7 @@ function applyPhase(outdatedSelfAcceptedModules, newModuleFactories, outdatedMod try { errorHandler(err, { moduleId, - module: moduleCache[moduleId] + module: devModuleCache[moduleId] }); } catch (err2) { reportError(err2); @@ -914,14 +1000,14 @@ function applyChunkListUpdate(update) { switch(chunkUpdate.type){ case "added": BACKEND.loadChunk(chunkPath, { - type: 2 + type: SourceType.Update }); break; case "total": - BACKEND.reloadChunk?.(chunkPath); + DEV_BACKEND.reloadChunk?.(chunkPath); break; case "deleted": - BACKEND.unloadChunk?.(chunkPath); + DEV_BACKEND.unloadChunk?.(chunkPath); break; case "partial": invariant(chunkUpdate.instruction, (instruction)=>`Unknown partial instruction: ${JSON.stringify(instruction)}.`); @@ -1061,7 +1147,7 @@ function getAffectedModuleEffects(moduleId) { dependencyChain }; } - const module = moduleCache[moduleId]; + const module = devModuleCache[moduleId]; const hotState = moduleHotState.get(module); if (// The module is not in the cache. Since this is a "modified" update, // it means that the module was never instantiated before. @@ -1086,7 +1172,7 @@ function getAffectedModuleEffects(moduleId) { continue; } for (const parentId of module.parents){ - const parent = moduleCache[parentId]; + const parent = devModuleCache[parentId]; if (!parent) { continue; } @@ -1120,7 +1206,7 @@ function handleApply(chunkListPath, update) { // This indicates that there is no way to apply the update to the // current state of the application, and that the application must be // restarted. - BACKEND.restart(); + DEV_BACKEND.restart(); break; } case "notFound": @@ -1130,7 +1216,7 @@ function handleApply(chunkListPath, update) { // If it is a dynamic import, we simply discard all modules that the chunk has exclusive access to. // If it is a runtime chunk list, we restart the application. if (runtimeChunkLists.has(chunkListPath)) { - BACKEND.restart(); + DEV_BACKEND.restart(); } else { disposeChunkList(chunkListPath); } @@ -1203,39 +1289,6 @@ function createModuleHot(moduleId, hotData) { hotState }; } -/** - * Adds a module to a chunk. - */ function addModuleToChunk(moduleId, chunkPath) { - let moduleChunks = moduleChunksMap.get(moduleId); - if (!moduleChunks) { - moduleChunks = new Set([ - chunkPath - ]); - moduleChunksMap.set(moduleId, moduleChunks); - } else { - moduleChunks.add(chunkPath); - } - let chunkModules = chunkModulesMap.get(chunkPath); - if (!chunkModules) { - chunkModules = new Set([ - moduleId - ]); - chunkModulesMap.set(chunkPath, chunkModules); - } else { - chunkModules.add(moduleId); - } -} -/** - * Returns the first chunk that included a module. - * This is used by the Node.js backend, hence why it's marked as unused in this - * file. - */ function getFirstModuleChunk(moduleId) { - const moduleChunkPaths = moduleChunksMap.get(moduleId); - if (moduleChunkPaths == null) { - return null; - } - return moduleChunkPaths.values().next().value; -} /** * Removes a module from a chunk. * Returns `true` if there are no remaining chunks including this module. @@ -1272,7 +1325,7 @@ function createModuleHot(moduleId, hotData) { } // We must also dispose of the chunk list's chunk itself to ensure it may // be reloaded properly in the future. - BACKEND.unloadChunk?.(chunkListPath); + DEV_BACKEND.unloadChunk?.(chunkListPath); return true; } /** @@ -1282,7 +1335,7 @@ function createModuleHot(moduleId, hotData) { */ function disposeChunk(chunkPath) { // This should happen whether the chunk has any modules in it or not. // For instance, CSS chunks have no modules in them, but they still need to be unloaded. - BACKEND.unloadChunk?.(chunkPath); + DEV_BACKEND.unloadChunk?.(chunkPath); const chunkModules = chunkModulesMap.get(chunkPath); if (chunkModules == null) { return false; @@ -1300,34 +1353,6 @@ function createModuleHot(moduleId, hotData) { } return true; } -/** - * Instantiates a runtime module. - */ function instantiateRuntimeModule(moduleId, chunkPath) { - return instantiateModule(moduleId, { - type: 0, - chunkPath - }); -} -/** - * Gets or instantiates a runtime module. - */ function getOrInstantiateRuntimeModule(moduleId, chunkPath) { - const module = moduleCache[moduleId]; - if (module) { - if (module.error) { - throw module.error; - } - return module; - } - return instantiateModule(moduleId, { - type: 0, - chunkPath - }); -} -/** - * Returns the URL relative to the origin where a chunk can be fetched from. - */ function getChunkRelativeUrl(chunkPath) { - return `${CHUNK_BASE_PATH}${chunkPath.split("/").map((p)=>encodeURIComponent(p)).join("/")}`; -} /** * Subscribes to chunk list updates from the update server and applies them. */ function registerChunkList(chunkUpdateProvider, chunkList) { @@ -1353,22 +1378,6 @@ function createModuleHot(moduleId, hotData) { markChunkListAsRuntime(chunkList.path); } } -/** - * Marks a chunk list as a runtime chunk list. There can be more than one - * runtime chunk list. For instance, integration tests can have multiple chunk - * groups loaded at runtime, each with its own chunk list. - */ function markChunkListAsRuntime(chunkListPath) { - runtimeChunkLists.add(chunkListPath); -} -function registerChunk([chunkPath, chunkModules, runtimeParams]) { - for (const [moduleId, moduleFactory] of Object.entries(chunkModules)){ - if (!moduleFactories[moduleId]) { - moduleFactories[moduleId] = moduleFactory; - } - addModuleToChunk(moduleId, chunkPath); - } - return BACKEND.registerChunk(chunkPath, runtimeParams); -} globalThis.TURBOPACK_CHUNK_UPDATE_LISTENERS ??= []; const chunkListsToRegister = globalThis.TURBOPACK_CHUNK_LISTS; if (Array.isArray(chunkListsToRegister)) { @@ -1386,8 +1395,8 @@ globalThis.TURBOPACK_CHUNK_LISTS = { * ECMAScript DOM runtime. * * It will be appended to the base development runtime code. - */ /* eslint-disable @typescript-eslint/no-unused-vars */ /// -/// + */ /* eslint-disable @typescript-eslint/no-unused-vars */ /// +/// let BACKEND; function augmentContext(context) { return context; @@ -1404,6 +1413,9 @@ async function loadWebAssemblyModule(_source, wasmChunkPath) { const req = fetchWebAssembly(wasmChunkPath); return await WebAssembly.compileStreaming(req); } +/** + * Maps chunk paths to the corresponding resolver. + */ const chunkResolvers = new Map(); (()=>{ BACKEND = { async registerChunk (chunkPath, params) { @@ -1430,79 +1442,8 @@ async function loadWebAssemblyModule(_source, wasmChunkPath) { }, loadChunk (chunkPath, source) { return doLoadChunk(chunkPath, source); - }, - unloadChunk (chunkPath) { - deleteResolver(chunkPath); - const chunkUrl = getChunkRelativeUrl(chunkPath); - // TODO(PACK-2140): remove this once all filenames are guaranteed to be escaped. - const decodedChunkUrl = decodeURI(chunkUrl); - if (chunkPath.endsWith(".css")) { - const links = document.querySelectorAll(`link[href="${chunkUrl}"],link[href^="${chunkUrl}?"],link[href="${decodedChunkUrl}"],link[href^="${decodedChunkUrl}?"]`); - for (const link of Array.from(links)){ - link.remove(); - } - } else if (chunkPath.endsWith(".js")) { - // Unloading a JS chunk would have no effect, as it lives in the JS - // runtime once evaluated. - // However, we still want to remove the script tag from the DOM to keep - // the HTML somewhat consistent from the user's perspective. - const scripts = document.querySelectorAll(`script[src="${chunkUrl}"],script[src^="${chunkUrl}?"],script[src="${decodedChunkUrl}"],script[src^="${decodedChunkUrl}?"]`); - for (const script of Array.from(scripts)){ - script.remove(); - } - } else { - throw new Error(`can't infer type of chunk from path ${chunkPath}`); - } - }, - reloadChunk (chunkPath) { - return new Promise((resolve, reject)=>{ - if (!chunkPath.endsWith(".css")) { - reject(new Error("The DOM backend can only reload CSS chunks")); - return; - } - const chunkUrl = getChunkRelativeUrl(chunkPath); - const decodedChunkUrl = decodeURI(chunkUrl); - const previousLinks = document.querySelectorAll(`link[rel=stylesheet][href="${chunkUrl}"],link[rel=stylesheet][href^="${chunkUrl}?"],link[rel=stylesheet][href="${decodedChunkUrl}"],link[rel=stylesheet][href^="${decodedChunkUrl}?"]`); - if (previousLinks.length === 0) { - reject(new Error(`No link element found for chunk ${chunkPath}`)); - return; - } - const link = document.createElement("link"); - link.rel = "stylesheet"; - if (navigator.userAgent.includes("Firefox")) { - // Firefox won't reload CSS files that were previously loaded on the current page, - // we need to add a query param to make sure CSS is actually reloaded from the server. - // - // I believe this is this issue: https://bugzilla.mozilla.org/show_bug.cgi?id=1037506 - // - // Safari has a similar issue, but only if you have a `` tag - // pointing to the same URL as the stylesheet: https://bugs.webkit.org/show_bug.cgi?id=187726 - link.href = `${chunkUrl}?ts=${Date.now()}`; - } else { - link.href = chunkUrl; - } - link.onerror = ()=>{ - reject(); - }; - link.onload = ()=>{ - // First load the new CSS, then remove the old ones. This prevents visible - // flickering that would happen in-between removing the previous CSS and - // loading the new one. - for (const previousLink of Array.from(previousLinks))previousLink.remove(); - // CSS chunks do not register themselves, and as such must be marked as - // loaded instantly. - resolve(); - }; - // Make sure to insert the new CSS right after the previous one, so that - // its precedence is higher. - previousLinks[0].parentElement.insertBefore(link, previousLinks[0].nextSibling); - }); - }, - restart: ()=>self.location.reload() + } }; - /** - * Maps chunk paths to the corresponding resolver. - */ const chunkResolvers = new Map(); function getOrCreateResolver(chunkPath) { let resolver = chunkResolvers.get(chunkPath); if (!resolver) { @@ -1525,9 +1466,6 @@ async function loadWebAssemblyModule(_source, wasmChunkPath) { } return resolver; } - function deleteResolver(chunkPath) { - chunkResolvers.delete(chunkPath); - } /** * Loads the given chunk, and returns a promise that resolves once the chunk * has been loaded. @@ -1609,6 +1547,91 @@ async function loadWebAssemblyModule(_source, wasmChunkPath) { return resolver.promise; } })(); +/** + * This file contains the runtime code specific to the Turbopack development + * ECMAScript DOM runtime. + * + * It will be appended to the base development runtime code. + */ /* eslint-disable @typescript-eslint/no-unused-vars */ /// +/// +/// +/// +let DEV_BACKEND; +(()=>{ + DEV_BACKEND = { + unloadChunk (chunkPath) { + deleteResolver(chunkPath); + const chunkUrl = getChunkRelativeUrl(chunkPath); + // TODO(PACK-2140): remove this once all filenames are guaranteed to be escaped. + const decodedChunkUrl = decodeURI(chunkUrl); + if (chunkPath.endsWith(".css")) { + const links = document.querySelectorAll(`link[href="${chunkUrl}"],link[href^="${chunkUrl}?"],link[href="${decodedChunkUrl}"],link[href^="${decodedChunkUrl}?"]`); + for (const link of Array.from(links)){ + link.remove(); + } + } else if (chunkPath.endsWith(".js")) { + // Unloading a JS chunk would have no effect, as it lives in the JS + // runtime once evaluated. + // However, we still want to remove the script tag from the DOM to keep + // the HTML somewhat consistent from the user's perspective. + const scripts = document.querySelectorAll(`script[src="${chunkUrl}"],script[src^="${chunkUrl}?"],script[src="${decodedChunkUrl}"],script[src^="${decodedChunkUrl}?"]`); + for (const script of Array.from(scripts)){ + script.remove(); + } + } else { + throw new Error(`can't infer type of chunk from path ${chunkPath}`); + } + }, + reloadChunk (chunkPath) { + return new Promise((resolve, reject)=>{ + if (!chunkPath.endsWith(".css")) { + reject(new Error("The DOM backend can only reload CSS chunks")); + return; + } + const chunkUrl = getChunkRelativeUrl(chunkPath); + const decodedChunkUrl = decodeURI(chunkUrl); + const previousLinks = document.querySelectorAll(`link[rel=stylesheet][href="${chunkUrl}"],link[rel=stylesheet][href^="${chunkUrl}?"],link[rel=stylesheet][href="${decodedChunkUrl}"],link[rel=stylesheet][href^="${decodedChunkUrl}?"]`); + if (previousLinks.length === 0) { + reject(new Error(`No link element found for chunk ${chunkPath}`)); + return; + } + const link = document.createElement("link"); + link.rel = "stylesheet"; + if (navigator.userAgent.includes("Firefox")) { + // Firefox won't reload CSS files that were previously loaded on the current page, + // we need to add a query param to make sure CSS is actually reloaded from the server. + // + // I believe this is this issue: https://bugzilla.mozilla.org/show_bug.cgi?id=1037506 + // + // Safari has a similar issue, but only if you have a `` tag + // pointing to the same URL as the stylesheet: https://bugs.webkit.org/show_bug.cgi?id=187726 + link.href = `${chunkUrl}?ts=${Date.now()}`; + } else { + link.href = chunkUrl; + } + link.onerror = ()=>{ + reject(); + }; + link.onload = ()=>{ + // First load the new CSS, then remove the old ones. This prevents visible + // flickering that would happen in-between removing the previous CSS and + // loading the new one. + for (const previousLink of Array.from(previousLinks))previousLink.remove(); + // CSS chunks do not register themselves, and as such must be marked as + // loaded instantly. + resolve(); + }; + // Make sure to insert the new CSS right after the previous one, so that + // its precedence is higher. + previousLinks[0].parentElement.insertBefore(link, previousLinks[0].nextSibling); + }); + }, + restart: ()=>self.location.reload() + }; + function deleteResolver(chunkPath) { + chunkResolvers.delete(chunkPath); + } +})(); function _eval({ code, url, map }) { code += `\n\n//# sourceURL=${encodeURI(location.origin + CHUNK_BASE_PATH + url)}`; if (map) { diff --git a/turbopack/crates/turbopack-tests/tests/snapshot/runtime/default_dev_runtime/output/b1abf_turbopack-tests_tests_snapshot_runtime_default_dev_runtime_input_index_b6426d.js.map b/turbopack/crates/turbopack-tests/tests/snapshot/runtime/default_dev_runtime/output/b1abf_turbopack-tests_tests_snapshot_runtime_default_dev_runtime_input_index_b6426d.js.map index d28b3e5235800..fe06b5a27fbde 100644 --- a/turbopack/crates/turbopack-tests/tests/snapshot/runtime/default_dev_runtime/output/b1abf_turbopack-tests_tests_snapshot_runtime_default_dev_runtime_input_index_b6426d.js.map +++ b/turbopack/crates/turbopack-tests/tests/snapshot/runtime/default_dev_runtime/output/b1abf_turbopack-tests_tests_snapshot_runtime_default_dev_runtime_input_index_b6426d.js.map @@ -2,8 +2,10 @@ "version": 3, "sources": [], "sections": [ - {"offset": {"line": 13, "column": 0}, "map": {"version":3,"sources":["turbopack://[turbopack]/shared/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\ninterface Exports {\n __esModule?: boolean;\n\n [key: string]: any;\n}\n\ntype EsmNamespaceObject = Record;\n\nconst REEXPORTED_OBJECTS = Symbol(\"reexported objects\");\n\ninterface BaseModule {\n exports: Function | Exports | Promise | AsyncModulePromise;\n error: Error | undefined;\n loaded: boolean;\n id: ModuleId;\n children: ModuleId[];\n parents: ModuleId[];\n namespaceObject?:\n | EsmNamespaceObject\n | Promise\n | AsyncModulePromise;\n [REEXPORTED_OBJECTS]?: any[];\n}\n\ninterface Module extends BaseModule {}\n\ntype ModuleContextMap = Record;\n\ninterface ModuleContextEntry {\n id: () => ModuleId;\n module: () => any;\n}\n\ninterface ModuleContext {\n // require call\n (moduleId: ModuleId): Exports | EsmNamespaceObject;\n\n // async import call\n import(moduleId: ModuleId): Promise;\n\n keys(): ModuleId[];\n\n resolve(moduleId: ModuleId): ModuleId;\n}\n\ntype GetOrInstantiateModuleFromParent = (\n moduleId: ModuleId,\n parentModule: Module\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))\n Object.defineProperty(obj, name, options);\n}\n\n/**\n * Adds the getters to the exports object.\n */\nfunction esm(\n exports: Exports,\n getters: Record any) | [() => any, (v: any) => void]>\n) {\n defineProp(exports, \"__esModule\", { value: true });\n if (toStringTag) defineProp(exports, toStringTag, { value: \"Module\" });\n for (const key in getters) {\n const item = getters[key];\n if (Array.isArray(item)) {\n defineProp(exports, key, {\n get: item[0],\n set: item[1],\n enumerable: true,\n });\n } else {\n defineProp(exports, key, { get: item, enumerable: true });\n }\n }\n Object.seal(exports);\n}\n\n/**\n * Makes the module an ESM with exports\n */\nfunction esmExport(\n module: Module,\n exports: Exports,\n getters: Record any>\n) {\n module.namespaceObject = module.exports;\n esm(exports, getters);\n}\n\nfunction ensureDynamicExports(module: Module, exports: Exports) {\n let reexportedObjects = module[REEXPORTED_OBJECTS];\n\n if (!reexportedObjects) {\n reexportedObjects = module[REEXPORTED_OBJECTS] = [];\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 for (const obj of reexportedObjects!) {\n const value = Reflect.get(obj, prop);\n if (value !== undefined) return value;\n }\n return undefined;\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 });\n }\n}\n\n/**\n * Dynamically exports properties from an object\n */\nfunction dynamicExport(\n module: Module,\n exports: Exports,\n object: Record\n) {\n ensureDynamicExports(module, exports);\n\n if (typeof object === \"object\" && object !== null) {\n module[REEXPORTED_OBJECTS]!.push(object);\n }\n}\n\nfunction exportValue(module: Module, value: any) {\n module.exports = value;\n}\n\nfunction exportNamespace(module: Module, namespace: any) {\n module.exports = module.namespaceObject = namespace;\n}\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 getters: { [s: string]: () => any } = Object.create(null);\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 getters[key] = createGetter(raw, key);\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 && \"default\" in getters)) {\n getters[\"default\"] = () => raw;\n }\n\n esm(ns, getters);\n return ns;\n}\n\nfunction createNS(raw: BaseModule[\"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 sourceModule: Module,\n id: ModuleId\n): Exclude {\n const module = getOrInstantiateModuleFromParent(id, sourceModule);\n if (module.error) throw module.error;\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}\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 typeof require === \"function\"\n ? require\n : function require() {\n throw new Error(\"Unexpected use of runtime require\");\n };\n\nfunction commonJsRequire(sourceModule: Module, id: ModuleId): Exports {\n const module = getOrInstantiateModuleFromParent(id, sourceModule);\n if (module.error) throw module.error;\n return module.exports;\n}\n\n/**\n * `require.context` and require/import expression runtime.\n */\nfunction moduleContext(map: ModuleContextMap): ModuleContext {\n function moduleContext(id: ModuleId): Exports {\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 = (): ModuleId[] => {\n return Object.keys(map);\n };\n\n moduleContext.resolve = (id: ModuleId): ModuleId => {\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: ModuleId) => {\n return await (moduleContext(id) as Promise);\n };\n\n return moduleContext;\n}\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\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\n// everything below is adapted from webpack\n// https://github.com/webpack/webpack/blob/6be4065ade1e252c1d8dcba4af0f43e32af1bdc1/lib/runtime/AsyncModuleRuntimeModule.js#L13\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\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\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 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 module: Module,\n body: (\n handleAsyncDependencies: (\n deps: Dep[]\n ) => Exports[] | Promise<() => Exports[]>,\n asyncResult: (err?: any) => void\n ) => void,\n hasAwait: boolean\n) {\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}\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};\n\nrelativeURL.prototype = URL.prototype;\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 * 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}\n"],"names":[],"mappings":"AAAA;;;;;CAKC,GAED,oDAAoD,GAEpD,6CAA6C;AAU7C,MAAM,qBAAqB,OAAO;AA0ClC,MAAM,iBAAiB,OAAO,SAAS,CAAC,cAAc;AACtD,MAAM,cAAc,OAAO,WAAW,eAAe,OAAO,WAAW;AAEvE,SAAS,WACP,GAAQ,EACR,IAAiB,EACjB,OAA2C;IAE3C,IAAI,CAAC,eAAe,IAAI,CAAC,KAAK,OAC5B,OAAO,cAAc,CAAC,KAAK,MAAM;AACrC;AAEA;;CAEC,GACD,SAAS,IACP,OAAgB,EAChB,OAAoE;IAEpE,WAAW,SAAS,cAAc;QAAE,OAAO;IAAK;IAChD,IAAI,aAAa,WAAW,SAAS,aAAa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ev/runtime/base/runtime-base.ts"],"sourcesContent":["/**\n * This file contains runtime types and functions that are shared between all\n * Turbopack *development* 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/// \n\n// This file must not use `import` and `export` statements. Otherwise, it\n// becomes impossible to augment interfaces declared in ``d files\n// (e.g. `Module`). Hence, the need for `import()` here.\ntype RefreshRuntimeGlobals =\n import(\"@next/react-refresh-utils/dist/runtime\").RefreshRuntimeGlobals;\n\n// Workers are loaded via blob object urls and aren't relative to the main context, this gets\n// prefixed to chunk urls in the worker.\ndeclare var TURBOPACK_WORKER_LOCATION: string;\ndeclare var CHUNK_BASE_PATH: string;\ndeclare var $RefreshHelpers$: RefreshRuntimeGlobals[\"$RefreshHelpers$\"];\ndeclare var $RefreshReg$: RefreshRuntimeGlobals[\"$RefreshReg$\"];\ndeclare var $RefreshSig$: RefreshRuntimeGlobals[\"$RefreshSig$\"];\ndeclare var $RefreshInterceptModuleExecution$:\n | RefreshRuntimeGlobals[\"$RefreshInterceptModuleExecution$\"];\n\ntype RefreshContext = {\n register: RefreshRuntimeGlobals[\"$RefreshReg$\"];\n signature: RefreshRuntimeGlobals[\"$RefreshSig$\"];\n registerExports: typeof registerExportsAndSetupBoundaryForReactRefresh;\n};\n\ntype RefreshHelpers = RefreshRuntimeGlobals[\"$RefreshHelpers$\"];\n\ninterface TurbopackDevBaseContext extends TurbopackBaseContext {\n k: RefreshContext;\n R: ResolvePathFromModule;\n}\n\ninterface TurbopackDevContext extends TurbopackDevBaseContext {}\n\n// string encoding of a module factory (used in hmr updates)\ntype ModuleFactoryString = string;\n\ntype ModuleFactory = (\n this: Module[\"exports\"],\n context: TurbopackDevContext\n) => undefined;\n\ntype DevRuntimeParams = {\n otherChunks: ChunkData[];\n runtimeModuleIds: ModuleId[];\n};\n\ntype ChunkRegistration = [\n chunkPath: ChunkPath,\n chunkModules: ModuleFactories,\n params: DevRuntimeParams | undefined\n];\ntype ChunkList = {\n path: ChunkPath;\n chunks: ChunkData[];\n source: \"entry\" | \"dynamic\";\n};\n\nenum SourceType {\n /**\n * The module was instantiated because it was included in an evaluated chunk's\n * runtime.\n */\n Runtime = 0,\n /**\n * The module was instantiated because a parent module imported it.\n */\n Parent = 1,\n /**\n * The module was instantiated because it was included in a chunk's hot module\n * update.\n */\n Update = 2,\n}\n\ntype SourceInfo =\n | {\n type: SourceType.Runtime;\n chunkPath: ChunkPath;\n }\n | {\n type: SourceType.Parent;\n parentId: ModuleId;\n }\n | {\n type: SourceType.Update;\n parents?: ModuleId[];\n };\n\ninterface RuntimeBackend {\n registerChunk: (chunkPath: ChunkPath, params?: DevRuntimeParams) => void;\n loadChunk: (chunkPath: ChunkPath, source: SourceInfo) => Promise;\n reloadChunk?: (chunkPath: ChunkPath) => Promise;\n unloadChunk?: (chunkPath: ChunkPath) => void;\n\n restart: () => void;\n}\n\nclass UpdateApplyError extends Error {\n name = \"UpdateApplyError\";\n\n dependencyChain: string[];\n\n constructor(message: string, dependencyChain: string[]) {\n super(message);\n this.dependencyChain = dependencyChain;\n }\n}\n\nconst moduleFactories: ModuleFactories = Object.create(null);\nconst moduleCache: ModuleCache = Object.create(null);\n/**\n * Maps module IDs to persisted data between executions of their hot module\n * implementation (`hot.data`).\n */\nconst moduleHotData: Map = new Map();\n/**\n * Maps module instances to their hot module state.\n */\nconst moduleHotState: Map = new Map();\n/**\n * Modules that call `module.hot.invalidate()` (while being updated).\n */\nconst queuedInvalidatedModules: Set = new Set();\n/**\n * Module IDs that are instantiated as part of the runtime of a chunk.\n */\nconst runtimeModules: Set = new Set();\n/**\n * Map from module ID to the chunks that contain this module.\n *\n * In HMR, we need to keep track of which modules are contained in which so\n * chunks. This is so we don't eagerly dispose of a module when it is removed\n * from chunk A, but still exists in chunk B.\n */\nconst moduleChunksMap: Map> = new Map();\n/**\n * Map from a chunk path to all modules it contains.\n */\nconst chunkModulesMap: Map> = new Map();\n/**\n * Chunk lists that contain a runtime. When these chunk lists receive an update\n * that can't be reconciled with the current state of the page, we need to\n * reload the runtime entirely.\n */\nconst runtimeChunkLists: Set = new Set();\n/**\n * Map from a chunk list to the chunk paths it contains.\n */\nconst chunkListChunksMap: Map> = new Map();\n/**\n * Map from a chunk path to the chunk lists it belongs to.\n */\nconst chunkChunkListsMap: Map> = new Map();\n\nconst availableModules: Map | true> = new Map();\n\nconst availableModuleChunks: Map | true> = new Map();\n\nasync function loadChunk(\n source: SourceInfo,\n chunkData: ChunkData\n): Promise {\n if (typeof chunkData === \"string\") {\n return loadChunkPath(source, chunkData);\n }\n\n const includedList = chunkData.included || [];\n const modulesPromises = includedList.map((included) => {\n if (moduleFactories[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 return Promise.all(modulesPromises);\n }\n\n const includedModuleChunksList = chunkData.moduleChunks || [];\n const moduleChunksPromises = includedModuleChunksList\n .map((included) => {\n // TODO(alexkirsz) Do we need this check?\n // if (moduleFactories[included]) return true;\n return availableModuleChunks.get(included);\n })\n .filter((p) => p);\n\n let promise;\n if (moduleChunksPromises.length > 0) {\n // Some module chunks are already loaded or loading.\n\n if (moduleChunksPromises.length === includedModuleChunksList.length) {\n // When all included module chunks are already loaded or loading, we can skip loading ourselves\n return Promise.all(moduleChunksPromises);\n }\n\n const moduleChunksToLoad: Set = new Set();\n for (const moduleChunk of includedModuleChunksList) {\n if (!availableModuleChunks.has(moduleChunk)) {\n moduleChunksToLoad.add(moduleChunk);\n }\n }\n\n for (const moduleChunkToLoad of moduleChunksToLoad) {\n const promise = loadChunkPath(source, moduleChunkToLoad);\n\n availableModuleChunks.set(moduleChunkToLoad, promise);\n\n moduleChunksPromises.push(promise);\n }\n\n promise = Promise.all(moduleChunksPromises);\n } else {\n promise = loadChunkPath(source, chunkData.path);\n\n // Mark all included module chunks as loading if they are not already loaded or loading.\n for (const includedModuleChunk of includedModuleChunksList) {\n if (!availableModuleChunks.has(includedModuleChunk)) {\n availableModuleChunks.set(includedModuleChunk, promise);\n }\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 return promise;\n}\n\nasync function loadChunkPath(\n source: SourceInfo,\n chunkPath: ChunkPath\n): Promise {\n try {\n await BACKEND.loadChunk(chunkPath, source);\n } catch (error) {\n let loadReason;\n switch (source.type) {\n case SourceType.Runtime:\n loadReason = `as a runtime dependency of chunk ${source.chunkPath}`;\n break;\n case SourceType.Parent:\n loadReason = `from module ${source.parentId}`;\n break;\n case SourceType.Update:\n loadReason = \"from an HMR update\";\n break;\n default:\n invariant(source, (source) => `Unknown source type: ${source?.type}`);\n }\n throw new Error(\n `Failed to load chunk ${chunkPath} ${loadReason}${\n error ? `: ${error}` : \"\"\n }`,\n error\n ? {\n cause: error,\n }\n : undefined\n );\n }\n}\n\n/**\n * Returns an absolute url to an asset.\n */\nfunction createResolvePathFromModule(\n resolver: (moduleId: string) => Exports\n): (moduleId: string) => string {\n return function resolvePathFromModule(moduleId: string): string {\n const exported = resolver(moduleId);\n return exported?.default ?? exported;\n };\n}\n\nfunction instantiateModule(id: ModuleId, source: SourceInfo): Module {\n const moduleFactory = moduleFactories[id];\n if (typeof moduleFactory !== \"function\") {\n // This can happen if modules incorrectly handle HMR disposes/updates,\n // e.g. when they keep a `setTimeout` around which still executes old code\n // and contains e.g. a `require(\"something\")` call.\n let instantiationReason;\n switch (source.type) {\n case SourceType.Runtime:\n instantiationReason = `as a runtime entry of chunk ${source.chunkPath}`;\n break;\n case SourceType.Parent:\n instantiationReason = `because it was required from module ${source.parentId}`;\n break;\n case SourceType.Update:\n instantiationReason = \"because of an HMR update\";\n break;\n default:\n invariant(source, (source) => `Unknown source type: ${source?.type}`);\n }\n throw new Error(\n `Module ${id} was instantiated ${instantiationReason}, but the module factory is not available. It might have been deleted in an HMR update.`\n );\n }\n\n const hotData = moduleHotData.get(id)!;\n const { hot, hotState } = createModuleHot(id, hotData);\n\n let parents: ModuleId[];\n switch (source.type) {\n case SourceType.Runtime:\n runtimeModules.add(id);\n parents = [];\n break;\n case SourceType.Parent:\n // No need to add this module as a child of the parent module here, this\n // has already been taken care of in `getOrInstantiateModuleFromParent`.\n parents = [source.parentId];\n break;\n case SourceType.Update:\n parents = source.parents || [];\n break;\n default:\n invariant(source, (source) => `Unknown source type: ${source?.type}`);\n }\n\n const module: Module = {\n exports: {},\n error: undefined,\n loaded: false,\n id,\n parents,\n children: [],\n namespaceObject: undefined,\n hot,\n };\n\n moduleCache[id] = module;\n moduleHotState.set(module, hotState);\n\n // NOTE(alexkirsz) This can fail when the module encounters a runtime error.\n try {\n const sourceInfo: SourceInfo = { type: SourceType.Parent, parentId: id };\n\n runModuleExecutionHooks(module, (refresh) => {\n const r = commonJsRequire.bind(null, module);\n moduleFactory.call(\n module.exports,\n augmentContext({\n a: asyncModule.bind(null, module),\n e: module.exports,\n r: commonJsRequire.bind(null, module),\n t: runtimeRequire,\n f: moduleContext,\n i: esmImport.bind(null, module),\n s: esmExport.bind(null, module, module.exports),\n j: dynamicExport.bind(null, module, module.exports),\n v: exportValue.bind(null, module),\n n: exportNamespace.bind(null, module),\n m: module,\n c: moduleCache,\n M: moduleFactories,\n l: loadChunk.bind(null, sourceInfo),\n w: loadWebAssembly.bind(null, sourceInfo),\n u: loadWebAssemblyModule.bind(null, sourceInfo),\n g: globalThis,\n P: resolveAbsolutePath,\n U: relativeURL,\n k: refresh,\n R: createResolvePathFromModule(r),\n b: getWorkerBlobURL,\n z: requireStub,\n __dirname: typeof module.id === \"string\" ? module.id.replace(/(^|\\/)\\/+$/, \"\") : module.id\n })\n );\n });\n } catch (error) {\n module.error = error as any;\n throw error;\n }\n\n module.loaded = true;\n if (module.namespaceObject && module.exports !== module.namespaceObject) {\n // in case of a circular dependency: cjs1 -> esm2 -> cjs1\n interopEsm(module.exports, module.namespaceObject);\n }\n\n return module;\n}\n\n/**\n * no-op for browser\n * @param modulePath\n */\nfunction resolveAbsolutePath(modulePath?: string): string {\n return `/ROOT/${modulePath ?? \"\"}`;\n}\n\nfunction getWorkerBlobURL(chunks: ChunkPath[]): string {\n let bootstrap = `TURBOPACK_WORKER_LOCATION = ${JSON.stringify(location.origin)};importScripts(${chunks.map(c => (`TURBOPACK_WORKER_LOCATION + ${JSON.stringify(getChunkRelativeUrl(c))}`)).join(\", \")});`;\n let blob = new Blob([bootstrap], { type: \"text/javascript\" });\n return URL.createObjectURL(blob);\n}\n\n/**\n * NOTE(alexkirsz) Webpack has a \"module execution\" interception hook that\n * Next.js' React Refresh runtime hooks into to add module context to the\n * refresh registry.\n */\nfunction runModuleExecutionHooks(\n module: Module,\n executeModule: (ctx: RefreshContext) => void\n) {\n const cleanupReactRefreshIntercept =\n typeof globalThis.$RefreshInterceptModuleExecution$ === \"function\"\n ? globalThis.$RefreshInterceptModuleExecution$(module.id)\n : () => {};\n\n try {\n executeModule({\n register: globalThis.$RefreshReg$,\n signature: globalThis.$RefreshSig$,\n registerExports: registerExportsAndSetupBoundaryForReactRefresh,\n });\n } catch (e) {\n throw e;\n } finally {\n // Always cleanup the intercept, even if module execution failed.\n cleanupReactRefreshIntercept();\n }\n}\n\n/**\n * Retrieves a module from the cache, or instantiate it if it is not cached.\n */\nconst getOrInstantiateModuleFromParent: GetOrInstantiateModuleFromParent = (\n id,\n sourceModule\n) => {\n if (!sourceModule.hot.active) {\n console.warn(\n `Unexpected import of module ${id} from module ${sourceModule.id}, which was deleted by an HMR update`\n );\n }\n\n const module = moduleCache[id];\n\n if (sourceModule.children.indexOf(id) === -1) {\n sourceModule.children.push(id);\n }\n\n if (module) {\n if (module.parents.indexOf(sourceModule.id) === -1) {\n module.parents.push(sourceModule.id);\n }\n\n return module;\n }\n\n return instantiateModule(id, {\n type: SourceType.Parent,\n parentId: sourceModule.id,\n });\n};\n\n/**\n * This is adapted from https://github.com/vercel/next.js/blob/3466862d9dc9c8bb3131712134d38757b918d1c0/packages/react-refresh-utils/internal/ReactRefreshModule.runtime.ts\n */\nfunction registerExportsAndSetupBoundaryForReactRefresh(\n module: Module,\n helpers: RefreshHelpers\n) {\n const currentExports = module.exports;\n const prevExports = module.hot.data.prevExports ?? null;\n\n helpers.registerExportsForReactRefresh(currentExports, module.id);\n\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (helpers.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports on update, so we can compare the boundary\n // signatures.\n module.hot.dispose((data) => {\n data.prevExports = currentExports;\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n module.hot.accept();\n\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevExports !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (\n helpers.shouldInvalidateReactRefreshBoundary(\n helpers.getRefreshBoundarySignature(prevExports),\n helpers.getRefreshBoundarySignature(currentExports)\n )\n ) {\n module.hot.invalidate();\n } else {\n helpers.scheduleUpdate();\n }\n }\n } else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n const isNoLongerABoundary = prevExports !== null;\n if (isNoLongerABoundary) {\n module.hot.invalidate();\n }\n }\n}\n\nfunction formatDependencyChain(dependencyChain: ModuleId[]): string {\n return `Dependency chain: ${dependencyChain.join(\" -> \")}`;\n}\n\nfunction computeOutdatedModules(\n added: Map,\n modified: Map\n): {\n outdatedModules: Set;\n newModuleFactories: Map;\n} {\n const newModuleFactories = new Map();\n\n for (const [moduleId, entry] of added) {\n if (entry != null) {\n newModuleFactories.set(moduleId, _eval(entry));\n }\n }\n\n const outdatedModules = computedInvalidatedModules(modified.keys());\n\n for (const [moduleId, entry] of modified) {\n newModuleFactories.set(moduleId, _eval(entry));\n }\n\n return { outdatedModules, newModuleFactories };\n}\n\nfunction computedInvalidatedModules(\n invalidated: Iterable\n): Set {\n const outdatedModules = new Set();\n\n for (const moduleId of invalidated) {\n const effect = getAffectedModuleEffects(moduleId);\n\n switch (effect.type) {\n case \"unaccepted\":\n throw new UpdateApplyError(\n `cannot apply update: unaccepted module. ${formatDependencyChain(\n effect.dependencyChain\n )}.`,\n effect.dependencyChain\n );\n case \"self-declined\":\n throw new UpdateApplyError(\n `cannot apply update: self-declined module. ${formatDependencyChain(\n effect.dependencyChain\n )}.`,\n effect.dependencyChain\n );\n case \"accepted\":\n for (const outdatedModuleId of effect.outdatedModules) {\n outdatedModules.add(outdatedModuleId);\n }\n break;\n // TODO(alexkirsz) Dependencies: handle dependencies effects.\n default:\n invariant(effect, (effect) => `Unknown effect type: ${effect?.type}`);\n }\n }\n\n return outdatedModules;\n}\n\nfunction computeOutdatedSelfAcceptedModules(\n outdatedModules: Iterable\n): { moduleId: ModuleId; errorHandler: true | Function }[] {\n const outdatedSelfAcceptedModules = [];\n for (const moduleId of outdatedModules) {\n const module = moduleCache[moduleId];\n const hotState = moduleHotState.get(module)!;\n if (module && hotState.selfAccepted && !hotState.selfInvalidated) {\n outdatedSelfAcceptedModules.push({\n moduleId,\n errorHandler: hotState.selfAccepted,\n });\n }\n }\n return outdatedSelfAcceptedModules;\n}\n\n/**\n * Adds, deletes, and moves modules between chunks. This must happen before the\n * dispose phase as it needs to know which modules were removed from all chunks,\n * which we can only compute *after* taking care of added and moved modules.\n */\nfunction updateChunksPhase(\n chunksAddedModules: Map>,\n chunksDeletedModules: Map>\n): { disposedModules: Set } {\n for (const [chunkPath, addedModuleIds] of chunksAddedModules) {\n for (const moduleId of addedModuleIds) {\n addModuleToChunk(moduleId, chunkPath);\n }\n }\n\n const disposedModules: Set = new Set();\n for (const [chunkPath, addedModuleIds] of chunksDeletedModules) {\n for (const moduleId of addedModuleIds) {\n if (removeModuleFromChunk(moduleId, chunkPath)) {\n disposedModules.add(moduleId);\n }\n }\n }\n\n return { disposedModules };\n}\n\nfunction disposePhase(\n outdatedModules: Iterable,\n disposedModules: Iterable\n): { outdatedModuleParents: Map> } {\n for (const moduleId of outdatedModules) {\n disposeModule(moduleId, \"replace\");\n }\n\n for (const moduleId of disposedModules) {\n disposeModule(moduleId, \"clear\");\n }\n\n // Removing modules from the module cache is a separate step.\n // We also want to keep track of previous parents of the outdated modules.\n const outdatedModuleParents = new Map();\n for (const moduleId of outdatedModules) {\n const oldModule = moduleCache[moduleId];\n outdatedModuleParents.set(moduleId, oldModule?.parents);\n delete moduleCache[moduleId];\n }\n\n // TODO(alexkirsz) Dependencies: remove outdated dependency from module\n // children.\n\n return { outdatedModuleParents };\n}\n\n/**\n * Disposes of an instance of a module.\n *\n * Returns the persistent hot data that should be kept for the next module\n * instance.\n *\n * NOTE: mode = \"replace\" will not remove modules from the moduleCache.\n * This must be done in a separate step afterwards.\n * This is important because all modules need to be disposed to update the\n * parent/child relationships before they are actually removed from the moduleCache.\n * If this was done in this method, the following disposeModule calls won't find\n * the module from the module id in the cache.\n */\nfunction disposeModule(moduleId: ModuleId, mode: \"clear\" | \"replace\") {\n const module = moduleCache[moduleId];\n if (!module) {\n return;\n }\n\n const hotState = moduleHotState.get(module)!;\n const data = {};\n\n // Run the `hot.dispose` handler, if any, passing in the persistent\n // `hot.data` object.\n for (const disposeHandler of hotState.disposeHandlers) {\n disposeHandler(data);\n }\n\n // This used to warn in `getOrInstantiateModuleFromParent` when a disposed\n // module is still importing other modules.\n module.hot.active = false;\n\n moduleHotState.delete(module);\n\n // TODO(alexkirsz) Dependencies: delete the module from outdated deps.\n\n // Remove the disposed module from its children's parent list.\n // It will be added back once the module re-instantiates and imports its\n // children again.\n for (const childId of module.children) {\n const child = moduleCache[childId];\n if (!child) {\n continue;\n }\n\n const idx = child.parents.indexOf(module.id);\n if (idx >= 0) {\n child.parents.splice(idx, 1);\n }\n }\n\n switch (mode) {\n case \"clear\":\n delete moduleCache[module.id];\n moduleHotData.delete(module.id);\n break;\n case \"replace\":\n moduleHotData.set(module.id, data);\n break;\n default:\n invariant(mode, (mode) => `invalid mode: ${mode}`);\n }\n}\n\nfunction applyPhase(\n outdatedSelfAcceptedModules: {\n moduleId: ModuleId;\n errorHandler: true | Function;\n }[],\n newModuleFactories: Map,\n outdatedModuleParents: Map>,\n reportError: (err: any) => void\n) {\n // Update module factories.\n for (const [moduleId, factory] of newModuleFactories.entries()) {\n moduleFactories[moduleId] = factory;\n }\n\n // TODO(alexkirsz) Run new runtime entries here.\n\n // TODO(alexkirsz) Dependencies: call accept handlers for outdated deps.\n\n // Re-instantiate all outdated self-accepted modules.\n for (const { moduleId, errorHandler } of outdatedSelfAcceptedModules) {\n try {\n instantiateModule(moduleId, {\n type: SourceType.Update,\n parents: outdatedModuleParents.get(moduleId),\n });\n } catch (err) {\n if (typeof errorHandler === \"function\") {\n try {\n errorHandler(err, { moduleId, module: moduleCache[moduleId] });\n } catch (err2) {\n reportError(err2);\n reportError(err);\n }\n } else {\n reportError(err);\n }\n }\n }\n}\n\nfunction applyUpdate(update: PartialUpdate) {\n switch (update.type) {\n case \"ChunkListUpdate\":\n applyChunkListUpdate(update);\n break;\n default:\n invariant(update, (update) => `Unknown update type: ${update.type}`);\n }\n}\n\nfunction applyChunkListUpdate(update: ChunkListUpdate) {\n if (update.merged != null) {\n for (const merged of update.merged) {\n switch (merged.type) {\n case \"EcmascriptMergedUpdate\":\n applyEcmascriptMergedUpdate(merged);\n break;\n default:\n invariant(merged, (merged) => `Unknown merged type: ${merged.type}`);\n }\n }\n }\n\n if (update.chunks != null) {\n for (const [chunkPath, chunkUpdate] of Object.entries(update.chunks)) {\n switch (chunkUpdate.type) {\n case \"added\":\n BACKEND.loadChunk(chunkPath, { type: SourceType.Update });\n break;\n case \"total\":\n BACKEND.reloadChunk?.(chunkPath);\n break;\n case \"deleted\":\n BACKEND.unloadChunk?.(chunkPath);\n break;\n case \"partial\":\n invariant(\n chunkUpdate.instruction,\n (instruction) =>\n `Unknown partial instruction: ${JSON.stringify(instruction)}.`\n );\n break;\n default:\n invariant(\n chunkUpdate,\n (chunkUpdate) => `Unknown chunk update type: ${chunkUpdate.type}`\n );\n }\n }\n }\n}\n\nfunction applyEcmascriptMergedUpdate(update: EcmascriptMergedUpdate) {\n const { entries = {}, chunks = {} } = update;\n const { added, modified, chunksAdded, chunksDeleted } = computeChangedModules(\n entries,\n chunks\n );\n const { outdatedModules, newModuleFactories } = computeOutdatedModules(\n added,\n modified\n );\n const { disposedModules } = updateChunksPhase(chunksAdded, chunksDeleted);\n\n applyInternal(outdatedModules, disposedModules, newModuleFactories);\n}\n\nfunction applyInvalidatedModules(outdatedModules: Set) {\n if (queuedInvalidatedModules.size > 0) {\n computedInvalidatedModules(queuedInvalidatedModules).forEach((moduleId) => {\n outdatedModules.add(moduleId);\n });\n\n queuedInvalidatedModules.clear();\n }\n\n return outdatedModules;\n}\n\nfunction applyInternal(\n outdatedModules: Set,\n disposedModules: Iterable,\n newModuleFactories: Map\n) {\n outdatedModules = applyInvalidatedModules(outdatedModules);\n\n const outdatedSelfAcceptedModules =\n computeOutdatedSelfAcceptedModules(outdatedModules);\n\n const { outdatedModuleParents } = disposePhase(\n outdatedModules,\n disposedModules\n );\n\n // we want to continue on error and only throw the error after we tried applying all updates\n let error: any;\n\n function reportError(err: any) {\n if (!error) error = err;\n }\n\n applyPhase(\n outdatedSelfAcceptedModules,\n newModuleFactories,\n outdatedModuleParents,\n reportError\n );\n\n if (error) {\n throw error;\n }\n\n if (queuedInvalidatedModules.size > 0) {\n applyInternal(new Set(), [], new Map());\n }\n}\n\nfunction computeChangedModules(\n entries: Record,\n updates: Record\n): {\n added: Map;\n modified: Map;\n deleted: Set;\n chunksAdded: Map>;\n chunksDeleted: Map>;\n} {\n const chunksAdded = new Map();\n const chunksDeleted = new Map();\n const added: Map = new Map();\n const modified = new Map();\n const deleted: Set = new Set();\n\n for (const [chunkPath, mergedChunkUpdate] of Object.entries(updates)) {\n switch (mergedChunkUpdate.type) {\n case \"added\": {\n const updateAdded = new Set(mergedChunkUpdate.modules);\n for (const moduleId of updateAdded) {\n added.set(moduleId, entries[moduleId]);\n }\n chunksAdded.set(chunkPath, updateAdded);\n break;\n }\n case \"deleted\": {\n // We could also use `mergedChunkUpdate.modules` here.\n const updateDeleted = new Set(chunkModulesMap.get(chunkPath));\n for (const moduleId of updateDeleted) {\n deleted.add(moduleId);\n }\n chunksDeleted.set(chunkPath, updateDeleted);\n break;\n }\n case \"partial\": {\n const updateAdded = new Set(mergedChunkUpdate.added);\n const updateDeleted = new Set(mergedChunkUpdate.deleted);\n for (const moduleId of updateAdded) {\n added.set(moduleId, entries[moduleId]);\n }\n for (const moduleId of updateDeleted) {\n deleted.add(moduleId);\n }\n chunksAdded.set(chunkPath, updateAdded);\n chunksDeleted.set(chunkPath, updateDeleted);\n break;\n }\n default:\n invariant(\n mergedChunkUpdate,\n (mergedChunkUpdate) =>\n `Unknown merged chunk update type: ${mergedChunkUpdate.type}`\n );\n }\n }\n\n // If a module was added from one chunk and deleted from another in the same update,\n // consider it to be modified, as it means the module was moved from one chunk to another\n // AND has new code in a single update.\n for (const moduleId of added.keys()) {\n if (deleted.has(moduleId)) {\n added.delete(moduleId);\n deleted.delete(moduleId);\n }\n }\n\n for (const [moduleId, entry] of Object.entries(entries)) {\n // Modules that haven't been added to any chunk but have new code are considered\n // to be modified.\n // This needs to be under the previous loop, as we need it to get rid of modules\n // that were added and deleted in the same update.\n if (!added.has(moduleId)) {\n modified.set(moduleId, entry);\n }\n }\n\n return { added, deleted, modified, chunksAdded, chunksDeleted };\n}\n\ntype ModuleEffect =\n | {\n type: \"unaccepted\";\n dependencyChain: ModuleId[];\n }\n | {\n type: \"self-declined\";\n dependencyChain: ModuleId[];\n moduleId: ModuleId;\n }\n | {\n type: \"accepted\";\n moduleId: ModuleId;\n outdatedModules: Set;\n };\n\nfunction getAffectedModuleEffects(moduleId: ModuleId): ModuleEffect {\n const outdatedModules: Set = new Set();\n\n type QueueItem = { moduleId?: ModuleId; dependencyChain: ModuleId[] };\n\n const queue: QueueItem[] = [\n {\n moduleId,\n dependencyChain: [],\n },\n ];\n\n let nextItem;\n while ((nextItem = queue.shift())) {\n const { moduleId, dependencyChain } = nextItem;\n\n if (moduleId != null) {\n if (outdatedModules.has(moduleId)) {\n // Avoid infinite loops caused by cycles between modules in the dependency chain.\n continue;\n }\n\n outdatedModules.add(moduleId);\n }\n\n // We've arrived at the runtime of the chunk, which means that nothing\n // else above can accept this update.\n if (moduleId === undefined) {\n return {\n type: \"unaccepted\",\n dependencyChain,\n };\n }\n\n const module = moduleCache[moduleId];\n const hotState = moduleHotState.get(module)!;\n\n if (\n // The module is not in the cache. Since this is a \"modified\" update,\n // it means that the module was never instantiated before.\n !module || // The module accepted itself without invalidating globalThis.\n // TODO is that right?\n (hotState.selfAccepted && !hotState.selfInvalidated)\n ) {\n continue;\n }\n\n if (hotState.selfDeclined) {\n return {\n type: \"self-declined\",\n dependencyChain,\n moduleId,\n };\n }\n\n if (runtimeModules.has(moduleId)) {\n queue.push({\n moduleId: undefined,\n dependencyChain: [...dependencyChain, moduleId],\n });\n continue;\n }\n\n for (const parentId of module.parents) {\n const parent = moduleCache[parentId];\n\n if (!parent) {\n // TODO(alexkirsz) Is this even possible?\n continue;\n }\n\n // TODO(alexkirsz) Dependencies: check accepted and declined\n // dependencies here.\n\n queue.push({\n moduleId: parentId,\n dependencyChain: [...dependencyChain, moduleId],\n });\n }\n }\n\n return {\n type: \"accepted\",\n moduleId,\n outdatedModules,\n };\n}\n\nfunction handleApply(chunkListPath: ChunkPath, update: ServerMessage) {\n switch (update.type) {\n case \"partial\": {\n // This indicates that the update is can be applied to the current state of the application.\n applyUpdate(update.instruction);\n break;\n }\n case \"restart\": {\n // This indicates that there is no way to apply the update to the\n // current state of the application, and that the application must be\n // restarted.\n BACKEND.restart();\n break;\n }\n case \"notFound\": {\n // This indicates that the chunk list no longer exists: either the dynamic import which created it was removed,\n // or the page itself was deleted.\n // If it is a dynamic import, we simply discard all modules that the chunk has exclusive access to.\n // If it is a runtime chunk list, we restart the application.\n if (runtimeChunkLists.has(chunkListPath)) {\n BACKEND.restart();\n } else {\n disposeChunkList(chunkListPath);\n }\n break;\n }\n default:\n throw new Error(`Unknown update type: ${update.type}`);\n }\n}\n\nfunction createModuleHot(\n moduleId: ModuleId,\n hotData: HotData\n): { hot: Hot; hotState: HotState } {\n const hotState: HotState = {\n selfAccepted: false,\n selfDeclined: false,\n selfInvalidated: false,\n disposeHandlers: [],\n };\n\n const hot: Hot = {\n // TODO(alexkirsz) This is not defined in the HMR API. It was used to\n // decide whether to warn whenever an HMR-disposed module required other\n // modules. We might want to remove it.\n active: true,\n\n data: hotData ?? {},\n\n // TODO(alexkirsz) Support full (dep, callback, errorHandler) form.\n accept: (\n modules?: string | string[] | AcceptErrorHandler,\n _callback?: AcceptCallback,\n _errorHandler?: AcceptErrorHandler\n ) => {\n if (modules === undefined) {\n hotState.selfAccepted = true;\n } else if (typeof modules === \"function\") {\n hotState.selfAccepted = modules;\n } else {\n throw new Error(\"unsupported `accept` signature\");\n }\n },\n\n decline: (dep) => {\n if (dep === undefined) {\n hotState.selfDeclined = true;\n } else {\n throw new Error(\"unsupported `decline` signature\");\n }\n },\n\n dispose: (callback) => {\n hotState.disposeHandlers.push(callback);\n },\n\n addDisposeHandler: (callback) => {\n hotState.disposeHandlers.push(callback);\n },\n\n removeDisposeHandler: (callback) => {\n const idx = hotState.disposeHandlers.indexOf(callback);\n if (idx >= 0) {\n hotState.disposeHandlers.splice(idx, 1);\n }\n },\n\n invalidate: () => {\n hotState.selfInvalidated = true;\n queuedInvalidatedModules.add(moduleId);\n },\n\n // NOTE(alexkirsz) This is part of the management API, which we don't\n // implement, but the Next.js React Refresh runtime uses this to decide\n // whether to schedule an update.\n status: () => \"idle\",\n\n // NOTE(alexkirsz) Since we always return \"idle\" for now, these are no-ops.\n addStatusHandler: (_handler) => {},\n removeStatusHandler: (_handler) => {},\n\n // NOTE(jridgewell) Check returns the list of updated modules, but we don't\n // want the webpack code paths to ever update (the turbopack paths handle\n // this already).\n check: () => Promise.resolve(null),\n };\n\n return { hot, hotState };\n}\n\n/**\n * Adds a module to a chunk.\n */\nfunction addModuleToChunk(moduleId: ModuleId, chunkPath: ChunkPath) {\n let moduleChunks = moduleChunksMap.get(moduleId);\n if (!moduleChunks) {\n moduleChunks = new Set([chunkPath]);\n moduleChunksMap.set(moduleId, moduleChunks);\n } else {\n moduleChunks.add(chunkPath);\n }\n\n let chunkModules = chunkModulesMap.get(chunkPath);\n if (!chunkModules) {\n chunkModules = new Set([moduleId]);\n chunkModulesMap.set(chunkPath, chunkModules);\n } else {\n chunkModules.add(moduleId);\n }\n}\n\n/**\n * Returns the first chunk that included a module.\n * This is used by the Node.js backend, hence why it's marked as unused in this\n * file.\n */\nfunction getFirstModuleChunk(moduleId: ModuleId) {\n const moduleChunkPaths = moduleChunksMap.get(moduleId);\n if (moduleChunkPaths == null) {\n return null;\n }\n\n return moduleChunkPaths.values().next().value;\n}\n\n/**\n * Removes a module from a chunk.\n * Returns `true` if there are no remaining chunks including this module.\n */\nfunction removeModuleFromChunk(\n moduleId: ModuleId,\n chunkPath: ChunkPath\n): boolean {\n const moduleChunks = moduleChunksMap.get(moduleId)!;\n moduleChunks.delete(chunkPath);\n\n const chunkModules = chunkModulesMap.get(chunkPath)!;\n chunkModules.delete(moduleId);\n\n const noRemainingModules = chunkModules.size === 0;\n if (noRemainingModules) {\n chunkModulesMap.delete(chunkPath);\n }\n\n const noRemainingChunks = moduleChunks.size === 0;\n if (noRemainingChunks) {\n moduleChunksMap.delete(moduleId);\n }\n\n return noRemainingChunks;\n}\n\n/**\n * Disposes of a chunk list and its corresponding exclusive chunks.\n */\nfunction disposeChunkList(chunkListPath: ChunkPath): boolean {\n const chunkPaths = chunkListChunksMap.get(chunkListPath);\n if (chunkPaths == null) {\n return false;\n }\n chunkListChunksMap.delete(chunkListPath);\n\n for (const chunkPath of chunkPaths) {\n const chunkChunkLists = chunkChunkListsMap.get(chunkPath)!;\n chunkChunkLists.delete(chunkListPath);\n\n if (chunkChunkLists.size === 0) {\n chunkChunkListsMap.delete(chunkPath);\n disposeChunk(chunkPath);\n }\n }\n\n // We must also dispose of the chunk list's chunk itself to ensure it may\n // be reloaded properly in the future.\n BACKEND.unloadChunk?.(chunkListPath);\n\n return true;\n}\n\n/**\n * Disposes of a chunk and its corresponding exclusive modules.\n *\n * @returns Whether the chunk was disposed of.\n */\nfunction disposeChunk(chunkPath: ChunkPath): boolean {\n // This should happen whether the chunk has any modules in it or not.\n // For instance, CSS chunks have no modules in them, but they still need to be unloaded.\n BACKEND.unloadChunk?.(chunkPath);\n\n const chunkModules = chunkModulesMap.get(chunkPath);\n if (chunkModules == null) {\n return false;\n }\n chunkModules.delete(chunkPath);\n\n for (const moduleId of chunkModules) {\n const moduleChunks = moduleChunksMap.get(moduleId)!;\n moduleChunks.delete(chunkPath);\n\n const noRemainingChunks = moduleChunks.size === 0;\n if (noRemainingChunks) {\n moduleChunksMap.delete(moduleId);\n disposeModule(moduleId, \"clear\");\n availableModules.delete(moduleId);\n }\n }\n\n return true;\n}\n\n/**\n * Instantiates a runtime module.\n */\nfunction instantiateRuntimeModule(\n moduleId: ModuleId,\n chunkPath: ChunkPath\n): Module {\n return instantiateModule(moduleId, { type: SourceType.Runtime, chunkPath });\n}\n\n/**\n * Gets or instantiates a runtime module.\n */\nfunction getOrInstantiateRuntimeModule(\n moduleId: ModuleId,\n chunkPath: ChunkPath\n): Module {\n const module = moduleCache[moduleId];\n if (module) {\n if (module.error) {\n throw module.error;\n }\n return module;\n }\n\n return instantiateModule(moduleId, { type: SourceType.Runtime, chunkPath });\n}\n\n/**\n * Returns the URL relative to the origin where a chunk can be fetched from.\n */\nfunction getChunkRelativeUrl(chunkPath: ChunkPath): string {\n return `${CHUNK_BASE_PATH}${chunkPath\n .split(\"/\")\n .map((p) => encodeURIComponent(p))\n .join(\"/\")}`;\n}\n\n/**\n * Subscribes to chunk list updates from the update server and applies them.\n */\nfunction registerChunkList(\n chunkUpdateProvider: ChunkUpdateProvider,\n chunkList: ChunkList\n) {\n chunkUpdateProvider.push([\n chunkList.path,\n handleApply.bind(null, chunkList.path),\n ]);\n\n // Adding chunks to chunk lists and vice versa.\n const chunks = new Set(chunkList.chunks.map(getChunkPath));\n chunkListChunksMap.set(chunkList.path, chunks);\n for (const chunkPath of chunks) {\n let chunkChunkLists = chunkChunkListsMap.get(chunkPath);\n if (!chunkChunkLists) {\n chunkChunkLists = new Set([chunkList.path]);\n chunkChunkListsMap.set(chunkPath, chunkChunkLists);\n } else {\n chunkChunkLists.add(chunkList.path);\n }\n }\n\n if (chunkList.source === \"entry\") {\n markChunkListAsRuntime(chunkList.path);\n }\n}\n\n/**\n * Marks a chunk list as a runtime chunk list. There can be more than one\n * runtime chunk list. For instance, integration tests can have multiple chunk\n * groups loaded at runtime, each with its own chunk list.\n */\nfunction markChunkListAsRuntime(chunkListPath: ChunkPath) {\n runtimeChunkLists.add(chunkListPath);\n}\n\nfunction registerChunk([\n chunkPath,\n chunkModules,\n runtimeParams,\n]: ChunkRegistration) {\n for (const [moduleId, moduleFactory] of Object.entries(chunkModules)) {\n if (!moduleFactories[moduleId]) {\n moduleFactories[moduleId] = moduleFactory;\n }\n addModuleToChunk(moduleId, chunkPath);\n }\n\n return BACKEND.registerChunk(chunkPath, runtimeParams);\n}\n\nglobalThis.TURBOPACK_CHUNK_UPDATE_LISTENERS ??= [];\n\nconst chunkListsToRegister = globalThis.TURBOPACK_CHUNK_LISTS;\nif (Array.isArray(chunkListsToRegister)) {\n for (const chunkList of chunkListsToRegister) {\n registerChunkList(globalThis.TURBOPACK_CHUNK_UPDATE_LISTENERS, chunkList);\n }\n}\n\nglobalThis.TURBOPACK_CHUNK_LISTS = {\n push: (chunkList) => {\n registerChunkList(globalThis.TURBOPACK_CHUNK_UPDATE_LISTENERS!, chunkList);\n },\n} satisfies ChunkListProvider;\n"],"names":[],"mappings":"AAAA;;;;;;CAMC,GAED,oDAAoD,GAEpD,4DAA4D;AAC5D,uCAAuC;AACvC,wCAAwC;AACxC,0CAA0C;AAE1C,yEAAyE;AACzE,4EAA4E;AAC5E,wDAAwD;;UAqDnD;IACH;;;GAGC;IAED;;GAEC;IAED;;;GAGC;GAbE,eAAA;AAwCL,MAAM,yBAAyB;IAC7B,OAAO,mBAAmB;IAE1B,gBAA0B;IAE1B,YAAY,OAAe,EAAE,eAAyB,CAAE;QACtD,KAAK,CAAC;QACN,IAAI,CAAC,eAAe,GAAG;IACzB;AACF;AAEA,MAAM,kBAAmC,OAAO,MAAM,CAAC;AACvD,MAAM,cAA2B,OAAO,MAAM,CAAC;AAC/C;;;CAGC,GACD,MAAM,gBAAwC,IAAI;AAClD;;CAEC,GACD,MAAM,iBAAwC,IAAI;AAClD;;CAEC,GACD,MAAM,2BAA0C,IAAI;AACpD;;CAEC,GACD,MAAM,iBAAgC,IAAI;AAC1C;;;;;;CAMC,GACD,MAAM,kBAAiD,IAAI;AAC3D;;CAEC,GACD,MAAM,kBAAiD,IAAI;AAC3D;;;;CAIC,GACD,MAAM,oBAAoC,IAAI;AAC9C;;CAEC,GACD,MAAM,qBAAqD,IAAI;AAC/D;;CAEC,GACD,MAAM,qBAAqD,IAAI;AAE/D,MAAM,mBAAuD,IAAI;AAEjE,MAAM,wBAA6D,IAAI;AAEvE,eAAe,UACb,MAAkB,EAClB,SAAoB;IAEpB,IAAI,OAAO,cAAc,UAAU;QACjC,OAAO,cAAc,QAAQ;IAC/B;IAEA,MAAM,eAAe,UAAU,QAAQ,IAAI,EAAE;IAC7C,MAAM,kBAAkB,aAAa,GAAG,CAAC,CAAC;QACxC,IAAI,eAAe,CAAC,SAAS,EAAE,OAAO;QACtC,OAA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AAM,CAAC;QACL,kBAAkB,WAAW,gCAAgC,EAAG;IAClE;AACF"}}, - {"offset": {"line": 1383, "column": 0}, "map": {"version":3,"sources":["turbopack://[turbopack]/browser/dev/runtime/dom/runtime-backend-dom.ts"],"sourcesContent":["/**\n * This file contains the runtime code specific to the Turbopack development\n * ECMAScript DOM runtime.\n *\n * It will be appended to the base development runtime code.\n */\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n/// \n\ntype ChunkResolver = {\n resolved: boolean;\n resolve: () => void;\n reject: (error?: Error) => void;\n promise: Promise;\n};\n\nlet BACKEND: RuntimeBackend;\n\nfunction augmentContext(context: TurbopackDevBaseContext): TurbopackDevContext {\n return context;\n}\n\nfunction fetchWebAssembly(wasmChunkPath: ChunkPath) {\n return fetch(getChunkRelativeUrl(wasmChunkPath));\n}\n\nasync function loadWebAssembly(\n _source: SourceInfo,\n wasmChunkPath: ChunkPath,\n importsObj: WebAssembly.Imports\n): Promise {\n const req = fetchWebAssembly(wasmChunkPath);\n\n const { instance } = await WebAssembly.instantiateStreaming(req, importsObj);\n\n return instance.exports;\n}\n\nasync function loadWebAssemblyModule(\n _source: SourceInfo,\n wasmChunkPath: ChunkPath\n): Promise {\n const req = fetchWebAssembly(wasmChunkPath);\n\n return await WebAssembly.compileStreaming(req);\n}\n\n(() => {\n BACKEND = {\n async registerChunk(chunkPath, params) {\n const resolver = getOrCreateResolver(chunkPath);\n resolver.resolve();\n\n if (params == null) {\n return;\n }\n\n for (const otherChunkData of params.otherChunks) {\n const otherChunkPath = getChunkPath(otherChunkData);\n // Chunk might have started loading, so we want to avoid triggering another load.\n getOrCreateResolver(otherChunkPath);\n }\n\n // This waits for chunks to be loaded, but also marks included items as available.\n await Promise.all(\n params.otherChunks.map((otherChunkData) =>\n loadChunk({ type: SourceType.Runtime, chunkPath }, otherChunkData)\n )\n );\n\n if (params.runtimeModuleIds.length > 0) {\n for (const moduleId of params.runtimeModuleIds) {\n getOrInstantiateRuntimeModule(moduleId, chunkPath);\n }\n }\n },\n\n loadChunk(chunkPath, source) {\n return doLoadChunk(chunkPath, source);\n },\n\n unloadChunk(chunkPath) {\n deleteResolver(chunkPath);\n\n const chunkUrl = getChunkRelativeUrl(chunkPath);\n // TODO(PACK-2140): remove this once all filenames are guaranteed to be escaped.\n const decodedChunkUrl = decodeURI(chunkUrl);\n\n if (chunkPath.endsWith(\".css\")) {\n const links = document.querySelectorAll(\n `link[href=\"${chunkUrl}\"],link[href^=\"${chunkUrl}?\"],link[href=\"${decodedChunkUrl}\"],link[href^=\"${decodedChunkUrl}?\"]`\n );\n for (const link of Array.from(links)) {\n link.remove();\n }\n } else if (chunkPath.endsWith(\".js\")) {\n // Unloading a JS chunk would have no effect, as it lives in the JS\n // runtime once evaluated.\n // However, we still want to remove the script tag from the DOM to keep\n // the HTML somewhat consistent from the user's perspective.\n const scripts = document.querySelectorAll(\n `script[src=\"${chunkUrl}\"],script[src^=\"${chunkUrl}?\"],script[src=\"${decodedChunkUrl}\"],script[src^=\"${decodedChunkUrl}?\"]`\n );\n for (const script of Array.from(scripts)) {\n script.remove();\n }\n } else {\n throw new Error(`can't infer type of chunk from path ${chunkPath}`);\n }\n },\n\n reloadChunk(chunkPath) {\n return new Promise((resolve, reject) => {\n if (!chunkPath.endsWith(\".css\")) {\n reject(new Error(\"The DOM backend can only reload CSS chunks\"));\n return;\n }\n\n const chunkUrl = getChunkRelativeUrl(chunkPath);\n const decodedChunkUrl = decodeURI(chunkUrl);\n\n const previousLinks = document.querySelectorAll(\n `link[rel=stylesheet][href=\"${chunkUrl}\"],link[rel=stylesheet][href^=\"${chunkUrl}?\"],link[rel=stylesheet][href=\"${decodedChunkUrl}\"],link[rel=stylesheet][href^=\"${decodedChunkUrl}?\"]`\n );\n\n if (previousLinks.length === 0) {\n reject(new Error(`No link element found for chunk ${chunkPath}`));\n return;\n }\n\n const link = document.createElement(\"link\");\n link.rel = \"stylesheet\";\n\n if (navigator.userAgent.includes(\"Firefox\")) {\n // Firefox won't reload CSS files that were previously loaded on the current page,\n // we need to add a query param to make sure CSS is actually reloaded from the server.\n //\n // I believe this is this issue: https://bugzilla.mozilla.org/show_bug.cgi?id=1037506\n //\n // Safari has a similar issue, but only if you have a `` tag\n // pointing to the same URL as the stylesheet: https://bugs.webkit.org/show_bug.cgi?id=187726\n link.href = `${chunkUrl}?ts=${Date.now()}`;\n } else {\n link.href = chunkUrl;\n }\n\n link.onerror = () => {\n reject();\n };\n link.onload = () => {\n // First load the new CSS, then remove the old ones. This prevents visible\n // flickering that would happen in-between removing the previous CSS and\n // loading the new one.\n for (const previousLink of Array.from(previousLinks))\n previousLink.remove();\n\n // CSS chunks do not register themselves, and as such must be marked as\n // loaded instantly.\n resolve();\n };\n\n // Make sure to insert the new CSS right after the previous one, so that\n // its precedence is higher.\n previousLinks[0].parentElement!.insertBefore(\n link,\n previousLinks[0].nextSibling\n );\n });\n },\n\n restart: () => self.location.reload(),\n };\n\n /**\n * Maps chunk paths to the corresponding resolver.\n */\n const chunkResolvers: Map = new Map();\n\n function getOrCreateResolver(chunkPath: ChunkPath): ChunkResolver {\n let resolver = chunkResolvers.get(chunkPath);\n if (!resolver) {\n let resolve: () => void;\n let reject: (error?: Error) => void;\n const promise = new Promise((innerResolve, innerReject) => {\n resolve = innerResolve;\n reject = innerReject;\n });\n resolver = {\n resolved: false,\n promise,\n resolve: () => {\n resolver!.resolved = true;\n resolve();\n },\n reject: reject!,\n };\n chunkResolvers.set(chunkPath, resolver);\n }\n return resolver;\n }\n\n function deleteResolver(chunkPath: ChunkPath) {\n chunkResolvers.delete(chunkPath);\n }\n\n /**\n * Loads the given chunk, and returns a promise that resolves once the chunk\n * has been loaded.\n */\n async function doLoadChunk(chunkPath: ChunkPath, source: SourceInfo) {\n const resolver = getOrCreateResolver(chunkPath);\n if (resolver.resolved) {\n return resolver.promise;\n }\n\n if (source.type === SourceType.Runtime) {\n // We don't need to load chunks references from runtime code, as they're already\n // present in the DOM.\n\n if (chunkPath.endsWith(\".css\")) {\n // CSS chunks do not register themselves, and as such must be marked as\n // loaded instantly.\n resolver.resolve();\n }\n\n // We need to wait for JS chunks to register themselves within `registerChunk`\n // before we can start instantiating runtime modules, hence the absence of\n // `resolver.resolve()` in this branch.\n\n return resolver.promise;\n }\n\n const chunkUrl = getChunkRelativeUrl(chunkPath);\n const decodedChunkUrl = decodeURI(chunkUrl);\n\n if (typeof importScripts === \"function\") {\n // We're in a web worker\n if (chunkPath.endsWith(\".css\")) {\n // ignore\n } else if (chunkPath.endsWith(\".js\")) {\n importScripts(TURBOPACK_WORKER_LOCATION + chunkUrl);\n } else {\n throw new Error(`can't infer type of chunk from path ${chunkPath} in worker`);\n }\n } else {\n if (chunkPath.endsWith(\".css\")) {\n const previousLinks = document.querySelectorAll(\n `link[rel=stylesheet][href=\"${chunkUrl}\"],link[rel=stylesheet][href^=\"${chunkUrl}?\"],link[rel=stylesheet][href=\"${decodedChunkUrl}\"],link[rel=stylesheet][href^=\"${decodedChunkUrl}?\"]`\n );\n if (previousLinks.length > 0) {\n // CSS chunks do not register themselves, and as such must be marked as\n // loaded instantly.\n resolver.resolve();\n } else {\n const link = document.createElement(\"link\");\n link.rel = \"stylesheet\";\n link.href = chunkUrl;\n link.onerror = () => {\n resolver.reject();\n };\n link.onload = () => {\n // CSS chunks do not register themselves, and as such must be marked as\n // loaded instantly.\n resolver.resolve();\n };\n document.body.appendChild(link);\n }\n } else if (chunkPath.endsWith(\".js\")) {\n const previousScripts = document.querySelectorAll(\n `script[src=\"${chunkUrl}\"],script[src^=\"${chunkUrl}?\"],script[src=\"${decodedChunkUrl}\"],script[src^=\"${decodedChunkUrl}?\"]`\n );\n if (previousScripts.length > 0) {\n // There is this edge where the script already failed loading, but we\n // can't detect that. The Promise will never resolve in this case.\n for (const script of Array.from(previousScripts)) {\n script.addEventListener(\"error\", () => {\n resolver.reject();\n });\n }\n } else {\n const script = document.createElement(\"script\");\n script.src = chunkUrl;\n // We'll only mark the chunk as loaded once the script has been executed,\n // which happens in `registerChunk`. Hence the absence of `resolve()` in\n // this branch.\n script.onerror = () => {\n resolver.reject();\n };\n document.body.appendChild(script);\n }\n } else {\n throw new Error(`can't infer type of chunk from path ${chunkPath}`);\n }\n }\n\n return resolver.promise;\n }\n})();\n\nfunction _eval({ code, url, map }: EcmascriptModuleEntry): ModuleFactory {\n code += `\\n\\n//# sourceURL=${encodeURI(\n location.origin + CHUNK_BASE_PATH + url\n )}`;\n if (map) {\n code += `\\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,${btoa(\n // btoa doesn't handle nonlatin characters, so escape them as \\x sequences\n // See https://stackoverflow.com/a/26603875\n unescape(encodeURIComponent(map))\n )}`;\n }\n\n // eslint-disable-next-line no-eval\n return eval(code);\n}\n"],"names":[],"mappings":"AAAA;;;;;CAKC,GAED,oDAAoD,GAEpD,gDAAgD;AAChD,6DAA6D;AAS7D,IAAI;AAEJ,SAAS,eAAe,OAAgC;IACtD,OAAO;AACT;AAEA,SAAS,iBAAiB,aAAwB;IAChD,OAAO,MAAM,oBAAoB;AACnC;AAEA,eAAe,gBACb,OAAmB,EACnB,aAAwB,EACxB,UAA+B;IAE/B,MAAM,MAAM,iBAAiB;IAE7B,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,YAAY,oBAAoB,CAAC,KAAK;IAEjE,OAAO,SAAS,OAAO;AACzB;AAEA,eAAe,sBACb,OAAmB,EACnB,aAAwB;IAExB,MAAM,MAAM,iBAAiB;IAE7B,OAAO,MAAM,YAAY,gBAAgB,CAAC;AAC5C;AAEA,CAAC;IACC,UAAU;QACR,MAAM,eAAc,SAAS,EAAE,MAAM;YACnC,MAAM,WAAW,oBAAoB;YACrC,SAAS,OAAO;YAEhB,IAAI,UAAU,MAAM;gBAClB;YACF;YAEA,KAAK,MAAM,kBAAkB,OAAO,WAAW,CAAE;gBAC/C,MAAM,iBAAiB,aAAa;gBACpC,iFAAiF;gBACjF,oBAAoB;YACtB;YAEA,kFAAkF;YAClF,MAAM,QAAQ,GAAG,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KAAK;AACd"}}, - {"offset": {"line": 1621, "column": 0}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}}] + {"offset": {"line": 13, "column": 0}, "map": {"version":3,"sources":["turbopack://[turbopack]/shared/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\ntype EsmNamespaceObject = Record;\n\n// @ts-ignore Defined in `dev-base.ts`\ndeclare function getOrInstantiateModuleFromParent(\n id: ModuleId,\n sourceModule: M\n): M;\n\nconst REEXPORTED_OBJECTS = Symbol(\"reexported objects\");\n\ntype ModuleContextMap = Record;\n\ninterface ModuleContextEntry {\n id: () => ModuleId;\n module: () => any;\n}\n\ninterface ModuleContext {\n // require call\n (moduleId: ModuleId): Exports | EsmNamespaceObject;\n\n // async import call\n import(moduleId: ModuleId): Promise;\n\n keys(): ModuleId[];\n\n resolve(moduleId: ModuleId): ModuleId;\n}\n\ntype GetOrInstantiateModuleFromParent = (\n moduleId: ModuleId,\n parentModule: M\n) => M;\n\ndeclare function getOrInstantiateRuntimeModule(moduleId: ModuleId, chunkPath: ChunkPath): 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))\n Object.defineProperty(obj, name, options);\n}\n\n/**\n * Adds the getters to the exports object.\n */\nfunction esm(\n exports: Exports,\n getters: Record any) | [() => any, (v: any) => void]>\n) {\n defineProp(exports, \"__esModule\", { value: true });\n if (toStringTag) defineProp(exports, toStringTag, { value: \"Module\" });\n for (const key in getters) {\n const item = getters[key];\n if (Array.isArray(item)) {\n defineProp(exports, key, {\n get: item[0],\n set: item[1],\n enumerable: true,\n });\n } else {\n defineProp(exports, key, { get: item, enumerable: true });\n }\n }\n Object.seal(exports);\n}\n\n/**\n * Makes the module an ESM with exports\n */\nfunction esmExport(\n module: Module,\n exports: Exports,\n getters: Record any>\n) {\n module.namespaceObject = module.exports;\n esm(exports, getters);\n}\n\nfunction ensureDynamicExports(module: Module, exports: Exports) {\n let reexportedObjects = module[REEXPORTED_OBJECTS];\n\n if (!reexportedObjects) {\n reexportedObjects = module[REEXPORTED_OBJECTS] = [];\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 for (const obj of reexportedObjects!) {\n const value = Reflect.get(obj, prop);\n if (value !== undefined) return value;\n }\n return undefined;\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 });\n }\n}\n\n/**\n * Dynamically exports properties from an object\n */\nfunction dynamicExport(\n module: Module,\n exports: Exports,\n object: Record\n) {\n ensureDynamicExports(module, exports);\n\n if (typeof object === \"object\" && object !== null) {\n module[REEXPORTED_OBJECTS]!.push(object);\n }\n}\n\nfunction exportValue(module: Module, value: any) {\n module.exports = value;\n}\n\nfunction exportNamespace(module: Module, namespace: any) {\n module.exports = module.namespaceObject = namespace;\n}\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 getters: { [s: string]: () => any } = Object.create(null);\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 getters[key] = createGetter(raw, key);\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 && \"default\" in getters)) {\n getters[\"default\"] = () => raw;\n }\n\n esm(ns, getters);\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 sourceModule: Module,\n id: ModuleId\n): Exclude {\n const module = getOrInstantiateModuleFromParent(id, sourceModule);\n if (module.error) throw module.error;\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}\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 };\n\nfunction commonJsRequire(sourceModule: Module, id: ModuleId): Exports {\n const module = getOrInstantiateModuleFromParent(id, sourceModule);\n if (module.error) throw module.error;\n return module.exports;\n}\n\n/**\n * `require.context` and require/import expression runtime.\n */\nfunction moduleContext(map: ModuleContextMap): ModuleContext {\n function moduleContext(id: ModuleId): Exports {\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 = (): ModuleId[] => {\n return Object.keys(map);\n };\n\n moduleContext.resolve = (id: ModuleId): ModuleId => {\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: ModuleId) => {\n return await (moduleContext(id) as Promise);\n };\n\n return moduleContext;\n}\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\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\n// everything below is adapted from webpack\n// https://github.com/webpack/webpack/blob/6be4065ade1e252c1d8dcba4af0f43e32af1bdc1/lib/runtime/AsyncModuleRuntimeModule.js#L13\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\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\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 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 module: Module,\n body: (\n handleAsyncDependencies: (\n deps: Dep[]\n ) => Exports[] | Promise<() => Exports[]>,\n asyncResult: (err?: any) => void\n ) => void,\n hasAwait: boolean\n) {\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}\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};\n\nrelativeURL.prototype = URL.prototype;\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 * 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}\n"],"names":[],"mappings":"AAAA;;;;;CAKC,GAED,oDAAoD,GAEpD,6CAA6C;AAU7C,MAAM,qBAAqB,OAAO;AA4BlC,MAAM,iBAAiB,OAAO,SAAS,CAAC,cAAc;AACtD,MAAM,cAAc,OAAO,WAAW,eAAe,OAAO,WAAW;AAEvE,SAAS,WACP,GAAQ,EACR,IAAiB,EACjB,OAA2C;IAE3C,IAAI,CAAC,eAAe,IAAI,CAAC,KAAK,OAC5B,OAAO,cAAc,CAAC,KAAK,MAAM;AACrC;AAEA;;CAEC,GACD,SAAS,IACP,OAAgB,EAChB,OAAoE;IAEpE,WAAW,SAAS,cAAc;QAAE,OAAO;IAAK;IAChD,IAAI,aAAa,WAAW,SAAS,aAAa;QAAE,OAAO;IAAS;IACpE,IAAK,MAAM,OAAO,QAAS;QACzB,MAAM,OAAO,OAAO,CAAC,IAAI;QACzB,IAAI,MAAM,OAAO,CAAC,OAAO;YACvB,WAAW,SAAS,KAAK;gBACvB,KAAK,IAAI,CAAC,EAAE;gBACZ,KAAK,IAAI,CAAC,EAAE;gBACZ,YAAY;YACd;QACF,OAAO;YACL,WAAW,SAAS,KAAK;gBAAE,KAAK;gBAAM,YAAY;YAAK;QACzD;IACF;IACA,OAAO,IAAI,CAAC;AACd;AAEA;;CAEC,GACD,SAAS,UACP,MAAc,EACd,OAAgB,EAChB,OAAkC;IAElC,OAAO,eAAe,GAAG,OAAO,OAAO;IACvC,IAAI,SAAS;AACf;AAEA,SAAS,qBAAqB,MAAc,EAAE,OAAgB;IAC5D,IAAI,oBAAoB,MAAM,CAAC,mBAAmB;IAElD,IAAI,CAAC,mBAAmB;QACtB,oBAAoB,MAAM,CAAC,mBAAmB,GAAG,EAAE;QACnD,OAAO,OAAO,GAAG,OAAO,eAAe,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AAI;IAC9D,OAAO,IAAI,GAAG;IACd,OAAO,QAAQ,GAAG,SAAS,OAAO,CAAC,UAAU;IAC7C,OAAO,MAAM,GAAG,OAAO,QAAQ,GAAG;IAClC,OAAO,QAAQ,GAAG,OAAO,MAAM,GAAG,CAAC,GAAG,QAAsB;IAC5D,IAAK,MAAM,OAAO,OAChB,OAAO,cAAc,CAAC,IAAI,EAAE,KAAK;QAC/B,YAAY;QACZ,cAAc;QACd,OAAO,MAAM,CAAC,IAAI;IACpB;AACJ;AAEA,YAAY,SAAS,GAAG,IAAI,SAAS;AAErC;;CAEC,GACD,SAAS,UAAU,KAAY,EAAE,cAAoC;IACnE,MAAM,IAAI,MAAM,CAAC,WAAW,EAAE,eAAe,OAAO,CAAC;AACvD;AAEA;;CAEC,GACD,SAAS,YAAY,SAAmB;IACtC,MAAM,IAAI,MAAM;AAClB"}}, + {"offset": {"line": 348, "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 *development* 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\ndeclare var TURBOPACK_WORKER_LOCATION: string;\ndeclare var CHUNK_BASE_PATH: string;\ndeclare function instantiateModule(id: ModuleId, source: SourceInfo): Module;\n\ntype RuntimeParams = {\n otherChunks: ChunkData[];\n runtimeModuleIds: ModuleId[];\n};\n\ntype ChunkRegistration = [\n chunkPath: ChunkPath,\n chunkModules: ModuleFactories,\n params: RuntimeParams | undefined\n];\n\ntype ChunkList = {\n path: ChunkPath;\n chunks: ChunkData[];\n source: \"entry\" | \"dynamic\";\n};\n\nenum SourceType {\n /**\n * The module was instantiated because it was included in an evaluated chunk's\n * runtime.\n */\n Runtime = 0,\n /**\n * The module was instantiated because a parent module imported it.\n */\n Parent = 1,\n /**\n * The module was instantiated because it was included in a chunk's hot module\n * update.\n */\n Update = 2,\n}\n\ntype SourceInfo =\n | {\n type: SourceType.Runtime;\n chunkPath: ChunkPath;\n }\n | {\n type: SourceType.Parent;\n parentId: ModuleId;\n }\n | {\n type: SourceType.Update;\n parents?: ModuleId[];\n };\n\ninterface RuntimeBackend {\n registerChunk: (chunkPath: ChunkPath, params?: RuntimeParams) => void;\n loadChunk: (chunkPath: ChunkPath, source: SourceInfo) => Promise;\n}\n\ninterface DevRuntimeBackend {\n reloadChunk?: (chunkPath: ChunkPath) => Promise;\n unloadChunk?: (chunkPath: ChunkPath) => void;\n restart: () => void;\n}\n\nconst moduleFactories: ModuleFactories = Object.create(null);\n/**\n * Module IDs that are instantiated as part of the runtime of a chunk.\n */\nconst runtimeModules: Set = new Set();\n/**\n * Map from module ID to the chunks that contain this module.\n *\n * In HMR, we need to keep track of which modules are contained in which so\n * chunks. This is so we don't eagerly dispose of a module when it is removed\n * from chunk A, but still exists in chunk B.\n */\nconst moduleChunksMap: Map> = new Map();\n/**\n * Map from a chunk path to all modules it contains.\n */\nconst chunkModulesMap: Map> = new Map();\n/**\n * Chunk lists that contain a runtime. When these chunk lists receive an update\n * that can't be reconciled with the current state of the page, we need to\n * reload the runtime entirely.\n */\nconst runtimeChunkLists: Set = new Set();\n/**\n * Map from a chunk list to the chunk paths it contains.\n */\nconst chunkListChunksMap: Map> = new Map();\n/**\n * Map from a chunk path to the chunk lists it belongs to.\n */\nconst chunkChunkListsMap: Map> = new Map();\n\nconst availableModules: Map | true> = new Map();\n\nconst availableModuleChunks: Map | true> = new Map();\n\nasync function loadChunk(\n source: SourceInfo,\n chunkData: ChunkData\n): Promise {\n if (typeof chunkData === \"string\") {\n return loadChunkPath(source, chunkData);\n }\n\n const includedList = chunkData.included || [];\n const modulesPromises = includedList.map((included) => {\n if (moduleFactories[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 return Promise.all(modulesPromises);\n }\n\n const includedModuleChunksList = chunkData.moduleChunks || [];\n const moduleChunksPromises = includedModuleChunksList\n .map((included) => {\n // TODO(alexkirsz) Do we need this check?\n // if (moduleFactories[included]) return true;\n return availableModuleChunks.get(included);\n })\n .filter((p) => p);\n\n let promise;\n if (moduleChunksPromises.length > 0) {\n // Some module chunks are already loaded or loading.\n\n if (moduleChunksPromises.length === includedModuleChunksList.length) {\n // When all included module chunks are already loaded or loading, we can skip loading ourselves\n return Promise.all(moduleChunksPromises);\n }\n\n const moduleChunksToLoad: Set = new Set();\n for (const moduleChunk of includedModuleChunksList) {\n if (!availableModuleChunks.has(moduleChunk)) {\n moduleChunksToLoad.add(moduleChunk);\n }\n }\n\n for (const moduleChunkToLoad of moduleChunksToLoad) {\n const promise = loadChunkPath(source, moduleChunkToLoad);\n\n availableModuleChunks.set(moduleChunkToLoad, promise);\n\n moduleChunksPromises.push(promise);\n }\n\n promise = Promise.all(moduleChunksPromises);\n } else {\n promise = loadChunkPath(source, chunkData.path);\n\n // Mark all included module chunks as loading if they are not already loaded or loading.\n for (const includedModuleChunk of includedModuleChunksList) {\n if (!availableModuleChunks.has(includedModuleChunk)) {\n availableModuleChunks.set(includedModuleChunk, promise);\n }\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 return promise;\n}\n\nasync function loadChunkPath(\n source: SourceInfo,\n chunkPath: ChunkPath\n): Promise {\n try {\n await BACKEND.loadChunk(chunkPath, source);\n } catch (error) {\n let loadReason;\n switch (source.type) {\n case SourceType.Runtime:\n loadReason = `as a runtime dependency of chunk ${source.chunkPath}`;\n break;\n case SourceType.Parent:\n loadReason = `from module ${source.parentId}`;\n break;\n case SourceType.Update:\n loadReason = \"from an HMR update\";\n break;\n default:\n invariant(source, (source) => `Unknown source type: ${source?.type}`);\n }\n throw new Error(\n `Failed to load chunk ${chunkPath} ${loadReason}${\n error ? `: ${error}` : \"\"\n }`,\n error\n ? {\n cause: error,\n }\n : undefined\n );\n }\n}\n\n/**\n * Returns an absolute url to an asset.\n */\nfunction createResolvePathFromModule(\n resolver: (moduleId: string) => Exports\n): (moduleId: string) => string {\n return function resolvePathFromModule(moduleId: string): string {\n const exported = resolver(moduleId);\n return exported?.default ?? exported;\n };\n}\n\n/**\n * no-op for browser\n * @param modulePath\n */\nfunction resolveAbsolutePath(modulePath?: string): string {\n return `/ROOT/${modulePath ?? \"\"}`;\n}\n\nfunction getWorkerBlobURL(chunks: ChunkPath[]): string {\n let bootstrap = `TURBOPACK_WORKER_LOCATION = ${JSON.stringify(location.origin)};importScripts(${chunks.map(c => (`TURBOPACK_WORKER_LOCATION + ${JSON.stringify(getChunkRelativeUrl(c))}`)).join(\", \")});`;\n let blob = new Blob([bootstrap], { type: \"text/javascript\" });\n return URL.createObjectURL(blob);\n}\n\n/**\n * Adds a module to a chunk.\n */\nfunction addModuleToChunk(moduleId: ModuleId, chunkPath: ChunkPath) {\n let moduleChunks = moduleChunksMap.get(moduleId);\n if (!moduleChunks) {\n moduleChunks = new Set([chunkPath]);\n moduleChunksMap.set(moduleId, moduleChunks);\n } else {\n moduleChunks.add(chunkPath);\n }\n\n let chunkModules = chunkModulesMap.get(chunkPath);\n if (!chunkModules) {\n chunkModules = new Set([moduleId]);\n chunkModulesMap.set(chunkPath, chunkModules);\n } else {\n chunkModules.add(moduleId);\n }\n}\n\n/**\n * Returns the first chunk that included a module.\n * This is used by the Node.js backend, hence why it's marked as unused in this\n * file.\n */\nfunction getFirstModuleChunk(moduleId: ModuleId) {\n const moduleChunkPaths = moduleChunksMap.get(moduleId);\n if (moduleChunkPaths == null) {\n return null;\n }\n\n return moduleChunkPaths.values().next().value;\n}\n\n/**\n * Instantiates a runtime module.\n */\nfunction instantiateRuntimeModule(\n moduleId: ModuleId,\n chunkPath: ChunkPath\n): Module {\n return instantiateModule(moduleId, { type: SourceType.Runtime, chunkPath });\n}\n\n/**\n * Returns the URL relative to the origin where a chunk can be fetched from.\n */\nfunction getChunkRelativeUrl(chunkPath: ChunkPath): string {\n return `${CHUNK_BASE_PATH}${chunkPath\n .split(\"/\")\n .map((p) => encodeURIComponent(p))\n .join(\"/\")}`;\n}\n\n/**\n * Marks a chunk list as a runtime chunk list. There can be more than one\n * runtime chunk list. For instance, integration tests can have multiple chunk\n * groups loaded at runtime, each with its own chunk list.\n */\nfunction markChunkListAsRuntime(chunkListPath: ChunkPath) {\n runtimeChunkLists.add(chunkListPath);\n}\n\nfunction registerChunk([\n chunkPath,\n chunkModules,\n runtimeParams,\n]: ChunkRegistration) {\n for (const [moduleId, moduleFactory] of Object.entries(chunkModules)) {\n if (!moduleFactories[moduleId]) {\n moduleFactories[moduleId] = moduleFactory;\n }\n addModuleToChunk(moduleId, chunkPath);\n }\n\n return BACKEND.registerChunk(chunkPath, runtimeParams);\n}\n"],"names":[],"mappings":"AAAA;;;;;;CAMC,GAED,oDAAoD,GAEpD,6CAA6C;AAC7C,yDAAyD;;UAuBpD;IACH;;;GAGC;IAED;;GAEC;IAED;;;GAGC;GAbE,eAAA;AA0CL,MAAM,kBAAmC,OAAO,MAAM,CAAC;AACvD;;CAEC,GACD,MAAM,iBAAgC,IAAI;AAC1C;;;;;;CAMC,GACD,MAAM,kBAAiD,IAAI;AAC3D;;CAEC,GACD,MAAM,kBAAiD,IAAI;AAC3D;;;;CAIC,GACD,MAAM,oBAAoC,IAAI;AAC9C;;CAEC,GACD,MAAM,qBAAqD,IAAI;AAC/D;;CAEC,GACD,MAAM,qBAAqD,IAAI;AAE/D,MAAM,mBAAuD,IAAI;AAEjE,MAAM,wBAA6D,IAAI;AAEvE,eAAe,UACb,MAAkB,EAClB,SAAoB;IAEpB,IAAI,OAAO,cAAc,UAAU;QACjC,OAAO,cAAc,QAAQ;IAC/B;IAEA,MAAM,eAAe,UAAU,QAAQ,IAAI,EAAE;IAC7C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dev-base.ts"],"sourcesContent":["/// \n/// \n/// \n\n/**\n * This file contains runtime types and functions that are shared between all\n * Turbopack *development* 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\nconst devModuleCache: ModuleCache = Object.create(null);\n\n// This file must not use `import` and `export` statements. Otherwise, it\n// becomes impossible to augment interfaces declared in ``d files\n// (e.g. `Module`). Hence, the need for `import()` here.\ntype RefreshRuntimeGlobals =\n import(\"@next/react-refresh-utils/dist/runtime\").RefreshRuntimeGlobals;\n\n// Workers are loaded via blob object urls and aren't relative to the main context, this gets\n// prefixed to chunk urls in the worker.\n// declare var TURBOPACK_WORKER_LOCATION: string;\n// declare var CHUNK_BASE_PATH: string;\ndeclare var $RefreshHelpers$: RefreshRuntimeGlobals[\"$RefreshHelpers$\"];\ndeclare var $RefreshReg$: RefreshRuntimeGlobals[\"$RefreshReg$\"];\ndeclare var $RefreshSig$: RefreshRuntimeGlobals[\"$RefreshSig$\"];\ndeclare var $RefreshInterceptModuleExecution$:\n | RefreshRuntimeGlobals[\"$RefreshInterceptModuleExecution$\"];\n\ntype RefreshContext = {\n register: RefreshRuntimeGlobals[\"$RefreshReg$\"];\n signature: RefreshRuntimeGlobals[\"$RefreshSig$\"];\n registerExports: typeof registerExportsAndSetupBoundaryForReactRefresh;\n};\n\ntype RefreshHelpers = RefreshRuntimeGlobals[\"$RefreshHelpers$\"];\n\ninterface TurbopackDevBaseContext extends TurbopackBaseContext {\n k: RefreshContext;\n R: ResolvePathFromModule;\n}\n\ninterface TurbopackDevContext extends TurbopackDevBaseContext {}\n\ntype ModuleFactory = (\n this: Module[\"exports\"],\n context: TurbopackDevBaseContext\n) => undefined\n\ninterface DevRuntimeBackend {\n reloadChunk?: (chunkPath: ChunkPath) => Promise;\n unloadChunk?: (chunkPath: ChunkPath) => void;\n restart: () => void;\n}\n\nclass UpdateApplyError extends Error {\n name = \"UpdateApplyError\";\n\n dependencyChain: string[];\n\n constructor(message: string, dependencyChain: string[]) {\n super(message);\n this.dependencyChain = dependencyChain;\n }\n}\n\n/**\n * Maps module IDs to persisted data between executions of their hot module\n * implementation (`hot.data`).\n */\nconst moduleHotData: Map = new Map();\n/**\n * Maps module instances to their hot module state.\n */\nconst moduleHotState: Map = new Map();\n/**\n * Modules that call `module.hot.invalidate()` (while being updated).\n */\nconst queuedInvalidatedModules: Set = new Set();\n\n/**\n * Gets or instantiates a runtime module.\n */\n// @ts-ignore\nfunction getOrInstantiateRuntimeModule(\n moduleId: ModuleId,\n chunkPath: ChunkPath,\n): Module {\n const module = devModuleCache[moduleId];\n if (module) {\n if (module.error) {\n throw module.error;\n }\n return module;\n }\n\n // @ts-ignore\n return instantiateModule(moduleId, { type: SourceType.Runtime, chunkPath });\n}\n\n/**\n * Retrieves a module from the cache, or instantiate it if it is not cached.\n */\n// @ts-ignore Defined in `runtime-utils.ts`\nconst getOrInstantiateModuleFromParent: GetOrInstantiateModuleFromParent = (\n id,\n sourceModule,\n) => {\n if (!sourceModule.hot.active) {\n console.warn(\n `Unexpected import of module ${id} from module ${sourceModule.id}, which was deleted by an HMR update`\n );\n }\n\n const module = devModuleCache[id];\n\n if (sourceModule.children.indexOf(id) === -1) {\n sourceModule.children.push(id);\n }\n\n if (module) {\n if (module.parents.indexOf(sourceModule.id) === -1) {\n module.parents.push(sourceModule.id);\n }\n\n return module;\n }\n\n return instantiateModule(id, {\n type: SourceType.Parent,\n parentId: sourceModule.id,\n });\n};\n\n// @ts-ignore Defined in `runtime-base.ts`\nfunction instantiateModule(id: ModuleId, source: SourceInfo): Module {\n const moduleFactory = moduleFactories[id];\n if (typeof moduleFactory !== \"function\") {\n // This can happen if modules incorrectly handle HMR disposes/updates,\n // e.g. when they keep a `setTimeout` around which still executes old code\n // and contains e.g. a `require(\"something\")` call.\n let instantiationReason;\n switch (source.type) {\n case SourceType.Runtime:\n instantiationReason = `as a runtime entry of chunk ${source.chunkPath}`;\n break;\n case SourceType.Parent:\n instantiationReason = `because it was required from module ${source.parentId}`;\n break;\n case SourceType.Update:\n instantiationReason = \"because of an HMR update\";\n break;\n default:\n invariant(source, (source) => `Unknown source type: ${source?.type}`);\n }\n throw new Error(\n `Module ${id} was instantiated ${instantiationReason}, but the module factory is not available. It might have been deleted in an HMR update.`\n );\n }\n\n const hotData = moduleHotData.get(id)!;\n const { hot, hotState } = createModuleHot(id, hotData);\n\n let parents: ModuleId[];\n switch (source.type) {\n case SourceType.Runtime:\n runtimeModules.add(id);\n parents = [];\n break;\n case SourceType.Parent:\n // No need to add this module as a child of the parent module here, this\n // has already been taken care of in `getOrInstantiateModuleFromParent`.\n parents = [source.parentId];\n break;\n case SourceType.Update:\n parents = source.parents || [];\n break;\n default:\n invariant(source, (source) => `Unknown source type: ${source?.type}`);\n }\n\n const module: HotModule = {\n exports: {},\n error: undefined,\n loaded: false,\n id,\n parents,\n children: [],\n namespaceObject: undefined,\n hot,\n };\n\n devModuleCache[id] = module;\n moduleHotState.set(module, hotState);\n\n // NOTE(alexkirsz) This can fail when the module encounters a runtime error.\n try {\n const sourceInfo: SourceInfo = { type: SourceType.Parent, parentId: id };\n\n runModuleExecutionHooks(module, (refresh) => {\n const r = commonJsRequire.bind(null, module);\n moduleFactory.call(\n module.exports,\n augmentContext({\n a: asyncModule.bind(null, module),\n e: module.exports,\n r: commonJsRequire.bind(null, module),\n t: runtimeRequire,\n f: moduleContext,\n i: esmImport.bind(null, module),\n s: esmExport.bind(null, module, module.exports),\n j: dynamicExport.bind(null, module, module.exports),\n v: exportValue.bind(null, module),\n n: exportNamespace.bind(null, module),\n m: module,\n c: devModuleCache,\n M: moduleFactories,\n l: loadChunk.bind(null, sourceInfo),\n w: loadWebAssembly.bind(null, sourceInfo),\n u: loadWebAssemblyModule.bind(null, sourceInfo),\n g: globalThis,\n P: resolveAbsolutePath,\n U: relativeURL,\n k: refresh,\n R: createResolvePathFromModule(r),\n b: getWorkerBlobURL,\n z: requireStub,\n __dirname: typeof module.id === \"string\" ? module.id.replace(/(^|\\/)\\/+$/, \"\") : module.id\n })\n );\n });\n } catch (error) {\n module.error = error as any;\n throw error;\n }\n\n module.loaded = true;\n if (module.namespaceObject && module.exports !== module.namespaceObject) {\n // in case of a circular dependency: cjs1 -> esm2 -> cjs1\n interopEsm(module.exports, module.namespaceObject);\n }\n\n return module;\n}\n\n/**\n * NOTE(alexkirsz) Webpack has a \"module execution\" interception hook that\n * Next.js' React Refresh runtime hooks into to add module context to the\n * refresh registry.\n */\nfunction runModuleExecutionHooks(\n module: Module,\n executeModule: (ctx: RefreshContext) => void\n) {\n const cleanupReactRefreshIntercept =\n typeof globalThis.$RefreshInterceptModuleExecution$ === \"function\"\n ? globalThis.$RefreshInterceptModuleExecution$(module.id)\n : () => {};\n\n try {\n executeModule({\n register: globalThis.$RefreshReg$,\n signature: globalThis.$RefreshSig$,\n registerExports: registerExportsAndSetupBoundaryForReactRefresh,\n });\n } catch (e) {\n throw e;\n } finally {\n // Always cleanup the intercept, even if module execution failed.\n cleanupReactRefreshIntercept();\n }\n}\n\n/**\n * This is adapted from https://github.com/vercel/next.js/blob/3466862d9dc9c8bb3131712134d38757b918d1c0/packages/react-refresh-utils/internal/ReactRefreshModule.runtime.ts\n */\nfunction registerExportsAndSetupBoundaryForReactRefresh(\n module: HotModule,\n helpers: RefreshHelpers\n) {\n const currentExports = module.exports;\n const prevExports = module.hot.data.prevExports ?? null;\n\n helpers.registerExportsForReactRefresh(currentExports, module.id);\n\n // A module can be accepted automatically based on its exports, e.g. when\n // it is a Refresh Boundary.\n if (helpers.isReactRefreshBoundary(currentExports)) {\n // Save the previous exports on update, so we can compare the boundary\n // signatures.\n module.hot.dispose((data) => {\n data.prevExports = currentExports;\n });\n // Unconditionally accept an update to this module, we'll check if it's\n // still a Refresh Boundary later.\n module.hot.accept();\n\n // This field is set when the previous version of this module was a\n // Refresh Boundary, letting us know we need to check for invalidation or\n // enqueue an update.\n if (prevExports !== null) {\n // A boundary can become ineligible if its exports are incompatible\n // with the previous exports.\n //\n // For example, if you add/remove/change exports, we'll want to\n // re-execute the importing modules, and force those components to\n // re-render. Similarly, if you convert a class component to a\n // function, we want to invalidate the boundary.\n if (\n helpers.shouldInvalidateReactRefreshBoundary(\n helpers.getRefreshBoundarySignature(prevExports),\n helpers.getRefreshBoundarySignature(currentExports)\n )\n ) {\n module.hot.invalidate();\n } else {\n helpers.scheduleUpdate();\n }\n }\n } else {\n // Since we just executed the code for the module, it's possible that the\n // new exports made it ineligible for being a boundary.\n // We only care about the case when we were _previously_ a boundary,\n // because we already accepted this update (accidental side effect).\n const isNoLongerABoundary = prevExports !== null;\n if (isNoLongerABoundary) {\n module.hot.invalidate();\n }\n }\n}\n\nfunction formatDependencyChain(dependencyChain: ModuleId[]): string {\n return `Dependency chain: ${dependencyChain.join(\" -> \")}`;\n}\n\nfunction computeOutdatedModules(\n added: Map,\n modified: Map\n): {\n outdatedModules: Set;\n newModuleFactories: Map;\n} {\n const newModuleFactories = new Map();\n\n for (const [moduleId, entry] of added) {\n if (entry != null) {\n newModuleFactories.set(moduleId, _eval(entry));\n }\n }\n\n const outdatedModules = computedInvalidatedModules(modified.keys());\n\n for (const [moduleId, entry] of modified) {\n newModuleFactories.set(moduleId, _eval(entry));\n }\n\n return { outdatedModules, newModuleFactories };\n}\n\nfunction computedInvalidatedModules(\n invalidated: Iterable\n): Set {\n const outdatedModules = new Set();\n\n for (const moduleId of invalidated) {\n const effect = getAffectedModuleEffects(moduleId);\n\n switch (effect.type) {\n case \"unaccepted\":\n throw new UpdateApplyError(\n `cannot apply update: unaccepted module. ${formatDependencyChain(\n effect.dependencyChain\n )}.`,\n effect.dependencyChain\n );\n case \"self-declined\":\n throw new UpdateApplyError(\n `cannot apply update: self-declined module. ${formatDependencyChain(\n effect.dependencyChain\n )}.`,\n effect.dependencyChain\n );\n case \"accepted\":\n for (const outdatedModuleId of effect.outdatedModules) {\n outdatedModules.add(outdatedModuleId);\n }\n break;\n // TODO(alexkirsz) Dependencies: handle dependencies effects.\n default:\n invariant(effect, (effect) => `Unknown effect type: ${effect?.type}`);\n }\n }\n\n return outdatedModules;\n}\n\nfunction computeOutdatedSelfAcceptedModules(\n outdatedModules: Iterable\n): { moduleId: ModuleId; errorHandler: true | Function }[] {\n const outdatedSelfAcceptedModules: { moduleId: ModuleId; errorHandler: true | Function }[] = [];\n for (const moduleId of outdatedModules) {\n const module = devModuleCache[moduleId];\n const hotState = moduleHotState.get(module)!;\n if (module && hotState.selfAccepted && !hotState.selfInvalidated) {\n outdatedSelfAcceptedModules.push({\n moduleId,\n errorHandler: hotState.selfAccepted,\n });\n }\n }\n return outdatedSelfAcceptedModules;\n}\n\n/**\n * Adds, deletes, and moves modules between chunks. This must happen before the\n * dispose phase as it needs to know which modules were removed from all chunks,\n * which we can only compute *after* taking care of added and moved modules.\n */\nfunction updateChunksPhase(\n chunksAddedModules: Map>,\n chunksDeletedModules: Map>\n): { disposedModules: Set } {\n for (const [chunkPath, addedModuleIds] of chunksAddedModules) {\n for (const moduleId of addedModuleIds) {\n addModuleToChunk(moduleId, chunkPath);\n }\n }\n\n const disposedModules: Set = new Set();\n for (const [chunkPath, addedModuleIds] of chunksDeletedModules) {\n for (const moduleId of addedModuleIds) {\n if (removeModuleFromChunk(moduleId, chunkPath)) {\n disposedModules.add(moduleId);\n }\n }\n }\n\n return { disposedModules };\n}\n\nfunction disposePhase(\n outdatedModules: Iterable,\n disposedModules: Iterable\n): { outdatedModuleParents: Map> } {\n for (const moduleId of outdatedModules) {\n disposeModule(moduleId, \"replace\");\n }\n\n for (const moduleId of disposedModules) {\n disposeModule(moduleId, \"clear\");\n }\n\n // Removing modules from the module cache is a separate step.\n // We also want to keep track of previous parents of the outdated modules.\n const outdatedModuleParents = new Map();\n for (const moduleId of outdatedModules) {\n const oldModule = devModuleCache[moduleId];\n outdatedModuleParents.set(moduleId, oldModule?.parents);\n delete devModuleCache[moduleId];\n }\n\n // TODO(alexkirsz) Dependencies: remove outdated dependency from module\n // children.\n\n return { outdatedModuleParents };\n}\n\n/**\n * Disposes of an instance of a module.\n *\n * Returns the persistent hot data that should be kept for the next module\n * instance.\n *\n * NOTE: mode = \"replace\" will not remove modules from the devModuleCache\n * This must be done in a separate step afterwards.\n * This is important because all modules need to be disposed to update the\n * parent/child relationships before they are actually removed from the devModuleCache.\n * If this was done in this method, the following disposeModule calls won't find\n * the module from the module id in the cache.\n */\nfunction disposeModule(moduleId: ModuleId, mode: \"clear\" | \"replace\") {\n const module = devModuleCache[moduleId];\n if (!module) {\n return;\n }\n\n const hotState = moduleHotState.get(module)!;\n const data = {};\n\n // Run the `hot.dispose` handler, if any, passing in the persistent\n // `hot.data` object.\n for (const disposeHandler of hotState.disposeHandlers) {\n disposeHandler(data);\n }\n\n // This used to warn in `getOrInstantiateModuleFromParent` when a disposed\n // module is still importing other modules.\n module.hot.active = false;\n\n moduleHotState.delete(module);\n\n // TODO(alexkirsz) Dependencies: delete the module from outdated deps.\n\n // Remove the disposed module from its children's parent list.\n // It will be added back once the module re-instantiates and imports its\n // children again.\n for (const childId of module.children) {\n const child = devModuleCache[childId];\n if (!child) {\n continue;\n }\n\n const idx = child.parents.indexOf(module.id);\n if (idx >= 0) {\n child.parents.splice(idx, 1);\n }\n }\n\n switch (mode) {\n case \"clear\":\n delete devModuleCache[module.id];\n moduleHotData.delete(module.id);\n break;\n case \"replace\":\n moduleHotData.set(module.id, data);\n break;\n default:\n invariant(mode, (mode) => `invalid mode: ${mode}`);\n }\n}\n\nfunction applyPhase(\n outdatedSelfAcceptedModules: {\n moduleId: ModuleId;\n errorHandler: true | Function;\n }[],\n newModuleFactories: Map,\n outdatedModuleParents: Map>,\n reportError: (err: any) => void\n) {\n // Update module factories.\n for (const [moduleId, factory] of newModuleFactories.entries()) {\n moduleFactories[moduleId] = factory;\n }\n\n // TODO(alexkirsz) Run new runtime entries here.\n\n // TODO(alexkirsz) Dependencies: call accept handlers for outdated deps.\n\n // Re-instantiate all outdated self-accepted modules.\n for (const { moduleId, errorHandler } of outdatedSelfAcceptedModules) {\n try {\n instantiateModule(moduleId, {\n type: SourceType.Update,\n parents: outdatedModuleParents.get(moduleId),\n });\n } catch (err) {\n if (typeof errorHandler === \"function\") {\n try {\n errorHandler(err, { moduleId, module: devModuleCache[moduleId] });\n } catch (err2) {\n reportError(err2);\n reportError(err);\n }\n } else {\n reportError(err);\n }\n }\n }\n}\n\nfunction applyUpdate(update: PartialUpdate) {\n switch (update.type) {\n case \"ChunkListUpdate\":\n applyChunkListUpdate(update);\n break;\n default:\n invariant(update, (update) => `Unknown update type: ${update.type}`);\n }\n}\n\nfunction applyChunkListUpdate(update: ChunkListUpdate) {\n if (update.merged != null) {\n for (const merged of update.merged) {\n switch (merged.type) {\n case \"EcmascriptMergedUpdate\":\n applyEcmascriptMergedUpdate(merged);\n break;\n default:\n invariant(merged, (merged) => `Unknown merged type: ${merged.type}`);\n }\n }\n }\n\n if (update.chunks != null) {\n for (const [chunkPath, chunkUpdate] of Object.entries(update.chunks)) {\n switch (chunkUpdate.type) {\n case \"added\":\n BACKEND.loadChunk(chunkPath, { type: SourceType.Update });\n break;\n case \"total\":\n DEV_BACKEND.reloadChunk?.(chunkPath);\n break;\n case \"deleted\":\n DEV_BACKEND.unloadChunk?.(chunkPath);\n break;\n case \"partial\":\n invariant(\n chunkUpdate.instruction,\n (instruction) =>\n `Unknown partial instruction: ${JSON.stringify(instruction)}.`\n );\n break;\n default:\n invariant(\n chunkUpdate,\n (chunkUpdate) => `Unknown chunk update type: ${chunkUpdate.type}`\n );\n }\n }\n }\n}\n\nfunction applyEcmascriptMergedUpdate(update: EcmascriptMergedUpdate) {\n const { entries = {}, chunks = {} } = update;\n const { added, modified, chunksAdded, chunksDeleted } = computeChangedModules(\n entries,\n chunks\n );\n const { outdatedModules, newModuleFactories } = computeOutdatedModules(\n added,\n modified\n );\n const { disposedModules } = updateChunksPhase(chunksAdded, chunksDeleted);\n\n applyInternal(outdatedModules, disposedModules, newModuleFactories);\n}\n\nfunction applyInvalidatedModules(outdatedModules: Set) {\n if (queuedInvalidatedModules.size > 0) {\n computedInvalidatedModules(queuedInvalidatedModules).forEach((moduleId) => {\n outdatedModules.add(moduleId);\n });\n\n queuedInvalidatedModules.clear();\n }\n\n return outdatedModules;\n}\n\nfunction applyInternal(\n outdatedModules: Set,\n disposedModules: Iterable,\n newModuleFactories: Map\n) {\n outdatedModules = applyInvalidatedModules(outdatedModules);\n\n const outdatedSelfAcceptedModules =\n computeOutdatedSelfAcceptedModules(outdatedModules);\n\n const { outdatedModuleParents } = disposePhase(\n outdatedModules,\n disposedModules\n );\n\n // we want to continue on error and only throw the error after we tried applying all updates\n let error: any;\n\n function reportError(err: any) {\n if (!error) error = err;\n }\n\n applyPhase(\n outdatedSelfAcceptedModules,\n newModuleFactories,\n outdatedModuleParents,\n reportError\n );\n\n if (error) {\n throw error;\n }\n\n if (queuedInvalidatedModules.size > 0) {\n applyInternal(new Set(), [], new Map());\n }\n}\n\nfunction computeChangedModules(\n entries: Record,\n updates: Record\n): {\n added: Map;\n modified: Map;\n deleted: Set;\n chunksAdded: Map>;\n chunksDeleted: Map>;\n} {\n const chunksAdded = new Map();\n const chunksDeleted = new Map();\n const added: Map = new Map();\n const modified = new Map();\n const deleted: Set = new Set();\n\n for (const [chunkPath, mergedChunkUpdate] of Object.entries(updates)) {\n switch (mergedChunkUpdate.type) {\n case \"added\": {\n const updateAdded = new Set(mergedChunkUpdate.modules);\n for (const moduleId of updateAdded) {\n added.set(moduleId, entries[moduleId]);\n }\n chunksAdded.set(chunkPath, updateAdded);\n break;\n }\n case \"deleted\": {\n // We could also use `mergedChunkUpdate.modules` here.\n const updateDeleted = new Set(chunkModulesMap.get(chunkPath));\n for (const moduleId of updateDeleted) {\n deleted.add(moduleId);\n }\n chunksDeleted.set(chunkPath, updateDeleted);\n break;\n }\n case \"partial\": {\n const updateAdded = new Set(mergedChunkUpdate.added);\n const updateDeleted = new Set(mergedChunkUpdate.deleted);\n for (const moduleId of updateAdded) {\n added.set(moduleId, entries[moduleId]);\n }\n for (const moduleId of updateDeleted) {\n deleted.add(moduleId);\n }\n chunksAdded.set(chunkPath, updateAdded);\n chunksDeleted.set(chunkPath, updateDeleted);\n break;\n }\n default:\n invariant(\n mergedChunkUpdate,\n (mergedChunkUpdate) =>\n `Unknown merged chunk update type: ${mergedChunkUpdate.type}`\n );\n }\n }\n\n // If a module was added from one chunk and deleted from another in the same update,\n // consider it to be modified, as it means the module was moved from one chunk to another\n // AND has new code in a single update.\n for (const moduleId of added.keys()) {\n if (deleted.has(moduleId)) {\n added.delete(moduleId);\n deleted.delete(moduleId);\n }\n }\n\n for (const [moduleId, entry] of Object.entries(entries)) {\n // Modules that haven't been added to any chunk but have new code are considered\n // to be modified.\n // This needs to be under the previous loop, as we need it to get rid of modules\n // that were added and deleted in the same update.\n if (!added.has(moduleId)) {\n modified.set(moduleId, entry);\n }\n }\n\n return { added, deleted, modified, chunksAdded, chunksDeleted };\n}\n\ntype ModuleEffect =\n | {\n type: \"unaccepted\";\n dependencyChain: ModuleId[];\n }\n | {\n type: \"self-declined\";\n dependencyChain: ModuleId[];\n moduleId: ModuleId;\n }\n | {\n type: \"accepted\";\n moduleId: ModuleId;\n outdatedModules: Set;\n };\n\nfunction getAffectedModuleEffects(moduleId: ModuleId): ModuleEffect {\n const outdatedModules: Set = new Set();\n\n type QueueItem = { moduleId?: ModuleId; dependencyChain: ModuleId[] };\n\n const queue: QueueItem[] = [\n {\n moduleId,\n dependencyChain: [],\n },\n ];\n\n let nextItem;\n while ((nextItem = queue.shift())) {\n const { moduleId, dependencyChain } = nextItem;\n\n if (moduleId != null) {\n if (outdatedModules.has(moduleId)) {\n // Avoid infinite loops caused by cycles between modules in the dependency chain.\n continue;\n }\n\n outdatedModules.add(moduleId);\n }\n\n // We've arrived at the runtime of the chunk, which means that nothing\n // else above can accept this update.\n if (moduleId === undefined) {\n return {\n type: \"unaccepted\",\n dependencyChain,\n };\n }\n\n const module = devModuleCache[moduleId];\n const hotState = moduleHotState.get(module)!;\n\n if (\n // The module is not in the cache. Since this is a \"modified\" update,\n // it means that the module was never instantiated before.\n !module || // The module accepted itself without invalidating globalThis.\n // TODO is that right?\n (hotState.selfAccepted && !hotState.selfInvalidated)\n ) {\n continue;\n }\n\n if (hotState.selfDeclined) {\n return {\n type: \"self-declined\",\n dependencyChain,\n moduleId,\n };\n }\n\n if (runtimeModules.has(moduleId)) {\n queue.push({\n moduleId: undefined,\n dependencyChain: [...dependencyChain, moduleId],\n });\n continue;\n }\n\n for (const parentId of module.parents) {\n const parent = devModuleCache[parentId];\n\n if (!parent) {\n // TODO(alexkirsz) Is this even possible?\n continue;\n }\n\n // TODO(alexkirsz) Dependencies: check accepted and declined\n // dependencies here.\n\n queue.push({\n moduleId: parentId,\n dependencyChain: [...dependencyChain, moduleId],\n });\n }\n }\n\n return {\n type: \"accepted\",\n moduleId,\n outdatedModules,\n };\n}\n\nfunction handleApply(chunkListPath: ChunkPath, update: ServerMessage) {\n switch (update.type) {\n case \"partial\": {\n // This indicates that the update is can be applied to the current state of the application.\n applyUpdate(update.instruction);\n break;\n }\n case \"restart\": {\n // This indicates that there is no way to apply the update to the\n // current state of the application, and that the application must be\n // restarted.\n DEV_BACKEND.restart();\n break;\n }\n case \"notFound\": {\n // This indicates that the chunk list no longer exists: either the dynamic import which created it was removed,\n // or the page itself was deleted.\n // If it is a dynamic import, we simply discard all modules that the chunk has exclusive access to.\n // If it is a runtime chunk list, we restart the application.\n if (runtimeChunkLists.has(chunkListPath)) {\n DEV_BACKEND.restart();\n } else {\n disposeChunkList(chunkListPath);\n }\n break;\n }\n default:\n throw new Error(`Unknown update type: ${update.type}`);\n }\n}\n\nfunction createModuleHot(\n moduleId: ModuleId,\n hotData: HotData\n): { hot: Hot; hotState: HotState } {\n const hotState: HotState = {\n selfAccepted: false,\n selfDeclined: false,\n selfInvalidated: false,\n disposeHandlers: [],\n };\n\n const hot: Hot = {\n // TODO(alexkirsz) This is not defined in the HMR API. It was used to\n // decide whether to warn whenever an HMR-disposed module required other\n // modules. We might want to remove it.\n active: true,\n\n data: hotData ?? {},\n\n // TODO(alexkirsz) Support full (dep, callback, errorHandler) form.\n accept: (\n modules?: string | string[] | AcceptErrorHandler,\n _callback?: AcceptCallback,\n _errorHandler?: AcceptErrorHandler\n ) => {\n if (modules === undefined) {\n hotState.selfAccepted = true;\n } else if (typeof modules === \"function\") {\n hotState.selfAccepted = modules;\n } else {\n throw new Error(\"unsupported `accept` signature\");\n }\n },\n\n decline: (dep) => {\n if (dep === undefined) {\n hotState.selfDeclined = true;\n } else {\n throw new Error(\"unsupported `decline` signature\");\n }\n },\n\n dispose: (callback) => {\n hotState.disposeHandlers.push(callback);\n },\n\n addDisposeHandler: (callback) => {\n hotState.disposeHandlers.push(callback);\n },\n\n removeDisposeHandler: (callback) => {\n const idx = hotState.disposeHandlers.indexOf(callback);\n if (idx >= 0) {\n hotState.disposeHandlers.splice(idx, 1);\n }\n },\n\n invalidate: () => {\n hotState.selfInvalidated = true;\n queuedInvalidatedModules.add(moduleId);\n },\n\n // NOTE(alexkirsz) This is part of the management API, which we don't\n // implement, but the Next.js React Refresh runtime uses this to decide\n // whether to schedule an update.\n status: () => \"idle\",\n\n // NOTE(alexkirsz) Since we always return \"idle\" for now, these are no-ops.\n addStatusHandler: (_handler) => {},\n removeStatusHandler: (_handler) => {},\n\n // NOTE(jridgewell) Check returns the list of updated modules, but we don't\n // want the webpack code paths to ever update (the turbopack paths handle\n // this already).\n check: () => Promise.resolve(null),\n };\n\n return { hot, hotState };\n}\n\n/**\n * Removes a module from a chunk.\n * Returns `true` if there are no remaining chunks including this module.\n */\nfunction removeModuleFromChunk(\n moduleId: ModuleId,\n chunkPath: ChunkPath\n): boolean {\n const moduleChunks = moduleChunksMap.get(moduleId)!;\n moduleChunks.delete(chunkPath);\n\n const chunkModules = chunkModulesMap.get(chunkPath)!;\n chunkModules.delete(moduleId);\n\n const noRemainingModules = chunkModules.size === 0;\n if (noRemainingModules) {\n chunkModulesMap.delete(chunkPath);\n }\n\n const noRemainingChunks = moduleChunks.size === 0;\n if (noRemainingChunks) {\n moduleChunksMap.delete(moduleId);\n }\n\n return noRemainingChunks;\n}\n\n/**\n * Disposes of a chunk list and its corresponding exclusive chunks.\n */\nfunction disposeChunkList(chunkListPath: ChunkPath): boolean {\n const chunkPaths = chunkListChunksMap.get(chunkListPath);\n if (chunkPaths == null) {\n return false;\n }\n chunkListChunksMap.delete(chunkListPath);\n\n for (const chunkPath of chunkPaths) {\n const chunkChunkLists = chunkChunkListsMap.get(chunkPath)!;\n chunkChunkLists.delete(chunkListPath);\n\n if (chunkChunkLists.size === 0) {\n chunkChunkListsMap.delete(chunkPath);\n disposeChunk(chunkPath);\n }\n }\n\n // We must also dispose of the chunk list's chunk itself to ensure it may\n // be reloaded properly in the future.\n DEV_BACKEND.unloadChunk?.(chunkListPath);\n\n return true;\n}\n\n/**\n * Disposes of a chunk and its corresponding exclusive modules.\n *\n * @returns Whether the chunk was disposed of.\n */\nfunction disposeChunk(chunkPath: ChunkPath): boolean {\n // This should happen whether the chunk has any modules in it or not.\n // For instance, CSS chunks have no modules in them, but they still need to be unloaded.\n DEV_BACKEND.unloadChunk?.(chunkPath);\n\n const chunkModules = chunkModulesMap.get(chunkPath);\n if (chunkModules == null) {\n return false;\n }\n chunkModules.delete(chunkPath);\n\n for (const moduleId of chunkModules) {\n const moduleChunks = moduleChunksMap.get(moduleId)!;\n moduleChunks.delete(chunkPath);\n\n const noRemainingChunks = moduleChunks.size === 0;\n if (noRemainingChunks) {\n moduleChunksMap.delete(moduleId);\n disposeModule(moduleId, \"clear\");\n availableModules.delete(moduleId);\n }\n }\n\n return true;\n}\n\n\n/**\n * Subscribes to chunk list updates from the update server and applies them.\n */\nfunction registerChunkList(\n chunkUpdateProvider: ChunkUpdateProvider,\n chunkList: ChunkList\n) {\n chunkUpdateProvider.push([\n chunkList.path,\n handleApply.bind(null, chunkList.path),\n ]);\n\n // Adding chunks to chunk lists and vice versa.\n const chunks = new Set(chunkList.chunks.map(getChunkPath));\n chunkListChunksMap.set(chunkList.path, chunks);\n for (const chunkPath of chunks) {\n let chunkChunkLists = chunkChunkListsMap.get(chunkPath);\n if (!chunkChunkLists) {\n chunkChunkLists = new Set([chunkList.path]);\n chunkChunkListsMap.set(chunkPath, chunkChunkLists);\n } else {\n chunkChunkLists.add(chunkList.path);\n }\n }\n\n if (chunkList.source === \"entry\") {\n markChunkListAsRuntime(chunkList.path);\n }\n}\n\nglobalThis.TURBOPACK_CHUNK_UPDATE_LISTENERS ??= [];\n\nconst chunkListsToRegister = globalThis.TURBOPACK_CHUNK_LISTS;\nif (Array.isArray(chunkListsToRegister)) {\n for (const chunkList of chunkListsToRegister) {\n registerChunkList(globalThis.TURBOPACK_CHUNK_UPDATE_LISTENERS, chunkList);\n }\n}\n\nglobalThis.TURBOPACK_CHUNK_LISTS = {\n push: (chunkList) => {\n registerChunkList(globalThis.TURBOPACK_CHUNK_UPDATE_LISTENERS!, chunkList);\n },\n} satisfies ChunkListProvider;\n"],"names":[],"mappings":"AAAA,2CAA2C;AAC3C,4CAA4C;AAC5C,4CAA4C;AAE5C;;;;;;CAMC,GAED,oDAAoD,GAEpD,MAAM,iBAAyC,OAAO,MAAM,CAAC;AA4C7D,MAAM,yBAAyB;IAC7B,OAAO,mBAAmB;IAE1B,gBAA0B;IAE1B,YAAY,OAAe,EAAE,eAAyB,CAAE;QACtD,KAAK,CAAC;QACN,IAAI,CAAC,eAAe,GAAG;IACzB;AACF;AAEA;;;CAGC,GACD,MAAM,gBAAwC,IAAI;AAClD;;CAEC,GACD,MAAM,iBAAwC,IAAI;AAClD;;CAEC,GACD,MAAM,2BAA0C,IAAI;AAEpD;;CAEC,GACD,aAAa;AACb,SAAS,8BACP,QAAkB,EAClB,SAAoB;IAEpB,MAAM,SAAS,cAAc,CAAC,SAAS;IACvC,IAAI,QAAQ;QACV,IAAI,OAAO,KAAK,EAAE;YAChB,MAAM,OAAO,KAAK;QACpB;QACA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gC,KAAK,EAAE;AAElD,MAAM,uBAAuB,WAAW,qBAAqB;AAC7D,IAAI,MAAM,OAAO,CAAC,uBAAuB;IACvC,KAAK,MAAM,aAAa,qBAAsB;QAC5C,kBAAkB,WAAW,gCAAgC,EAAE;IACjE;AACF;AAEA,WAAW,qBAAqB,GAAG;IACjC,MAAM,CAAC;QACL,kBAAkB,WAAW,gCAAgC,EAAG;IAClE;AACF"}}, + {"offset": {"line": 1392, "column": 0}, "map": {"version":3,"sources":["turbopack://[turbopack]/browser/runtime/dom/runtime-backend-dom.ts"],"sourcesContent":["/**\n * This file contains the runtime code specific to the Turbopack development\n * ECMAScript DOM runtime.\n *\n * It will be appended to the base development runtime code.\n */\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n/// \n\ntype ChunkResolver = {\n resolved: boolean;\n resolve: () => void;\n reject: (error?: Error) => void;\n promise: Promise;\n};\n\nlet BACKEND: RuntimeBackend;\n\nfunction augmentContext(context: unknown): unknown {\n return context;\n}\n\nfunction fetchWebAssembly(wasmChunkPath: ChunkPath) {\n return fetch(getChunkRelativeUrl(wasmChunkPath));\n}\n\nasync function loadWebAssembly(\n _source: unknown,\n wasmChunkPath: ChunkPath,\n importsObj: WebAssembly.Imports\n): Promise {\n const req = fetchWebAssembly(wasmChunkPath);\n\n const { instance } = await WebAssembly.instantiateStreaming(req, importsObj);\n\n return instance.exports;\n}\n\nasync function loadWebAssemblyModule(\n _source: unknown,\n wasmChunkPath: ChunkPath\n): Promise {\n const req = fetchWebAssembly(wasmChunkPath);\n\n return await WebAssembly.compileStreaming(req);\n}\n\n/**\n * Maps chunk paths to the corresponding resolver.\n */\nconst chunkResolvers: Map = new Map();\n\n(() => {\n BACKEND = {\n async registerChunk(chunkPath, params) {\n const resolver = getOrCreateResolver(chunkPath);\n resolver.resolve();\n\n if (params == null) {\n return;\n }\n\n for (const otherChunkData of params.otherChunks) {\n const otherChunkPath = getChunkPath(otherChunkData);\n // Chunk might have started loading, so we want to avoid triggering another load.\n getOrCreateResolver(otherChunkPath);\n }\n\n // This waits for chunks to be loaded, but also marks included items as available.\n await Promise.all(\n params.otherChunks.map((otherChunkData) =>\n loadChunk({ type: SourceType.Runtime, chunkPath }, otherChunkData)\n )\n );\n\n if (params.runtimeModuleIds.length > 0) {\n for (const moduleId of params.runtimeModuleIds) {\n getOrInstantiateRuntimeModule(moduleId, chunkPath);\n }\n }\n },\n\n loadChunk(chunkPath, source) {\n return doLoadChunk(chunkPath, source);\n },\n };\n\n function getOrCreateResolver(chunkPath: ChunkPath): ChunkResolver {\n let resolver = chunkResolvers.get(chunkPath);\n if (!resolver) {\n let resolve: () => void;\n let reject: (error?: Error) => void;\n const promise = new Promise((innerResolve, innerReject) => {\n resolve = innerResolve;\n reject = innerReject;\n });\n resolver = {\n resolved: false,\n promise,\n resolve: () => {\n resolver!.resolved = true;\n resolve();\n },\n reject: reject!,\n };\n chunkResolvers.set(chunkPath, resolver);\n }\n return resolver;\n }\n\n /**\n * Loads the given chunk, and returns a promise that resolves once the chunk\n * has been loaded.\n */\n async function doLoadChunk(chunkPath: ChunkPath, source: SourceInfo) {\n const resolver = getOrCreateResolver(chunkPath);\n if (resolver.resolved) {\n return resolver.promise;\n }\n\n if (source.type === SourceType.Runtime) {\n // We don't need to load chunks references from runtime code, as they're already\n // present in the DOM.\n\n if (chunkPath.endsWith(\".css\")) {\n // CSS chunks do not register themselves, and as such must be marked as\n // loaded instantly.\n resolver.resolve();\n }\n\n // We need to wait for JS chunks to register themselves within `registerChunk`\n // before we can start instantiating runtime modules, hence the absence of\n // `resolver.resolve()` in this branch.\n\n return resolver.promise;\n }\n\n const chunkUrl = getChunkRelativeUrl(chunkPath);\n const decodedChunkUrl = decodeURI(chunkUrl);\n\n if (typeof importScripts === \"function\") {\n // We're in a web worker\n if (chunkPath.endsWith(\".css\")) {\n // ignore\n } else if (chunkPath.endsWith(\".js\")) {\n importScripts(TURBOPACK_WORKER_LOCATION + chunkUrl);\n } else {\n throw new Error(`can't infer type of chunk from path ${chunkPath} in worker`);\n }\n } else {\n if (chunkPath.endsWith(\".css\")) {\n const previousLinks = document.querySelectorAll(\n `link[rel=stylesheet][href=\"${chunkUrl}\"],link[rel=stylesheet][href^=\"${chunkUrl}?\"],link[rel=stylesheet][href=\"${decodedChunkUrl}\"],link[rel=stylesheet][href^=\"${decodedChunkUrl}?\"]`\n );\n if (previousLinks.length > 0) {\n // CSS chunks do not register themselves, and as such must be marked as\n // loaded instantly.\n resolver.resolve();\n } else {\n const link = document.createElement(\"link\");\n link.rel = \"stylesheet\";\n link.href = chunkUrl;\n link.onerror = () => {\n resolver.reject();\n };\n link.onload = () => {\n // CSS chunks do not register themselves, and as such must be marked as\n // loaded instantly.\n resolver.resolve();\n };\n document.body.appendChild(link);\n }\n } else if (chunkPath.endsWith(\".js\")) {\n const previousScripts = document.querySelectorAll(\n `script[src=\"${chunkUrl}\"],script[src^=\"${chunkUrl}?\"],script[src=\"${decodedChunkUrl}\"],script[src^=\"${decodedChunkUrl}?\"]`\n );\n if (previousScripts.length > 0) {\n // There is this edge where the script already failed loading, but we\n // can't detect that. The Promise will never resolve in this case.\n for (const script of Array.from(previousScripts)) {\n script.addEventListener(\"error\", () => {\n resolver.reject();\n });\n }\n } else {\n const script = document.createElement(\"script\");\n script.src = chunkUrl;\n // We'll only mark the chunk as loaded once the script has been executed,\n // which happens in `registerChunk`. Hence the absence of `resolve()` in\n // this branch.\n script.onerror = () => {\n resolver.reject();\n };\n document.body.appendChild(script);\n }\n } else {\n throw new Error(`can't infer type of chunk from path ${chunkPath}`);\n }\n }\n\n return resolver.promise;\n }\n})();\n"],"names":[],"mappings":"AAAA;;;;;CAKC,GAED,oDAAoD,GAEpD,sEAAsE;AACtE,2DAA2D;AAS3D,IAAI;AAEJ,SAAS,eAAe,OAAgB;IACtC,OAAO;AACT;AAEA,SAAS,iBAAiB,aAAwB;IAChD,OAAO,MAAM,oBAAoB;AACnC;AAEA,eAAe,gBACb,OAAgB,EAChB,aAAwB,E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AC5B;YACF,OAAO,IAAI,UAAU,QAAQ,CAAC,QAAQ;gBACpC,MAAM,kBAAkB,SAAS,gBAAgB,CAC/C,CAAC,YAAY,EAAE,SAAS,gBAAgB,EAAE,SAAS,gBAAgB,EAAE,gBAAgB,gBAAgB,EAAE,gBAAgB,GAAG,CAAC;gBAE7H,IAAI,gBAAgB,MAAM,GAAG,GAAG;oBAC9B,qEAAqE;oBACrE,kEAAkE;oBAClE,KAAK,MAAM,UAAU,MAAM,IAAI,CAAC,iBAAkB;wBAChD,OAAO,gBAAgB,CAAC,SAAS;4BAC/B,SAAS,MAAM;wBACjB;oBACF;gBACF,OAAO;oBACL,MAAM,SAAS,SAAS,aAAa,CAAC;oBACtC,OAAO,GAAG,GAAG;oBACb,yEAAyE;oBACzE,wEAAwE;oBACxE,eAAe;oBACf,OAAO,OAAO,GAAG;wBACf,SAAS,MAAM;oBACjB;oBACA,SAAS,IAAI,CAAC,WAAW,CAAC;gBAC5B;YACF,OAAO;gBACL,MAAM,IAAI,MAAM,CAAC,oCAAoC,EAAE,UAAU,CAAC;YACpE;QACF;QAEA,OAAO,SAAS,OAAO;IACzB;AACF,CAAC"}}, + {"offset": {"line": 1549, "column": 0}, "map": {"version":3,"sources":["turbopack://[turbopack]/browser/runtime/dom/dev-backend-dom.ts"],"sourcesContent":["/**\n * This file contains the runtime code specific to the Turbopack development\n * ECMAScript DOM runtime.\n *\n * It will be appended to the base development runtime code.\n */\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n\n/// \n/// \n/// \n/// \n\nlet DEV_BACKEND: DevRuntimeBackend;\n\n(() => {\n DEV_BACKEND = {\n unloadChunk(chunkPath) {\n deleteResolver(chunkPath);\n\n const chunkUrl = getChunkRelativeUrl(chunkPath);\n // TODO(PACK-2140): remove this once all filenames are guaranteed to be escaped.\n const decodedChunkUrl = decodeURI(chunkUrl);\n\n if (chunkPath.endsWith(\".css\")) {\n const links = document.querySelectorAll(\n `link[href=\"${chunkUrl}\"],link[href^=\"${chunkUrl}?\"],link[href=\"${decodedChunkUrl}\"],link[href^=\"${decodedChunkUrl}?\"]`\n );\n for (const link of Array.from(links)) {\n link.remove();\n }\n } else if (chunkPath.endsWith(\".js\")) {\n // Unloading a JS chunk would have no effect, as it lives in the JS\n // runtime once evaluated.\n // However, we still want to remove the script tag from the DOM to keep\n // the HTML somewhat consistent from the user's perspective.\n const scripts = document.querySelectorAll(\n `script[src=\"${chunkUrl}\"],script[src^=\"${chunkUrl}?\"],script[src=\"${decodedChunkUrl}\"],script[src^=\"${decodedChunkUrl}?\"]`\n );\n for (const script of Array.from(scripts)) {\n script.remove();\n }\n } else {\n throw new Error(`can't infer type of chunk from path ${chunkPath}`);\n }\n },\n\n reloadChunk(chunkPath) {\n return new Promise((resolve, reject) => {\n if (!chunkPath.endsWith(\".css\")) {\n reject(new Error(\"The DOM backend can only reload CSS chunks\"));\n return;\n }\n\n const chunkUrl = getChunkRelativeUrl(chunkPath);\n const decodedChunkUrl = decodeURI(chunkUrl);\n\n const previousLinks = document.querySelectorAll(\n `link[rel=stylesheet][href=\"${chunkUrl}\"],link[rel=stylesheet][href^=\"${chunkUrl}?\"],link[rel=stylesheet][href=\"${decodedChunkUrl}\"],link[rel=stylesheet][href^=\"${decodedChunkUrl}?\"]`\n );\n\n if (previousLinks.length === 0) {\n reject(new Error(`No link element found for chunk ${chunkPath}`));\n return;\n }\n\n const link = document.createElement(\"link\");\n link.rel = \"stylesheet\";\n\n if (navigator.userAgent.includes(\"Firefox\")) {\n // Firefox won't reload CSS files that were previously loaded on the current page,\n // we need to add a query param to make sure CSS is actually reloaded from the server.\n //\n // I believe this is this issue: https://bugzilla.mozilla.org/show_bug.cgi?id=1037506\n //\n // Safari has a similar issue, but only if you have a `` tag\n // pointing to the same URL as the stylesheet: https://bugs.webkit.org/show_bug.cgi?id=187726\n link.href = `${chunkUrl}?ts=${Date.now()}`;\n } else {\n link.href = chunkUrl;\n }\n\n link.onerror = () => {\n reject();\n };\n link.onload = () => {\n // First load the new CSS, then remove the old ones. This prevents visible\n // flickering that would happen in-between removing the previous CSS and\n // loading the new one.\n for (const previousLink of Array.from(previousLinks))\n previousLink.remove();\n\n // CSS chunks do not register themselves, and as such must be marked as\n // loaded instantly.\n resolve();\n };\n\n // Make sure to insert the new CSS right after the previous one, so that\n // its precedence is higher.\n previousLinks[0].parentElement!.insertBefore(\n link,\n previousLinks[0].nextSibling\n );\n });\n },\n\n restart: () => self.location.reload(),\n };\n\n function deleteResolver(chunkPath: ChunkPath) {\n chunkResolvers.delete(chunkPath);\n }\n})();\n\nfunction _eval({ code, url, map }: EcmascriptModuleEntry): ModuleFactory {\n code += `\\n\\n//# sourceURL=${encodeURI(\n location.origin + CHUNK_BASE_PATH + url\n )}`;\n if (map) {\n code += `\\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,${btoa(\n // btoa doesn't handle nonlatin characters, so escape them as \\x sequences\n // See https://stackoverflow.com/a/26603875\n unescape(encodeURIComponent(map))\n )}`;\n }\n\n // eslint-disable-next-line no-eval\n return eval(code);\n}\n"],"names":[],"mappings":"AAAA;;;;;CAKC,GAED,oDAAoD,GAEpD,gDAAgD;AAChD,4CAA4C;AAC5C,iDAAiD;AACjD,0DAA0D;AAE1D,IAAI;AAEJ,CAAC;IACC,cAAc;QACZ,aAAY,SAAS;YACnB,eAAe;YAEf,MAAM,WAAW,oBAAoB;YACrC,gFAAgF;YAChF,MAAM,kBAAkB,UAAU;YAElC,IAAI,UAAU,QAAQ,CAAC,SAAS;gBAC9B,MAAM,QAAQ,SAAS,gBAAgB,CACrC,CAAC,WAAW,EAAE,SAAS,eAAe,EAAE,SAAS,eAAe,EAAE,gBAAgB,eAAe,EAAE,gBAAgB,GAAG,CAAC;gBAEzH,KAAK,MAAM,QAAQ,MAAM,IAAI,CAAC,OAAQ;oBACpC,KAAK,MAAM;gBACb;YACF,OAAO,IAAI,UAAU,QAAQ,CAAC,QAAQ;gBACpC,mEAAmE;gBACnE,0BAA0B;gBAC1B,uEAAuE;g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AM,gBAAgB,MAAM,IAAI,CAAC,eACpC,aAAa,MAAM;oBAErB,uEAAuE;oBACvE,oBAAoB;oBACpB;gBACF;gBAEA,wEAAwE;gBACxE,4BAA4B;gBAC5B,aAAa,CAAC,EAAE,CAAC,aAAa,CAAE,YAAY,CAC1C,MACA,aAAa,CAAC,EAAE,CAAC,WAAW;YAEhC;QACF;QAEA,SAAS,IAAM,KAAK,QAAQ,CAAC,MAAM;IACrC;IAEA,SAAS,eAAe,SAAoB;QAC1C,eAAe,MAAM,CAAC;IACxB;AACF,CAAC;AAED,SAAS,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAyB;IACtD,QAAQ,CAAC,kBAAkB,EAAE,UAC3B,SAAS,MAAM,GAAG,kBAAkB,KACpC,CAAC;IACH,IAAI,KAAK;QACP,QAAQ,CAAC,kEAAkE,EAAE,KAC3E,0EAA0E;QAC1E,2CAA2C;QAC3C,SAAS,mBAAmB,OAC5B,CAAC;IACL;IAEA,mCAAmC;IACnC,OAAO,KAAK;AACd"}}, + {"offset": {"line": 1644, "column": 0}, "map": {"version":3,"sources":[],"names":[],"mappings":"A"}}] } \ No newline at end of file From 33c1eb7dc0ea433ca0649eeeb6495db17dea387d Mon Sep 17 00:00:00 2001 From: Zack Tanner <1939140+ztanner@users.noreply.github.com> Date: Wed, 25 Sep 2024 17:47:39 -0700 Subject: [PATCH 02/13] fix failing ppr deploy test (#70491) This behavior is differing when deployed causing failures. [x-ref](https://github.com/vercel/next.js/actions/runs/11042054253/attempts/2) [x-ref](https://github.com/vercel/next.js/actions/runs/11041870219/attempts/2) --- test/e2e/app-dir/ppr-full/ppr-full.test.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/test/e2e/app-dir/ppr-full/ppr-full.test.ts b/test/e2e/app-dir/ppr-full/ppr-full.test.ts index 9b636ac3aa3b8..0a070ba5f6b45 100644 --- a/test/e2e/app-dir/ppr-full/ppr-full.test.ts +++ b/test/e2e/app-dir/ppr-full/ppr-full.test.ts @@ -458,7 +458,14 @@ describe('ppr-full', () => { // We expect to get the fallback shell. $ = await next.render$(pathname) - expect($('[data-layout]').data('layout')).toBe(fallbackID) + + // When deployed to Vercel, it will serve a stale version of the dynamic shell + // Whereas with `next start` it will serve the fallback shell + if (isNextDeploy) { + expect($('[data-layout]').data('layout')).toBe(dynamicID) + } else { + expect($('[data-layout]').data('layout')).toBe(fallbackID) + } // Let's wait for the page to be revalidated. let revalidatedDynamicID: string From a189a4d9e44b1ba3747a9dc133e3760879c43d59 Mon Sep 17 00:00:00 2001 From: Sam Ko Date: Wed, 25 Sep 2024 17:51:23 -0700 Subject: [PATCH 03/13] chore(sass): add docs for `implementation` property in `sassOptions` and update `sassOption` types (#70428) ## Why? We currently don't document the `implementation` property for `sassOptions`. Since this is one our maintained properties, we should also update the types for `sassOptions`. - Fixes https://github.com/vercel/next.js/issues/70020 --------- Co-authored-by: Zack Tanner <1939140+ztanner@users.noreply.github.com> Co-authored-by: JJ Kasper --- .../05-styling/03-sass.mdx | 52 +++++++++++++++++-- .../05-next-config-js/sassOptions.mdx | 46 ++++++++++++++++ .../05-next-config-js/useLightningcss.mdx | 4 +- packages/next/src/server/config-schema.ts | 9 +++- packages/next/src/server/config-shared.ts | 7 ++- 5 files changed, 107 insertions(+), 11 deletions(-) create mode 100644 docs/02-app/02-api-reference/05-next-config-js/sassOptions.mdx diff --git a/docs/02-app/01-building-your-application/05-styling/03-sass.mdx b/docs/02-app/01-building-your-application/05-styling/03-sass.mdx index 6a8f4ea649c66..4582991c7d0e8 100644 --- a/docs/02-app/01-building-your-application/05-styling/03-sass.mdx +++ b/docs/02-app/01-building-your-application/05-styling/03-sass.mdx @@ -24,16 +24,58 @@ npm install --save-dev sass ### Customizing Sass Options -If you want to configure the Sass compiler, use `sassOptions` in `next.config.js`. +If you want to configure your Sass options, use `sassOptions` in `next.config`. -```js filename="next.config.js" -const path = require('path') +```ts filename="next.config.ts" switcher +import type { NextConfig } from 'next' -module.exports = { +const nextConfig: NextConfig = { sassOptions: { - includePaths: [path.join(__dirname, 'styles')], + additionalData: `$var: red;`, }, } + +export default nextConfig +``` + +```js filename="next.config.js" switcher +/** @type {import('next').NextConfig} */ + +const nextConfig = { + sassOptions: { + additionalData: `$var: red;`, + }, +} + +module.exports = nextConfig +``` + +#### Implementation + +You can use the `implementation` property to specify the Sass implementation to use. By default, Next.js uses the [`sass`](https://www.npmjs.com/package/sass) package. + +```ts filename="next.config.ts" switcher +import type { NextConfig } from 'next' + +const nextConfig: NextConfig = { + sassOptions: { + implementation: 'sass-embedded', + }, +} + +export default nextConfig +``` + +```js filename="next.config.js" switcher +/** @type {import('next').NextConfig} */ + +const nextConfig = { + sassOptions: { + implementation: 'sass-embedded', + }, +} + +module.exports = nextConfig ``` ### Sass Variables diff --git a/docs/02-app/02-api-reference/05-next-config-js/sassOptions.mdx b/docs/02-app/02-api-reference/05-next-config-js/sassOptions.mdx new file mode 100644 index 0000000000000..8c510fb6c625f --- /dev/null +++ b/docs/02-app/02-api-reference/05-next-config-js/sassOptions.mdx @@ -0,0 +1,46 @@ +--- +title: sassOptions +description: Configure Sass options. +--- + +`sassOptions` allow you to configure the Sass compiler. + +```ts filename="next.config.ts" switcher +import type { NextConfig } from 'next' + +const sassOptions = { + additionalData: ` + $var: red; + `, +} + +const nextConfig: NextConfig = { + sassOptions: { + ...sassOptions, + implementation: 'sass-embedded', + }, +} + +export default nextConfig +``` + +```js filename="next.config.js" switcher +/** @type {import('next').NextConfig} */ + +const sassOptions = { + additionalData: ` + $var: red; + `, +} + +const nextConfig = { + sassOptions: { + ...sassOptions, + implementation: 'sass-embedded', + }, +} + +module.exports = nextConfig +``` + +> **Good to know:** `sassOptions` are not typed outside of `implementation` because Next.js does not maintain the other possible properties. diff --git a/docs/02-app/02-api-reference/05-next-config-js/useLightningcss.mdx b/docs/02-app/02-api-reference/05-next-config-js/useLightningcss.mdx index 1b93f3b66490b..4ff8b2aca645f 100644 --- a/docs/02-app/02-api-reference/05-next-config-js/useLightningcss.mdx +++ b/docs/02-app/02-api-reference/05-next-config-js/useLightningcss.mdx @@ -6,7 +6,7 @@ version: experimental Experimental support for using [Lightning CSS](https://lightningcss.dev), a fast CSS bundler and minifier, written in Rust. -```ts filename="next.config.ts" +```ts filename="next.config.ts" switcher import type { NextConfig } from 'next' const nextConfig: NextConfig = { @@ -18,7 +18,7 @@ const nextConfig: NextConfig = { export default nextConfig ``` -```js filename="next.config.js" +```js filename="next.config.js" switcher /** @type {import('next').NextConfig} */ const nextConfig = { experimental: { diff --git a/packages/next/src/server/config-schema.ts b/packages/next/src/server/config-schema.ts index 82eecea40a2c3..5050c01a648d8 100644 --- a/packages/next/src/server/config-schema.ts +++ b/packages/next/src/server/config-schema.ts @@ -602,8 +602,13 @@ export const configSchema: zod.ZodType = z.lazy(() => ) ) .optional(), - // saas option is unknown, use z.any() here - sassOptions: z.record(z.string(), z.any()).optional(), + // sassOptions properties are unknown besides implementation, use z.any() here + sassOptions: z + .object({ + implementation: z.string().optional(), + }) + .catchall(z.any()) + .optional(), serverExternalPackages: z.array(z.string()).optional(), serverRuntimeConfig: z.record(z.string(), z.any()).optional(), skipMiddlewareUrlNormalize: z.boolean().optional(), diff --git a/packages/next/src/server/config-shared.ts b/packages/next/src/server/config-shared.ts index e24637c181fa5..fdd230c75aea0 100644 --- a/packages/next/src/server/config-shared.ts +++ b/packages/next/src/server/config-shared.ts @@ -770,8 +770,11 @@ export interface NextConfig extends Record { */ basePath?: string - /** @see [Customizing sass options](https://nextjs.org/docs/basic-features/built-in-css-support#customizing-sass-options) */ - sassOptions?: { [key: string]: any } + /** @see [Customizing sass options](https://nextjs.org/docs/app/api-reference/next-config-js/sassOptions) */ + sassOptions?: { + implementation?: string + [key: string]: any + } /** * Enable browser source map generation during the production build From 82682ddcc69179903d1d10ad54cfadcc8f116f75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Donny/=EA=B0=95=EB=8F=99=EC=9C=A4?= Date: Thu, 26 Sep 2024 10:30:34 +0900 Subject: [PATCH 04/13] perf(turbopack): Optimize turbopack tree shaking using `pure` (#70433) ### What? Use `pure` property to check if we need a group ### Why? To reduce the number of internal parts. --- .../turbopack-ecmascript/src/tree_shake/graph.rs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/turbopack/crates/turbopack-ecmascript/src/tree_shake/graph.rs b/turbopack/crates/turbopack-ecmascript/src/tree_shake/graph.rs index 84f95f246c339..3470d62597c9a 100644 --- a/turbopack/crates/turbopack-ecmascript/src/tree_shake/graph.rs +++ b/turbopack/crates/turbopack-ecmascript/src/tree_shake/graph.rs @@ -575,7 +575,7 @@ impl DepGraph { /// performance. pub(super) fn finalize( &self, - _data: &FxHashMap, + data: &FxHashMap, ) -> InternedGraph> { let graph = self.g.idx_graph.clone().into_graph::(); @@ -584,7 +584,7 @@ impl DepGraph { let mut new_graph = InternedGraph::default(); let mut done = FxHashSet::default(); - let mapped = condensed.map( + let mapped = condensed.filter_map( |_, node| { let mut item_ids = node .iter() @@ -596,9 +596,9 @@ impl DepGraph { .collect::>(); item_ids.sort(); - new_graph.node(&item_ids) + Some(new_graph.node(&item_ids)) }, - |_, edge| *edge, + |_, edge| Some(*edge), ); let map = GraphMap::from_graph(mapped); @@ -607,7 +607,12 @@ impl DepGraph { for node in self.g.graph_ix.iter() { let ix = self.g.get_node(node); + if !done.contains(&ix) { + if data[node].pure { + continue; + } + let item_ids = vec![node.clone()]; new_graph.node(&item_ids); } From bb1617b30f533f6293045c9bcfdbfe8f2ada88d2 Mon Sep 17 00:00:00 2001 From: Benjamin Woodruff Date: Wed, 25 Sep 2024 19:08:39 -0700 Subject: [PATCH 05/13] codemod(turbopack): Remove unused async function modifier keywords (#70474) I left a bunch of these behind in #70412 . This cleans them up. The only remaining work after this is removing unused `Result<...>`s from return types. ast-grep config: ```yaml language: rust id: remove_unused_async_keyword rule: pattern: async inside: kind: function_modifiers inside: kind: function_item follows: pattern: context: | #[turbo_tasks::function] selector: attribute_item stopBy: not: kind: attribute_item has: field: body not: has: any: - kind: await_expression - pattern: context: foo!($$$ await $$$) selector: token_tree inside: kind: macro_invocation stopBy: end stopBy: any: - kind: function_item - kind: async_block - kind: closure_expression fix: "" # these files have intentionally async functions ignores: - "**/turbo-tasks-testing/**" - "**/turbo-tasks-memory/tests/**" ``` Applied with: ``` sg scan -U -r ../codemod_remove_unused_async_keyword.yml . && cargo fmt ``` --- crates/next-api/src/app.rs | 36 +++++++------- .../next-api/src/global_module_id_strategy.rs | 2 +- crates/next-api/src/instrumentation.rs | 2 +- crates/next-api/src/middleware.rs | 2 +- crates/next-api/src/pages.rs | 32 ++++++------- crates/next-api/src/project.rs | 26 +++++----- crates/next-api/src/versioned_content_map.rs | 2 +- crates/next-core/src/app_structure.rs | 4 +- crates/next-core/src/bootstrap.rs | 2 +- crates/next-core/src/hmr_entry.rs | 2 +- .../src/next_app/include_modules_module.rs | 4 +- .../ecmascript_client_reference_module.rs | 2 +- ...cmascript_client_reference_proxy_module.rs | 4 +- crates/next-core/src/next_config.rs | 47 +++++++++---------- .../next-core/src/next_font/google/options.rs | 2 +- crates/next-core/src/next_font/local/mod.rs | 4 +- .../next-core/src/next_font/local/options.rs | 2 +- crates/next-core/src/next_pages/page_entry.rs | 2 +- .../next-core/src/next_route_matcher/mod.rs | 2 +- crates/next-core/src/next_server/context.rs | 2 +- .../server_component_module.rs | 6 +-- crates/next-core/src/next_shared/resolve.rs | 2 +- .../transforms/next_page_static_info.rs | 2 +- crates/next-core/src/pages_structure.rs | 4 +- .../crates/turbo-tasks-env/src/dotenv.rs | 4 +- turbopack/crates/turbo-tasks-env/src/lib.rs | 4 +- .../crates/turbo-tasks-fs/src/embed/file.rs | 2 +- turbopack/crates/turbo-tasks-fs/src/lib.rs | 10 ++-- .../turbopack-browser/src/chunking_context.rs | 2 +- .../turbopack-browser/src/ecmascript/chunk.rs | 2 +- .../src/ecmascript/content.rs | 4 +- .../src/ecmascript/evaluate/chunk.rs | 4 +- .../src/ecmascript/list/asset.rs | 4 +- .../src/ecmascript/runtime.rs | 2 +- .../crates/turbopack-cli/src/contexts.rs | 2 +- .../crates/turbopack-core/src/chunk/data.rs | 2 +- .../crates/turbopack-core/src/code_builder.rs | 2 +- .../turbopack-core/src/compile_time_info.rs | 2 +- .../crates/turbopack-core/src/environment.rs | 18 +++---- .../crates/turbopack-core/src/issue/mod.rs | 4 +- .../turbopack-core/src/reference/mod.rs | 4 +- .../crates/turbopack-core/src/resolve/mod.rs | 16 +++---- .../src/source_map/source_map_asset.rs | 2 +- .../turbopack-core/src/source_transform.rs | 2 +- .../crates/turbopack-core/src/version.rs | 4 +- turbopack/crates/turbopack-css/src/asset.rs | 8 ++-- .../src/chunk/single_item_chunk/chunk.rs | 2 +- .../src/chunk/single_item_chunk/source_map.rs | 2 +- .../turbopack-css/src/chunk/source_map.rs | 2 +- .../crates/turbopack-css/src/module_asset.rs | 10 ++-- .../turbopack-css/src/references/mod.rs | 2 +- .../crates/turbopack-dev-server/src/html.rs | 2 +- .../src/source/conditional.rs | 2 +- .../turbopack-dev-server/src/source/router.rs | 2 +- .../src/source/wrapping_source.rs | 2 +- .../transform/swc_ecma_transform_plugins.rs | 2 +- .../src/async_chunk/chunk_item.rs | 2 +- .../src/async_chunk/module.rs | 2 +- .../turbopack-ecmascript/src/chunk/mod.rs | 4 +- .../src/chunk_group_files_asset.rs | 4 +- .../crates/turbopack-ecmascript/src/lib.rs | 12 ++--- .../src/manifest/chunk_asset.rs | 4 +- .../src/manifest/chunk_item.rs | 4 +- .../src/manifest/loader_item.rs | 4 +- .../src/references/async_module.rs | 2 +- .../src/references/esm/url.rs | 2 +- .../src/references/external_module.rs | 4 +- .../src/references/require_context.rs | 4 +- .../side_effect_optimization/facade/module.rs | 6 +-- .../side_effect_optimization/locals/module.rs | 4 +- .../src/tree_shake/asset.rs | 12 ++--- .../src/tree_shake/chunk_item.rs | 6 +-- .../turbopack-ecmascript/src/webpack/mod.rs | 2 +- .../src/worker_chunk/chunk_item.rs | 4 +- .../src/worker_chunk/module.rs | 2 +- turbopack/crates/turbopack-json/src/lib.rs | 4 +- .../turbopack-node/src/execution_context.rs | 6 +-- turbopack/crates/turbopack-node/src/lib.rs | 2 +- .../src/render/node_api_source.rs | 2 +- .../src/render/rendered_source.rs | 2 +- .../turbopack-node/src/source_map/trace.rs | 7 +-- .../turbopack-node/src/transforms/postcss.rs | 2 +- .../turbopack-node/src/transforms/webpack.rs | 2 +- .../turbopack-nodejs/src/chunking_context.rs | 2 +- .../src/ecmascript/node/chunk.rs | 2 +- .../src/ecmascript/node/content.rs | 2 +- .../src/ecmascript/node/entry/chunk.rs | 4 +- .../src/ecmascript/node/entry/runtime.rs | 2 +- .../turbopack-resolve/src/typescript.rs | 2 +- .../crates/turbopack-static/src/fixed.rs | 2 +- turbopack/crates/turbopack-static/src/lib.rs | 6 +-- turbopack/crates/turbopack-wasm/src/loader.rs | 2 +- .../crates/turbopack-wasm/src/module_asset.rs | 8 ++-- .../crates/turbopack-wasm/src/output_asset.rs | 2 +- turbopack/crates/turbopack-wasm/src/raw.rs | 4 +- turbopack/crates/turbopack/src/lib.rs | 10 ++-- .../src/transition/context_transition.rs | 2 +- .../src/transition/full_context_transition.rs | 2 +- 98 files changed, 238 insertions(+), 252 deletions(-) diff --git a/crates/next-api/src/app.rs b/crates/next-api/src/app.rs index d86f1d59bf841..15f9446b177a1 100644 --- a/crates/next-api/src/app.rs +++ b/crates/next-api/src/app.rs @@ -152,7 +152,7 @@ impl AppProject { } #[turbo_tasks::function] - async fn client_module_options_context(self: Vc) -> Result> { + fn client_module_options_context(self: Vc) -> Result> { Ok(get_client_module_options_context( self.project().project_path(), self.project().execution_context(), @@ -164,7 +164,7 @@ impl AppProject { } #[turbo_tasks::function] - async fn client_resolve_options_context(self: Vc) -> Result> { + fn client_resolve_options_context(self: Vc) -> Result> { Ok(get_client_resolve_options_context( self.project().project_path(), Value::new(self.client_ty()), @@ -180,13 +180,13 @@ impl AppProject { } #[turbo_tasks::function] - async fn client_transition(self: Vc) -> Result> { + fn client_transition(self: Vc) -> Result> { let module_context = self.client_module_context(); Ok(FullContextTransition::new(module_context)) } #[turbo_tasks::function] - async fn rsc_module_options_context(self: Vc) -> Result> { + fn rsc_module_options_context(self: Vc) -> Result> { Ok(get_server_module_options_context( self.project().project_path(), self.project().execution_context(), @@ -198,7 +198,7 @@ impl AppProject { } #[turbo_tasks::function] - async fn edge_rsc_module_options_context(self: Vc) -> Result> { + fn edge_rsc_module_options_context(self: Vc) -> Result> { Ok(get_server_module_options_context( self.project().project_path(), self.project().execution_context(), @@ -210,7 +210,7 @@ impl AppProject { } #[turbo_tasks::function] - async fn route_module_options_context(self: Vc) -> Result> { + fn route_module_options_context(self: Vc) -> Result> { Ok(get_server_module_options_context( self.project().project_path(), self.project().execution_context(), @@ -222,7 +222,7 @@ impl AppProject { } #[turbo_tasks::function] - async fn edge_route_module_options_context(self: Vc) -> Result> { + fn edge_route_module_options_context(self: Vc) -> Result> { Ok(get_server_module_options_context( self.project().project_path(), self.project().execution_context(), @@ -234,7 +234,7 @@ impl AppProject { } #[turbo_tasks::function] - async fn rsc_resolve_options_context(self: Vc) -> Result> { + fn rsc_resolve_options_context(self: Vc) -> Result> { Ok(get_server_resolve_options_context( self.project().project_path(), Value::new(self.rsc_ty()), @@ -245,7 +245,7 @@ impl AppProject { } #[turbo_tasks::function] - async fn edge_rsc_resolve_options_context(self: Vc) -> Result> { + fn edge_rsc_resolve_options_context(self: Vc) -> Result> { Ok(get_edge_resolve_options_context( self.project().project_path(), Value::new(self.rsc_ty()), @@ -256,7 +256,7 @@ impl AppProject { } #[turbo_tasks::function] - async fn route_resolve_options_context(self: Vc) -> Result> { + fn route_resolve_options_context(self: Vc) -> Result> { Ok(get_server_resolve_options_context( self.project().project_path(), Value::new(self.route_ty()), @@ -267,9 +267,7 @@ impl AppProject { } #[turbo_tasks::function] - async fn edge_route_resolve_options_context( - self: Vc, - ) -> Result> { + fn edge_route_resolve_options_context(self: Vc) -> Result> { Ok(get_edge_resolve_options_context( self.project().project_path(), Value::new(self.route_ty()), @@ -446,7 +444,7 @@ impl AppProject { } #[turbo_tasks::function] - async fn ssr_module_options_context(self: Vc) -> Result> { + fn ssr_module_options_context(self: Vc) -> Result> { Ok(get_server_module_options_context( self.project().project_path(), self.project().execution_context(), @@ -458,7 +456,7 @@ impl AppProject { } #[turbo_tasks::function] - async fn edge_ssr_module_options_context(self: Vc) -> Result> { + fn edge_ssr_module_options_context(self: Vc) -> Result> { Ok(get_server_module_options_context( self.project().project_path(), self.project().execution_context(), @@ -470,7 +468,7 @@ impl AppProject { } #[turbo_tasks::function] - async fn ssr_resolve_options_context(self: Vc) -> Result> { + fn ssr_resolve_options_context(self: Vc) -> Result> { Ok(get_server_resolve_options_context( self.project().project_path(), Value::new(self.ssr_ty()), @@ -481,7 +479,7 @@ impl AppProject { } #[turbo_tasks::function] - async fn edge_ssr_resolve_options_context(self: Vc) -> Result> { + fn edge_ssr_resolve_options_context(self: Vc) -> Result> { Ok(get_edge_resolve_options_context( self.project().project_path(), Value::new(self.ssr_ty()), @@ -532,7 +530,7 @@ impl AppProject { } #[turbo_tasks::function] - async fn runtime_entries(self: Vc) -> Result> { + fn runtime_entries(self: Vc) -> Result> { Ok(get_server_runtime_entries( Value::new(self.rsc_ty()), self.project().next_mode(), @@ -560,7 +558,7 @@ impl AppProject { } #[turbo_tasks::function] - async fn client_runtime_entries(self: Vc) -> Result> { + fn client_runtime_entries(self: Vc) -> Result> { Ok(get_client_runtime_entries( self.project().project_path(), Value::new(self.client_ty()), diff --git a/crates/next-api/src/global_module_id_strategy.rs b/crates/next-api/src/global_module_id_strategy.rs index 626735c62a859..93bc3f39cdf12 100644 --- a/crates/next-api/src/global_module_id_strategy.rs +++ b/crates/next-api/src/global_module_id_strategy.rs @@ -84,7 +84,7 @@ impl GlobalModuleIdStrategyBuilder { // NOTE(LichuAcu) We can't move this function to `turbopack-core` because we need access to // `Endpoint`, which is not available there. #[turbo_tasks::function] -async fn preprocess_module_ids( +fn preprocess_module_ids( endpoint: Vc>, ) -> Result> { let root_modules = endpoint.root_modules(); diff --git a/crates/next-api/src/instrumentation.rs b/crates/next-api/src/instrumentation.rs index 1361188432c6c..1811ac55700a7 100644 --- a/crates/next-api/src/instrumentation.rs +++ b/crates/next-api/src/instrumentation.rs @@ -65,7 +65,7 @@ impl InstrumentationEndpoint { } #[turbo_tasks::function] - async fn core_modules(&self) -> Result> { + fn core_modules(&self) -> Result> { let userland_module = self .asset_context .process( diff --git a/crates/next-api/src/middleware.rs b/crates/next-api/src/middleware.rs index 57de8fe4a14d2..f4fab591527aa 100644 --- a/crates/next-api/src/middleware.rs +++ b/crates/next-api/src/middleware.rs @@ -255,7 +255,7 @@ impl MiddlewareEndpoint { } #[turbo_tasks::function] - async fn userland_module(&self) -> Result>> { + fn userland_module(&self) -> Result>> { Ok(self .asset_context .process( diff --git a/crates/next-api/src/pages.rs b/crates/next-api/src/pages.rs index 7a4925ef06a42..e49fa8cda2e12 100644 --- a/crates/next-api/src/pages.rs +++ b/crates/next-api/src/pages.rs @@ -81,7 +81,7 @@ pub struct PagesProject { #[turbo_tasks::value_impl] impl PagesProject { #[turbo_tasks::function] - pub async fn new(project: Vc) -> Result> { + pub fn new(project: Vc) -> Result> { Ok(PagesProject { project }.cell()) } @@ -279,7 +279,7 @@ impl PagesProject { } #[turbo_tasks::function] - async fn client_module_options_context(self: Vc) -> Result> { + fn client_module_options_context(self: Vc) -> Result> { Ok(get_client_module_options_context( self.project().project_path(), self.project().execution_context(), @@ -293,7 +293,7 @@ impl PagesProject { } #[turbo_tasks::function] - async fn client_resolve_options_context(self: Vc) -> Result> { + fn client_resolve_options_context(self: Vc) -> Result> { Ok(get_client_resolve_options_context( self.project().project_path(), Value::new(ClientContextType::Pages { @@ -385,7 +385,7 @@ impl PagesProject { } #[turbo_tasks::function] - async fn ssr_module_options_context(self: Vc) -> Result> { + fn ssr_module_options_context(self: Vc) -> Result> { Ok(get_server_module_options_context( self.project().project_path(), self.project().execution_context(), @@ -399,7 +399,7 @@ impl PagesProject { } #[turbo_tasks::function] - async fn edge_ssr_module_options_context(self: Vc) -> Result> { + fn edge_ssr_module_options_context(self: Vc) -> Result> { Ok(get_server_module_options_context( self.project().project_path(), self.project().execution_context(), @@ -413,7 +413,7 @@ impl PagesProject { } #[turbo_tasks::function] - async fn api_module_options_context(self: Vc) -> Result> { + fn api_module_options_context(self: Vc) -> Result> { Ok(get_server_module_options_context( self.project().project_path(), self.project().execution_context(), @@ -427,7 +427,7 @@ impl PagesProject { } #[turbo_tasks::function] - async fn edge_api_module_options_context(self: Vc) -> Result> { + fn edge_api_module_options_context(self: Vc) -> Result> { Ok(get_server_module_options_context( self.project().project_path(), self.project().execution_context(), @@ -441,7 +441,7 @@ impl PagesProject { } #[turbo_tasks::function] - async fn ssr_data_module_options_context(self: Vc) -> Result> { + fn ssr_data_module_options_context(self: Vc) -> Result> { Ok(get_server_module_options_context( self.project().project_path(), self.project().execution_context(), @@ -455,9 +455,7 @@ impl PagesProject { } #[turbo_tasks::function] - async fn edge_ssr_data_module_options_context( - self: Vc, - ) -> Result> { + fn edge_ssr_data_module_options_context(self: Vc) -> Result> { Ok(get_server_module_options_context( self.project().project_path(), self.project().execution_context(), @@ -471,7 +469,7 @@ impl PagesProject { } #[turbo_tasks::function] - async fn ssr_resolve_options_context(self: Vc) -> Result> { + fn ssr_resolve_options_context(self: Vc) -> Result> { Ok(get_server_resolve_options_context( self.project().project_path(), // NOTE(alexkirsz) This could be `PagesData` for the data endpoint, but it doesn't @@ -487,7 +485,7 @@ impl PagesProject { } #[turbo_tasks::function] - async fn edge_ssr_resolve_options_context(self: Vc) -> Result> { + fn edge_ssr_resolve_options_context(self: Vc) -> Result> { Ok(get_edge_resolve_options_context( self.project().project_path(), // NOTE(alexkirsz) This could be `PagesData` for the data endpoint, but it doesn't @@ -503,7 +501,7 @@ impl PagesProject { } #[turbo_tasks::function] - async fn client_runtime_entries(self: Vc) -> Result> { + fn client_runtime_entries(self: Vc) -> Result> { let client_runtime_entries = get_client_runtime_entries( self.project().project_path(), Value::new(ClientContextType::Pages { @@ -517,7 +515,7 @@ impl PagesProject { } #[turbo_tasks::function] - async fn runtime_entries(self: Vc) -> Result> { + fn runtime_entries(self: Vc) -> Result> { Ok(get_server_runtime_entries( Value::new(ServerContextType::Pages { pages_dir: self.pages_dir(), @@ -527,7 +525,7 @@ impl PagesProject { } #[turbo_tasks::function] - async fn data_runtime_entries(self: Vc) -> Result> { + fn data_runtime_entries(self: Vc) -> Result> { Ok(get_server_runtime_entries( Value::new(ServerContextType::PagesData { pages_dir: self.pages_dir(), @@ -640,7 +638,7 @@ impl PageEndpoint { } #[turbo_tasks::function] - async fn source(&self) -> Result>> { + fn source(&self) -> Result>> { Ok(Vc::upcast(FileSource::new(self.page.project_path()))) } diff --git a/crates/next-api/src/project.rs b/crates/next-api/src/project.rs index 38f8cad5fe39d..5727cb51ba11b 100644 --- a/crates/next-api/src/project.rs +++ b/crates/next-api/src/project.rs @@ -382,7 +382,7 @@ impl ProjectContainer { /// Gets a source map for a particular `file_path`. If `dev` mode is /// disabled, this will always return [`OptionSourceMap::none`]. #[turbo_tasks::function] - pub async fn get_source_map( + pub fn get_source_map( &self, file_path: Vc, section: Option, @@ -510,7 +510,7 @@ impl Project { } #[turbo_tasks::function] - pub async fn pages_project(self: Vc) -> Result> { + pub fn pages_project(self: Vc) -> Result> { Ok(PagesProject::new(self)) } @@ -528,19 +528,19 @@ impl Project { } #[turbo_tasks::function] - async fn client_fs(self: Vc) -> Result>> { + fn client_fs(self: Vc) -> Result>> { let virtual_fs = VirtualFileSystem::new(); Ok(Vc::upcast(virtual_fs)) } #[turbo_tasks::function] - pub async fn output_fs(&self) -> Result> { + pub fn output_fs(&self) -> Result> { let disk_fs = DiskFileSystem::new("output".into(), self.project_path.clone(), vec![]); Ok(disk_fs) } #[turbo_tasks::function] - pub async fn dist_dir(&self) -> Result> { + pub fn dist_dir(&self) -> Result> { Ok(Vc::cell(self.dist_dir.clone())) } @@ -585,22 +585,22 @@ impl Project { } #[turbo_tasks::function] - pub(super) async fn env(&self) -> Result>> { + pub(super) fn env(&self) -> Result>> { Ok(self.env) } #[turbo_tasks::function] - pub(super) async fn next_config(&self) -> Result> { + pub(super) fn next_config(&self) -> Result> { Ok(self.next_config) } #[turbo_tasks::function] - pub(super) async fn next_mode(&self) -> Result> { + pub(super) fn next_mode(&self) -> Result> { Ok(self.mode) } #[turbo_tasks::function] - pub(super) async fn js_config(&self) -> Result> { + pub(super) fn js_config(&self) -> Result> { Ok(self.js_config) } @@ -630,7 +630,7 @@ impl Project { } #[turbo_tasks::function] - pub(super) async fn client_compile_time_info(&self) -> Result> { + pub(super) fn client_compile_time_info(&self) -> Result> { Ok(get_client_compile_time_info( self.browserslist_query.clone(), self.define_env.client(), @@ -668,9 +668,7 @@ impl Project { } #[turbo_tasks::function] - pub(super) async fn client_chunking_context( - self: Vc, - ) -> Result>> { + pub(super) fn client_chunking_context(self: Vc) -> Result>> { Ok(get_client_chunking_context( self.project_path(), self.client_relative_path(), @@ -1324,6 +1322,6 @@ fn all_assets_from_entries_operation( } #[turbo_tasks::function] -async fn stable_endpoint(endpoint: Vc>) -> Result>> { +fn stable_endpoint(endpoint: Vc>) -> Result>> { Ok(endpoint) } diff --git a/crates/next-api/src/versioned_content_map.rs b/crates/next-api/src/versioned_content_map.rs index 189a968534d89..a07553d2bdbb1 100644 --- a/crates/next-api/src/versioned_content_map.rs +++ b/crates/next-api/src/versioned_content_map.rs @@ -230,7 +230,7 @@ impl VersionedContentMap { } #[turbo_tasks::function] - async fn raw_get(&self, path: Vc) -> Result> { + fn raw_get(&self, path: Vc) -> Result> { let assets = { let map = self.map_path_to_op.get(); map.get(&path).and_then(|m| m.iter().last().copied()) diff --git a/crates/next-core/src/app_structure.rs b/crates/next-core/src/app_structure.rs index b1548aa49b4a9..a9483fbd81ace 100644 --- a/crates/next-core/src/app_structure.rs +++ b/crates/next-core/src/app_structure.rs @@ -732,7 +732,7 @@ struct DuplicateParallelRouteIssue { #[turbo_tasks::value_impl] impl Issue for DuplicateParallelRouteIssue { #[turbo_tasks::function] - async fn file_path(&self) -> Result> { + fn file_path(&self) -> Result> { Ok(self.app_dir.join(self.page.to_string().into())) } @@ -1355,7 +1355,7 @@ impl Issue for DirectoryTreeIssue { } #[turbo_tasks::function] - async fn title(&self) -> Result> { + fn title(&self) -> Result> { Ok(StyledString::Text("An issue occurred while preparing your Next.js app".into()).cell()) } diff --git a/crates/next-core/src/bootstrap.rs b/crates/next-core/src/bootstrap.rs index a17391ff85c40..273a0709dc446 100644 --- a/crates/next-core/src/bootstrap.rs +++ b/crates/next-core/src/bootstrap.rs @@ -14,7 +14,7 @@ use turbopack_core::{ use turbopack_ecmascript::utils::StringifyJs; #[turbo_tasks::function] -pub async fn route_bootstrap( +pub fn route_bootstrap( asset: Vc>, asset_context: Vc>, base_path: Vc, diff --git a/crates/next-core/src/hmr_entry.rs b/crates/next-core/src/hmr_entry.rs index bacd703100730..c969b1020fc7e 100644 --- a/crates/next-core/src/hmr_entry.rs +++ b/crates/next-core/src/hmr_entry.rs @@ -121,7 +121,7 @@ impl ValueToString for HmrEntryModuleReference { #[turbo_tasks::value_impl] impl ModuleReference for HmrEntryModuleReference { #[turbo_tasks::function] - async fn resolve_reference(&self) -> Result> { + fn resolve_reference(&self) -> Result> { Ok(ModuleResolveResult::module(self.module).cell()) } } diff --git a/crates/next-core/src/next_app/include_modules_module.rs b/crates/next-core/src/next_app/include_modules_module.rs index f36c23bdcc88a..65d4a3f3069b8 100644 --- a/crates/next-core/src/next_app/include_modules_module.rs +++ b/crates/next-core/src/next_app/include_modules_module.rs @@ -75,7 +75,7 @@ impl EcmascriptChunkPlaceable for IncludeModulesModule { #[turbo_tasks::value_impl] impl ChunkableModule for IncludeModulesModule { #[turbo_tasks::function] - async fn as_chunk_item( + fn as_chunk_item( self: Vc, chunking_context: Vc>, ) -> Result>> { @@ -165,7 +165,7 @@ impl ValueToString for IncludedModuleReference { #[turbo_tasks::value_impl] impl ModuleReference for IncludedModuleReference { #[turbo_tasks::function] - async fn resolve_reference(&self) -> Result> { + fn resolve_reference(&self) -> Result> { Ok(ModuleResolveResult::module(self.module).cell()) } } diff --git a/crates/next-core/src/next_client_reference/ecmascript_client_reference/ecmascript_client_reference_module.rs b/crates/next-core/src/next_client_reference/ecmascript_client_reference/ecmascript_client_reference_module.rs index 382733c050a03..fc04e3ba8d33e 100644 --- a/crates/next-core/src/next_client_reference/ecmascript_client_reference/ecmascript_client_reference_module.rs +++ b/crates/next-core/src/next_client_reference/ecmascript_client_reference/ecmascript_client_reference_module.rs @@ -57,7 +57,7 @@ impl Module for EcmascriptClientReferenceModule { } #[turbo_tasks::function] - async fn additional_layers_modules(&self) -> Result> { + fn additional_layers_modules(&self) -> Result> { let client_module = Vc::upcast(self.client_module); let ssr_module = Vc::upcast(self.ssr_module); Ok(Vc::cell(vec![client_module, ssr_module])) diff --git a/crates/next-core/src/next_client_reference/ecmascript_client_reference/ecmascript_client_reference_proxy_module.rs b/crates/next-core/src/next_client_reference/ecmascript_client_reference/ecmascript_client_reference_proxy_module.rs index 8c7577fe81f95..4c1a16b7aa0fc 100644 --- a/crates/next-core/src/next_client_reference/ecmascript_client_reference/ecmascript_client_reference_proxy_module.rs +++ b/crates/next-core/src/next_client_reference/ecmascript_client_reference/ecmascript_client_reference_proxy_module.rs @@ -262,7 +262,7 @@ fn client_reference_description() -> Vc { #[turbo_tasks::value_impl] impl ChunkItem for ProxyModuleChunkItem { #[turbo_tasks::function] - async fn asset_ident(&self) -> Vc { + fn asset_ident(&self) -> Vc { self.client_proxy_asset.ident() } @@ -272,7 +272,7 @@ impl ChunkItem for ProxyModuleChunkItem { } #[turbo_tasks::function] - async fn chunking_context(&self) -> Vc> { + fn chunking_context(&self) -> Vc> { Vc::upcast(self.chunking_context) } diff --git a/crates/next-core/src/next_config.rs b/crates/next-core/src/next_config.rs index a137783d4ae45..f3ca4eb9cbee3 100644 --- a/crates/next-core/src/next_config.rs +++ b/crates/next-core/src/next_config.rs @@ -792,7 +792,7 @@ impl NextConfig { } #[turbo_tasks::function] - pub async fn server_external_packages(&self) -> Result>> { + pub fn server_external_packages(&self) -> Result>> { Ok(Vc::cell( self.server_external_packages .as_ref() @@ -802,7 +802,7 @@ impl NextConfig { } #[turbo_tasks::function] - pub async fn env(&self) -> Result> { + pub fn env(&self) -> Result> { // The value expected for env is Record, but config itself // allows arbitrary object (https://github.com/vercel/next.js/blob/25ba8a74b7544dfb6b30d1b67c47b9cb5360cb4e/packages/next/src/server/config-schema.ts#L203) // then stringifies it. We do the interop here as well. @@ -826,27 +826,24 @@ impl NextConfig { } #[turbo_tasks::function] - pub async fn image_config(&self) -> Result> { + pub fn image_config(&self) -> Result> { Ok(self.images.clone().cell()) } #[turbo_tasks::function] - pub async fn page_extensions(&self) -> Result>> { + pub fn page_extensions(&self) -> Result>> { Ok(Vc::cell(self.page_extensions.clone())) } #[turbo_tasks::function] - pub async fn transpile_packages(&self) -> Result>> { + pub fn transpile_packages(&self) -> Result>> { Ok(Vc::cell( self.transpile_packages.clone().unwrap_or_default(), )) } #[turbo_tasks::function] - pub async fn webpack_rules( - &self, - active_conditions: Vec, - ) -> Result> { + pub fn webpack_rules(&self, active_conditions: Vec) -> Result> { let Some(turbo_rules) = self .experimental .turbo @@ -934,7 +931,7 @@ impl NextConfig { } #[turbo_tasks::function] - pub async fn resolve_alias_options(&self) -> Result> { + pub fn resolve_alias_options(&self) -> Result> { let Some(resolve_alias) = self .experimental .turbo @@ -948,7 +945,7 @@ impl NextConfig { } #[turbo_tasks::function] - pub async fn resolve_extension(&self) -> Result> { + pub fn resolve_extension(&self) -> Result> { let Some(resolve_extensions) = self .experimental .turbo @@ -970,7 +967,7 @@ impl NextConfig { } #[turbo_tasks::function] - pub async fn mdx_rs(&self) -> Result> { + pub fn mdx_rs(&self) -> Result> { let options = &self.experimental.mdx_rs; let options = match options { @@ -1000,7 +997,7 @@ impl NextConfig { } #[turbo_tasks::function] - pub async fn react_compiler(&self) -> Result> { + pub fn react_compiler(&self) -> Result> { let options = &self.experimental.react_compiler; let options = match options { @@ -1023,19 +1020,19 @@ impl NextConfig { } #[turbo_tasks::function] - pub async fn sass_config(&self) -> Result> { + pub fn sass_config(&self) -> Result> { Ok(Vc::cell(self.sass_options.clone().unwrap_or_default())) } #[turbo_tasks::function] - pub async fn skip_middleware_url_normalize(&self) -> Result> { + pub fn skip_middleware_url_normalize(&self) -> Result> { Ok(Vc::cell( self.skip_middleware_url_normalize.unwrap_or(false), )) } #[turbo_tasks::function] - pub async fn skip_trailing_slash_redirect(&self) -> Result> { + pub fn skip_trailing_slash_redirect(&self) -> Result> { Ok(Vc::cell(self.skip_trailing_slash_redirect.unwrap_or(false))) } @@ -1060,7 +1057,7 @@ impl NextConfig { } #[turbo_tasks::function] - pub async fn enable_ppr(&self) -> Result> { + pub fn enable_ppr(&self) -> Result> { Ok(Vc::cell( self.experimental .ppr @@ -1076,17 +1073,17 @@ impl NextConfig { } #[turbo_tasks::function] - pub async fn enable_taint(&self) -> Result> { + pub fn enable_taint(&self) -> Result> { Ok(Vc::cell(self.experimental.taint.unwrap_or(false))) } #[turbo_tasks::function] - pub async fn enable_dynamic_io(&self) -> Result> { + pub fn enable_dynamic_io(&self) -> Result> { Ok(Vc::cell(self.experimental.dynamic_io.unwrap_or(false))) } #[turbo_tasks::function] - pub async fn use_swc_css(&self) -> Result> { + pub fn use_swc_css(&self) -> Result> { Ok(Vc::cell( self.experimental .turbo @@ -1097,7 +1094,7 @@ impl NextConfig { } #[turbo_tasks::function] - pub async fn optimize_package_imports(&self) -> Result>> { + pub fn optimize_package_imports(&self) -> Result>> { Ok(Vc::cell( self.experimental .optimize_package_imports @@ -1107,7 +1104,7 @@ impl NextConfig { } #[turbo_tasks::function] - pub async fn tree_shaking_mode_for_foreign_code( + pub fn tree_shaking_mode_for_foreign_code( &self, is_development: bool, ) -> Result> { @@ -1132,7 +1129,7 @@ impl NextConfig { } #[turbo_tasks::function] - pub async fn tree_shaking_mode_for_user_code( + pub fn tree_shaking_mode_for_user_code( self: Vc, is_development: bool, ) -> Result> { @@ -1144,7 +1141,7 @@ impl NextConfig { } #[turbo_tasks::function] - pub async fn module_id_strategy_config(&self) -> Result> { + pub fn module_id_strategy_config(&self) -> Result> { let Some(module_id_strategy) = self .experimental .turbo @@ -1178,7 +1175,7 @@ impl JsConfig { } #[turbo_tasks::function] - pub async fn compiler_options(&self) -> Result> { + pub fn compiler_options(&self) -> Result> { Ok(Vc::cell(self.compiler_options.clone().unwrap_or_default())) } } diff --git a/crates/next-core/src/next_font/google/options.rs b/crates/next-core/src/next_font/google/options.rs index 1ecc78bfdaac2..74b0db71c72d9 100644 --- a/crates/next-core/src/next_font/google/options.rs +++ b/crates/next-core/src/next_font/google/options.rs @@ -35,7 +35,7 @@ impl NextFontGoogleOptions { } #[turbo_tasks::function] - pub async fn font_family(&self) -> Result> { + pub fn font_family(&self) -> Result> { Ok(Vc::cell((*self.font_family).into())) } } diff --git a/crates/next-core/src/next_font/local/mod.rs b/crates/next-core/src/next_font/local/mod.rs index d3fd243d09028..62ce9730f2ca2 100644 --- a/crates/next-core/src/next_font/local/mod.rs +++ b/crates/next-core/src/next_font/local/mod.rs @@ -65,7 +65,7 @@ impl NextFontLocalResolvePlugin { #[turbo_tasks::value_impl] impl BeforeResolvePlugin for NextFontLocalResolvePlugin { #[turbo_tasks::function] - async fn before_resolve_condition(&self) -> Vc { + fn before_resolve_condition(&self) -> Vc { BeforeResolvePluginCondition::from_request_glob(Glob::new( "{next,@vercel/turbopack-next/internal}/font/local/*".into(), )) @@ -321,7 +321,7 @@ impl Issue for FontResolvingIssue { } #[turbo_tasks::function] - async fn file_path(&self) -> Result> { + fn file_path(&self) -> Result> { Ok(self.origin_path) } diff --git a/crates/next-core/src/next_font/local/options.rs b/crates/next-core/src/next_font/local/options.rs index 2e06626db987b..cffd94152f426 100644 --- a/crates/next-core/src/next_font/local/options.rs +++ b/crates/next-core/src/next_font/local/options.rs @@ -41,7 +41,7 @@ impl NextFontLocalOptions { } #[turbo_tasks::function] - pub async fn font_family(&self) -> Result> { + pub fn font_family(&self) -> Result> { Ok(Vc::cell(self.variable_name.clone())) } } diff --git a/crates/next-core/src/next_pages/page_entry.rs b/crates/next-core/src/next_pages/page_entry.rs index 595c9fbbebf18..33a4043a24513 100644 --- a/crates/next-core/src/next_pages/page_entry.rs +++ b/crates/next-core/src/next_pages/page_entry.rs @@ -166,7 +166,7 @@ pub async fn create_page_ssr_entry_module( } #[turbo_tasks::function] -async fn process_global_item( +fn process_global_item( item: Vc, reference_type: Value, module_context: Vc>, diff --git a/crates/next-core/src/next_route_matcher/mod.rs b/crates/next-core/src/next_route_matcher/mod.rs index a58adf5f53b97..affb4329226b1 100644 --- a/crates/next-core/src/next_route_matcher/mod.rs +++ b/crates/next-core/src/next_route_matcher/mod.rs @@ -21,7 +21,7 @@ pub(crate) struct NextExactMatcher { #[turbo_tasks::value_impl] impl NextExactMatcher { #[turbo_tasks::function] - pub async fn new(path: Vc) -> Result> { + pub fn new(path: Vc) -> Result> { Ok(Self::cell(NextExactMatcher { path })) } } diff --git a/crates/next-core/src/next_server/context.rs b/crates/next-core/src/next_server/context.rs index 2454a86713f98..a0865d56f4856 100644 --- a/crates/next-core/src/next_server/context.rs +++ b/crates/next-core/src/next_server/context.rs @@ -348,7 +348,7 @@ async fn next_server_free_vars(define_env: Vc) -> Result>, define_env: Vc, ) -> Vc { diff --git a/crates/next-core/src/next_server_component/server_component_module.rs b/crates/next-core/src/next_server_component/server_component_module.rs index aa049cee125f0..3b50935dc46d4 100644 --- a/crates/next-core/src/next_server_component/server_component_module.rs +++ b/crates/next-core/src/next_server_component/server_component_module.rs @@ -46,7 +46,7 @@ impl NextServerComponentModule { } #[turbo_tasks::function] - pub async fn server_path(&self) -> Result> { + pub fn server_path(&self) -> Result> { Ok(self.module.ident().path()) } } @@ -89,7 +89,7 @@ impl Asset for NextServerComponentModule { #[turbo_tasks::value_impl] impl ChunkableModule for NextServerComponentModule { #[turbo_tasks::function] - async fn as_chunk_item( + fn as_chunk_item( self: Vc, chunking_context: Vc>, ) -> Result>> { @@ -177,7 +177,7 @@ impl ChunkItem for NextServerComponentChunkItem { } #[turbo_tasks::function] - async fn chunking_context(&self) -> Vc> { + fn chunking_context(&self) -> Vc> { self.chunking_context } diff --git a/crates/next-core/src/next_shared/resolve.rs b/crates/next-core/src/next_shared/resolve.rs index 82d797ad885b3..02b585e539df2 100644 --- a/crates/next-core/src/next_shared/resolve.rs +++ b/crates/next-core/src/next_shared/resolve.rs @@ -125,7 +125,7 @@ impl BeforeResolvePlugin for InvalidImportResolvePlugin { } #[turbo_tasks::function] - async fn before_resolve( + fn before_resolve( &self, lookup_path: Vc, _reference_type: Value, diff --git a/crates/next-core/src/next_shared/transforms/next_page_static_info.rs b/crates/next-core/src/next_shared/transforms/next_page_static_info.rs index 5dfe5b600ecfa..3f8beee7a97c5 100644 --- a/crates/next-core/src/next_shared/transforms/next_page_static_info.rs +++ b/crates/next-core/src/next_shared/transforms/next_page_static_info.rs @@ -157,7 +157,7 @@ impl Issue for PageStaticInfoIssue { } #[turbo_tasks::function] - async fn description(&self) -> Result> { + fn description(&self) -> Result> { Ok(Vc::cell(Some( StyledString::Line( self.messages diff --git a/crates/next-core/src/pages_structure.rs b/crates/next-core/src/pages_structure.rs index 1a27898110d6a..44644aac8d1e1 100644 --- a/crates/next-core/src/pages_structure.rs +++ b/crates/next-core/src/pages_structure.rs @@ -26,7 +26,7 @@ pub struct PagesStructureItem { #[turbo_tasks::value_impl] impl PagesStructureItem { #[turbo_tasks::function] - async fn new( + fn new( base_path: Vc, extensions: Vc>, fallback_path: Option>, @@ -102,7 +102,7 @@ impl PagesDirectoryStructure { /// Returns the path to the directory of this structure in the project file /// system. #[turbo_tasks::function] - pub async fn project_path(&self) -> Result> { + pub fn project_path(&self) -> Result> { Ok(self.project_path) } } diff --git a/turbopack/crates/turbo-tasks-env/src/dotenv.rs b/turbopack/crates/turbo-tasks-env/src/dotenv.rs index fd1faa7ec7e3e..f83d55785d592 100644 --- a/turbopack/crates/turbo-tasks-env/src/dotenv.rs +++ b/turbopack/crates/turbo-tasks-env/src/dotenv.rs @@ -24,7 +24,7 @@ impl DotenvProcessEnv { } #[turbo_tasks::function] - pub async fn read_prior(&self) -> Result> { + pub fn read_prior(&self) -> Result> { match self.prior { None => Ok(EnvMap::empty()), Some(p) => Ok(p.read_all()), @@ -76,7 +76,7 @@ impl DotenvProcessEnv { #[turbo_tasks::value_impl] impl ProcessEnv for DotenvProcessEnv { #[turbo_tasks::function] - async fn read_all(self: Vc) -> Result> { + fn read_all(self: Vc) -> Result> { let prior = self.read_prior(); Ok(self.read_all_with_prior(prior)) } diff --git a/turbopack/crates/turbo-tasks-env/src/lib.rs b/turbopack/crates/turbo-tasks-env/src/lib.rs index 6d4880ff6fbaf..e6b71932dcb89 100644 --- a/turbopack/crates/turbo-tasks-env/src/lib.rs +++ b/turbopack/crates/turbo-tasks-env/src/lib.rs @@ -30,12 +30,12 @@ impl EnvMap { #[turbo_tasks::value_impl] impl ProcessEnv for EnvMap { #[turbo_tasks::function] - async fn read_all(self: Vc) -> Result> { + fn read_all(self: Vc) -> Result> { Ok(self) } #[turbo_tasks::function] - async fn read(self: Vc, name: RcStr) -> Vc> { + fn read(self: Vc, name: RcStr) -> Vc> { case_insensitive_read(self, name) } } diff --git a/turbopack/crates/turbo-tasks-fs/src/embed/file.rs b/turbopack/crates/turbo-tasks-fs/src/embed/file.rs index 74646862b8ff4..c6376de43dd78 100644 --- a/turbopack/crates/turbo-tasks-fs/src/embed/file.rs +++ b/turbopack/crates/turbo-tasks-fs/src/embed/file.rs @@ -30,7 +30,7 @@ pub async fn content_from_relative_path( } #[turbo_tasks::function] -pub async fn content_from_str(string: RcStr) -> Result> { +pub fn content_from_str(string: RcStr) -> Result> { Ok(File::from(string).into()) } diff --git a/turbopack/crates/turbo-tasks-fs/src/lib.rs b/turbopack/crates/turbo-tasks-fs/src/lib.rs index 872c7daab255c..358e5aad95007 100644 --- a/turbopack/crates/turbo-tasks-fs/src/lib.rs +++ b/turbopack/crates/turbo-tasks-fs/src/lib.rs @@ -1195,7 +1195,7 @@ impl FileSystemPath { } #[turbo_tasks::function] - pub async fn read_glob( + pub fn read_glob( self: Vc, glob: Vc, include_dot_files: bool, @@ -1209,12 +1209,12 @@ impl FileSystemPath { } #[turbo_tasks::function] - pub async fn fs(&self) -> Result>> { + pub fn fs(&self) -> Result>> { Ok(self.fs) } #[turbo_tasks::function] - pub async fn extension(&self) -> Result> { + pub fn extension(&self) -> Result> { Ok(Vc::cell(self.extension_ref().unwrap_or("").into())) } @@ -1253,7 +1253,7 @@ impl FileSystemPath { /// * The entire file name if the file name begins with `.` and has no other `.`s within; /// * Otherwise, the portion of the file name before the final `.` #[turbo_tasks::function] - pub async fn file_stem(&self) -> Result>> { + pub fn file_stem(&self) -> Result>> { let (_, file_stem, _) = self.split_file_stem_extension(); if file_stem.is_empty() { return Ok(Vc::cell(None)); @@ -1478,7 +1478,7 @@ pub struct RealPathResult { #[turbo_tasks::value_impl] impl RealPathResult { #[turbo_tasks::function] - pub async fn path(&self) -> Result> { + pub fn path(&self) -> Result> { Ok(self.path) } } diff --git a/turbopack/crates/turbopack-browser/src/chunking_context.rs b/turbopack/crates/turbopack-browser/src/chunking_context.rs index 963b98fee1c6e..d187c7601eb84 100644 --- a/turbopack/crates/turbopack-browser/src/chunking_context.rs +++ b/turbopack/crates/turbopack-browser/src/chunking_context.rs @@ -485,7 +485,7 @@ impl ChunkingContext for BrowserChunkingContext { } #[turbo_tasks::function] - async fn chunk_item_id_from_ident(&self, ident: Vc) -> Result> { + fn chunk_item_id_from_ident(&self, ident: Vc) -> Result> { Ok(self.module_id_strategy.get_module_id(ident)) } diff --git a/turbopack/crates/turbopack-browser/src/ecmascript/chunk.rs b/turbopack/crates/turbopack-browser/src/ecmascript/chunk.rs index 7e6c651b8cbd7..adf1b8a05d472 100644 --- a/turbopack/crates/turbopack-browser/src/ecmascript/chunk.rs +++ b/turbopack/crates/turbopack-browser/src/ecmascript/chunk.rs @@ -40,7 +40,7 @@ impl EcmascriptDevChunk { #[turbo_tasks::value_impl] impl ValueToString for EcmascriptDevChunk { #[turbo_tasks::function] - async fn to_string(&self) -> Result> { + fn to_string(&self) -> Result> { Ok(Vc::cell("Ecmascript Dev Chunk".into())) } } diff --git a/turbopack/crates/turbopack-browser/src/ecmascript/content.rs b/turbopack/crates/turbopack-browser/src/ecmascript/content.rs index c7abd8b91fd60..95d53351d409b 100644 --- a/turbopack/crates/turbopack-browser/src/ecmascript/content.rs +++ b/turbopack/crates/turbopack-browser/src/ecmascript/content.rs @@ -47,7 +47,7 @@ impl EcmascriptDevChunkContent { } #[turbo_tasks::function] - pub async fn entries(&self) -> Result> { + pub fn entries(&self) -> Result> { Ok(self.entries) } } @@ -55,7 +55,7 @@ impl EcmascriptDevChunkContent { #[turbo_tasks::value_impl] impl EcmascriptDevChunkContent { #[turbo_tasks::function] - pub(crate) async fn own_version(&self) -> Result> { + pub(crate) fn own_version(&self) -> Result> { Ok(EcmascriptDevChunkVersion::new( self.chunking_context.output_root(), self.chunk.ident().path(), diff --git a/turbopack/crates/turbopack-browser/src/ecmascript/evaluate/chunk.rs b/turbopack/crates/turbopack-browser/src/ecmascript/evaluate/chunk.rs index 69ba25c6713b2..8416b828bf9dd 100644 --- a/turbopack/crates/turbopack-browser/src/ecmascript/evaluate/chunk.rs +++ b/turbopack/crates/turbopack-browser/src/ecmascript/evaluate/chunk.rs @@ -57,7 +57,7 @@ impl EcmascriptDevEvaluateChunk { } #[turbo_tasks::function] - async fn chunks_data(&self) -> Result> { + fn chunks_data(&self) -> Result> { Ok(ChunkData::from_assets( self.chunking_context.output_root(), self.other_chunks, @@ -191,7 +191,7 @@ impl EcmascriptDevEvaluateChunk { #[turbo_tasks::value_impl] impl ValueToString for EcmascriptDevEvaluateChunk { #[turbo_tasks::function] - async fn to_string(&self) -> Result> { + fn to_string(&self) -> Result> { Ok(Vc::cell("Ecmascript Dev Evaluate Chunk".into())) } } diff --git a/turbopack/crates/turbopack-browser/src/ecmascript/list/asset.rs b/turbopack/crates/turbopack-browser/src/ecmascript/list/asset.rs index 5c26820bece95..eb6639ff63614 100644 --- a/turbopack/crates/turbopack-browser/src/ecmascript/list/asset.rs +++ b/turbopack/crates/turbopack-browser/src/ecmascript/list/asset.rs @@ -61,7 +61,7 @@ impl EcmascriptDevChunkList { #[turbo_tasks::value_impl] impl ValueToString for EcmascriptDevChunkList { #[turbo_tasks::function] - async fn to_string(&self) -> Result> { + fn to_string(&self) -> Result> { Ok(Vc::cell("Ecmascript Dev Chunk List".into())) } } @@ -111,7 +111,7 @@ impl OutputAsset for EcmascriptDevChunkList { } #[turbo_tasks::function] - async fn references(&self) -> Result> { + fn references(&self) -> Result> { Ok(self.chunks) } } diff --git a/turbopack/crates/turbopack-browser/src/ecmascript/runtime.rs b/turbopack/crates/turbopack-browser/src/ecmascript/runtime.rs index 68b103bed10c9..4c68b95738ec5 100644 --- a/turbopack/crates/turbopack-browser/src/ecmascript/runtime.rs +++ b/turbopack/crates/turbopack-browser/src/ecmascript/runtime.rs @@ -46,7 +46,7 @@ impl EcmascriptDevChunkRuntime { #[turbo_tasks::value_impl] impl ValueToString for EcmascriptDevChunkRuntime { #[turbo_tasks::function] - async fn to_string(&self) -> Result> { + fn to_string(&self) -> Result> { Ok(Vc::cell("Ecmascript Dev Runtime".to_string())) } } diff --git a/turbopack/crates/turbopack-cli/src/contexts.rs b/turbopack/crates/turbopack-cli/src/contexts.rs index bd467b22ac366..87c6cf317687a 100644 --- a/turbopack/crates/turbopack-cli/src/contexts.rs +++ b/turbopack/crates/turbopack-cli/src/contexts.rs @@ -50,7 +50,7 @@ async fn foreign_code_context_condition() -> Result { } #[turbo_tasks::function] -pub async fn get_client_import_map(project_path: Vc) -> Result> { +pub fn get_client_import_map(project_path: Vc) -> Result> { let mut import_map = ImportMap::empty(); import_map.insert_singleton_alias("@swc/helpers", project_path); diff --git a/turbopack/crates/turbopack-core/src/chunk/data.rs b/turbopack/crates/turbopack-core/src/chunk/data.rs index 4d482835406e6..77eae0d15d018 100644 --- a/turbopack/crates/turbopack-core/src/chunk/data.rs +++ b/turbopack/crates/turbopack-core/src/chunk/data.rs @@ -137,7 +137,7 @@ impl ChunkData { /// Returns [`OutputAsset`]s that this chunk data references. #[turbo_tasks::function] - pub async fn references(&self) -> Result> { + pub fn references(&self) -> Result> { Ok(self.references) } } diff --git a/turbopack/crates/turbopack-core/src/code_builder.rs b/turbopack/crates/turbopack-core/src/code_builder.rs index 54433d1b649d3..8112c94310246 100644 --- a/turbopack/crates/turbopack-core/src/code_builder.rs +++ b/turbopack/crates/turbopack-core/src/code_builder.rs @@ -191,7 +191,7 @@ impl GenerateSourceMap for Code { impl Code { /// Returns the hash of the source code of this Code. #[turbo_tasks::function] - pub async fn source_code_hash(&self) -> Result> { + pub fn source_code_hash(&self) -> Result> { let code = self; let hash = hash_xxh3_hash64(code.source_code()); Ok(Vc::cell(hash)) diff --git a/turbopack/crates/turbopack-core/src/compile_time_info.rs b/turbopack/crates/turbopack-core/src/compile_time_info.rs index 561088f5493c2..5d1a5ad7c71bb 100644 --- a/turbopack/crates/turbopack-core/src/compile_time_info.rs +++ b/turbopack/crates/turbopack-core/src/compile_time_info.rs @@ -263,7 +263,7 @@ impl CompileTimeInfo { } #[turbo_tasks::function] - pub async fn environment(&self) -> Result> { + pub fn environment(&self) -> Result> { Ok(self.environment) } } diff --git a/turbopack/crates/turbopack-core/src/environment.rs b/turbopack/crates/turbopack-core/src/environment.rs index dc56e8e795232..aa6e32c367f22 100644 --- a/turbopack/crates/turbopack-core/src/environment.rs +++ b/turbopack/crates/turbopack-core/src/environment.rs @@ -93,7 +93,7 @@ impl Environment { } #[turbo_tasks::function] - pub async fn node_externals(&self) -> Result> { + pub fn node_externals(&self) -> Result> { Ok(match self.execution { ExecutionEnvironment::NodeJsBuildTime(..) | ExecutionEnvironment::NodeJsLambda(_) => { Vc::cell(true) @@ -105,7 +105,7 @@ impl Environment { } #[turbo_tasks::function] - pub async fn supports_esm_externals(&self) -> Result> { + pub fn supports_esm_externals(&self) -> Result> { Ok(match self.execution { ExecutionEnvironment::NodeJsBuildTime(..) | ExecutionEnvironment::NodeJsLambda(_) => { Vc::cell(true) @@ -117,7 +117,7 @@ impl Environment { } #[turbo_tasks::function] - pub async fn supports_commonjs_externals(&self) -> Result> { + pub fn supports_commonjs_externals(&self) -> Result> { Ok(match self.execution { ExecutionEnvironment::NodeJsBuildTime(..) | ExecutionEnvironment::NodeJsLambda(_) => { Vc::cell(true) @@ -129,7 +129,7 @@ impl Environment { } #[turbo_tasks::function] - pub async fn supports_wasm(&self) -> Result> { + pub fn supports_wasm(&self) -> Result> { Ok(match self.execution { ExecutionEnvironment::NodeJsBuildTime(..) | ExecutionEnvironment::NodeJsLambda(_) => { Vc::cell(true) @@ -141,7 +141,7 @@ impl Environment { } #[turbo_tasks::function] - pub async fn resolve_extensions(&self) -> Result>> { + pub fn resolve_extensions(&self) -> Result>> { let env = self; Ok(match env.execution { ExecutionEnvironment::NodeJsBuildTime(..) | ExecutionEnvironment::NodeJsLambda(_) => { @@ -155,7 +155,7 @@ impl Environment { } #[turbo_tasks::function] - pub async fn resolve_node_modules(&self) -> Result> { + pub fn resolve_node_modules(&self) -> Result> { let env = self; Ok(match env.execution { ExecutionEnvironment::NodeJsBuildTime(..) | ExecutionEnvironment::NodeJsLambda(_) => { @@ -169,7 +169,7 @@ impl Environment { } #[turbo_tasks::function] - pub async fn resolve_conditions(&self) -> Result>> { + pub fn resolve_conditions(&self) -> Result>> { let env = self; Ok(match env.execution { ExecutionEnvironment::NodeJsBuildTime(..) | ExecutionEnvironment::NodeJsLambda(_) => { @@ -194,7 +194,7 @@ impl Environment { } #[turbo_tasks::function] - pub async fn rendering(&self) -> Result> { + pub fn rendering(&self) -> Result> { let env = self; Ok(match env.execution { ExecutionEnvironment::NodeJsBuildTime(_) | ExecutionEnvironment::NodeJsLambda(_) => { @@ -207,7 +207,7 @@ impl Environment { } #[turbo_tasks::function] - pub async fn chunk_loading(&self) -> Result> { + pub fn chunk_loading(&self) -> Result> { let env = self; Ok(match env.execution { ExecutionEnvironment::NodeJsBuildTime(_) | ExecutionEnvironment::NodeJsLambda(_) => { diff --git a/turbopack/crates/turbopack-core/src/issue/mod.rs b/turbopack/crates/turbopack-core/src/issue/mod.rs index eba0c4011983e..2ffa9d6d29ca4 100644 --- a/turbopack/crates/turbopack-core/src/issue/mod.rs +++ b/turbopack/crates/turbopack-core/src/issue/mod.rs @@ -368,7 +368,7 @@ pub struct CapturedIssues { #[turbo_tasks::value_impl] impl CapturedIssues { #[turbo_tasks::function] - pub async fn is_empty(&self) -> Result> { + pub fn is_empty(&self) -> Result> { Ok(Vc::cell(self.is_empty_ref())) } } @@ -761,7 +761,7 @@ impl PlainIssue { /// same issue to pass from multiple processing paths, making for overly /// verbose logging. #[turbo_tasks::function] - pub async fn internal_hash(&self, full: bool) -> Result> { + pub fn internal_hash(&self, full: bool) -> Result> { Ok(Vc::cell(self.internal_hash_ref(full))) } } diff --git a/turbopack/crates/turbopack-core/src/reference/mod.rs b/turbopack/crates/turbopack-core/src/reference/mod.rs index 09f44a9821b75..81859a482ed42 100644 --- a/turbopack/crates/turbopack-core/src/reference/mod.rs +++ b/turbopack/crates/turbopack-core/src/reference/mod.rs @@ -86,7 +86,7 @@ impl SingleModuleReference { /// The [Vc>] that this reference resolves to. #[turbo_tasks::function] - pub async fn asset(&self) -> Result>> { + pub fn asset(&self) -> Result>> { Ok(self.asset) } } @@ -132,7 +132,7 @@ impl SingleOutputAssetReference { /// The [Vc>] that this reference resolves to. #[turbo_tasks::function] - pub async fn asset(&self) -> Result>> { + pub fn asset(&self) -> Result>> { Ok(self.asset) } } diff --git a/turbopack/crates/turbopack-core/src/resolve/mod.rs b/turbopack/crates/turbopack-core/src/resolve/mod.rs index 667a234cec9ed..ae066ae897dcd 100644 --- a/turbopack/crates/turbopack-core/src/resolve/mod.rs +++ b/turbopack/crates/turbopack-core/src/resolve/mod.rs @@ -319,12 +319,12 @@ impl ModuleResolveResult { } #[turbo_tasks::function] - pub async fn is_unresolveable(&self) -> Result> { + pub fn is_unresolveable(&self) -> Result> { Ok(Vc::cell(self.is_unresolveable_ref())) } #[turbo_tasks::function] - pub async fn first_module(&self) -> Result> { + pub fn first_module(&self) -> Result> { Ok(Vc::cell(self.primary.iter().find_map( |(_, item)| match item { &ModuleResolveResultItem::Module(a) => Some(a), @@ -357,7 +357,7 @@ impl ModuleResolveResult { } #[turbo_tasks::function] - pub async fn primary_output_assets(&self) -> Result> { + pub fn primary_output_assets(&self) -> Result> { Ok(Vc::cell( self.primary .iter() @@ -847,12 +847,12 @@ impl ResolveResult { } #[turbo_tasks::function] - pub async fn is_unresolveable(&self) -> Result> { + pub fn is_unresolveable(&self) -> Result> { Ok(Vc::cell(self.is_unresolveable_ref())) } #[turbo_tasks::function] - pub async fn first_source(&self) -> Result> { + pub fn first_source(&self) -> Result> { Ok(Vc::cell(self.primary.iter().find_map(|(_, item)| { if let &ResolveResultItem::Source(a) = item { Some(a) @@ -863,7 +863,7 @@ impl ResolveResult { } #[turbo_tasks::function] - pub async fn primary_sources(&self) -> Result> { + pub fn primary_sources(&self) -> Result> { Ok(Vc::cell( self.primary .iter() @@ -883,7 +883,7 @@ impl ResolveResult { /// contains [RequestKey]s that don't have the `old_request_key` prefix, but if there are still /// some, they are discarded. #[turbo_tasks::function] - pub async fn with_replaced_request_key( + pub fn with_replaced_request_key( &self, old_request_key: RcStr, request_key: Value, @@ -953,7 +953,7 @@ impl ResolveResult { /// Returns a new [ResolveResult] where all [RequestKey]s are set to the /// passed `request`. #[turbo_tasks::function] - pub async fn with_request(&self, request: RcStr) -> Result> { + pub fn with_request(&self, request: RcStr) -> Result> { let new_primary = self .primary .iter() diff --git a/turbopack/crates/turbopack-core/src/source_map/source_map_asset.rs b/turbopack/crates/turbopack-core/src/source_map/source_map_asset.rs index a2a7a6ae61849..97944a69be620 100644 --- a/turbopack/crates/turbopack-core/src/source_map/source_map_asset.rs +++ b/turbopack/crates/turbopack-core/src/source_map/source_map_asset.rs @@ -28,7 +28,7 @@ impl SourceMapAsset { #[turbo_tasks::value_impl] impl OutputAsset for SourceMapAsset { #[turbo_tasks::function] - async fn ident(&self) -> Result> { + fn ident(&self) -> Result> { // NOTE(alexkirsz) We used to include the asset's version id in the path, // but this caused `all_assets_map` to be recomputed on every change. Ok(AssetIdent::from_path( diff --git a/turbopack/crates/turbopack-core/src/source_transform.rs b/turbopack/crates/turbopack-core/src/source_transform.rs index 64ea4f1311d60..bed7fde8692fe 100644 --- a/turbopack/crates/turbopack-core/src/source_transform.rs +++ b/turbopack/crates/turbopack-core/src/source_transform.rs @@ -14,7 +14,7 @@ pub struct SourceTransforms(Vec>>); #[turbo_tasks::value_impl] impl SourceTransforms { #[turbo_tasks::function] - pub async fn transform(&self, source: Vc>) -> Result>> { + pub fn transform(&self, source: Vc>) -> Result>> { Ok(self .0 .iter() diff --git a/turbopack/crates/turbopack-core/src/version.rs b/turbopack/crates/turbopack-core/src/version.rs index ac772c1a36403..9ab28c3477524 100644 --- a/turbopack/crates/turbopack-core/src/version.rs +++ b/turbopack/crates/turbopack-core/src/version.rs @@ -236,7 +236,7 @@ impl FileHashVersion { #[turbo_tasks::value_impl] impl Version for FileHashVersion { #[turbo_tasks::function] - async fn id(&self) -> Result> { + fn id(&self) -> Result> { Ok(Vc::cell(self.hash.clone())) } } @@ -250,7 +250,7 @@ pub struct VersionState { #[turbo_tasks::value_impl] impl VersionState { #[turbo_tasks::function] - pub async fn get(&self) -> Result>> { + pub fn get(&self) -> Result>> { let version = TraitRef::cell(self.version.get().clone()); Ok(version) } diff --git a/turbopack/crates/turbopack-css/src/asset.rs b/turbopack/crates/turbopack-css/src/asset.rs index fe4c9a21a059a..2b3830ca75e82 100644 --- a/turbopack/crates/turbopack-css/src/asset.rs +++ b/turbopack/crates/turbopack-css/src/asset.rs @@ -65,7 +65,7 @@ impl CssModuleAsset { /// Retrns the asset ident of the source without the "css" modifier #[turbo_tasks::function] - pub async fn source_ident(&self) -> Result> { + pub fn source_ident(&self) -> Result> { Ok(self.source.ident()) } } @@ -90,14 +90,14 @@ impl ParseCss for CssModuleAsset { #[turbo_tasks::value_impl] impl ProcessCss for CssModuleAsset { #[turbo_tasks::function] - async fn get_css_with_placeholder(self: Vc) -> Result> { + fn get_css_with_placeholder(self: Vc) -> Result> { let parse_result = self.parse_css(); Ok(process_css_with_placeholder(parse_result)) } #[turbo_tasks::function] - async fn finalize_css( + fn finalize_css( self: Vc, chunking_context: Vc>, ) -> Result> { @@ -192,7 +192,7 @@ impl ChunkItem for CssModuleChunkItem { } #[turbo_tasks::function] - async fn chunking_context(&self) -> Vc> { + fn chunking_context(&self) -> Vc> { Vc::upcast(self.chunking_context) } diff --git a/turbopack/crates/turbopack-css/src/chunk/single_item_chunk/chunk.rs b/turbopack/crates/turbopack-css/src/chunk/single_item_chunk/chunk.rs index b394b402566fa..3460f6ca8161e 100644 --- a/turbopack/crates/turbopack-css/src/chunk/single_item_chunk/chunk.rs +++ b/turbopack/crates/turbopack-css/src/chunk/single_item_chunk/chunk.rs @@ -100,7 +100,7 @@ fn single_item_modifier() -> Vc { #[turbo_tasks::value_impl] impl OutputAsset for SingleItemCssChunk { #[turbo_tasks::function] - async fn ident(&self) -> Result> { + fn ident(&self) -> Result> { Ok(AssetIdent::from_path( self.chunking_context.chunk_path( self.item diff --git a/turbopack/crates/turbopack-css/src/chunk/single_item_chunk/source_map.rs b/turbopack/crates/turbopack-css/src/chunk/single_item_chunk/source_map.rs index 1b0f42359dad1..d9b07ce9539ef 100644 --- a/turbopack/crates/turbopack-css/src/chunk/single_item_chunk/source_map.rs +++ b/turbopack/crates/turbopack-css/src/chunk/single_item_chunk/source_map.rs @@ -28,7 +28,7 @@ impl SingleItemCssChunkSourceMapAsset { #[turbo_tasks::value_impl] impl OutputAsset for SingleItemCssChunkSourceMapAsset { #[turbo_tasks::function] - async fn ident(&self) -> Result> { + fn ident(&self) -> Result> { Ok(AssetIdent::from_path( self.chunk.path().append(".map".into()), )) diff --git a/turbopack/crates/turbopack-css/src/chunk/source_map.rs b/turbopack/crates/turbopack-css/src/chunk/source_map.rs index 7be9a1b14f03e..840634b257072 100644 --- a/turbopack/crates/turbopack-css/src/chunk/source_map.rs +++ b/turbopack/crates/turbopack-css/src/chunk/source_map.rs @@ -28,7 +28,7 @@ impl CssChunkSourceMapAsset { #[turbo_tasks::value_impl] impl OutputAsset for CssChunkSourceMapAsset { #[turbo_tasks::function] - async fn ident(&self) -> Result> { + fn ident(&self) -> Result> { Ok(AssetIdent::from_path( self.chunk.path().append(".map".into()), )) diff --git a/turbopack/crates/turbopack-css/src/module_asset.rs b/turbopack/crates/turbopack-css/src/module_asset.rs index 23489a198d0bc..7afeebc834c3e 100644 --- a/turbopack/crates/turbopack-css/src/module_asset.rs +++ b/turbopack/crates/turbopack-css/src/module_asset.rs @@ -49,7 +49,7 @@ pub struct ModuleCssAsset { #[turbo_tasks::value_impl] impl ModuleCssAsset { #[turbo_tasks::function] - pub async fn new( + pub fn new( source: Vc>, asset_context: Vc>, ) -> Result> { @@ -152,7 +152,7 @@ struct ModuleCssClasses(IndexMap>); #[turbo_tasks::value_impl] impl ModuleCssAsset { #[turbo_tasks::function] - async fn inner(&self) -> Result> { + fn inner(&self) -> Result> { Ok(self.asset_context.process( self.source, Value::new(ReferenceType::Css(CssReferenceSubType::Internal)), @@ -234,7 +234,7 @@ impl ModuleCssAsset { #[turbo_tasks::value_impl] impl ChunkableModule for ModuleCssAsset { #[turbo_tasks::function] - async fn as_chunk_item( + fn as_chunk_item( self: Vc, chunking_context: Vc>, ) -> Result>> { @@ -288,7 +288,7 @@ impl ChunkItem for ModuleChunkItem { } #[turbo_tasks::function] - async fn chunking_context(&self) -> Vc> { + fn chunking_context(&self) -> Vc> { Vc::upcast(self.chunking_context) } @@ -439,7 +439,7 @@ impl Issue for CssModuleComposesIssue { } #[turbo_tasks::function] - async fn title(&self) -> Result> { + fn title(&self) -> Result> { Ok(StyledString::Text( "An issue occurred while resolving a CSS module `composes:` rule".into(), ) diff --git a/turbopack/crates/turbopack-css/src/references/mod.rs b/turbopack/crates/turbopack-css/src/references/mod.rs index 159dce8a4a487..b7579b4b5061d 100644 --- a/turbopack/crates/turbopack-css/src/references/mod.rs +++ b/turbopack/crates/turbopack-css/src/references/mod.rs @@ -239,7 +239,7 @@ impl<'a> Visitor<'_> for ModuleReferencesVisitor<'a> { } #[turbo_tasks::function] -pub async fn css_resolve( +pub fn css_resolve( origin: Vc>, request: Vc, ty: Value, diff --git a/turbopack/crates/turbopack-dev-server/src/html.rs b/turbopack/crates/turbopack-dev-server/src/html.rs index 907873b4f63b0..abb134fb237a6 100644 --- a/turbopack/crates/turbopack-dev-server/src/html.rs +++ b/turbopack/crates/turbopack-dev-server/src/html.rs @@ -241,7 +241,7 @@ struct DevHtmlAssetVersion { #[turbo_tasks::value_impl] impl Version for DevHtmlAssetVersion { #[turbo_tasks::function] - async fn id(&self) -> Result> { + fn id(&self) -> Result> { let mut hasher = Xxh3Hash64Hasher::new(); for relative_path in &*self.content.chunk_paths { hasher.write_ref(relative_path); diff --git a/turbopack/crates/turbopack-dev-server/src/source/conditional.rs b/turbopack/crates/turbopack-dev-server/src/source/conditional.rs index 6638ef21a6235..7d22af561452f 100644 --- a/turbopack/crates/turbopack-dev-server/src/source/conditional.rs +++ b/turbopack/crates/turbopack-dev-server/src/source/conditional.rs @@ -108,7 +108,7 @@ impl Introspectable for ConditionalContentSource { } #[turbo_tasks::function] - async fn details(&self) -> Result> { + fn details(&self) -> Result> { Ok(Vc::cell( if *self.activated.get() { "activated" diff --git a/turbopack/crates/turbopack-dev-server/src/source/router.rs b/turbopack/crates/turbopack-dev-server/src/source/router.rs index d62db2a1f891f..fea17074e90ef 100644 --- a/turbopack/crates/turbopack-dev-server/src/source/router.rs +++ b/turbopack/crates/turbopack-dev-server/src/source/router.rs @@ -25,7 +25,7 @@ pub struct PrefixedRouterContentSource { #[turbo_tasks::value_impl] impl PrefixedRouterContentSource { #[turbo_tasks::function] - pub async fn new( + pub fn new( prefix: Vc, routes: Vec<(RcStr, Vc>)>, fallback: Vc>, diff --git a/turbopack/crates/turbopack-dev-server/src/source/wrapping_source.rs b/turbopack/crates/turbopack-dev-server/src/source/wrapping_source.rs index 513e1704bf602..235c9c2ce0ed3 100644 --- a/turbopack/crates/turbopack-dev-server/src/source/wrapping_source.rs +++ b/turbopack/crates/turbopack-dev-server/src/source/wrapping_source.rs @@ -31,7 +31,7 @@ pub struct WrappedGetContentSourceContent { #[turbo_tasks::value_impl] impl WrappedGetContentSourceContent { #[turbo_tasks::function] - pub async fn new( + pub fn new( inner: Vc>, processor: Vc>, ) -> Vc { diff --git a/turbopack/crates/turbopack-ecmascript-plugins/src/transform/swc_ecma_transform_plugins.rs b/turbopack/crates/turbopack-ecmascript-plugins/src/transform/swc_ecma_transform_plugins.rs index 359c89433c3cc..fe7a4be6a92cd 100644 --- a/turbopack/crates/turbopack-ecmascript-plugins/src/transform/swc_ecma_transform_plugins.rs +++ b/turbopack/crates/turbopack-ecmascript-plugins/src/transform/swc_ecma_transform_plugins.rs @@ -64,7 +64,7 @@ impl Issue for UnsupportedSwcEcmaTransformPluginsIssue { } #[turbo_tasks::function] - async fn title(&self) -> Result> { + fn title(&self) -> Result> { Ok(StyledString::Text( "Unsupported SWC EcmaScript transform plugins on this platform.".into(), ) diff --git a/turbopack/crates/turbopack-ecmascript/src/async_chunk/chunk_item.rs b/turbopack/crates/turbopack-ecmascript/src/async_chunk/chunk_item.rs index 4bd5cb2de7c14..77134077a1cf9 100644 --- a/turbopack/crates/turbopack-ecmascript/src/async_chunk/chunk_item.rs +++ b/turbopack/crates/turbopack-ecmascript/src/async_chunk/chunk_item.rs @@ -196,7 +196,7 @@ impl ChunkItem for AsyncLoaderChunkItem { } #[turbo_tasks::function] - async fn chunking_context(&self) -> Vc> { + fn chunking_context(&self) -> Vc> { Vc::upcast(self.chunking_context) } diff --git a/turbopack/crates/turbopack-ecmascript/src/async_chunk/module.rs b/turbopack/crates/turbopack-ecmascript/src/async_chunk/module.rs index 460067b09c86a..94daedfed109f 100644 --- a/turbopack/crates/turbopack-ecmascript/src/async_chunk/module.rs +++ b/turbopack/crates/turbopack-ecmascript/src/async_chunk/module.rs @@ -77,7 +77,7 @@ impl Asset for AsyncLoaderModule { #[turbo_tasks::value_impl] impl ChunkableModule for AsyncLoaderModule { #[turbo_tasks::function] - async fn as_chunk_item( + fn as_chunk_item( self: Vc, chunking_context: Vc>, ) -> Result>> { diff --git a/turbopack/crates/turbopack-ecmascript/src/chunk/mod.rs b/turbopack/crates/turbopack-ecmascript/src/chunk/mod.rs index 7b7722c34c4f0..ff631b9d6f80d 100644 --- a/turbopack/crates/turbopack-ecmascript/src/chunk/mod.rs +++ b/turbopack/crates/turbopack-ecmascript/src/chunk/mod.rs @@ -45,7 +45,7 @@ pub struct EcmascriptChunks(Vec>); #[turbo_tasks::value_impl] impl EcmascriptChunk { #[turbo_tasks::function] - pub async fn new( + pub fn new( chunking_context: Vc>, content: Vc, ) -> Result> { @@ -57,7 +57,7 @@ impl EcmascriptChunk { } #[turbo_tasks::function] - pub async fn entry_ids(self: Vc) -> Result> { + pub fn entry_ids(self: Vc) -> Result> { // TODO return something usefull Ok(Vc::cell(Default::default())) } diff --git a/turbopack/crates/turbopack-ecmascript/src/chunk_group_files_asset.rs b/turbopack/crates/turbopack-ecmascript/src/chunk_group_files_asset.rs index 70597412421de..fd9c8d972b34e 100644 --- a/turbopack/crates/turbopack-ecmascript/src/chunk_group_files_asset.rs +++ b/turbopack/crates/turbopack-ecmascript/src/chunk_group_files_asset.rs @@ -214,7 +214,7 @@ impl ChunkItem for ChunkGroupFilesChunkItem { } #[turbo_tasks::function] - async fn chunking_context(&self) -> Vc> { + fn chunking_context(&self) -> Vc> { Vc::upcast(self.chunking_context) } @@ -249,7 +249,7 @@ impl Introspectable for ChunkGroupFilesAsset { } #[turbo_tasks::function] - async fn children(&self) -> Result> { + fn children(&self) -> Result> { let mut children = IndexSet::new(); children.insert(( Vc::cell("inner asset".into()), diff --git a/turbopack/crates/turbopack-ecmascript/src/lib.rs b/turbopack/crates/turbopack-ecmascript/src/lib.rs index 8dd6ae8752de0..4b45c88067ab7 100644 --- a/turbopack/crates/turbopack-ecmascript/src/lib.rs +++ b/turbopack/crates/turbopack-ecmascript/src/lib.rs @@ -352,12 +352,12 @@ impl EcmascriptParsable for EcmascriptModuleAsset { } #[turbo_tasks::function] - async fn parse_original(self: Vc) -> Result> { + fn parse_original(self: Vc) -> Result> { Ok(self.failsafe_parse()) } #[turbo_tasks::function] - async fn ty(&self) -> Result> { + fn ty(&self) -> Result> { Ok(self.ty.cell()) } } @@ -461,7 +461,7 @@ impl EcmascriptModuleAsset { } #[turbo_tasks::function] - pub async fn source(&self) -> Result>> { + pub fn source(&self) -> Result>> { Ok(self.source) } @@ -471,7 +471,7 @@ impl EcmascriptModuleAsset { } #[turbo_tasks::function] - pub async fn options(&self) -> Result> { + pub fn options(&self) -> Result> { Ok(self.options) } @@ -569,7 +569,7 @@ impl Asset for EcmascriptModuleAsset { #[turbo_tasks::value_impl] impl ChunkableModule for EcmascriptModuleAsset { #[turbo_tasks::function] - async fn as_chunk_item( + fn as_chunk_item( self: Vc, chunking_context: Vc>, ) -> Result>> { @@ -641,7 +641,7 @@ impl ChunkItem for ModuleChunkItem { } #[turbo_tasks::function] - async fn chunking_context(&self) -> Vc> { + fn chunking_context(&self) -> Vc> { Vc::upcast(self.chunking_context) } diff --git a/turbopack/crates/turbopack-ecmascript/src/manifest/chunk_asset.rs b/turbopack/crates/turbopack-ecmascript/src/manifest/chunk_asset.rs index fd09ddb4451c9..eed27101735f8 100644 --- a/turbopack/crates/turbopack-ecmascript/src/manifest/chunk_asset.rs +++ b/turbopack/crates/turbopack-ecmascript/src/manifest/chunk_asset.rs @@ -52,7 +52,7 @@ impl ManifestAsyncModule { } #[turbo_tasks::function] - pub(super) async fn chunks(&self) -> Result> { + pub(super) fn chunks(&self) -> Result> { Ok(self .chunking_context .chunk_group_assets(Vc::upcast(self.inner), Value::new(self.availability_info))) @@ -139,7 +139,7 @@ impl Asset for ManifestAsyncModule { #[turbo_tasks::value_impl] impl ChunkableModule for ManifestAsyncModule { #[turbo_tasks::function] - async fn as_chunk_item( + fn as_chunk_item( self: Vc, chunking_context: Vc>, ) -> Result>> { diff --git a/turbopack/crates/turbopack-ecmascript/src/manifest/chunk_item.rs b/turbopack/crates/turbopack-ecmascript/src/manifest/chunk_item.rs index 5ffb3d1b7a445..4d09a1aac005e 100644 --- a/turbopack/crates/turbopack-ecmascript/src/manifest/chunk_item.rs +++ b/turbopack/crates/turbopack-ecmascript/src/manifest/chunk_item.rs @@ -29,7 +29,7 @@ pub(super) struct ManifestChunkItem { #[turbo_tasks::value_impl] impl ManifestChunkItem { #[turbo_tasks::function] - async fn chunks_data(&self) -> Result> { + fn chunks_data(&self) -> Result> { Ok(ChunkData::from_assets( self.chunking_context.output_root(), self.manifest.chunks(), @@ -97,7 +97,7 @@ impl ChunkItem for ManifestChunkItem { } #[turbo_tasks::function] - async fn chunking_context(&self) -> Vc> { + fn chunking_context(&self) -> Vc> { Vc::upcast(self.chunking_context) } diff --git a/turbopack/crates/turbopack-ecmascript/src/manifest/loader_item.rs b/turbopack/crates/turbopack-ecmascript/src/manifest/loader_item.rs index 2c5c627572e46..ece48fa38f8b1 100644 --- a/turbopack/crates/turbopack-ecmascript/src/manifest/loader_item.rs +++ b/turbopack/crates/turbopack-ecmascript/src/manifest/loader_item.rs @@ -58,7 +58,7 @@ impl ManifestLoaderChunkItem { } #[turbo_tasks::function] - pub async fn chunks_data(&self) -> Result> { + pub fn chunks_data(&self) -> Result> { let chunks = self.manifest.manifest_chunks(); Ok(ChunkData::from_assets( self.chunking_context.output_root(), @@ -124,7 +124,7 @@ impl ChunkItem for ManifestLoaderChunkItem { } #[turbo_tasks::function] - async fn chunking_context(&self) -> Result>> { + fn chunking_context(&self) -> Result>> { Ok(Vc::upcast(self.chunking_context)) } diff --git a/turbopack/crates/turbopack-ecmascript/src/references/async_module.rs b/turbopack/crates/turbopack-ecmascript/src/references/async_module.rs index 22ae8dff2ac89..72635f242690c 100644 --- a/turbopack/crates/turbopack-ecmascript/src/references/async_module.rs +++ b/turbopack/crates/turbopack-ecmascript/src/references/async_module.rs @@ -173,7 +173,7 @@ impl AsyncModule { /// Returns #[turbo_tasks::function] - pub async fn module_options( + pub fn module_options( &self, async_module_info: Option>, ) -> Result> { diff --git a/turbopack/crates/turbopack-ecmascript/src/references/esm/url.rs b/turbopack/crates/turbopack-ecmascript/src/references/esm/url.rs index 89bf7cf20dc74..85461158f1e29 100644 --- a/turbopack/crates/turbopack-ecmascript/src/references/esm/url.rs +++ b/turbopack/crates/turbopack-ecmascript/src/references/esm/url.rs @@ -90,7 +90,7 @@ impl UrlAssetReference { #[turbo_tasks::value_impl] impl ModuleReference for UrlAssetReference { #[turbo_tasks::function] - async fn resolve_reference(&self) -> Vc { + fn resolve_reference(&self) -> Vc { url_resolve( self.origin, self.request, diff --git a/turbopack/crates/turbopack-ecmascript/src/references/external_module.rs b/turbopack/crates/turbopack-ecmascript/src/references/external_module.rs index 65e16b175fbce..7b2f8876f9582 100644 --- a/turbopack/crates/turbopack-ecmascript/src/references/external_module.rs +++ b/turbopack/crates/turbopack-ecmascript/src/references/external_module.rs @@ -122,7 +122,7 @@ impl Asset for CachedExternalModule { #[turbo_tasks::value_impl] impl ChunkableModule for CachedExternalModule { #[turbo_tasks::function] - async fn as_chunk_item( + fn as_chunk_item( self: Vc, chunking_context: Vc>, ) -> Result>> { @@ -227,7 +227,7 @@ impl EcmascriptChunkItem for CachedExternalModuleChunkItem { } #[turbo_tasks::function] - async fn content_with_async_module_info( + fn content_with_async_module_info( &self, async_module_info: Option>, ) -> Result> { diff --git a/turbopack/crates/turbopack-ecmascript/src/references/require_context.rs b/turbopack/crates/turbopack-ecmascript/src/references/require_context.rs index 6c1db7bd6412d..8a067f9dd16fd 100644 --- a/turbopack/crates/turbopack-ecmascript/src/references/require_context.rs +++ b/turbopack/crates/turbopack-ecmascript/src/references/require_context.rs @@ -317,7 +317,7 @@ impl ModuleReference for ResolvedModuleReference { #[turbo_tasks::value_impl] impl ValueToString for ResolvedModuleReference { #[turbo_tasks::function] - async fn to_string(&self) -> Result> { + fn to_string(&self) -> Result> { Ok(Vc::cell("resolved reference".into())) } } @@ -509,7 +509,7 @@ impl ChunkItem for RequireContextChunkItem { } #[turbo_tasks::function] - async fn chunking_context(&self) -> Vc> { + fn chunking_context(&self) -> Vc> { Vc::upcast(self.chunking_context) } diff --git a/turbopack/crates/turbopack-ecmascript/src/side_effect_optimization/facade/module.rs b/turbopack/crates/turbopack-ecmascript/src/side_effect_optimization/facade/module.rs index 9546c7e0dd436..b8de4653482b9 100644 --- a/turbopack/crates/turbopack-ecmascript/src/side_effect_optimization/facade/module.rs +++ b/turbopack/crates/turbopack-ecmascript/src/side_effect_optimization/facade/module.rs @@ -61,7 +61,7 @@ impl EcmascriptModuleFacadeModule { #[turbo_tasks::value_impl] impl Module for EcmascriptModuleFacadeModule { #[turbo_tasks::function] - async fn ident(&self) -> Result> { + fn ident(&self) -> Result> { let inner = self.module.ident(); Ok(inner.with_part(self.ty)) @@ -135,7 +135,7 @@ impl Module for EcmascriptModuleFacadeModule { #[turbo_tasks::value_impl] impl Asset for EcmascriptModuleFacadeModule { #[turbo_tasks::function] - async fn content(&self) -> Result> { + fn content(&self) -> Result> { let f = File::from(""); Ok(AssetContent::file(FileContent::Content(f).cell())) @@ -283,7 +283,7 @@ impl EcmascriptChunkPlaceable for EcmascriptModuleFacadeModule { #[turbo_tasks::value_impl] impl ChunkableModule for EcmascriptModuleFacadeModule { #[turbo_tasks::function] - async fn as_chunk_item( + fn as_chunk_item( self: Vc, chunking_context: Vc>, ) -> Result>> { diff --git a/turbopack/crates/turbopack-ecmascript/src/side_effect_optimization/locals/module.rs b/turbopack/crates/turbopack-ecmascript/src/side_effect_optimization/locals/module.rs index 0cc104ef0b999..97b20bbcdcfbb 100644 --- a/turbopack/crates/turbopack-ecmascript/src/side_effect_optimization/locals/module.rs +++ b/turbopack/crates/turbopack-ecmascript/src/side_effect_optimization/locals/module.rs @@ -41,7 +41,7 @@ impl EcmascriptModuleLocalsModule { #[turbo_tasks::value_impl] impl Module for EcmascriptModuleLocalsModule { #[turbo_tasks::function] - async fn ident(&self) -> Result> { + fn ident(&self) -> Result> { let inner = self.module.ident(); Ok(inner.with_part(ModulePart::locals())) @@ -112,7 +112,7 @@ impl EcmascriptChunkPlaceable for EcmascriptModuleLocalsModule { #[turbo_tasks::value_impl] impl ChunkableModule for EcmascriptModuleLocalsModule { #[turbo_tasks::function] - async fn as_chunk_item( + fn as_chunk_item( self: Vc, chunking_context: Vc>, ) -> Result>> { diff --git a/turbopack/crates/turbopack-ecmascript/src/tree_shake/asset.rs b/turbopack/crates/turbopack-ecmascript/src/tree_shake/asset.rs index 955bda93d8b0f..155ec5a95872b 100644 --- a/turbopack/crates/turbopack-ecmascript/src/tree_shake/asset.rs +++ b/turbopack/crates/turbopack-ecmascript/src/tree_shake/asset.rs @@ -49,7 +49,7 @@ impl EcmascriptParsable for EcmascriptModulePartAsset { } #[turbo_tasks::function] - async fn ty(&self) -> Result> { + fn ty(&self) -> Result> { Ok(self.full_module.ty()) } } @@ -57,18 +57,18 @@ impl EcmascriptParsable for EcmascriptModulePartAsset { #[turbo_tasks::value_impl] impl EcmascriptAnalyzable for EcmascriptModulePartAsset { #[turbo_tasks::function] - async fn analyze(&self) -> Result> { + fn analyze(&self) -> Result> { let part = self.part; Ok(analyse_ecmascript_module(self.full_module, Some(part))) } #[turbo_tasks::function] - async fn module_content_without_analysis(&self) -> Result> { + fn module_content_without_analysis(&self) -> Result> { Ok(self.full_module.module_content_without_analysis()) } #[turbo_tasks::function] - async fn module_content( + fn module_content( &self, chunking_context: Vc>, async_module_info: Option>, @@ -204,7 +204,7 @@ impl EcmascriptChunkPlaceable for EcmascriptModulePartAsset { #[turbo_tasks::value_impl] impl ChunkableModule for EcmascriptModulePartAsset { #[turbo_tasks::function] - async fn as_chunk_item( + fn as_chunk_item( self: Vc, chunking_context: Vc>, ) -> Result>> { @@ -221,7 +221,7 @@ impl ChunkableModule for EcmascriptModulePartAsset { #[turbo_tasks::value_impl] impl EcmascriptModulePartAsset { #[turbo_tasks::function] - pub(super) async fn analyze(&self) -> Result> { + pub(super) fn analyze(&self) -> Result> { Ok(analyze(self.full_module, self.part)) } } diff --git a/turbopack/crates/turbopack-ecmascript/src/tree_shake/chunk_item.rs b/turbopack/crates/turbopack-ecmascript/src/tree_shake/chunk_item.rs index e7efeef2a0d2a..ef58aa17deeea 100644 --- a/turbopack/crates/turbopack-ecmascript/src/tree_shake/chunk_item.rs +++ b/turbopack/crates/turbopack-ecmascript/src/tree_shake/chunk_item.rs @@ -75,17 +75,17 @@ impl EcmascriptChunkItem for EcmascriptModulePartChunkItem { #[turbo_tasks::value_impl] impl ChunkItem for EcmascriptModulePartChunkItem { #[turbo_tasks::function] - async fn references(&self) -> Vc { + fn references(&self) -> Vc { self.module.references() } #[turbo_tasks::function] - async fn asset_ident(&self) -> Result> { + fn asset_ident(&self) -> Result> { Ok(self.module.ident()) } #[turbo_tasks::function] - async fn chunking_context(&self) -> Vc> { + fn chunking_context(&self) -> Vc> { Vc::upcast(self.chunking_context) } diff --git a/turbopack/crates/turbopack-ecmascript/src/webpack/mod.rs b/turbopack/crates/turbopack-ecmascript/src/webpack/mod.rs index 8e0630f76ef74..3a332a812daf3 100644 --- a/turbopack/crates/turbopack-ecmascript/src/webpack/mod.rs +++ b/turbopack/crates/turbopack-ecmascript/src/webpack/mod.rs @@ -147,7 +147,7 @@ impl ModuleReference for WebpackEntryAssetReference { #[turbo_tasks::value_impl] impl ValueToString for WebpackEntryAssetReference { #[turbo_tasks::function] - async fn to_string(&self) -> Result> { + fn to_string(&self) -> Result> { Ok(Vc::cell("webpack entry".into())) } } diff --git a/turbopack/crates/turbopack-ecmascript/src/worker_chunk/chunk_item.rs b/turbopack/crates/turbopack-ecmascript/src/worker_chunk/chunk_item.rs index 29e9e10d37c92..174c3d8a8a994 100644 --- a/turbopack/crates/turbopack-ecmascript/src/worker_chunk/chunk_item.rs +++ b/turbopack/crates/turbopack-ecmascript/src/worker_chunk/chunk_item.rs @@ -112,7 +112,7 @@ impl ChunkItem for WorkerLoaderChunkItem { } #[turbo_tasks::function] - async fn content_ident(&self) -> Result> { + fn content_ident(&self) -> Result> { Ok(self.module.ident()) } @@ -136,7 +136,7 @@ impl ChunkItem for WorkerLoaderChunkItem { } #[turbo_tasks::function] - async fn chunking_context(&self) -> Vc> { + fn chunking_context(&self) -> Vc> { Vc::upcast(self.chunking_context) } diff --git a/turbopack/crates/turbopack-ecmascript/src/worker_chunk/module.rs b/turbopack/crates/turbopack-ecmascript/src/worker_chunk/module.rs index 547f1cd745539..3468d9734930b 100644 --- a/turbopack/crates/turbopack-ecmascript/src/worker_chunk/module.rs +++ b/turbopack/crates/turbopack-ecmascript/src/worker_chunk/module.rs @@ -67,7 +67,7 @@ impl Asset for WorkerLoaderModule { #[turbo_tasks::value_impl] impl ChunkableModule for WorkerLoaderModule { #[turbo_tasks::function] - async fn as_chunk_item( + fn as_chunk_item( self: Vc, chunking_context: Vc>, ) -> Result>> { diff --git a/turbopack/crates/turbopack-json/src/lib.rs b/turbopack/crates/turbopack-json/src/lib.rs index 0005a466f7914..af2d42ab2e17e 100644 --- a/turbopack/crates/turbopack-json/src/lib.rs +++ b/turbopack/crates/turbopack-json/src/lib.rs @@ -63,7 +63,7 @@ impl Asset for JsonModuleAsset { #[turbo_tasks::value_impl] impl ChunkableModule for JsonModuleAsset { #[turbo_tasks::function] - async fn as_chunk_item( + fn as_chunk_item( self: Vc, chunking_context: Vc>, ) -> Result>> { @@ -101,7 +101,7 @@ impl ChunkItem for JsonChunkItem { } #[turbo_tasks::function] - async fn chunking_context(&self) -> Vc> { + fn chunking_context(&self) -> Vc> { Vc::upcast(self.chunking_context) } diff --git a/turbopack/crates/turbopack-node/src/execution_context.rs b/turbopack/crates/turbopack-node/src/execution_context.rs index 8efd14203348a..1b831721c52d8 100644 --- a/turbopack/crates/turbopack-node/src/execution_context.rs +++ b/turbopack/crates/turbopack-node/src/execution_context.rs @@ -28,17 +28,17 @@ impl ExecutionContext { } #[turbo_tasks::function] - pub async fn project_path(&self) -> Result> { + pub fn project_path(&self) -> Result> { Ok(self.project_path) } #[turbo_tasks::function] - pub async fn chunking_context(&self) -> Result>> { + pub fn chunking_context(&self) -> Result>> { Ok(self.chunking_context) } #[turbo_tasks::function] - pub async fn env(&self) -> Result>> { + pub fn env(&self) -> Result>> { Ok(self.env) } } diff --git a/turbopack/crates/turbopack-node/src/lib.rs b/turbopack/crates/turbopack-node/src/lib.rs index f0d46a35b5b5c..3aadebbfaf0c0 100644 --- a/turbopack/crates/turbopack-node/src/lib.rs +++ b/turbopack/crates/turbopack-node/src/lib.rs @@ -257,7 +257,7 @@ pub async fn get_renderer_pool( /// Converts a module graph into node.js executable assets #[turbo_tasks::function] -pub async fn get_intermediate_asset( +pub fn get_intermediate_asset( chunking_context: Vc>, main_entry: Vc>, other_entries: Vc, diff --git a/turbopack/crates/turbopack-node/src/render/node_api_source.rs b/turbopack/crates/turbopack-node/src/render/node_api_source.rs index 0bf1b729dee00..8b83c3961b517 100644 --- a/turbopack/crates/turbopack-node/src/render/node_api_source.rs +++ b/turbopack/crates/turbopack-node/src/render/node_api_source.rs @@ -71,7 +71,7 @@ pub struct NodeApiContentSource { #[turbo_tasks::value_impl] impl NodeApiContentSource { #[turbo_tasks::function] - pub async fn get_pathname(&self) -> Result> { + pub fn get_pathname(&self) -> Result> { Ok(self.pathname) } } diff --git a/turbopack/crates/turbopack-node/src/render/rendered_source.rs b/turbopack/crates/turbopack-node/src/render/rendered_source.rs index d495af48e0b3c..cf0d5851ff47b 100644 --- a/turbopack/crates/turbopack-node/src/render/rendered_source.rs +++ b/turbopack/crates/turbopack-node/src/render/rendered_source.rs @@ -99,7 +99,7 @@ pub struct NodeRenderContentSource { #[turbo_tasks::value_impl] impl NodeRenderContentSource { #[turbo_tasks::function] - pub async fn get_pathname(&self) -> Result> { + pub fn get_pathname(&self) -> Result> { Ok(self.pathname) } } diff --git a/turbopack/crates/turbopack-node/src/source_map/trace.rs b/turbopack/crates/turbopack-node/src/source_map/trace.rs index 422cfd02d960f..3c858cddc86fc 100644 --- a/turbopack/crates/turbopack-node/src/source_map/trace.rs +++ b/turbopack/crates/turbopack-node/src/source_map/trace.rs @@ -102,12 +102,7 @@ pub enum TraceResult { #[turbo_tasks::value_impl] impl SourceMapTrace { #[turbo_tasks::function] - pub async fn new( - map: Vc, - line: usize, - column: usize, - name: Option, - ) -> Vc { + pub fn new(map: Vc, line: usize, column: usize, name: Option) -> Vc { SourceMapTrace { map, line, diff --git a/turbopack/crates/turbopack-node/src/transforms/postcss.rs b/turbopack/crates/turbopack-node/src/transforms/postcss.rs index 2cabfa001dbbf..af9f2fc6267e8 100644 --- a/turbopack/crates/turbopack-node/src/transforms/postcss.rs +++ b/turbopack/crates/turbopack-node/src/transforms/postcss.rs @@ -356,7 +356,7 @@ pub(crate) async fn config_loader_source( } #[turbo_tasks::function] -async fn postcss_executor( +fn postcss_executor( asset_context: Vc>, project_path: Vc, postcss_config_path: Vc, diff --git a/turbopack/crates/turbopack-node/src/transforms/webpack.rs b/turbopack/crates/turbopack-node/src/transforms/webpack.rs index a864721f10874..118808443a248 100644 --- a/turbopack/crates/turbopack-node/src/transforms/webpack.rs +++ b/turbopack/crates/turbopack-node/src/transforms/webpack.rs @@ -820,7 +820,7 @@ impl Issue for EvaluateErrorLoggingIssue { } #[turbo_tasks::function] - async fn description(&self) -> Result> { + fn description(&self) -> Result> { fn fmt_args(prefix: String, args: &[JsonValue]) -> String { let mut iter = args.iter(); let Some(first) = iter.next() else { diff --git a/turbopack/crates/turbopack-nodejs/src/chunking_context.rs b/turbopack/crates/turbopack-nodejs/src/chunking_context.rs index ebb93170b7c49..c764bb20afd44 100644 --- a/turbopack/crates/turbopack-nodejs/src/chunking_context.rs +++ b/turbopack/crates/turbopack-nodejs/src/chunking_context.rs @@ -363,7 +363,7 @@ impl ChunkingContext for NodeJsChunkingContext { } #[turbo_tasks::function] - async fn chunk_item_id_from_ident(&self, ident: Vc) -> Result> { + fn chunk_item_id_from_ident(&self, ident: Vc) -> Result> { Ok(self.module_id_strategy.get_module_id(ident)) } diff --git a/turbopack/crates/turbopack-nodejs/src/ecmascript/node/chunk.rs b/turbopack/crates/turbopack-nodejs/src/ecmascript/node/chunk.rs index a06e53d7ef58c..9bb2679641de4 100644 --- a/turbopack/crates/turbopack-nodejs/src/ecmascript/node/chunk.rs +++ b/turbopack/crates/turbopack-nodejs/src/ecmascript/node/chunk.rs @@ -41,7 +41,7 @@ impl EcmascriptBuildNodeChunk { #[turbo_tasks::value_impl] impl ValueToString for EcmascriptBuildNodeChunk { #[turbo_tasks::function] - async fn to_string(&self) -> Result> { + fn to_string(&self) -> Result> { Ok(Vc::cell("Ecmascript Build Node Chunk".into())) } } diff --git a/turbopack/crates/turbopack-nodejs/src/ecmascript/node/content.rs b/turbopack/crates/turbopack-nodejs/src/ecmascript/node/content.rs index 435b806d6b772..58394fe768e14 100644 --- a/turbopack/crates/turbopack-nodejs/src/ecmascript/node/content.rs +++ b/turbopack/crates/turbopack-nodejs/src/ecmascript/node/content.rs @@ -31,7 +31,7 @@ pub(super) struct EcmascriptBuildNodeChunkContent { #[turbo_tasks::value_impl] impl EcmascriptBuildNodeChunkContent { #[turbo_tasks::function] - pub(crate) async fn new( + pub(crate) fn new( chunking_context: Vc, chunk: Vc, content: Vc, diff --git a/turbopack/crates/turbopack-nodejs/src/ecmascript/node/entry/chunk.rs b/turbopack/crates/turbopack-nodejs/src/ecmascript/node/entry/chunk.rs index 847336a64b821..06f5c37e01ad5 100644 --- a/turbopack/crates/turbopack-nodejs/src/ecmascript/node/entry/chunk.rs +++ b/turbopack/crates/turbopack-nodejs/src/ecmascript/node/entry/chunk.rs @@ -144,7 +144,7 @@ impl EcmascriptBuildNodeEntryChunk { } #[turbo_tasks::function] - async fn runtime_chunk(&self) -> Result> { + fn runtime_chunk(&self) -> Result> { Ok(EcmascriptBuildNodeRuntimeChunk::new(self.chunking_context)) } } @@ -152,7 +152,7 @@ impl EcmascriptBuildNodeEntryChunk { #[turbo_tasks::value_impl] impl ValueToString for EcmascriptBuildNodeEntryChunk { #[turbo_tasks::function] - async fn to_string(&self) -> Result> { + fn to_string(&self) -> Result> { Ok(Vc::cell("Ecmascript Build Node Evaluate Chunk".into())) } } diff --git a/turbopack/crates/turbopack-nodejs/src/ecmascript/node/entry/runtime.rs b/turbopack/crates/turbopack-nodejs/src/ecmascript/node/entry/runtime.rs index 25e7f37ac389d..c0a1f580548b7 100644 --- a/turbopack/crates/turbopack-nodejs/src/ecmascript/node/entry/runtime.rs +++ b/turbopack/crates/turbopack-nodejs/src/ecmascript/node/entry/runtime.rs @@ -91,7 +91,7 @@ impl EcmascriptBuildNodeRuntimeChunk { #[turbo_tasks::value_impl] impl ValueToString for EcmascriptBuildNodeRuntimeChunk { #[turbo_tasks::function] - async fn to_string(&self) -> Result> { + fn to_string(&self) -> Result> { Ok(Vc::cell("Ecmascript Build Node Runtime Chunk".into())) } } diff --git a/turbopack/crates/turbopack-resolve/src/typescript.rs b/turbopack/crates/turbopack-resolve/src/typescript.rs index e144b8394e3d7..18daee0caae02 100644 --- a/turbopack/crates/turbopack-resolve/src/typescript.rs +++ b/turbopack/crates/turbopack-resolve/src/typescript.rs @@ -519,7 +519,7 @@ impl Issue for TsConfigIssue { } #[turbo_tasks::function] - async fn title(&self) -> Result> { + fn title(&self) -> Result> { Ok( StyledString::Text("An issue occurred while parsing a tsconfig.json file.".into()) .cell(), diff --git a/turbopack/crates/turbopack-static/src/fixed.rs b/turbopack/crates/turbopack-static/src/fixed.rs index b5c2831e1ba9f..45c2924d6b69e 100644 --- a/turbopack/crates/turbopack-static/src/fixed.rs +++ b/turbopack/crates/turbopack-static/src/fixed.rs @@ -31,7 +31,7 @@ impl FixedStaticAsset { #[turbo_tasks::value_impl] impl OutputAsset for FixedStaticAsset { #[turbo_tasks::function] - async fn ident(&self) -> Result> { + fn ident(&self) -> Result> { Ok(AssetIdent::from_path(self.output_path)) } } diff --git a/turbopack/crates/turbopack-static/src/lib.rs b/turbopack/crates/turbopack-static/src/lib.rs index 6f57d24106011..51b47a37cb748 100644 --- a/turbopack/crates/turbopack-static/src/lib.rs +++ b/turbopack/crates/turbopack-static/src/lib.rs @@ -60,7 +60,7 @@ impl StaticModuleAsset { } #[turbo_tasks::function] - async fn static_asset( + fn static_asset( &self, chunking_context: Vc>, ) -> Result> { @@ -90,7 +90,7 @@ impl Asset for StaticModuleAsset { #[turbo_tasks::value_impl] impl ChunkableModule for StaticModuleAsset { #[turbo_tasks::function] - async fn as_chunk_item( + fn as_chunk_item( self: Vc, chunking_context: Vc>, ) -> Result>> { @@ -139,7 +139,7 @@ impl ChunkItem for ModuleChunkItem { } #[turbo_tasks::function] - async fn chunking_context(&self) -> Vc> { + fn chunking_context(&self) -> Vc> { Vc::upcast(self.chunking_context) } diff --git a/turbopack/crates/turbopack-wasm/src/loader.rs b/turbopack/crates/turbopack-wasm/src/loader.rs index 1a16107aaf960..661e304348d49 100644 --- a/turbopack/crates/turbopack-wasm/src/loader.rs +++ b/turbopack/crates/turbopack-wasm/src/loader.rs @@ -62,7 +62,7 @@ pub(crate) async fn instantiating_loader_source( /// Create a javascript loader to compile the WebAssembly module and export it /// without instantiating. #[turbo_tasks::function] -pub(crate) async fn compiling_loader_source( +pub(crate) fn compiling_loader_source( source: Vc, ) -> Result>> { let code: RcStr = formatdoc! { diff --git a/turbopack/crates/turbopack-wasm/src/module_asset.rs b/turbopack/crates/turbopack-wasm/src/module_asset.rs index da3381b6923e4..9475f5f030017 100644 --- a/turbopack/crates/turbopack-wasm/src/module_asset.rs +++ b/turbopack/crates/turbopack-wasm/src/module_asset.rs @@ -117,7 +117,7 @@ impl Module for WebAssemblyModuleAsset { } #[turbo_tasks::function] - async fn references(self: Vc) -> Vc { + fn references(self: Vc) -> Vc { self.loader().references() } } @@ -133,7 +133,7 @@ impl Asset for WebAssemblyModuleAsset { #[turbo_tasks::value_impl] impl ChunkableModule for WebAssemblyModuleAsset { #[turbo_tasks::function] - async fn as_chunk_item( + fn as_chunk_item( self: Vc, chunking_context: Vc>, ) -> Result>> { @@ -192,7 +192,7 @@ impl ChunkItem for ModuleChunkItem { } #[turbo_tasks::function] - async fn references(&self) -> Result> { + fn references(&self) -> Result> { let loader = self .module .loader() @@ -202,7 +202,7 @@ impl ChunkItem for ModuleChunkItem { } #[turbo_tasks::function] - async fn chunking_context(&self) -> Vc> { + fn chunking_context(&self) -> Vc> { Vc::upcast(self.chunking_context) } diff --git a/turbopack/crates/turbopack-wasm/src/output_asset.rs b/turbopack/crates/turbopack-wasm/src/output_asset.rs index d09ded683e061..19d0d60132a52 100644 --- a/turbopack/crates/turbopack-wasm/src/output_asset.rs +++ b/turbopack/crates/turbopack-wasm/src/output_asset.rs @@ -40,7 +40,7 @@ impl WebAssemblyAsset { #[turbo_tasks::value_impl] impl OutputAsset for WebAssemblyAsset { #[turbo_tasks::function] - async fn ident(&self) -> Result> { + fn ident(&self) -> Result> { let ident = self.source.ident().with_modifier(modifier()); let asset_path = self.chunking_context.chunk_path(ident, ".wasm".into()); diff --git a/turbopack/crates/turbopack-wasm/src/raw.rs b/turbopack/crates/turbopack-wasm/src/raw.rs index 44301c0abca22..fc2e0d0e162c0 100644 --- a/turbopack/crates/turbopack-wasm/src/raw.rs +++ b/turbopack/crates/turbopack-wasm/src/raw.rs @@ -74,7 +74,7 @@ impl Asset for RawWebAssemblyModuleAsset { #[turbo_tasks::value_impl] impl ChunkableModule for RawWebAssemblyModuleAsset { #[turbo_tasks::function] - async fn as_chunk_item( + fn as_chunk_item( self: Vc, chunking_context: Vc>, ) -> Result>> { @@ -120,7 +120,7 @@ impl ChunkItem for RawModuleChunkItem { } #[turbo_tasks::function] - async fn chunking_context(&self) -> Vc> { + fn chunking_context(&self) -> Vc> { Vc::upcast(self.chunking_context) } diff --git a/turbopack/crates/turbopack/src/lib.rs b/turbopack/crates/turbopack/src/lib.rs index edab1193284ce..6ed1f95e2015f 100644 --- a/turbopack/crates/turbopack/src/lib.rs +++ b/turbopack/crates/turbopack/src/lib.rs @@ -368,12 +368,12 @@ impl ModuleAssetContext { } #[turbo_tasks::function] - pub async fn module_options_context(&self) -> Result> { + pub fn module_options_context(&self) -> Result> { Ok(self.module_options_context) } #[turbo_tasks::function] - pub async fn resolve_options_context(&self) -> Result> { + pub fn resolve_options_context(&self) -> Result> { Ok(self.resolve_options_context) } @@ -783,7 +783,7 @@ impl AssetContext for ModuleAssetContext { } #[turbo_tasks::function] -pub async fn emit_with_completion( +pub fn emit_with_completion( asset: Vc>, output_dir: Vc, ) -> Vc { @@ -791,7 +791,7 @@ pub async fn emit_with_completion( } #[turbo_tasks::function] -async fn emit_assets_aggregated( +fn emit_assets_aggregated( asset: Vc>, output_dir: Vc, ) -> Vc { @@ -816,7 +816,7 @@ async fn emit_aggregated_assets( } #[turbo_tasks::function] -pub async fn emit_asset(asset: Vc>) -> Vc { +pub fn emit_asset(asset: Vc>) -> Vc { asset.content().write(asset.ident().path()) } diff --git a/turbopack/crates/turbopack/src/transition/context_transition.rs b/turbopack/crates/turbopack/src/transition/context_transition.rs index a69ebfab68857..6509f7f05b8fa 100644 --- a/turbopack/crates/turbopack/src/transition/context_transition.rs +++ b/turbopack/crates/turbopack/src/transition/context_transition.rs @@ -17,7 +17,7 @@ pub struct ContextTransition { #[turbo_tasks::value_impl] impl ContextTransition { #[turbo_tasks::function] - pub async fn new( + pub fn new( compile_time_info: Vc, module_options_context: Vc, resolve_options_context: Vc, diff --git a/turbopack/crates/turbopack/src/transition/full_context_transition.rs b/turbopack/crates/turbopack/src/transition/full_context_transition.rs index a479e998f2814..79e431aa7dfe0 100644 --- a/turbopack/crates/turbopack/src/transition/full_context_transition.rs +++ b/turbopack/crates/turbopack/src/transition/full_context_transition.rs @@ -12,7 +12,7 @@ pub struct FullContextTransition { #[turbo_tasks::value_impl] impl FullContextTransition { #[turbo_tasks::function] - pub async fn new(module_context: Vc) -> Result> { + pub fn new(module_context: Vc) -> Result> { Ok(FullContextTransition { module_context }.cell()) } } From c38bcb717061ca3edec58a9c22f9560a9cd277af Mon Sep 17 00:00:00 2001 From: Sam Ko Date: Wed, 25 Sep 2024 21:34:39 -0700 Subject: [PATCH 06/13] docs(cli): add mention of default port with experimental-https (#70497) ## Why? There is no mention of what the default port is when you `next dev --experimental-https`. x-ref: https://x.com/rauchg/status/1839092783392632867 --------- Co-authored-by: Will Binns-Smith --- docs/02-app/02-api-reference/06-cli/next.mdx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/02-app/02-api-reference/06-cli/next.mdx b/docs/02-app/02-api-reference/06-cli/next.mdx index 13e4aef860e14..e5c6df988754e 100644 --- a/docs/02-app/02-api-reference/06-cli/next.mdx +++ b/docs/02-app/02-api-reference/06-cli/next.mdx @@ -207,6 +207,8 @@ For certain use cases like webhooks or authentication, you can use [HTTPS](https next dev --experimental-https ``` +With the generated certificate, the Next.js development server will exist at `https://localhost:3000`. The default port `3000` is used unless a port is specified with `-p`, `--port`, or `PORT`. + You can also provide a custom certificate and key with `--experimental-https-key` and `--experimental-https-cert`. Optionally, you can provide a custom CA certificate with `--experimental-https-ca` as well. ```bash filename="Terminal" From eefa9d7d45c7b46095d36e4f4a563dddf80aaa8c Mon Sep 17 00:00:00 2001 From: Zack Tanner <1939140+ztanner@users.noreply.github.com> Date: Wed, 25 Sep 2024 22:01:15 -0700 Subject: [PATCH 07/13] remove redux devtools from router reducer (#70495) It's a bit odd that we expose this internal debugging capability in production and it seems to cause potential production issues when serializing unsupported data structures ([x-ref ](https://github.com/vercel/next.js/discussions/69436)) If we feel a need to re-introduce the ability to introspect on the router state even in production we could consider relanding it in an opt-in way, and not run on every action. But I think since we've moved away from throwing promises in reducers (back when the reducers could potentially be replayed by React, in early Suspense implementations), I'm not sure this provides as much value. Fixes #70441 --- .../next/src/client/components/app-router.tsx | 16 +- .../components/use-reducer-with-devtools.ts | 153 ------------------ .../next/src/client/components/use-reducer.ts | 35 ++++ .../src/shared/lib/router/action-queue.ts | 6 - 4 files changed, 39 insertions(+), 171 deletions(-) delete mode 100644 packages/next/src/client/components/use-reducer-with-devtools.ts create mode 100644 packages/next/src/client/components/use-reducer.ts diff --git a/packages/next/src/client/components/app-router.tsx b/packages/next/src/client/components/app-router.tsx index 42357ab3090ef..2d9b4f530d349 100644 --- a/packages/next/src/client/components/app-router.tsx +++ b/packages/next/src/client/components/app-router.tsx @@ -39,11 +39,7 @@ import { PathnameContext, PathParamsContext, } from '../../shared/lib/hooks-client-context.shared-runtime' -import { - useReducerWithReduxDevtools, - useUnwrapState, - type ReduxDevtoolsSyncFn, -} from './use-reducer-with-devtools' +import { useReducer, useUnwrapState } from './use-reducer' import { ErrorBoundary, type ErrorComponent } from './error-boundary' import { isBot } from '../../shared/lib/router/utils/is-bot' import { addBasePath } from '../add-base-path' @@ -75,10 +71,8 @@ function isExternalURL(url: URL) { function HistoryUpdater({ appRouterState, - sync, }: { appRouterState: AppRouterState - sync: ReduxDevtoolsSyncFn }) { useInsertionEffect(() => { if (process.env.__NEXT_APP_NAV_FAIL_HANDLING) { @@ -108,9 +102,7 @@ function HistoryUpdater({ } else { window.history.replaceState(historyState, '', canonicalUrl) } - - sync(appRouterState) - }, [appRouterState, sync]) + }, [appRouterState]) return null } @@ -219,7 +211,7 @@ function Router({ actionQueue: AppRouterActionQueue assetPrefix: string }) { - const [state, dispatch, sync] = useReducerWithReduxDevtools(actionQueue) + const [state, dispatch] = useReducer(actionQueue) const { canonicalUrl } = useUnwrapState(state) // Add memoized pathname/query for useSearchParams and usePathname. const { searchParams, pathname } = useMemo(() => { @@ -606,7 +598,7 @@ function Router({ return ( <> - + diff --git a/packages/next/src/client/components/use-reducer-with-devtools.ts b/packages/next/src/client/components/use-reducer-with-devtools.ts deleted file mode 100644 index 9e5636d711cac..0000000000000 --- a/packages/next/src/client/components/use-reducer-with-devtools.ts +++ /dev/null @@ -1,153 +0,0 @@ -import type { Dispatch } from 'react' -import React, { use } from 'react' -import { useRef, useEffect, useCallback } from 'react' -import type { - AppRouterState, - ReducerActions, - ReducerState, -} from './router-reducer/router-reducer-types' -import type { AppRouterActionQueue } from '../../shared/lib/router/action-queue' -import { isThenable } from '../../shared/lib/is-thenable' - -export type ReduxDevtoolsSyncFn = (state: AppRouterState) => void - -function normalizeRouterState(val: any): any { - if (val instanceof Map) { - const obj: { [key: string]: any } = {} - for (const [key, value] of val.entries()) { - if (typeof value === 'function') { - obj[key] = 'fn()' - continue - } - if (typeof value === 'object' && value !== null) { - if (value.$$typeof) { - obj[key] = value.$$typeof.toString() - continue - } - if (value._bundlerConfig) { - obj[key] = 'FlightData' - continue - } - } - obj[key] = normalizeRouterState(value) - } - return obj - } - - if (typeof val === 'object' && val !== null) { - const obj: { [key: string]: any } = {} - for (const key in val) { - const value = val[key] - if (typeof value === 'function') { - obj[key] = 'fn()' - continue - } - if (typeof value === 'object' && value !== null) { - if (value.$$typeof) { - obj[key] = value.$$typeof.toString() - continue - } - if (value.hasOwnProperty('_bundlerConfig')) { - obj[key] = 'FlightData' - continue - } - } - - obj[key] = normalizeRouterState(value) - } - return obj - } - - if (Array.isArray(val)) { - return val.map(normalizeRouterState) - } - - return val -} - -declare global { - interface Window { - __REDUX_DEVTOOLS_EXTENSION__: any - } -} - -export interface ReduxDevToolsInstance { - send(action: any, state: any): void - init(initialState: any): void -} - -export function useUnwrapState(state: ReducerState): AppRouterState { - // reducer actions can be async, so sometimes we need to suspend until the state is resolved - if (isThenable(state)) { - const result = use(state) - return result - } - - return state -} - -export function useReducerWithReduxDevtools( - actionQueue: AppRouterActionQueue -): [ReducerState, Dispatch, ReduxDevtoolsSyncFn] { - const [state, setState] = React.useState(actionQueue.state) - const devtoolsConnectionRef = useRef(undefined) - const enabledRef = useRef(undefined) - - useEffect(() => { - if (devtoolsConnectionRef.current || enabledRef.current === false) { - return - } - - if ( - enabledRef.current === undefined && - typeof window.__REDUX_DEVTOOLS_EXTENSION__ === 'undefined' - ) { - enabledRef.current = false - return - } - - devtoolsConnectionRef.current = window.__REDUX_DEVTOOLS_EXTENSION__.connect( - { - instanceId: 8000, // Random number that is high to avoid conflicts - name: 'next-router', - } - ) - if (devtoolsConnectionRef.current) { - devtoolsConnectionRef.current.init( - normalizeRouterState(actionQueue.state) - ) - - if (actionQueue) { - actionQueue.devToolsInstance = devtoolsConnectionRef.current - } - } - - return () => { - devtoolsConnectionRef.current = undefined - } - }, [actionQueue]) - - const dispatch = useCallback( - (action: ReducerActions) => { - actionQueue.dispatch(action, setState) - }, - [actionQueue] - ) - - // Sync is called after a state update in the HistoryUpdater, - // for debugging purposes. Since the reducer state may be a Promise, - // we let the app router use() it and sync on the resolved value if - // something changed. - // Using the `state` here would be referentially unstable and cause - // undesirable re-renders and history updates. - const sync = useCallback((resolvedState) => { - if (devtoolsConnectionRef.current) { - devtoolsConnectionRef.current.send( - { type: 'RENDER_SYNC' }, - normalizeRouterState(resolvedState) - ) - } - }, []) - - return [state, dispatch, sync] -} diff --git a/packages/next/src/client/components/use-reducer.ts b/packages/next/src/client/components/use-reducer.ts new file mode 100644 index 0000000000000..38906e8695eab --- /dev/null +++ b/packages/next/src/client/components/use-reducer.ts @@ -0,0 +1,35 @@ +import type { Dispatch } from 'react' +import React, { use } from 'react' +import { useCallback } from 'react' +import type { + AppRouterState, + ReducerActions, + ReducerState, +} from './router-reducer/router-reducer-types' +import type { AppRouterActionQueue } from '../../shared/lib/router/action-queue' +import { isThenable } from '../../shared/lib/is-thenable' + +export function useUnwrapState(state: ReducerState): AppRouterState { + // reducer actions can be async, so sometimes we need to suspend until the state is resolved + if (isThenable(state)) { + const result = use(state) + return result + } + + return state +} + +export function useReducer( + actionQueue: AppRouterActionQueue +): [ReducerState, Dispatch] { + const [state, setState] = React.useState(actionQueue.state) + + const dispatch = useCallback( + (action: ReducerActions) => { + actionQueue.dispatch(action, setState) + }, + [actionQueue] + ) + + return [state, dispatch] +} diff --git a/packages/next/src/shared/lib/router/action-queue.ts b/packages/next/src/shared/lib/router/action-queue.ts index acc5b3afd8bc2..40a5eb9c22250 100644 --- a/packages/next/src/shared/lib/router/action-queue.ts +++ b/packages/next/src/shared/lib/router/action-queue.ts @@ -7,7 +7,6 @@ import { ACTION_NAVIGATE, ACTION_RESTORE, } from '../../../client/components/router-reducer/router-reducer-types' -import type { ReduxDevToolsInstance } from '../../../client/components/use-reducer-with-devtools' import { reducer } from '../../../client/components/router-reducer/router-reducer' import { startTransition } from 'react' import { isThenable } from '../is-thenable' @@ -16,7 +15,6 @@ export type DispatchStatePromise = React.Dispatch export type AppRouterActionQueue = { state: AppRouterState - devToolsInstance?: ReduxDevToolsInstance dispatch: (payload: ReducerActions, setState: DispatchStatePromise) => void action: (state: AppRouterState, action: ReducerActions) => ReducerState pending: ActionQueueNode | null @@ -85,10 +83,6 @@ async function runAction({ actionQueue.state = nextState - if (actionQueue.devToolsInstance) { - actionQueue.devToolsInstance.send(payload, nextState) - } - runRemainingActions(actionQueue, setState) action.resolve(nextState) } From 9b62028ce9a2ae00300f41c555062d44793215ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Donny/=EA=B0=95=EB=8F=99=EC=9C=A4?= Date: Thu, 26 Sep 2024 15:41:55 +0900 Subject: [PATCH 08/13] feat(turbopack): Evaluate simple numeric addition (#70273) ### What? Add evaluation logic for cases where we are sure that the result is a number and not a string. ### Why? It's required for DCE. --- .../turbopack-ecmascript/src/analyzer/builtin.rs | 13 +++++++++++++ .../graph/nested-args/resolved-explained.snapshot | 2 +- .../turbopack/basic/comptime/input/index.js | 6 ++++++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/turbopack/crates/turbopack-ecmascript/src/analyzer/builtin.rs b/turbopack/crates/turbopack-ecmascript/src/analyzer/builtin.rs index 574aeb93f88b6..3542ce46a11bb 100644 --- a/turbopack/crates/turbopack-ecmascript/src/analyzer/builtin.rs +++ b/turbopack/crates/turbopack-ecmascript/src/analyzer/builtin.rs @@ -97,6 +97,19 @@ pub fn early_replace_builtin(value: &mut JsValue) -> bool { /// processed. pub fn replace_builtin(value: &mut JsValue) -> bool { match value { + JsValue::Add(_, list) => { + // numeric addition + let mut sum = 0f64; + for arg in list { + let JsValue::Constant(ConstantValue::Num(num)) = arg else { + return false; + }; + sum += num.0; + } + *value = JsValue::Constant(ConstantValue::Num(ConstantNumber(sum))); + true + } + // matching property access like `obj.prop` // Accessing a property on something can be handled in some cases JsValue::Member(_, box ref mut obj, ref mut prop) => match obj { diff --git a/turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/nested-args/resolved-explained.snapshot b/turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/nested-args/resolved-explained.snapshot index f9b00360809eb..f018bcdcef9ca 100644 --- a/turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/nested-args/resolved-explained.snapshot +++ b/turbopack/crates/turbopack-ecmascript/tests/analyzer/graph/nested-args/resolved-explained.snapshot @@ -29,7 +29,7 @@ v1 = (???*0* + 2) ⚠️ function calls are not analysed yet v2 = (undefined | 2 | (???*0* + 1)) -- *0* (...) => (undefined | a | (r((a + 1)) + 1))((2 + 1)) +- *0* (...) => (undefined | a | (r((a + 1)) + 1))(3) ⚠️ recursive function call ⚠️ This value might have side effects diff --git a/turbopack/crates/turbopack-tests/tests/execution/turbopack/basic/comptime/input/index.js b/turbopack/crates/turbopack-tests/tests/execution/turbopack/basic/comptime/input/index.js index 58e928ec46561..8e0a6a5e79924 100644 --- a/turbopack/crates/turbopack-tests/tests/execution/turbopack/basic/comptime/input/index.js +++ b/turbopack/crates/turbopack-tests/tests/execution/turbopack/basic/comptime/input/index.js @@ -166,3 +166,9 @@ it("should keep side-effects in if statements", () => { expect(ok).toBe(2); } }); + +it('should analyze numeric additions',()=>{ + if (1 +2 !==3) { + require("fail"); + } +}) From 3ead2d1fe98f78307861b12983c76d5a7a88c41a Mon Sep 17 00:00:00 2001 From: Vercel Release Bot <88769842+vercel-release-bot@users.noreply.github.com> Date: Thu, 26 Sep 2024 01:00:08 -0700 Subject: [PATCH 09/13] Upgrade React from `5d19e1c8-20240923` to `778e1ed2-20240926` (#70486) --- examples/reproduction-template/package.json | 4 +- package.json | 34 +- packages/create-next-app/templates/index.ts | 2 +- packages/next/package.json | 4 +- .../cjs/react-dom-client.development.js | 1158 +++++++++-------- .../cjs/react-dom-client.production.js | 854 ++++++------ .../cjs/react-dom-profiling.development.js | 1158 +++++++++-------- .../cjs/react-dom-profiling.profiling.js | 1083 +++++++-------- ...t-dom-server-legacy.browser.development.js | 2 +- ...ct-dom-server-legacy.browser.production.js | 2 +- ...eact-dom-server-legacy.node.development.js | 2 +- ...react-dom-server-legacy.node.production.js | 2 +- .../react-dom-server.browser.development.js | 6 +- .../react-dom-server.browser.production.js | 6 +- .../cjs/react-dom-server.bun.production.js | 6 +- .../cjs/react-dom-server.edge.development.js | 6 +- .../cjs/react-dom-server.edge.production.js | 6 +- .../cjs/react-dom-server.node.development.js | 6 +- .../cjs/react-dom-server.node.production.js | 6 +- .../react-dom-unstable_testing.development.js | 1158 +++++++++-------- .../react-dom-unstable_testing.production.js | 854 ++++++------ .../cjs/react-dom.development.js | 2 +- .../cjs/react-dom.production.js | 2 +- .../cjs/react-dom.react-server.development.js | 2 +- .../cjs/react-dom.react-server.production.js | 2 +- .../react-dom-experimental/package.json | 4 +- .../cjs/react-dom-client.development.js | 1023 +++++++-------- .../cjs/react-dom-client.production.js | 852 ++++++------ .../cjs/react-dom-profiling.development.js | 1023 +++++++-------- .../cjs/react-dom-profiling.profiling.js | 951 +++++++------- ...t-dom-server-legacy.browser.development.js | 2 +- ...ct-dom-server-legacy.browser.production.js | 2 +- ...eact-dom-server-legacy.node.development.js | 2 +- ...react-dom-server-legacy.node.production.js | 2 +- .../react-dom-server.browser.development.js | 6 +- .../react-dom-server.browser.production.js | 6 +- .../cjs/react-dom-server.bun.production.js | 6 +- .../cjs/react-dom-server.edge.development.js | 6 +- .../cjs/react-dom-server.edge.production.js | 6 +- .../cjs/react-dom-server.node.development.js | 6 +- .../cjs/react-dom-server.node.production.js | 6 +- .../react-dom/cjs/react-dom.development.js | 2 +- .../react-dom/cjs/react-dom.production.js | 2 +- .../cjs/react-dom.react-server.development.js | 2 +- .../cjs/react-dom.react-server.production.js | 2 +- .../next/src/compiled/react-dom/package.json | 4 +- .../cjs/react.development.js | 2 +- .../cjs/react.production.js | 2 +- .../cjs/react.react-server.development.js | 2 +- .../cjs/react.react-server.production.js | 2 +- .../next/src/compiled/react-is/package.json | 2 +- ...om-turbopack-client.browser.development.js | 27 +- ...dom-turbopack-client.browser.production.js | 18 +- ...r-dom-turbopack-client.edge.development.js | 23 +- ...er-dom-turbopack-client.edge.production.js | 18 +- ...r-dom-turbopack-client.node.development.js | 23 +- ...er-dom-turbopack-client.node.production.js | 18 +- ...om-turbopack-server.browser.development.js | 3 + ...dom-turbopack-server.browser.production.js | 3 + ...r-dom-turbopack-server.edge.development.js | 3 + ...er-dom-turbopack-server.edge.production.js | 3 + ...r-dom-turbopack-server.node.development.js | 3 + ...er-dom-turbopack-server.node.production.js | 3 + .../package.json | 4 +- ...om-turbopack-client.browser.development.js | 27 +- ...dom-turbopack-client.browser.production.js | 18 +- ...r-dom-turbopack-client.edge.development.js | 23 +- ...er-dom-turbopack-client.edge.production.js | 18 +- ...r-dom-turbopack-client.node.development.js | 23 +- ...er-dom-turbopack-client.node.production.js | 18 +- ...om-turbopack-server.browser.development.js | 3 + ...dom-turbopack-server.browser.production.js | 3 + ...r-dom-turbopack-server.edge.development.js | 3 + ...er-dom-turbopack-server.edge.production.js | 3 + ...r-dom-turbopack-server.node.development.js | 3 + ...er-dom-turbopack-server.node.production.js | 3 + .../react-server-dom-turbopack/package.json | 4 +- ...-dom-webpack-client.browser.development.js | 27 +- ...r-dom-webpack-client.browser.production.js | 18 +- ...ver-dom-webpack-client.edge.development.js | 23 +- ...rver-dom-webpack-client.edge.production.js | 18 +- ...ver-dom-webpack-client.node.development.js | 23 +- ...rver-dom-webpack-client.node.production.js | 18 +- ...bpack-client.node.unbundled.development.js | 23 +- ...ebpack-client.node.unbundled.production.js | 18 +- ...-dom-webpack-server.browser.development.js | 3 + ...r-dom-webpack-server.browser.production.js | 3 + ...ver-dom-webpack-server.edge.development.js | 3 + ...rver-dom-webpack-server.edge.production.js | 3 + ...ver-dom-webpack-server.node.development.js | 3 + ...rver-dom-webpack-server.node.production.js | 3 + ...bpack-server.node.unbundled.development.js | 3 + ...ebpack-server.node.unbundled.production.js | 3 + .../package.json | 4 +- ...-dom-webpack-client.browser.development.js | 27 +- ...r-dom-webpack-client.browser.production.js | 18 +- ...ver-dom-webpack-client.edge.development.js | 23 +- ...rver-dom-webpack-client.edge.production.js | 18 +- ...ver-dom-webpack-client.node.development.js | 23 +- ...rver-dom-webpack-client.node.production.js | 18 +- ...bpack-client.node.unbundled.development.js | 23 +- ...ebpack-client.node.unbundled.production.js | 18 +- ...-dom-webpack-server.browser.development.js | 3 + ...r-dom-webpack-server.browser.production.js | 3 + ...ver-dom-webpack-server.edge.development.js | 3 + ...rver-dom-webpack-server.edge.production.js | 3 + ...ver-dom-webpack-server.node.development.js | 3 + ...rver-dom-webpack-server.node.production.js | 3 + ...bpack-server.node.unbundled.development.js | 3 + ...ebpack-server.node.unbundled.production.js | 3 + .../react-server-dom-webpack/package.json | 4 +- .../compiled/react/cjs/react.development.js | 2 +- .../compiled/react/cjs/react.production.js | 2 +- .../cjs/react.react-server.development.js | 2 +- .../cjs/react.react-server.production.js | 2 +- .../next/src/compiled/unistore/unistore.js | 2 +- pnpm-lock.yaml | 376 +++--- run-tests.js | 2 +- test/.stats-app/package.json | 4 +- .../first-time-setup-js/package.json | 4 +- .../first-time-setup-ts/package.json | 4 +- test/lib/next-modes/base.ts | 2 +- 122 files changed, 5680 insertions(+), 5704 deletions(-) diff --git a/examples/reproduction-template/package.json b/examples/reproduction-template/package.json index dda04e8c51342..282b16c34a860 100644 --- a/examples/reproduction-template/package.json +++ b/examples/reproduction-template/package.json @@ -7,8 +7,8 @@ }, "dependencies": { "next": "canary", - "react": "19.0.0-rc-5d19e1c8-20240923", - "react-dom": "19.0.0-rc-5d19e1c8-20240923" + "react": "19.0.0-rc-778e1ed2-20240926", + "react-dom": "19.0.0-rc-778e1ed2-20240926" }, "devDependencies": { "@types/node": "20.12.12", diff --git a/package.json b/package.json index d680f5ad29c08..9584fbec3f815 100644 --- a/package.json +++ b/package.json @@ -208,19 +208,19 @@ "pretty-bytes": "5.3.0", "pretty-ms": "7.0.0", "random-seed": "0.3.0", - "react": "19.0.0-rc-5d19e1c8-20240923", + "react": "19.0.0-rc-778e1ed2-20240926", "react-17": "npm:react@17.0.2", - "react-builtin": "npm:react@19.0.0-rc-5d19e1c8-20240923", - "react-dom": "19.0.0-rc-5d19e1c8-20240923", + "react-builtin": "npm:react@19.0.0-rc-778e1ed2-20240926", + "react-dom": "19.0.0-rc-778e1ed2-20240926", "react-dom-17": "npm:react-dom@17.0.2", - "react-dom-builtin": "npm:react-dom@19.0.0-rc-5d19e1c8-20240923", - "react-dom-experimental-builtin": "npm:react-dom@0.0.0-experimental-5d19e1c8-20240923", - "react-experimental-builtin": "npm:react@0.0.0-experimental-5d19e1c8-20240923", - "react-is-builtin": "npm:react-is@19.0.0-rc-5d19e1c8-20240923", - "react-server-dom-turbopack": "19.0.0-rc-5d19e1c8-20240923", - "react-server-dom-turbopack-experimental": "npm:react-server-dom-turbopack@0.0.0-experimental-5d19e1c8-20240923", - "react-server-dom-webpack": "19.0.0-rc-5d19e1c8-20240923", - "react-server-dom-webpack-experimental": "npm:react-server-dom-webpack@0.0.0-experimental-5d19e1c8-20240923", + "react-dom-builtin": "npm:react-dom@19.0.0-rc-778e1ed2-20240926", + "react-dom-experimental-builtin": "npm:react-dom@0.0.0-experimental-778e1ed2-20240926", + "react-experimental-builtin": "npm:react@0.0.0-experimental-778e1ed2-20240926", + "react-is-builtin": "npm:react-is@19.0.0-rc-778e1ed2-20240926", + "react-server-dom-turbopack": "19.0.0-rc-778e1ed2-20240926", + "react-server-dom-turbopack-experimental": "npm:react-server-dom-turbopack@0.0.0-experimental-778e1ed2-20240926", + "react-server-dom-webpack": "19.0.0-rc-778e1ed2-20240926", + "react-server-dom-webpack-experimental": "npm:react-server-dom-webpack@0.0.0-experimental-778e1ed2-20240926", "react-ssr-prepass": "1.0.8", "react-virtualized": "9.22.3", "relay-compiler": "13.0.2", @@ -230,8 +230,8 @@ "resolve-from": "5.0.0", "sass": "1.54.0", "satori": "0.10.9", - "scheduler-builtin": "npm:scheduler@0.25.0-rc-5d19e1c8-20240923", - "scheduler-experimental-builtin": "npm:scheduler@0.0.0-experimental-5d19e1c8-20240923", + "scheduler-builtin": "npm:scheduler@0.25.0-rc-778e1ed2-20240926", + "scheduler-experimental-builtin": "npm:scheduler@0.0.0-experimental-778e1ed2-20240926", "seedrandom": "3.0.5", "semver": "7.3.7", "shell-quote": "1.7.3", @@ -271,10 +271,10 @@ "@babel/traverse": "7.22.5", "@types/react": "npm:types-react@19.0.0-rc.0", "@types/react-dom": "npm:types-react-dom@19.0.0-rc.0", - "react": "19.0.0-rc-5d19e1c8-20240923", - "react-dom": "19.0.0-rc-5d19e1c8-20240923", - "react-is": "19.0.0-rc-5d19e1c8-20240923", - "scheduler": "0.25.0-rc-5d19e1c8-20240923" + "react": "19.0.0-rc-778e1ed2-20240926", + "react-dom": "19.0.0-rc-778e1ed2-20240926", + "react-is": "19.0.0-rc-778e1ed2-20240926", + "scheduler": "0.25.0-rc-778e1ed2-20240926" }, "patchedDependencies": { "webpack-sources@3.2.3": "patches/webpack-sources@3.2.3.patch" diff --git a/packages/create-next-app/templates/index.ts b/packages/create-next-app/templates/index.ts index 6e91c597690bb..e5fe2f2e84181 100644 --- a/packages/create-next-app/templates/index.ts +++ b/packages/create-next-app/templates/index.ts @@ -13,7 +13,7 @@ import { GetTemplateFileArgs, InstallTemplateArgs } from "./types"; // Do not rename or format. sync-react script relies on this line. // prettier-ignore -const nextjsReactPeerVersion = "19.0.0-rc-5d19e1c8-20240923"; +const nextjsReactPeerVersion = "19.0.0-rc-778e1ed2-20240926"; /** * Get the file path for a given file in a template, e.g. "next.config.js". diff --git a/packages/next/package.json b/packages/next/package.json index 29c7ed6ff1b70..0817c87167976 100644 --- a/packages/next/package.json +++ b/packages/next/package.json @@ -107,8 +107,8 @@ "@opentelemetry/api": "^1.1.0", "@playwright/test": "^1.41.2", "babel-plugin-react-compiler": "*", - "react": "^18.2.0 || 19.0.0-rc-5d19e1c8-20240923", - "react-dom": "^18.2.0 || 19.0.0-rc-5d19e1c8-20240923", + "react": "^18.2.0 || 19.0.0-rc-778e1ed2-20240926", + "react-dom": "^18.2.0 || 19.0.0-rc-778e1ed2-20240926", "sass": "^1.3.0" }, "peerDependenciesMeta": { diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-client.development.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-client.development.js index 9fc79fa112425..96c37316b3197 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-client.development.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-client.development.js @@ -1031,43 +1031,39 @@ var pendingLanes = root.pendingLanes; if (0 === pendingLanes) return 0; var nextLanes = 0, - suspendedLanes = root.suspendedLanes, - pingedLanes = root.pingedLanes, - warmLanes = root.warmLanes; - root = 0 !== root.finishedLanes; + suspendedLanes = root.suspendedLanes; + root = root.pingedLanes; var nonIdlePendingLanes = pendingLanes & 134217727; 0 !== nonIdlePendingLanes ? ((pendingLanes = nonIdlePendingLanes & ~suspendedLanes), 0 !== pendingLanes ? (nextLanes = getHighestPriorityLanes(pendingLanes)) - : ((pingedLanes &= nonIdlePendingLanes), - 0 !== pingedLanes - ? (nextLanes = getHighestPriorityLanes(pingedLanes)) - : root || - ((warmLanes = nonIdlePendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes))))) - : ((nonIdlePendingLanes = pendingLanes & ~suspendedLanes), - 0 !== nonIdlePendingLanes - ? (nextLanes = getHighestPriorityLanes(nonIdlePendingLanes)) - : 0 !== pingedLanes - ? (nextLanes = getHighestPriorityLanes(pingedLanes)) - : root || - ((warmLanes = pendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes)))); + : ((root &= nonIdlePendingLanes), + 0 !== root && (nextLanes = getHighestPriorityLanes(root)))) + : ((pendingLanes &= ~suspendedLanes), + 0 !== pendingLanes + ? (nextLanes = getHighestPriorityLanes(pendingLanes)) + : 0 !== root && (nextLanes = getHighestPriorityLanes(root))); return 0 === nextLanes ? 0 : 0 !== wipLanes && wipLanes !== nextLanes && 0 === (wipLanes & suspendedLanes) && ((suspendedLanes = nextLanes & -nextLanes), - (warmLanes = wipLanes & -wipLanes), - suspendedLanes >= warmLanes || - (32 === suspendedLanes && 0 !== (warmLanes & 4194176))) + (root = wipLanes & -wipLanes), + suspendedLanes >= root || + (32 === suspendedLanes && 0 !== (root & 4194176))) ? wipLanes : nextLanes; } + function checkIfRootIsPrerendering(root, renderLanes) { + return ( + 0 === + (root.pendingLanes & + ~(root.suspendedLanes & ~root.pingedLanes) & + renderLanes) + ); + } function computeExpirationTime(lane, currentTime) { switch (lane) { case 1: @@ -1114,14 +1110,6 @@ ); } } - function getLanesToRetrySynchronouslyOnError( - root, - originallyAttemptedLanes - ) { - if (root.errorRecoveryDisabledLanes & originallyAttemptedLanes) return 0; - root = root.pendingLanes & -536870913; - return 0 !== root ? root : root & 536870912 ? 536870912 : 0; - } function claimNextTransitionLane() { var lane = nextTransitionLane; nextTransitionLane <<= 1; @@ -1142,9 +1130,7 @@ root, finishedLanes, remainingLanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes + spawnedLane ) { var previouslyPendingLanes = root.pendingLanes; root.pendingLanes = remainingLanes; @@ -1155,17 +1141,17 @@ root.entangledLanes &= remainingLanes; root.errorRecoveryDisabledLanes &= remainingLanes; root.shellSuspendCounter = 0; - var entanglements = root.entanglements, - expirationTimes = root.expirationTimes, + finishedLanes = root.entanglements; + var expirationTimes = root.expirationTimes, hiddenUpdates = root.hiddenUpdates; for ( remainingLanes = previouslyPendingLanes & ~remainingLanes; 0 < remainingLanes; ) { - var index = 31 - clz32(remainingLanes), - lane = 1 << index; - entanglements[index] = 0; + var index = 31 - clz32(remainingLanes); + previouslyPendingLanes = 1 << index; + finishedLanes[index] = 0; expirationTimes[index] = -1; var hiddenUpdatesForLane = hiddenUpdates[index]; if (null !== hiddenUpdatesForLane) @@ -1177,14 +1163,9 @@ var update = hiddenUpdatesForLane[index]; null !== update && (update.lane &= -536870913); } - remainingLanes &= ~lane; + remainingLanes &= ~previouslyPendingLanes; } 0 !== spawnedLane && markSpawnedDeferredLane(root, spawnedLane, 0); - 0 !== suspendedRetryLanes && - 0 === updatedLanes && - 0 !== root.tag && - (root.suspendedLanes |= - suspendedRetryLanes & ~(previouslyPendingLanes & ~finishedLanes)); } function markSpawnedDeferredLane(root, spawnedLane, entangledLanes) { root.pendingLanes |= spawnedLane; @@ -1236,6 +1217,17 @@ lanes &= ~root; } } + function getGroupNameOfHighestPriorityLane(lanes) { + return lanes & 63 + ? "Blocking" + : lanes & 4194240 + ? "Transition" + : lanes & 62914560 + ? "Suspense" + : lanes & 2080374784 + ? "Idle" + : "Other"; + } function lanesToEventPriority(lanes) { lanes &= -lanes; return 0 !== DiscreteEventPriority && DiscreteEventPriority < lanes @@ -3774,6 +3766,34 @@ (reusableComponentOptions.end = endTime), performance.measure(fiber, reusableComponentOptions)); } + function logRenderPhase(startTime, endTime) { + supportsUserTiming && + ((reusableComponentDevToolDetails.color = "primary-dark"), + (reusableComponentOptions.start = startTime), + (reusableComponentOptions.end = endTime), + performance.measure("Render", reusableComponentOptions)); + } + function logSuspenseThrottlePhase(startTime, endTime) { + supportsUserTiming && + ((reusableComponentDevToolDetails.color = "secondary-light"), + (reusableComponentOptions.start = startTime), + (reusableComponentOptions.end = endTime), + performance.measure("Throttled", reusableComponentOptions)); + } + function logSuspendedCommitPhase(startTime, endTime) { + supportsUserTiming && + ((reusableComponentDevToolDetails.color = "secondary-light"), + (reusableComponentOptions.start = startTime), + (reusableComponentOptions.end = endTime), + performance.measure("Suspended", reusableComponentOptions)); + } + function logCommitPhase(startTime, endTime) { + supportsUserTiming && + ((reusableComponentDevToolDetails.color = "secondary-dark"), + (reusableComponentOptions.start = startTime), + (reusableComponentOptions.end = endTime), + performance.measure("Commit", reusableComponentOptions)); + } function finishQueueingConcurrentUpdates() { for ( var endIndex = concurrentQueuesIndex, @@ -8852,33 +8872,33 @@ return current; } function updateSuspenseComponent(current, workInProgress, renderLanes) { - var JSCompiler_object_inline_componentStack_2262; - var JSCompiler_object_inline_stack_2261 = workInProgress.pendingProps; + var JSCompiler_object_inline_componentStack_2281; + var JSCompiler_object_inline_stack_2280 = workInProgress.pendingProps; shouldSuspendImpl(workInProgress) && (workInProgress.flags |= 128); - var JSCompiler_object_inline_message_2259 = !1; + var JSCompiler_object_inline_message_2278 = !1; var didSuspend = 0 !== (workInProgress.flags & 128); - (JSCompiler_object_inline_componentStack_2262 = didSuspend) || - (JSCompiler_object_inline_componentStack_2262 = + (JSCompiler_object_inline_componentStack_2281 = didSuspend) || + (JSCompiler_object_inline_componentStack_2281 = null !== current && null === current.memoizedState ? !1 : 0 !== (suspenseStackCursor.current & ForceSuspenseFallback)); - JSCompiler_object_inline_componentStack_2262 && - ((JSCompiler_object_inline_message_2259 = !0), + JSCompiler_object_inline_componentStack_2281 && + ((JSCompiler_object_inline_message_2278 = !0), (workInProgress.flags &= -129)); - JSCompiler_object_inline_componentStack_2262 = + JSCompiler_object_inline_componentStack_2281 = 0 !== (workInProgress.flags & 32); workInProgress.flags &= -33; if (null === current) { if (isHydrating) { - JSCompiler_object_inline_message_2259 + JSCompiler_object_inline_message_2278 ? pushPrimaryTreeSuspenseHandler(workInProgress) : reuseSuspenseHandlerOnStack(workInProgress); if (isHydrating) { - var JSCompiler_object_inline_digest_2260 = nextHydratableInstance; + var JSCompiler_object_inline_digest_2279 = nextHydratableInstance; var JSCompiler_temp; - if (!(JSCompiler_temp = !JSCompiler_object_inline_digest_2260)) { + if (!(JSCompiler_temp = !JSCompiler_object_inline_digest_2279)) { c: { - var instance = JSCompiler_object_inline_digest_2260; + var instance = JSCompiler_object_inline_digest_2279; for ( JSCompiler_temp = rootOrSingletonContext; 8 !== instance.nodeType; @@ -8919,19 +8939,19 @@ JSCompiler_temp && (warnNonHydratedInstance( workInProgress, - JSCompiler_object_inline_digest_2260 + JSCompiler_object_inline_digest_2279 ), throwOnHydrationMismatch(workInProgress)); } - JSCompiler_object_inline_digest_2260 = workInProgress.memoizedState; + JSCompiler_object_inline_digest_2279 = workInProgress.memoizedState; if ( - null !== JSCompiler_object_inline_digest_2260 && - ((JSCompiler_object_inline_digest_2260 = - JSCompiler_object_inline_digest_2260.dehydrated), - null !== JSCompiler_object_inline_digest_2260) + null !== JSCompiler_object_inline_digest_2279 && + ((JSCompiler_object_inline_digest_2279 = + JSCompiler_object_inline_digest_2279.dehydrated), + null !== JSCompiler_object_inline_digest_2279) ) return ( - JSCompiler_object_inline_digest_2260.data === + JSCompiler_object_inline_digest_2279.data === SUSPENSE_FALLBACK_START_DATA ? (workInProgress.lanes = 16) : (workInProgress.lanes = 536870912), @@ -8939,68 +8959,68 @@ ); popSuspenseHandler(workInProgress); } - JSCompiler_object_inline_digest_2260 = - JSCompiler_object_inline_stack_2261.children; - JSCompiler_temp = JSCompiler_object_inline_stack_2261.fallback; - if (JSCompiler_object_inline_message_2259) + JSCompiler_object_inline_digest_2279 = + JSCompiler_object_inline_stack_2280.children; + JSCompiler_temp = JSCompiler_object_inline_stack_2280.fallback; + if (JSCompiler_object_inline_message_2278) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2261 = + (JSCompiler_object_inline_stack_2280 = mountSuspenseFallbackChildren( workInProgress, - JSCompiler_object_inline_digest_2260, + JSCompiler_object_inline_digest_2279, JSCompiler_temp, renderLanes )), - (JSCompiler_object_inline_message_2259 = workInProgress.child), - (JSCompiler_object_inline_message_2259.memoizedState = + (JSCompiler_object_inline_message_2278 = workInProgress.child), + (JSCompiler_object_inline_message_2278.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_message_2259.childLanes = + (JSCompiler_object_inline_message_2278.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_componentStack_2262, + JSCompiler_object_inline_componentStack_2281, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2261 + JSCompiler_object_inline_stack_2280 ); if ( "number" === - typeof JSCompiler_object_inline_stack_2261.unstable_expectedLoadTime + typeof JSCompiler_object_inline_stack_2280.unstable_expectedLoadTime ) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2261 = + (JSCompiler_object_inline_stack_2280 = mountSuspenseFallbackChildren( workInProgress, - JSCompiler_object_inline_digest_2260, + JSCompiler_object_inline_digest_2279, JSCompiler_temp, renderLanes )), - (JSCompiler_object_inline_message_2259 = workInProgress.child), - (JSCompiler_object_inline_message_2259.memoizedState = + (JSCompiler_object_inline_message_2278 = workInProgress.child), + (JSCompiler_object_inline_message_2278.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_message_2259.childLanes = + (JSCompiler_object_inline_message_2278.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_componentStack_2262, + JSCompiler_object_inline_componentStack_2281, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), (workInProgress.lanes = 4194304), - JSCompiler_object_inline_stack_2261 + JSCompiler_object_inline_stack_2280 ); pushPrimaryTreeSuspenseHandler(workInProgress); return mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_digest_2260 + JSCompiler_object_inline_digest_2279 ); } var prevState = current.memoizedState; if ( null !== prevState && - ((JSCompiler_object_inline_digest_2260 = prevState.dehydrated), - null !== JSCompiler_object_inline_digest_2260) + ((JSCompiler_object_inline_digest_2279 = prevState.dehydrated), + null !== JSCompiler_object_inline_digest_2279) ) { if (didSuspend) workInProgress.flags & 256 @@ -9017,94 +9037,94 @@ (workInProgress.flags |= 128), (workInProgress = null)) : (reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_message_2259 = - JSCompiler_object_inline_stack_2261.fallback), - (JSCompiler_object_inline_digest_2260 = workInProgress.mode), - (JSCompiler_object_inline_stack_2261 = + (JSCompiler_object_inline_message_2278 = + JSCompiler_object_inline_stack_2280.fallback), + (JSCompiler_object_inline_digest_2279 = workInProgress.mode), + (JSCompiler_object_inline_stack_2280 = mountWorkInProgressOffscreenFiber( { mode: "visible", - children: JSCompiler_object_inline_stack_2261.children + children: JSCompiler_object_inline_stack_2280.children }, - JSCompiler_object_inline_digest_2260 + JSCompiler_object_inline_digest_2279 )), - (JSCompiler_object_inline_message_2259 = + (JSCompiler_object_inline_message_2278 = createFiberFromFragment( - JSCompiler_object_inline_message_2259, - JSCompiler_object_inline_digest_2260, + JSCompiler_object_inline_message_2278, + JSCompiler_object_inline_digest_2279, renderLanes, null )), - (JSCompiler_object_inline_message_2259.flags |= 2), - (JSCompiler_object_inline_stack_2261.return = workInProgress), - (JSCompiler_object_inline_message_2259.return = workInProgress), - (JSCompiler_object_inline_stack_2261.sibling = - JSCompiler_object_inline_message_2259), - (workInProgress.child = JSCompiler_object_inline_stack_2261), + (JSCompiler_object_inline_message_2278.flags |= 2), + (JSCompiler_object_inline_stack_2280.return = workInProgress), + (JSCompiler_object_inline_message_2278.return = workInProgress), + (JSCompiler_object_inline_stack_2280.sibling = + JSCompiler_object_inline_message_2278), + (workInProgress.child = JSCompiler_object_inline_stack_2280), reconcileChildFibers( workInProgress, current.child, null, renderLanes ), - (JSCompiler_object_inline_stack_2261 = workInProgress.child), - (JSCompiler_object_inline_stack_2261.memoizedState = + (JSCompiler_object_inline_stack_2280 = workInProgress.child), + (JSCompiler_object_inline_stack_2280.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_stack_2261.childLanes = + (JSCompiler_object_inline_stack_2280.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_componentStack_2262, + JSCompiler_object_inline_componentStack_2281, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - (workInProgress = JSCompiler_object_inline_message_2259)); + (workInProgress = JSCompiler_object_inline_message_2278)); else if ( (pushPrimaryTreeSuspenseHandler(workInProgress), isHydrating && console.error( "We should not be hydrating here. This is a bug in React. Please file a bug." ), - JSCompiler_object_inline_digest_2260.data === + JSCompiler_object_inline_digest_2279.data === SUSPENSE_FALLBACK_START_DATA) ) { - JSCompiler_object_inline_componentStack_2262 = - JSCompiler_object_inline_digest_2260.nextSibling && - JSCompiler_object_inline_digest_2260.nextSibling.dataset; - if (JSCompiler_object_inline_componentStack_2262) { - JSCompiler_temp = JSCompiler_object_inline_componentStack_2262.dgst; - var message = JSCompiler_object_inline_componentStack_2262.msg; - instance = JSCompiler_object_inline_componentStack_2262.stck; + JSCompiler_object_inline_componentStack_2281 = + JSCompiler_object_inline_digest_2279.nextSibling && + JSCompiler_object_inline_digest_2279.nextSibling.dataset; + if (JSCompiler_object_inline_componentStack_2281) { + JSCompiler_temp = JSCompiler_object_inline_componentStack_2281.dgst; + var message = JSCompiler_object_inline_componentStack_2281.msg; + instance = JSCompiler_object_inline_componentStack_2281.stck; var componentStack = - JSCompiler_object_inline_componentStack_2262.cstck; + JSCompiler_object_inline_componentStack_2281.cstck; } - JSCompiler_object_inline_message_2259 = message; - JSCompiler_object_inline_digest_2260 = JSCompiler_temp; - JSCompiler_object_inline_stack_2261 = instance; - JSCompiler_object_inline_componentStack_2262 = componentStack; - "POSTPONE" !== JSCompiler_object_inline_digest_2260 && - ((JSCompiler_object_inline_message_2259 = - JSCompiler_object_inline_message_2259 - ? Error(JSCompiler_object_inline_message_2259) + JSCompiler_object_inline_message_2278 = message; + JSCompiler_object_inline_digest_2279 = JSCompiler_temp; + JSCompiler_object_inline_stack_2280 = instance; + JSCompiler_object_inline_componentStack_2281 = componentStack; + "POSTPONE" !== JSCompiler_object_inline_digest_2279 && + ((JSCompiler_object_inline_message_2278 = + JSCompiler_object_inline_message_2278 + ? Error(JSCompiler_object_inline_message_2278) : Error( "The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering." )), - (JSCompiler_object_inline_message_2259.stack = - JSCompiler_object_inline_stack_2261 || ""), - (JSCompiler_object_inline_message_2259.digest = - JSCompiler_object_inline_digest_2260), - (JSCompiler_object_inline_componentStack_2262 = - void 0 === JSCompiler_object_inline_componentStack_2262 + (JSCompiler_object_inline_message_2278.stack = + JSCompiler_object_inline_stack_2280 || ""), + (JSCompiler_object_inline_message_2278.digest = + JSCompiler_object_inline_digest_2279), + (JSCompiler_object_inline_componentStack_2281 = + void 0 === JSCompiler_object_inline_componentStack_2281 ? null - : JSCompiler_object_inline_componentStack_2262), - "string" === typeof JSCompiler_object_inline_componentStack_2262 && + : JSCompiler_object_inline_componentStack_2281), + "string" === typeof JSCompiler_object_inline_componentStack_2281 && CapturedStacks.set( - JSCompiler_object_inline_message_2259, - JSCompiler_object_inline_componentStack_2262 + JSCompiler_object_inline_message_2278, + JSCompiler_object_inline_componentStack_2281 ), queueHydrationError({ - value: JSCompiler_object_inline_message_2259, + value: JSCompiler_object_inline_message_2278, source: null, - stack: JSCompiler_object_inline_componentStack_2262 + stack: JSCompiler_object_inline_componentStack_2281 })); workInProgress = retrySuspenseComponentWithoutHydrating( current, @@ -9119,25 +9139,25 @@ renderLanes, !1 ), - (JSCompiler_object_inline_componentStack_2262 = + (JSCompiler_object_inline_componentStack_2281 = 0 !== (renderLanes & current.childLanes)), - didReceiveUpdate || JSCompiler_object_inline_componentStack_2262) + didReceiveUpdate || JSCompiler_object_inline_componentStack_2281) ) { - JSCompiler_object_inline_componentStack_2262 = workInProgressRoot; - if (null !== JSCompiler_object_inline_componentStack_2262) { - JSCompiler_object_inline_stack_2261 = renderLanes & -renderLanes; - if (0 !== (JSCompiler_object_inline_stack_2261 & 42)) - JSCompiler_object_inline_stack_2261 = 1; + JSCompiler_object_inline_componentStack_2281 = workInProgressRoot; + if (null !== JSCompiler_object_inline_componentStack_2281) { + JSCompiler_object_inline_stack_2280 = renderLanes & -renderLanes; + if (0 !== (JSCompiler_object_inline_stack_2280 & 42)) + JSCompiler_object_inline_stack_2280 = 1; else - switch (JSCompiler_object_inline_stack_2261) { + switch (JSCompiler_object_inline_stack_2280) { case 2: - JSCompiler_object_inline_stack_2261 = 1; + JSCompiler_object_inline_stack_2280 = 1; break; case 8: - JSCompiler_object_inline_stack_2261 = 4; + JSCompiler_object_inline_stack_2280 = 4; break; case 32: - JSCompiler_object_inline_stack_2261 = 16; + JSCompiler_object_inline_stack_2280 = 16; break; case 128: case 256: @@ -9158,40 +9178,40 @@ case 8388608: case 16777216: case 33554432: - JSCompiler_object_inline_stack_2261 = 64; + JSCompiler_object_inline_stack_2280 = 64; break; case 268435456: - JSCompiler_object_inline_stack_2261 = 134217728; + JSCompiler_object_inline_stack_2280 = 134217728; break; default: - JSCompiler_object_inline_stack_2261 = 0; + JSCompiler_object_inline_stack_2280 = 0; } - JSCompiler_object_inline_stack_2261 = + JSCompiler_object_inline_stack_2280 = 0 !== - (JSCompiler_object_inline_stack_2261 & - (JSCompiler_object_inline_componentStack_2262.suspendedLanes | + (JSCompiler_object_inline_stack_2280 & + (JSCompiler_object_inline_componentStack_2281.suspendedLanes | renderLanes)) ? 0 - : JSCompiler_object_inline_stack_2261; + : JSCompiler_object_inline_stack_2280; if ( - 0 !== JSCompiler_object_inline_stack_2261 && - JSCompiler_object_inline_stack_2261 !== prevState.retryLane + 0 !== JSCompiler_object_inline_stack_2280 && + JSCompiler_object_inline_stack_2280 !== prevState.retryLane ) throw ( - ((prevState.retryLane = JSCompiler_object_inline_stack_2261), + ((prevState.retryLane = JSCompiler_object_inline_stack_2280), enqueueConcurrentRenderForLane( current, - JSCompiler_object_inline_stack_2261 + JSCompiler_object_inline_stack_2280 ), scheduleUpdateOnFiber( - JSCompiler_object_inline_componentStack_2262, + JSCompiler_object_inline_componentStack_2281, current, - JSCompiler_object_inline_stack_2261 + JSCompiler_object_inline_stack_2280 ), SelectiveHydrationException) ); } - JSCompiler_object_inline_digest_2260.data === + JSCompiler_object_inline_digest_2279.data === SUSPENSE_PENDING_START_DATA || renderDidSuspendDelayIfPossible(); workInProgress = retrySuspenseComponentWithoutHydrating( current, @@ -9199,7 +9219,7 @@ renderLanes ); } else - JSCompiler_object_inline_digest_2260.data === + JSCompiler_object_inline_digest_2279.data === SUSPENSE_PENDING_START_DATA ? ((workInProgress.flags |= 128), (workInProgress.child = current.child), @@ -9207,12 +9227,12 @@ null, current )), - (JSCompiler_object_inline_digest_2260._reactRetry = + (JSCompiler_object_inline_digest_2279._reactRetry = workInProgress), (workInProgress = null)) : ((current = prevState.treeContext), (nextHydratableInstance = getNextHydratable( - JSCompiler_object_inline_digest_2260.nextSibling + JSCompiler_object_inline_digest_2279.nextSibling )), (hydrationParentFiber = workInProgress), (isHydrating = !0), @@ -9230,54 +9250,54 @@ (treeContextProvider = workInProgress)), (workInProgress = mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_stack_2261.children + JSCompiler_object_inline_stack_2280.children )), (workInProgress.flags |= 4096)); return workInProgress; } - if (JSCompiler_object_inline_message_2259) + if (JSCompiler_object_inline_message_2278) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_message_2259 = - JSCompiler_object_inline_stack_2261.fallback), - (JSCompiler_object_inline_digest_2260 = workInProgress.mode), + (JSCompiler_object_inline_message_2278 = + JSCompiler_object_inline_stack_2280.fallback), + (JSCompiler_object_inline_digest_2279 = workInProgress.mode), (JSCompiler_temp = current.child), (instance = JSCompiler_temp.sibling), - (JSCompiler_object_inline_stack_2261 = createWorkInProgress( + (JSCompiler_object_inline_stack_2280 = createWorkInProgress( JSCompiler_temp, { mode: "hidden", - children: JSCompiler_object_inline_stack_2261.children + children: JSCompiler_object_inline_stack_2280.children } )), - (JSCompiler_object_inline_stack_2261.subtreeFlags = + (JSCompiler_object_inline_stack_2280.subtreeFlags = JSCompiler_temp.subtreeFlags & 31457280), null !== instance - ? (JSCompiler_object_inline_message_2259 = createWorkInProgress( + ? (JSCompiler_object_inline_message_2278 = createWorkInProgress( instance, - JSCompiler_object_inline_message_2259 + JSCompiler_object_inline_message_2278 )) - : ((JSCompiler_object_inline_message_2259 = createFiberFromFragment( - JSCompiler_object_inline_message_2259, - JSCompiler_object_inline_digest_2260, + : ((JSCompiler_object_inline_message_2278 = createFiberFromFragment( + JSCompiler_object_inline_message_2278, + JSCompiler_object_inline_digest_2279, renderLanes, null )), - (JSCompiler_object_inline_message_2259.flags |= 2)), - (JSCompiler_object_inline_message_2259.return = workInProgress), - (JSCompiler_object_inline_stack_2261.return = workInProgress), - (JSCompiler_object_inline_stack_2261.sibling = - JSCompiler_object_inline_message_2259), - (workInProgress.child = JSCompiler_object_inline_stack_2261), - (JSCompiler_object_inline_stack_2261 = - JSCompiler_object_inline_message_2259), - (JSCompiler_object_inline_message_2259 = workInProgress.child), - (JSCompiler_object_inline_digest_2260 = current.child.memoizedState), - null === JSCompiler_object_inline_digest_2260 - ? (JSCompiler_object_inline_digest_2260 = + (JSCompiler_object_inline_message_2278.flags |= 2)), + (JSCompiler_object_inline_message_2278.return = workInProgress), + (JSCompiler_object_inline_stack_2280.return = workInProgress), + (JSCompiler_object_inline_stack_2280.sibling = + JSCompiler_object_inline_message_2278), + (workInProgress.child = JSCompiler_object_inline_stack_2280), + (JSCompiler_object_inline_stack_2280 = + JSCompiler_object_inline_message_2278), + (JSCompiler_object_inline_message_2278 = workInProgress.child), + (JSCompiler_object_inline_digest_2279 = current.child.memoizedState), + null === JSCompiler_object_inline_digest_2279 + ? (JSCompiler_object_inline_digest_2279 = mountSuspenseOffscreenState(renderLanes)) : ((JSCompiler_temp = - JSCompiler_object_inline_digest_2260.cachePool), + JSCompiler_object_inline_digest_2279.cachePool), null !== JSCompiler_temp ? ((instance = CacheContext._currentValue), (JSCompiler_temp = @@ -9285,38 +9305,38 @@ ? { parent: instance, pool: instance } : JSCompiler_temp)) : (JSCompiler_temp = getSuspendedCache()), - (JSCompiler_object_inline_digest_2260 = { + (JSCompiler_object_inline_digest_2279 = { baseLanes: - JSCompiler_object_inline_digest_2260.baseLanes | renderLanes, + JSCompiler_object_inline_digest_2279.baseLanes | renderLanes, cachePool: JSCompiler_temp })), - (JSCompiler_object_inline_message_2259.memoizedState = - JSCompiler_object_inline_digest_2260), - (JSCompiler_object_inline_message_2259.childLanes = + (JSCompiler_object_inline_message_2278.memoizedState = + JSCompiler_object_inline_digest_2279), + (JSCompiler_object_inline_message_2278.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_componentStack_2262, + JSCompiler_object_inline_componentStack_2281, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2261 + JSCompiler_object_inline_stack_2280 ); pushPrimaryTreeSuspenseHandler(workInProgress); renderLanes = current.child; current = renderLanes.sibling; renderLanes = createWorkInProgress(renderLanes, { mode: "visible", - children: JSCompiler_object_inline_stack_2261.children + children: JSCompiler_object_inline_stack_2280.children }); renderLanes.return = workInProgress; renderLanes.sibling = null; null !== current && - ((JSCompiler_object_inline_componentStack_2262 = + ((JSCompiler_object_inline_componentStack_2281 = workInProgress.deletions), - null === JSCompiler_object_inline_componentStack_2262 + null === JSCompiler_object_inline_componentStack_2281 ? ((workInProgress.deletions = [current]), (workInProgress.flags |= 16)) - : JSCompiler_object_inline_componentStack_2262.push(current)); + : JSCompiler_object_inline_componentStack_2281.push(current)); workInProgress.child = renderLanes; workInProgress.memoizedState = null; return renderLanes; @@ -11234,7 +11254,12 @@ } else ref.current = null; } - function commitProfiler(finishedWork, current, commitTime, effectDuration) { + function commitProfiler( + finishedWork, + current, + commitStartTime, + effectDuration + ) { var _finishedWork$memoize = finishedWork.memoizedProps, id = _finishedWork$memoize.id, onCommit = _finishedWork$memoize.onCommit; @@ -11248,20 +11273,20 @@ finishedWork.actualDuration, finishedWork.treeBaseDuration, finishedWork.actualStartTime, - commitTime + commitStartTime ); "function" === typeof onCommit && onCommit( finishedWork.memoizedProps.id, current, effectDuration, - commitTime + commitStartTime ); } function commitProfilerPostCommitImpl( finishedWork, current, - commitTime, + commitStartTime, passiveEffectDuration ) { var _finishedWork$memoize2 = finishedWork.memoizedProps; @@ -11274,7 +11299,7 @@ finishedWork, current, passiveEffectDuration, - commitTime + commitStartTime ); } function commitHostMount(finishedWork) { @@ -11718,7 +11743,7 @@ commitProfiler, finishedWork, current, - commitTime, + commitStartTime, finishedRoot.effectDuration ); } catch (error) { @@ -12732,7 +12757,7 @@ commitProfiler, finishedWork, current, - commitTime, + commitStartTime, includeWorkInProgressEffects.effectDuration ); } catch (error) { @@ -12928,7 +12953,7 @@ commitProfilerPostCommitImpl, finishedWork, finishedWork.alternate, - commitTime, + commitStartTime, finishedRoot.passiveEffectDuration ); } catch (error) { @@ -13734,8 +13759,7 @@ workInProgress.flags & 16384 && ((retryQueue = 22 !== workInProgress.tag ? claimNextRetryLane() : 536870912), - (workInProgress.lanes |= retryQueue), - (workInProgressSuspendedRetryLanes |= retryQueue)); + (workInProgress.lanes |= retryQueue)); } function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { if (!isHydrating) @@ -14532,8 +14556,7 @@ markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane, - workInProgressRootDidSkipSuspendedSiblings + workInProgressDeferredLane ); markRootUpdated(root, lane); if ( @@ -14575,199 +14598,189 @@ markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane, - workInProgressRootDidSkipSuspendedSiblings + workInProgressDeferredLane )), ensureRootIsScheduled(root); } - function performConcurrentWorkOnRoot(root, didTimeout) { - nestedUpdateScheduled = currentUpdateIsNested = !1; + function performWorkOnRoot(root, lanes, forceSync) { if ((executionContext & (RenderContext | CommitContext)) !== NoContext) throw Error("Should not already be working."); - var originalCallbackNode = root.callbackNode; - if (flushPassiveEffects() && root.callbackNode !== originalCallbackNode) - return null; - var lanes = getNextLanes( - root, - root === workInProgressRoot ? workInProgressRootRenderLanes : 0 - ); - if (0 === lanes) return null; var shouldTimeSlice = - 0 === (lanes & 60) && 0 === (lanes & root.expiredLanes) && !didTimeout; - didTimeout = shouldTimeSlice - ? renderRootConcurrent(root, lanes) - : renderRootSync(root, lanes); - if (didTimeout !== RootInProgress) { + (!forceSync && + 0 === (lanes & 60) && + 0 === (lanes & root.expiredLanes)) || + !1, + exitStatus = shouldTimeSlice + ? renderRootConcurrent(root, lanes) + : renderRootSync(root, lanes, !0); + do { var renderWasConcurrent = shouldTimeSlice; - do { - if (didTimeout === RootDidNotComplete) - markRootSuspended( - root, - lanes, - 0, - workInProgressRootDidSkipSuspendedSiblings - ); - else { - shouldTimeSlice = root.current.alternate; - if ( - renderWasConcurrent && - !isRenderConsistentWithExternalStores(shouldTimeSlice) - ) { - didTimeout = renderRootSync(root, lanes); - renderWasConcurrent = !1; - continue; - } - if (didTimeout === RootErrored) { - renderWasConcurrent = lanes; - var errorRetryLanes = getLanesToRetrySynchronouslyOnError( - root, - renderWasConcurrent - ); - if ( - 0 !== errorRetryLanes && - ((lanes = errorRetryLanes), - (didTimeout = recoverFromConcurrentError( - root, - renderWasConcurrent, - errorRetryLanes - )), - (renderWasConcurrent = !1), - didTimeout !== RootErrored) - ) - continue; - } - if (didTimeout === RootFatalErrored) { - prepareFreshStack(root, 0); - markRootSuspended( - root, - lanes, - 0, - workInProgressRootDidSkipSuspendedSiblings - ); - break; - } - a: { - renderWasConcurrent = root; - completeTime = now(); - switch (didTimeout) { - case RootInProgress: - case RootFatalErrored: - throw Error("Root did not complete. This is a bug in React."); - case RootSuspendedWithDelay: - if ((lanes & 4194176) === lanes) { - markRootSuspended( - renderWasConcurrent, - lanes, - workInProgressDeferredLane, - workInProgressRootDidSkipSuspendedSiblings - ); + if (exitStatus === RootInProgress) break; + else if (exitStatus === RootDidNotComplete) + markRootSuspended(root, lanes, 0); + else { + forceSync = root.current.alternate; + if ( + renderWasConcurrent && + !isRenderConsistentWithExternalStores(forceSync) + ) { + exitStatus = renderRootSync(root, lanes, !1); + continue; + } + if (exitStatus === RootErrored) { + renderWasConcurrent = lanes; + if (root.errorRecoveryDisabledLanes & renderWasConcurrent) + var errorRetryLanes = 0; + else + (errorRetryLanes = root.pendingLanes & -536870913), + (errorRetryLanes = + 0 !== errorRetryLanes + ? errorRetryLanes + : errorRetryLanes & 536870912 + ? 536870912 + : 0); + if (0 !== errorRetryLanes) { + lanes = errorRetryLanes; + a: { + exitStatus = root; + var errorRetryLanes$jscomp$0 = errorRetryLanes; + errorRetryLanes = workInProgressRootConcurrentErrors; + var wasRootDehydrated = + exitStatus.current.memoizedState.isDehydrated; + wasRootDehydrated && + (prepareFreshStack( + exitStatus, + errorRetryLanes$jscomp$0 + ).flags |= 256); + errorRetryLanes$jscomp$0 = renderRootSync( + exitStatus, + errorRetryLanes$jscomp$0, + !1 + ); + if (errorRetryLanes$jscomp$0 !== RootErrored) { + if ( + workInProgressRootDidAttachPingListener && + !wasRootDehydrated + ) { + exitStatus.errorRecoveryDisabledLanes |= + renderWasConcurrent; + workInProgressRootInterleavedUpdatedLanes |= + renderWasConcurrent; + exitStatus = RootSuspendedWithDelay; break a; } - break; - case RootErrored: - workInProgressRootRecoverableErrors = null; - break; - case RootSuspended: - case RootCompleted: - break; - default: - throw Error("Unknown root exit status."); + exitStatus = workInProgressRootRecoverableErrors; + workInProgressRootRecoverableErrors = errorRetryLanes; + null !== exitStatus && queueRecoverableErrors(exitStatus); + } + exitStatus = errorRetryLanes$jscomp$0; } - renderWasConcurrent.finishedWork = shouldTimeSlice; - renderWasConcurrent.finishedLanes = lanes; - if (null !== ReactSharedInternals.actQueue) - commitRoot( - renderWasConcurrent, - workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, - workInProgressDeferredLane, - workInProgressRootInterleavedUpdatedLanes, - workInProgressSuspendedRetryLanes - ); - else { - if ( - (lanes & 62914560) === lanes && - ((didTimeout = - globalMostRecentFallbackTime + - FALLBACK_THROTTLE_MS - - now$1()), - 10 < didTimeout) - ) { + if (exitStatus !== RootErrored) continue; + } + } + if (exitStatus === RootFatalErrored) { + prepareFreshStack(root, 0); + markRootSuspended(root, lanes, 0); + break; + } + a: { + shouldTimeSlice = root; + renderWasConcurrent = now$1(); + switch (exitStatus) { + case RootInProgress: + case RootFatalErrored: + throw Error("Root did not complete. This is a bug in React."); + case RootSuspendedWithDelay: + if ((lanes & 4194176) === lanes) { markRootSuspended( - renderWasConcurrent, + shouldTimeSlice, lanes, - workInProgressDeferredLane, - workInProgressRootDidSkipSuspendedSiblings - ); - if (0 !== getNextLanes(renderWasConcurrent, 0)) break a; - renderWasConcurrent.timeoutHandle = scheduleTimeout( - commitRootWhenReady.bind( - null, - renderWasConcurrent, - shouldTimeSlice, - workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, - lanes, - workInProgressDeferredLane, - workInProgressRootInterleavedUpdatedLanes, - workInProgressSuspendedRetryLanes, - workInProgressRootDidSkipSuspendedSiblings - ), - didTimeout + workInProgressDeferredLane ); break a; } - commitRootWhenReady( - renderWasConcurrent, + break; + case RootErrored: + workInProgressRootRecoverableErrors = null; + break; + case RootSuspended: + case RootCompleted: + break; + default: + throw Error("Unknown root exit status."); + } + shouldTimeSlice.finishedWork = forceSync; + shouldTimeSlice.finishedLanes = lanes; + if (null !== ReactSharedInternals.actQueue) + commitRoot( + shouldTimeSlice, + workInProgressRootRecoverableErrors, + workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + IMMEDIATE_COMMIT, + renderStartTime, + renderWasConcurrent + ); + else { + if ( + (lanes & 62914560) === lanes && + ((exitStatus = + globalMostRecentFallbackTime + + FALLBACK_THROTTLE_MS - + now$1()), + 10 < exitStatus) + ) { + markRootSuspended( shouldTimeSlice, - workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, lanes, - workInProgressDeferredLane, - workInProgressRootInterleavedUpdatedLanes, - workInProgressSuspendedRetryLanes, - workInProgressRootDidSkipSuspendedSiblings + workInProgressDeferredLane + ); + if (0 !== getNextLanes(shouldTimeSlice, 0)) break a; + shouldTimeSlice.timeoutHandle = scheduleTimeout( + commitRootWhenReady.bind( + null, + shouldTimeSlice, + forceSync, + workInProgressRootRecoverableErrors, + workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, + lanes, + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + workInProgressRootDidSkipSuspendedSiblings, + THROTTLED_COMMIT, + renderStartTime, + renderWasConcurrent + ), + exitStatus ); + break a; } + commitRootWhenReady( + shouldTimeSlice, + forceSync, + workInProgressRootRecoverableErrors, + workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, + lanes, + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + workInProgressRootDidSkipSuspendedSiblings, + IMMEDIATE_COMMIT, + renderStartTime, + renderWasConcurrent + ); } } - break; - } while (1); - } + } + break; + } while (1); ensureRootIsScheduled(root); - scheduleTaskForRootDuringMicrotask(root, now$1()); - root = - root.callbackNode === originalCallbackNode - ? performConcurrentWorkOnRoot.bind(null, root) - : null; - return root; - } - function recoverFromConcurrentError( - root, - originallyAttemptedLanes, - errorRetryLanes - ) { - var errorsFromFirstAttempt = workInProgressRootConcurrentErrors, - wasRootDehydrated = root.current.memoizedState.isDehydrated; - wasRootDehydrated && - (prepareFreshStack(root, errorRetryLanes).flags |= 256); - errorRetryLanes = renderRootSync(root, errorRetryLanes); - if (errorRetryLanes !== RootErrored) { - if (workInProgressRootDidAttachPingListener && !wasRootDehydrated) - return ( - (root.errorRecoveryDisabledLanes |= originallyAttemptedLanes), - (workInProgressRootInterleavedUpdatedLanes |= - originallyAttemptedLanes), - RootSuspendedWithDelay - ); - root = workInProgressRootRecoverableErrors; - workInProgressRootRecoverableErrors = errorsFromFirstAttempt; - null !== root && queueRecoverableErrors(root); - } - return errorRetryLanes; } function queueRecoverableErrors(errors) { null === workInProgressRootRecoverableErrors @@ -14787,10 +14800,16 @@ spawnedLane, updatedLanes, suspendedRetryLanes, - didSkipSuspendedSiblings + didSkipSuspendedSiblings, + suspendedCommitReason, + completedRenderStartTime, + completedRenderEndTime ) { - var subtreeFlags = finishedWork.subtreeFlags; - if (subtreeFlags & 8192 || 16785408 === (subtreeFlags & 16785408)) + didSkipSuspendedSiblings = finishedWork.subtreeFlags; + if ( + didSkipSuspendedSiblings & 8192 || + 16785408 === (didSkipSuspendedSiblings & 16785408) + ) if ( ((suspendedState = { stylesheets: null, count: 0, unsuspend: noop }), accumulateSuspenseyCommitOnFiber(finishedWork), @@ -14806,10 +14825,13 @@ didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes + suspendedRetryLanes, + SUSPENDED_COMMIT, + completedRenderStartTime, + completedRenderEndTime ) ); - markRootSuspended(root, lanes, spawnedLane, didSkipSuspendedSiblings); + markRootSuspended(root, lanes, spawnedLane); return; } commitRoot( @@ -14819,7 +14841,10 @@ didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes + suspendedRetryLanes, + suspendedCommitReason, + completedRenderStartTime, + completedRenderEndTime ); } function isRenderConsistentWithExternalStores(finishedWork) { @@ -14868,81 +14893,24 @@ (didIncludeCommitPhaseUpdate = !0); throwIfInfiniteUpdateLoopDetected(); } - function markRootSuspended( - root, - suspendedLanes, - spawnedLane, - didSkipSuspendedSiblings - ) { + function markRootSuspended(root, suspendedLanes, spawnedLane) { suspendedLanes &= ~workInProgressRootPingedLanes; suspendedLanes &= ~workInProgressRootInterleavedUpdatedLanes; root.suspendedLanes |= suspendedLanes; root.pingedLanes &= ~suspendedLanes; - didSkipSuspendedSiblings || (root.warmLanes |= suspendedLanes); - didSkipSuspendedSiblings = root.expirationTimes; - for (var lanes = suspendedLanes; 0 < lanes; ) { + for ( + var expirationTimes = root.expirationTimes, lanes = suspendedLanes; + 0 < lanes; + + ) { var index = 31 - clz32(lanes), lane = 1 << index; - didSkipSuspendedSiblings[index] = -1; + expirationTimes[index] = -1; lanes &= ~lane; } 0 !== spawnedLane && markSpawnedDeferredLane(root, spawnedLane, suspendedLanes); } - function performSyncWorkOnRoot(root, lanes) { - if ((executionContext & (RenderContext | CommitContext)) !== NoContext) - throw Error("Should not already be working."); - if (flushPassiveEffects()) return ensureRootIsScheduled(root), null; - currentUpdateIsNested = nestedUpdateScheduled; - nestedUpdateScheduled = !1; - var exitStatus = renderRootSync(root, lanes); - if (exitStatus === RootErrored) { - var originallyAttemptedLanes = lanes, - errorRetryLanes = getLanesToRetrySynchronouslyOnError( - root, - originallyAttemptedLanes - ); - 0 !== errorRetryLanes && - ((lanes = errorRetryLanes), - (exitStatus = recoverFromConcurrentError( - root, - originallyAttemptedLanes, - errorRetryLanes - ))); - } - if (exitStatus === RootFatalErrored) - return ( - prepareFreshStack(root, 0), - markRootSuspended(root, lanes, 0, !1), - ensureRootIsScheduled(root), - null - ); - if (exitStatus === RootDidNotComplete) - return ( - markRootSuspended( - root, - lanes, - workInProgressDeferredLane, - workInProgressRootDidSkipSuspendedSiblings - ), - ensureRootIsScheduled(root), - null - ); - completeTime = now(); - root.finishedWork = root.current.alternate; - root.finishedLanes = lanes; - commitRoot( - root, - workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, - workInProgressDeferredLane, - workInProgressRootInterleavedUpdatedLanes, - workInProgressSuspendedRetryLanes - ); - ensureRootIsScheduled(root); - return null; - } function flushSyncWork$1() { return (executionContext & (RenderContext | CommitContext)) === NoContext ? (flushSyncWorkAcrossRoots_impl(0, !1), !1) @@ -15056,8 +15024,9 @@ workInProgressRootRenderLanes = lanes; workInProgressSuspendedReason = NotSuspended; workInProgressThrownValue = null; - workInProgressRootDidAttachPingListener = - workInProgressRootDidSkipSuspendedSiblings = !1; + workInProgressRootDidSkipSuspendedSiblings = !1; + checkIfRootIsPrerendering(root, lanes); + workInProgressRootDidAttachPingListener = !1; workInProgressRootExitStatus = RootInProgress; workInProgressSuspendedRetryLanes = workInProgressDeferredLane = @@ -15150,8 +15119,7 @@ markRootSuspended( workInProgressRoot, workInProgressRootRenderLanes, - workInProgressDeferredLane, - workInProgressRootDidSkipSuspendedSiblings + workInProgressDeferredLane ); } function queueConcurrentError(error) { @@ -15179,37 +15147,38 @@ prepareFreshStack(root, lanes); } lanes = !1; + memoizedUpdaters = workInProgressRootExitStatus; a: do try { if ( workInProgressSuspendedReason !== NotSuspended && null !== workInProgress ) { - memoizedUpdaters = workInProgress; - var thrownValue = workInProgressThrownValue; + var unitOfWork = workInProgress, + thrownValue = workInProgressThrownValue; switch (workInProgressSuspendedReason) { case SuspendedOnHydration: resetWorkInProgressStack(); - workInProgressRootExitStatus = RootDidNotComplete; + memoizedUpdaters = RootDidNotComplete; break a; case SuspendedOnImmediate: case SuspendedOnData: - lanes || - null !== suspenseHandlerStackCursor.current || - (lanes = !0); - default: + case SuspendedOnDeprecatedThrowPromise: + null === suspenseHandlerStackCursor.current && (lanes = !0); var reason = workInProgressSuspendedReason; workInProgressSuspendedReason = NotSuspended; workInProgressThrownValue = null; - throwAndUnwindWorkLoop( - root, - memoizedUpdaters, - thrownValue, - reason - ); + throwAndUnwindWorkLoop(root, unitOfWork, thrownValue, reason); + break; + default: + (reason = workInProgressSuspendedReason), + (workInProgressSuspendedReason = NotSuspended), + (workInProgressThrownValue = null), + throwAndUnwindWorkLoop(root, unitOfWork, thrownValue, reason); } } workLoopSync(); + memoizedUpdaters = workInProgressRootExitStatus; break; } catch (thrownValue$8) { handleThrow(root, thrownValue$8); @@ -15220,14 +15189,11 @@ executionContext = prevExecutionContext; ReactSharedInternals.H = prevDispatcher; ReactSharedInternals.A = prevAsyncDispatcher; - if (null !== workInProgress) - throw Error( - "Cannot commit an incomplete root. This error is likely caused by a bug in React. Please file an issue." - ); - workInProgressRoot = null; - workInProgressRootRenderLanes = 0; - finishQueueingConcurrentUpdates(); - return workInProgressRootExitStatus; + null === workInProgress && + ((workInProgressRoot = null), + (workInProgressRootRenderLanes = 0), + finishQueueingConcurrentUpdates()); + return memoizedUpdaters; } function workLoopSync() { for (; null !== workInProgress; ) performUnitOfWork(workInProgress); @@ -15251,7 +15217,7 @@ workInProgressTransitions = null; workInProgressRootRenderTargetTime = now$1() + RENDER_TIMEOUT_MS; prepareFreshStack(root, lanes); - } + } else checkIfRootIsPrerendering(root, lanes); a: do try { if ( @@ -15568,7 +15534,10 @@ didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes + suspendedRetryLanes, + suspendedCommitReason, + completedRenderStartTime, + completedRenderEndTime ) { var prevTransition = ReactSharedInternals.T, previousUpdateLanePriority = ReactDOMSharedInternals.p; @@ -15583,13 +15552,15 @@ previousUpdateLanePriority, spawnedLane, updatedLanes, - suspendedRetryLanes + suspendedRetryLanes, + suspendedCommitReason, + completedRenderStartTime, + completedRenderEndTime ); } finally { (ReactSharedInternals.T = prevTransition), (ReactDOMSharedInternals.p = previousUpdateLanePriority); } - return null; } function commitRootImpl( root, @@ -15599,7 +15570,10 @@ renderPriorityLevel, spawnedLane, updatedLanes, - suspendedRetryLanes + suspendedRetryLanes, + suspendedCommitReason, + completedRenderStartTime, + completedRenderEndTime ) { do flushPassiveEffects(); while (null !== rootWithPendingPassiveEffects); @@ -15607,107 +15581,118 @@ ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings(); if ((executionContext & (RenderContext | CommitContext)) !== NoContext) throw Error("Should not already be working."); - var finishedWork = root.finishedWork, - lanes = root.finishedLanes; - if (null === finishedWork) return null; - 0 === lanes && + suspendedRetryLanes = root.finishedWork; + updatedLanes = root.finishedLanes; + reusableComponentDevToolDetails.track = + getGroupNameOfHighestPriorityLane(updatedLanes); + logRenderPhase(completedRenderStartTime, completedRenderEndTime); + if (null === suspendedRetryLanes) return null; + 0 === updatedLanes && console.error( "root.finishedLanes should not be empty during a commit. This is a bug in React." ); root.finishedWork = null; root.finishedLanes = 0; - if (finishedWork === root.current) + if (suspendedRetryLanes === root.current) throw Error( "Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue." ); root.callbackNode = null; root.callbackPriority = 0; root.cancelPendingCommit = null; - var remainingLanes = finishedWork.lanes | finishedWork.childLanes; - remainingLanes |= concurrentlyUpdatedLanes; + completedRenderStartTime = + suspendedRetryLanes.lanes | suspendedRetryLanes.childLanes; + completedRenderStartTime |= concurrentlyUpdatedLanes; markRootFinished( root, - lanes, - remainingLanes, - spawnedLane, updatedLanes, - suspendedRetryLanes + completedRenderStartTime, + spawnedLane ); didIncludeCommitPhaseUpdate = !1; root === workInProgressRoot && ((workInProgress = workInProgressRoot = null), (workInProgressRootRenderLanes = 0)); - (0 === finishedWork.actualDuration && - 0 === (finishedWork.subtreeFlags & 10256) && - 0 === (finishedWork.flags & 10256)) || + (0 === suspendedRetryLanes.actualDuration && + 0 === (suspendedRetryLanes.subtreeFlags & 10256) && + 0 === (suspendedRetryLanes.flags & 10256)) || rootDoesHavePassiveEffects || ((rootDoesHavePassiveEffects = !0), - (pendingPassiveEffectsRemainingLanes = remainingLanes), + (pendingPassiveEffectsRemainingLanes = completedRenderStartTime), + (pendingPassiveEffectsRenderEndTime = completedRenderEndTime), (pendingPassiveTransitions = transitions), scheduleCallback$1(NormalPriority$1, function () { - flushPassiveEffects(); + flushPassiveEffects(!0); return null; })); - transitions = 0 !== (finishedWork.flags & 15990); - 0 !== (finishedWork.subtreeFlags & 15990) || transitions + commitStartTime = now(); + suspendedCommitReason === SUSPENDED_COMMIT + ? logSuspendedCommitPhase(completedRenderEndTime, commitStartTime) + : suspendedCommitReason === THROTTLED_COMMIT && + logSuspenseThrottlePhase(completedRenderEndTime, commitStartTime); + transitions = 0 !== (suspendedRetryLanes.flags & 15990); + 0 !== (suspendedRetryLanes.subtreeFlags & 15990) || transitions ? ((transitions = ReactSharedInternals.T), (ReactSharedInternals.T = null), (spawnedLane = ReactDOMSharedInternals.p), (ReactDOMSharedInternals.p = DiscreteEventPriority), - (updatedLanes = executionContext), + (suspendedCommitReason = executionContext), (executionContext |= CommitContext), - commitBeforeMutationEffects(root, finishedWork), - (commitTime = now()), - commitMutationEffects(root, finishedWork, lanes), + commitBeforeMutationEffects(root, suspendedRetryLanes), + commitMutationEffects(root, suspendedRetryLanes, updatedLanes), restoreSelection(selectionInformation, root.containerInfo), (_enabled = !!eventsEnabled), (selectionInformation = eventsEnabled = null), - (root.current = finishedWork), - commitLayoutEffects(finishedWork, root, lanes), + (root.current = suspendedRetryLanes), + commitLayoutEffects(suspendedRetryLanes, root, updatedLanes), requestPaint(), - (executionContext = updatedLanes), + (executionContext = suspendedCommitReason), (ReactDOMSharedInternals.p = spawnedLane), (ReactSharedInternals.T = transitions)) - : ((root.current = finishedWork), (commitTime = now())); + : (root.current = suspendedRetryLanes); + commitEndTime = now(); + logCommitPhase(commitStartTime, commitEndTime); (transitions = rootDoesHavePassiveEffects) ? ((rootDoesHavePassiveEffects = !1), (rootWithPendingPassiveEffects = root), - (pendingPassiveEffectsLanes = lanes)) - : (releaseRootPooledCache(root, remainingLanes), + (pendingPassiveEffectsLanes = updatedLanes)) + : (releaseRootPooledCache(root, completedRenderStartTime), (nestedPassiveUpdateCount = 0), (rootWithPassiveNestedUpdates = null)); - remainingLanes = root.pendingLanes; - 0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null); + completedRenderStartTime = root.pendingLanes; + 0 === completedRenderStartTime && + (legacyErrorBoundariesThatAlreadyFailed = null); transitions || commitDoubleInvokeEffectsInDEV(root); - onCommitRoot$1(finishedWork.stateNode, renderPriorityLevel); + onCommitRoot$1(suspendedRetryLanes.stateNode, renderPriorityLevel); isDevToolsPresent && root.memoizedUpdaters.clear(); onCommitRoot(); ensureRootIsScheduled(root); if (null !== recoverableErrors) for ( - renderPriorityLevel = root.onRecoverableError, finishedWork = 0; - finishedWork < recoverableErrors.length; - finishedWork++ + renderPriorityLevel = root.onRecoverableError, + suspendedRetryLanes = 0; + suspendedRetryLanes < recoverableErrors.length; + suspendedRetryLanes++ ) - (remainingLanes = recoverableErrors[finishedWork]), - (spawnedLane = makeErrorInfo(remainingLanes.stack)), + (completedRenderStartTime = recoverableErrors[suspendedRetryLanes]), + (spawnedLane = makeErrorInfo(completedRenderStartTime.stack)), runWithFiberInDEV( - remainingLanes.source, + completedRenderStartTime.source, renderPriorityLevel, - remainingLanes.value, + completedRenderStartTime.value, spawnedLane ); 0 !== (pendingPassiveEffectsLanes & 3) && flushPassiveEffects(); - remainingLanes = root.pendingLanes; + completedRenderStartTime = root.pendingLanes; didIncludeRenderPhaseUpdate || didIncludeCommitPhaseUpdate || - (0 !== (lanes & 4194218) && 0 !== (remainingLanes & 42)) + (0 !== (updatedLanes & 4194218) && 0 !== (completedRenderStartTime & 42)) ? ((nestedUpdateScheduled = !0), root === rootWithNestedUpdates ? nestedUpdateCount++ : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root))) : (nestedUpdateCount = 0); - transitions || finalizeRender(lanes, now$1()); + transitions || finalizeRender(updatedLanes, now$1()); flushSyncWorkAcrossRoots_impl(0, !1); return null; } @@ -15728,7 +15713,7 @@ null != remainingLanes && ((root.pooledCache = null), releaseCache(remainingLanes))); } - function flushPassiveEffects() { + function flushPassiveEffects(wasDelayedCommit) { if (null !== rootWithPendingPassiveEffects) { var root = rootWithPendingPassiveEffects, remainingLanes = pendingPassiveEffectsRemainingLanes; @@ -15746,10 +15731,10 @@ if (null === rootWithPendingPassiveEffects) var JSCompiler_inline_result = !1; else { - priority = pendingPassiveTransitions; + var transitions = pendingPassiveTransitions; pendingPassiveTransitions = null; - var root$jscomp$0 = rootWithPendingPassiveEffects, - lanes = pendingPassiveEffectsLanes; + priority = rootWithPendingPassiveEffects; + var lanes = pendingPassiveEffectsLanes; rootWithPendingPassiveEffects = null; pendingPassiveEffectsLanes = 0; if ( @@ -15760,40 +15745,56 @@ "Cannot flush passive effects while already rendering." ); reusableComponentDevToolDetails.track = - lanes & 63 - ? "Blocking" - : lanes & 4194240 - ? "Transition" - : lanes & 62914560 - ? "Suspense" - : lanes & 2080374784 - ? "Idle" - : "Other"; + getGroupNameOfHighestPriorityLane(lanes); isFlushingPassiveEffects = !0; didScheduleUpdateDuringPassiveEffects = !1; - var prevExecutionContext = executionContext; + var passiveEffectStartTime = 0; + passiveEffectStartTime = now$1(); + var startTime = commitEndTime, + endTime = passiveEffectStartTime; + supportsUserTiming && + ((reusableComponentDevToolDetails.color = "secondary-light"), + (reusableComponentOptions.start = startTime), + (reusableComponentOptions.end = endTime), + performance.measure( + "Waiting for Paint", + reusableComponentOptions + )); + startTime = executionContext; executionContext |= CommitContext; - var finishedWork = root$jscomp$0.current; + var finishedWork = priority.current; resetComponentEffectTimers(); commitPassiveUnmountOnFiber(finishedWork); - var finishedWork$jscomp$0 = root$jscomp$0.current; + var finishedWork$jscomp$0 = priority.current; + finishedWork = pendingPassiveEffectsRenderEndTime; resetComponentEffectTimers(); commitPassiveMountOnFiber( - root$jscomp$0, + priority, finishedWork$jscomp$0, lanes, - priority, - completeTime + transitions, + finishedWork ); - commitDoubleInvokeEffectsInDEV(root$jscomp$0); - executionContext = prevExecutionContext; - finalizeRender(lanes, now$1()); + commitDoubleInvokeEffectsInDEV(priority); + executionContext = startTime; + var passiveEffectsEndTime = now$1(); + wasDelayedCommit && + ((wasDelayedCommit = passiveEffectStartTime), + supportsUserTiming && + ((reusableComponentDevToolDetails.color = "secondary-dark"), + (reusableComponentOptions.start = wasDelayedCommit), + (reusableComponentOptions.end = passiveEffectsEndTime), + performance.measure( + "Remaining Effects", + reusableComponentOptions + ))); + finalizeRender(lanes, passiveEffectsEndTime); flushSyncWorkAcrossRoots_impl(0, !1); didScheduleUpdateDuringPassiveEffects - ? root$jscomp$0 === rootWithPassiveNestedUpdates + ? priority === rootWithPassiveNestedUpdates ? nestedPassiveUpdateCount++ : ((nestedPassiveUpdateCount = 0), - (rootWithPassiveNestedUpdates = root$jscomp$0)) + (rootWithPassiveNestedUpdates = priority)) : (nestedPassiveUpdateCount = 0); didScheduleUpdateDuringPassiveEffects = isFlushingPassiveEffects = !1; @@ -15802,7 +15803,7 @@ "function" === typeof injectedHook.onPostCommitFiberRoot ) try { - injectedHook.onPostCommitFiberRoot(rendererID, root$jscomp$0); + injectedHook.onPostCommitFiberRoot(rendererID, priority); } catch (err) { hasLoggedError || ((hasLoggedError = !0), @@ -15811,7 +15812,7 @@ err )); } - var stateNode = root$jscomp$0.current.stateNode; + var stateNode = priority.current.stateNode; stateNode.effectDuration = 0; stateNode.passiveEffectDuration = 0; JSCompiler_inline_result = !0; @@ -16142,7 +16143,8 @@ root, root === workInProgressRoot ? nextLanes : 0 )), - 0 !== (nextLanes & 3) && + 0 === (nextLanes & 3) || + checkIfRootIsPrerendering(root, nextLanes) || ((didPerformSomeWork = !0), performSyncWorkOnRoot(root, nextLanes)); root = root.next; @@ -16233,8 +16235,6 @@ else return currentTime; switch (lanesToEventPriority(suspendedLanes)) { case DiscreteEventPriority: - suspendedLanes = ImmediatePriority; - break; case ContinuousEventPriority: suspendedLanes = UserBlockingPriority; break; @@ -16247,7 +16247,7 @@ default: suspendedLanes = NormalPriority$1; } - pingedLanes = performConcurrentWorkOnRoot.bind(null, root); + pingedLanes = performWorkOnRootViaSchedulerTask.bind(null, root); null !== ReactSharedInternals.actQueue ? (ReactSharedInternals.actQueue.push(pingedLanes), (suspendedLanes = fakeActCallbackNode)) @@ -16256,6 +16256,34 @@ root.callbackNode = suspendedLanes; return currentTime; } + function performWorkOnRootViaSchedulerTask(root, didTimeout) { + nestedUpdateScheduled = currentUpdateIsNested = !1; + var originalCallbackNode = root.callbackNode; + if (flushPassiveEffects() && root.callbackNode !== originalCallbackNode) + return null; + var workInProgressRootRenderLanes$jscomp$0 = + workInProgressRootRenderLanes; + workInProgressRootRenderLanes$jscomp$0 = getNextLanes( + root, + root === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0 + ); + if (0 === workInProgressRootRenderLanes$jscomp$0) return null; + performWorkOnRoot( + root, + workInProgressRootRenderLanes$jscomp$0, + didTimeout + ); + scheduleTaskForRootDuringMicrotask(root, now$1()); + return root.callbackNode === originalCallbackNode + ? performWorkOnRootViaSchedulerTask.bind(null, root) + : null; + } + function performSyncWorkOnRoot(root, lanes) { + if (flushPassiveEffects()) return null; + currentUpdateIsNested = nestedUpdateScheduled; + nestedUpdateScheduled = !1; + performWorkOnRoot(root, lanes, !0); + } function cancelCallback(callbackNode) { callbackNode !== fakeActCallbackNode && null !== callbackNode && @@ -22489,8 +22517,8 @@ NoStrictPassiveEffectsMode = 64, now = Scheduler.unstable_now, renderStartTime = -0, - completeTime = -0, - commitTime = -0, + commitStartTime = -0, + commitEndTime = -0, profilerStartTime = -1.1, profilerEffectDuration = -0, componentEffectDuration = -0, @@ -24320,16 +24348,20 @@ rootWithPendingPassiveEffects = null, pendingPassiveEffectsLanes = 0, pendingPassiveEffectsRemainingLanes = 0, + pendingPassiveEffectsRenderEndTime = -0, pendingPassiveTransitions = null, - NESTED_UPDATE_LIMIT = 50, + NESTED_UPDATE_LIMIT = 100, nestedUpdateCount = 0, rootWithNestedUpdates = null, isFlushingPassiveEffects = !1, didScheduleUpdateDuringPassiveEffects = !1, - NESTED_PASSIVE_UPDATE_LIMIT = 50, + NESTED_PASSIVE_UPDATE_LIMIT = 100, nestedPassiveUpdateCount = 0, rootWithPassiveNestedUpdates = null, isRunningInsertionEffect = !1, + IMMEDIATE_COMMIT = 0, + SUSPENDED_COMMIT = 1, + THROTTLED_COMMIT = 2, didWarnStateUpdateForNotYetMountedComponent = null, didWarnAboutUpdateInRender = !1; var didWarnAboutUpdateInRenderForAnotherComponent = new Set(); @@ -24874,11 +24906,11 @@ }; (function () { var isomorphicReactPackageVersion = React.version; - if ("19.0.0-experimental-5d19e1c8-20240923" !== isomorphicReactPackageVersion) + if ("19.0.0-experimental-778e1ed2-20240926" !== isomorphicReactPackageVersion) throw Error( 'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion + - "\n - react-dom: 19.0.0-experimental-5d19e1c8-20240923\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.0.0-experimental-778e1ed2-20240926\nLearn more: https://react.dev/warnings/version-mismatch") ); })(); ("function" === typeof Map && @@ -24915,11 +24947,11 @@ !(function () { var internals = { bundleType: 1, - version: "19.0.0-experimental-5d19e1c8-20240923", + version: "19.0.0-experimental-778e1ed2-20240926", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, findFiberByHostInstance: getClosestInstanceFromNode, - reconcilerVersion: "19.0.0-experimental-5d19e1c8-20240923" + reconcilerVersion: "19.0.0-experimental-778e1ed2-20240926" }; internals.overrideHookState = overrideHookState; internals.overrideHookStateDeletePath = overrideHookStateDeletePath; @@ -25061,7 +25093,7 @@ listenToAllSupportedEvents(container); return new ReactDOMHydrationRoot(initialChildren); }; - exports.version = "19.0.0-experimental-5d19e1c8-20240923"; + exports.version = "19.0.0-experimental-778e1ed2-20240926"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-client.production.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-client.production.js index 36aabe44a73cf..b6bcccb91f4fc 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-client.production.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-client.production.js @@ -597,43 +597,39 @@ function getNextLanes(root, wipLanes) { var pendingLanes = root.pendingLanes; if (0 === pendingLanes) return 0; var nextLanes = 0, - suspendedLanes = root.suspendedLanes, - pingedLanes = root.pingedLanes, - warmLanes = root.warmLanes; - root = 0 !== root.finishedLanes; + suspendedLanes = root.suspendedLanes; + root = root.pingedLanes; var nonIdlePendingLanes = pendingLanes & 134217727; 0 !== nonIdlePendingLanes ? ((pendingLanes = nonIdlePendingLanes & ~suspendedLanes), 0 !== pendingLanes ? (nextLanes = getHighestPriorityLanes(pendingLanes)) - : ((pingedLanes &= nonIdlePendingLanes), - 0 !== pingedLanes - ? (nextLanes = getHighestPriorityLanes(pingedLanes)) - : root || - ((warmLanes = nonIdlePendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes))))) - : ((nonIdlePendingLanes = pendingLanes & ~suspendedLanes), - 0 !== nonIdlePendingLanes - ? (nextLanes = getHighestPriorityLanes(nonIdlePendingLanes)) - : 0 !== pingedLanes - ? (nextLanes = getHighestPriorityLanes(pingedLanes)) - : root || - ((warmLanes = pendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes)))); + : ((root &= nonIdlePendingLanes), + 0 !== root && (nextLanes = getHighestPriorityLanes(root)))) + : ((pendingLanes &= ~suspendedLanes), + 0 !== pendingLanes + ? (nextLanes = getHighestPriorityLanes(pendingLanes)) + : 0 !== root && (nextLanes = getHighestPriorityLanes(root))); return 0 === nextLanes ? 0 : 0 !== wipLanes && wipLanes !== nextLanes && 0 === (wipLanes & suspendedLanes) && ((suspendedLanes = nextLanes & -nextLanes), - (warmLanes = wipLanes & -wipLanes), - suspendedLanes >= warmLanes || - (32 === suspendedLanes && 0 !== (warmLanes & 4194176))) + (root = wipLanes & -wipLanes), + suspendedLanes >= root || + (32 === suspendedLanes && 0 !== (root & 4194176))) ? wipLanes : nextLanes; } +function checkIfRootIsPrerendering(root, renderLanes) { + return ( + 0 === + (root.pendingLanes & + ~(root.suspendedLanes & ~root.pingedLanes) & + renderLanes) + ); +} function computeExpirationTime(lane, currentTime) { switch (lane) { case 1: @@ -675,11 +671,6 @@ function computeExpirationTime(lane, currentTime) { return -1; } } -function getLanesToRetrySynchronouslyOnError(root, originallyAttemptedLanes) { - if (root.errorRecoveryDisabledLanes & originallyAttemptedLanes) return 0; - root = root.pendingLanes & -536870913; - return 0 !== root ? root : root & 536870912 ? 536870912 : 0; -} function claimNextTransitionLane() { var lane = nextTransitionLane; nextTransitionLane <<= 1; @@ -696,14 +687,7 @@ function createLaneMap(initial) { for (var laneMap = [], i = 0; 31 > i; i++) laneMap.push(initial); return laneMap; } -function markRootFinished( - root, - finishedLanes, - remainingLanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes -) { +function markRootFinished(root, finishedLanes, remainingLanes, spawnedLane) { var previouslyPendingLanes = root.pendingLanes; root.pendingLanes = remainingLanes; root.suspendedLanes = 0; @@ -713,36 +697,31 @@ function markRootFinished( root.entangledLanes &= remainingLanes; root.errorRecoveryDisabledLanes &= remainingLanes; root.shellSuspendCounter = 0; - var entanglements = root.entanglements, - expirationTimes = root.expirationTimes, + finishedLanes = root.entanglements; + var expirationTimes = root.expirationTimes, hiddenUpdates = root.hiddenUpdates; for ( remainingLanes = previouslyPendingLanes & ~remainingLanes; 0 < remainingLanes; ) { - var index$7 = 31 - clz32(remainingLanes), - lane = 1 << index$7; - entanglements[index$7] = 0; - expirationTimes[index$7] = -1; - var hiddenUpdatesForLane = hiddenUpdates[index$7]; + var index$6 = 31 - clz32(remainingLanes); + previouslyPendingLanes = 1 << index$6; + finishedLanes[index$6] = 0; + expirationTimes[index$6] = -1; + var hiddenUpdatesForLane = hiddenUpdates[index$6]; if (null !== hiddenUpdatesForLane) for ( - hiddenUpdates[index$7] = null, index$7 = 0; - index$7 < hiddenUpdatesForLane.length; - index$7++ + hiddenUpdates[index$6] = null, index$6 = 0; + index$6 < hiddenUpdatesForLane.length; + index$6++ ) { - var update = hiddenUpdatesForLane[index$7]; + var update = hiddenUpdatesForLane[index$6]; null !== update && (update.lane &= -536870913); } - remainingLanes &= ~lane; + remainingLanes &= ~previouslyPendingLanes; } 0 !== spawnedLane && markSpawnedDeferredLane(root, spawnedLane, 0); - 0 !== suspendedRetryLanes && - 0 === updatedLanes && - 0 !== root.tag && - (root.suspendedLanes |= - suspendedRetryLanes & ~(previouslyPendingLanes & ~finishedLanes)); } function markSpawnedDeferredLane(root, spawnedLane, entangledLanes) { root.pendingLanes |= spawnedLane; @@ -757,10 +736,10 @@ function markSpawnedDeferredLane(root, spawnedLane, entangledLanes) { function markRootEntangled(root, entangledLanes) { var rootEntangledLanes = (root.entangledLanes |= entangledLanes); for (root = root.entanglements; rootEntangledLanes; ) { - var index$8 = 31 - clz32(rootEntangledLanes), - lane = 1 << index$8; - (lane & entangledLanes) | (root[index$8] & entangledLanes) && - (root[index$8] |= entangledLanes); + var index$7 = 31 - clz32(rootEntangledLanes), + lane = 1 << index$7; + (lane & entangledLanes) | (root[index$7] & entangledLanes) && + (root[index$7] |= entangledLanes); rootEntangledLanes &= ~lane; } } @@ -910,8 +889,8 @@ function setValueForAttribute(node, name, value) { node.removeAttribute(name); return; case "boolean": - var prefix$10 = name.toLowerCase().slice(0, 5); - if ("data-" !== prefix$10 && "aria-" !== prefix$10) { + var prefix$9 = name.toLowerCase().slice(0, 5); + if ("data-" !== prefix$9 && "aria-" !== prefix$9) { node.removeAttribute(name); return; } @@ -1244,15 +1223,15 @@ function setValueForStyles(node, styles, prevStyles) { : "float" === styleName ? (node.cssFloat = "") : (node[styleName] = "")); - for (var styleName$16 in styles) - (styleName = styles[styleName$16]), - styles.hasOwnProperty(styleName$16) && - prevStyles[styleName$16] !== styleName && - setValueForStyle(node, styleName$16, styleName); + for (var styleName$15 in styles) + (styleName = styles[styleName$15]), + styles.hasOwnProperty(styleName$15) && + prevStyles[styleName$15] !== styleName && + setValueForStyle(node, styleName$15, styleName); } else - for (var styleName$17 in styles) - styles.hasOwnProperty(styleName$17) && - setValueForStyle(node, styleName$17, styles[styleName$17]); + for (var styleName$16 in styles) + styles.hasOwnProperty(styleName$16) && + setValueForStyle(node, styleName$16, styles[styleName$16]); } function isCustomElement(tagName) { if (-1 === tagName.indexOf("-")) return !1; @@ -1983,14 +1962,14 @@ var isInputEventSupported = !1; if (canUseDOM) { var JSCompiler_inline_result$jscomp$281; if (canUseDOM) { - var isSupported$jscomp$inline_416 = "oninput" in document; - if (!isSupported$jscomp$inline_416) { - var element$jscomp$inline_417 = document.createElement("div"); - element$jscomp$inline_417.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_416 = - "function" === typeof element$jscomp$inline_417.oninput; + var isSupported$jscomp$inline_415 = "oninput" in document; + if (!isSupported$jscomp$inline_415) { + var element$jscomp$inline_416 = document.createElement("div"); + element$jscomp$inline_416.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_415 = + "function" === typeof element$jscomp$inline_416.oninput; } - JSCompiler_inline_result$jscomp$281 = isSupported$jscomp$inline_416; + JSCompiler_inline_result$jscomp$281 = isSupported$jscomp$inline_415; } else JSCompiler_inline_result$jscomp$281 = !1; isInputEventSupported = JSCompiler_inline_result$jscomp$281 && @@ -3933,7 +3912,7 @@ function updateReducerImpl(hook, current, reducer) { var newBaseQueueFirst = (baseFirst = null), newBaseQueueLast = null, update = current, - didReadFromEntangledAsyncAction$55 = !1; + didReadFromEntangledAsyncAction$54 = !1; do { var updateLane = update.lane & -536870913; if ( @@ -3954,11 +3933,11 @@ function updateReducerImpl(hook, current, reducer) { next: null }), updateLane === currentEntangledLane && - (didReadFromEntangledAsyncAction$55 = !0); + (didReadFromEntangledAsyncAction$54 = !0); else if ((renderLanes & revertLane) === revertLane) { update = update.next; revertLane === currentEntangledLane && - (didReadFromEntangledAsyncAction$55 = !0); + (didReadFromEntangledAsyncAction$54 = !0); continue; } else (updateLane = { @@ -4004,7 +3983,7 @@ function updateReducerImpl(hook, current, reducer) { if ( !objectIs(pendingQueue, hook.memoizedState) && ((didReceiveUpdate = !0), - didReadFromEntangledAsyncAction$55 && + didReadFromEntangledAsyncAction$54 && ((reducer = currentEntangledActionThenable), null !== reducer)) ) throw reducer; @@ -4202,8 +4181,8 @@ function runActionStateAction(actionQueue, node) { try { (prevTransition = action(prevState, payload)), handleActionReturnValue(actionQueue, node, prevTransition); - } catch (error$61) { - onActionError(actionQueue, node, error$61); + } catch (error$60) { + onActionError(actionQueue, node, error$60); } } function handleActionReturnValue(actionQueue, node, returnValue) { @@ -4652,14 +4631,14 @@ function refreshCache(fiber, seedKey, seedValue) { case 3: var lane = requestUpdateLane(); fiber = createUpdate(lane); - var root$64 = enqueueUpdate(provider, fiber, lane); - null !== root$64 && - (scheduleUpdateOnFiber(root$64, provider, lane), - entangleTransitions(root$64, provider, lane)); + var root$63 = enqueueUpdate(provider, fiber, lane); + null !== root$63 && + (scheduleUpdateOnFiber(root$63, provider, lane), + entangleTransitions(root$63, provider, lane)); provider = createCache(); null !== seedKey && void 0 !== seedKey && - null !== root$64 && + null !== root$63 && provider.data.set(seedKey, seedValue); fiber.payload = { cache: provider }; return; @@ -5190,9 +5169,9 @@ function resolveClassComponentProps(Component, baseProps) { } if ((Component = Component.defaultProps)) { newProps === baseProps && (newProps = assign({}, newProps)); - for (var propName$68 in Component) - void 0 === newProps[propName$68] && - (newProps[propName$68] = Component[propName$68]); + for (var propName$67 in Component) + void 0 === newProps[propName$67] && + (newProps[propName$67] = Component[propName$67]); } return newProps; } @@ -5238,9 +5217,9 @@ function logUncaughtError(root, errorInfo) { try { var onUncaughtError = root.onUncaughtError; onUncaughtError(errorInfo.value, { componentStack: errorInfo.stack }); - } catch (e$69) { + } catch (e$68) { setTimeout(function () { - throw e$69; + throw e$68; }); } } @@ -5251,9 +5230,9 @@ function logCaughtError(root, boundary, errorInfo) { componentStack: errorInfo.stack, errorBoundary: 1 === boundary.tag ? boundary.stateNode : null }); - } catch (e$70) { + } catch (e$69) { setTimeout(function () { - throw e$70; + throw e$69; }); } } @@ -7719,8 +7698,8 @@ function safelyDetachRef(current, nearestMountedAncestor) { else if ("function" === typeof ref) try { ref(null); - } catch (error$115) { - captureCommitPhaseError(current, nearestMountedAncestor, error$115); + } catch (error$114) { + captureCommitPhaseError(current, nearestMountedAncestor, error$114); } else ref.current = null; } @@ -7854,7 +7833,7 @@ function commitBeforeMutationEffects(root, firstChild) { selection = selection.focusOffset; try { JSCompiler_temp.nodeType, focusNode.nodeType; - } catch (e$20) { + } catch (e$19) { JSCompiler_temp = null; break a; } @@ -8029,11 +8008,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } catch (error$114) { + } catch (error$113) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$114 + error$113 ); } } @@ -8187,7 +8166,7 @@ function commitDeletionEffectsOnFiber( safelyDetachRef(deletedFiber, nearestMountedAncestor); case 6: prevHostParentIsContainer = hostParent; - var prevHostParentIsContainer$122 = hostParentIsContainer; + var prevHostParentIsContainer$121 = hostParentIsContainer; hostParent = null; recursivelyTraverseDeletionEffects( finishedRoot, @@ -8195,7 +8174,7 @@ function commitDeletionEffectsOnFiber( deletedFiber ); hostParent = prevHostParentIsContainer; - hostParentIsContainer = prevHostParentIsContainer$122; + hostParentIsContainer = prevHostParentIsContainer$121; if (null !== hostParent) if (hostParentIsContainer) try { @@ -8823,21 +8802,21 @@ function commitReconciliationEffects(finishedWork) { insertOrAppendPlacementNode(finishedWork, before, parent$jscomp$0); break; case 5: - var parent$116 = JSCompiler_inline_result.stateNode; + var parent$115 = JSCompiler_inline_result.stateNode; JSCompiler_inline_result.flags & 32 && - (setTextContent(parent$116, ""), + (setTextContent(parent$115, ""), (JSCompiler_inline_result.flags &= -33)); - var before$117 = getHostSibling(finishedWork); - insertOrAppendPlacementNode(finishedWork, before$117, parent$116); + var before$116 = getHostSibling(finishedWork); + insertOrAppendPlacementNode(finishedWork, before$116, parent$115); break; case 3: case 4: - var parent$118 = JSCompiler_inline_result.stateNode.containerInfo, - before$119 = getHostSibling(finishedWork); + var parent$117 = JSCompiler_inline_result.stateNode.containerInfo, + before$118 = getHostSibling(finishedWork); insertOrAppendPlacementNodeIntoContainer( finishedWork, - before$119, - parent$118 + before$118, + parent$117 ); break; default: @@ -9734,8 +9713,7 @@ function scheduleRetryEffect(workInProgress, retryQueue) { workInProgress.flags & 16384 && ((retryQueue = 22 !== workInProgress.tag ? claimNextRetryLane() : 536870912), - (workInProgress.lanes |= retryQueue), - (workInProgressSuspendedRetryLanes |= retryQueue)); + (workInProgress.lanes |= retryQueue)); } function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { if (!isHydrating) @@ -9752,14 +9730,14 @@ function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { break; case "collapsed": lastTailNode = renderState.tail; - for (var lastTailNode$134 = null; null !== lastTailNode; ) - null !== lastTailNode.alternate && (lastTailNode$134 = lastTailNode), + for (var lastTailNode$133 = null; null !== lastTailNode; ) + null !== lastTailNode.alternate && (lastTailNode$133 = lastTailNode), (lastTailNode = lastTailNode.sibling); - null === lastTailNode$134 + null === lastTailNode$133 ? hasRenderedATailFallback || null === renderState.tail ? (renderState.tail = null) : (renderState.tail.sibling = null) - : (lastTailNode$134.sibling = null); + : (lastTailNode$133.sibling = null); } } function bubbleProperties(completedWork) { @@ -9769,19 +9747,19 @@ function bubbleProperties(completedWork) { newChildLanes = 0, subtreeFlags = 0; if (didBailout) - for (var child$135 = completedWork.child; null !== child$135; ) - (newChildLanes |= child$135.lanes | child$135.childLanes), - (subtreeFlags |= child$135.subtreeFlags & 31457280), - (subtreeFlags |= child$135.flags & 31457280), - (child$135.return = completedWork), - (child$135 = child$135.sibling); + for (var child$134 = completedWork.child; null !== child$134; ) + (newChildLanes |= child$134.lanes | child$134.childLanes), + (subtreeFlags |= child$134.subtreeFlags & 31457280), + (subtreeFlags |= child$134.flags & 31457280), + (child$134.return = completedWork), + (child$134 = child$134.sibling); else - for (child$135 = completedWork.child; null !== child$135; ) - (newChildLanes |= child$135.lanes | child$135.childLanes), - (subtreeFlags |= child$135.subtreeFlags), - (subtreeFlags |= child$135.flags), - (child$135.return = completedWork), - (child$135 = child$135.sibling); + for (child$134 = completedWork.child; null !== child$134; ) + (newChildLanes |= child$134.lanes | child$134.childLanes), + (subtreeFlags |= child$134.subtreeFlags), + (subtreeFlags |= child$134.flags), + (child$134.return = completedWork), + (child$134 = child$134.sibling); completedWork.subtreeFlags |= subtreeFlags; completedWork.childLanes = newChildLanes; return didBailout; @@ -10058,11 +10036,11 @@ function completeWork(current, workInProgress, renderLanes) { null !== newProps.alternate.memoizedState && null !== newProps.alternate.memoizedState.cachePool && (type = newProps.alternate.memoizedState.cachePool.pool); - var cache$147 = null; + var cache$146 = null; null !== newProps.memoizedState && null !== newProps.memoizedState.cachePool && - (cache$147 = newProps.memoizedState.cachePool.pool); - cache$147 !== type && (newProps.flags |= 2048); + (cache$146 = newProps.memoizedState.cachePool.pool); + cache$146 !== type && (newProps.flags |= 2048); } renderLanes !== current && renderLanes && @@ -10087,8 +10065,8 @@ function completeWork(current, workInProgress, renderLanes) { type = workInProgress.memoizedState; if (null === type) return bubbleProperties(workInProgress), null; newProps = 0 !== (workInProgress.flags & 128); - cache$147 = type.rendering; - if (null === cache$147) + cache$146 = type.rendering; + if (null === cache$146) if (newProps) cutOffTailIfNeeded(type, !1); else { if ( @@ -10096,11 +10074,11 @@ function completeWork(current, workInProgress, renderLanes) { (null !== current && 0 !== (current.flags & 128)) ) for (current = workInProgress.child; null !== current; ) { - cache$147 = findFirstSuspended(current); - if (null !== cache$147) { + cache$146 = findFirstSuspended(current); + if (null !== cache$146) { workInProgress.flags |= 128; cutOffTailIfNeeded(type, !1); - current = cache$147.updateQueue; + current = cache$146.updateQueue; workInProgress.updateQueue = current; scheduleRetryEffect(workInProgress, current); workInProgress.subtreeFlags = 0; @@ -10125,7 +10103,7 @@ function completeWork(current, workInProgress, renderLanes) { } else { if (!newProps) - if (((current = findFirstSuspended(cache$147)), null !== current)) { + if (((current = findFirstSuspended(cache$146)), null !== current)) { if ( ((workInProgress.flags |= 128), (newProps = !0), @@ -10135,7 +10113,7 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(type, !0), null === type.tail && "hidden" === type.tailMode && - !cache$147.alternate && + !cache$146.alternate && !isHydrating) ) return bubbleProperties(workInProgress), null; @@ -10148,13 +10126,13 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(type, !1), (workInProgress.lanes = 4194304)); type.isBackwards - ? ((cache$147.sibling = workInProgress.child), - (workInProgress.child = cache$147)) + ? ((cache$146.sibling = workInProgress.child), + (workInProgress.child = cache$146)) : ((current = type.last), null !== current - ? (current.sibling = cache$147) - : (workInProgress.child = cache$147), - (type.last = cache$147)); + ? (current.sibling = cache$146) + : (workInProgress.child = cache$146), + (type.last = cache$146)); } if (null !== type.tail) return ( @@ -10379,8 +10357,7 @@ function scheduleUpdateOnFiber(root, fiber, lane) { markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane, - workInProgressRootDidSkipSuspendedSiblings + workInProgressDeferredLane ); markRootUpdated(root, lane); if (0 === (executionContext & 2) || root !== workInProgressRoot) @@ -10391,179 +10368,159 @@ function scheduleUpdateOnFiber(root, fiber, lane) { markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane, - workInProgressRootDidSkipSuspendedSiblings + workInProgressDeferredLane )), ensureRootIsScheduled(root); } -function performConcurrentWorkOnRoot(root, didTimeout) { +function performWorkOnRoot(root$jscomp$0, lanes, forceSync) { if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(327)); - var originalCallbackNode = root.callbackNode; - if (flushPassiveEffects() && root.callbackNode !== originalCallbackNode) - return null; - var lanes = getNextLanes( - root, - root === workInProgressRoot ? workInProgressRootRenderLanes : 0 - ); - if (0 === lanes) return null; var shouldTimeSlice = - 0 === (lanes & 60) && 0 === (lanes & root.expiredLanes) && !didTimeout; - didTimeout = shouldTimeSlice - ? renderRootConcurrent(root, lanes) - : renderRootSync(root, lanes); - if (0 !== didTimeout) { + (!forceSync && + 0 === (lanes & 60) && + 0 === (lanes & root$jscomp$0.expiredLanes)) || + !1, + exitStatus = shouldTimeSlice + ? renderRootConcurrent(root$jscomp$0, lanes) + : renderRootSync(root$jscomp$0, lanes, !0); + do { var renderWasConcurrent = shouldTimeSlice; - do { - if (6 === didTimeout) - markRootSuspended( - root, - lanes, - 0, - workInProgressRootDidSkipSuspendedSiblings - ); - else { - shouldTimeSlice = root.current.alternate; - if ( - renderWasConcurrent && - !isRenderConsistentWithExternalStores(shouldTimeSlice) - ) { - didTimeout = renderRootSync(root, lanes); - renderWasConcurrent = !1; - continue; - } - if (2 === didTimeout) { - renderWasConcurrent = lanes; - var errorRetryLanes = getLanesToRetrySynchronouslyOnError( - root, - renderWasConcurrent - ); - if ( - 0 !== errorRetryLanes && - ((lanes = errorRetryLanes), - (didTimeout = recoverFromConcurrentError( + if (0 === exitStatus) break; + else if (6 === exitStatus) markRootSuspended(root$jscomp$0, lanes, 0); + else { + forceSync = root$jscomp$0.current.alternate; + if ( + renderWasConcurrent && + !isRenderConsistentWithExternalStores(forceSync) + ) { + exitStatus = renderRootSync(root$jscomp$0, lanes, !1); + continue; + } + if (2 === exitStatus) { + renderWasConcurrent = lanes; + if (root$jscomp$0.errorRecoveryDisabledLanes & renderWasConcurrent) + var JSCompiler_inline_result = 0; + else + (JSCompiler_inline_result = root$jscomp$0.pendingLanes & -536870913), + (JSCompiler_inline_result = + 0 !== JSCompiler_inline_result + ? JSCompiler_inline_result + : JSCompiler_inline_result & 536870912 + ? 536870912 + : 0); + if (0 !== JSCompiler_inline_result) { + lanes = JSCompiler_inline_result; + a: { + var root = root$jscomp$0; + exitStatus = workInProgressRootConcurrentErrors; + var wasRootDehydrated = root.current.memoizedState.isDehydrated; + wasRootDehydrated && + (prepareFreshStack(root, JSCompiler_inline_result).flags |= 256); + JSCompiler_inline_result = renderRootSync( root, - renderWasConcurrent, - errorRetryLanes - )), - (renderWasConcurrent = !1), - 2 !== didTimeout) - ) - continue; - } - if (1 === didTimeout) { - prepareFreshStack(root, 0); - markRootSuspended( - root, - lanes, - 0, - workInProgressRootDidSkipSuspendedSiblings - ); - break; - } - a: { - renderWasConcurrent = root; - switch (didTimeout) { - case 0: - case 1: - throw Error(formatProdErrorMessage(345)); - case 4: - if ((lanes & 4194176) === lanes) { - markRootSuspended( - renderWasConcurrent, - lanes, - workInProgressDeferredLane, - workInProgressRootDidSkipSuspendedSiblings - ); + JSCompiler_inline_result, + !1 + ); + if (2 !== JSCompiler_inline_result) { + if ( + workInProgressRootDidAttachPingListener && + !wasRootDehydrated + ) { + root.errorRecoveryDisabledLanes |= renderWasConcurrent; + workInProgressRootInterleavedUpdatedLanes |= + renderWasConcurrent; + exitStatus = 4; break a; } - break; - case 2: - workInProgressRootRecoverableErrors = null; - break; - case 3: - case 5: - break; - default: - throw Error(formatProdErrorMessage(329)); + renderWasConcurrent = workInProgressRootRecoverableErrors; + workInProgressRootRecoverableErrors = exitStatus; + null !== renderWasConcurrent && + queueRecoverableErrors(renderWasConcurrent); + } + exitStatus = JSCompiler_inline_result; } - renderWasConcurrent.finishedWork = shouldTimeSlice; - renderWasConcurrent.finishedLanes = lanes; - if ( - (lanes & 62914560) === lanes && - ((didTimeout = globalMostRecentFallbackTime + 300 - now()), - 10 < didTimeout) - ) { - markRootSuspended( - renderWasConcurrent, - lanes, - workInProgressDeferredLane, - workInProgressRootDidSkipSuspendedSiblings - ); - if (0 !== getNextLanes(renderWasConcurrent, 0)) break a; - renderWasConcurrent.timeoutHandle = scheduleTimeout( - commitRootWhenReady.bind( - null, - renderWasConcurrent, + if (2 !== exitStatus) continue; + } + } + if (1 === exitStatus) { + prepareFreshStack(root$jscomp$0, 0); + markRootSuspended(root$jscomp$0, lanes, 0); + break; + } + a: { + shouldTimeSlice = root$jscomp$0; + switch (exitStatus) { + case 0: + case 1: + throw Error(formatProdErrorMessage(345)); + case 4: + if ((lanes & 4194176) === lanes) { + markRootSuspended( shouldTimeSlice, - workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, lanes, - workInProgressDeferredLane, - workInProgressRootInterleavedUpdatedLanes, - workInProgressSuspendedRetryLanes, - workInProgressRootDidSkipSuspendedSiblings - ), - didTimeout - ); - break a; - } - commitRootWhenReady( - renderWasConcurrent, - shouldTimeSlice, - workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, - lanes, - workInProgressDeferredLane, - workInProgressRootInterleavedUpdatedLanes, - workInProgressSuspendedRetryLanes, - workInProgressRootDidSkipSuspendedSiblings + workInProgressDeferredLane + ); + break a; + } + break; + case 2: + workInProgressRootRecoverableErrors = null; + break; + case 3: + case 5: + break; + default: + throw Error(formatProdErrorMessage(329)); + } + shouldTimeSlice.finishedWork = forceSync; + shouldTimeSlice.finishedLanes = lanes; + if ( + (lanes & 62914560) === lanes && + ((renderWasConcurrent = globalMostRecentFallbackTime + 300 - now()), + 10 < renderWasConcurrent) + ) { + markRootSuspended(shouldTimeSlice, lanes, workInProgressDeferredLane); + if (0 !== getNextLanes(shouldTimeSlice, 0)) break a; + shouldTimeSlice.timeoutHandle = scheduleTimeout( + commitRootWhenReady.bind( + null, + shouldTimeSlice, + forceSync, + workInProgressRootRecoverableErrors, + workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, + lanes, + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + workInProgressRootDidSkipSuspendedSiblings, + 2, + -0, + 0 + ), + renderWasConcurrent ); + break a; } + commitRootWhenReady( + shouldTimeSlice, + forceSync, + workInProgressRootRecoverableErrors, + workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, + lanes, + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + workInProgressRootDidSkipSuspendedSiblings, + 0, + -0, + 0 + ); } - break; - } while (1); - } - ensureRootIsScheduled(root); - scheduleTaskForRootDuringMicrotask(root, now()); - root = - root.callbackNode === originalCallbackNode - ? performConcurrentWorkOnRoot.bind(null, root) - : null; - return root; -} -function recoverFromConcurrentError( - root, - originallyAttemptedLanes, - errorRetryLanes -) { - var errorsFromFirstAttempt = workInProgressRootConcurrentErrors, - wasRootDehydrated = root.current.memoizedState.isDehydrated; - wasRootDehydrated && (prepareFreshStack(root, errorRetryLanes).flags |= 256); - errorRetryLanes = renderRootSync(root, errorRetryLanes); - if (2 !== errorRetryLanes) { - if (workInProgressRootDidAttachPingListener && !wasRootDehydrated) - return ( - (root.errorRecoveryDisabledLanes |= originallyAttemptedLanes), - (workInProgressRootInterleavedUpdatedLanes |= originallyAttemptedLanes), - 4 - ); - root = workInProgressRootRecoverableErrors; - workInProgressRootRecoverableErrors = errorsFromFirstAttempt; - null !== root && queueRecoverableErrors(root); - } - return errorRetryLanes; + } + break; + } while (1); + ensureRootIsScheduled(root$jscomp$0); } function queueRecoverableErrors(errors) { null === workInProgressRootRecoverableErrors @@ -10583,10 +10540,16 @@ function commitRootWhenReady( spawnedLane, updatedLanes, suspendedRetryLanes, - didSkipSuspendedSiblings + didSkipSuspendedSiblings, + suspendedCommitReason, + completedRenderStartTime, + completedRenderEndTime ) { - var subtreeFlags = finishedWork.subtreeFlags; - if (subtreeFlags & 8192 || 16785408 === (subtreeFlags & 16785408)) + didSkipSuspendedSiblings = finishedWork.subtreeFlags; + if ( + didSkipSuspendedSiblings & 8192 || + 16785408 === (didSkipSuspendedSiblings & 16785408) + ) if ( ((suspendedState = { stylesheets: null, count: 0, unsuspend: noop }), accumulateSuspenseyCommitOnFiber(finishedWork), @@ -10602,10 +10565,13 @@ function commitRootWhenReady( didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes + suspendedRetryLanes, + 1, + completedRenderStartTime, + completedRenderEndTime ) ); - markRootSuspended(root, lanes, spawnedLane, didSkipSuspendedSiblings); + markRootSuspended(root, lanes, spawnedLane); return; } commitRoot( @@ -10615,7 +10581,10 @@ function commitRootWhenReady( didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes + suspendedRetryLanes, + suspendedCommitReason, + completedRenderStartTime, + completedRenderEndTime ); } function isRenderConsistentWithExternalStores(finishedWork) { @@ -10661,77 +10630,24 @@ function markRootUpdated(root, updatedLanes) { : executionContext & 4 && (didIncludeCommitPhaseUpdate = !0); throwIfInfiniteUpdateLoopDetected(); } -function markRootSuspended( - root, - suspendedLanes, - spawnedLane, - didSkipSuspendedSiblings -) { +function markRootSuspended(root, suspendedLanes, spawnedLane) { suspendedLanes &= ~workInProgressRootPingedLanes; suspendedLanes &= ~workInProgressRootInterleavedUpdatedLanes; root.suspendedLanes |= suspendedLanes; root.pingedLanes &= ~suspendedLanes; - didSkipSuspendedSiblings || (root.warmLanes |= suspendedLanes); - didSkipSuspendedSiblings = root.expirationTimes; - for (var lanes = suspendedLanes; 0 < lanes; ) { - var index$6 = 31 - clz32(lanes), - lane = 1 << index$6; - didSkipSuspendedSiblings[index$6] = -1; + for ( + var expirationTimes = root.expirationTimes, lanes = suspendedLanes; + 0 < lanes; + + ) { + var index$5 = 31 - clz32(lanes), + lane = 1 << index$5; + expirationTimes[index$5] = -1; lanes &= ~lane; } 0 !== spawnedLane && markSpawnedDeferredLane(root, spawnedLane, suspendedLanes); } -function performSyncWorkOnRoot(root, lanes) { - if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(327)); - if (flushPassiveEffects()) return ensureRootIsScheduled(root), null; - var exitStatus = renderRootSync(root, lanes); - if (2 === exitStatus) { - var originallyAttemptedLanes = lanes, - errorRetryLanes = getLanesToRetrySynchronouslyOnError( - root, - originallyAttemptedLanes - ); - 0 !== errorRetryLanes && - ((lanes = errorRetryLanes), - (exitStatus = recoverFromConcurrentError( - root, - originallyAttemptedLanes, - errorRetryLanes - ))); - } - if (1 === exitStatus) - return ( - prepareFreshStack(root, 0), - markRootSuspended(root, lanes, 0, !1), - ensureRootIsScheduled(root), - null - ); - if (6 === exitStatus) - return ( - markRootSuspended( - root, - lanes, - workInProgressDeferredLane, - workInProgressRootDidSkipSuspendedSiblings - ), - ensureRootIsScheduled(root), - null - ); - root.finishedWork = root.current.alternate; - root.finishedLanes = lanes; - commitRoot( - root, - workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, - workInProgressDeferredLane, - workInProgressRootInterleavedUpdatedLanes, - workInProgressSuspendedRetryLanes - ); - ensureRootIsScheduled(root); - return null; -} function flushSyncWork$1() { return 0 === (executionContext & 6) ? (flushSyncWorkAcrossRoots_impl(0, !1), !1) @@ -10769,8 +10685,9 @@ function prepareFreshStack(root, lanes) { workInProgressRootRenderLanes = lanes; workInProgressSuspendedReason = 0; workInProgressThrownValue = null; - workInProgressRootDidAttachPingListener = - workInProgressRootDidSkipSuspendedSiblings = !1; + workInProgressRootDidSkipSuspendedSiblings = !1; + checkIfRootIsPrerendering(root, lanes); + workInProgressRootDidAttachPingListener = !1; workInProgressSuspendedRetryLanes = workInProgressDeferredLane = workInProgressRootPingedLanes = @@ -10789,9 +10706,9 @@ function prepareFreshStack(root, lanes) { 0 < allEntangledLanes; ) { - var index$4 = 31 - clz32(allEntangledLanes), - lane = 1 << index$4; - lanes |= root[index$4]; + var index$3 = 31 - clz32(allEntangledLanes), + lane = 1 << index$3; + lanes |= root[index$3]; allEntangledLanes &= ~lane; } entangledRenderLanes = lanes; @@ -10861,8 +10778,7 @@ function renderDidSuspendDelayIfPossible() { markRootSuspended( workInProgressRoot, workInProgressRootRenderLanes, - workInProgressDeferredLane, - workInProgressRootDidSkipSuspendedSiblings + workInProgressDeferredLane ); } function queueConcurrentError(error) { @@ -10878,6 +10794,7 @@ function renderRootSync(root, lanes) { if (workInProgressRoot !== root || workInProgressRootRenderLanes !== lanes) (workInProgressTransitions = null), prepareFreshStack(root, lanes); lanes = !1; + var exitStatus = workInProgressRootExitStatus; a: do try { if (0 !== workInProgressSuspendedReason && null !== workInProgress) { @@ -10886,21 +10803,26 @@ function renderRootSync(root, lanes) { switch (workInProgressSuspendedReason) { case 8: resetWorkInProgressStack(); - workInProgressRootExitStatus = 6; + exitStatus = 6; break a; case 3: case 2: - lanes || - null !== suspenseHandlerStackCursor.current || - (lanes = !0); - default: + case 6: + null === suspenseHandlerStackCursor.current && (lanes = !0); var reason = workInProgressSuspendedReason; workInProgressSuspendedReason = 0; workInProgressThrownValue = null; throwAndUnwindWorkLoop(root, unitOfWork, thrownValue, reason); + break; + default: + (reason = workInProgressSuspendedReason), + (workInProgressSuspendedReason = 0), + (workInProgressThrownValue = null), + throwAndUnwindWorkLoop(root, unitOfWork, thrownValue, reason); } } workLoopSync(); + exitStatus = workInProgressRootExitStatus; break; } catch (thrownValue$162) { handleThrow(root, thrownValue$162); @@ -10911,11 +10833,11 @@ function renderRootSync(root, lanes) { executionContext = prevExecutionContext; ReactSharedInternals.H = prevDispatcher; ReactSharedInternals.A = prevAsyncDispatcher; - if (null !== workInProgress) throw Error(formatProdErrorMessage(261)); - workInProgressRoot = null; - workInProgressRootRenderLanes = 0; - finishQueueingConcurrentUpdates(); - return workInProgressRootExitStatus; + null === workInProgress && + ((workInProgressRoot = null), + (workInProgressRootRenderLanes = 0), + finishQueueingConcurrentUpdates()); + return exitStatus; } function workLoopSync() { for (; null !== workInProgress; ) performUnitOfWork(workInProgress); @@ -10925,10 +10847,11 @@ function renderRootConcurrent(root, lanes) { executionContext |= 2; var prevDispatcher = pushDispatcher(), prevAsyncDispatcher = pushAsyncDispatcher(); - if (workInProgressRoot !== root || workInProgressRootRenderLanes !== lanes) - (workInProgressTransitions = null), + workInProgressRoot !== root || workInProgressRootRenderLanes !== lanes + ? ((workInProgressTransitions = null), (workInProgressRootRenderTargetTime = now() + 500), - prepareFreshStack(root, lanes); + prepareFreshStack(root, lanes)) + : checkIfRootIsPrerendering(root, lanes); a: do try { if (0 !== workInProgressSuspendedReason && null !== workInProgress) { @@ -11168,7 +11091,10 @@ function commitRoot( didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes + suspendedRetryLanes, + suspendedCommitReason, + completedRenderStartTime, + completedRenderEndTime ) { var prevTransition = ReactSharedInternals.T, previousUpdateLanePriority = ReactDOMSharedInternals.p; @@ -11183,13 +11109,15 @@ function commitRoot( previousUpdateLanePriority, spawnedLane, updatedLanes, - suspendedRetryLanes + suspendedRetryLanes, + suspendedCommitReason, + completedRenderStartTime, + completedRenderEndTime ); } finally { (ReactSharedInternals.T = prevTransition), (ReactDOMSharedInternals.p = previousUpdateLanePriority); } - return null; } function commitRootImpl( root, @@ -11197,9 +11125,7 @@ function commitRootImpl( transitions, didIncludeRenderPhaseUpdate, renderPriorityLevel, - spawnedLane, - updatedLanes, - suspendedRetryLanes + spawnedLane ) { do flushPassiveEffects(); while (null !== rootWithPendingPassiveEffects); @@ -11215,14 +11141,7 @@ function commitRootImpl( root.cancelPendingCommit = null; var remainingLanes = finishedWork.lanes | finishedWork.childLanes; remainingLanes |= concurrentlyUpdatedLanes; - markRootFinished( - root, - lanes, - remainingLanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes - ); + markRootFinished(root, lanes, remainingLanes, spawnedLane); didIncludeCommitPhaseUpdate = !1; root === workInProgressRoot && ((workInProgress = workInProgressRoot = null), @@ -11234,29 +11153,29 @@ function commitRootImpl( (pendingPassiveEffectsRemainingLanes = remainingLanes), (pendingPassiveTransitions = transitions), scheduleCallback$1(NormalPriority$1, function () { - flushPassiveEffects(); + flushPassiveEffects(!0); return null; })); transitions = 0 !== (finishedWork.flags & 15990); - 0 !== (finishedWork.subtreeFlags & 15990) || transitions - ? ((transitions = ReactSharedInternals.T), - (ReactSharedInternals.T = null), - (spawnedLane = ReactDOMSharedInternals.p), - (ReactDOMSharedInternals.p = 2), - (updatedLanes = executionContext), - (executionContext |= 4), - commitBeforeMutationEffects(root, finishedWork), - commitMutationEffectsOnFiber(finishedWork, root), - restoreSelection(selectionInformation, root.containerInfo), - (_enabled = !!eventsEnabled), - (selectionInformation = eventsEnabled = null), - (root.current = finishedWork), - commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork), - requestPaint(), - (executionContext = updatedLanes), - (ReactDOMSharedInternals.p = spawnedLane), - (ReactSharedInternals.T = transitions)) - : (root.current = finishedWork); + if (0 !== (finishedWork.subtreeFlags & 15990) || transitions) { + transitions = ReactSharedInternals.T; + ReactSharedInternals.T = null; + spawnedLane = ReactDOMSharedInternals.p; + ReactDOMSharedInternals.p = 2; + var prevExecutionContext = executionContext; + executionContext |= 4; + commitBeforeMutationEffects(root, finishedWork); + commitMutationEffectsOnFiber(finishedWork, root); + restoreSelection(selectionInformation, root.containerInfo); + _enabled = !!eventsEnabled; + selectionInformation = eventsEnabled = null; + root.current = finishedWork; + commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork); + requestPaint(); + executionContext = prevExecutionContext; + ReactDOMSharedInternals.p = spawnedLane; + ReactSharedInternals.T = transitions; + } else root.current = finishedWork; rootDoesHavePassiveEffects ? ((rootDoesHavePassiveEffects = !1), (rootWithPendingPassiveEffects = root), @@ -11458,7 +11377,7 @@ function resolveRetryWakeable(boundaryFiber, wakeable) { retryTimedOutBoundary(boundaryFiber, retryLane); } function throwIfInfiniteUpdateLoopDetected() { - if (50 < nestedUpdateCount) + if (100 < nestedUpdateCount) throw ( ((nestedUpdateCount = 0), (rootWithNestedUpdates = null), @@ -11522,7 +11441,8 @@ function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) { root$170, root$170 === workInProgressRoot ? JSCompiler_inline_result : 0 )), - 0 !== (JSCompiler_inline_result & 3) && + 0 === (JSCompiler_inline_result & 3) || + checkIfRootIsPrerendering(root$170, JSCompiler_inline_result) || ((didPerformSomeWork = !0), performSyncWorkOnRoot(root$170, JSCompiler_inline_result)); root$170 = root$170.next; @@ -11566,12 +11486,12 @@ function scheduleTaskForRootDuringMicrotask(root, currentTime) { 0 < lanes; ) { - var index$5 = 31 - clz32(lanes), - lane = 1 << index$5, - expirationTime = expirationTimes[index$5]; + var index$4 = 31 - clz32(lanes), + lane = 1 << index$4, + expirationTime = expirationTimes[index$4]; if (-1 === expirationTime) { if (0 === (lane & suspendedLanes) || 0 !== (lane & pingedLanes)) - expirationTimes[index$5] = computeExpirationTime(lane, currentTime); + expirationTimes[index$4] = computeExpirationTime(lane, currentTime); } else expirationTime <= currentTime && (root.expiredLanes |= lane); lanes &= ~lane; } @@ -11608,8 +11528,6 @@ function scheduleTaskForRootDuringMicrotask(root, currentTime) { null !== pingedLanes && cancelCallback$1(pingedLanes); switch (lanesToEventPriority(suspendedLanes)) { case 2: - suspendedLanes = ImmediatePriority; - break; case 8: suspendedLanes = UserBlockingPriority; break; @@ -11622,12 +11540,32 @@ function scheduleTaskForRootDuringMicrotask(root, currentTime) { default: suspendedLanes = NormalPriority$1; } - pingedLanes = performConcurrentWorkOnRoot.bind(null, root); + pingedLanes = performWorkOnRootViaSchedulerTask.bind(null, root); suspendedLanes = scheduleCallback$3(suspendedLanes, pingedLanes); root.callbackPriority = currentTime; root.callbackNode = suspendedLanes; return currentTime; } +function performWorkOnRootViaSchedulerTask(root, didTimeout) { + var originalCallbackNode = root.callbackNode; + if (flushPassiveEffects() && root.callbackNode !== originalCallbackNode) + return null; + var workInProgressRootRenderLanes$jscomp$0 = workInProgressRootRenderLanes; + workInProgressRootRenderLanes$jscomp$0 = getNextLanes( + root, + root === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0 + ); + if (0 === workInProgressRootRenderLanes$jscomp$0) return null; + performWorkOnRoot(root, workInProgressRootRenderLanes$jscomp$0, didTimeout); + scheduleTaskForRootDuringMicrotask(root, now()); + return root.callbackNode === originalCallbackNode + ? performWorkOnRootViaSchedulerTask.bind(null, root) + : null; +} +function performSyncWorkOnRoot(root, lanes) { + if (flushPassiveEffects()) return null; + performWorkOnRoot(root, lanes, !0); +} function scheduleImmediateTask(cb) { scheduleMicrotask(function () { 0 !== (executionContext & 6) @@ -11735,20 +11673,20 @@ function extractEvents$1( } } for ( - var i$jscomp$inline_1404 = 0; - i$jscomp$inline_1404 < simpleEventPluginEvents.length; - i$jscomp$inline_1404++ + var i$jscomp$inline_1410 = 0; + i$jscomp$inline_1410 < simpleEventPluginEvents.length; + i$jscomp$inline_1410++ ) { - var eventName$jscomp$inline_1405 = - simpleEventPluginEvents[i$jscomp$inline_1404], - domEventName$jscomp$inline_1406 = - eventName$jscomp$inline_1405.toLowerCase(), - capitalizedEvent$jscomp$inline_1407 = - eventName$jscomp$inline_1405[0].toUpperCase() + - eventName$jscomp$inline_1405.slice(1); + var eventName$jscomp$inline_1411 = + simpleEventPluginEvents[i$jscomp$inline_1410], + domEventName$jscomp$inline_1412 = + eventName$jscomp$inline_1411.toLowerCase(), + capitalizedEvent$jscomp$inline_1413 = + eventName$jscomp$inline_1411[0].toUpperCase() + + eventName$jscomp$inline_1411.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1406, - "on" + capitalizedEvent$jscomp$inline_1407 + domEventName$jscomp$inline_1412, + "on" + capitalizedEvent$jscomp$inline_1413 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -15189,16 +15127,16 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) { 0 === i && attemptExplicitHydrationTarget(target); } }; -var isomorphicReactPackageVersion$jscomp$inline_1651 = React.version; +var isomorphicReactPackageVersion$jscomp$inline_1657 = React.version; if ( - "19.0.0-experimental-5d19e1c8-20240923" !== - isomorphicReactPackageVersion$jscomp$inline_1651 + "19.0.0-experimental-778e1ed2-20240926" !== + isomorphicReactPackageVersion$jscomp$inline_1657 ) throw Error( formatProdErrorMessage( 527, - isomorphicReactPackageVersion$jscomp$inline_1651, - "19.0.0-experimental-5d19e1c8-20240923" + isomorphicReactPackageVersion$jscomp$inline_1657, + "19.0.0-experimental-778e1ed2-20240926" ) ); ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { @@ -15218,25 +15156,25 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { null === componentOrElement ? null : componentOrElement.stateNode; return componentOrElement; }; -var internals$jscomp$inline_2111 = { +var internals$jscomp$inline_2122 = { bundleType: 0, - version: "19.0.0-experimental-5d19e1c8-20240923", + version: "19.0.0-experimental-778e1ed2-20240926", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, findFiberByHostInstance: getClosestInstanceFromNode, - reconcilerVersion: "19.0.0-experimental-5d19e1c8-20240923" + reconcilerVersion: "19.0.0-experimental-778e1ed2-20240926" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_2112 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_2123 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_2112.isDisabled && - hook$jscomp$inline_2112.supportsFiber + !hook$jscomp$inline_2123.isDisabled && + hook$jscomp$inline_2123.supportsFiber ) try { - (rendererID = hook$jscomp$inline_2112.inject( - internals$jscomp$inline_2111 + (rendererID = hook$jscomp$inline_2123.inject( + internals$jscomp$inline_2122 )), - (injectedHook = hook$jscomp$inline_2112); + (injectedHook = hook$jscomp$inline_2123); } catch (err) {} } exports.createRoot = function (container, options) { @@ -15328,4 +15266,4 @@ exports.hydrateRoot = function (container, initialChildren, options) { listenToAllSupportedEvents(container); return new ReactDOMHydrationRoot(initialChildren); }; -exports.version = "19.0.0-experimental-5d19e1c8-20240923"; +exports.version = "19.0.0-experimental-778e1ed2-20240926"; diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-profiling.development.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-profiling.development.js index 31949e978046b..677c43f85bab1 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-profiling.development.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-profiling.development.js @@ -1039,43 +1039,39 @@ var pendingLanes = root.pendingLanes; if (0 === pendingLanes) return 0; var nextLanes = 0, - suspendedLanes = root.suspendedLanes, - pingedLanes = root.pingedLanes, - warmLanes = root.warmLanes; - root = 0 !== root.finishedLanes; + suspendedLanes = root.suspendedLanes; + root = root.pingedLanes; var nonIdlePendingLanes = pendingLanes & 134217727; 0 !== nonIdlePendingLanes ? ((pendingLanes = nonIdlePendingLanes & ~suspendedLanes), 0 !== pendingLanes ? (nextLanes = getHighestPriorityLanes(pendingLanes)) - : ((pingedLanes &= nonIdlePendingLanes), - 0 !== pingedLanes - ? (nextLanes = getHighestPriorityLanes(pingedLanes)) - : root || - ((warmLanes = nonIdlePendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes))))) - : ((nonIdlePendingLanes = pendingLanes & ~suspendedLanes), - 0 !== nonIdlePendingLanes - ? (nextLanes = getHighestPriorityLanes(nonIdlePendingLanes)) - : 0 !== pingedLanes - ? (nextLanes = getHighestPriorityLanes(pingedLanes)) - : root || - ((warmLanes = pendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes)))); + : ((root &= nonIdlePendingLanes), + 0 !== root && (nextLanes = getHighestPriorityLanes(root)))) + : ((pendingLanes &= ~suspendedLanes), + 0 !== pendingLanes + ? (nextLanes = getHighestPriorityLanes(pendingLanes)) + : 0 !== root && (nextLanes = getHighestPriorityLanes(root))); return 0 === nextLanes ? 0 : 0 !== wipLanes && wipLanes !== nextLanes && 0 === (wipLanes & suspendedLanes) && ((suspendedLanes = nextLanes & -nextLanes), - (warmLanes = wipLanes & -wipLanes), - suspendedLanes >= warmLanes || - (32 === suspendedLanes && 0 !== (warmLanes & 4194176))) + (root = wipLanes & -wipLanes), + suspendedLanes >= root || + (32 === suspendedLanes && 0 !== (root & 4194176))) ? wipLanes : nextLanes; } + function checkIfRootIsPrerendering(root, renderLanes) { + return ( + 0 === + (root.pendingLanes & + ~(root.suspendedLanes & ~root.pingedLanes) & + renderLanes) + ); + } function computeExpirationTime(lane, currentTime) { switch (lane) { case 1: @@ -1122,14 +1118,6 @@ ); } } - function getLanesToRetrySynchronouslyOnError( - root, - originallyAttemptedLanes - ) { - if (root.errorRecoveryDisabledLanes & originallyAttemptedLanes) return 0; - root = root.pendingLanes & -536870913; - return 0 !== root ? root : root & 536870912 ? 536870912 : 0; - } function claimNextTransitionLane() { var lane = nextTransitionLane; nextTransitionLane <<= 1; @@ -1150,9 +1138,7 @@ root, finishedLanes, remainingLanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes + spawnedLane ) { var previouslyPendingLanes = root.pendingLanes; root.pendingLanes = remainingLanes; @@ -1163,17 +1149,17 @@ root.entangledLanes &= remainingLanes; root.errorRecoveryDisabledLanes &= remainingLanes; root.shellSuspendCounter = 0; - var entanglements = root.entanglements, - expirationTimes = root.expirationTimes, + finishedLanes = root.entanglements; + var expirationTimes = root.expirationTimes, hiddenUpdates = root.hiddenUpdates; for ( remainingLanes = previouslyPendingLanes & ~remainingLanes; 0 < remainingLanes; ) { - var index = 31 - clz32(remainingLanes), - lane = 1 << index; - entanglements[index] = 0; + var index = 31 - clz32(remainingLanes); + previouslyPendingLanes = 1 << index; + finishedLanes[index] = 0; expirationTimes[index] = -1; var hiddenUpdatesForLane = hiddenUpdates[index]; if (null !== hiddenUpdatesForLane) @@ -1185,14 +1171,9 @@ var update = hiddenUpdatesForLane[index]; null !== update && (update.lane &= -536870913); } - remainingLanes &= ~lane; + remainingLanes &= ~previouslyPendingLanes; } 0 !== spawnedLane && markSpawnedDeferredLane(root, spawnedLane, 0); - 0 !== suspendedRetryLanes && - 0 === updatedLanes && - 0 !== root.tag && - (root.suspendedLanes |= - suspendedRetryLanes & ~(previouslyPendingLanes & ~finishedLanes)); } function markSpawnedDeferredLane(root, spawnedLane, entangledLanes) { root.pendingLanes |= spawnedLane; @@ -1244,6 +1225,17 @@ lanes &= ~root; } } + function getGroupNameOfHighestPriorityLane(lanes) { + return lanes & 63 + ? "Blocking" + : lanes & 4194240 + ? "Transition" + : lanes & 62914560 + ? "Suspense" + : lanes & 2080374784 + ? "Idle" + : "Other"; + } function lanesToEventPriority(lanes) { lanes &= -lanes; return 0 !== DiscreteEventPriority && DiscreteEventPriority < lanes @@ -3782,6 +3774,34 @@ (reusableComponentOptions.end = endTime), performance.measure(fiber, reusableComponentOptions)); } + function logRenderPhase(startTime, endTime) { + supportsUserTiming && + ((reusableComponentDevToolDetails.color = "primary-dark"), + (reusableComponentOptions.start = startTime), + (reusableComponentOptions.end = endTime), + performance.measure("Render", reusableComponentOptions)); + } + function logSuspenseThrottlePhase(startTime, endTime) { + supportsUserTiming && + ((reusableComponentDevToolDetails.color = "secondary-light"), + (reusableComponentOptions.start = startTime), + (reusableComponentOptions.end = endTime), + performance.measure("Throttled", reusableComponentOptions)); + } + function logSuspendedCommitPhase(startTime, endTime) { + supportsUserTiming && + ((reusableComponentDevToolDetails.color = "secondary-light"), + (reusableComponentOptions.start = startTime), + (reusableComponentOptions.end = endTime), + performance.measure("Suspended", reusableComponentOptions)); + } + function logCommitPhase(startTime, endTime) { + supportsUserTiming && + ((reusableComponentDevToolDetails.color = "secondary-dark"), + (reusableComponentOptions.start = startTime), + (reusableComponentOptions.end = endTime), + performance.measure("Commit", reusableComponentOptions)); + } function finishQueueingConcurrentUpdates() { for ( var endIndex = concurrentQueuesIndex, @@ -8860,33 +8880,33 @@ return current; } function updateSuspenseComponent(current, workInProgress, renderLanes) { - var JSCompiler_object_inline_componentStack_2267; - var JSCompiler_object_inline_stack_2266 = workInProgress.pendingProps; + var JSCompiler_object_inline_componentStack_2286; + var JSCompiler_object_inline_stack_2285 = workInProgress.pendingProps; shouldSuspendImpl(workInProgress) && (workInProgress.flags |= 128); - var JSCompiler_object_inline_message_2264 = !1; + var JSCompiler_object_inline_message_2283 = !1; var didSuspend = 0 !== (workInProgress.flags & 128); - (JSCompiler_object_inline_componentStack_2267 = didSuspend) || - (JSCompiler_object_inline_componentStack_2267 = + (JSCompiler_object_inline_componentStack_2286 = didSuspend) || + (JSCompiler_object_inline_componentStack_2286 = null !== current && null === current.memoizedState ? !1 : 0 !== (suspenseStackCursor.current & ForceSuspenseFallback)); - JSCompiler_object_inline_componentStack_2267 && - ((JSCompiler_object_inline_message_2264 = !0), + JSCompiler_object_inline_componentStack_2286 && + ((JSCompiler_object_inline_message_2283 = !0), (workInProgress.flags &= -129)); - JSCompiler_object_inline_componentStack_2267 = + JSCompiler_object_inline_componentStack_2286 = 0 !== (workInProgress.flags & 32); workInProgress.flags &= -33; if (null === current) { if (isHydrating) { - JSCompiler_object_inline_message_2264 + JSCompiler_object_inline_message_2283 ? pushPrimaryTreeSuspenseHandler(workInProgress) : reuseSuspenseHandlerOnStack(workInProgress); if (isHydrating) { - var JSCompiler_object_inline_digest_2265 = nextHydratableInstance; + var JSCompiler_object_inline_digest_2284 = nextHydratableInstance; var JSCompiler_temp; - if (!(JSCompiler_temp = !JSCompiler_object_inline_digest_2265)) { + if (!(JSCompiler_temp = !JSCompiler_object_inline_digest_2284)) { c: { - var instance = JSCompiler_object_inline_digest_2265; + var instance = JSCompiler_object_inline_digest_2284; for ( JSCompiler_temp = rootOrSingletonContext; 8 !== instance.nodeType; @@ -8927,19 +8947,19 @@ JSCompiler_temp && (warnNonHydratedInstance( workInProgress, - JSCompiler_object_inline_digest_2265 + JSCompiler_object_inline_digest_2284 ), throwOnHydrationMismatch(workInProgress)); } - JSCompiler_object_inline_digest_2265 = workInProgress.memoizedState; + JSCompiler_object_inline_digest_2284 = workInProgress.memoizedState; if ( - null !== JSCompiler_object_inline_digest_2265 && - ((JSCompiler_object_inline_digest_2265 = - JSCompiler_object_inline_digest_2265.dehydrated), - null !== JSCompiler_object_inline_digest_2265) + null !== JSCompiler_object_inline_digest_2284 && + ((JSCompiler_object_inline_digest_2284 = + JSCompiler_object_inline_digest_2284.dehydrated), + null !== JSCompiler_object_inline_digest_2284) ) return ( - JSCompiler_object_inline_digest_2265.data === + JSCompiler_object_inline_digest_2284.data === SUSPENSE_FALLBACK_START_DATA ? (workInProgress.lanes = 16) : (workInProgress.lanes = 536870912), @@ -8947,68 +8967,68 @@ ); popSuspenseHandler(workInProgress); } - JSCompiler_object_inline_digest_2265 = - JSCompiler_object_inline_stack_2266.children; - JSCompiler_temp = JSCompiler_object_inline_stack_2266.fallback; - if (JSCompiler_object_inline_message_2264) + JSCompiler_object_inline_digest_2284 = + JSCompiler_object_inline_stack_2285.children; + JSCompiler_temp = JSCompiler_object_inline_stack_2285.fallback; + if (JSCompiler_object_inline_message_2283) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2266 = + (JSCompiler_object_inline_stack_2285 = mountSuspenseFallbackChildren( workInProgress, - JSCompiler_object_inline_digest_2265, + JSCompiler_object_inline_digest_2284, JSCompiler_temp, renderLanes )), - (JSCompiler_object_inline_message_2264 = workInProgress.child), - (JSCompiler_object_inline_message_2264.memoizedState = + (JSCompiler_object_inline_message_2283 = workInProgress.child), + (JSCompiler_object_inline_message_2283.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_message_2264.childLanes = + (JSCompiler_object_inline_message_2283.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_componentStack_2267, + JSCompiler_object_inline_componentStack_2286, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2266 + JSCompiler_object_inline_stack_2285 ); if ( "number" === - typeof JSCompiler_object_inline_stack_2266.unstable_expectedLoadTime + typeof JSCompiler_object_inline_stack_2285.unstable_expectedLoadTime ) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2266 = + (JSCompiler_object_inline_stack_2285 = mountSuspenseFallbackChildren( workInProgress, - JSCompiler_object_inline_digest_2265, + JSCompiler_object_inline_digest_2284, JSCompiler_temp, renderLanes )), - (JSCompiler_object_inline_message_2264 = workInProgress.child), - (JSCompiler_object_inline_message_2264.memoizedState = + (JSCompiler_object_inline_message_2283 = workInProgress.child), + (JSCompiler_object_inline_message_2283.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_message_2264.childLanes = + (JSCompiler_object_inline_message_2283.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_componentStack_2267, + JSCompiler_object_inline_componentStack_2286, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), (workInProgress.lanes = 4194304), - JSCompiler_object_inline_stack_2266 + JSCompiler_object_inline_stack_2285 ); pushPrimaryTreeSuspenseHandler(workInProgress); return mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_digest_2265 + JSCompiler_object_inline_digest_2284 ); } var prevState = current.memoizedState; if ( null !== prevState && - ((JSCompiler_object_inline_digest_2265 = prevState.dehydrated), - null !== JSCompiler_object_inline_digest_2265) + ((JSCompiler_object_inline_digest_2284 = prevState.dehydrated), + null !== JSCompiler_object_inline_digest_2284) ) { if (didSuspend) workInProgress.flags & 256 @@ -9025,94 +9045,94 @@ (workInProgress.flags |= 128), (workInProgress = null)) : (reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_message_2264 = - JSCompiler_object_inline_stack_2266.fallback), - (JSCompiler_object_inline_digest_2265 = workInProgress.mode), - (JSCompiler_object_inline_stack_2266 = + (JSCompiler_object_inline_message_2283 = + JSCompiler_object_inline_stack_2285.fallback), + (JSCompiler_object_inline_digest_2284 = workInProgress.mode), + (JSCompiler_object_inline_stack_2285 = mountWorkInProgressOffscreenFiber( { mode: "visible", - children: JSCompiler_object_inline_stack_2266.children + children: JSCompiler_object_inline_stack_2285.children }, - JSCompiler_object_inline_digest_2265 + JSCompiler_object_inline_digest_2284 )), - (JSCompiler_object_inline_message_2264 = + (JSCompiler_object_inline_message_2283 = createFiberFromFragment( - JSCompiler_object_inline_message_2264, - JSCompiler_object_inline_digest_2265, + JSCompiler_object_inline_message_2283, + JSCompiler_object_inline_digest_2284, renderLanes, null )), - (JSCompiler_object_inline_message_2264.flags |= 2), - (JSCompiler_object_inline_stack_2266.return = workInProgress), - (JSCompiler_object_inline_message_2264.return = workInProgress), - (JSCompiler_object_inline_stack_2266.sibling = - JSCompiler_object_inline_message_2264), - (workInProgress.child = JSCompiler_object_inline_stack_2266), + (JSCompiler_object_inline_message_2283.flags |= 2), + (JSCompiler_object_inline_stack_2285.return = workInProgress), + (JSCompiler_object_inline_message_2283.return = workInProgress), + (JSCompiler_object_inline_stack_2285.sibling = + JSCompiler_object_inline_message_2283), + (workInProgress.child = JSCompiler_object_inline_stack_2285), reconcileChildFibers( workInProgress, current.child, null, renderLanes ), - (JSCompiler_object_inline_stack_2266 = workInProgress.child), - (JSCompiler_object_inline_stack_2266.memoizedState = + (JSCompiler_object_inline_stack_2285 = workInProgress.child), + (JSCompiler_object_inline_stack_2285.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_stack_2266.childLanes = + (JSCompiler_object_inline_stack_2285.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_componentStack_2267, + JSCompiler_object_inline_componentStack_2286, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - (workInProgress = JSCompiler_object_inline_message_2264)); + (workInProgress = JSCompiler_object_inline_message_2283)); else if ( (pushPrimaryTreeSuspenseHandler(workInProgress), isHydrating && console.error( "We should not be hydrating here. This is a bug in React. Please file a bug." ), - JSCompiler_object_inline_digest_2265.data === + JSCompiler_object_inline_digest_2284.data === SUSPENSE_FALLBACK_START_DATA) ) { - JSCompiler_object_inline_componentStack_2267 = - JSCompiler_object_inline_digest_2265.nextSibling && - JSCompiler_object_inline_digest_2265.nextSibling.dataset; - if (JSCompiler_object_inline_componentStack_2267) { - JSCompiler_temp = JSCompiler_object_inline_componentStack_2267.dgst; - var message = JSCompiler_object_inline_componentStack_2267.msg; - instance = JSCompiler_object_inline_componentStack_2267.stck; + JSCompiler_object_inline_componentStack_2286 = + JSCompiler_object_inline_digest_2284.nextSibling && + JSCompiler_object_inline_digest_2284.nextSibling.dataset; + if (JSCompiler_object_inline_componentStack_2286) { + JSCompiler_temp = JSCompiler_object_inline_componentStack_2286.dgst; + var message = JSCompiler_object_inline_componentStack_2286.msg; + instance = JSCompiler_object_inline_componentStack_2286.stck; var componentStack = - JSCompiler_object_inline_componentStack_2267.cstck; + JSCompiler_object_inline_componentStack_2286.cstck; } - JSCompiler_object_inline_message_2264 = message; - JSCompiler_object_inline_digest_2265 = JSCompiler_temp; - JSCompiler_object_inline_stack_2266 = instance; - JSCompiler_object_inline_componentStack_2267 = componentStack; - "POSTPONE" !== JSCompiler_object_inline_digest_2265 && - ((JSCompiler_object_inline_message_2264 = - JSCompiler_object_inline_message_2264 - ? Error(JSCompiler_object_inline_message_2264) + JSCompiler_object_inline_message_2283 = message; + JSCompiler_object_inline_digest_2284 = JSCompiler_temp; + JSCompiler_object_inline_stack_2285 = instance; + JSCompiler_object_inline_componentStack_2286 = componentStack; + "POSTPONE" !== JSCompiler_object_inline_digest_2284 && + ((JSCompiler_object_inline_message_2283 = + JSCompiler_object_inline_message_2283 + ? Error(JSCompiler_object_inline_message_2283) : Error( "The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering." )), - (JSCompiler_object_inline_message_2264.stack = - JSCompiler_object_inline_stack_2266 || ""), - (JSCompiler_object_inline_message_2264.digest = - JSCompiler_object_inline_digest_2265), - (JSCompiler_object_inline_componentStack_2267 = - void 0 === JSCompiler_object_inline_componentStack_2267 + (JSCompiler_object_inline_message_2283.stack = + JSCompiler_object_inline_stack_2285 || ""), + (JSCompiler_object_inline_message_2283.digest = + JSCompiler_object_inline_digest_2284), + (JSCompiler_object_inline_componentStack_2286 = + void 0 === JSCompiler_object_inline_componentStack_2286 ? null - : JSCompiler_object_inline_componentStack_2267), - "string" === typeof JSCompiler_object_inline_componentStack_2267 && + : JSCompiler_object_inline_componentStack_2286), + "string" === typeof JSCompiler_object_inline_componentStack_2286 && CapturedStacks.set( - JSCompiler_object_inline_message_2264, - JSCompiler_object_inline_componentStack_2267 + JSCompiler_object_inline_message_2283, + JSCompiler_object_inline_componentStack_2286 ), queueHydrationError({ - value: JSCompiler_object_inline_message_2264, + value: JSCompiler_object_inline_message_2283, source: null, - stack: JSCompiler_object_inline_componentStack_2267 + stack: JSCompiler_object_inline_componentStack_2286 })); workInProgress = retrySuspenseComponentWithoutHydrating( current, @@ -9127,25 +9147,25 @@ renderLanes, !1 ), - (JSCompiler_object_inline_componentStack_2267 = + (JSCompiler_object_inline_componentStack_2286 = 0 !== (renderLanes & current.childLanes)), - didReceiveUpdate || JSCompiler_object_inline_componentStack_2267) + didReceiveUpdate || JSCompiler_object_inline_componentStack_2286) ) { - JSCompiler_object_inline_componentStack_2267 = workInProgressRoot; - if (null !== JSCompiler_object_inline_componentStack_2267) { - JSCompiler_object_inline_stack_2266 = renderLanes & -renderLanes; - if (0 !== (JSCompiler_object_inline_stack_2266 & 42)) - JSCompiler_object_inline_stack_2266 = 1; + JSCompiler_object_inline_componentStack_2286 = workInProgressRoot; + if (null !== JSCompiler_object_inline_componentStack_2286) { + JSCompiler_object_inline_stack_2285 = renderLanes & -renderLanes; + if (0 !== (JSCompiler_object_inline_stack_2285 & 42)) + JSCompiler_object_inline_stack_2285 = 1; else - switch (JSCompiler_object_inline_stack_2266) { + switch (JSCompiler_object_inline_stack_2285) { case 2: - JSCompiler_object_inline_stack_2266 = 1; + JSCompiler_object_inline_stack_2285 = 1; break; case 8: - JSCompiler_object_inline_stack_2266 = 4; + JSCompiler_object_inline_stack_2285 = 4; break; case 32: - JSCompiler_object_inline_stack_2266 = 16; + JSCompiler_object_inline_stack_2285 = 16; break; case 128: case 256: @@ -9166,40 +9186,40 @@ case 8388608: case 16777216: case 33554432: - JSCompiler_object_inline_stack_2266 = 64; + JSCompiler_object_inline_stack_2285 = 64; break; case 268435456: - JSCompiler_object_inline_stack_2266 = 134217728; + JSCompiler_object_inline_stack_2285 = 134217728; break; default: - JSCompiler_object_inline_stack_2266 = 0; + JSCompiler_object_inline_stack_2285 = 0; } - JSCompiler_object_inline_stack_2266 = + JSCompiler_object_inline_stack_2285 = 0 !== - (JSCompiler_object_inline_stack_2266 & - (JSCompiler_object_inline_componentStack_2267.suspendedLanes | + (JSCompiler_object_inline_stack_2285 & + (JSCompiler_object_inline_componentStack_2286.suspendedLanes | renderLanes)) ? 0 - : JSCompiler_object_inline_stack_2266; + : JSCompiler_object_inline_stack_2285; if ( - 0 !== JSCompiler_object_inline_stack_2266 && - JSCompiler_object_inline_stack_2266 !== prevState.retryLane + 0 !== JSCompiler_object_inline_stack_2285 && + JSCompiler_object_inline_stack_2285 !== prevState.retryLane ) throw ( - ((prevState.retryLane = JSCompiler_object_inline_stack_2266), + ((prevState.retryLane = JSCompiler_object_inline_stack_2285), enqueueConcurrentRenderForLane( current, - JSCompiler_object_inline_stack_2266 + JSCompiler_object_inline_stack_2285 ), scheduleUpdateOnFiber( - JSCompiler_object_inline_componentStack_2267, + JSCompiler_object_inline_componentStack_2286, current, - JSCompiler_object_inline_stack_2266 + JSCompiler_object_inline_stack_2285 ), SelectiveHydrationException) ); } - JSCompiler_object_inline_digest_2265.data === + JSCompiler_object_inline_digest_2284.data === SUSPENSE_PENDING_START_DATA || renderDidSuspendDelayIfPossible(); workInProgress = retrySuspenseComponentWithoutHydrating( current, @@ -9207,7 +9227,7 @@ renderLanes ); } else - JSCompiler_object_inline_digest_2265.data === + JSCompiler_object_inline_digest_2284.data === SUSPENSE_PENDING_START_DATA ? ((workInProgress.flags |= 128), (workInProgress.child = current.child), @@ -9215,12 +9235,12 @@ null, current )), - (JSCompiler_object_inline_digest_2265._reactRetry = + (JSCompiler_object_inline_digest_2284._reactRetry = workInProgress), (workInProgress = null)) : ((current = prevState.treeContext), (nextHydratableInstance = getNextHydratable( - JSCompiler_object_inline_digest_2265.nextSibling + JSCompiler_object_inline_digest_2284.nextSibling )), (hydrationParentFiber = workInProgress), (isHydrating = !0), @@ -9238,54 +9258,54 @@ (treeContextProvider = workInProgress)), (workInProgress = mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_stack_2266.children + JSCompiler_object_inline_stack_2285.children )), (workInProgress.flags |= 4096)); return workInProgress; } - if (JSCompiler_object_inline_message_2264) + if (JSCompiler_object_inline_message_2283) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_message_2264 = - JSCompiler_object_inline_stack_2266.fallback), - (JSCompiler_object_inline_digest_2265 = workInProgress.mode), + (JSCompiler_object_inline_message_2283 = + JSCompiler_object_inline_stack_2285.fallback), + (JSCompiler_object_inline_digest_2284 = workInProgress.mode), (JSCompiler_temp = current.child), (instance = JSCompiler_temp.sibling), - (JSCompiler_object_inline_stack_2266 = createWorkInProgress( + (JSCompiler_object_inline_stack_2285 = createWorkInProgress( JSCompiler_temp, { mode: "hidden", - children: JSCompiler_object_inline_stack_2266.children + children: JSCompiler_object_inline_stack_2285.children } )), - (JSCompiler_object_inline_stack_2266.subtreeFlags = + (JSCompiler_object_inline_stack_2285.subtreeFlags = JSCompiler_temp.subtreeFlags & 31457280), null !== instance - ? (JSCompiler_object_inline_message_2264 = createWorkInProgress( + ? (JSCompiler_object_inline_message_2283 = createWorkInProgress( instance, - JSCompiler_object_inline_message_2264 + JSCompiler_object_inline_message_2283 )) - : ((JSCompiler_object_inline_message_2264 = createFiberFromFragment( - JSCompiler_object_inline_message_2264, - JSCompiler_object_inline_digest_2265, + : ((JSCompiler_object_inline_message_2283 = createFiberFromFragment( + JSCompiler_object_inline_message_2283, + JSCompiler_object_inline_digest_2284, renderLanes, null )), - (JSCompiler_object_inline_message_2264.flags |= 2)), - (JSCompiler_object_inline_message_2264.return = workInProgress), - (JSCompiler_object_inline_stack_2266.return = workInProgress), - (JSCompiler_object_inline_stack_2266.sibling = - JSCompiler_object_inline_message_2264), - (workInProgress.child = JSCompiler_object_inline_stack_2266), - (JSCompiler_object_inline_stack_2266 = - JSCompiler_object_inline_message_2264), - (JSCompiler_object_inline_message_2264 = workInProgress.child), - (JSCompiler_object_inline_digest_2265 = current.child.memoizedState), - null === JSCompiler_object_inline_digest_2265 - ? (JSCompiler_object_inline_digest_2265 = + (JSCompiler_object_inline_message_2283.flags |= 2)), + (JSCompiler_object_inline_message_2283.return = workInProgress), + (JSCompiler_object_inline_stack_2285.return = workInProgress), + (JSCompiler_object_inline_stack_2285.sibling = + JSCompiler_object_inline_message_2283), + (workInProgress.child = JSCompiler_object_inline_stack_2285), + (JSCompiler_object_inline_stack_2285 = + JSCompiler_object_inline_message_2283), + (JSCompiler_object_inline_message_2283 = workInProgress.child), + (JSCompiler_object_inline_digest_2284 = current.child.memoizedState), + null === JSCompiler_object_inline_digest_2284 + ? (JSCompiler_object_inline_digest_2284 = mountSuspenseOffscreenState(renderLanes)) : ((JSCompiler_temp = - JSCompiler_object_inline_digest_2265.cachePool), + JSCompiler_object_inline_digest_2284.cachePool), null !== JSCompiler_temp ? ((instance = CacheContext._currentValue), (JSCompiler_temp = @@ -9293,38 +9313,38 @@ ? { parent: instance, pool: instance } : JSCompiler_temp)) : (JSCompiler_temp = getSuspendedCache()), - (JSCompiler_object_inline_digest_2265 = { + (JSCompiler_object_inline_digest_2284 = { baseLanes: - JSCompiler_object_inline_digest_2265.baseLanes | renderLanes, + JSCompiler_object_inline_digest_2284.baseLanes | renderLanes, cachePool: JSCompiler_temp })), - (JSCompiler_object_inline_message_2264.memoizedState = - JSCompiler_object_inline_digest_2265), - (JSCompiler_object_inline_message_2264.childLanes = + (JSCompiler_object_inline_message_2283.memoizedState = + JSCompiler_object_inline_digest_2284), + (JSCompiler_object_inline_message_2283.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_componentStack_2267, + JSCompiler_object_inline_componentStack_2286, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2266 + JSCompiler_object_inline_stack_2285 ); pushPrimaryTreeSuspenseHandler(workInProgress); renderLanes = current.child; current = renderLanes.sibling; renderLanes = createWorkInProgress(renderLanes, { mode: "visible", - children: JSCompiler_object_inline_stack_2266.children + children: JSCompiler_object_inline_stack_2285.children }); renderLanes.return = workInProgress; renderLanes.sibling = null; null !== current && - ((JSCompiler_object_inline_componentStack_2267 = + ((JSCompiler_object_inline_componentStack_2286 = workInProgress.deletions), - null === JSCompiler_object_inline_componentStack_2267 + null === JSCompiler_object_inline_componentStack_2286 ? ((workInProgress.deletions = [current]), (workInProgress.flags |= 16)) - : JSCompiler_object_inline_componentStack_2267.push(current)); + : JSCompiler_object_inline_componentStack_2286.push(current)); workInProgress.child = renderLanes; workInProgress.memoizedState = null; return renderLanes; @@ -11242,7 +11262,12 @@ } else ref.current = null; } - function commitProfiler(finishedWork, current, commitTime, effectDuration) { + function commitProfiler( + finishedWork, + current, + commitStartTime, + effectDuration + ) { var _finishedWork$memoize = finishedWork.memoizedProps, id = _finishedWork$memoize.id, onCommit = _finishedWork$memoize.onCommit; @@ -11256,20 +11281,20 @@ finishedWork.actualDuration, finishedWork.treeBaseDuration, finishedWork.actualStartTime, - commitTime + commitStartTime ); "function" === typeof onCommit && onCommit( finishedWork.memoizedProps.id, current, effectDuration, - commitTime + commitStartTime ); } function commitProfilerPostCommitImpl( finishedWork, current, - commitTime, + commitStartTime, passiveEffectDuration ) { var _finishedWork$memoize2 = finishedWork.memoizedProps; @@ -11282,7 +11307,7 @@ finishedWork, current, passiveEffectDuration, - commitTime + commitStartTime ); } function commitHostMount(finishedWork) { @@ -11726,7 +11751,7 @@ commitProfiler, finishedWork, current, - commitTime, + commitStartTime, finishedRoot.effectDuration ); } catch (error) { @@ -12740,7 +12765,7 @@ commitProfiler, finishedWork, current, - commitTime, + commitStartTime, includeWorkInProgressEffects.effectDuration ); } catch (error) { @@ -12936,7 +12961,7 @@ commitProfilerPostCommitImpl, finishedWork, finishedWork.alternate, - commitTime, + commitStartTime, finishedRoot.passiveEffectDuration ); } catch (error) { @@ -13742,8 +13767,7 @@ workInProgress.flags & 16384 && ((retryQueue = 22 !== workInProgress.tag ? claimNextRetryLane() : 536870912), - (workInProgress.lanes |= retryQueue), - (workInProgressSuspendedRetryLanes |= retryQueue)); + (workInProgress.lanes |= retryQueue)); } function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { if (!isHydrating) @@ -14540,8 +14564,7 @@ markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane, - workInProgressRootDidSkipSuspendedSiblings + workInProgressDeferredLane ); markRootUpdated(root, lane); if ( @@ -14583,199 +14606,189 @@ markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane, - workInProgressRootDidSkipSuspendedSiblings + workInProgressDeferredLane )), ensureRootIsScheduled(root); } - function performConcurrentWorkOnRoot(root, didTimeout) { - nestedUpdateScheduled = currentUpdateIsNested = !1; + function performWorkOnRoot(root, lanes, forceSync) { if ((executionContext & (RenderContext | CommitContext)) !== NoContext) throw Error("Should not already be working."); - var originalCallbackNode = root.callbackNode; - if (flushPassiveEffects() && root.callbackNode !== originalCallbackNode) - return null; - var lanes = getNextLanes( - root, - root === workInProgressRoot ? workInProgressRootRenderLanes : 0 - ); - if (0 === lanes) return null; var shouldTimeSlice = - 0 === (lanes & 60) && 0 === (lanes & root.expiredLanes) && !didTimeout; - didTimeout = shouldTimeSlice - ? renderRootConcurrent(root, lanes) - : renderRootSync(root, lanes); - if (didTimeout !== RootInProgress) { + (!forceSync && + 0 === (lanes & 60) && + 0 === (lanes & root.expiredLanes)) || + !1, + exitStatus = shouldTimeSlice + ? renderRootConcurrent(root, lanes) + : renderRootSync(root, lanes, !0); + do { var renderWasConcurrent = shouldTimeSlice; - do { - if (didTimeout === RootDidNotComplete) - markRootSuspended( - root, - lanes, - 0, - workInProgressRootDidSkipSuspendedSiblings - ); - else { - shouldTimeSlice = root.current.alternate; - if ( - renderWasConcurrent && - !isRenderConsistentWithExternalStores(shouldTimeSlice) - ) { - didTimeout = renderRootSync(root, lanes); - renderWasConcurrent = !1; - continue; - } - if (didTimeout === RootErrored) { - renderWasConcurrent = lanes; - var errorRetryLanes = getLanesToRetrySynchronouslyOnError( - root, - renderWasConcurrent - ); - if ( - 0 !== errorRetryLanes && - ((lanes = errorRetryLanes), - (didTimeout = recoverFromConcurrentError( - root, - renderWasConcurrent, - errorRetryLanes - )), - (renderWasConcurrent = !1), - didTimeout !== RootErrored) - ) - continue; - } - if (didTimeout === RootFatalErrored) { - prepareFreshStack(root, 0); - markRootSuspended( - root, - lanes, - 0, - workInProgressRootDidSkipSuspendedSiblings - ); - break; - } - a: { - renderWasConcurrent = root; - completeTime = now(); - switch (didTimeout) { - case RootInProgress: - case RootFatalErrored: - throw Error("Root did not complete. This is a bug in React."); - case RootSuspendedWithDelay: - if ((lanes & 4194176) === lanes) { - markRootSuspended( - renderWasConcurrent, - lanes, - workInProgressDeferredLane, - workInProgressRootDidSkipSuspendedSiblings - ); + if (exitStatus === RootInProgress) break; + else if (exitStatus === RootDidNotComplete) + markRootSuspended(root, lanes, 0); + else { + forceSync = root.current.alternate; + if ( + renderWasConcurrent && + !isRenderConsistentWithExternalStores(forceSync) + ) { + exitStatus = renderRootSync(root, lanes, !1); + continue; + } + if (exitStatus === RootErrored) { + renderWasConcurrent = lanes; + if (root.errorRecoveryDisabledLanes & renderWasConcurrent) + var errorRetryLanes = 0; + else + (errorRetryLanes = root.pendingLanes & -536870913), + (errorRetryLanes = + 0 !== errorRetryLanes + ? errorRetryLanes + : errorRetryLanes & 536870912 + ? 536870912 + : 0); + if (0 !== errorRetryLanes) { + lanes = errorRetryLanes; + a: { + exitStatus = root; + var errorRetryLanes$jscomp$0 = errorRetryLanes; + errorRetryLanes = workInProgressRootConcurrentErrors; + var wasRootDehydrated = + exitStatus.current.memoizedState.isDehydrated; + wasRootDehydrated && + (prepareFreshStack( + exitStatus, + errorRetryLanes$jscomp$0 + ).flags |= 256); + errorRetryLanes$jscomp$0 = renderRootSync( + exitStatus, + errorRetryLanes$jscomp$0, + !1 + ); + if (errorRetryLanes$jscomp$0 !== RootErrored) { + if ( + workInProgressRootDidAttachPingListener && + !wasRootDehydrated + ) { + exitStatus.errorRecoveryDisabledLanes |= + renderWasConcurrent; + workInProgressRootInterleavedUpdatedLanes |= + renderWasConcurrent; + exitStatus = RootSuspendedWithDelay; break a; } - break; - case RootErrored: - workInProgressRootRecoverableErrors = null; - break; - case RootSuspended: - case RootCompleted: - break; - default: - throw Error("Unknown root exit status."); + exitStatus = workInProgressRootRecoverableErrors; + workInProgressRootRecoverableErrors = errorRetryLanes; + null !== exitStatus && queueRecoverableErrors(exitStatus); + } + exitStatus = errorRetryLanes$jscomp$0; } - renderWasConcurrent.finishedWork = shouldTimeSlice; - renderWasConcurrent.finishedLanes = lanes; - if (null !== ReactSharedInternals.actQueue) - commitRoot( - renderWasConcurrent, - workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, - workInProgressDeferredLane, - workInProgressRootInterleavedUpdatedLanes, - workInProgressSuspendedRetryLanes - ); - else { - if ( - (lanes & 62914560) === lanes && - ((didTimeout = - globalMostRecentFallbackTime + - FALLBACK_THROTTLE_MS - - now$1()), - 10 < didTimeout) - ) { + if (exitStatus !== RootErrored) continue; + } + } + if (exitStatus === RootFatalErrored) { + prepareFreshStack(root, 0); + markRootSuspended(root, lanes, 0); + break; + } + a: { + shouldTimeSlice = root; + renderWasConcurrent = now$1(); + switch (exitStatus) { + case RootInProgress: + case RootFatalErrored: + throw Error("Root did not complete. This is a bug in React."); + case RootSuspendedWithDelay: + if ((lanes & 4194176) === lanes) { markRootSuspended( - renderWasConcurrent, + shouldTimeSlice, lanes, - workInProgressDeferredLane, - workInProgressRootDidSkipSuspendedSiblings - ); - if (0 !== getNextLanes(renderWasConcurrent, 0)) break a; - renderWasConcurrent.timeoutHandle = scheduleTimeout( - commitRootWhenReady.bind( - null, - renderWasConcurrent, - shouldTimeSlice, - workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, - lanes, - workInProgressDeferredLane, - workInProgressRootInterleavedUpdatedLanes, - workInProgressSuspendedRetryLanes, - workInProgressRootDidSkipSuspendedSiblings - ), - didTimeout + workInProgressDeferredLane ); break a; } - commitRootWhenReady( - renderWasConcurrent, + break; + case RootErrored: + workInProgressRootRecoverableErrors = null; + break; + case RootSuspended: + case RootCompleted: + break; + default: + throw Error("Unknown root exit status."); + } + shouldTimeSlice.finishedWork = forceSync; + shouldTimeSlice.finishedLanes = lanes; + if (null !== ReactSharedInternals.actQueue) + commitRoot( + shouldTimeSlice, + workInProgressRootRecoverableErrors, + workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + IMMEDIATE_COMMIT, + renderStartTime, + renderWasConcurrent + ); + else { + if ( + (lanes & 62914560) === lanes && + ((exitStatus = + globalMostRecentFallbackTime + + FALLBACK_THROTTLE_MS - + now$1()), + 10 < exitStatus) + ) { + markRootSuspended( shouldTimeSlice, - workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, lanes, - workInProgressDeferredLane, - workInProgressRootInterleavedUpdatedLanes, - workInProgressSuspendedRetryLanes, - workInProgressRootDidSkipSuspendedSiblings + workInProgressDeferredLane + ); + if (0 !== getNextLanes(shouldTimeSlice, 0)) break a; + shouldTimeSlice.timeoutHandle = scheduleTimeout( + commitRootWhenReady.bind( + null, + shouldTimeSlice, + forceSync, + workInProgressRootRecoverableErrors, + workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, + lanes, + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + workInProgressRootDidSkipSuspendedSiblings, + THROTTLED_COMMIT, + renderStartTime, + renderWasConcurrent + ), + exitStatus ); + break a; } + commitRootWhenReady( + shouldTimeSlice, + forceSync, + workInProgressRootRecoverableErrors, + workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, + lanes, + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + workInProgressRootDidSkipSuspendedSiblings, + IMMEDIATE_COMMIT, + renderStartTime, + renderWasConcurrent + ); } } - break; - } while (1); - } + } + break; + } while (1); ensureRootIsScheduled(root); - scheduleTaskForRootDuringMicrotask(root, now$1()); - root = - root.callbackNode === originalCallbackNode - ? performConcurrentWorkOnRoot.bind(null, root) - : null; - return root; - } - function recoverFromConcurrentError( - root, - originallyAttemptedLanes, - errorRetryLanes - ) { - var errorsFromFirstAttempt = workInProgressRootConcurrentErrors, - wasRootDehydrated = root.current.memoizedState.isDehydrated; - wasRootDehydrated && - (prepareFreshStack(root, errorRetryLanes).flags |= 256); - errorRetryLanes = renderRootSync(root, errorRetryLanes); - if (errorRetryLanes !== RootErrored) { - if (workInProgressRootDidAttachPingListener && !wasRootDehydrated) - return ( - (root.errorRecoveryDisabledLanes |= originallyAttemptedLanes), - (workInProgressRootInterleavedUpdatedLanes |= - originallyAttemptedLanes), - RootSuspendedWithDelay - ); - root = workInProgressRootRecoverableErrors; - workInProgressRootRecoverableErrors = errorsFromFirstAttempt; - null !== root && queueRecoverableErrors(root); - } - return errorRetryLanes; } function queueRecoverableErrors(errors) { null === workInProgressRootRecoverableErrors @@ -14795,10 +14808,16 @@ spawnedLane, updatedLanes, suspendedRetryLanes, - didSkipSuspendedSiblings + didSkipSuspendedSiblings, + suspendedCommitReason, + completedRenderStartTime, + completedRenderEndTime ) { - var subtreeFlags = finishedWork.subtreeFlags; - if (subtreeFlags & 8192 || 16785408 === (subtreeFlags & 16785408)) + didSkipSuspendedSiblings = finishedWork.subtreeFlags; + if ( + didSkipSuspendedSiblings & 8192 || + 16785408 === (didSkipSuspendedSiblings & 16785408) + ) if ( ((suspendedState = { stylesheets: null, @@ -14818,10 +14837,13 @@ didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes + suspendedRetryLanes, + SUSPENDED_COMMIT, + completedRenderStartTime, + completedRenderEndTime ) ); - markRootSuspended(root, lanes, spawnedLane, didSkipSuspendedSiblings); + markRootSuspended(root, lanes, spawnedLane); return; } commitRoot( @@ -14831,7 +14853,10 @@ didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes + suspendedRetryLanes, + suspendedCommitReason, + completedRenderStartTime, + completedRenderEndTime ); } function isRenderConsistentWithExternalStores(finishedWork) { @@ -14880,81 +14905,24 @@ (didIncludeCommitPhaseUpdate = !0); throwIfInfiniteUpdateLoopDetected(); } - function markRootSuspended( - root, - suspendedLanes, - spawnedLane, - didSkipSuspendedSiblings - ) { + function markRootSuspended(root, suspendedLanes, spawnedLane) { suspendedLanes &= ~workInProgressRootPingedLanes; suspendedLanes &= ~workInProgressRootInterleavedUpdatedLanes; root.suspendedLanes |= suspendedLanes; root.pingedLanes &= ~suspendedLanes; - didSkipSuspendedSiblings || (root.warmLanes |= suspendedLanes); - didSkipSuspendedSiblings = root.expirationTimes; - for (var lanes = suspendedLanes; 0 < lanes; ) { + for ( + var expirationTimes = root.expirationTimes, lanes = suspendedLanes; + 0 < lanes; + + ) { var index = 31 - clz32(lanes), lane = 1 << index; - didSkipSuspendedSiblings[index] = -1; + expirationTimes[index] = -1; lanes &= ~lane; } 0 !== spawnedLane && markSpawnedDeferredLane(root, spawnedLane, suspendedLanes); } - function performSyncWorkOnRoot(root, lanes) { - if ((executionContext & (RenderContext | CommitContext)) !== NoContext) - throw Error("Should not already be working."); - if (flushPassiveEffects()) return ensureRootIsScheduled(root), null; - currentUpdateIsNested = nestedUpdateScheduled; - nestedUpdateScheduled = !1; - var exitStatus = renderRootSync(root, lanes); - if (exitStatus === RootErrored) { - var originallyAttemptedLanes = lanes, - errorRetryLanes = getLanesToRetrySynchronouslyOnError( - root, - originallyAttemptedLanes - ); - 0 !== errorRetryLanes && - ((lanes = errorRetryLanes), - (exitStatus = recoverFromConcurrentError( - root, - originallyAttemptedLanes, - errorRetryLanes - ))); - } - if (exitStatus === RootFatalErrored) - return ( - prepareFreshStack(root, 0), - markRootSuspended(root, lanes, 0, !1), - ensureRootIsScheduled(root), - null - ); - if (exitStatus === RootDidNotComplete) - return ( - markRootSuspended( - root, - lanes, - workInProgressDeferredLane, - workInProgressRootDidSkipSuspendedSiblings - ), - ensureRootIsScheduled(root), - null - ); - completeTime = now(); - root.finishedWork = root.current.alternate; - root.finishedLanes = lanes; - commitRoot( - root, - workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, - workInProgressDeferredLane, - workInProgressRootInterleavedUpdatedLanes, - workInProgressSuspendedRetryLanes - ); - ensureRootIsScheduled(root); - return null; - } function flushSyncWork$1() { return (executionContext & (RenderContext | CommitContext)) === NoContext ? (flushSyncWorkAcrossRoots_impl(0, !1), !1) @@ -15068,8 +15036,9 @@ workInProgressRootRenderLanes = lanes; workInProgressSuspendedReason = NotSuspended; workInProgressThrownValue = null; - workInProgressRootDidAttachPingListener = - workInProgressRootDidSkipSuspendedSiblings = !1; + workInProgressRootDidSkipSuspendedSiblings = !1; + checkIfRootIsPrerendering(root, lanes); + workInProgressRootDidAttachPingListener = !1; workInProgressRootExitStatus = RootInProgress; workInProgressSuspendedRetryLanes = workInProgressDeferredLane = @@ -15162,8 +15131,7 @@ markRootSuspended( workInProgressRoot, workInProgressRootRenderLanes, - workInProgressDeferredLane, - workInProgressRootDidSkipSuspendedSiblings + workInProgressDeferredLane ); } function queueConcurrentError(error) { @@ -15191,37 +15159,38 @@ prepareFreshStack(root, lanes); } lanes = !1; + memoizedUpdaters = workInProgressRootExitStatus; a: do try { if ( workInProgressSuspendedReason !== NotSuspended && null !== workInProgress ) { - memoizedUpdaters = workInProgress; - var thrownValue = workInProgressThrownValue; + var unitOfWork = workInProgress, + thrownValue = workInProgressThrownValue; switch (workInProgressSuspendedReason) { case SuspendedOnHydration: resetWorkInProgressStack(); - workInProgressRootExitStatus = RootDidNotComplete; + memoizedUpdaters = RootDidNotComplete; break a; case SuspendedOnImmediate: case SuspendedOnData: - lanes || - null !== suspenseHandlerStackCursor.current || - (lanes = !0); - default: + case SuspendedOnDeprecatedThrowPromise: + null === suspenseHandlerStackCursor.current && (lanes = !0); var reason = workInProgressSuspendedReason; workInProgressSuspendedReason = NotSuspended; workInProgressThrownValue = null; - throwAndUnwindWorkLoop( - root, - memoizedUpdaters, - thrownValue, - reason - ); + throwAndUnwindWorkLoop(root, unitOfWork, thrownValue, reason); + break; + default: + (reason = workInProgressSuspendedReason), + (workInProgressSuspendedReason = NotSuspended), + (workInProgressThrownValue = null), + throwAndUnwindWorkLoop(root, unitOfWork, thrownValue, reason); } } workLoopSync(); + memoizedUpdaters = workInProgressRootExitStatus; break; } catch (thrownValue$8) { handleThrow(root, thrownValue$8); @@ -15232,14 +15201,11 @@ executionContext = prevExecutionContext; ReactSharedInternals.H = prevDispatcher; ReactSharedInternals.A = prevAsyncDispatcher; - if (null !== workInProgress) - throw Error( - "Cannot commit an incomplete root. This error is likely caused by a bug in React. Please file an issue." - ); - workInProgressRoot = null; - workInProgressRootRenderLanes = 0; - finishQueueingConcurrentUpdates(); - return workInProgressRootExitStatus; + null === workInProgress && + ((workInProgressRoot = null), + (workInProgressRootRenderLanes = 0), + finishQueueingConcurrentUpdates()); + return memoizedUpdaters; } function workLoopSync() { for (; null !== workInProgress; ) performUnitOfWork(workInProgress); @@ -15263,7 +15229,7 @@ workInProgressTransitions = null; workInProgressRootRenderTargetTime = now$1() + RENDER_TIMEOUT_MS; prepareFreshStack(root, lanes); - } + } else checkIfRootIsPrerendering(root, lanes); a: do try { if ( @@ -15580,7 +15546,10 @@ didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes + suspendedRetryLanes, + suspendedCommitReason, + completedRenderStartTime, + completedRenderEndTime ) { var prevTransition = ReactSharedInternals.T, previousUpdateLanePriority = ReactDOMSharedInternals.p; @@ -15595,13 +15564,15 @@ previousUpdateLanePriority, spawnedLane, updatedLanes, - suspendedRetryLanes + suspendedRetryLanes, + suspendedCommitReason, + completedRenderStartTime, + completedRenderEndTime ); } finally { (ReactSharedInternals.T = prevTransition), (ReactDOMSharedInternals.p = previousUpdateLanePriority); } - return null; } function commitRootImpl( root, @@ -15611,7 +15582,10 @@ renderPriorityLevel, spawnedLane, updatedLanes, - suspendedRetryLanes + suspendedRetryLanes, + suspendedCommitReason, + completedRenderStartTime, + completedRenderEndTime ) { do flushPassiveEffects(); while (null !== rootWithPendingPassiveEffects); @@ -15619,107 +15593,118 @@ ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings(); if ((executionContext & (RenderContext | CommitContext)) !== NoContext) throw Error("Should not already be working."); - var finishedWork = root.finishedWork, - lanes = root.finishedLanes; - if (null === finishedWork) return null; - 0 === lanes && + suspendedRetryLanes = root.finishedWork; + updatedLanes = root.finishedLanes; + reusableComponentDevToolDetails.track = + getGroupNameOfHighestPriorityLane(updatedLanes); + logRenderPhase(completedRenderStartTime, completedRenderEndTime); + if (null === suspendedRetryLanes) return null; + 0 === updatedLanes && console.error( "root.finishedLanes should not be empty during a commit. This is a bug in React." ); root.finishedWork = null; root.finishedLanes = 0; - if (finishedWork === root.current) + if (suspendedRetryLanes === root.current) throw Error( "Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue." ); root.callbackNode = null; root.callbackPriority = 0; root.cancelPendingCommit = null; - var remainingLanes = finishedWork.lanes | finishedWork.childLanes; - remainingLanes |= concurrentlyUpdatedLanes; + completedRenderStartTime = + suspendedRetryLanes.lanes | suspendedRetryLanes.childLanes; + completedRenderStartTime |= concurrentlyUpdatedLanes; markRootFinished( root, - lanes, - remainingLanes, - spawnedLane, updatedLanes, - suspendedRetryLanes + completedRenderStartTime, + spawnedLane ); didIncludeCommitPhaseUpdate = !1; root === workInProgressRoot && ((workInProgress = workInProgressRoot = null), (workInProgressRootRenderLanes = 0)); - (0 === finishedWork.actualDuration && - 0 === (finishedWork.subtreeFlags & 10256) && - 0 === (finishedWork.flags & 10256)) || + (0 === suspendedRetryLanes.actualDuration && + 0 === (suspendedRetryLanes.subtreeFlags & 10256) && + 0 === (suspendedRetryLanes.flags & 10256)) || rootDoesHavePassiveEffects || ((rootDoesHavePassiveEffects = !0), - (pendingPassiveEffectsRemainingLanes = remainingLanes), + (pendingPassiveEffectsRemainingLanes = completedRenderStartTime), + (pendingPassiveEffectsRenderEndTime = completedRenderEndTime), (pendingPassiveTransitions = transitions), scheduleCallback$1(NormalPriority$1, function () { - flushPassiveEffects(); + flushPassiveEffects(!0); return null; })); - transitions = 0 !== (finishedWork.flags & 15990); - 0 !== (finishedWork.subtreeFlags & 15990) || transitions + commitStartTime = now(); + suspendedCommitReason === SUSPENDED_COMMIT + ? logSuspendedCommitPhase(completedRenderEndTime, commitStartTime) + : suspendedCommitReason === THROTTLED_COMMIT && + logSuspenseThrottlePhase(completedRenderEndTime, commitStartTime); + transitions = 0 !== (suspendedRetryLanes.flags & 15990); + 0 !== (suspendedRetryLanes.subtreeFlags & 15990) || transitions ? ((transitions = ReactSharedInternals.T), (ReactSharedInternals.T = null), (spawnedLane = ReactDOMSharedInternals.p), (ReactDOMSharedInternals.p = DiscreteEventPriority), - (updatedLanes = executionContext), + (suspendedCommitReason = executionContext), (executionContext |= CommitContext), - commitBeforeMutationEffects(root, finishedWork), - (commitTime = now()), - commitMutationEffects(root, finishedWork, lanes), + commitBeforeMutationEffects(root, suspendedRetryLanes), + commitMutationEffects(root, suspendedRetryLanes, updatedLanes), restoreSelection(selectionInformation, root.containerInfo), (_enabled = !!eventsEnabled), (selectionInformation = eventsEnabled = null), - (root.current = finishedWork), - commitLayoutEffects(finishedWork, root, lanes), + (root.current = suspendedRetryLanes), + commitLayoutEffects(suspendedRetryLanes, root, updatedLanes), requestPaint(), - (executionContext = updatedLanes), + (executionContext = suspendedCommitReason), (ReactDOMSharedInternals.p = spawnedLane), (ReactSharedInternals.T = transitions)) - : ((root.current = finishedWork), (commitTime = now())); + : (root.current = suspendedRetryLanes); + commitEndTime = now(); + logCommitPhase(commitStartTime, commitEndTime); (transitions = rootDoesHavePassiveEffects) ? ((rootDoesHavePassiveEffects = !1), (rootWithPendingPassiveEffects = root), - (pendingPassiveEffectsLanes = lanes)) - : (releaseRootPooledCache(root, remainingLanes), + (pendingPassiveEffectsLanes = updatedLanes)) + : (releaseRootPooledCache(root, completedRenderStartTime), (nestedPassiveUpdateCount = 0), (rootWithPassiveNestedUpdates = null)); - remainingLanes = root.pendingLanes; - 0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null); + completedRenderStartTime = root.pendingLanes; + 0 === completedRenderStartTime && + (legacyErrorBoundariesThatAlreadyFailed = null); transitions || commitDoubleInvokeEffectsInDEV(root); - onCommitRoot$1(finishedWork.stateNode, renderPriorityLevel); + onCommitRoot$1(suspendedRetryLanes.stateNode, renderPriorityLevel); isDevToolsPresent && root.memoizedUpdaters.clear(); onCommitRoot(); ensureRootIsScheduled(root); if (null !== recoverableErrors) for ( - renderPriorityLevel = root.onRecoverableError, finishedWork = 0; - finishedWork < recoverableErrors.length; - finishedWork++ + renderPriorityLevel = root.onRecoverableError, + suspendedRetryLanes = 0; + suspendedRetryLanes < recoverableErrors.length; + suspendedRetryLanes++ ) - (remainingLanes = recoverableErrors[finishedWork]), - (spawnedLane = makeErrorInfo(remainingLanes.stack)), + (completedRenderStartTime = recoverableErrors[suspendedRetryLanes]), + (spawnedLane = makeErrorInfo(completedRenderStartTime.stack)), runWithFiberInDEV( - remainingLanes.source, + completedRenderStartTime.source, renderPriorityLevel, - remainingLanes.value, + completedRenderStartTime.value, spawnedLane ); 0 !== (pendingPassiveEffectsLanes & 3) && flushPassiveEffects(); - remainingLanes = root.pendingLanes; + completedRenderStartTime = root.pendingLanes; didIncludeRenderPhaseUpdate || didIncludeCommitPhaseUpdate || - (0 !== (lanes & 4194218) && 0 !== (remainingLanes & 42)) + (0 !== (updatedLanes & 4194218) && 0 !== (completedRenderStartTime & 42)) ? ((nestedUpdateScheduled = !0), root === rootWithNestedUpdates ? nestedUpdateCount++ : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root))) : (nestedUpdateCount = 0); - transitions || finalizeRender(lanes, now$1()); + transitions || finalizeRender(updatedLanes, now$1()); flushSyncWorkAcrossRoots_impl(0, !1); return null; } @@ -15740,7 +15725,7 @@ null != remainingLanes && ((root.pooledCache = null), releaseCache(remainingLanes))); } - function flushPassiveEffects() { + function flushPassiveEffects(wasDelayedCommit) { if (null !== rootWithPendingPassiveEffects) { var root = rootWithPendingPassiveEffects, remainingLanes = pendingPassiveEffectsRemainingLanes; @@ -15758,10 +15743,10 @@ if (null === rootWithPendingPassiveEffects) var JSCompiler_inline_result = !1; else { - priority = pendingPassiveTransitions; + var transitions = pendingPassiveTransitions; pendingPassiveTransitions = null; - var root$jscomp$0 = rootWithPendingPassiveEffects, - lanes = pendingPassiveEffectsLanes; + priority = rootWithPendingPassiveEffects; + var lanes = pendingPassiveEffectsLanes; rootWithPendingPassiveEffects = null; pendingPassiveEffectsLanes = 0; if ( @@ -15772,40 +15757,56 @@ "Cannot flush passive effects while already rendering." ); reusableComponentDevToolDetails.track = - lanes & 63 - ? "Blocking" - : lanes & 4194240 - ? "Transition" - : lanes & 62914560 - ? "Suspense" - : lanes & 2080374784 - ? "Idle" - : "Other"; + getGroupNameOfHighestPriorityLane(lanes); isFlushingPassiveEffects = !0; didScheduleUpdateDuringPassiveEffects = !1; - var prevExecutionContext = executionContext; + var passiveEffectStartTime = 0; + passiveEffectStartTime = now$1(); + var startTime = commitEndTime, + endTime = passiveEffectStartTime; + supportsUserTiming && + ((reusableComponentDevToolDetails.color = "secondary-light"), + (reusableComponentOptions.start = startTime), + (reusableComponentOptions.end = endTime), + performance.measure( + "Waiting for Paint", + reusableComponentOptions + )); + startTime = executionContext; executionContext |= CommitContext; - var finishedWork = root$jscomp$0.current; + var finishedWork = priority.current; resetComponentEffectTimers(); commitPassiveUnmountOnFiber(finishedWork); - var finishedWork$jscomp$0 = root$jscomp$0.current; + var finishedWork$jscomp$0 = priority.current; + finishedWork = pendingPassiveEffectsRenderEndTime; resetComponentEffectTimers(); commitPassiveMountOnFiber( - root$jscomp$0, + priority, finishedWork$jscomp$0, lanes, - priority, - completeTime + transitions, + finishedWork ); - commitDoubleInvokeEffectsInDEV(root$jscomp$0); - executionContext = prevExecutionContext; - finalizeRender(lanes, now$1()); + commitDoubleInvokeEffectsInDEV(priority); + executionContext = startTime; + var passiveEffectsEndTime = now$1(); + wasDelayedCommit && + ((wasDelayedCommit = passiveEffectStartTime), + supportsUserTiming && + ((reusableComponentDevToolDetails.color = "secondary-dark"), + (reusableComponentOptions.start = wasDelayedCommit), + (reusableComponentOptions.end = passiveEffectsEndTime), + performance.measure( + "Remaining Effects", + reusableComponentOptions + ))); + finalizeRender(lanes, passiveEffectsEndTime); flushSyncWorkAcrossRoots_impl(0, !1); didScheduleUpdateDuringPassiveEffects - ? root$jscomp$0 === rootWithPassiveNestedUpdates + ? priority === rootWithPassiveNestedUpdates ? nestedPassiveUpdateCount++ : ((nestedPassiveUpdateCount = 0), - (rootWithPassiveNestedUpdates = root$jscomp$0)) + (rootWithPassiveNestedUpdates = priority)) : (nestedPassiveUpdateCount = 0); didScheduleUpdateDuringPassiveEffects = isFlushingPassiveEffects = !1; @@ -15814,7 +15815,7 @@ "function" === typeof injectedHook.onPostCommitFiberRoot ) try { - injectedHook.onPostCommitFiberRoot(rendererID, root$jscomp$0); + injectedHook.onPostCommitFiberRoot(rendererID, priority); } catch (err) { hasLoggedError || ((hasLoggedError = !0), @@ -15823,7 +15824,7 @@ err )); } - var stateNode = root$jscomp$0.current.stateNode; + var stateNode = priority.current.stateNode; stateNode.effectDuration = 0; stateNode.passiveEffectDuration = 0; JSCompiler_inline_result = !0; @@ -16154,7 +16155,8 @@ root, root === workInProgressRoot ? nextLanes : 0 )), - 0 !== (nextLanes & 3) && + 0 === (nextLanes & 3) || + checkIfRootIsPrerendering(root, nextLanes) || ((didPerformSomeWork = !0), performSyncWorkOnRoot(root, nextLanes)); root = root.next; @@ -16245,8 +16247,6 @@ else return currentTime; switch (lanesToEventPriority(suspendedLanes)) { case DiscreteEventPriority: - suspendedLanes = ImmediatePriority; - break; case ContinuousEventPriority: suspendedLanes = UserBlockingPriority; break; @@ -16259,7 +16259,7 @@ default: suspendedLanes = NormalPriority$1; } - pingedLanes = performConcurrentWorkOnRoot.bind(null, root); + pingedLanes = performWorkOnRootViaSchedulerTask.bind(null, root); null !== ReactSharedInternals.actQueue ? (ReactSharedInternals.actQueue.push(pingedLanes), (suspendedLanes = fakeActCallbackNode)) @@ -16268,6 +16268,34 @@ root.callbackNode = suspendedLanes; return currentTime; } + function performWorkOnRootViaSchedulerTask(root, didTimeout) { + nestedUpdateScheduled = currentUpdateIsNested = !1; + var originalCallbackNode = root.callbackNode; + if (flushPassiveEffects() && root.callbackNode !== originalCallbackNode) + return null; + var workInProgressRootRenderLanes$jscomp$0 = + workInProgressRootRenderLanes; + workInProgressRootRenderLanes$jscomp$0 = getNextLanes( + root, + root === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0 + ); + if (0 === workInProgressRootRenderLanes$jscomp$0) return null; + performWorkOnRoot( + root, + workInProgressRootRenderLanes$jscomp$0, + didTimeout + ); + scheduleTaskForRootDuringMicrotask(root, now$1()); + return root.callbackNode === originalCallbackNode + ? performWorkOnRootViaSchedulerTask.bind(null, root) + : null; + } + function performSyncWorkOnRoot(root, lanes) { + if (flushPassiveEffects()) return null; + currentUpdateIsNested = nestedUpdateScheduled; + nestedUpdateScheduled = !1; + performWorkOnRoot(root, lanes, !0); + } function cancelCallback(callbackNode) { callbackNode !== fakeActCallbackNode && null !== callbackNode && @@ -22546,8 +22574,8 @@ NoStrictPassiveEffectsMode = 64, now = Scheduler.unstable_now, renderStartTime = -0, - completeTime = -0, - commitTime = -0, + commitStartTime = -0, + commitEndTime = -0, profilerStartTime = -1.1, profilerEffectDuration = -0, componentEffectDuration = -0, @@ -24377,16 +24405,20 @@ rootWithPendingPassiveEffects = null, pendingPassiveEffectsLanes = 0, pendingPassiveEffectsRemainingLanes = 0, + pendingPassiveEffectsRenderEndTime = -0, pendingPassiveTransitions = null, - NESTED_UPDATE_LIMIT = 50, + NESTED_UPDATE_LIMIT = 100, nestedUpdateCount = 0, rootWithNestedUpdates = null, isFlushingPassiveEffects = !1, didScheduleUpdateDuringPassiveEffects = !1, - NESTED_PASSIVE_UPDATE_LIMIT = 50, + NESTED_PASSIVE_UPDATE_LIMIT = 100, nestedPassiveUpdateCount = 0, rootWithPassiveNestedUpdates = null, isRunningInsertionEffect = !1, + IMMEDIATE_COMMIT = 0, + SUSPENDED_COMMIT = 1, + THROTTLED_COMMIT = 2, didWarnStateUpdateForNotYetMountedComponent = null, didWarnAboutUpdateInRender = !1; var didWarnAboutUpdateInRenderForAnotherComponent = new Set(); @@ -24931,11 +24963,11 @@ }; (function () { var isomorphicReactPackageVersion = React.version; - if ("19.0.0-experimental-5d19e1c8-20240923" !== isomorphicReactPackageVersion) + if ("19.0.0-experimental-778e1ed2-20240926" !== isomorphicReactPackageVersion) throw Error( 'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion + - "\n - react-dom: 19.0.0-experimental-5d19e1c8-20240923\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.0.0-experimental-778e1ed2-20240926\nLearn more: https://react.dev/warnings/version-mismatch") ); })(); ("function" === typeof Map && @@ -24972,11 +25004,11 @@ !(function () { var internals = { bundleType: 1, - version: "19.0.0-experimental-5d19e1c8-20240923", + version: "19.0.0-experimental-778e1ed2-20240926", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, findFiberByHostInstance: getClosestInstanceFromNode, - reconcilerVersion: "19.0.0-experimental-5d19e1c8-20240923" + reconcilerVersion: "19.0.0-experimental-778e1ed2-20240926" }; internals.overrideHookState = overrideHookState; internals.overrideHookStateDeletePath = overrideHookStateDeletePath; @@ -25448,7 +25480,7 @@ exports.useFormStatus = function () { return resolveDispatcher().useHostTransitionStatus(); }; - exports.version = "19.0.0-experimental-5d19e1c8-20240923"; + exports.version = "19.0.0-experimental-778e1ed2-20240926"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-profiling.profiling.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-profiling.profiling.js index a502438334dff..0593b1c74be54 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-profiling.profiling.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-profiling.profiling.js @@ -675,43 +675,39 @@ function getNextLanes(root, wipLanes) { var pendingLanes = root.pendingLanes; if (0 === pendingLanes) return 0; var nextLanes = 0, - suspendedLanes = root.suspendedLanes, - pingedLanes = root.pingedLanes, - warmLanes = root.warmLanes; - root = 0 !== root.finishedLanes; + suspendedLanes = root.suspendedLanes; + root = root.pingedLanes; var nonIdlePendingLanes = pendingLanes & 134217727; 0 !== nonIdlePendingLanes ? ((pendingLanes = nonIdlePendingLanes & ~suspendedLanes), 0 !== pendingLanes ? (nextLanes = getHighestPriorityLanes(pendingLanes)) - : ((pingedLanes &= nonIdlePendingLanes), - 0 !== pingedLanes - ? (nextLanes = getHighestPriorityLanes(pingedLanes)) - : root || - ((warmLanes = nonIdlePendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes))))) - : ((nonIdlePendingLanes = pendingLanes & ~suspendedLanes), - 0 !== nonIdlePendingLanes - ? (nextLanes = getHighestPriorityLanes(nonIdlePendingLanes)) - : 0 !== pingedLanes - ? (nextLanes = getHighestPriorityLanes(pingedLanes)) - : root || - ((warmLanes = pendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes)))); + : ((root &= nonIdlePendingLanes), + 0 !== root && (nextLanes = getHighestPriorityLanes(root)))) + : ((pendingLanes &= ~suspendedLanes), + 0 !== pendingLanes + ? (nextLanes = getHighestPriorityLanes(pendingLanes)) + : 0 !== root && (nextLanes = getHighestPriorityLanes(root))); return 0 === nextLanes ? 0 : 0 !== wipLanes && wipLanes !== nextLanes && 0 === (wipLanes & suspendedLanes) && ((suspendedLanes = nextLanes & -nextLanes), - (warmLanes = wipLanes & -wipLanes), - suspendedLanes >= warmLanes || - (32 === suspendedLanes && 0 !== (warmLanes & 4194176))) + (root = wipLanes & -wipLanes), + suspendedLanes >= root || + (32 === suspendedLanes && 0 !== (root & 4194176))) ? wipLanes : nextLanes; } +function checkIfRootIsPrerendering(root, renderLanes) { + return ( + 0 === + (root.pendingLanes & + ~(root.suspendedLanes & ~root.pingedLanes) & + renderLanes) + ); +} function computeExpirationTime(lane, currentTime) { switch (lane) { case 1: @@ -753,11 +749,6 @@ function computeExpirationTime(lane, currentTime) { return -1; } } -function getLanesToRetrySynchronouslyOnError(root, originallyAttemptedLanes) { - if (root.errorRecoveryDisabledLanes & originallyAttemptedLanes) return 0; - root = root.pendingLanes & -536870913; - return 0 !== root ? root : root & 536870912 ? 536870912 : 0; -} function claimNextTransitionLane() { var lane = nextTransitionLane; nextTransitionLane <<= 1; @@ -774,14 +765,7 @@ function createLaneMap(initial) { for (var laneMap = [], i = 0; 31 > i; i++) laneMap.push(initial); return laneMap; } -function markRootFinished( - root, - finishedLanes, - remainingLanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes -) { +function markRootFinished(root, finishedLanes, remainingLanes, spawnedLane) { var previouslyPendingLanes = root.pendingLanes; root.pendingLanes = remainingLanes; root.suspendedLanes = 0; @@ -791,36 +775,31 @@ function markRootFinished( root.entangledLanes &= remainingLanes; root.errorRecoveryDisabledLanes &= remainingLanes; root.shellSuspendCounter = 0; - var entanglements = root.entanglements, - expirationTimes = root.expirationTimes, + finishedLanes = root.entanglements; + var expirationTimes = root.expirationTimes, hiddenUpdates = root.hiddenUpdates; for ( remainingLanes = previouslyPendingLanes & ~remainingLanes; 0 < remainingLanes; ) { - var index$7 = 31 - clz32(remainingLanes), - lane = 1 << index$7; - entanglements[index$7] = 0; - expirationTimes[index$7] = -1; - var hiddenUpdatesForLane = hiddenUpdates[index$7]; + var index$6 = 31 - clz32(remainingLanes); + previouslyPendingLanes = 1 << index$6; + finishedLanes[index$6] = 0; + expirationTimes[index$6] = -1; + var hiddenUpdatesForLane = hiddenUpdates[index$6]; if (null !== hiddenUpdatesForLane) for ( - hiddenUpdates[index$7] = null, index$7 = 0; - index$7 < hiddenUpdatesForLane.length; - index$7++ + hiddenUpdates[index$6] = null, index$6 = 0; + index$6 < hiddenUpdatesForLane.length; + index$6++ ) { - var update = hiddenUpdatesForLane[index$7]; + var update = hiddenUpdatesForLane[index$6]; null !== update && (update.lane &= -536870913); } - remainingLanes &= ~lane; + remainingLanes &= ~previouslyPendingLanes; } 0 !== spawnedLane && markSpawnedDeferredLane(root, spawnedLane, 0); - 0 !== suspendedRetryLanes && - 0 === updatedLanes && - 0 !== root.tag && - (root.suspendedLanes |= - suspendedRetryLanes & ~(previouslyPendingLanes & ~finishedLanes)); } function markSpawnedDeferredLane(root, spawnedLane, entangledLanes) { root.pendingLanes |= spawnedLane; @@ -835,19 +814,19 @@ function markSpawnedDeferredLane(root, spawnedLane, entangledLanes) { function markRootEntangled(root, entangledLanes) { var rootEntangledLanes = (root.entangledLanes |= entangledLanes); for (root = root.entanglements; rootEntangledLanes; ) { - var index$8 = 31 - clz32(rootEntangledLanes), - lane = 1 << index$8; - (lane & entangledLanes) | (root[index$8] & entangledLanes) && - (root[index$8] |= entangledLanes); + var index$7 = 31 - clz32(rootEntangledLanes), + lane = 1 << index$7; + (lane & entangledLanes) | (root[index$7] & entangledLanes) && + (root[index$7] |= entangledLanes); rootEntangledLanes &= ~lane; } } function addFiberToLanesMap(root, fiber, lanes) { if (isDevToolsPresent) for (root = root.pendingUpdatersLaneMap; 0 < lanes; ) { - var index$10 = 31 - clz32(lanes), - lane = 1 << index$10; - root[index$10].add(fiber); + var index$9 = 31 - clz32(lanes), + lane = 1 << index$9; + root[index$9].add(fiber); lanes &= ~lane; } } @@ -859,19 +838,30 @@ function movePendingFibersToMemoized(root, lanes) { 0 < lanes; ) { - var index$11 = 31 - clz32(lanes); - root = 1 << index$11; - index$11 = pendingUpdatersLaneMap[index$11]; - 0 < index$11.size && - (index$11.forEach(function (fiber) { + var index$10 = 31 - clz32(lanes); + root = 1 << index$10; + index$10 = pendingUpdatersLaneMap[index$10]; + 0 < index$10.size && + (index$10.forEach(function (fiber) { var alternate = fiber.alternate; (null !== alternate && memoizedUpdaters.has(alternate)) || memoizedUpdaters.add(fiber); }), - index$11.clear()); + index$10.clear()); lanes &= ~root; } } +function getGroupNameOfHighestPriorityLane(lanes) { + return lanes & 63 + ? "Blocking" + : lanes & 4194240 + ? "Transition" + : lanes & 62914560 + ? "Suspense" + : lanes & 2080374784 + ? "Idle" + : "Other"; +} function lanesToEventPriority(lanes) { lanes &= -lanes; return 2 < lanes @@ -1018,8 +1008,8 @@ function setValueForAttribute(node, name, value) { node.removeAttribute(name); return; case "boolean": - var prefix$12 = name.toLowerCase().slice(0, 5); - if ("data-" !== prefix$12 && "aria-" !== prefix$12) { + var prefix$11 = name.toLowerCase().slice(0, 5); + if ("data-" !== prefix$11 && "aria-" !== prefix$11) { node.removeAttribute(name); return; } @@ -1352,15 +1342,15 @@ function setValueForStyles(node, styles, prevStyles) { : "float" === styleName ? (node.cssFloat = "") : (node[styleName] = "")); - for (var styleName$18 in styles) - (styleName = styles[styleName$18]), - styles.hasOwnProperty(styleName$18) && - prevStyles[styleName$18] !== styleName && - setValueForStyle(node, styleName$18, styleName); + for (var styleName$17 in styles) + (styleName = styles[styleName$17]), + styles.hasOwnProperty(styleName$17) && + prevStyles[styleName$17] !== styleName && + setValueForStyle(node, styleName$17, styleName); } else - for (var styleName$19 in styles) - styles.hasOwnProperty(styleName$19) && - setValueForStyle(node, styleName$19, styles[styleName$19]); + for (var styleName$18 in styles) + styles.hasOwnProperty(styleName$18) && + setValueForStyle(node, styleName$18, styles[styleName$18]); } function isCustomElement(tagName) { if (-1 === tagName.indexOf("-")) return !1; @@ -2091,14 +2081,14 @@ var isInputEventSupported = !1; if (canUseDOM) { var JSCompiler_inline_result$jscomp$297; if (canUseDOM) { - var isSupported$jscomp$inline_433 = "oninput" in document; - if (!isSupported$jscomp$inline_433) { - var element$jscomp$inline_434 = document.createElement("div"); - element$jscomp$inline_434.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_433 = - "function" === typeof element$jscomp$inline_434.oninput; + var isSupported$jscomp$inline_432 = "oninput" in document; + if (!isSupported$jscomp$inline_432) { + var element$jscomp$inline_433 = document.createElement("div"); + element$jscomp$inline_433.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_432 = + "function" === typeof element$jscomp$inline_433.oninput; } - JSCompiler_inline_result$jscomp$297 = isSupported$jscomp$inline_433; + JSCompiler_inline_result$jscomp$297 = isSupported$jscomp$inline_432; } else JSCompiler_inline_result$jscomp$297 = !1; isInputEventSupported = JSCompiler_inline_result$jscomp$297 && @@ -2469,6 +2459,34 @@ function logComponentEffect(fiber, startTime, endTime, selfTime) { (reusableComponentOptions.end = endTime), performance.measure(fiber, reusableComponentOptions)); } +function logRenderPhase(startTime, endTime) { + supportsUserTiming && + ((reusableComponentDevToolDetails.color = "primary-dark"), + (reusableComponentOptions.start = startTime), + (reusableComponentOptions.end = endTime), + performance.measure("Render", reusableComponentOptions)); +} +function logSuspenseThrottlePhase(startTime, endTime) { + supportsUserTiming && + ((reusableComponentDevToolDetails.color = "secondary-light"), + (reusableComponentOptions.start = startTime), + (reusableComponentOptions.end = endTime), + performance.measure("Throttled", reusableComponentOptions)); +} +function logSuspendedCommitPhase(startTime, endTime) { + supportsUserTiming && + ((reusableComponentDevToolDetails.color = "secondary-light"), + (reusableComponentOptions.start = startTime), + (reusableComponentOptions.end = endTime), + performance.measure("Suspended", reusableComponentOptions)); +} +function logCommitPhase(startTime, endTime) { + supportsUserTiming && + ((reusableComponentDevToolDetails.color = "secondary-dark"), + (reusableComponentOptions.start = startTime), + (reusableComponentOptions.end = endTime), + performance.measure("Commit", reusableComponentOptions)); +} var concurrentQueues = [], concurrentQueuesIndex = 0, concurrentlyUpdatedLanes = 0; @@ -2549,8 +2567,8 @@ function getRootForUpdatedFiber(sourceFiber) { var emptyContextObject = {}, now = Scheduler.unstable_now, renderStartTime = -0, - completeTime = -0, - commitTime = -0, + commitStartTime = -0, + commitEndTime = -0, profilerStartTime = -1.1, profilerEffectDuration = -0, componentEffectDuration = -0, @@ -4176,7 +4194,7 @@ function updateReducerImpl(hook, current, reducer) { var newBaseQueueFirst = (baseFirst = null), newBaseQueueLast = null, update = current, - didReadFromEntangledAsyncAction$57 = !1; + didReadFromEntangledAsyncAction$56 = !1; do { var updateLane = update.lane & -536870913; if ( @@ -4197,11 +4215,11 @@ function updateReducerImpl(hook, current, reducer) { next: null }), updateLane === currentEntangledLane && - (didReadFromEntangledAsyncAction$57 = !0); + (didReadFromEntangledAsyncAction$56 = !0); else if ((renderLanes & revertLane) === revertLane) { update = update.next; revertLane === currentEntangledLane && - (didReadFromEntangledAsyncAction$57 = !0); + (didReadFromEntangledAsyncAction$56 = !0); continue; } else (updateLane = { @@ -4247,7 +4265,7 @@ function updateReducerImpl(hook, current, reducer) { if ( !objectIs(pendingQueue, hook.memoizedState) && ((didReceiveUpdate = !0), - didReadFromEntangledAsyncAction$57 && + didReadFromEntangledAsyncAction$56 && ((reducer = currentEntangledActionThenable), null !== reducer)) ) throw reducer; @@ -4445,8 +4463,8 @@ function runActionStateAction(actionQueue, node) { try { (prevTransition = action(prevState, payload)), handleActionReturnValue(actionQueue, node, prevTransition); - } catch (error$63) { - onActionError(actionQueue, node, error$63); + } catch (error$62) { + onActionError(actionQueue, node, error$62); } } function handleActionReturnValue(actionQueue, node, returnValue) { @@ -4895,15 +4913,15 @@ function refreshCache(fiber, seedKey, seedValue) { case 3: var lane = requestUpdateLane(); fiber = createUpdate(lane); - var root$66 = enqueueUpdate(provider, fiber, lane); - null !== root$66 && + var root$65 = enqueueUpdate(provider, fiber, lane); + null !== root$65 && (startUpdateTimerByLane(lane), - scheduleUpdateOnFiber(root$66, provider, lane), - entangleTransitions(root$66, provider, lane)); + scheduleUpdateOnFiber(root$65, provider, lane), + entangleTransitions(root$65, provider, lane)); provider = createCache(); null !== seedKey && void 0 !== seedKey && - null !== root$66 && + null !== root$65 && provider.data.set(seedKey, seedValue); fiber.payload = { cache: provider }; return; @@ -5440,9 +5458,9 @@ function resolveClassComponentProps(Component, baseProps) { } if ((Component = Component.defaultProps)) { newProps === baseProps && (newProps = assign({}, newProps)); - for (var propName$70 in Component) - void 0 === newProps[propName$70] && - (newProps[propName$70] = Component[propName$70]); + for (var propName$69 in Component) + void 0 === newProps[propName$69] && + (newProps[propName$69] = Component[propName$69]); } return newProps; } @@ -5488,9 +5506,9 @@ function logUncaughtError(root, errorInfo) { try { var onUncaughtError = root.onUncaughtError; onUncaughtError(errorInfo.value, { componentStack: errorInfo.stack }); - } catch (e$71) { + } catch (e$70) { setTimeout(function () { - throw e$71; + throw e$70; }); } } @@ -5501,9 +5519,9 @@ function logCaughtError(root, boundary, errorInfo) { componentStack: errorInfo.stack, errorBoundary: 1 === boundary.tag ? boundary.stateNode : null }); - } catch (e$72) { + } catch (e$71) { setTimeout(function () { - throw e$72; + throw e$71; }); } } @@ -8004,8 +8022,8 @@ function safelyCallComponentWillUnmount( } else try { instance.componentWillUnmount(); - } catch (error$120) { - captureCommitPhaseError(current, nearestMountedAncestor, error$120); + } catch (error$119) { + captureCommitPhaseError(current, nearestMountedAncestor, error$119); } } function safelyAttachRef(current, nearestMountedAncestor) { @@ -8065,15 +8083,15 @@ function safelyDetachRef(current, nearestMountedAncestor) { recordEffectDuration(current); } else ref(null); - } catch (error$121) { - captureCommitPhaseError(current, nearestMountedAncestor, error$121); + } catch (error$120) { + captureCommitPhaseError(current, nearestMountedAncestor, error$120); } else ref.current = null; } function commitProfilerUpdate( finishedWork, current, - commitTime, + commitStartTime, effectDuration ) { try { @@ -8090,14 +8108,14 @@ function commitProfilerUpdate( finishedWork.actualDuration, finishedWork.treeBaseDuration, finishedWork.actualStartTime, - commitTime + commitStartTime ); "function" === typeof onCommit && onCommit( finishedWork.memoizedProps.id, current, effectDuration, - commitTime + commitStartTime ); } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); @@ -8235,7 +8253,7 @@ function commitBeforeMutationEffects(root, firstChild) { selection = selection.focusOffset; try { JSCompiler_temp.nodeType, focusNode.nodeType; - } catch (e$22) { + } catch (e$21) { JSCompiler_temp = null; break a; } @@ -8405,11 +8423,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { } else try { finishedRoot.componentDidMount(); - } catch (error$117) { + } catch (error$116) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$117 + error$116 ); } else { @@ -8426,11 +8444,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } catch (error$118) { + } catch (error$117) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$118 + error$117 ); } recordEffectDuration(); @@ -8441,11 +8459,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } catch (error$119) { + } catch (error$118) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$119 + error$118 ); } } @@ -8493,7 +8511,7 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { commitProfilerUpdate( finishedWork, current, - commitTime, + commitStartTime, finishedRoot.effectDuration )) : recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); @@ -8622,7 +8640,7 @@ function commitDeletionEffectsOnFiber( safelyDetachRef(deletedFiber, nearestMountedAncestor); case 6: prevHostParentIsContainer = hostParent; - var prevHostParentIsContainer$129 = hostParentIsContainer; + var prevHostParentIsContainer$128 = hostParentIsContainer; hostParent = null; recursivelyTraverseDeletionEffects( finishedRoot, @@ -8630,7 +8648,7 @@ function commitDeletionEffectsOnFiber( deletedFiber ); hostParent = prevHostParentIsContainer; - hostParentIsContainer = prevHostParentIsContainer$129; + hostParentIsContainer = prevHostParentIsContainer$128; if (null !== hostParent) if (hostParentIsContainer) try { @@ -9285,21 +9303,21 @@ function commitReconciliationEffects(finishedWork) { insertOrAppendPlacementNode(finishedWork, before, parent$jscomp$0); break; case 5: - var parent$122 = JSCompiler_inline_result.stateNode; + var parent$121 = JSCompiler_inline_result.stateNode; JSCompiler_inline_result.flags & 32 && - (setTextContent(parent$122, ""), + (setTextContent(parent$121, ""), (JSCompiler_inline_result.flags &= -33)); - var before$123 = getHostSibling(finishedWork); - insertOrAppendPlacementNode(finishedWork, before$123, parent$122); + var before$122 = getHostSibling(finishedWork); + insertOrAppendPlacementNode(finishedWork, before$122, parent$121); break; case 3: case 4: - var parent$124 = JSCompiler_inline_result.stateNode.containerInfo, - before$125 = getHostSibling(finishedWork); + var parent$123 = JSCompiler_inline_result.stateNode.containerInfo, + before$124 = getHostSibling(finishedWork); insertOrAppendPlacementNodeIntoContainer( finishedWork, - before$125, - parent$124 + before$124, + parent$123 ); break; default: @@ -9460,7 +9478,7 @@ function recursivelyTraverseReappearLayoutEffects( commitProfilerUpdate( finishedWork, current, - commitTime, + commitStartTime, finishedRoot.effectDuration )) : recursivelyTraverseReappearLayoutEffects( @@ -9639,7 +9657,7 @@ function commitPassiveMountOnFiber( id, phase, finishedRoot.passiveEffectDuration, - commitTime + commitStartTime ); } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); @@ -10312,8 +10330,7 @@ function scheduleRetryEffect(workInProgress, retryQueue) { workInProgress.flags & 16384 && ((retryQueue = 22 !== workInProgress.tag ? claimNextRetryLane() : 536870912), - (workInProgress.lanes |= retryQueue), - (workInProgressSuspendedRetryLanes |= retryQueue)); + (workInProgress.lanes |= retryQueue)); } function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { if (!isHydrating) @@ -10330,14 +10347,14 @@ function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { break; case "collapsed": lastTailNode = renderState.tail; - for (var lastTailNode$144 = null; null !== lastTailNode; ) - null !== lastTailNode.alternate && (lastTailNode$144 = lastTailNode), + for (var lastTailNode$143 = null; null !== lastTailNode; ) + null !== lastTailNode.alternate && (lastTailNode$143 = lastTailNode), (lastTailNode = lastTailNode.sibling); - null === lastTailNode$144 + null === lastTailNode$143 ? hasRenderedATailFallback || null === renderState.tail ? (renderState.tail = null) : (renderState.tail.sibling = null) - : (lastTailNode$144.sibling = null); + : (lastTailNode$143.sibling = null); } } function bubbleProperties(completedWork) { @@ -10349,53 +10366,53 @@ function bubbleProperties(completedWork) { if (didBailout) if (0 !== (completedWork.mode & 2)) { for ( - var treeBaseDuration$146 = completedWork.selfBaseDuration, - child$147 = completedWork.child; - null !== child$147; + var treeBaseDuration$145 = completedWork.selfBaseDuration, + child$146 = completedWork.child; + null !== child$146; ) - (newChildLanes |= child$147.lanes | child$147.childLanes), - (subtreeFlags |= child$147.subtreeFlags & 31457280), - (subtreeFlags |= child$147.flags & 31457280), - (treeBaseDuration$146 += child$147.treeBaseDuration), - (child$147 = child$147.sibling); - completedWork.treeBaseDuration = treeBaseDuration$146; + (newChildLanes |= child$146.lanes | child$146.childLanes), + (subtreeFlags |= child$146.subtreeFlags & 31457280), + (subtreeFlags |= child$146.flags & 31457280), + (treeBaseDuration$145 += child$146.treeBaseDuration), + (child$146 = child$146.sibling); + completedWork.treeBaseDuration = treeBaseDuration$145; } else for ( - treeBaseDuration$146 = completedWork.child; - null !== treeBaseDuration$146; + treeBaseDuration$145 = completedWork.child; + null !== treeBaseDuration$145; ) (newChildLanes |= - treeBaseDuration$146.lanes | treeBaseDuration$146.childLanes), - (subtreeFlags |= treeBaseDuration$146.subtreeFlags & 31457280), - (subtreeFlags |= treeBaseDuration$146.flags & 31457280), - (treeBaseDuration$146.return = completedWork), - (treeBaseDuration$146 = treeBaseDuration$146.sibling); + treeBaseDuration$145.lanes | treeBaseDuration$145.childLanes), + (subtreeFlags |= treeBaseDuration$145.subtreeFlags & 31457280), + (subtreeFlags |= treeBaseDuration$145.flags & 31457280), + (treeBaseDuration$145.return = completedWork), + (treeBaseDuration$145 = treeBaseDuration$145.sibling); else if (0 !== (completedWork.mode & 2)) { - treeBaseDuration$146 = completedWork.actualDuration; - child$147 = completedWork.selfBaseDuration; + treeBaseDuration$145 = completedWork.actualDuration; + child$146 = completedWork.selfBaseDuration; for (var child = completedWork.child; null !== child; ) (newChildLanes |= child.lanes | child.childLanes), (subtreeFlags |= child.subtreeFlags), (subtreeFlags |= child.flags), - (treeBaseDuration$146 += child.actualDuration), - (child$147 += child.treeBaseDuration), + (treeBaseDuration$145 += child.actualDuration), + (child$146 += child.treeBaseDuration), (child = child.sibling); - completedWork.actualDuration = treeBaseDuration$146; - completedWork.treeBaseDuration = child$147; + completedWork.actualDuration = treeBaseDuration$145; + completedWork.treeBaseDuration = child$146; } else for ( - treeBaseDuration$146 = completedWork.child; - null !== treeBaseDuration$146; + treeBaseDuration$145 = completedWork.child; + null !== treeBaseDuration$145; ) (newChildLanes |= - treeBaseDuration$146.lanes | treeBaseDuration$146.childLanes), - (subtreeFlags |= treeBaseDuration$146.subtreeFlags), - (subtreeFlags |= treeBaseDuration$146.flags), - (treeBaseDuration$146.return = completedWork), - (treeBaseDuration$146 = treeBaseDuration$146.sibling); + treeBaseDuration$145.lanes | treeBaseDuration$145.childLanes), + (subtreeFlags |= treeBaseDuration$145.subtreeFlags), + (subtreeFlags |= treeBaseDuration$145.flags), + (treeBaseDuration$145.return = completedWork), + (treeBaseDuration$145 = treeBaseDuration$145.sibling); completedWork.subtreeFlags |= subtreeFlags; completedWork.childLanes = newChildLanes; return didBailout; @@ -10688,11 +10705,11 @@ function completeWork(current, workInProgress, renderLanes) { null !== newProps.alternate.memoizedState && null !== newProps.alternate.memoizedState.cachePool && (type = newProps.alternate.memoizedState.cachePool.pool); - var cache$162 = null; + var cache$161 = null; null !== newProps.memoizedState && null !== newProps.memoizedState.cachePool && - (cache$162 = newProps.memoizedState.cachePool.pool); - cache$162 !== type && (newProps.flags |= 2048); + (cache$161 = newProps.memoizedState.cachePool.pool); + cache$161 !== type && (newProps.flags |= 2048); } renderLanes !== current && renderLanes && @@ -10722,8 +10739,8 @@ function completeWork(current, workInProgress, renderLanes) { type = workInProgress.memoizedState; if (null === type) return bubbleProperties(workInProgress), null; newProps = 0 !== (workInProgress.flags & 128); - cache$162 = type.rendering; - if (null === cache$162) + cache$161 = type.rendering; + if (null === cache$161) if (newProps) cutOffTailIfNeeded(type, !1); else { if ( @@ -10731,11 +10748,11 @@ function completeWork(current, workInProgress, renderLanes) { (null !== current && 0 !== (current.flags & 128)) ) for (current = workInProgress.child; null !== current; ) { - cache$162 = findFirstSuspended(current); - if (null !== cache$162) { + cache$161 = findFirstSuspended(current); + if (null !== cache$161) { workInProgress.flags |= 128; cutOffTailIfNeeded(type, !1); - current = cache$162.updateQueue; + current = cache$161.updateQueue; workInProgress.updateQueue = current; scheduleRetryEffect(workInProgress, current); workInProgress.subtreeFlags = 0; @@ -10760,7 +10777,7 @@ function completeWork(current, workInProgress, renderLanes) { } else { if (!newProps) - if (((current = findFirstSuspended(cache$162)), null !== current)) { + if (((current = findFirstSuspended(cache$161)), null !== current)) { if ( ((workInProgress.flags |= 128), (newProps = !0), @@ -10770,7 +10787,7 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(type, !0), null === type.tail && "hidden" === type.tailMode && - !cache$162.alternate && + !cache$161.alternate && !isHydrating) ) return bubbleProperties(workInProgress), null; @@ -10783,13 +10800,13 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(type, !1), (workInProgress.lanes = 4194304)); type.isBackwards - ? ((cache$162.sibling = workInProgress.child), - (workInProgress.child = cache$162)) + ? ((cache$161.sibling = workInProgress.child), + (workInProgress.child = cache$161)) : ((current = type.last), null !== current - ? (current.sibling = cache$162) - : (workInProgress.child = cache$162), - (type.last = cache$162)); + ? (current.sibling = cache$161) + : (workInProgress.child = cache$161), + (type.last = cache$161)); } if (null !== type.tail) return ( @@ -10992,6 +11009,7 @@ var DefaultAsyncDispatcher = { rootWithPendingPassiveEffects = null, pendingPassiveEffectsLanes = 0, pendingPassiveEffectsRemainingLanes = 0, + pendingPassiveEffectsRenderEndTime = -0, pendingPassiveTransitions = null, nestedUpdateCount = 0, rootWithNestedUpdates = null; @@ -11023,8 +11041,7 @@ function scheduleUpdateOnFiber(root, fiber, lane) { markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane, - workInProgressRootDidSkipSuspendedSiblings + workInProgressDeferredLane ); markRootUpdated(root, lane); if (0 === (executionContext & 2) || root !== workInProgressRoot) @@ -11036,180 +11053,161 @@ function scheduleUpdateOnFiber(root, fiber, lane) { markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane, - workInProgressRootDidSkipSuspendedSiblings + workInProgressDeferredLane )), ensureRootIsScheduled(root); } -function performConcurrentWorkOnRoot(root, didTimeout) { - nestedUpdateScheduled = currentUpdateIsNested = !1; +function performWorkOnRoot(root$jscomp$0, lanes, forceSync) { if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(327)); - var originalCallbackNode = root.callbackNode; - if (flushPassiveEffects() && root.callbackNode !== originalCallbackNode) - return null; - var lanes = getNextLanes( - root, - root === workInProgressRoot ? workInProgressRootRenderLanes : 0 - ); - if (0 === lanes) return null; - var exitStatus = (didTimeout = - 0 === (lanes & 60) && 0 === (lanes & root.expiredLanes) && !didTimeout) - ? renderRootConcurrent(root, lanes) - : renderRootSync(root, lanes); - if (0 !== exitStatus) { - var renderWasConcurrent = didTimeout; - do { - if (6 === exitStatus) - markRootSuspended( - root, - lanes, - 0, - workInProgressRootDidSkipSuspendedSiblings - ); - else { - didTimeout = root.current.alternate; - if ( - renderWasConcurrent && - !isRenderConsistentWithExternalStores(didTimeout) - ) { - exitStatus = renderRootSync(root, lanes); - renderWasConcurrent = !1; - continue; - } - if (2 === exitStatus) { - renderWasConcurrent = lanes; - var errorRetryLanes = getLanesToRetrySynchronouslyOnError( - root, - renderWasConcurrent - ); - if ( - 0 !== errorRetryLanes && - ((lanes = errorRetryLanes), - (exitStatus = recoverFromConcurrentError( + var shouldTimeSlice = + (!forceSync && + 0 === (lanes & 60) && + 0 === (lanes & root$jscomp$0.expiredLanes)) || + !1, + exitStatus = shouldTimeSlice + ? renderRootConcurrent(root$jscomp$0, lanes) + : renderRootSync(root$jscomp$0, lanes, !0); + do { + var renderWasConcurrent = shouldTimeSlice; + if (0 === exitStatus) break; + else if (6 === exitStatus) markRootSuspended(root$jscomp$0, lanes, 0); + else { + forceSync = root$jscomp$0.current.alternate; + if ( + renderWasConcurrent && + !isRenderConsistentWithExternalStores(forceSync) + ) { + exitStatus = renderRootSync(root$jscomp$0, lanes, !1); + continue; + } + if (2 === exitStatus) { + renderWasConcurrent = lanes; + if (root$jscomp$0.errorRecoveryDisabledLanes & renderWasConcurrent) + var JSCompiler_inline_result = 0; + else + (JSCompiler_inline_result = root$jscomp$0.pendingLanes & -536870913), + (JSCompiler_inline_result = + 0 !== JSCompiler_inline_result + ? JSCompiler_inline_result + : JSCompiler_inline_result & 536870912 + ? 536870912 + : 0); + if (0 !== JSCompiler_inline_result) { + lanes = JSCompiler_inline_result; + a: { + var root = root$jscomp$0; + exitStatus = workInProgressRootConcurrentErrors; + var wasRootDehydrated = root.current.memoizedState.isDehydrated; + wasRootDehydrated && + (prepareFreshStack(root, JSCompiler_inline_result).flags |= 256); + JSCompiler_inline_result = renderRootSync( root, - renderWasConcurrent, - errorRetryLanes - )), - (renderWasConcurrent = !1), - 2 !== exitStatus) - ) - continue; - } - if (1 === exitStatus) { - prepareFreshStack(root, 0); - markRootSuspended( - root, - lanes, - 0, - workInProgressRootDidSkipSuspendedSiblings - ); - break; - } - a: { - renderWasConcurrent = root; - completeTime = now(); - switch (exitStatus) { - case 0: - case 1: - throw Error(formatProdErrorMessage(345)); - case 4: - if ((lanes & 4194176) === lanes) { - markRootSuspended( - renderWasConcurrent, - lanes, - workInProgressDeferredLane, - workInProgressRootDidSkipSuspendedSiblings - ); + JSCompiler_inline_result, + !1 + ); + if (2 !== JSCompiler_inline_result) { + if ( + workInProgressRootDidAttachPingListener && + !wasRootDehydrated + ) { + root.errorRecoveryDisabledLanes |= renderWasConcurrent; + workInProgressRootInterleavedUpdatedLanes |= + renderWasConcurrent; + exitStatus = 4; break a; } - break; - case 2: - workInProgressRootRecoverableErrors = null; - break; - case 3: - case 5: - break; - default: - throw Error(formatProdErrorMessage(329)); + renderWasConcurrent = workInProgressRootRecoverableErrors; + workInProgressRootRecoverableErrors = exitStatus; + null !== renderWasConcurrent && + queueRecoverableErrors(renderWasConcurrent); + } + exitStatus = JSCompiler_inline_result; } - renderWasConcurrent.finishedWork = didTimeout; - renderWasConcurrent.finishedLanes = lanes; - if ( - (lanes & 62914560) === lanes && - ((exitStatus = globalMostRecentFallbackTime + 300 - now$1()), - 10 < exitStatus) - ) { - markRootSuspended( - renderWasConcurrent, + if (2 !== exitStatus) continue; + } + } + if (1 === exitStatus) { + prepareFreshStack(root$jscomp$0, 0); + markRootSuspended(root$jscomp$0, lanes, 0); + break; + } + a: { + shouldTimeSlice = root$jscomp$0; + renderWasConcurrent = exitStatus; + exitStatus = now$1(); + switch (renderWasConcurrent) { + case 0: + case 1: + throw Error(formatProdErrorMessage(345)); + case 4: + if ((lanes & 4194176) === lanes) { + markRootSuspended( + shouldTimeSlice, + lanes, + workInProgressDeferredLane + ); + break a; + } + break; + case 2: + workInProgressRootRecoverableErrors = null; + break; + case 3: + case 5: + break; + default: + throw Error(formatProdErrorMessage(329)); + } + shouldTimeSlice.finishedWork = forceSync; + shouldTimeSlice.finishedLanes = lanes; + if ( + (lanes & 62914560) === lanes && + ((renderWasConcurrent = globalMostRecentFallbackTime + 300 - now$1()), + 10 < renderWasConcurrent) + ) { + markRootSuspended(shouldTimeSlice, lanes, workInProgressDeferredLane); + if (0 !== getNextLanes(shouldTimeSlice, 0)) break a; + shouldTimeSlice.timeoutHandle = scheduleTimeout( + commitRootWhenReady.bind( + null, + shouldTimeSlice, + forceSync, + workInProgressRootRecoverableErrors, + workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, lanes, workInProgressDeferredLane, - workInProgressRootDidSkipSuspendedSiblings - ); - if (0 !== getNextLanes(renderWasConcurrent, 0)) break a; - renderWasConcurrent.timeoutHandle = scheduleTimeout( - commitRootWhenReady.bind( - null, - renderWasConcurrent, - didTimeout, - workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, - lanes, - workInProgressDeferredLane, - workInProgressRootInterleavedUpdatedLanes, - workInProgressSuspendedRetryLanes, - workInProgressRootDidSkipSuspendedSiblings - ), + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + workInProgressRootDidSkipSuspendedSiblings, + 2, + renderStartTime, exitStatus - ); - break a; - } - commitRootWhenReady( - renderWasConcurrent, - didTimeout, - workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, - lanes, - workInProgressDeferredLane, - workInProgressRootInterleavedUpdatedLanes, - workInProgressSuspendedRetryLanes, - workInProgressRootDidSkipSuspendedSiblings + ), + renderWasConcurrent ); + break a; } + commitRootWhenReady( + shouldTimeSlice, + forceSync, + workInProgressRootRecoverableErrors, + workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, + lanes, + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + workInProgressRootDidSkipSuspendedSiblings, + 0, + renderStartTime, + exitStatus + ); } - break; - } while (1); - } - ensureRootIsScheduled(root); - scheduleTaskForRootDuringMicrotask(root, now$1()); - root = - root.callbackNode === originalCallbackNode - ? performConcurrentWorkOnRoot.bind(null, root) - : null; - return root; -} -function recoverFromConcurrentError( - root, - originallyAttemptedLanes, - errorRetryLanes -) { - var errorsFromFirstAttempt = workInProgressRootConcurrentErrors, - wasRootDehydrated = root.current.memoizedState.isDehydrated; - wasRootDehydrated && (prepareFreshStack(root, errorRetryLanes).flags |= 256); - errorRetryLanes = renderRootSync(root, errorRetryLanes); - if (2 !== errorRetryLanes) { - if (workInProgressRootDidAttachPingListener && !wasRootDehydrated) - return ( - (root.errorRecoveryDisabledLanes |= originallyAttemptedLanes), - (workInProgressRootInterleavedUpdatedLanes |= originallyAttemptedLanes), - 4 - ); - root = workInProgressRootRecoverableErrors; - workInProgressRootRecoverableErrors = errorsFromFirstAttempt; - null !== root && queueRecoverableErrors(root); - } - return errorRetryLanes; + } + break; + } while (1); + ensureRootIsScheduled(root$jscomp$0); } function queueRecoverableErrors(errors) { null === workInProgressRootRecoverableErrors @@ -11229,10 +11227,16 @@ function commitRootWhenReady( spawnedLane, updatedLanes, suspendedRetryLanes, - didSkipSuspendedSiblings + didSkipSuspendedSiblings, + suspendedCommitReason, + completedRenderStartTime, + completedRenderEndTime ) { - var subtreeFlags = finishedWork.subtreeFlags; - if (subtreeFlags & 8192 || 16785408 === (subtreeFlags & 16785408)) + didSkipSuspendedSiblings = finishedWork.subtreeFlags; + if ( + didSkipSuspendedSiblings & 8192 || + 16785408 === (didSkipSuspendedSiblings & 16785408) + ) if ( ((suspendedState = { stylesheets: null, count: 0, unsuspend: noop$1 }), accumulateSuspenseyCommitOnFiber(finishedWork), @@ -11248,10 +11252,13 @@ function commitRootWhenReady( didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes + suspendedRetryLanes, + 1, + completedRenderStartTime, + completedRenderEndTime ) ); - markRootSuspended(root, lanes, spawnedLane, didSkipSuspendedSiblings); + markRootSuspended(root, lanes, spawnedLane); return; } commitRoot( @@ -11261,7 +11268,10 @@ function commitRootWhenReady( didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes + suspendedRetryLanes, + suspendedCommitReason, + completedRenderStartTime, + completedRenderEndTime ); } function isRenderConsistentWithExternalStores(finishedWork) { @@ -11307,80 +11317,24 @@ function markRootUpdated(root, updatedLanes) { : executionContext & 4 && (didIncludeCommitPhaseUpdate = !0); throwIfInfiniteUpdateLoopDetected(); } -function markRootSuspended( - root, - suspendedLanes, - spawnedLane, - didSkipSuspendedSiblings -) { +function markRootSuspended(root, suspendedLanes, spawnedLane) { suspendedLanes &= ~workInProgressRootPingedLanes; suspendedLanes &= ~workInProgressRootInterleavedUpdatedLanes; root.suspendedLanes |= suspendedLanes; root.pingedLanes &= ~suspendedLanes; - didSkipSuspendedSiblings || (root.warmLanes |= suspendedLanes); - didSkipSuspendedSiblings = root.expirationTimes; - for (var lanes = suspendedLanes; 0 < lanes; ) { - var index$6 = 31 - clz32(lanes), - lane = 1 << index$6; - didSkipSuspendedSiblings[index$6] = -1; + for ( + var expirationTimes = root.expirationTimes, lanes = suspendedLanes; + 0 < lanes; + + ) { + var index$5 = 31 - clz32(lanes), + lane = 1 << index$5; + expirationTimes[index$5] = -1; lanes &= ~lane; } 0 !== spawnedLane && markSpawnedDeferredLane(root, spawnedLane, suspendedLanes); } -function performSyncWorkOnRoot(root, lanes) { - if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(327)); - if (flushPassiveEffects()) return ensureRootIsScheduled(root), null; - currentUpdateIsNested = nestedUpdateScheduled; - nestedUpdateScheduled = !1; - var exitStatus = renderRootSync(root, lanes); - if (2 === exitStatus) { - var originallyAttemptedLanes = lanes, - errorRetryLanes = getLanesToRetrySynchronouslyOnError( - root, - originallyAttemptedLanes - ); - 0 !== errorRetryLanes && - ((lanes = errorRetryLanes), - (exitStatus = recoverFromConcurrentError( - root, - originallyAttemptedLanes, - errorRetryLanes - ))); - } - if (1 === exitStatus) - return ( - prepareFreshStack(root, 0), - markRootSuspended(root, lanes, 0, !1), - ensureRootIsScheduled(root), - null - ); - if (6 === exitStatus) - return ( - markRootSuspended( - root, - lanes, - workInProgressDeferredLane, - workInProgressRootDidSkipSuspendedSiblings - ), - ensureRootIsScheduled(root), - null - ); - completeTime = now(); - root.finishedWork = root.current.alternate; - root.finishedLanes = lanes; - commitRoot( - root, - workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, - workInProgressDeferredLane, - workInProgressRootInterleavedUpdatedLanes, - workInProgressSuspendedRetryLanes - ); - ensureRootIsScheduled(root); - return null; -} function flushSyncWork$1() { return 0 === (executionContext & 6) ? (flushSyncWorkAcrossRoots_impl(0, !1), !1) @@ -11493,8 +11447,9 @@ function prepareFreshStack(root, lanes) { workInProgressRootRenderLanes = lanes; workInProgressSuspendedReason = 0; workInProgressThrownValue = null; - workInProgressRootDidAttachPingListener = - workInProgressRootDidSkipSuspendedSiblings = !1; + workInProgressRootDidSkipSuspendedSiblings = !1; + checkIfRootIsPrerendering(root, lanes); + workInProgressRootDidAttachPingListener = !1; workInProgressSuspendedRetryLanes = workInProgressDeferredLane = workInProgressRootPingedLanes = @@ -11583,8 +11538,7 @@ function renderDidSuspendDelayIfPossible() { markRootSuspended( workInProgressRoot, workInProgressRootRenderLanes, - workInProgressDeferredLane, - workInProgressRootDidSkipSuspendedSiblings + workInProgressDeferredLane ); } function queueConcurrentError(error) { @@ -11609,29 +11563,35 @@ function renderRootSync(root, lanes) { prepareFreshStack(root, lanes); } lanes = !1; + memoizedUpdaters = workInProgressRootExitStatus; a: do try { if (0 !== workInProgressSuspendedReason && null !== workInProgress) { - memoizedUpdaters = workInProgress; - var thrownValue = workInProgressThrownValue; + var unitOfWork = workInProgress, + thrownValue = workInProgressThrownValue; switch (workInProgressSuspendedReason) { case 8: resetWorkInProgressStack(); - workInProgressRootExitStatus = 6; + memoizedUpdaters = 6; break a; case 3: case 2: - lanes || - null !== suspenseHandlerStackCursor.current || - (lanes = !0); - default: + case 6: + null === suspenseHandlerStackCursor.current && (lanes = !0); var reason = workInProgressSuspendedReason; workInProgressSuspendedReason = 0; workInProgressThrownValue = null; - throwAndUnwindWorkLoop(root, memoizedUpdaters, thrownValue, reason); + throwAndUnwindWorkLoop(root, unitOfWork, thrownValue, reason); + break; + default: + (reason = workInProgressSuspendedReason), + (workInProgressSuspendedReason = 0), + (workInProgressThrownValue = null), + throwAndUnwindWorkLoop(root, unitOfWork, thrownValue, reason); } } workLoopSync(); + memoizedUpdaters = workInProgressRootExitStatus; break; } catch (thrownValue$177) { handleThrow(root, thrownValue$177); @@ -11642,11 +11602,11 @@ function renderRootSync(root, lanes) { executionContext = prevExecutionContext; ReactSharedInternals.H = prevDispatcher; ReactSharedInternals.A = prevAsyncDispatcher; - if (null !== workInProgress) throw Error(formatProdErrorMessage(261)); - workInProgressRoot = null; - workInProgressRootRenderLanes = 0; - finishQueueingConcurrentUpdates(); - return workInProgressRootExitStatus; + null === workInProgress && + ((workInProgressRoot = null), + (workInProgressRootRenderLanes = 0), + finishQueueingConcurrentUpdates()); + return memoizedUpdaters; } function workLoopSync() { for (; null !== workInProgress; ) performUnitOfWork(workInProgress); @@ -11667,7 +11627,7 @@ function renderRootConcurrent(root, lanes) { workInProgressTransitions = null; workInProgressRootRenderTargetTime = now$1() + 500; prepareFreshStack(root, lanes); - } + } else checkIfRootIsPrerendering(root, lanes); a: do try { if (0 !== workInProgressSuspendedReason && null !== workInProgress) @@ -11926,7 +11886,10 @@ function commitRoot( didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes + suspendedRetryLanes, + suspendedCommitReason, + completedRenderStartTime, + completedRenderEndTime ) { var prevTransition = ReactSharedInternals.T, previousUpdateLanePriority = ReactDOMSharedInternals.p; @@ -11941,13 +11904,15 @@ function commitRoot( previousUpdateLanePriority, spawnedLane, updatedLanes, - suspendedRetryLanes + suspendedRetryLanes, + suspendedCommitReason, + completedRenderStartTime, + completedRenderEndTime ); } finally { (ReactSharedInternals.T = prevTransition), (ReactDOMSharedInternals.p = previousUpdateLanePriority); } - return null; } function commitRootImpl( root, @@ -11957,97 +11922,106 @@ function commitRootImpl( renderPriorityLevel, spawnedLane, updatedLanes, - suspendedRetryLanes + suspendedRetryLanes, + suspendedCommitReason, + completedRenderStartTime, + completedRenderEndTime ) { do flushPassiveEffects(); while (null !== rootWithPendingPassiveEffects); if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(327)); - var finishedWork = root.finishedWork, - lanes = root.finishedLanes; - if (null === finishedWork) return null; + suspendedRetryLanes = root.finishedWork; + updatedLanes = root.finishedLanes; + reusableComponentDevToolDetails.track = + getGroupNameOfHighestPriorityLane(updatedLanes); + logRenderPhase(completedRenderStartTime, completedRenderEndTime); + if (null === suspendedRetryLanes) return null; root.finishedWork = null; root.finishedLanes = 0; - if (finishedWork === root.current) throw Error(formatProdErrorMessage(177)); + if (suspendedRetryLanes === root.current) + throw Error(formatProdErrorMessage(177)); root.callbackNode = null; root.callbackPriority = 0; root.cancelPendingCommit = null; - var remainingLanes = finishedWork.lanes | finishedWork.childLanes; - remainingLanes |= concurrentlyUpdatedLanes; - markRootFinished( - root, - lanes, - remainingLanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes - ); + completedRenderStartTime = + suspendedRetryLanes.lanes | suspendedRetryLanes.childLanes; + completedRenderStartTime |= concurrentlyUpdatedLanes; + markRootFinished(root, updatedLanes, completedRenderStartTime, spawnedLane); didIncludeCommitPhaseUpdate = !1; root === workInProgressRoot && ((workInProgress = workInProgressRoot = null), (workInProgressRootRenderLanes = 0)); - (0 === finishedWork.actualDuration && - 0 === (finishedWork.subtreeFlags & 10256) && - 0 === (finishedWork.flags & 10256)) || + (0 === suspendedRetryLanes.actualDuration && + 0 === (suspendedRetryLanes.subtreeFlags & 10256) && + 0 === (suspendedRetryLanes.flags & 10256)) || rootDoesHavePassiveEffects || ((rootDoesHavePassiveEffects = !0), - (pendingPassiveEffectsRemainingLanes = remainingLanes), + (pendingPassiveEffectsRemainingLanes = completedRenderStartTime), + (pendingPassiveEffectsRenderEndTime = completedRenderEndTime), (pendingPassiveTransitions = transitions), scheduleCallback$1(NormalPriority$1, function () { - flushPassiveEffects(); + flushPassiveEffects(!0); return null; })); - transitions = 0 !== (finishedWork.flags & 15990); - 0 !== (finishedWork.subtreeFlags & 15990) || transitions + commitStartTime = now(); + 1 === suspendedCommitReason + ? logSuspendedCommitPhase(completedRenderEndTime, commitStartTime) + : 2 === suspendedCommitReason && + logSuspenseThrottlePhase(completedRenderEndTime, commitStartTime); + transitions = 0 !== (suspendedRetryLanes.flags & 15990); + 0 !== (suspendedRetryLanes.subtreeFlags & 15990) || transitions ? ((transitions = ReactSharedInternals.T), (ReactSharedInternals.T = null), (spawnedLane = ReactDOMSharedInternals.p), (ReactDOMSharedInternals.p = 2), - (updatedLanes = executionContext), + (suspendedCommitReason = executionContext), (executionContext |= 4), - commitBeforeMutationEffects(root, finishedWork), - (commitTime = now()), - commitMutationEffects(root, finishedWork, lanes), + commitBeforeMutationEffects(root, suspendedRetryLanes), + commitMutationEffects(root, suspendedRetryLanes, updatedLanes), restoreSelection(selectionInformation, root.containerInfo), (_enabled = !!eventsEnabled), (selectionInformation = eventsEnabled = null), - (root.current = finishedWork), - commitLayoutEffects(finishedWork, root, lanes), + (root.current = suspendedRetryLanes), + commitLayoutEffects(suspendedRetryLanes, root, updatedLanes), requestPaint(), - (executionContext = updatedLanes), + (executionContext = suspendedCommitReason), (ReactDOMSharedInternals.p = spawnedLane), (ReactSharedInternals.T = transitions)) - : ((root.current = finishedWork), (commitTime = now())); + : (root.current = suspendedRetryLanes); + commitEndTime = now(); + logCommitPhase(commitStartTime, commitEndTime); (transitions = rootDoesHavePassiveEffects) ? ((rootDoesHavePassiveEffects = !1), (rootWithPendingPassiveEffects = root), - (pendingPassiveEffectsLanes = lanes)) - : releaseRootPooledCache(root, remainingLanes); - remainingLanes = root.pendingLanes; - 0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null); - onCommitRoot(finishedWork.stateNode, renderPriorityLevel); + (pendingPassiveEffectsLanes = updatedLanes)) + : releaseRootPooledCache(root, completedRenderStartTime); + completedRenderStartTime = root.pendingLanes; + 0 === completedRenderStartTime && + (legacyErrorBoundariesThatAlreadyFailed = null); + onCommitRoot(suspendedRetryLanes.stateNode, renderPriorityLevel); isDevToolsPresent && root.memoizedUpdaters.clear(); ensureRootIsScheduled(root); if (null !== recoverableErrors) for ( - renderPriorityLevel = root.onRecoverableError, finishedWork = 0; - finishedWork < recoverableErrors.length; - finishedWork++ + renderPriorityLevel = root.onRecoverableError, suspendedRetryLanes = 0; + suspendedRetryLanes < recoverableErrors.length; + suspendedRetryLanes++ ) - (remainingLanes = recoverableErrors[finishedWork]), - renderPriorityLevel(remainingLanes.value, { - componentStack: remainingLanes.stack + (completedRenderStartTime = recoverableErrors[suspendedRetryLanes]), + renderPriorityLevel(completedRenderStartTime.value, { + componentStack: completedRenderStartTime.stack }); 0 !== (pendingPassiveEffectsLanes & 3) && flushPassiveEffects(); - remainingLanes = root.pendingLanes; + completedRenderStartTime = root.pendingLanes; didIncludeRenderPhaseUpdate || didIncludeCommitPhaseUpdate || - (0 !== (lanes & 4194218) && 0 !== (remainingLanes & 42)) + (0 !== (updatedLanes & 4194218) && 0 !== (completedRenderStartTime & 42)) ? ((nestedUpdateScheduled = !0), root === rootWithNestedUpdates ? nestedUpdateCount++ : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root))) : (nestedUpdateCount = 0); - transitions || finalizeRender(lanes, now$1()); + transitions || finalizeRender(updatedLanes, now$1()); flushSyncWorkAcrossRoots_impl(0, !1); return null; } @@ -12057,7 +12031,7 @@ function releaseRootPooledCache(root, remainingLanes) { null != remainingLanes && ((root.pooledCache = null), releaseCache(remainingLanes))); } -function flushPassiveEffects() { +function flushPassiveEffects(wasDelayedCommit) { if (null !== rootWithPendingPassiveEffects) { var root$183 = rootWithPendingPassiveEffects, remainingLanes = pendingPassiveEffectsRemainingLanes; @@ -12071,49 +12045,62 @@ function flushPassiveEffects() { if (null === rootWithPendingPassiveEffects) var JSCompiler_inline_result = !1; else { - renderPriority = pendingPassiveTransitions; + var transitions = pendingPassiveTransitions; pendingPassiveTransitions = null; - var root = rootWithPendingPassiveEffects, - lanes = pendingPassiveEffectsLanes; + renderPriority = rootWithPendingPassiveEffects; + var lanes = pendingPassiveEffectsLanes; rootWithPendingPassiveEffects = null; pendingPassiveEffectsLanes = 0; if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(331)); reusableComponentDevToolDetails.track = - lanes & 63 - ? "Blocking" - : lanes & 4194240 - ? "Transition" - : lanes & 62914560 - ? "Suspense" - : lanes & 2080374784 - ? "Idle" - : "Other"; - var prevExecutionContext = executionContext; + getGroupNameOfHighestPriorityLane(lanes); + var passiveEffectStartTime = 0; + passiveEffectStartTime = now$1(); + var startTime = commitEndTime, + endTime = passiveEffectStartTime; + supportsUserTiming && + ((reusableComponentDevToolDetails.color = "secondary-light"), + (reusableComponentOptions.start = startTime), + (reusableComponentOptions.end = endTime), + performance.measure("Waiting for Paint", reusableComponentOptions)); + startTime = executionContext; executionContext |= 4; - var finishedWork = root.current; + var finishedWork = renderPriority.current; resetComponentEffectTimers(); commitPassiveUnmountOnFiber(finishedWork); - var finishedWork$jscomp$0 = root.current; + var finishedWork$jscomp$0 = renderPriority.current; + finishedWork = pendingPassiveEffectsRenderEndTime; resetComponentEffectTimers(); commitPassiveMountOnFiber( - root, + renderPriority, finishedWork$jscomp$0, lanes, - renderPriority, - completeTime + transitions, + finishedWork ); - executionContext = prevExecutionContext; - finalizeRender(lanes, now$1()); + executionContext = startTime; + var passiveEffectsEndTime = now$1(); + wasDelayedCommit && + ((wasDelayedCommit = passiveEffectStartTime), + supportsUserTiming && + ((reusableComponentDevToolDetails.color = "secondary-dark"), + (reusableComponentOptions.start = wasDelayedCommit), + (reusableComponentOptions.end = passiveEffectsEndTime), + performance.measure( + "Remaining Effects", + reusableComponentOptions + ))); + finalizeRender(lanes, passiveEffectsEndTime); flushSyncWorkAcrossRoots_impl(0, !1); if ( injectedHook && "function" === typeof injectedHook.onPostCommitFiberRoot ) try { - injectedHook.onPostCommitFiberRoot(rendererID, root); + injectedHook.onPostCommitFiberRoot(rendererID, renderPriority); } catch (err) {} - var stateNode = root.current.stateNode; + var stateNode = renderPriority.current.stateNode; stateNode.effectDuration = 0; stateNode.passiveEffectDuration = 0; JSCompiler_inline_result = !0; @@ -12246,7 +12233,7 @@ function resolveRetryWakeable(boundaryFiber, wakeable) { retryTimedOutBoundary(boundaryFiber, retryLane); } function throwIfInfiniteUpdateLoopDetected() { - if (50 < nestedUpdateCount) + if (100 < nestedUpdateCount) throw ( ((nestedUpdateCount = 0), (rootWithNestedUpdates = null), @@ -12316,7 +12303,8 @@ function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) { root$185, root$185 === workInProgressRoot ? JSCompiler_inline_result : 0 )), - 0 !== (JSCompiler_inline_result & 3) && + 0 === (JSCompiler_inline_result & 3) || + checkIfRootIsPrerendering(root$185, JSCompiler_inline_result) || ((didPerformSomeWork = !0), performSyncWorkOnRoot(root$185, JSCompiler_inline_result)); root$185 = root$185.next; @@ -12360,12 +12348,12 @@ function scheduleTaskForRootDuringMicrotask(root, currentTime) { 0 < lanes; ) { - var index$5 = 31 - clz32(lanes), - lane = 1 << index$5, - expirationTime = expirationTimes[index$5]; + var index$4 = 31 - clz32(lanes), + lane = 1 << index$4, + expirationTime = expirationTimes[index$4]; if (-1 === expirationTime) { if (0 === (lane & suspendedLanes) || 0 !== (lane & pingedLanes)) - expirationTimes[index$5] = computeExpirationTime(lane, currentTime); + expirationTimes[index$4] = computeExpirationTime(lane, currentTime); } else expirationTime <= currentTime && (root.expiredLanes |= lane); lanes &= ~lane; } @@ -12402,8 +12390,6 @@ function scheduleTaskForRootDuringMicrotask(root, currentTime) { null !== pingedLanes && cancelCallback$1(pingedLanes); switch (lanesToEventPriority(suspendedLanes)) { case 2: - suspendedLanes = ImmediatePriority; - break; case 8: suspendedLanes = UserBlockingPriority; break; @@ -12416,12 +12402,35 @@ function scheduleTaskForRootDuringMicrotask(root, currentTime) { default: suspendedLanes = NormalPriority$1; } - pingedLanes = performConcurrentWorkOnRoot.bind(null, root); + pingedLanes = performWorkOnRootViaSchedulerTask.bind(null, root); suspendedLanes = scheduleCallback$3(suspendedLanes, pingedLanes); root.callbackPriority = currentTime; root.callbackNode = suspendedLanes; return currentTime; } +function performWorkOnRootViaSchedulerTask(root, didTimeout) { + nestedUpdateScheduled = currentUpdateIsNested = !1; + var originalCallbackNode = root.callbackNode; + if (flushPassiveEffects() && root.callbackNode !== originalCallbackNode) + return null; + var workInProgressRootRenderLanes$jscomp$0 = workInProgressRootRenderLanes; + workInProgressRootRenderLanes$jscomp$0 = getNextLanes( + root, + root === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0 + ); + if (0 === workInProgressRootRenderLanes$jscomp$0) return null; + performWorkOnRoot(root, workInProgressRootRenderLanes$jscomp$0, didTimeout); + scheduleTaskForRootDuringMicrotask(root, now$1()); + return root.callbackNode === originalCallbackNode + ? performWorkOnRootViaSchedulerTask.bind(null, root) + : null; +} +function performSyncWorkOnRoot(root, lanes) { + if (flushPassiveEffects()) return null; + currentUpdateIsNested = nestedUpdateScheduled; + nestedUpdateScheduled = !1; + performWorkOnRoot(root, lanes, !0); +} function scheduleImmediateTask(cb) { scheduleMicrotask(function () { 0 !== (executionContext & 6) @@ -12529,20 +12538,20 @@ function extractEvents$1( } } for ( - var i$jscomp$inline_1476 = 0; - i$jscomp$inline_1476 < simpleEventPluginEvents.length; - i$jscomp$inline_1476++ + var i$jscomp$inline_1483 = 0; + i$jscomp$inline_1483 < simpleEventPluginEvents.length; + i$jscomp$inline_1483++ ) { - var eventName$jscomp$inline_1477 = - simpleEventPluginEvents[i$jscomp$inline_1476], - domEventName$jscomp$inline_1478 = - eventName$jscomp$inline_1477.toLowerCase(), - capitalizedEvent$jscomp$inline_1479 = - eventName$jscomp$inline_1477[0].toUpperCase() + - eventName$jscomp$inline_1477.slice(1); + var eventName$jscomp$inline_1484 = + simpleEventPluginEvents[i$jscomp$inline_1483], + domEventName$jscomp$inline_1485 = + eventName$jscomp$inline_1484.toLowerCase(), + capitalizedEvent$jscomp$inline_1486 = + eventName$jscomp$inline_1484[0].toUpperCase() + + eventName$jscomp$inline_1484.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1478, - "on" + capitalizedEvent$jscomp$inline_1479 + domEventName$jscomp$inline_1485, + "on" + capitalizedEvent$jscomp$inline_1486 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -16008,16 +16017,16 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) { 0 === i && attemptExplicitHydrationTarget(target); } }; -var isomorphicReactPackageVersion$jscomp$inline_1723 = React.version; +var isomorphicReactPackageVersion$jscomp$inline_1730 = React.version; if ( - "19.0.0-experimental-5d19e1c8-20240923" !== - isomorphicReactPackageVersion$jscomp$inline_1723 + "19.0.0-experimental-778e1ed2-20240926" !== + isomorphicReactPackageVersion$jscomp$inline_1730 ) throw Error( formatProdErrorMessage( 527, - isomorphicReactPackageVersion$jscomp$inline_1723, - "19.0.0-experimental-5d19e1c8-20240923" + isomorphicReactPackageVersion$jscomp$inline_1730, + "19.0.0-experimental-778e1ed2-20240926" ) ); ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { @@ -16037,25 +16046,25 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { null === componentOrElement ? null : componentOrElement.stateNode; return componentOrElement; }; -var internals$jscomp$inline_2148 = { +var internals$jscomp$inline_2168 = { bundleType: 0, - version: "19.0.0-experimental-5d19e1c8-20240923", + version: "19.0.0-experimental-778e1ed2-20240926", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, findFiberByHostInstance: getClosestInstanceFromNode, - reconcilerVersion: "19.0.0-experimental-5d19e1c8-20240923" + reconcilerVersion: "19.0.0-experimental-778e1ed2-20240926" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_2149 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_2169 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_2149.isDisabled && - hook$jscomp$inline_2149.supportsFiber + !hook$jscomp$inline_2169.isDisabled && + hook$jscomp$inline_2169.supportsFiber ) try { - (rendererID = hook$jscomp$inline_2149.inject( - internals$jscomp$inline_2148 + (rendererID = hook$jscomp$inline_2169.inject( + internals$jscomp$inline_2168 )), - (injectedHook = hook$jscomp$inline_2149); + (injectedHook = hook$jscomp$inline_2169); } catch (err) {} } function noop() {} @@ -16308,7 +16317,7 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactSharedInternals.H.useHostTransitionStatus(); }; -exports.version = "19.0.0-experimental-5d19e1c8-20240923"; +exports.version = "19.0.0-experimental-778e1ed2-20240926"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.development.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.development.js index c0b38c953bd05..562d59ee0057a 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.development.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.development.js @@ -9288,5 +9288,5 @@ 'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server' ); }; - exports.version = "19.0.0-experimental-5d19e1c8-20240923"; + exports.version = "19.0.0-experimental-778e1ed2-20240926"; })(); diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.production.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.production.js index bb2264c70d295..98b84f55a14ac 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.production.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.browser.production.js @@ -6055,4 +6055,4 @@ exports.renderToString = function (children, options) { 'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server' ); }; -exports.version = "19.0.0-experimental-5d19e1c8-20240923"; +exports.version = "19.0.0-experimental-778e1ed2-20240926"; diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.node.development.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.node.development.js index ef98ea7aa1b29..cc0490e454880 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.node.development.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.node.development.js @@ -9288,5 +9288,5 @@ 'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToPipeableStream" which supports Suspense on the server' ); }; - exports.version = "19.0.0-experimental-5d19e1c8-20240923"; + exports.version = "19.0.0-experimental-778e1ed2-20240926"; })(); diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.node.production.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.node.production.js index 6843b129d9878..2d6dddc380de5 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.node.production.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server-legacy.node.production.js @@ -6147,4 +6147,4 @@ exports.renderToString = function (children, options) { 'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToPipeableStream" which supports Suspense on the server' ); }; -exports.version = "19.0.0-experimental-5d19e1c8-20240923"; +exports.version = "19.0.0-experimental-778e1ed2-20240926"; diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.browser.development.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.browser.development.js index 78e0dbd6ba74a..a01cb7b1fe898 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.browser.development.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.browser.development.js @@ -8188,11 +8188,11 @@ } function ensureCorrectIsomorphicReactVersion() { var isomorphicReactPackageVersion = React.version; - if ("19.0.0-experimental-5d19e1c8-20240923" !== isomorphicReactPackageVersion) + if ("19.0.0-experimental-778e1ed2-20240926" !== isomorphicReactPackageVersion) throw Error( 'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion + - "\n - react-dom: 19.0.0-experimental-5d19e1c8-20240923\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.0.0-experimental-778e1ed2-20240926\nLearn more: https://react.dev/warnings/version-mismatch") ); } var React = require("next/dist/compiled/react-experimental"), @@ -9972,5 +9972,5 @@ startWork(request); }); }; - exports.version = "19.0.0-experimental-5d19e1c8-20240923"; + exports.version = "19.0.0-experimental-778e1ed2-20240926"; })(); diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.browser.production.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.browser.production.js index f756ba4186d75..80f1706fca236 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.browser.production.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.browser.production.js @@ -6586,12 +6586,12 @@ function getPostponedState(request) { } function ensureCorrectIsomorphicReactVersion() { var isomorphicReactPackageVersion = React.version; - if ("19.0.0-experimental-5d19e1c8-20240923" !== isomorphicReactPackageVersion) + if ("19.0.0-experimental-778e1ed2-20240926" !== isomorphicReactPackageVersion) throw Error( formatProdErrorMessage( 527, isomorphicReactPackageVersion, - "19.0.0-experimental-5d19e1c8-20240923" + "19.0.0-experimental-778e1ed2-20240926" ) ); } @@ -6846,4 +6846,4 @@ exports.resumeAndPrerender = function (children, postponedState, options) { startWork(request); }); }; -exports.version = "19.0.0-experimental-5d19e1c8-20240923"; +exports.version = "19.0.0-experimental-778e1ed2-20240926"; diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.bun.production.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.bun.production.js index 790c63185fc7a..b290d7858af7c 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.bun.production.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.bun.production.js @@ -6068,13 +6068,13 @@ function addToReplayParent(node, parentKeyPath, trackedPostpones) { } var isomorphicReactPackageVersion$jscomp$inline_782 = React.version; if ( - "19.0.0-experimental-5d19e1c8-20240923" !== + "19.0.0-experimental-778e1ed2-20240926" !== isomorphicReactPackageVersion$jscomp$inline_782 ) throw Error( 'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion$jscomp$inline_782 + - "\n - react-dom: 19.0.0-experimental-5d19e1c8-20240923\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.0.0-experimental-778e1ed2-20240926\nLearn more: https://react.dev/warnings/version-mismatch") ); exports.renderToReadableStream = function (children, options) { return new Promise(function (resolve, reject) { @@ -6162,4 +6162,4 @@ exports.renderToReadableStream = function (children, options) { startWork(request); }); }; -exports.version = "19.0.0-experimental-5d19e1c8-20240923"; +exports.version = "19.0.0-experimental-778e1ed2-20240926"; diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.edge.development.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.edge.development.js index 51aec86d7759e..471cac0c99ce5 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.edge.development.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.edge.development.js @@ -8211,11 +8211,11 @@ } function ensureCorrectIsomorphicReactVersion() { var isomorphicReactPackageVersion = React.version; - if ("19.0.0-experimental-5d19e1c8-20240923" !== isomorphicReactPackageVersion) + if ("19.0.0-experimental-778e1ed2-20240926" !== isomorphicReactPackageVersion) throw Error( 'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion + - "\n - react-dom: 19.0.0-experimental-5d19e1c8-20240923\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.0.0-experimental-778e1ed2-20240926\nLearn more: https://react.dev/warnings/version-mismatch") ); } var React = require("next/dist/compiled/react-experimental"), @@ -10002,5 +10002,5 @@ const setTimeoutOrImmediate = ? globalThis['set' + 'Immediate'] : setTimeout; - exports.version = "19.0.0-experimental-5d19e1c8-20240923"; + exports.version = "19.0.0-experimental-778e1ed2-20240926"; })(); diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.edge.production.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.edge.production.js index f3c1b252891b5..d336bfbd9385b 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.edge.production.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.edge.production.js @@ -6694,11 +6694,11 @@ function getPostponedState(request) { } function ensureCorrectIsomorphicReactVersion() { var isomorphicReactPackageVersion = React.version; - if ("19.0.0-experimental-5d19e1c8-20240923" !== isomorphicReactPackageVersion) + if ("19.0.0-experimental-778e1ed2-20240926" !== isomorphicReactPackageVersion) throw Error( 'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion + - "\n - react-dom: 19.0.0-experimental-5d19e1c8-20240923\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.0.0-experimental-778e1ed2-20240926\nLearn more: https://react.dev/warnings/version-mismatch") ); } ensureCorrectIsomorphicReactVersion(); @@ -6963,4 +6963,4 @@ const setTimeoutOrImmediate = ? globalThis['set' + 'Immediate'] : setTimeout; -exports.version = "19.0.0-experimental-5d19e1c8-20240923"; +exports.version = "19.0.0-experimental-778e1ed2-20240926"; diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.node.development.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.node.development.js index 9daa9118394d6..6f9d6cbf5089a 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.node.development.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.node.development.js @@ -8069,11 +8069,11 @@ } function ensureCorrectIsomorphicReactVersion() { var isomorphicReactPackageVersion = React.version; - if ("19.0.0-experimental-5d19e1c8-20240923" !== isomorphicReactPackageVersion) + if ("19.0.0-experimental-778e1ed2-20240926" !== isomorphicReactPackageVersion) throw Error( 'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion + - "\n - react-dom: 19.0.0-experimental-5d19e1c8-20240923\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.0.0-experimental-778e1ed2-20240926\nLearn more: https://react.dev/warnings/version-mismatch") ); } function createDrainHandler(destination, request) { @@ -9846,5 +9846,5 @@ } }; }; - exports.version = "19.0.0-experimental-5d19e1c8-20240923"; + exports.version = "19.0.0-experimental-778e1ed2-20240926"; })(); diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.node.production.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.node.production.js index fc4a50306f9a0..4717018bbedfa 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.node.production.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.node.production.js @@ -6567,11 +6567,11 @@ function getPostponedState(request) { } function ensureCorrectIsomorphicReactVersion() { var isomorphicReactPackageVersion = React.version; - if ("19.0.0-experimental-5d19e1c8-20240923" !== isomorphicReactPackageVersion) + if ("19.0.0-experimental-778e1ed2-20240926" !== isomorphicReactPackageVersion) throw Error( 'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion + - "\n - react-dom: 19.0.0-experimental-5d19e1c8-20240923\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.0.0-experimental-778e1ed2-20240926\nLearn more: https://react.dev/warnings/version-mismatch") ); } ensureCorrectIsomorphicReactVersion(); @@ -6822,4 +6822,4 @@ exports.resumeToPipeableStream = function (children, postponedState, options) { } }; }; -exports.version = "19.0.0-experimental-5d19e1c8-20240923"; +exports.version = "19.0.0-experimental-778e1ed2-20240926"; diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-unstable_testing.development.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-unstable_testing.development.js index a4c8003012743..188a08bb6fa7d 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-unstable_testing.development.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-unstable_testing.development.js @@ -1031,43 +1031,39 @@ var pendingLanes = root.pendingLanes; if (0 === pendingLanes) return 0; var nextLanes = 0, - suspendedLanes = root.suspendedLanes, - pingedLanes = root.pingedLanes, - warmLanes = root.warmLanes; - root = 0 !== root.finishedLanes; + suspendedLanes = root.suspendedLanes; + root = root.pingedLanes; var nonIdlePendingLanes = pendingLanes & 134217727; 0 !== nonIdlePendingLanes ? ((pendingLanes = nonIdlePendingLanes & ~suspendedLanes), 0 !== pendingLanes ? (nextLanes = getHighestPriorityLanes(pendingLanes)) - : ((pingedLanes &= nonIdlePendingLanes), - 0 !== pingedLanes - ? (nextLanes = getHighestPriorityLanes(pingedLanes)) - : root || - ((warmLanes = nonIdlePendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes))))) - : ((nonIdlePendingLanes = pendingLanes & ~suspendedLanes), - 0 !== nonIdlePendingLanes - ? (nextLanes = getHighestPriorityLanes(nonIdlePendingLanes)) - : 0 !== pingedLanes - ? (nextLanes = getHighestPriorityLanes(pingedLanes)) - : root || - ((warmLanes = pendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes)))); + : ((root &= nonIdlePendingLanes), + 0 !== root && (nextLanes = getHighestPriorityLanes(root)))) + : ((pendingLanes &= ~suspendedLanes), + 0 !== pendingLanes + ? (nextLanes = getHighestPriorityLanes(pendingLanes)) + : 0 !== root && (nextLanes = getHighestPriorityLanes(root))); return 0 === nextLanes ? 0 : 0 !== wipLanes && wipLanes !== nextLanes && 0 === (wipLanes & suspendedLanes) && ((suspendedLanes = nextLanes & -nextLanes), - (warmLanes = wipLanes & -wipLanes), - suspendedLanes >= warmLanes || - (32 === suspendedLanes && 0 !== (warmLanes & 4194176))) + (root = wipLanes & -wipLanes), + suspendedLanes >= root || + (32 === suspendedLanes && 0 !== (root & 4194176))) ? wipLanes : nextLanes; } + function checkIfRootIsPrerendering(root, renderLanes) { + return ( + 0 === + (root.pendingLanes & + ~(root.suspendedLanes & ~root.pingedLanes) & + renderLanes) + ); + } function computeExpirationTime(lane, currentTime) { switch (lane) { case 1: @@ -1114,14 +1110,6 @@ ); } } - function getLanesToRetrySynchronouslyOnError( - root, - originallyAttemptedLanes - ) { - if (root.errorRecoveryDisabledLanes & originallyAttemptedLanes) return 0; - root = root.pendingLanes & -536870913; - return 0 !== root ? root : root & 536870912 ? 536870912 : 0; - } function claimNextTransitionLane() { var lane = nextTransitionLane; nextTransitionLane <<= 1; @@ -1142,9 +1130,7 @@ root, finishedLanes, remainingLanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes + spawnedLane ) { var previouslyPendingLanes = root.pendingLanes; root.pendingLanes = remainingLanes; @@ -1155,17 +1141,17 @@ root.entangledLanes &= remainingLanes; root.errorRecoveryDisabledLanes &= remainingLanes; root.shellSuspendCounter = 0; - var entanglements = root.entanglements, - expirationTimes = root.expirationTimes, + finishedLanes = root.entanglements; + var expirationTimes = root.expirationTimes, hiddenUpdates = root.hiddenUpdates; for ( remainingLanes = previouslyPendingLanes & ~remainingLanes; 0 < remainingLanes; ) { - var index = 31 - clz32(remainingLanes), - lane = 1 << index; - entanglements[index] = 0; + var index = 31 - clz32(remainingLanes); + previouslyPendingLanes = 1 << index; + finishedLanes[index] = 0; expirationTimes[index] = -1; var hiddenUpdatesForLane = hiddenUpdates[index]; if (null !== hiddenUpdatesForLane) @@ -1177,14 +1163,9 @@ var update = hiddenUpdatesForLane[index]; null !== update && (update.lane &= -536870913); } - remainingLanes &= ~lane; + remainingLanes &= ~previouslyPendingLanes; } 0 !== spawnedLane && markSpawnedDeferredLane(root, spawnedLane, 0); - 0 !== suspendedRetryLanes && - 0 === updatedLanes && - 0 !== root.tag && - (root.suspendedLanes |= - suspendedRetryLanes & ~(previouslyPendingLanes & ~finishedLanes)); } function markSpawnedDeferredLane(root, spawnedLane, entangledLanes) { root.pendingLanes |= spawnedLane; @@ -1236,6 +1217,17 @@ lanes &= ~root; } } + function getGroupNameOfHighestPriorityLane(lanes) { + return lanes & 63 + ? "Blocking" + : lanes & 4194240 + ? "Transition" + : lanes & 62914560 + ? "Suspense" + : lanes & 2080374784 + ? "Idle" + : "Other"; + } function lanesToEventPriority(lanes) { lanes &= -lanes; return 0 !== DiscreteEventPriority && DiscreteEventPriority < lanes @@ -3815,6 +3807,34 @@ (reusableComponentOptions.end = endTime), performance.measure(fiber, reusableComponentOptions)); } + function logRenderPhase(startTime, endTime) { + supportsUserTiming && + ((reusableComponentDevToolDetails.color = "primary-dark"), + (reusableComponentOptions.start = startTime), + (reusableComponentOptions.end = endTime), + performance.measure("Render", reusableComponentOptions)); + } + function logSuspenseThrottlePhase(startTime, endTime) { + supportsUserTiming && + ((reusableComponentDevToolDetails.color = "secondary-light"), + (reusableComponentOptions.start = startTime), + (reusableComponentOptions.end = endTime), + performance.measure("Throttled", reusableComponentOptions)); + } + function logSuspendedCommitPhase(startTime, endTime) { + supportsUserTiming && + ((reusableComponentDevToolDetails.color = "secondary-light"), + (reusableComponentOptions.start = startTime), + (reusableComponentOptions.end = endTime), + performance.measure("Suspended", reusableComponentOptions)); + } + function logCommitPhase(startTime, endTime) { + supportsUserTiming && + ((reusableComponentDevToolDetails.color = "secondary-dark"), + (reusableComponentOptions.start = startTime), + (reusableComponentOptions.end = endTime), + performance.measure("Commit", reusableComponentOptions)); + } function finishQueueingConcurrentUpdates() { for ( var endIndex = concurrentQueuesIndex, @@ -8893,33 +8913,33 @@ return current; } function updateSuspenseComponent(current, workInProgress, renderLanes) { - var JSCompiler_object_inline_componentStack_2296; - var JSCompiler_object_inline_stack_2295 = workInProgress.pendingProps; + var JSCompiler_object_inline_componentStack_2315; + var JSCompiler_object_inline_stack_2314 = workInProgress.pendingProps; shouldSuspendImpl(workInProgress) && (workInProgress.flags |= 128); - var JSCompiler_object_inline_message_2293 = !1; + var JSCompiler_object_inline_message_2312 = !1; var didSuspend = 0 !== (workInProgress.flags & 128); - (JSCompiler_object_inline_componentStack_2296 = didSuspend) || - (JSCompiler_object_inline_componentStack_2296 = + (JSCompiler_object_inline_componentStack_2315 = didSuspend) || + (JSCompiler_object_inline_componentStack_2315 = null !== current && null === current.memoizedState ? !1 : 0 !== (suspenseStackCursor.current & ForceSuspenseFallback)); - JSCompiler_object_inline_componentStack_2296 && - ((JSCompiler_object_inline_message_2293 = !0), + JSCompiler_object_inline_componentStack_2315 && + ((JSCompiler_object_inline_message_2312 = !0), (workInProgress.flags &= -129)); - JSCompiler_object_inline_componentStack_2296 = + JSCompiler_object_inline_componentStack_2315 = 0 !== (workInProgress.flags & 32); workInProgress.flags &= -33; if (null === current) { if (isHydrating) { - JSCompiler_object_inline_message_2293 + JSCompiler_object_inline_message_2312 ? pushPrimaryTreeSuspenseHandler(workInProgress) : reuseSuspenseHandlerOnStack(workInProgress); if (isHydrating) { - var JSCompiler_object_inline_digest_2294 = nextHydratableInstance; + var JSCompiler_object_inline_digest_2313 = nextHydratableInstance; var JSCompiler_temp; - if (!(JSCompiler_temp = !JSCompiler_object_inline_digest_2294)) { + if (!(JSCompiler_temp = !JSCompiler_object_inline_digest_2313)) { c: { - var instance = JSCompiler_object_inline_digest_2294; + var instance = JSCompiler_object_inline_digest_2313; for ( JSCompiler_temp = rootOrSingletonContext; 8 !== instance.nodeType; @@ -8960,19 +8980,19 @@ JSCompiler_temp && (warnNonHydratedInstance( workInProgress, - JSCompiler_object_inline_digest_2294 + JSCompiler_object_inline_digest_2313 ), throwOnHydrationMismatch(workInProgress)); } - JSCompiler_object_inline_digest_2294 = workInProgress.memoizedState; + JSCompiler_object_inline_digest_2313 = workInProgress.memoizedState; if ( - null !== JSCompiler_object_inline_digest_2294 && - ((JSCompiler_object_inline_digest_2294 = - JSCompiler_object_inline_digest_2294.dehydrated), - null !== JSCompiler_object_inline_digest_2294) + null !== JSCompiler_object_inline_digest_2313 && + ((JSCompiler_object_inline_digest_2313 = + JSCompiler_object_inline_digest_2313.dehydrated), + null !== JSCompiler_object_inline_digest_2313) ) return ( - JSCompiler_object_inline_digest_2294.data === + JSCompiler_object_inline_digest_2313.data === SUSPENSE_FALLBACK_START_DATA ? (workInProgress.lanes = 16) : (workInProgress.lanes = 536870912), @@ -8980,68 +9000,68 @@ ); popSuspenseHandler(workInProgress); } - JSCompiler_object_inline_digest_2294 = - JSCompiler_object_inline_stack_2295.children; - JSCompiler_temp = JSCompiler_object_inline_stack_2295.fallback; - if (JSCompiler_object_inline_message_2293) + JSCompiler_object_inline_digest_2313 = + JSCompiler_object_inline_stack_2314.children; + JSCompiler_temp = JSCompiler_object_inline_stack_2314.fallback; + if (JSCompiler_object_inline_message_2312) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2295 = + (JSCompiler_object_inline_stack_2314 = mountSuspenseFallbackChildren( workInProgress, - JSCompiler_object_inline_digest_2294, + JSCompiler_object_inline_digest_2313, JSCompiler_temp, renderLanes )), - (JSCompiler_object_inline_message_2293 = workInProgress.child), - (JSCompiler_object_inline_message_2293.memoizedState = + (JSCompiler_object_inline_message_2312 = workInProgress.child), + (JSCompiler_object_inline_message_2312.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_message_2293.childLanes = + (JSCompiler_object_inline_message_2312.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_componentStack_2296, + JSCompiler_object_inline_componentStack_2315, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2295 + JSCompiler_object_inline_stack_2314 ); if ( "number" === - typeof JSCompiler_object_inline_stack_2295.unstable_expectedLoadTime + typeof JSCompiler_object_inline_stack_2314.unstable_expectedLoadTime ) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_stack_2295 = + (JSCompiler_object_inline_stack_2314 = mountSuspenseFallbackChildren( workInProgress, - JSCompiler_object_inline_digest_2294, + JSCompiler_object_inline_digest_2313, JSCompiler_temp, renderLanes )), - (JSCompiler_object_inline_message_2293 = workInProgress.child), - (JSCompiler_object_inline_message_2293.memoizedState = + (JSCompiler_object_inline_message_2312 = workInProgress.child), + (JSCompiler_object_inline_message_2312.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_message_2293.childLanes = + (JSCompiler_object_inline_message_2312.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_componentStack_2296, + JSCompiler_object_inline_componentStack_2315, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), (workInProgress.lanes = 4194304), - JSCompiler_object_inline_stack_2295 + JSCompiler_object_inline_stack_2314 ); pushPrimaryTreeSuspenseHandler(workInProgress); return mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_digest_2294 + JSCompiler_object_inline_digest_2313 ); } var prevState = current.memoizedState; if ( null !== prevState && - ((JSCompiler_object_inline_digest_2294 = prevState.dehydrated), - null !== JSCompiler_object_inline_digest_2294) + ((JSCompiler_object_inline_digest_2313 = prevState.dehydrated), + null !== JSCompiler_object_inline_digest_2313) ) { if (didSuspend) workInProgress.flags & 256 @@ -9058,94 +9078,94 @@ (workInProgress.flags |= 128), (workInProgress = null)) : (reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_message_2293 = - JSCompiler_object_inline_stack_2295.fallback), - (JSCompiler_object_inline_digest_2294 = workInProgress.mode), - (JSCompiler_object_inline_stack_2295 = + (JSCompiler_object_inline_message_2312 = + JSCompiler_object_inline_stack_2314.fallback), + (JSCompiler_object_inline_digest_2313 = workInProgress.mode), + (JSCompiler_object_inline_stack_2314 = mountWorkInProgressOffscreenFiber( { mode: "visible", - children: JSCompiler_object_inline_stack_2295.children + children: JSCompiler_object_inline_stack_2314.children }, - JSCompiler_object_inline_digest_2294 + JSCompiler_object_inline_digest_2313 )), - (JSCompiler_object_inline_message_2293 = + (JSCompiler_object_inline_message_2312 = createFiberFromFragment( - JSCompiler_object_inline_message_2293, - JSCompiler_object_inline_digest_2294, + JSCompiler_object_inline_message_2312, + JSCompiler_object_inline_digest_2313, renderLanes, null )), - (JSCompiler_object_inline_message_2293.flags |= 2), - (JSCompiler_object_inline_stack_2295.return = workInProgress), - (JSCompiler_object_inline_message_2293.return = workInProgress), - (JSCompiler_object_inline_stack_2295.sibling = - JSCompiler_object_inline_message_2293), - (workInProgress.child = JSCompiler_object_inline_stack_2295), + (JSCompiler_object_inline_message_2312.flags |= 2), + (JSCompiler_object_inline_stack_2314.return = workInProgress), + (JSCompiler_object_inline_message_2312.return = workInProgress), + (JSCompiler_object_inline_stack_2314.sibling = + JSCompiler_object_inline_message_2312), + (workInProgress.child = JSCompiler_object_inline_stack_2314), reconcileChildFibers( workInProgress, current.child, null, renderLanes ), - (JSCompiler_object_inline_stack_2295 = workInProgress.child), - (JSCompiler_object_inline_stack_2295.memoizedState = + (JSCompiler_object_inline_stack_2314 = workInProgress.child), + (JSCompiler_object_inline_stack_2314.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_stack_2295.childLanes = + (JSCompiler_object_inline_stack_2314.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_componentStack_2296, + JSCompiler_object_inline_componentStack_2315, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - (workInProgress = JSCompiler_object_inline_message_2293)); + (workInProgress = JSCompiler_object_inline_message_2312)); else if ( (pushPrimaryTreeSuspenseHandler(workInProgress), isHydrating && console.error( "We should not be hydrating here. This is a bug in React. Please file a bug." ), - JSCompiler_object_inline_digest_2294.data === + JSCompiler_object_inline_digest_2313.data === SUSPENSE_FALLBACK_START_DATA) ) { - JSCompiler_object_inline_componentStack_2296 = - JSCompiler_object_inline_digest_2294.nextSibling && - JSCompiler_object_inline_digest_2294.nextSibling.dataset; - if (JSCompiler_object_inline_componentStack_2296) { - JSCompiler_temp = JSCompiler_object_inline_componentStack_2296.dgst; - var message = JSCompiler_object_inline_componentStack_2296.msg; - instance = JSCompiler_object_inline_componentStack_2296.stck; + JSCompiler_object_inline_componentStack_2315 = + JSCompiler_object_inline_digest_2313.nextSibling && + JSCompiler_object_inline_digest_2313.nextSibling.dataset; + if (JSCompiler_object_inline_componentStack_2315) { + JSCompiler_temp = JSCompiler_object_inline_componentStack_2315.dgst; + var message = JSCompiler_object_inline_componentStack_2315.msg; + instance = JSCompiler_object_inline_componentStack_2315.stck; var componentStack = - JSCompiler_object_inline_componentStack_2296.cstck; + JSCompiler_object_inline_componentStack_2315.cstck; } - JSCompiler_object_inline_message_2293 = message; - JSCompiler_object_inline_digest_2294 = JSCompiler_temp; - JSCompiler_object_inline_stack_2295 = instance; - JSCompiler_object_inline_componentStack_2296 = componentStack; - "POSTPONE" !== JSCompiler_object_inline_digest_2294 && - ((JSCompiler_object_inline_message_2293 = - JSCompiler_object_inline_message_2293 - ? Error(JSCompiler_object_inline_message_2293) + JSCompiler_object_inline_message_2312 = message; + JSCompiler_object_inline_digest_2313 = JSCompiler_temp; + JSCompiler_object_inline_stack_2314 = instance; + JSCompiler_object_inline_componentStack_2315 = componentStack; + "POSTPONE" !== JSCompiler_object_inline_digest_2313 && + ((JSCompiler_object_inline_message_2312 = + JSCompiler_object_inline_message_2312 + ? Error(JSCompiler_object_inline_message_2312) : Error( "The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering." )), - (JSCompiler_object_inline_message_2293.stack = - JSCompiler_object_inline_stack_2295 || ""), - (JSCompiler_object_inline_message_2293.digest = - JSCompiler_object_inline_digest_2294), - (JSCompiler_object_inline_componentStack_2296 = - void 0 === JSCompiler_object_inline_componentStack_2296 + (JSCompiler_object_inline_message_2312.stack = + JSCompiler_object_inline_stack_2314 || ""), + (JSCompiler_object_inline_message_2312.digest = + JSCompiler_object_inline_digest_2313), + (JSCompiler_object_inline_componentStack_2315 = + void 0 === JSCompiler_object_inline_componentStack_2315 ? null - : JSCompiler_object_inline_componentStack_2296), - "string" === typeof JSCompiler_object_inline_componentStack_2296 && + : JSCompiler_object_inline_componentStack_2315), + "string" === typeof JSCompiler_object_inline_componentStack_2315 && CapturedStacks.set( - JSCompiler_object_inline_message_2293, - JSCompiler_object_inline_componentStack_2296 + JSCompiler_object_inline_message_2312, + JSCompiler_object_inline_componentStack_2315 ), queueHydrationError({ - value: JSCompiler_object_inline_message_2293, + value: JSCompiler_object_inline_message_2312, source: null, - stack: JSCompiler_object_inline_componentStack_2296 + stack: JSCompiler_object_inline_componentStack_2315 })); workInProgress = retrySuspenseComponentWithoutHydrating( current, @@ -9160,25 +9180,25 @@ renderLanes, !1 ), - (JSCompiler_object_inline_componentStack_2296 = + (JSCompiler_object_inline_componentStack_2315 = 0 !== (renderLanes & current.childLanes)), - didReceiveUpdate || JSCompiler_object_inline_componentStack_2296) + didReceiveUpdate || JSCompiler_object_inline_componentStack_2315) ) { - JSCompiler_object_inline_componentStack_2296 = workInProgressRoot; - if (null !== JSCompiler_object_inline_componentStack_2296) { - JSCompiler_object_inline_stack_2295 = renderLanes & -renderLanes; - if (0 !== (JSCompiler_object_inline_stack_2295 & 42)) - JSCompiler_object_inline_stack_2295 = 1; + JSCompiler_object_inline_componentStack_2315 = workInProgressRoot; + if (null !== JSCompiler_object_inline_componentStack_2315) { + JSCompiler_object_inline_stack_2314 = renderLanes & -renderLanes; + if (0 !== (JSCompiler_object_inline_stack_2314 & 42)) + JSCompiler_object_inline_stack_2314 = 1; else - switch (JSCompiler_object_inline_stack_2295) { + switch (JSCompiler_object_inline_stack_2314) { case 2: - JSCompiler_object_inline_stack_2295 = 1; + JSCompiler_object_inline_stack_2314 = 1; break; case 8: - JSCompiler_object_inline_stack_2295 = 4; + JSCompiler_object_inline_stack_2314 = 4; break; case 32: - JSCompiler_object_inline_stack_2295 = 16; + JSCompiler_object_inline_stack_2314 = 16; break; case 128: case 256: @@ -9199,40 +9219,40 @@ case 8388608: case 16777216: case 33554432: - JSCompiler_object_inline_stack_2295 = 64; + JSCompiler_object_inline_stack_2314 = 64; break; case 268435456: - JSCompiler_object_inline_stack_2295 = 134217728; + JSCompiler_object_inline_stack_2314 = 134217728; break; default: - JSCompiler_object_inline_stack_2295 = 0; + JSCompiler_object_inline_stack_2314 = 0; } - JSCompiler_object_inline_stack_2295 = + JSCompiler_object_inline_stack_2314 = 0 !== - (JSCompiler_object_inline_stack_2295 & - (JSCompiler_object_inline_componentStack_2296.suspendedLanes | + (JSCompiler_object_inline_stack_2314 & + (JSCompiler_object_inline_componentStack_2315.suspendedLanes | renderLanes)) ? 0 - : JSCompiler_object_inline_stack_2295; + : JSCompiler_object_inline_stack_2314; if ( - 0 !== JSCompiler_object_inline_stack_2295 && - JSCompiler_object_inline_stack_2295 !== prevState.retryLane + 0 !== JSCompiler_object_inline_stack_2314 && + JSCompiler_object_inline_stack_2314 !== prevState.retryLane ) throw ( - ((prevState.retryLane = JSCompiler_object_inline_stack_2295), + ((prevState.retryLane = JSCompiler_object_inline_stack_2314), enqueueConcurrentRenderForLane( current, - JSCompiler_object_inline_stack_2295 + JSCompiler_object_inline_stack_2314 ), scheduleUpdateOnFiber( - JSCompiler_object_inline_componentStack_2296, + JSCompiler_object_inline_componentStack_2315, current, - JSCompiler_object_inline_stack_2295 + JSCompiler_object_inline_stack_2314 ), SelectiveHydrationException) ); } - JSCompiler_object_inline_digest_2294.data === + JSCompiler_object_inline_digest_2313.data === SUSPENSE_PENDING_START_DATA || renderDidSuspendDelayIfPossible(); workInProgress = retrySuspenseComponentWithoutHydrating( current, @@ -9240,7 +9260,7 @@ renderLanes ); } else - JSCompiler_object_inline_digest_2294.data === + JSCompiler_object_inline_digest_2313.data === SUSPENSE_PENDING_START_DATA ? ((workInProgress.flags |= 128), (workInProgress.child = current.child), @@ -9248,12 +9268,12 @@ null, current )), - (JSCompiler_object_inline_digest_2294._reactRetry = + (JSCompiler_object_inline_digest_2313._reactRetry = workInProgress), (workInProgress = null)) : ((current = prevState.treeContext), (nextHydratableInstance = getNextHydratable( - JSCompiler_object_inline_digest_2294.nextSibling + JSCompiler_object_inline_digest_2313.nextSibling )), (hydrationParentFiber = workInProgress), (isHydrating = !0), @@ -9271,54 +9291,54 @@ (treeContextProvider = workInProgress)), (workInProgress = mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_stack_2295.children + JSCompiler_object_inline_stack_2314.children )), (workInProgress.flags |= 4096)); return workInProgress; } - if (JSCompiler_object_inline_message_2293) + if (JSCompiler_object_inline_message_2312) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_message_2293 = - JSCompiler_object_inline_stack_2295.fallback), - (JSCompiler_object_inline_digest_2294 = workInProgress.mode), + (JSCompiler_object_inline_message_2312 = + JSCompiler_object_inline_stack_2314.fallback), + (JSCompiler_object_inline_digest_2313 = workInProgress.mode), (JSCompiler_temp = current.child), (instance = JSCompiler_temp.sibling), - (JSCompiler_object_inline_stack_2295 = createWorkInProgress( + (JSCompiler_object_inline_stack_2314 = createWorkInProgress( JSCompiler_temp, { mode: "hidden", - children: JSCompiler_object_inline_stack_2295.children + children: JSCompiler_object_inline_stack_2314.children } )), - (JSCompiler_object_inline_stack_2295.subtreeFlags = + (JSCompiler_object_inline_stack_2314.subtreeFlags = JSCompiler_temp.subtreeFlags & 31457280), null !== instance - ? (JSCompiler_object_inline_message_2293 = createWorkInProgress( + ? (JSCompiler_object_inline_message_2312 = createWorkInProgress( instance, - JSCompiler_object_inline_message_2293 + JSCompiler_object_inline_message_2312 )) - : ((JSCompiler_object_inline_message_2293 = createFiberFromFragment( - JSCompiler_object_inline_message_2293, - JSCompiler_object_inline_digest_2294, + : ((JSCompiler_object_inline_message_2312 = createFiberFromFragment( + JSCompiler_object_inline_message_2312, + JSCompiler_object_inline_digest_2313, renderLanes, null )), - (JSCompiler_object_inline_message_2293.flags |= 2)), - (JSCompiler_object_inline_message_2293.return = workInProgress), - (JSCompiler_object_inline_stack_2295.return = workInProgress), - (JSCompiler_object_inline_stack_2295.sibling = - JSCompiler_object_inline_message_2293), - (workInProgress.child = JSCompiler_object_inline_stack_2295), - (JSCompiler_object_inline_stack_2295 = - JSCompiler_object_inline_message_2293), - (JSCompiler_object_inline_message_2293 = workInProgress.child), - (JSCompiler_object_inline_digest_2294 = current.child.memoizedState), - null === JSCompiler_object_inline_digest_2294 - ? (JSCompiler_object_inline_digest_2294 = + (JSCompiler_object_inline_message_2312.flags |= 2)), + (JSCompiler_object_inline_message_2312.return = workInProgress), + (JSCompiler_object_inline_stack_2314.return = workInProgress), + (JSCompiler_object_inline_stack_2314.sibling = + JSCompiler_object_inline_message_2312), + (workInProgress.child = JSCompiler_object_inline_stack_2314), + (JSCompiler_object_inline_stack_2314 = + JSCompiler_object_inline_message_2312), + (JSCompiler_object_inline_message_2312 = workInProgress.child), + (JSCompiler_object_inline_digest_2313 = current.child.memoizedState), + null === JSCompiler_object_inline_digest_2313 + ? (JSCompiler_object_inline_digest_2313 = mountSuspenseOffscreenState(renderLanes)) : ((JSCompiler_temp = - JSCompiler_object_inline_digest_2294.cachePool), + JSCompiler_object_inline_digest_2313.cachePool), null !== JSCompiler_temp ? ((instance = CacheContext._currentValue), (JSCompiler_temp = @@ -9326,38 +9346,38 @@ ? { parent: instance, pool: instance } : JSCompiler_temp)) : (JSCompiler_temp = getSuspendedCache()), - (JSCompiler_object_inline_digest_2294 = { + (JSCompiler_object_inline_digest_2313 = { baseLanes: - JSCompiler_object_inline_digest_2294.baseLanes | renderLanes, + JSCompiler_object_inline_digest_2313.baseLanes | renderLanes, cachePool: JSCompiler_temp })), - (JSCompiler_object_inline_message_2293.memoizedState = - JSCompiler_object_inline_digest_2294), - (JSCompiler_object_inline_message_2293.childLanes = + (JSCompiler_object_inline_message_2312.memoizedState = + JSCompiler_object_inline_digest_2313), + (JSCompiler_object_inline_message_2312.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_componentStack_2296, + JSCompiler_object_inline_componentStack_2315, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2295 + JSCompiler_object_inline_stack_2314 ); pushPrimaryTreeSuspenseHandler(workInProgress); renderLanes = current.child; current = renderLanes.sibling; renderLanes = createWorkInProgress(renderLanes, { mode: "visible", - children: JSCompiler_object_inline_stack_2295.children + children: JSCompiler_object_inline_stack_2314.children }); renderLanes.return = workInProgress; renderLanes.sibling = null; null !== current && - ((JSCompiler_object_inline_componentStack_2296 = + ((JSCompiler_object_inline_componentStack_2315 = workInProgress.deletions), - null === JSCompiler_object_inline_componentStack_2296 + null === JSCompiler_object_inline_componentStack_2315 ? ((workInProgress.deletions = [current]), (workInProgress.flags |= 16)) - : JSCompiler_object_inline_componentStack_2296.push(current)); + : JSCompiler_object_inline_componentStack_2315.push(current)); workInProgress.child = renderLanes; workInProgress.memoizedState = null; return renderLanes; @@ -11275,7 +11295,12 @@ } else ref.current = null; } - function commitProfiler(finishedWork, current, commitTime, effectDuration) { + function commitProfiler( + finishedWork, + current, + commitStartTime, + effectDuration + ) { var _finishedWork$memoize = finishedWork.memoizedProps, id = _finishedWork$memoize.id, onCommit = _finishedWork$memoize.onCommit; @@ -11289,20 +11314,20 @@ finishedWork.actualDuration, finishedWork.treeBaseDuration, finishedWork.actualStartTime, - commitTime + commitStartTime ); "function" === typeof onCommit && onCommit( finishedWork.memoizedProps.id, current, effectDuration, - commitTime + commitStartTime ); } function commitProfilerPostCommitImpl( finishedWork, current, - commitTime, + commitStartTime, passiveEffectDuration ) { var _finishedWork$memoize2 = finishedWork.memoizedProps; @@ -11315,7 +11340,7 @@ finishedWork, current, passiveEffectDuration, - commitTime + commitStartTime ); } function commitHostMount(finishedWork) { @@ -11759,7 +11784,7 @@ commitProfiler, finishedWork, current, - commitTime, + commitStartTime, finishedRoot.effectDuration ); } catch (error) { @@ -12773,7 +12798,7 @@ commitProfiler, finishedWork, current, - commitTime, + commitStartTime, includeWorkInProgressEffects.effectDuration ); } catch (error) { @@ -12969,7 +12994,7 @@ commitProfilerPostCommitImpl, finishedWork, finishedWork.alternate, - commitTime, + commitStartTime, finishedRoot.passiveEffectDuration ); } catch (error) { @@ -13775,8 +13800,7 @@ workInProgress.flags & 16384 && ((retryQueue = 22 !== workInProgress.tag ? claimNextRetryLane() : 536870912), - (workInProgress.lanes |= retryQueue), - (workInProgressSuspendedRetryLanes |= retryQueue)); + (workInProgress.lanes |= retryQueue)); } function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { if (!isHydrating) @@ -14755,8 +14779,7 @@ markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane, - workInProgressRootDidSkipSuspendedSiblings + workInProgressDeferredLane ); markRootUpdated(root, lane); if ( @@ -14798,199 +14821,189 @@ markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane, - workInProgressRootDidSkipSuspendedSiblings + workInProgressDeferredLane )), ensureRootIsScheduled(root); } - function performConcurrentWorkOnRoot(root, didTimeout) { - nestedUpdateScheduled = currentUpdateIsNested = !1; + function performWorkOnRoot(root, lanes, forceSync) { if ((executionContext & (RenderContext | CommitContext)) !== NoContext) throw Error("Should not already be working."); - var originalCallbackNode = root.callbackNode; - if (flushPassiveEffects() && root.callbackNode !== originalCallbackNode) - return null; - var lanes = getNextLanes( - root, - root === workInProgressRoot ? workInProgressRootRenderLanes : 0 - ); - if (0 === lanes) return null; var shouldTimeSlice = - 0 === (lanes & 60) && 0 === (lanes & root.expiredLanes) && !didTimeout; - didTimeout = shouldTimeSlice - ? renderRootConcurrent(root, lanes) - : renderRootSync(root, lanes); - if (didTimeout !== RootInProgress) { + (!forceSync && + 0 === (lanes & 60) && + 0 === (lanes & root.expiredLanes)) || + !1, + exitStatus = shouldTimeSlice + ? renderRootConcurrent(root, lanes) + : renderRootSync(root, lanes, !0); + do { var renderWasConcurrent = shouldTimeSlice; - do { - if (didTimeout === RootDidNotComplete) - markRootSuspended( - root, - lanes, - 0, - workInProgressRootDidSkipSuspendedSiblings - ); - else { - shouldTimeSlice = root.current.alternate; - if ( - renderWasConcurrent && - !isRenderConsistentWithExternalStores(shouldTimeSlice) - ) { - didTimeout = renderRootSync(root, lanes); - renderWasConcurrent = !1; - continue; - } - if (didTimeout === RootErrored) { - renderWasConcurrent = lanes; - var errorRetryLanes = getLanesToRetrySynchronouslyOnError( - root, - renderWasConcurrent - ); - if ( - 0 !== errorRetryLanes && - ((lanes = errorRetryLanes), - (didTimeout = recoverFromConcurrentError( - root, - renderWasConcurrent, - errorRetryLanes - )), - (renderWasConcurrent = !1), - didTimeout !== RootErrored) - ) - continue; - } - if (didTimeout === RootFatalErrored) { - prepareFreshStack(root, 0); - markRootSuspended( - root, - lanes, - 0, - workInProgressRootDidSkipSuspendedSiblings - ); - break; - } - a: { - renderWasConcurrent = root; - completeTime = now(); - switch (didTimeout) { - case RootInProgress: - case RootFatalErrored: - throw Error("Root did not complete. This is a bug in React."); - case RootSuspendedWithDelay: - if ((lanes & 4194176) === lanes) { - markRootSuspended( - renderWasConcurrent, - lanes, - workInProgressDeferredLane, - workInProgressRootDidSkipSuspendedSiblings - ); + if (exitStatus === RootInProgress) break; + else if (exitStatus === RootDidNotComplete) + markRootSuspended(root, lanes, 0); + else { + forceSync = root.current.alternate; + if ( + renderWasConcurrent && + !isRenderConsistentWithExternalStores(forceSync) + ) { + exitStatus = renderRootSync(root, lanes, !1); + continue; + } + if (exitStatus === RootErrored) { + renderWasConcurrent = lanes; + if (root.errorRecoveryDisabledLanes & renderWasConcurrent) + var errorRetryLanes = 0; + else + (errorRetryLanes = root.pendingLanes & -536870913), + (errorRetryLanes = + 0 !== errorRetryLanes + ? errorRetryLanes + : errorRetryLanes & 536870912 + ? 536870912 + : 0); + if (0 !== errorRetryLanes) { + lanes = errorRetryLanes; + a: { + exitStatus = root; + var errorRetryLanes$jscomp$0 = errorRetryLanes; + errorRetryLanes = workInProgressRootConcurrentErrors; + var wasRootDehydrated = + exitStatus.current.memoizedState.isDehydrated; + wasRootDehydrated && + (prepareFreshStack( + exitStatus, + errorRetryLanes$jscomp$0 + ).flags |= 256); + errorRetryLanes$jscomp$0 = renderRootSync( + exitStatus, + errorRetryLanes$jscomp$0, + !1 + ); + if (errorRetryLanes$jscomp$0 !== RootErrored) { + if ( + workInProgressRootDidAttachPingListener && + !wasRootDehydrated + ) { + exitStatus.errorRecoveryDisabledLanes |= + renderWasConcurrent; + workInProgressRootInterleavedUpdatedLanes |= + renderWasConcurrent; + exitStatus = RootSuspendedWithDelay; break a; } - break; - case RootErrored: - workInProgressRootRecoverableErrors = null; - break; - case RootSuspended: - case RootCompleted: - break; - default: - throw Error("Unknown root exit status."); + exitStatus = workInProgressRootRecoverableErrors; + workInProgressRootRecoverableErrors = errorRetryLanes; + null !== exitStatus && queueRecoverableErrors(exitStatus); + } + exitStatus = errorRetryLanes$jscomp$0; } - renderWasConcurrent.finishedWork = shouldTimeSlice; - renderWasConcurrent.finishedLanes = lanes; - if (null !== ReactSharedInternals.actQueue) - commitRoot( - renderWasConcurrent, - workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, - workInProgressDeferredLane, - workInProgressRootInterleavedUpdatedLanes, - workInProgressSuspendedRetryLanes - ); - else { - if ( - (lanes & 62914560) === lanes && - ((didTimeout = - globalMostRecentFallbackTime + - FALLBACK_THROTTLE_MS - - now$1()), - 10 < didTimeout) - ) { + if (exitStatus !== RootErrored) continue; + } + } + if (exitStatus === RootFatalErrored) { + prepareFreshStack(root, 0); + markRootSuspended(root, lanes, 0); + break; + } + a: { + shouldTimeSlice = root; + renderWasConcurrent = now$1(); + switch (exitStatus) { + case RootInProgress: + case RootFatalErrored: + throw Error("Root did not complete. This is a bug in React."); + case RootSuspendedWithDelay: + if ((lanes & 4194176) === lanes) { markRootSuspended( - renderWasConcurrent, + shouldTimeSlice, lanes, - workInProgressDeferredLane, - workInProgressRootDidSkipSuspendedSiblings - ); - if (0 !== getNextLanes(renderWasConcurrent, 0)) break a; - renderWasConcurrent.timeoutHandle = scheduleTimeout( - commitRootWhenReady.bind( - null, - renderWasConcurrent, - shouldTimeSlice, - workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, - lanes, - workInProgressDeferredLane, - workInProgressRootInterleavedUpdatedLanes, - workInProgressSuspendedRetryLanes, - workInProgressRootDidSkipSuspendedSiblings - ), - didTimeout + workInProgressDeferredLane ); break a; } - commitRootWhenReady( - renderWasConcurrent, + break; + case RootErrored: + workInProgressRootRecoverableErrors = null; + break; + case RootSuspended: + case RootCompleted: + break; + default: + throw Error("Unknown root exit status."); + } + shouldTimeSlice.finishedWork = forceSync; + shouldTimeSlice.finishedLanes = lanes; + if (null !== ReactSharedInternals.actQueue) + commitRoot( + shouldTimeSlice, + workInProgressRootRecoverableErrors, + workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + IMMEDIATE_COMMIT, + renderStartTime, + renderWasConcurrent + ); + else { + if ( + (lanes & 62914560) === lanes && + ((exitStatus = + globalMostRecentFallbackTime + + FALLBACK_THROTTLE_MS - + now$1()), + 10 < exitStatus) + ) { + markRootSuspended( shouldTimeSlice, - workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, lanes, - workInProgressDeferredLane, - workInProgressRootInterleavedUpdatedLanes, - workInProgressSuspendedRetryLanes, - workInProgressRootDidSkipSuspendedSiblings + workInProgressDeferredLane + ); + if (0 !== getNextLanes(shouldTimeSlice, 0)) break a; + shouldTimeSlice.timeoutHandle = scheduleTimeout( + commitRootWhenReady.bind( + null, + shouldTimeSlice, + forceSync, + workInProgressRootRecoverableErrors, + workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, + lanes, + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + workInProgressRootDidSkipSuspendedSiblings, + THROTTLED_COMMIT, + renderStartTime, + renderWasConcurrent + ), + exitStatus ); + break a; } + commitRootWhenReady( + shouldTimeSlice, + forceSync, + workInProgressRootRecoverableErrors, + workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, + lanes, + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + workInProgressRootDidSkipSuspendedSiblings, + IMMEDIATE_COMMIT, + renderStartTime, + renderWasConcurrent + ); } } - break; - } while (1); - } + } + break; + } while (1); ensureRootIsScheduled(root); - scheduleTaskForRootDuringMicrotask(root, now$1()); - root = - root.callbackNode === originalCallbackNode - ? performConcurrentWorkOnRoot.bind(null, root) - : null; - return root; - } - function recoverFromConcurrentError( - root, - originallyAttemptedLanes, - errorRetryLanes - ) { - var errorsFromFirstAttempt = workInProgressRootConcurrentErrors, - wasRootDehydrated = root.current.memoizedState.isDehydrated; - wasRootDehydrated && - (prepareFreshStack(root, errorRetryLanes).flags |= 256); - errorRetryLanes = renderRootSync(root, errorRetryLanes); - if (errorRetryLanes !== RootErrored) { - if (workInProgressRootDidAttachPingListener && !wasRootDehydrated) - return ( - (root.errorRecoveryDisabledLanes |= originallyAttemptedLanes), - (workInProgressRootInterleavedUpdatedLanes |= - originallyAttemptedLanes), - RootSuspendedWithDelay - ); - root = workInProgressRootRecoverableErrors; - workInProgressRootRecoverableErrors = errorsFromFirstAttempt; - null !== root && queueRecoverableErrors(root); - } - return errorRetryLanes; } function queueRecoverableErrors(errors) { null === workInProgressRootRecoverableErrors @@ -15010,10 +15023,16 @@ spawnedLane, updatedLanes, suspendedRetryLanes, - didSkipSuspendedSiblings + didSkipSuspendedSiblings, + suspendedCommitReason, + completedRenderStartTime, + completedRenderEndTime ) { - var subtreeFlags = finishedWork.subtreeFlags; - if (subtreeFlags & 8192 || 16785408 === (subtreeFlags & 16785408)) + didSkipSuspendedSiblings = finishedWork.subtreeFlags; + if ( + didSkipSuspendedSiblings & 8192 || + 16785408 === (didSkipSuspendedSiblings & 16785408) + ) if ( ((suspendedState = { stylesheets: null, count: 0, unsuspend: noop }), accumulateSuspenseyCommitOnFiber(finishedWork), @@ -15029,10 +15048,13 @@ didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes + suspendedRetryLanes, + SUSPENDED_COMMIT, + completedRenderStartTime, + completedRenderEndTime ) ); - markRootSuspended(root, lanes, spawnedLane, didSkipSuspendedSiblings); + markRootSuspended(root, lanes, spawnedLane); return; } commitRoot( @@ -15042,7 +15064,10 @@ didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes + suspendedRetryLanes, + suspendedCommitReason, + completedRenderStartTime, + completedRenderEndTime ); } function isRenderConsistentWithExternalStores(finishedWork) { @@ -15091,81 +15116,24 @@ (didIncludeCommitPhaseUpdate = !0); throwIfInfiniteUpdateLoopDetected(); } - function markRootSuspended( - root, - suspendedLanes, - spawnedLane, - didSkipSuspendedSiblings - ) { + function markRootSuspended(root, suspendedLanes, spawnedLane) { suspendedLanes &= ~workInProgressRootPingedLanes; suspendedLanes &= ~workInProgressRootInterleavedUpdatedLanes; root.suspendedLanes |= suspendedLanes; root.pingedLanes &= ~suspendedLanes; - didSkipSuspendedSiblings || (root.warmLanes |= suspendedLanes); - didSkipSuspendedSiblings = root.expirationTimes; - for (var lanes = suspendedLanes; 0 < lanes; ) { + for ( + var expirationTimes = root.expirationTimes, lanes = suspendedLanes; + 0 < lanes; + + ) { var index = 31 - clz32(lanes), lane = 1 << index; - didSkipSuspendedSiblings[index] = -1; + expirationTimes[index] = -1; lanes &= ~lane; } 0 !== spawnedLane && markSpawnedDeferredLane(root, spawnedLane, suspendedLanes); } - function performSyncWorkOnRoot(root, lanes) { - if ((executionContext & (RenderContext | CommitContext)) !== NoContext) - throw Error("Should not already be working."); - if (flushPassiveEffects()) return ensureRootIsScheduled(root), null; - currentUpdateIsNested = nestedUpdateScheduled; - nestedUpdateScheduled = !1; - var exitStatus = renderRootSync(root, lanes); - if (exitStatus === RootErrored) { - var originallyAttemptedLanes = lanes, - errorRetryLanes = getLanesToRetrySynchronouslyOnError( - root, - originallyAttemptedLanes - ); - 0 !== errorRetryLanes && - ((lanes = errorRetryLanes), - (exitStatus = recoverFromConcurrentError( - root, - originallyAttemptedLanes, - errorRetryLanes - ))); - } - if (exitStatus === RootFatalErrored) - return ( - prepareFreshStack(root, 0), - markRootSuspended(root, lanes, 0, !1), - ensureRootIsScheduled(root), - null - ); - if (exitStatus === RootDidNotComplete) - return ( - markRootSuspended( - root, - lanes, - workInProgressDeferredLane, - workInProgressRootDidSkipSuspendedSiblings - ), - ensureRootIsScheduled(root), - null - ); - completeTime = now(); - root.finishedWork = root.current.alternate; - root.finishedLanes = lanes; - commitRoot( - root, - workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, - workInProgressDeferredLane, - workInProgressRootInterleavedUpdatedLanes, - workInProgressSuspendedRetryLanes - ); - ensureRootIsScheduled(root); - return null; - } function flushSyncWork$1() { return (executionContext & (RenderContext | CommitContext)) === NoContext ? (flushSyncWorkAcrossRoots_impl(0, !1), !1) @@ -15279,8 +15247,9 @@ workInProgressRootRenderLanes = lanes; workInProgressSuspendedReason = NotSuspended; workInProgressThrownValue = null; - workInProgressRootDidAttachPingListener = - workInProgressRootDidSkipSuspendedSiblings = !1; + workInProgressRootDidSkipSuspendedSiblings = !1; + checkIfRootIsPrerendering(root, lanes); + workInProgressRootDidAttachPingListener = !1; workInProgressRootExitStatus = RootInProgress; workInProgressSuspendedRetryLanes = workInProgressDeferredLane = @@ -15373,8 +15342,7 @@ markRootSuspended( workInProgressRoot, workInProgressRootRenderLanes, - workInProgressDeferredLane, - workInProgressRootDidSkipSuspendedSiblings + workInProgressDeferredLane ); } function queueConcurrentError(error) { @@ -15402,37 +15370,38 @@ prepareFreshStack(root, lanes); } lanes = !1; + memoizedUpdaters = workInProgressRootExitStatus; a: do try { if ( workInProgressSuspendedReason !== NotSuspended && null !== workInProgress ) { - memoizedUpdaters = workInProgress; - var thrownValue = workInProgressThrownValue; + var unitOfWork = workInProgress, + thrownValue = workInProgressThrownValue; switch (workInProgressSuspendedReason) { case SuspendedOnHydration: resetWorkInProgressStack(); - workInProgressRootExitStatus = RootDidNotComplete; + memoizedUpdaters = RootDidNotComplete; break a; case SuspendedOnImmediate: case SuspendedOnData: - lanes || - null !== suspenseHandlerStackCursor.current || - (lanes = !0); - default: + case SuspendedOnDeprecatedThrowPromise: + null === suspenseHandlerStackCursor.current && (lanes = !0); var reason = workInProgressSuspendedReason; workInProgressSuspendedReason = NotSuspended; workInProgressThrownValue = null; - throwAndUnwindWorkLoop( - root, - memoizedUpdaters, - thrownValue, - reason - ); + throwAndUnwindWorkLoop(root, unitOfWork, thrownValue, reason); + break; + default: + (reason = workInProgressSuspendedReason), + (workInProgressSuspendedReason = NotSuspended), + (workInProgressThrownValue = null), + throwAndUnwindWorkLoop(root, unitOfWork, thrownValue, reason); } } workLoopSync(); + memoizedUpdaters = workInProgressRootExitStatus; break; } catch (thrownValue$8) { handleThrow(root, thrownValue$8); @@ -15443,14 +15412,11 @@ executionContext = prevExecutionContext; ReactSharedInternals.H = prevDispatcher; ReactSharedInternals.A = prevAsyncDispatcher; - if (null !== workInProgress) - throw Error( - "Cannot commit an incomplete root. This error is likely caused by a bug in React. Please file an issue." - ); - workInProgressRoot = null; - workInProgressRootRenderLanes = 0; - finishQueueingConcurrentUpdates(); - return workInProgressRootExitStatus; + null === workInProgress && + ((workInProgressRoot = null), + (workInProgressRootRenderLanes = 0), + finishQueueingConcurrentUpdates()); + return memoizedUpdaters; } function workLoopSync() { for (; null !== workInProgress; ) performUnitOfWork(workInProgress); @@ -15474,7 +15440,7 @@ workInProgressTransitions = null; workInProgressRootRenderTargetTime = now$1() + RENDER_TIMEOUT_MS; prepareFreshStack(root, lanes); - } + } else checkIfRootIsPrerendering(root, lanes); a: do try { if ( @@ -15791,7 +15757,10 @@ didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes + suspendedRetryLanes, + suspendedCommitReason, + completedRenderStartTime, + completedRenderEndTime ) { var prevTransition = ReactSharedInternals.T, previousUpdateLanePriority = ReactDOMSharedInternals.p; @@ -15806,13 +15775,15 @@ previousUpdateLanePriority, spawnedLane, updatedLanes, - suspendedRetryLanes + suspendedRetryLanes, + suspendedCommitReason, + completedRenderStartTime, + completedRenderEndTime ); } finally { (ReactSharedInternals.T = prevTransition), (ReactDOMSharedInternals.p = previousUpdateLanePriority); } - return null; } function commitRootImpl( root, @@ -15822,7 +15793,10 @@ renderPriorityLevel, spawnedLane, updatedLanes, - suspendedRetryLanes + suspendedRetryLanes, + suspendedCommitReason, + completedRenderStartTime, + completedRenderEndTime ) { do flushPassiveEffects(); while (null !== rootWithPendingPassiveEffects); @@ -15830,107 +15804,118 @@ ReactStrictModeWarnings.flushPendingUnsafeLifecycleWarnings(); if ((executionContext & (RenderContext | CommitContext)) !== NoContext) throw Error("Should not already be working."); - var finishedWork = root.finishedWork, - lanes = root.finishedLanes; - if (null === finishedWork) return null; - 0 === lanes && + suspendedRetryLanes = root.finishedWork; + updatedLanes = root.finishedLanes; + reusableComponentDevToolDetails.track = + getGroupNameOfHighestPriorityLane(updatedLanes); + logRenderPhase(completedRenderStartTime, completedRenderEndTime); + if (null === suspendedRetryLanes) return null; + 0 === updatedLanes && console.error( "root.finishedLanes should not be empty during a commit. This is a bug in React." ); root.finishedWork = null; root.finishedLanes = 0; - if (finishedWork === root.current) + if (suspendedRetryLanes === root.current) throw Error( "Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue." ); root.callbackNode = null; root.callbackPriority = 0; root.cancelPendingCommit = null; - var remainingLanes = finishedWork.lanes | finishedWork.childLanes; - remainingLanes |= concurrentlyUpdatedLanes; + completedRenderStartTime = + suspendedRetryLanes.lanes | suspendedRetryLanes.childLanes; + completedRenderStartTime |= concurrentlyUpdatedLanes; markRootFinished( root, - lanes, - remainingLanes, - spawnedLane, updatedLanes, - suspendedRetryLanes + completedRenderStartTime, + spawnedLane ); didIncludeCommitPhaseUpdate = !1; root === workInProgressRoot && ((workInProgress = workInProgressRoot = null), (workInProgressRootRenderLanes = 0)); - (0 === finishedWork.actualDuration && - 0 === (finishedWork.subtreeFlags & 10256) && - 0 === (finishedWork.flags & 10256)) || + (0 === suspendedRetryLanes.actualDuration && + 0 === (suspendedRetryLanes.subtreeFlags & 10256) && + 0 === (suspendedRetryLanes.flags & 10256)) || rootDoesHavePassiveEffects || ((rootDoesHavePassiveEffects = !0), - (pendingPassiveEffectsRemainingLanes = remainingLanes), + (pendingPassiveEffectsRemainingLanes = completedRenderStartTime), + (pendingPassiveEffectsRenderEndTime = completedRenderEndTime), (pendingPassiveTransitions = transitions), scheduleCallback$1(NormalPriority$1, function () { - flushPassiveEffects(); + flushPassiveEffects(!0); return null; })); - transitions = 0 !== (finishedWork.flags & 15990); - 0 !== (finishedWork.subtreeFlags & 15990) || transitions + commitStartTime = now(); + suspendedCommitReason === SUSPENDED_COMMIT + ? logSuspendedCommitPhase(completedRenderEndTime, commitStartTime) + : suspendedCommitReason === THROTTLED_COMMIT && + logSuspenseThrottlePhase(completedRenderEndTime, commitStartTime); + transitions = 0 !== (suspendedRetryLanes.flags & 15990); + 0 !== (suspendedRetryLanes.subtreeFlags & 15990) || transitions ? ((transitions = ReactSharedInternals.T), (ReactSharedInternals.T = null), (spawnedLane = ReactDOMSharedInternals.p), (ReactDOMSharedInternals.p = DiscreteEventPriority), - (updatedLanes = executionContext), + (suspendedCommitReason = executionContext), (executionContext |= CommitContext), - commitBeforeMutationEffects(root, finishedWork), - (commitTime = now()), - commitMutationEffects(root, finishedWork, lanes), + commitBeforeMutationEffects(root, suspendedRetryLanes), + commitMutationEffects(root, suspendedRetryLanes, updatedLanes), restoreSelection(selectionInformation, root.containerInfo), (_enabled = !!eventsEnabled), (selectionInformation = eventsEnabled = null), - (root.current = finishedWork), - commitLayoutEffects(finishedWork, root, lanes), + (root.current = suspendedRetryLanes), + commitLayoutEffects(suspendedRetryLanes, root, updatedLanes), requestPaint(), - (executionContext = updatedLanes), + (executionContext = suspendedCommitReason), (ReactDOMSharedInternals.p = spawnedLane), (ReactSharedInternals.T = transitions)) - : ((root.current = finishedWork), (commitTime = now())); + : (root.current = suspendedRetryLanes); + commitEndTime = now(); + logCommitPhase(commitStartTime, commitEndTime); (transitions = rootDoesHavePassiveEffects) ? ((rootDoesHavePassiveEffects = !1), (rootWithPendingPassiveEffects = root), - (pendingPassiveEffectsLanes = lanes)) - : (releaseRootPooledCache(root, remainingLanes), + (pendingPassiveEffectsLanes = updatedLanes)) + : (releaseRootPooledCache(root, completedRenderStartTime), (nestedPassiveUpdateCount = 0), (rootWithPassiveNestedUpdates = null)); - remainingLanes = root.pendingLanes; - 0 === remainingLanes && (legacyErrorBoundariesThatAlreadyFailed = null); + completedRenderStartTime = root.pendingLanes; + 0 === completedRenderStartTime && + (legacyErrorBoundariesThatAlreadyFailed = null); transitions || commitDoubleInvokeEffectsInDEV(root); - onCommitRoot$1(finishedWork.stateNode, renderPriorityLevel); + onCommitRoot$1(suspendedRetryLanes.stateNode, renderPriorityLevel); isDevToolsPresent && root.memoizedUpdaters.clear(); onCommitRoot(); ensureRootIsScheduled(root); if (null !== recoverableErrors) for ( - renderPriorityLevel = root.onRecoverableError, finishedWork = 0; - finishedWork < recoverableErrors.length; - finishedWork++ + renderPriorityLevel = root.onRecoverableError, + suspendedRetryLanes = 0; + suspendedRetryLanes < recoverableErrors.length; + suspendedRetryLanes++ ) - (remainingLanes = recoverableErrors[finishedWork]), - (spawnedLane = makeErrorInfo(remainingLanes.stack)), + (completedRenderStartTime = recoverableErrors[suspendedRetryLanes]), + (spawnedLane = makeErrorInfo(completedRenderStartTime.stack)), runWithFiberInDEV( - remainingLanes.source, + completedRenderStartTime.source, renderPriorityLevel, - remainingLanes.value, + completedRenderStartTime.value, spawnedLane ); 0 !== (pendingPassiveEffectsLanes & 3) && flushPassiveEffects(); - remainingLanes = root.pendingLanes; + completedRenderStartTime = root.pendingLanes; didIncludeRenderPhaseUpdate || didIncludeCommitPhaseUpdate || - (0 !== (lanes & 4194218) && 0 !== (remainingLanes & 42)) + (0 !== (updatedLanes & 4194218) && 0 !== (completedRenderStartTime & 42)) ? ((nestedUpdateScheduled = !0), root === rootWithNestedUpdates ? nestedUpdateCount++ : ((nestedUpdateCount = 0), (rootWithNestedUpdates = root))) : (nestedUpdateCount = 0); - transitions || finalizeRender(lanes, now$1()); + transitions || finalizeRender(updatedLanes, now$1()); flushSyncWorkAcrossRoots_impl(0, !1); return null; } @@ -15951,7 +15936,7 @@ null != remainingLanes && ((root.pooledCache = null), releaseCache(remainingLanes))); } - function flushPassiveEffects() { + function flushPassiveEffects(wasDelayedCommit) { if (null !== rootWithPendingPassiveEffects) { var root = rootWithPendingPassiveEffects, remainingLanes = pendingPassiveEffectsRemainingLanes; @@ -15969,10 +15954,10 @@ if (null === rootWithPendingPassiveEffects) var JSCompiler_inline_result = !1; else { - priority = pendingPassiveTransitions; + var transitions = pendingPassiveTransitions; pendingPassiveTransitions = null; - var root$jscomp$0 = rootWithPendingPassiveEffects, - lanes = pendingPassiveEffectsLanes; + priority = rootWithPendingPassiveEffects; + var lanes = pendingPassiveEffectsLanes; rootWithPendingPassiveEffects = null; pendingPassiveEffectsLanes = 0; if ( @@ -15983,40 +15968,56 @@ "Cannot flush passive effects while already rendering." ); reusableComponentDevToolDetails.track = - lanes & 63 - ? "Blocking" - : lanes & 4194240 - ? "Transition" - : lanes & 62914560 - ? "Suspense" - : lanes & 2080374784 - ? "Idle" - : "Other"; + getGroupNameOfHighestPriorityLane(lanes); isFlushingPassiveEffects = !0; didScheduleUpdateDuringPassiveEffects = !1; - var prevExecutionContext = executionContext; + var passiveEffectStartTime = 0; + passiveEffectStartTime = now$1(); + var startTime = commitEndTime, + endTime = passiveEffectStartTime; + supportsUserTiming && + ((reusableComponentDevToolDetails.color = "secondary-light"), + (reusableComponentOptions.start = startTime), + (reusableComponentOptions.end = endTime), + performance.measure( + "Waiting for Paint", + reusableComponentOptions + )); + startTime = executionContext; executionContext |= CommitContext; - var finishedWork = root$jscomp$0.current; + var finishedWork = priority.current; resetComponentEffectTimers(); commitPassiveUnmountOnFiber(finishedWork); - var finishedWork$jscomp$0 = root$jscomp$0.current; + var finishedWork$jscomp$0 = priority.current; + finishedWork = pendingPassiveEffectsRenderEndTime; resetComponentEffectTimers(); commitPassiveMountOnFiber( - root$jscomp$0, + priority, finishedWork$jscomp$0, lanes, - priority, - completeTime + transitions, + finishedWork ); - commitDoubleInvokeEffectsInDEV(root$jscomp$0); - executionContext = prevExecutionContext; - finalizeRender(lanes, now$1()); + commitDoubleInvokeEffectsInDEV(priority); + executionContext = startTime; + var passiveEffectsEndTime = now$1(); + wasDelayedCommit && + ((wasDelayedCommit = passiveEffectStartTime), + supportsUserTiming && + ((reusableComponentDevToolDetails.color = "secondary-dark"), + (reusableComponentOptions.start = wasDelayedCommit), + (reusableComponentOptions.end = passiveEffectsEndTime), + performance.measure( + "Remaining Effects", + reusableComponentOptions + ))); + finalizeRender(lanes, passiveEffectsEndTime); flushSyncWorkAcrossRoots_impl(0, !1); didScheduleUpdateDuringPassiveEffects - ? root$jscomp$0 === rootWithPassiveNestedUpdates + ? priority === rootWithPassiveNestedUpdates ? nestedPassiveUpdateCount++ : ((nestedPassiveUpdateCount = 0), - (rootWithPassiveNestedUpdates = root$jscomp$0)) + (rootWithPassiveNestedUpdates = priority)) : (nestedPassiveUpdateCount = 0); didScheduleUpdateDuringPassiveEffects = isFlushingPassiveEffects = !1; @@ -16025,7 +16026,7 @@ "function" === typeof injectedHook.onPostCommitFiberRoot ) try { - injectedHook.onPostCommitFiberRoot(rendererID, root$jscomp$0); + injectedHook.onPostCommitFiberRoot(rendererID, priority); } catch (err) { hasLoggedError || ((hasLoggedError = !0), @@ -16034,7 +16035,7 @@ err )); } - var stateNode = root$jscomp$0.current.stateNode; + var stateNode = priority.current.stateNode; stateNode.effectDuration = 0; stateNode.passiveEffectDuration = 0; JSCompiler_inline_result = !0; @@ -16365,7 +16366,8 @@ root, root === workInProgressRoot ? nextLanes : 0 )), - 0 !== (nextLanes & 3) && + 0 === (nextLanes & 3) || + checkIfRootIsPrerendering(root, nextLanes) || ((didPerformSomeWork = !0), performSyncWorkOnRoot(root, nextLanes)); root = root.next; @@ -16456,8 +16458,6 @@ else return currentTime; switch (lanesToEventPriority(suspendedLanes)) { case DiscreteEventPriority: - suspendedLanes = ImmediatePriority; - break; case ContinuousEventPriority: suspendedLanes = UserBlockingPriority; break; @@ -16470,7 +16470,7 @@ default: suspendedLanes = NormalPriority$1; } - pingedLanes = performConcurrentWorkOnRoot.bind(null, root); + pingedLanes = performWorkOnRootViaSchedulerTask.bind(null, root); null !== ReactSharedInternals.actQueue ? (ReactSharedInternals.actQueue.push(pingedLanes), (suspendedLanes = fakeActCallbackNode)) @@ -16479,6 +16479,34 @@ root.callbackNode = suspendedLanes; return currentTime; } + function performWorkOnRootViaSchedulerTask(root, didTimeout) { + nestedUpdateScheduled = currentUpdateIsNested = !1; + var originalCallbackNode = root.callbackNode; + if (flushPassiveEffects() && root.callbackNode !== originalCallbackNode) + return null; + var workInProgressRootRenderLanes$jscomp$0 = + workInProgressRootRenderLanes; + workInProgressRootRenderLanes$jscomp$0 = getNextLanes( + root, + root === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0 + ); + if (0 === workInProgressRootRenderLanes$jscomp$0) return null; + performWorkOnRoot( + root, + workInProgressRootRenderLanes$jscomp$0, + didTimeout + ); + scheduleTaskForRootDuringMicrotask(root, now$1()); + return root.callbackNode === originalCallbackNode + ? performWorkOnRootViaSchedulerTask.bind(null, root) + : null; + } + function performSyncWorkOnRoot(root, lanes) { + if (flushPassiveEffects()) return null; + currentUpdateIsNested = nestedUpdateScheduled; + nestedUpdateScheduled = !1; + performWorkOnRoot(root, lanes, !0); + } function cancelCallback(callbackNode) { callbackNode !== fakeActCallbackNode && null !== callbackNode && @@ -22818,8 +22846,8 @@ NoStrictPassiveEffectsMode = 64, now = Scheduler.unstable_now, renderStartTime = -0, - completeTime = -0, - commitTime = -0, + commitStartTime = -0, + commitEndTime = -0, profilerStartTime = -1.1, profilerEffectDuration = -0, componentEffectDuration = -0, @@ -24654,16 +24682,20 @@ rootWithPendingPassiveEffects = null, pendingPassiveEffectsLanes = 0, pendingPassiveEffectsRemainingLanes = 0, + pendingPassiveEffectsRenderEndTime = -0, pendingPassiveTransitions = null, - NESTED_UPDATE_LIMIT = 50, + NESTED_UPDATE_LIMIT = 100, nestedUpdateCount = 0, rootWithNestedUpdates = null, isFlushingPassiveEffects = !1, didScheduleUpdateDuringPassiveEffects = !1, - NESTED_PASSIVE_UPDATE_LIMIT = 50, + NESTED_PASSIVE_UPDATE_LIMIT = 100, nestedPassiveUpdateCount = 0, rootWithPassiveNestedUpdates = null, isRunningInsertionEffect = !1, + IMMEDIATE_COMMIT = 0, + SUSPENDED_COMMIT = 1, + THROTTLED_COMMIT = 2, didWarnStateUpdateForNotYetMountedComponent = null, didWarnAboutUpdateInRender = !1; var didWarnAboutUpdateInRenderForAnotherComponent = new Set(); @@ -25208,11 +25240,11 @@ }; (function () { var isomorphicReactPackageVersion = React.version; - if ("19.0.0-experimental-5d19e1c8-20240923" !== isomorphicReactPackageVersion) + if ("19.0.0-experimental-778e1ed2-20240926" !== isomorphicReactPackageVersion) throw Error( 'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion + - "\n - react-dom: 19.0.0-experimental-5d19e1c8-20240923\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.0.0-experimental-778e1ed2-20240926\nLearn more: https://react.dev/warnings/version-mismatch") ); })(); ("function" === typeof Map && @@ -25249,11 +25281,11 @@ !(function () { var internals = { bundleType: 1, - version: "19.0.0-experimental-5d19e1c8-20240923", + version: "19.0.0-experimental-778e1ed2-20240926", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, findFiberByHostInstance: getClosestInstanceFromNode, - reconcilerVersion: "19.0.0-experimental-5d19e1c8-20240923" + reconcilerVersion: "19.0.0-experimental-778e1ed2-20240926" }; internals.overrideHookState = overrideHookState; internals.overrideHookStateDeletePath = overrideHookStateDeletePath; @@ -25561,5 +25593,5 @@ } }; }; - exports.version = "19.0.0-experimental-5d19e1c8-20240923"; + exports.version = "19.0.0-experimental-778e1ed2-20240926"; })(); diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-unstable_testing.production.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-unstable_testing.production.js index 6b827016f23ef..9ab16fa418dd0 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-unstable_testing.production.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom-unstable_testing.production.js @@ -597,43 +597,39 @@ function getNextLanes(root, wipLanes) { var pendingLanes = root.pendingLanes; if (0 === pendingLanes) return 0; var nextLanes = 0, - suspendedLanes = root.suspendedLanes, - pingedLanes = root.pingedLanes, - warmLanes = root.warmLanes; - root = 0 !== root.finishedLanes; + suspendedLanes = root.suspendedLanes; + root = root.pingedLanes; var nonIdlePendingLanes = pendingLanes & 134217727; 0 !== nonIdlePendingLanes ? ((pendingLanes = nonIdlePendingLanes & ~suspendedLanes), 0 !== pendingLanes ? (nextLanes = getHighestPriorityLanes(pendingLanes)) - : ((pingedLanes &= nonIdlePendingLanes), - 0 !== pingedLanes - ? (nextLanes = getHighestPriorityLanes(pingedLanes)) - : root || - ((warmLanes = nonIdlePendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes))))) - : ((nonIdlePendingLanes = pendingLanes & ~suspendedLanes), - 0 !== nonIdlePendingLanes - ? (nextLanes = getHighestPriorityLanes(nonIdlePendingLanes)) - : 0 !== pingedLanes - ? (nextLanes = getHighestPriorityLanes(pingedLanes)) - : root || - ((warmLanes = pendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes)))); + : ((root &= nonIdlePendingLanes), + 0 !== root && (nextLanes = getHighestPriorityLanes(root)))) + : ((pendingLanes &= ~suspendedLanes), + 0 !== pendingLanes + ? (nextLanes = getHighestPriorityLanes(pendingLanes)) + : 0 !== root && (nextLanes = getHighestPriorityLanes(root))); return 0 === nextLanes ? 0 : 0 !== wipLanes && wipLanes !== nextLanes && 0 === (wipLanes & suspendedLanes) && ((suspendedLanes = nextLanes & -nextLanes), - (warmLanes = wipLanes & -wipLanes), - suspendedLanes >= warmLanes || - (32 === suspendedLanes && 0 !== (warmLanes & 4194176))) + (root = wipLanes & -wipLanes), + suspendedLanes >= root || + (32 === suspendedLanes && 0 !== (root & 4194176))) ? wipLanes : nextLanes; } +function checkIfRootIsPrerendering(root, renderLanes) { + return ( + 0 === + (root.pendingLanes & + ~(root.suspendedLanes & ~root.pingedLanes) & + renderLanes) + ); +} function computeExpirationTime(lane, currentTime) { switch (lane) { case 1: @@ -675,11 +671,6 @@ function computeExpirationTime(lane, currentTime) { return -1; } } -function getLanesToRetrySynchronouslyOnError(root, originallyAttemptedLanes) { - if (root.errorRecoveryDisabledLanes & originallyAttemptedLanes) return 0; - root = root.pendingLanes & -536870913; - return 0 !== root ? root : root & 536870912 ? 536870912 : 0; -} function claimNextTransitionLane() { var lane = nextTransitionLane; nextTransitionLane <<= 1; @@ -696,14 +687,7 @@ function createLaneMap(initial) { for (var laneMap = [], i = 0; 31 > i; i++) laneMap.push(initial); return laneMap; } -function markRootFinished( - root, - finishedLanes, - remainingLanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes -) { +function markRootFinished(root, finishedLanes, remainingLanes, spawnedLane) { var previouslyPendingLanes = root.pendingLanes; root.pendingLanes = remainingLanes; root.suspendedLanes = 0; @@ -713,36 +697,31 @@ function markRootFinished( root.entangledLanes &= remainingLanes; root.errorRecoveryDisabledLanes &= remainingLanes; root.shellSuspendCounter = 0; - var entanglements = root.entanglements, - expirationTimes = root.expirationTimes, + finishedLanes = root.entanglements; + var expirationTimes = root.expirationTimes, hiddenUpdates = root.hiddenUpdates; for ( remainingLanes = previouslyPendingLanes & ~remainingLanes; 0 < remainingLanes; ) { - var index$7 = 31 - clz32(remainingLanes), - lane = 1 << index$7; - entanglements[index$7] = 0; - expirationTimes[index$7] = -1; - var hiddenUpdatesForLane = hiddenUpdates[index$7]; + var index$6 = 31 - clz32(remainingLanes); + previouslyPendingLanes = 1 << index$6; + finishedLanes[index$6] = 0; + expirationTimes[index$6] = -1; + var hiddenUpdatesForLane = hiddenUpdates[index$6]; if (null !== hiddenUpdatesForLane) for ( - hiddenUpdates[index$7] = null, index$7 = 0; - index$7 < hiddenUpdatesForLane.length; - index$7++ + hiddenUpdates[index$6] = null, index$6 = 0; + index$6 < hiddenUpdatesForLane.length; + index$6++ ) { - var update = hiddenUpdatesForLane[index$7]; + var update = hiddenUpdatesForLane[index$6]; null !== update && (update.lane &= -536870913); } - remainingLanes &= ~lane; + remainingLanes &= ~previouslyPendingLanes; } 0 !== spawnedLane && markSpawnedDeferredLane(root, spawnedLane, 0); - 0 !== suspendedRetryLanes && - 0 === updatedLanes && - 0 !== root.tag && - (root.suspendedLanes |= - suspendedRetryLanes & ~(previouslyPendingLanes & ~finishedLanes)); } function markSpawnedDeferredLane(root, spawnedLane, entangledLanes) { root.pendingLanes |= spawnedLane; @@ -757,10 +736,10 @@ function markSpawnedDeferredLane(root, spawnedLane, entangledLanes) { function markRootEntangled(root, entangledLanes) { var rootEntangledLanes = (root.entangledLanes |= entangledLanes); for (root = root.entanglements; rootEntangledLanes; ) { - var index$8 = 31 - clz32(rootEntangledLanes), - lane = 1 << index$8; - (lane & entangledLanes) | (root[index$8] & entangledLanes) && - (root[index$8] |= entangledLanes); + var index$7 = 31 - clz32(rootEntangledLanes), + lane = 1 << index$7; + (lane & entangledLanes) | (root[index$7] & entangledLanes) && + (root[index$7] |= entangledLanes); rootEntangledLanes &= ~lane; } } @@ -996,8 +975,8 @@ function setValueForAttribute(node, name, value) { node.removeAttribute(name); return; case "boolean": - var prefix$10 = name.toLowerCase().slice(0, 5); - if ("data-" !== prefix$10 && "aria-" !== prefix$10) { + var prefix$9 = name.toLowerCase().slice(0, 5); + if ("data-" !== prefix$9 && "aria-" !== prefix$9) { node.removeAttribute(name); return; } @@ -1330,15 +1309,15 @@ function setValueForStyles(node, styles, prevStyles) { : "float" === styleName ? (node.cssFloat = "") : (node[styleName] = "")); - for (var styleName$16 in styles) - (styleName = styles[styleName$16]), - styles.hasOwnProperty(styleName$16) && - prevStyles[styleName$16] !== styleName && - setValueForStyle(node, styleName$16, styleName); + for (var styleName$15 in styles) + (styleName = styles[styleName$15]), + styles.hasOwnProperty(styleName$15) && + prevStyles[styleName$15] !== styleName && + setValueForStyle(node, styleName$15, styleName); } else - for (var styleName$17 in styles) - styles.hasOwnProperty(styleName$17) && - setValueForStyle(node, styleName$17, styles[styleName$17]); + for (var styleName$16 in styles) + styles.hasOwnProperty(styleName$16) && + setValueForStyle(node, styleName$16, styles[styleName$16]); } function isCustomElement(tagName) { if (-1 === tagName.indexOf("-")) return !1; @@ -2069,14 +2048,14 @@ var isInputEventSupported = !1; if (canUseDOM) { var JSCompiler_inline_result$jscomp$282; if (canUseDOM) { - var isSupported$jscomp$inline_421 = "oninput" in document; - if (!isSupported$jscomp$inline_421) { - var element$jscomp$inline_422 = document.createElement("div"); - element$jscomp$inline_422.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_421 = - "function" === typeof element$jscomp$inline_422.oninput; + var isSupported$jscomp$inline_420 = "oninput" in document; + if (!isSupported$jscomp$inline_420) { + var element$jscomp$inline_421 = document.createElement("div"); + element$jscomp$inline_421.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_420 = + "function" === typeof element$jscomp$inline_421.oninput; } - JSCompiler_inline_result$jscomp$282 = isSupported$jscomp$inline_421; + JSCompiler_inline_result$jscomp$282 = isSupported$jscomp$inline_420; } else JSCompiler_inline_result$jscomp$282 = !1; isInputEventSupported = JSCompiler_inline_result$jscomp$282 && @@ -4019,7 +3998,7 @@ function updateReducerImpl(hook, current, reducer) { var newBaseQueueFirst = (baseFirst = null), newBaseQueueLast = null, update = current, - didReadFromEntangledAsyncAction$55 = !1; + didReadFromEntangledAsyncAction$54 = !1; do { var updateLane = update.lane & -536870913; if ( @@ -4040,11 +4019,11 @@ function updateReducerImpl(hook, current, reducer) { next: null }), updateLane === currentEntangledLane && - (didReadFromEntangledAsyncAction$55 = !0); + (didReadFromEntangledAsyncAction$54 = !0); else if ((renderLanes & revertLane) === revertLane) { update = update.next; revertLane === currentEntangledLane && - (didReadFromEntangledAsyncAction$55 = !0); + (didReadFromEntangledAsyncAction$54 = !0); continue; } else (updateLane = { @@ -4090,7 +4069,7 @@ function updateReducerImpl(hook, current, reducer) { if ( !objectIs(pendingQueue, hook.memoizedState) && ((didReceiveUpdate = !0), - didReadFromEntangledAsyncAction$55 && + didReadFromEntangledAsyncAction$54 && ((reducer = currentEntangledActionThenable), null !== reducer)) ) throw reducer; @@ -4288,8 +4267,8 @@ function runActionStateAction(actionQueue, node) { try { (prevTransition = action(prevState, payload)), handleActionReturnValue(actionQueue, node, prevTransition); - } catch (error$61) { - onActionError(actionQueue, node, error$61); + } catch (error$60) { + onActionError(actionQueue, node, error$60); } } function handleActionReturnValue(actionQueue, node, returnValue) { @@ -4738,14 +4717,14 @@ function refreshCache(fiber, seedKey, seedValue) { case 3: var lane = requestUpdateLane(); fiber = createUpdate(lane); - var root$64 = enqueueUpdate(provider, fiber, lane); - null !== root$64 && - (scheduleUpdateOnFiber(root$64, provider, lane), - entangleTransitions(root$64, provider, lane)); + var root$63 = enqueueUpdate(provider, fiber, lane); + null !== root$63 && + (scheduleUpdateOnFiber(root$63, provider, lane), + entangleTransitions(root$63, provider, lane)); provider = createCache(); null !== seedKey && void 0 !== seedKey && - null !== root$64 && + null !== root$63 && provider.data.set(seedKey, seedValue); fiber.payload = { cache: provider }; return; @@ -5276,9 +5255,9 @@ function resolveClassComponentProps(Component, baseProps) { } if ((Component = Component.defaultProps)) { newProps === baseProps && (newProps = assign({}, newProps)); - for (var propName$68 in Component) - void 0 === newProps[propName$68] && - (newProps[propName$68] = Component[propName$68]); + for (var propName$67 in Component) + void 0 === newProps[propName$67] && + (newProps[propName$67] = Component[propName$67]); } return newProps; } @@ -5324,9 +5303,9 @@ function logUncaughtError(root, errorInfo) { try { var onUncaughtError = root.onUncaughtError; onUncaughtError(errorInfo.value, { componentStack: errorInfo.stack }); - } catch (e$69) { + } catch (e$68) { setTimeout(function () { - throw e$69; + throw e$68; }); } } @@ -5337,9 +5316,9 @@ function logCaughtError(root, boundary, errorInfo) { componentStack: errorInfo.stack, errorBoundary: 1 === boundary.tag ? boundary.stateNode : null }); - } catch (e$70) { + } catch (e$69) { setTimeout(function () { - throw e$70; + throw e$69; }); } } @@ -7805,8 +7784,8 @@ function safelyDetachRef(current, nearestMountedAncestor) { else if ("function" === typeof ref) try { ref(null); - } catch (error$115) { - captureCommitPhaseError(current, nearestMountedAncestor, error$115); + } catch (error$114) { + captureCommitPhaseError(current, nearestMountedAncestor, error$114); } else ref.current = null; } @@ -7940,7 +7919,7 @@ function commitBeforeMutationEffects(root, firstChild) { selection = selection.focusOffset; try { JSCompiler_temp.nodeType, focusNode.nodeType; - } catch (e$20) { + } catch (e$19) { JSCompiler_temp = null; break a; } @@ -8115,11 +8094,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } catch (error$114) { + } catch (error$113) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$114 + error$113 ); } } @@ -8273,7 +8252,7 @@ function commitDeletionEffectsOnFiber( safelyDetachRef(deletedFiber, nearestMountedAncestor); case 6: prevHostParentIsContainer = hostParent; - var prevHostParentIsContainer$122 = hostParentIsContainer; + var prevHostParentIsContainer$121 = hostParentIsContainer; hostParent = null; recursivelyTraverseDeletionEffects( finishedRoot, @@ -8281,7 +8260,7 @@ function commitDeletionEffectsOnFiber( deletedFiber ); hostParent = prevHostParentIsContainer; - hostParentIsContainer = prevHostParentIsContainer$122; + hostParentIsContainer = prevHostParentIsContainer$121; if (null !== hostParent) if (hostParentIsContainer) try { @@ -8909,21 +8888,21 @@ function commitReconciliationEffects(finishedWork) { insertOrAppendPlacementNode(finishedWork, before, parent$jscomp$0); break; case 5: - var parent$116 = JSCompiler_inline_result.stateNode; + var parent$115 = JSCompiler_inline_result.stateNode; JSCompiler_inline_result.flags & 32 && - (setTextContent(parent$116, ""), + (setTextContent(parent$115, ""), (JSCompiler_inline_result.flags &= -33)); - var before$117 = getHostSibling(finishedWork); - insertOrAppendPlacementNode(finishedWork, before$117, parent$116); + var before$116 = getHostSibling(finishedWork); + insertOrAppendPlacementNode(finishedWork, before$116, parent$115); break; case 3: case 4: - var parent$118 = JSCompiler_inline_result.stateNode.containerInfo, - before$119 = getHostSibling(finishedWork); + var parent$117 = JSCompiler_inline_result.stateNode.containerInfo, + before$118 = getHostSibling(finishedWork); insertOrAppendPlacementNodeIntoContainer( finishedWork, - before$119, - parent$118 + before$118, + parent$117 ); break; default: @@ -9820,8 +9799,7 @@ function scheduleRetryEffect(workInProgress, retryQueue) { workInProgress.flags & 16384 && ((retryQueue = 22 !== workInProgress.tag ? claimNextRetryLane() : 536870912), - (workInProgress.lanes |= retryQueue), - (workInProgressSuspendedRetryLanes |= retryQueue)); + (workInProgress.lanes |= retryQueue)); } function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { if (!isHydrating) @@ -9838,14 +9816,14 @@ function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { break; case "collapsed": lastTailNode = renderState.tail; - for (var lastTailNode$134 = null; null !== lastTailNode; ) - null !== lastTailNode.alternate && (lastTailNode$134 = lastTailNode), + for (var lastTailNode$133 = null; null !== lastTailNode; ) + null !== lastTailNode.alternate && (lastTailNode$133 = lastTailNode), (lastTailNode = lastTailNode.sibling); - null === lastTailNode$134 + null === lastTailNode$133 ? hasRenderedATailFallback || null === renderState.tail ? (renderState.tail = null) : (renderState.tail.sibling = null) - : (lastTailNode$134.sibling = null); + : (lastTailNode$133.sibling = null); } } function bubbleProperties(completedWork) { @@ -9855,19 +9833,19 @@ function bubbleProperties(completedWork) { newChildLanes = 0, subtreeFlags = 0; if (didBailout) - for (var child$135 = completedWork.child; null !== child$135; ) - (newChildLanes |= child$135.lanes | child$135.childLanes), - (subtreeFlags |= child$135.subtreeFlags & 31457280), - (subtreeFlags |= child$135.flags & 31457280), - (child$135.return = completedWork), - (child$135 = child$135.sibling); + for (var child$134 = completedWork.child; null !== child$134; ) + (newChildLanes |= child$134.lanes | child$134.childLanes), + (subtreeFlags |= child$134.subtreeFlags & 31457280), + (subtreeFlags |= child$134.flags & 31457280), + (child$134.return = completedWork), + (child$134 = child$134.sibling); else - for (child$135 = completedWork.child; null !== child$135; ) - (newChildLanes |= child$135.lanes | child$135.childLanes), - (subtreeFlags |= child$135.subtreeFlags), - (subtreeFlags |= child$135.flags), - (child$135.return = completedWork), - (child$135 = child$135.sibling); + for (child$134 = completedWork.child; null !== child$134; ) + (newChildLanes |= child$134.lanes | child$134.childLanes), + (subtreeFlags |= child$134.subtreeFlags), + (subtreeFlags |= child$134.flags), + (child$134.return = completedWork), + (child$134 = child$134.sibling); completedWork.subtreeFlags |= subtreeFlags; completedWork.childLanes = newChildLanes; return didBailout; @@ -10144,11 +10122,11 @@ function completeWork(current, workInProgress, renderLanes) { null !== newProps.alternate.memoizedState && null !== newProps.alternate.memoizedState.cachePool && (type = newProps.alternate.memoizedState.cachePool.pool); - var cache$147 = null; + var cache$146 = null; null !== newProps.memoizedState && null !== newProps.memoizedState.cachePool && - (cache$147 = newProps.memoizedState.cachePool.pool); - cache$147 !== type && (newProps.flags |= 2048); + (cache$146 = newProps.memoizedState.cachePool.pool); + cache$146 !== type && (newProps.flags |= 2048); } renderLanes !== current && renderLanes && @@ -10173,8 +10151,8 @@ function completeWork(current, workInProgress, renderLanes) { type = workInProgress.memoizedState; if (null === type) return bubbleProperties(workInProgress), null; newProps = 0 !== (workInProgress.flags & 128); - cache$147 = type.rendering; - if (null === cache$147) + cache$146 = type.rendering; + if (null === cache$146) if (newProps) cutOffTailIfNeeded(type, !1); else { if ( @@ -10182,11 +10160,11 @@ function completeWork(current, workInProgress, renderLanes) { (null !== current && 0 !== (current.flags & 128)) ) for (current = workInProgress.child; null !== current; ) { - cache$147 = findFirstSuspended(current); - if (null !== cache$147) { + cache$146 = findFirstSuspended(current); + if (null !== cache$146) { workInProgress.flags |= 128; cutOffTailIfNeeded(type, !1); - current = cache$147.updateQueue; + current = cache$146.updateQueue; workInProgress.updateQueue = current; scheduleRetryEffect(workInProgress, current); workInProgress.subtreeFlags = 0; @@ -10211,7 +10189,7 @@ function completeWork(current, workInProgress, renderLanes) { } else { if (!newProps) - if (((current = findFirstSuspended(cache$147)), null !== current)) { + if (((current = findFirstSuspended(cache$146)), null !== current)) { if ( ((workInProgress.flags |= 128), (newProps = !0), @@ -10221,7 +10199,7 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(type, !0), null === type.tail && "hidden" === type.tailMode && - !cache$147.alternate && + !cache$146.alternate && !isHydrating) ) return bubbleProperties(workInProgress), null; @@ -10234,13 +10212,13 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(type, !1), (workInProgress.lanes = 4194304)); type.isBackwards - ? ((cache$147.sibling = workInProgress.child), - (workInProgress.child = cache$147)) + ? ((cache$146.sibling = workInProgress.child), + (workInProgress.child = cache$146)) : ((current = type.last), null !== current - ? (current.sibling = cache$147) - : (workInProgress.child = cache$147), - (type.last = cache$147)); + ? (current.sibling = cache$146) + : (workInProgress.child = cache$146), + (type.last = cache$146)); } if (null !== type.tail) return ( @@ -10651,8 +10629,7 @@ function scheduleUpdateOnFiber(root, fiber, lane) { markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane, - workInProgressRootDidSkipSuspendedSiblings + workInProgressDeferredLane ); markRootUpdated(root, lane); if (0 === (executionContext & 2) || root !== workInProgressRoot) @@ -10663,179 +10640,159 @@ function scheduleUpdateOnFiber(root, fiber, lane) { markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane, - workInProgressRootDidSkipSuspendedSiblings + workInProgressDeferredLane )), ensureRootIsScheduled(root); } -function performConcurrentWorkOnRoot(root, didTimeout) { +function performWorkOnRoot(root$jscomp$0, lanes, forceSync) { if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(327)); - var originalCallbackNode = root.callbackNode; - if (flushPassiveEffects() && root.callbackNode !== originalCallbackNode) - return null; - var lanes = getNextLanes( - root, - root === workInProgressRoot ? workInProgressRootRenderLanes : 0 - ); - if (0 === lanes) return null; var shouldTimeSlice = - 0 === (lanes & 60) && 0 === (lanes & root.expiredLanes) && !didTimeout; - didTimeout = shouldTimeSlice - ? renderRootConcurrent(root, lanes) - : renderRootSync(root, lanes); - if (0 !== didTimeout) { + (!forceSync && + 0 === (lanes & 60) && + 0 === (lanes & root$jscomp$0.expiredLanes)) || + !1, + exitStatus = shouldTimeSlice + ? renderRootConcurrent(root$jscomp$0, lanes) + : renderRootSync(root$jscomp$0, lanes, !0); + do { var renderWasConcurrent = shouldTimeSlice; - do { - if (6 === didTimeout) - markRootSuspended( - root, - lanes, - 0, - workInProgressRootDidSkipSuspendedSiblings - ); - else { - shouldTimeSlice = root.current.alternate; - if ( - renderWasConcurrent && - !isRenderConsistentWithExternalStores(shouldTimeSlice) - ) { - didTimeout = renderRootSync(root, lanes); - renderWasConcurrent = !1; - continue; - } - if (2 === didTimeout) { - renderWasConcurrent = lanes; - var errorRetryLanes = getLanesToRetrySynchronouslyOnError( - root, - renderWasConcurrent - ); - if ( - 0 !== errorRetryLanes && - ((lanes = errorRetryLanes), - (didTimeout = recoverFromConcurrentError( + if (0 === exitStatus) break; + else if (6 === exitStatus) markRootSuspended(root$jscomp$0, lanes, 0); + else { + forceSync = root$jscomp$0.current.alternate; + if ( + renderWasConcurrent && + !isRenderConsistentWithExternalStores(forceSync) + ) { + exitStatus = renderRootSync(root$jscomp$0, lanes, !1); + continue; + } + if (2 === exitStatus) { + renderWasConcurrent = lanes; + if (root$jscomp$0.errorRecoveryDisabledLanes & renderWasConcurrent) + var JSCompiler_inline_result = 0; + else + (JSCompiler_inline_result = root$jscomp$0.pendingLanes & -536870913), + (JSCompiler_inline_result = + 0 !== JSCompiler_inline_result + ? JSCompiler_inline_result + : JSCompiler_inline_result & 536870912 + ? 536870912 + : 0); + if (0 !== JSCompiler_inline_result) { + lanes = JSCompiler_inline_result; + a: { + var root = root$jscomp$0; + exitStatus = workInProgressRootConcurrentErrors; + var wasRootDehydrated = root.current.memoizedState.isDehydrated; + wasRootDehydrated && + (prepareFreshStack(root, JSCompiler_inline_result).flags |= 256); + JSCompiler_inline_result = renderRootSync( root, - renderWasConcurrent, - errorRetryLanes - )), - (renderWasConcurrent = !1), - 2 !== didTimeout) - ) - continue; - } - if (1 === didTimeout) { - prepareFreshStack(root, 0); - markRootSuspended( - root, - lanes, - 0, - workInProgressRootDidSkipSuspendedSiblings - ); - break; - } - a: { - renderWasConcurrent = root; - switch (didTimeout) { - case 0: - case 1: - throw Error(formatProdErrorMessage(345)); - case 4: - if ((lanes & 4194176) === lanes) { - markRootSuspended( - renderWasConcurrent, - lanes, - workInProgressDeferredLane, - workInProgressRootDidSkipSuspendedSiblings - ); + JSCompiler_inline_result, + !1 + ); + if (2 !== JSCompiler_inline_result) { + if ( + workInProgressRootDidAttachPingListener && + !wasRootDehydrated + ) { + root.errorRecoveryDisabledLanes |= renderWasConcurrent; + workInProgressRootInterleavedUpdatedLanes |= + renderWasConcurrent; + exitStatus = 4; break a; } - break; - case 2: - workInProgressRootRecoverableErrors = null; - break; - case 3: - case 5: - break; - default: - throw Error(formatProdErrorMessage(329)); + renderWasConcurrent = workInProgressRootRecoverableErrors; + workInProgressRootRecoverableErrors = exitStatus; + null !== renderWasConcurrent && + queueRecoverableErrors(renderWasConcurrent); + } + exitStatus = JSCompiler_inline_result; } - renderWasConcurrent.finishedWork = shouldTimeSlice; - renderWasConcurrent.finishedLanes = lanes; - if ( - (lanes & 62914560) === lanes && - ((didTimeout = globalMostRecentFallbackTime + 300 - now()), - 10 < didTimeout) - ) { - markRootSuspended( - renderWasConcurrent, - lanes, - workInProgressDeferredLane, - workInProgressRootDidSkipSuspendedSiblings - ); - if (0 !== getNextLanes(renderWasConcurrent, 0)) break a; - renderWasConcurrent.timeoutHandle = scheduleTimeout( - commitRootWhenReady.bind( - null, - renderWasConcurrent, + if (2 !== exitStatus) continue; + } + } + if (1 === exitStatus) { + prepareFreshStack(root$jscomp$0, 0); + markRootSuspended(root$jscomp$0, lanes, 0); + break; + } + a: { + shouldTimeSlice = root$jscomp$0; + switch (exitStatus) { + case 0: + case 1: + throw Error(formatProdErrorMessage(345)); + case 4: + if ((lanes & 4194176) === lanes) { + markRootSuspended( shouldTimeSlice, - workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, lanes, - workInProgressDeferredLane, - workInProgressRootInterleavedUpdatedLanes, - workInProgressSuspendedRetryLanes, - workInProgressRootDidSkipSuspendedSiblings - ), - didTimeout - ); - break a; - } - commitRootWhenReady( - renderWasConcurrent, - shouldTimeSlice, - workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, - lanes, - workInProgressDeferredLane, - workInProgressRootInterleavedUpdatedLanes, - workInProgressSuspendedRetryLanes, - workInProgressRootDidSkipSuspendedSiblings + workInProgressDeferredLane + ); + break a; + } + break; + case 2: + workInProgressRootRecoverableErrors = null; + break; + case 3: + case 5: + break; + default: + throw Error(formatProdErrorMessage(329)); + } + shouldTimeSlice.finishedWork = forceSync; + shouldTimeSlice.finishedLanes = lanes; + if ( + (lanes & 62914560) === lanes && + ((renderWasConcurrent = globalMostRecentFallbackTime + 300 - now()), + 10 < renderWasConcurrent) + ) { + markRootSuspended(shouldTimeSlice, lanes, workInProgressDeferredLane); + if (0 !== getNextLanes(shouldTimeSlice, 0)) break a; + shouldTimeSlice.timeoutHandle = scheduleTimeout( + commitRootWhenReady.bind( + null, + shouldTimeSlice, + forceSync, + workInProgressRootRecoverableErrors, + workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, + lanes, + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + workInProgressRootDidSkipSuspendedSiblings, + 2, + -0, + 0 + ), + renderWasConcurrent ); + break a; } + commitRootWhenReady( + shouldTimeSlice, + forceSync, + workInProgressRootRecoverableErrors, + workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, + lanes, + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + workInProgressRootDidSkipSuspendedSiblings, + 0, + -0, + 0 + ); } - break; - } while (1); - } - ensureRootIsScheduled(root); - scheduleTaskForRootDuringMicrotask(root, now()); - root = - root.callbackNode === originalCallbackNode - ? performConcurrentWorkOnRoot.bind(null, root) - : null; - return root; -} -function recoverFromConcurrentError( - root, - originallyAttemptedLanes, - errorRetryLanes -) { - var errorsFromFirstAttempt = workInProgressRootConcurrentErrors, - wasRootDehydrated = root.current.memoizedState.isDehydrated; - wasRootDehydrated && (prepareFreshStack(root, errorRetryLanes).flags |= 256); - errorRetryLanes = renderRootSync(root, errorRetryLanes); - if (2 !== errorRetryLanes) { - if (workInProgressRootDidAttachPingListener && !wasRootDehydrated) - return ( - (root.errorRecoveryDisabledLanes |= originallyAttemptedLanes), - (workInProgressRootInterleavedUpdatedLanes |= originallyAttemptedLanes), - 4 - ); - root = workInProgressRootRecoverableErrors; - workInProgressRootRecoverableErrors = errorsFromFirstAttempt; - null !== root && queueRecoverableErrors(root); - } - return errorRetryLanes; + } + break; + } while (1); + ensureRootIsScheduled(root$jscomp$0); } function queueRecoverableErrors(errors) { null === workInProgressRootRecoverableErrors @@ -10855,10 +10812,16 @@ function commitRootWhenReady( spawnedLane, updatedLanes, suspendedRetryLanes, - didSkipSuspendedSiblings + didSkipSuspendedSiblings, + suspendedCommitReason, + completedRenderStartTime, + completedRenderEndTime ) { - var subtreeFlags = finishedWork.subtreeFlags; - if (subtreeFlags & 8192 || 16785408 === (subtreeFlags & 16785408)) + didSkipSuspendedSiblings = finishedWork.subtreeFlags; + if ( + didSkipSuspendedSiblings & 8192 || + 16785408 === (didSkipSuspendedSiblings & 16785408) + ) if ( ((suspendedState = { stylesheets: null, count: 0, unsuspend: noop }), accumulateSuspenseyCommitOnFiber(finishedWork), @@ -10874,10 +10837,13 @@ function commitRootWhenReady( didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes + suspendedRetryLanes, + 1, + completedRenderStartTime, + completedRenderEndTime ) ); - markRootSuspended(root, lanes, spawnedLane, didSkipSuspendedSiblings); + markRootSuspended(root, lanes, spawnedLane); return; } commitRoot( @@ -10887,7 +10853,10 @@ function commitRootWhenReady( didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes + suspendedRetryLanes, + suspendedCommitReason, + completedRenderStartTime, + completedRenderEndTime ); } function isRenderConsistentWithExternalStores(finishedWork) { @@ -10933,77 +10902,24 @@ function markRootUpdated(root, updatedLanes) { : executionContext & 4 && (didIncludeCommitPhaseUpdate = !0); throwIfInfiniteUpdateLoopDetected(); } -function markRootSuspended( - root, - suspendedLanes, - spawnedLane, - didSkipSuspendedSiblings -) { +function markRootSuspended(root, suspendedLanes, spawnedLane) { suspendedLanes &= ~workInProgressRootPingedLanes; suspendedLanes &= ~workInProgressRootInterleavedUpdatedLanes; root.suspendedLanes |= suspendedLanes; root.pingedLanes &= ~suspendedLanes; - didSkipSuspendedSiblings || (root.warmLanes |= suspendedLanes); - didSkipSuspendedSiblings = root.expirationTimes; - for (var lanes = suspendedLanes; 0 < lanes; ) { - var index$6 = 31 - clz32(lanes), - lane = 1 << index$6; - didSkipSuspendedSiblings[index$6] = -1; + for ( + var expirationTimes = root.expirationTimes, lanes = suspendedLanes; + 0 < lanes; + + ) { + var index$5 = 31 - clz32(lanes), + lane = 1 << index$5; + expirationTimes[index$5] = -1; lanes &= ~lane; } 0 !== spawnedLane && markSpawnedDeferredLane(root, spawnedLane, suspendedLanes); } -function performSyncWorkOnRoot(root, lanes) { - if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(327)); - if (flushPassiveEffects()) return ensureRootIsScheduled(root), null; - var exitStatus = renderRootSync(root, lanes); - if (2 === exitStatus) { - var originallyAttemptedLanes = lanes, - errorRetryLanes = getLanesToRetrySynchronouslyOnError( - root, - originallyAttemptedLanes - ); - 0 !== errorRetryLanes && - ((lanes = errorRetryLanes), - (exitStatus = recoverFromConcurrentError( - root, - originallyAttemptedLanes, - errorRetryLanes - ))); - } - if (1 === exitStatus) - return ( - prepareFreshStack(root, 0), - markRootSuspended(root, lanes, 0, !1), - ensureRootIsScheduled(root), - null - ); - if (6 === exitStatus) - return ( - markRootSuspended( - root, - lanes, - workInProgressDeferredLane, - workInProgressRootDidSkipSuspendedSiblings - ), - ensureRootIsScheduled(root), - null - ); - root.finishedWork = root.current.alternate; - root.finishedLanes = lanes; - commitRoot( - root, - workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, - workInProgressDeferredLane, - workInProgressRootInterleavedUpdatedLanes, - workInProgressSuspendedRetryLanes - ); - ensureRootIsScheduled(root); - return null; -} function flushSyncWork$1() { return 0 === (executionContext & 6) ? (flushSyncWorkAcrossRoots_impl(0, !1), !1) @@ -11041,8 +10957,9 @@ function prepareFreshStack(root, lanes) { workInProgressRootRenderLanes = lanes; workInProgressSuspendedReason = 0; workInProgressThrownValue = null; - workInProgressRootDidAttachPingListener = - workInProgressRootDidSkipSuspendedSiblings = !1; + workInProgressRootDidSkipSuspendedSiblings = !1; + checkIfRootIsPrerendering(root, lanes); + workInProgressRootDidAttachPingListener = !1; workInProgressSuspendedRetryLanes = workInProgressDeferredLane = workInProgressRootPingedLanes = @@ -11061,9 +10978,9 @@ function prepareFreshStack(root, lanes) { 0 < allEntangledLanes; ) { - var index$4 = 31 - clz32(allEntangledLanes), - lane = 1 << index$4; - lanes |= root[index$4]; + var index$3 = 31 - clz32(allEntangledLanes), + lane = 1 << index$3; + lanes |= root[index$3]; allEntangledLanes &= ~lane; } entangledRenderLanes = lanes; @@ -11133,8 +11050,7 @@ function renderDidSuspendDelayIfPossible() { markRootSuspended( workInProgressRoot, workInProgressRootRenderLanes, - workInProgressDeferredLane, - workInProgressRootDidSkipSuspendedSiblings + workInProgressDeferredLane ); } function queueConcurrentError(error) { @@ -11150,6 +11066,7 @@ function renderRootSync(root, lanes) { if (workInProgressRoot !== root || workInProgressRootRenderLanes !== lanes) (workInProgressTransitions = null), prepareFreshStack(root, lanes); lanes = !1; + var exitStatus = workInProgressRootExitStatus; a: do try { if (0 !== workInProgressSuspendedReason && null !== workInProgress) { @@ -11158,21 +11075,26 @@ function renderRootSync(root, lanes) { switch (workInProgressSuspendedReason) { case 8: resetWorkInProgressStack(); - workInProgressRootExitStatus = 6; + exitStatus = 6; break a; case 3: case 2: - lanes || - null !== suspenseHandlerStackCursor.current || - (lanes = !0); - default: + case 6: + null === suspenseHandlerStackCursor.current && (lanes = !0); var reason = workInProgressSuspendedReason; workInProgressSuspendedReason = 0; workInProgressThrownValue = null; throwAndUnwindWorkLoop(root, unitOfWork, thrownValue, reason); + break; + default: + (reason = workInProgressSuspendedReason), + (workInProgressSuspendedReason = 0), + (workInProgressThrownValue = null), + throwAndUnwindWorkLoop(root, unitOfWork, thrownValue, reason); } } workLoopSync(); + exitStatus = workInProgressRootExitStatus; break; } catch (thrownValue$163) { handleThrow(root, thrownValue$163); @@ -11183,11 +11105,11 @@ function renderRootSync(root, lanes) { executionContext = prevExecutionContext; ReactSharedInternals.H = prevDispatcher; ReactSharedInternals.A = prevAsyncDispatcher; - if (null !== workInProgress) throw Error(formatProdErrorMessage(261)); - workInProgressRoot = null; - workInProgressRootRenderLanes = 0; - finishQueueingConcurrentUpdates(); - return workInProgressRootExitStatus; + null === workInProgress && + ((workInProgressRoot = null), + (workInProgressRootRenderLanes = 0), + finishQueueingConcurrentUpdates()); + return exitStatus; } function workLoopSync() { for (; null !== workInProgress; ) performUnitOfWork(workInProgress); @@ -11197,10 +11119,11 @@ function renderRootConcurrent(root, lanes) { executionContext |= 2; var prevDispatcher = pushDispatcher(), prevAsyncDispatcher = pushAsyncDispatcher(); - if (workInProgressRoot !== root || workInProgressRootRenderLanes !== lanes) - (workInProgressTransitions = null), + workInProgressRoot !== root || workInProgressRootRenderLanes !== lanes + ? ((workInProgressTransitions = null), (workInProgressRootRenderTargetTime = now() + 500), - prepareFreshStack(root, lanes); + prepareFreshStack(root, lanes)) + : checkIfRootIsPrerendering(root, lanes); a: do try { if (0 !== workInProgressSuspendedReason && null !== workInProgress) { @@ -11440,7 +11363,10 @@ function commitRoot( didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes + suspendedRetryLanes, + suspendedCommitReason, + completedRenderStartTime, + completedRenderEndTime ) { var prevTransition = ReactSharedInternals.T, previousUpdateLanePriority = ReactDOMSharedInternals.p; @@ -11455,13 +11381,15 @@ function commitRoot( previousUpdateLanePriority, spawnedLane, updatedLanes, - suspendedRetryLanes + suspendedRetryLanes, + suspendedCommitReason, + completedRenderStartTime, + completedRenderEndTime ); } finally { (ReactSharedInternals.T = prevTransition), (ReactDOMSharedInternals.p = previousUpdateLanePriority); } - return null; } function commitRootImpl( root, @@ -11469,9 +11397,7 @@ function commitRootImpl( transitions, didIncludeRenderPhaseUpdate, renderPriorityLevel, - spawnedLane, - updatedLanes, - suspendedRetryLanes + spawnedLane ) { do flushPassiveEffects(); while (null !== rootWithPendingPassiveEffects); @@ -11487,14 +11413,7 @@ function commitRootImpl( root.cancelPendingCommit = null; var remainingLanes = finishedWork.lanes | finishedWork.childLanes; remainingLanes |= concurrentlyUpdatedLanes; - markRootFinished( - root, - lanes, - remainingLanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes - ); + markRootFinished(root, lanes, remainingLanes, spawnedLane); didIncludeCommitPhaseUpdate = !1; root === workInProgressRoot && ((workInProgress = workInProgressRoot = null), @@ -11506,29 +11425,29 @@ function commitRootImpl( (pendingPassiveEffectsRemainingLanes = remainingLanes), (pendingPassiveTransitions = transitions), scheduleCallback$1(NormalPriority$1, function () { - flushPassiveEffects(); + flushPassiveEffects(!0); return null; })); transitions = 0 !== (finishedWork.flags & 15990); - 0 !== (finishedWork.subtreeFlags & 15990) || transitions - ? ((transitions = ReactSharedInternals.T), - (ReactSharedInternals.T = null), - (spawnedLane = ReactDOMSharedInternals.p), - (ReactDOMSharedInternals.p = 2), - (updatedLanes = executionContext), - (executionContext |= 4), - commitBeforeMutationEffects(root, finishedWork), - commitMutationEffectsOnFiber(finishedWork, root), - restoreSelection(selectionInformation, root.containerInfo), - (_enabled = !!eventsEnabled), - (selectionInformation = eventsEnabled = null), - (root.current = finishedWork), - commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork), - requestPaint(), - (executionContext = updatedLanes), - (ReactDOMSharedInternals.p = spawnedLane), - (ReactSharedInternals.T = transitions)) - : (root.current = finishedWork); + if (0 !== (finishedWork.subtreeFlags & 15990) || transitions) { + transitions = ReactSharedInternals.T; + ReactSharedInternals.T = null; + spawnedLane = ReactDOMSharedInternals.p; + ReactDOMSharedInternals.p = 2; + var prevExecutionContext = executionContext; + executionContext |= 4; + commitBeforeMutationEffects(root, finishedWork); + commitMutationEffectsOnFiber(finishedWork, root); + restoreSelection(selectionInformation, root.containerInfo); + _enabled = !!eventsEnabled; + selectionInformation = eventsEnabled = null; + root.current = finishedWork; + commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork); + requestPaint(); + executionContext = prevExecutionContext; + ReactDOMSharedInternals.p = spawnedLane; + ReactSharedInternals.T = transitions; + } else root.current = finishedWork; rootDoesHavePassiveEffects ? ((rootDoesHavePassiveEffects = !1), (rootWithPendingPassiveEffects = root), @@ -11730,7 +11649,7 @@ function resolveRetryWakeable(boundaryFiber, wakeable) { retryTimedOutBoundary(boundaryFiber, retryLane); } function throwIfInfiniteUpdateLoopDetected() { - if (50 < nestedUpdateCount) + if (100 < nestedUpdateCount) throw ( ((nestedUpdateCount = 0), (rootWithNestedUpdates = null), @@ -11794,7 +11713,8 @@ function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) { root$171, root$171 === workInProgressRoot ? JSCompiler_inline_result : 0 )), - 0 !== (JSCompiler_inline_result & 3) && + 0 === (JSCompiler_inline_result & 3) || + checkIfRootIsPrerendering(root$171, JSCompiler_inline_result) || ((didPerformSomeWork = !0), performSyncWorkOnRoot(root$171, JSCompiler_inline_result)); root$171 = root$171.next; @@ -11838,12 +11758,12 @@ function scheduleTaskForRootDuringMicrotask(root, currentTime) { 0 < lanes; ) { - var index$5 = 31 - clz32(lanes), - lane = 1 << index$5, - expirationTime = expirationTimes[index$5]; + var index$4 = 31 - clz32(lanes), + lane = 1 << index$4, + expirationTime = expirationTimes[index$4]; if (-1 === expirationTime) { if (0 === (lane & suspendedLanes) || 0 !== (lane & pingedLanes)) - expirationTimes[index$5] = computeExpirationTime(lane, currentTime); + expirationTimes[index$4] = computeExpirationTime(lane, currentTime); } else expirationTime <= currentTime && (root.expiredLanes |= lane); lanes &= ~lane; } @@ -11880,8 +11800,6 @@ function scheduleTaskForRootDuringMicrotask(root, currentTime) { null !== pingedLanes && cancelCallback$1(pingedLanes); switch (lanesToEventPriority(suspendedLanes)) { case 2: - suspendedLanes = ImmediatePriority; - break; case 8: suspendedLanes = UserBlockingPriority; break; @@ -11894,12 +11812,32 @@ function scheduleTaskForRootDuringMicrotask(root, currentTime) { default: suspendedLanes = NormalPriority$1; } - pingedLanes = performConcurrentWorkOnRoot.bind(null, root); + pingedLanes = performWorkOnRootViaSchedulerTask.bind(null, root); suspendedLanes = scheduleCallback$3(suspendedLanes, pingedLanes); root.callbackPriority = currentTime; root.callbackNode = suspendedLanes; return currentTime; } +function performWorkOnRootViaSchedulerTask(root, didTimeout) { + var originalCallbackNode = root.callbackNode; + if (flushPassiveEffects() && root.callbackNode !== originalCallbackNode) + return null; + var workInProgressRootRenderLanes$jscomp$0 = workInProgressRootRenderLanes; + workInProgressRootRenderLanes$jscomp$0 = getNextLanes( + root, + root === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0 + ); + if (0 === workInProgressRootRenderLanes$jscomp$0) return null; + performWorkOnRoot(root, workInProgressRootRenderLanes$jscomp$0, didTimeout); + scheduleTaskForRootDuringMicrotask(root, now()); + return root.callbackNode === originalCallbackNode + ? performWorkOnRootViaSchedulerTask.bind(null, root) + : null; +} +function performSyncWorkOnRoot(root, lanes) { + if (flushPassiveEffects()) return null; + performWorkOnRoot(root, lanes, !0); +} function scheduleImmediateTask(cb) { scheduleMicrotask(function () { 0 !== (executionContext & 6) @@ -12007,20 +11945,20 @@ function extractEvents$1( } } for ( - var i$jscomp$inline_1433 = 0; - i$jscomp$inline_1433 < simpleEventPluginEvents.length; - i$jscomp$inline_1433++ + var i$jscomp$inline_1439 = 0; + i$jscomp$inline_1439 < simpleEventPluginEvents.length; + i$jscomp$inline_1439++ ) { - var eventName$jscomp$inline_1434 = - simpleEventPluginEvents[i$jscomp$inline_1433], - domEventName$jscomp$inline_1435 = - eventName$jscomp$inline_1434.toLowerCase(), - capitalizedEvent$jscomp$inline_1436 = - eventName$jscomp$inline_1434[0].toUpperCase() + - eventName$jscomp$inline_1434.slice(1); + var eventName$jscomp$inline_1440 = + simpleEventPluginEvents[i$jscomp$inline_1439], + domEventName$jscomp$inline_1441 = + eventName$jscomp$inline_1440.toLowerCase(), + capitalizedEvent$jscomp$inline_1442 = + eventName$jscomp$inline_1440[0].toUpperCase() + + eventName$jscomp$inline_1440.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1435, - "on" + capitalizedEvent$jscomp$inline_1436 + domEventName$jscomp$inline_1441, + "on" + capitalizedEvent$jscomp$inline_1442 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -15518,16 +15456,16 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) { 0 === i && attemptExplicitHydrationTarget(target); } }; -var isomorphicReactPackageVersion$jscomp$inline_1680 = React.version; +var isomorphicReactPackageVersion$jscomp$inline_1686 = React.version; if ( - "19.0.0-experimental-5d19e1c8-20240923" !== - isomorphicReactPackageVersion$jscomp$inline_1680 + "19.0.0-experimental-778e1ed2-20240926" !== + isomorphicReactPackageVersion$jscomp$inline_1686 ) throw Error( formatProdErrorMessage( 527, - isomorphicReactPackageVersion$jscomp$inline_1680, - "19.0.0-experimental-5d19e1c8-20240923" + isomorphicReactPackageVersion$jscomp$inline_1686, + "19.0.0-experimental-778e1ed2-20240926" ) ); ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { @@ -15547,25 +15485,25 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { null === componentOrElement ? null : componentOrElement.stateNode; return componentOrElement; }; -var internals$jscomp$inline_2145 = { +var internals$jscomp$inline_2156 = { bundleType: 0, - version: "19.0.0-experimental-5d19e1c8-20240923", + version: "19.0.0-experimental-778e1ed2-20240926", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, findFiberByHostInstance: getClosestInstanceFromNode, - reconcilerVersion: "19.0.0-experimental-5d19e1c8-20240923" + reconcilerVersion: "19.0.0-experimental-778e1ed2-20240926" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_2146 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_2157 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_2146.isDisabled && - hook$jscomp$inline_2146.supportsFiber + !hook$jscomp$inline_2157.isDisabled && + hook$jscomp$inline_2157.supportsFiber ) try { - (rendererID = hook$jscomp$inline_2146.inject( - internals$jscomp$inline_2145 + (rendererID = hook$jscomp$inline_2157.inject( + internals$jscomp$inline_2156 )), - (injectedHook = hook$jscomp$inline_2146); + (injectedHook = hook$jscomp$inline_2157); } catch (err) {} } exports.createComponentSelector = function (component) { @@ -15808,4 +15746,4 @@ exports.observeVisibleRects = function ( } }; }; -exports.version = "19.0.0-experimental-5d19e1c8-20240923"; +exports.version = "19.0.0-experimental-778e1ed2-20240926"; diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom.development.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom.development.js index 048e2ee0039c8..a62200a9e19a9 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom.development.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom.development.js @@ -416,7 +416,7 @@ exports.useFormStatus = function () { return resolveDispatcher().useHostTransitionStatus(); }; - exports.version = "19.0.0-experimental-5d19e1c8-20240923"; + exports.version = "19.0.0-experimental-778e1ed2-20240926"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom.production.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom.production.js index ae8d05d7bea34..5e82f5cd78f96 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom.production.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom.production.js @@ -207,4 +207,4 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactSharedInternals.H.useHostTransitionStatus(); }; -exports.version = "19.0.0-experimental-5d19e1c8-20240923"; +exports.version = "19.0.0-experimental-778e1ed2-20240926"; diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom.react-server.development.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom.react-server.development.js index b3db1f291ed99..45513d75d8ba3 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom.react-server.development.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom.react-server.development.js @@ -336,5 +336,5 @@ })) : Internals.d.m(href)); }; - exports.version = "19.0.0-experimental-5d19e1c8-20240923"; + exports.version = "19.0.0-experimental-778e1ed2-20240926"; })(); diff --git a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom.react-server.production.js b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom.react-server.production.js index 353a895622fbb..1a53d7dc26874 100644 --- a/packages/next/src/compiled/react-dom-experimental/cjs/react-dom.react-server.production.js +++ b/packages/next/src/compiled/react-dom-experimental/cjs/react-dom.react-server.production.js @@ -149,4 +149,4 @@ exports.preloadModule = function (href, options) { }); } else Internals.d.m(href); }; -exports.version = "19.0.0-experimental-5d19e1c8-20240923"; +exports.version = "19.0.0-experimental-778e1ed2-20240926"; diff --git a/packages/next/src/compiled/react-dom-experimental/package.json b/packages/next/src/compiled/react-dom-experimental/package.json index 59d683cb5b760..a4e721c17eb8a 100644 --- a/packages/next/src/compiled/react-dom-experimental/package.json +++ b/packages/next/src/compiled/react-dom-experimental/package.json @@ -72,10 +72,10 @@ "./package.json": "./package.json" }, "dependencies": { - "scheduler": "0.0.0-experimental-5d19e1c8-20240923" + "scheduler": "0.0.0-experimental-778e1ed2-20240926" }, "peerDependencies": { - "react": "0.0.0-experimental-5d19e1c8-20240923" + "react": "0.0.0-experimental-778e1ed2-20240926" }, "browser": { "./server.js": "./server.browser.js", diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom-client.development.js b/packages/next/src/compiled/react-dom/cjs/react-dom-client.development.js index 49e3eba4eb2ac..cbc09d68642dd 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom-client.development.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom-client.development.js @@ -998,43 +998,39 @@ var pendingLanes = root.pendingLanes; if (0 === pendingLanes) return 0; var nextLanes = 0, - suspendedLanes = root.suspendedLanes, - pingedLanes = root.pingedLanes, - warmLanes = root.warmLanes; - root = 0 !== root.finishedLanes; + suspendedLanes = root.suspendedLanes; + root = root.pingedLanes; var nonIdlePendingLanes = pendingLanes & 134217727; 0 !== nonIdlePendingLanes ? ((pendingLanes = nonIdlePendingLanes & ~suspendedLanes), 0 !== pendingLanes ? (nextLanes = getHighestPriorityLanes(pendingLanes)) - : ((pingedLanes &= nonIdlePendingLanes), - 0 !== pingedLanes - ? (nextLanes = getHighestPriorityLanes(pingedLanes)) - : root || - ((warmLanes = nonIdlePendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes))))) - : ((nonIdlePendingLanes = pendingLanes & ~suspendedLanes), - 0 !== nonIdlePendingLanes - ? (nextLanes = getHighestPriorityLanes(nonIdlePendingLanes)) - : 0 !== pingedLanes - ? (nextLanes = getHighestPriorityLanes(pingedLanes)) - : root || - ((warmLanes = pendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes)))); + : ((root &= nonIdlePendingLanes), + 0 !== root && (nextLanes = getHighestPriorityLanes(root)))) + : ((pendingLanes &= ~suspendedLanes), + 0 !== pendingLanes + ? (nextLanes = getHighestPriorityLanes(pendingLanes)) + : 0 !== root && (nextLanes = getHighestPriorityLanes(root))); return 0 === nextLanes ? 0 : 0 !== wipLanes && wipLanes !== nextLanes && 0 === (wipLanes & suspendedLanes) && ((suspendedLanes = nextLanes & -nextLanes), - (warmLanes = wipLanes & -wipLanes), - suspendedLanes >= warmLanes || - (32 === suspendedLanes && 0 !== (warmLanes & 4194176))) + (root = wipLanes & -wipLanes), + suspendedLanes >= root || + (32 === suspendedLanes && 0 !== (root & 4194176))) ? wipLanes : nextLanes; } + function checkIfRootIsPrerendering(root, renderLanes) { + return ( + 0 === + (root.pendingLanes & + ~(root.suspendedLanes & ~root.pingedLanes) & + renderLanes) + ); + } function computeExpirationTime(lane, currentTime) { switch (lane) { case 1: @@ -1081,14 +1077,6 @@ ); } } - function getLanesToRetrySynchronouslyOnError( - root, - originallyAttemptedLanes - ) { - if (root.errorRecoveryDisabledLanes & originallyAttemptedLanes) return 0; - root = root.pendingLanes & -536870913; - return 0 !== root ? root : root & 536870912 ? 536870912 : 0; - } function claimNextTransitionLane() { var lane = nextTransitionLane; nextTransitionLane <<= 1; @@ -1109,9 +1097,7 @@ root, finishedLanes, remainingLanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes + spawnedLane ) { var previouslyPendingLanes = root.pendingLanes; root.pendingLanes = remainingLanes; @@ -1122,17 +1108,17 @@ root.entangledLanes &= remainingLanes; root.errorRecoveryDisabledLanes &= remainingLanes; root.shellSuspendCounter = 0; - var entanglements = root.entanglements, - expirationTimes = root.expirationTimes, + finishedLanes = root.entanglements; + var expirationTimes = root.expirationTimes, hiddenUpdates = root.hiddenUpdates; for ( remainingLanes = previouslyPendingLanes & ~remainingLanes; 0 < remainingLanes; ) { - var index = 31 - clz32(remainingLanes), - lane = 1 << index; - entanglements[index] = 0; + var index = 31 - clz32(remainingLanes); + previouslyPendingLanes = 1 << index; + finishedLanes[index] = 0; expirationTimes[index] = -1; var hiddenUpdatesForLane = hiddenUpdates[index]; if (null !== hiddenUpdatesForLane) @@ -1144,14 +1130,9 @@ var update = hiddenUpdatesForLane[index]; null !== update && (update.lane &= -536870913); } - remainingLanes &= ~lane; + remainingLanes &= ~previouslyPendingLanes; } 0 !== spawnedLane && markSpawnedDeferredLane(root, spawnedLane, 0); - 0 !== suspendedRetryLanes && - 0 === updatedLanes && - 0 !== root.tag && - (root.suspendedLanes |= - suspendedRetryLanes & ~(previouslyPendingLanes & ~finishedLanes)); } function markSpawnedDeferredLane(root, spawnedLane, entangledLanes) { root.pendingLanes |= spawnedLane; @@ -8636,32 +8617,32 @@ return current; } function updateSuspenseComponent(current, workInProgress, renderLanes) { - var JSCompiler_object_inline_digest_2287; - var JSCompiler_object_inline_stack_2288 = workInProgress.pendingProps; + var JSCompiler_object_inline_digest_2296; + var JSCompiler_object_inline_stack_2297 = workInProgress.pendingProps; shouldSuspendImpl(workInProgress) && (workInProgress.flags |= 128); - var JSCompiler_object_inline_componentStack_2289 = !1; + var JSCompiler_object_inline_componentStack_2298 = !1; var didSuspend = 0 !== (workInProgress.flags & 128); - (JSCompiler_object_inline_digest_2287 = didSuspend) || - (JSCompiler_object_inline_digest_2287 = + (JSCompiler_object_inline_digest_2296 = didSuspend) || + (JSCompiler_object_inline_digest_2296 = null !== current && null === current.memoizedState ? !1 : 0 !== (suspenseStackCursor.current & ForceSuspenseFallback)); - JSCompiler_object_inline_digest_2287 && - ((JSCompiler_object_inline_componentStack_2289 = !0), + JSCompiler_object_inline_digest_2296 && + ((JSCompiler_object_inline_componentStack_2298 = !0), (workInProgress.flags &= -129)); - JSCompiler_object_inline_digest_2287 = 0 !== (workInProgress.flags & 32); + JSCompiler_object_inline_digest_2296 = 0 !== (workInProgress.flags & 32); workInProgress.flags &= -33; if (null === current) { if (isHydrating) { - JSCompiler_object_inline_componentStack_2289 + JSCompiler_object_inline_componentStack_2298 ? pushPrimaryTreeSuspenseHandler(workInProgress) : reuseSuspenseHandlerOnStack(workInProgress); if (isHydrating) { - var JSCompiler_object_inline_message_2286 = nextHydratableInstance; + var JSCompiler_object_inline_message_2295 = nextHydratableInstance; var JSCompiler_temp; - if (!(JSCompiler_temp = !JSCompiler_object_inline_message_2286)) { + if (!(JSCompiler_temp = !JSCompiler_object_inline_message_2295)) { c: { - var instance = JSCompiler_object_inline_message_2286; + var instance = JSCompiler_object_inline_message_2295; for ( JSCompiler_temp = rootOrSingletonContext; 8 !== instance.nodeType; @@ -8702,19 +8683,19 @@ JSCompiler_temp && (warnNonHydratedInstance( workInProgress, - JSCompiler_object_inline_message_2286 + JSCompiler_object_inline_message_2295 ), throwOnHydrationMismatch(workInProgress)); } - JSCompiler_object_inline_message_2286 = workInProgress.memoizedState; + JSCompiler_object_inline_message_2295 = workInProgress.memoizedState; if ( - null !== JSCompiler_object_inline_message_2286 && - ((JSCompiler_object_inline_message_2286 = - JSCompiler_object_inline_message_2286.dehydrated), - null !== JSCompiler_object_inline_message_2286) + null !== JSCompiler_object_inline_message_2295 && + ((JSCompiler_object_inline_message_2295 = + JSCompiler_object_inline_message_2295.dehydrated), + null !== JSCompiler_object_inline_message_2295) ) return ( - JSCompiler_object_inline_message_2286.data === + JSCompiler_object_inline_message_2295.data === SUSPENSE_FALLBACK_START_DATA ? (workInProgress.lanes = 16) : (workInProgress.lanes = 536870912), @@ -8722,58 +8703,58 @@ ); popSuspenseHandler(workInProgress); } - JSCompiler_object_inline_message_2286 = - JSCompiler_object_inline_stack_2288.children; - JSCompiler_object_inline_stack_2288 = - JSCompiler_object_inline_stack_2288.fallback; - if (JSCompiler_object_inline_componentStack_2289) + JSCompiler_object_inline_message_2295 = + JSCompiler_object_inline_stack_2297.children; + JSCompiler_object_inline_stack_2297 = + JSCompiler_object_inline_stack_2297.fallback; + if (JSCompiler_object_inline_componentStack_2298) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_componentStack_2289 = + (JSCompiler_object_inline_componentStack_2298 = workInProgress.mode), - (JSCompiler_object_inline_message_2286 = + (JSCompiler_object_inline_message_2295 = mountWorkInProgressOffscreenFiber( { mode: "hidden", - children: JSCompiler_object_inline_message_2286 + children: JSCompiler_object_inline_message_2295 }, - JSCompiler_object_inline_componentStack_2289 + JSCompiler_object_inline_componentStack_2298 )), - (JSCompiler_object_inline_stack_2288 = createFiberFromFragment( - JSCompiler_object_inline_stack_2288, - JSCompiler_object_inline_componentStack_2289, + (JSCompiler_object_inline_stack_2297 = createFiberFromFragment( + JSCompiler_object_inline_stack_2297, + JSCompiler_object_inline_componentStack_2298, renderLanes, null )), - (JSCompiler_object_inline_message_2286.return = workInProgress), - (JSCompiler_object_inline_stack_2288.return = workInProgress), - (JSCompiler_object_inline_message_2286.sibling = - JSCompiler_object_inline_stack_2288), - (workInProgress.child = JSCompiler_object_inline_message_2286), - (JSCompiler_object_inline_componentStack_2289 = + (JSCompiler_object_inline_message_2295.return = workInProgress), + (JSCompiler_object_inline_stack_2297.return = workInProgress), + (JSCompiler_object_inline_message_2295.sibling = + JSCompiler_object_inline_stack_2297), + (workInProgress.child = JSCompiler_object_inline_message_2295), + (JSCompiler_object_inline_componentStack_2298 = workInProgress.child), - (JSCompiler_object_inline_componentStack_2289.memoizedState = + (JSCompiler_object_inline_componentStack_2298.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_componentStack_2289.childLanes = + (JSCompiler_object_inline_componentStack_2298.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2287, + JSCompiler_object_inline_digest_2296, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2288 + JSCompiler_object_inline_stack_2297 ); pushPrimaryTreeSuspenseHandler(workInProgress); return mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_message_2286 + JSCompiler_object_inline_message_2295 ); } var prevState = current.memoizedState; if ( null !== prevState && - ((JSCompiler_object_inline_message_2286 = prevState.dehydrated), - null !== JSCompiler_object_inline_message_2286) + ((JSCompiler_object_inline_message_2295 = prevState.dehydrated), + null !== JSCompiler_object_inline_message_2295) ) { if (didSuspend) workInProgress.flags & 256 @@ -8790,94 +8771,94 @@ (workInProgress.flags |= 128), (workInProgress = null)) : (reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_componentStack_2289 = - JSCompiler_object_inline_stack_2288.fallback), - (JSCompiler_object_inline_message_2286 = workInProgress.mode), - (JSCompiler_object_inline_stack_2288 = + (JSCompiler_object_inline_componentStack_2298 = + JSCompiler_object_inline_stack_2297.fallback), + (JSCompiler_object_inline_message_2295 = workInProgress.mode), + (JSCompiler_object_inline_stack_2297 = mountWorkInProgressOffscreenFiber( { mode: "visible", - children: JSCompiler_object_inline_stack_2288.children + children: JSCompiler_object_inline_stack_2297.children }, - JSCompiler_object_inline_message_2286 + JSCompiler_object_inline_message_2295 )), - (JSCompiler_object_inline_componentStack_2289 = + (JSCompiler_object_inline_componentStack_2298 = createFiberFromFragment( - JSCompiler_object_inline_componentStack_2289, - JSCompiler_object_inline_message_2286, + JSCompiler_object_inline_componentStack_2298, + JSCompiler_object_inline_message_2295, renderLanes, null )), - (JSCompiler_object_inline_componentStack_2289.flags |= 2), - (JSCompiler_object_inline_stack_2288.return = workInProgress), - (JSCompiler_object_inline_componentStack_2289.return = + (JSCompiler_object_inline_componentStack_2298.flags |= 2), + (JSCompiler_object_inline_stack_2297.return = workInProgress), + (JSCompiler_object_inline_componentStack_2298.return = workInProgress), - (JSCompiler_object_inline_stack_2288.sibling = - JSCompiler_object_inline_componentStack_2289), - (workInProgress.child = JSCompiler_object_inline_stack_2288), + (JSCompiler_object_inline_stack_2297.sibling = + JSCompiler_object_inline_componentStack_2298), + (workInProgress.child = JSCompiler_object_inline_stack_2297), reconcileChildFibers( workInProgress, current.child, null, renderLanes ), - (JSCompiler_object_inline_stack_2288 = workInProgress.child), - (JSCompiler_object_inline_stack_2288.memoizedState = + (JSCompiler_object_inline_stack_2297 = workInProgress.child), + (JSCompiler_object_inline_stack_2297.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_stack_2288.childLanes = + (JSCompiler_object_inline_stack_2297.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2287, + JSCompiler_object_inline_digest_2296, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), (workInProgress = - JSCompiler_object_inline_componentStack_2289)); + JSCompiler_object_inline_componentStack_2298)); else if ( (pushPrimaryTreeSuspenseHandler(workInProgress), isHydrating && console.error( "We should not be hydrating here. This is a bug in React. Please file a bug." ), - JSCompiler_object_inline_message_2286.data === + JSCompiler_object_inline_message_2295.data === SUSPENSE_FALLBACK_START_DATA) ) { - JSCompiler_object_inline_digest_2287 = - JSCompiler_object_inline_message_2286.nextSibling && - JSCompiler_object_inline_message_2286.nextSibling.dataset; - if (JSCompiler_object_inline_digest_2287) { - JSCompiler_temp = JSCompiler_object_inline_digest_2287.dgst; - var message = JSCompiler_object_inline_digest_2287.msg; - instance = JSCompiler_object_inline_digest_2287.stck; - var componentStack = JSCompiler_object_inline_digest_2287.cstck; + JSCompiler_object_inline_digest_2296 = + JSCompiler_object_inline_message_2295.nextSibling && + JSCompiler_object_inline_message_2295.nextSibling.dataset; + if (JSCompiler_object_inline_digest_2296) { + JSCompiler_temp = JSCompiler_object_inline_digest_2296.dgst; + var message = JSCompiler_object_inline_digest_2296.msg; + instance = JSCompiler_object_inline_digest_2296.stck; + var componentStack = JSCompiler_object_inline_digest_2296.cstck; } - JSCompiler_object_inline_message_2286 = message; - JSCompiler_object_inline_digest_2287 = JSCompiler_temp; - JSCompiler_object_inline_stack_2288 = instance; - JSCompiler_object_inline_componentStack_2289 = componentStack; - JSCompiler_object_inline_message_2286 = - JSCompiler_object_inline_message_2286 - ? Error(JSCompiler_object_inline_message_2286) + JSCompiler_object_inline_message_2295 = message; + JSCompiler_object_inline_digest_2296 = JSCompiler_temp; + JSCompiler_object_inline_stack_2297 = instance; + JSCompiler_object_inline_componentStack_2298 = componentStack; + JSCompiler_object_inline_message_2295 = + JSCompiler_object_inline_message_2295 + ? Error(JSCompiler_object_inline_message_2295) : Error( "The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering." ); - JSCompiler_object_inline_message_2286.stack = - JSCompiler_object_inline_stack_2288 || ""; - JSCompiler_object_inline_message_2286.digest = - JSCompiler_object_inline_digest_2287; - JSCompiler_object_inline_digest_2287 = - void 0 === JSCompiler_object_inline_componentStack_2289 + JSCompiler_object_inline_message_2295.stack = + JSCompiler_object_inline_stack_2297 || ""; + JSCompiler_object_inline_message_2295.digest = + JSCompiler_object_inline_digest_2296; + JSCompiler_object_inline_digest_2296 = + void 0 === JSCompiler_object_inline_componentStack_2298 ? null - : JSCompiler_object_inline_componentStack_2289; - "string" === typeof JSCompiler_object_inline_digest_2287 && + : JSCompiler_object_inline_componentStack_2298; + "string" === typeof JSCompiler_object_inline_digest_2296 && CapturedStacks.set( - JSCompiler_object_inline_message_2286, - JSCompiler_object_inline_digest_2287 + JSCompiler_object_inline_message_2295, + JSCompiler_object_inline_digest_2296 ); queueHydrationError({ - value: JSCompiler_object_inline_message_2286, + value: JSCompiler_object_inline_message_2295, source: null, - stack: JSCompiler_object_inline_digest_2287 + stack: JSCompiler_object_inline_digest_2296 }); workInProgress = retrySuspenseComponentWithoutHydrating( current, @@ -8892,25 +8873,25 @@ renderLanes, !1 ), - (JSCompiler_object_inline_digest_2287 = + (JSCompiler_object_inline_digest_2296 = 0 !== (renderLanes & current.childLanes)), - didReceiveUpdate || JSCompiler_object_inline_digest_2287) + didReceiveUpdate || JSCompiler_object_inline_digest_2296) ) { - JSCompiler_object_inline_digest_2287 = workInProgressRoot; - if (null !== JSCompiler_object_inline_digest_2287) { - JSCompiler_object_inline_stack_2288 = renderLanes & -renderLanes; - if (0 !== (JSCompiler_object_inline_stack_2288 & 42)) - JSCompiler_object_inline_stack_2288 = 1; + JSCompiler_object_inline_digest_2296 = workInProgressRoot; + if (null !== JSCompiler_object_inline_digest_2296) { + JSCompiler_object_inline_stack_2297 = renderLanes & -renderLanes; + if (0 !== (JSCompiler_object_inline_stack_2297 & 42)) + JSCompiler_object_inline_stack_2297 = 1; else - switch (JSCompiler_object_inline_stack_2288) { + switch (JSCompiler_object_inline_stack_2297) { case 2: - JSCompiler_object_inline_stack_2288 = 1; + JSCompiler_object_inline_stack_2297 = 1; break; case 8: - JSCompiler_object_inline_stack_2288 = 4; + JSCompiler_object_inline_stack_2297 = 4; break; case 32: - JSCompiler_object_inline_stack_2288 = 16; + JSCompiler_object_inline_stack_2297 = 16; break; case 128: case 256: @@ -8931,40 +8912,40 @@ case 8388608: case 16777216: case 33554432: - JSCompiler_object_inline_stack_2288 = 64; + JSCompiler_object_inline_stack_2297 = 64; break; case 268435456: - JSCompiler_object_inline_stack_2288 = 134217728; + JSCompiler_object_inline_stack_2297 = 134217728; break; default: - JSCompiler_object_inline_stack_2288 = 0; + JSCompiler_object_inline_stack_2297 = 0; } - JSCompiler_object_inline_stack_2288 = + JSCompiler_object_inline_stack_2297 = 0 !== - (JSCompiler_object_inline_stack_2288 & - (JSCompiler_object_inline_digest_2287.suspendedLanes | + (JSCompiler_object_inline_stack_2297 & + (JSCompiler_object_inline_digest_2296.suspendedLanes | renderLanes)) ? 0 - : JSCompiler_object_inline_stack_2288; + : JSCompiler_object_inline_stack_2297; if ( - 0 !== JSCompiler_object_inline_stack_2288 && - JSCompiler_object_inline_stack_2288 !== prevState.retryLane + 0 !== JSCompiler_object_inline_stack_2297 && + JSCompiler_object_inline_stack_2297 !== prevState.retryLane ) throw ( - ((prevState.retryLane = JSCompiler_object_inline_stack_2288), + ((prevState.retryLane = JSCompiler_object_inline_stack_2297), enqueueConcurrentRenderForLane( current, - JSCompiler_object_inline_stack_2288 + JSCompiler_object_inline_stack_2297 ), scheduleUpdateOnFiber( - JSCompiler_object_inline_digest_2287, + JSCompiler_object_inline_digest_2296, current, - JSCompiler_object_inline_stack_2288 + JSCompiler_object_inline_stack_2297 ), SelectiveHydrationException) ); } - JSCompiler_object_inline_message_2286.data === + JSCompiler_object_inline_message_2295.data === SUSPENSE_PENDING_START_DATA || renderDidSuspendDelayIfPossible(); workInProgress = retrySuspenseComponentWithoutHydrating( current, @@ -8972,7 +8953,7 @@ renderLanes ); } else - JSCompiler_object_inline_message_2286.data === + JSCompiler_object_inline_message_2295.data === SUSPENSE_PENDING_START_DATA ? ((workInProgress.flags |= 128), (workInProgress.child = current.child), @@ -8980,12 +8961,12 @@ null, current )), - (JSCompiler_object_inline_message_2286._reactRetry = + (JSCompiler_object_inline_message_2295._reactRetry = workInProgress), (workInProgress = null)) : ((current = prevState.treeContext), (nextHydratableInstance = getNextHydratable( - JSCompiler_object_inline_message_2286.nextSibling + JSCompiler_object_inline_message_2295.nextSibling )), (hydrationParentFiber = workInProgress), (isHydrating = !0), @@ -9003,57 +8984,57 @@ (treeContextProvider = workInProgress)), (workInProgress = mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_stack_2288.children + JSCompiler_object_inline_stack_2297.children )), (workInProgress.flags |= 4096)); return workInProgress; } - if (JSCompiler_object_inline_componentStack_2289) + if (JSCompiler_object_inline_componentStack_2298) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_componentStack_2289 = - JSCompiler_object_inline_stack_2288.fallback), - (JSCompiler_object_inline_message_2286 = workInProgress.mode), + (JSCompiler_object_inline_componentStack_2298 = + JSCompiler_object_inline_stack_2297.fallback), + (JSCompiler_object_inline_message_2295 = workInProgress.mode), (JSCompiler_temp = current.child), (instance = JSCompiler_temp.sibling), - (JSCompiler_object_inline_stack_2288 = createWorkInProgress( + (JSCompiler_object_inline_stack_2297 = createWorkInProgress( JSCompiler_temp, { mode: "hidden", - children: JSCompiler_object_inline_stack_2288.children + children: JSCompiler_object_inline_stack_2297.children } )), - (JSCompiler_object_inline_stack_2288.subtreeFlags = + (JSCompiler_object_inline_stack_2297.subtreeFlags = JSCompiler_temp.subtreeFlags & 31457280), null !== instance - ? (JSCompiler_object_inline_componentStack_2289 = + ? (JSCompiler_object_inline_componentStack_2298 = createWorkInProgress( instance, - JSCompiler_object_inline_componentStack_2289 + JSCompiler_object_inline_componentStack_2298 )) - : ((JSCompiler_object_inline_componentStack_2289 = + : ((JSCompiler_object_inline_componentStack_2298 = createFiberFromFragment( - JSCompiler_object_inline_componentStack_2289, - JSCompiler_object_inline_message_2286, + JSCompiler_object_inline_componentStack_2298, + JSCompiler_object_inline_message_2295, renderLanes, null )), - (JSCompiler_object_inline_componentStack_2289.flags |= 2)), - (JSCompiler_object_inline_componentStack_2289.return = + (JSCompiler_object_inline_componentStack_2298.flags |= 2)), + (JSCompiler_object_inline_componentStack_2298.return = workInProgress), - (JSCompiler_object_inline_stack_2288.return = workInProgress), - (JSCompiler_object_inline_stack_2288.sibling = - JSCompiler_object_inline_componentStack_2289), - (workInProgress.child = JSCompiler_object_inline_stack_2288), - (JSCompiler_object_inline_stack_2288 = - JSCompiler_object_inline_componentStack_2289), - (JSCompiler_object_inline_componentStack_2289 = workInProgress.child), - (JSCompiler_object_inline_message_2286 = current.child.memoizedState), - null === JSCompiler_object_inline_message_2286 - ? (JSCompiler_object_inline_message_2286 = + (JSCompiler_object_inline_stack_2297.return = workInProgress), + (JSCompiler_object_inline_stack_2297.sibling = + JSCompiler_object_inline_componentStack_2298), + (workInProgress.child = JSCompiler_object_inline_stack_2297), + (JSCompiler_object_inline_stack_2297 = + JSCompiler_object_inline_componentStack_2298), + (JSCompiler_object_inline_componentStack_2298 = workInProgress.child), + (JSCompiler_object_inline_message_2295 = current.child.memoizedState), + null === JSCompiler_object_inline_message_2295 + ? (JSCompiler_object_inline_message_2295 = mountSuspenseOffscreenState(renderLanes)) : ((JSCompiler_temp = - JSCompiler_object_inline_message_2286.cachePool), + JSCompiler_object_inline_message_2295.cachePool), null !== JSCompiler_temp ? ((instance = CacheContext._currentValue), (JSCompiler_temp = @@ -9061,37 +9042,37 @@ ? { parent: instance, pool: instance } : JSCompiler_temp)) : (JSCompiler_temp = getSuspendedCache()), - (JSCompiler_object_inline_message_2286 = { + (JSCompiler_object_inline_message_2295 = { baseLanes: - JSCompiler_object_inline_message_2286.baseLanes | renderLanes, + JSCompiler_object_inline_message_2295.baseLanes | renderLanes, cachePool: JSCompiler_temp })), - (JSCompiler_object_inline_componentStack_2289.memoizedState = - JSCompiler_object_inline_message_2286), - (JSCompiler_object_inline_componentStack_2289.childLanes = + (JSCompiler_object_inline_componentStack_2298.memoizedState = + JSCompiler_object_inline_message_2295), + (JSCompiler_object_inline_componentStack_2298.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2287, + JSCompiler_object_inline_digest_2296, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2288 + JSCompiler_object_inline_stack_2297 ); pushPrimaryTreeSuspenseHandler(workInProgress); renderLanes = current.child; current = renderLanes.sibling; renderLanes = createWorkInProgress(renderLanes, { mode: "visible", - children: JSCompiler_object_inline_stack_2288.children + children: JSCompiler_object_inline_stack_2297.children }); renderLanes.return = workInProgress; renderLanes.sibling = null; null !== current && - ((JSCompiler_object_inline_digest_2287 = workInProgress.deletions), - null === JSCompiler_object_inline_digest_2287 + ((JSCompiler_object_inline_digest_2296 = workInProgress.deletions), + null === JSCompiler_object_inline_digest_2296 ? ((workInProgress.deletions = [current]), (workInProgress.flags |= 16)) - : JSCompiler_object_inline_digest_2287.push(current)); + : JSCompiler_object_inline_digest_2296.push(current)); workInProgress.child = renderLanes; workInProgress.memoizedState = null; return renderLanes; @@ -11034,7 +11015,12 @@ } else ref.current = null; } - function commitProfiler(finishedWork, current, commitTime, effectDuration) { + function commitProfiler( + finishedWork, + current, + commitStartTime, + effectDuration + ) { var _finishedWork$memoize = finishedWork.memoizedProps, id = _finishedWork$memoize.id, onCommit = _finishedWork$memoize.onCommit; @@ -11048,20 +11034,20 @@ finishedWork.actualDuration, finishedWork.treeBaseDuration, finishedWork.actualStartTime, - commitTime + commitStartTime ); "function" === typeof onCommit && onCommit( finishedWork.memoizedProps.id, current, effectDuration, - commitTime + commitStartTime ); } function commitProfilerPostCommitImpl( finishedWork, current, - commitTime, + commitStartTime, passiveEffectDuration ) { var _finishedWork$memoize2 = finishedWork.memoizedProps; @@ -11074,7 +11060,7 @@ finishedWork, current, passiveEffectDuration, - commitTime + commitStartTime ); } function commitHostMount(finishedWork) { @@ -11504,7 +11490,7 @@ commitProfiler, finishedWork, current, - commitTime, + commitStartTime, finishedRoot.effectDuration ); } catch (error) { @@ -12495,7 +12481,7 @@ commitProfiler, finishedWork, current, - commitTime, + commitStartTime, includeWorkInProgressEffects.effectDuration ); } catch (error) { @@ -12646,7 +12632,7 @@ commitProfilerPostCommitImpl, finishedWork, finishedWork.alternate, - commitTime, + commitStartTime, finishedRoot.passiveEffectDuration ); } catch (error) { @@ -13419,8 +13405,7 @@ workInProgress.flags & 16384 && ((retryQueue = 22 !== workInProgress.tag ? claimNextRetryLane() : 536870912), - (workInProgress.lanes |= retryQueue), - (workInProgressSuspendedRetryLanes |= retryQueue)); + (workInProgress.lanes |= retryQueue)); } function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { if (!isHydrating) @@ -14217,8 +14202,7 @@ markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane, - workInProgressRootDidSkipSuspendedSiblings + workInProgressDeferredLane ); markRootUpdated(root, lane); if ( @@ -14260,198 +14244,188 @@ markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane, - workInProgressRootDidSkipSuspendedSiblings + workInProgressDeferredLane )), ensureRootIsScheduled(root); } - function performConcurrentWorkOnRoot(root, didTimeout) { - nestedUpdateScheduled = currentUpdateIsNested = !1; + function performWorkOnRoot(root, lanes, forceSync) { if ((executionContext & (RenderContext | CommitContext)) !== NoContext) throw Error("Should not already be working."); - var originalCallbackNode = root.callbackNode; - if (flushPassiveEffects() && root.callbackNode !== originalCallbackNode) - return null; - var lanes = getNextLanes( - root, - root === workInProgressRoot ? workInProgressRootRenderLanes : 0 - ); - if (0 === lanes) return null; var shouldTimeSlice = - 0 === (lanes & 60) && 0 === (lanes & root.expiredLanes) && !didTimeout; - didTimeout = shouldTimeSlice - ? renderRootConcurrent(root, lanes) - : renderRootSync(root, lanes); - if (didTimeout !== RootInProgress) { + (!forceSync && + 0 === (lanes & 60) && + 0 === (lanes & root.expiredLanes)) || + !1, + exitStatus = shouldTimeSlice + ? renderRootConcurrent(root, lanes) + : renderRootSync(root, lanes, !0); + do { var renderWasConcurrent = shouldTimeSlice; - do { - if (didTimeout === RootDidNotComplete) - markRootSuspended( - root, - lanes, - 0, - workInProgressRootDidSkipSuspendedSiblings - ); - else { - shouldTimeSlice = root.current.alternate; - if ( - renderWasConcurrent && - !isRenderConsistentWithExternalStores(shouldTimeSlice) - ) { - didTimeout = renderRootSync(root, lanes); - renderWasConcurrent = !1; - continue; - } - if (didTimeout === RootErrored) { - renderWasConcurrent = lanes; - var errorRetryLanes = getLanesToRetrySynchronouslyOnError( - root, - renderWasConcurrent - ); - if ( - 0 !== errorRetryLanes && - ((lanes = errorRetryLanes), - (didTimeout = recoverFromConcurrentError( - root, - renderWasConcurrent, - errorRetryLanes - )), - (renderWasConcurrent = !1), - didTimeout !== RootErrored) - ) - continue; - } - if (didTimeout === RootFatalErrored) { - prepareFreshStack(root, 0); - markRootSuspended( - root, - lanes, - 0, - workInProgressRootDidSkipSuspendedSiblings - ); - break; - } - a: { - renderWasConcurrent = root; - switch (didTimeout) { - case RootInProgress: - case RootFatalErrored: - throw Error("Root did not complete. This is a bug in React."); - case RootSuspendedWithDelay: - if ((lanes & 4194176) === lanes) { - markRootSuspended( - renderWasConcurrent, - lanes, - workInProgressDeferredLane, - workInProgressRootDidSkipSuspendedSiblings - ); + if (exitStatus === RootInProgress) break; + else if (exitStatus === RootDidNotComplete) + markRootSuspended(root, lanes, 0); + else { + forceSync = root.current.alternate; + if ( + renderWasConcurrent && + !isRenderConsistentWithExternalStores(forceSync) + ) { + exitStatus = renderRootSync(root, lanes, !1); + continue; + } + if (exitStatus === RootErrored) { + renderWasConcurrent = lanes; + if (root.errorRecoveryDisabledLanes & renderWasConcurrent) + var errorRetryLanes = 0; + else + (errorRetryLanes = root.pendingLanes & -536870913), + (errorRetryLanes = + 0 !== errorRetryLanes + ? errorRetryLanes + : errorRetryLanes & 536870912 + ? 536870912 + : 0); + if (0 !== errorRetryLanes) { + lanes = errorRetryLanes; + a: { + exitStatus = root; + var errorRetryLanes$jscomp$0 = errorRetryLanes; + errorRetryLanes = workInProgressRootConcurrentErrors; + var wasRootDehydrated = + exitStatus.current.memoizedState.isDehydrated; + wasRootDehydrated && + (prepareFreshStack( + exitStatus, + errorRetryLanes$jscomp$0 + ).flags |= 256); + errorRetryLanes$jscomp$0 = renderRootSync( + exitStatus, + errorRetryLanes$jscomp$0, + !1 + ); + if (errorRetryLanes$jscomp$0 !== RootErrored) { + if ( + workInProgressRootDidAttachPingListener && + !wasRootDehydrated + ) { + exitStatus.errorRecoveryDisabledLanes |= + renderWasConcurrent; + workInProgressRootInterleavedUpdatedLanes |= + renderWasConcurrent; + exitStatus = RootSuspendedWithDelay; break a; } - break; - case RootErrored: - workInProgressRootRecoverableErrors = null; - break; - case RootSuspended: - case RootCompleted: - break; - default: - throw Error("Unknown root exit status."); + exitStatus = workInProgressRootRecoverableErrors; + workInProgressRootRecoverableErrors = errorRetryLanes; + null !== exitStatus && queueRecoverableErrors(exitStatus); + } + exitStatus = errorRetryLanes$jscomp$0; } - renderWasConcurrent.finishedWork = shouldTimeSlice; - renderWasConcurrent.finishedLanes = lanes; - if (null !== ReactSharedInternals.actQueue) - commitRoot( - renderWasConcurrent, - workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, - workInProgressDeferredLane, - workInProgressRootInterleavedUpdatedLanes, - workInProgressSuspendedRetryLanes - ); - else { - if ( - (lanes & 62914560) === lanes && - ((didTimeout = - globalMostRecentFallbackTime + - FALLBACK_THROTTLE_MS - - now$1()), - 10 < didTimeout) - ) { + if (exitStatus !== RootErrored) continue; + } + } + if (exitStatus === RootFatalErrored) { + prepareFreshStack(root, 0); + markRootSuspended(root, lanes, 0); + break; + } + a: { + shouldTimeSlice = root; + switch (exitStatus) { + case RootInProgress: + case RootFatalErrored: + throw Error("Root did not complete. This is a bug in React."); + case RootSuspendedWithDelay: + if ((lanes & 4194176) === lanes) { markRootSuspended( - renderWasConcurrent, + shouldTimeSlice, lanes, - workInProgressDeferredLane, - workInProgressRootDidSkipSuspendedSiblings - ); - if (0 !== getNextLanes(renderWasConcurrent, 0)) break a; - renderWasConcurrent.timeoutHandle = scheduleTimeout( - commitRootWhenReady.bind( - null, - renderWasConcurrent, - shouldTimeSlice, - workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, - lanes, - workInProgressDeferredLane, - workInProgressRootInterleavedUpdatedLanes, - workInProgressSuspendedRetryLanes, - workInProgressRootDidSkipSuspendedSiblings - ), - didTimeout + workInProgressDeferredLane ); break a; } - commitRootWhenReady( - renderWasConcurrent, + break; + case RootErrored: + workInProgressRootRecoverableErrors = null; + break; + case RootSuspended: + case RootCompleted: + break; + default: + throw Error("Unknown root exit status."); + } + shouldTimeSlice.finishedWork = forceSync; + shouldTimeSlice.finishedLanes = lanes; + if (null !== ReactSharedInternals.actQueue) + commitRoot( + shouldTimeSlice, + workInProgressRootRecoverableErrors, + workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + IMMEDIATE_COMMIT, + renderStartTime, + 0 + ); + else { + if ( + (lanes & 62914560) === lanes && + ((exitStatus = + globalMostRecentFallbackTime + + FALLBACK_THROTTLE_MS - + now$1()), + 10 < exitStatus) + ) { + markRootSuspended( shouldTimeSlice, - workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, lanes, - workInProgressDeferredLane, - workInProgressRootInterleavedUpdatedLanes, - workInProgressSuspendedRetryLanes, - workInProgressRootDidSkipSuspendedSiblings + workInProgressDeferredLane + ); + if (0 !== getNextLanes(shouldTimeSlice, 0)) break a; + shouldTimeSlice.timeoutHandle = scheduleTimeout( + commitRootWhenReady.bind( + null, + shouldTimeSlice, + forceSync, + workInProgressRootRecoverableErrors, + workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, + lanes, + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + workInProgressRootDidSkipSuspendedSiblings, + THROTTLED_COMMIT, + renderStartTime, + 0 + ), + exitStatus ); + break a; } + commitRootWhenReady( + shouldTimeSlice, + forceSync, + workInProgressRootRecoverableErrors, + workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, + lanes, + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + workInProgressRootDidSkipSuspendedSiblings, + IMMEDIATE_COMMIT, + renderStartTime, + 0 + ); } } - break; - } while (1); - } + } + break; + } while (1); ensureRootIsScheduled(root); - scheduleTaskForRootDuringMicrotask(root, now$1()); - root = - root.callbackNode === originalCallbackNode - ? performConcurrentWorkOnRoot.bind(null, root) - : null; - return root; - } - function recoverFromConcurrentError( - root, - originallyAttemptedLanes, - errorRetryLanes - ) { - var errorsFromFirstAttempt = workInProgressRootConcurrentErrors, - wasRootDehydrated = root.current.memoizedState.isDehydrated; - wasRootDehydrated && - (prepareFreshStack(root, errorRetryLanes).flags |= 256); - errorRetryLanes = renderRootSync(root, errorRetryLanes); - if (errorRetryLanes !== RootErrored) { - if (workInProgressRootDidAttachPingListener && !wasRootDehydrated) - return ( - (root.errorRecoveryDisabledLanes |= originallyAttemptedLanes), - (workInProgressRootInterleavedUpdatedLanes |= - originallyAttemptedLanes), - RootSuspendedWithDelay - ); - root = workInProgressRootRecoverableErrors; - workInProgressRootRecoverableErrors = errorsFromFirstAttempt; - null !== root && queueRecoverableErrors(root); - } - return errorRetryLanes; } function queueRecoverableErrors(errors) { null === workInProgressRootRecoverableErrors @@ -14471,10 +14445,16 @@ spawnedLane, updatedLanes, suspendedRetryLanes, - didSkipSuspendedSiblings + didSkipSuspendedSiblings, + suspendedCommitReason, + completedRenderStartTime, + completedRenderEndTime ) { - var subtreeFlags = finishedWork.subtreeFlags; - if (subtreeFlags & 8192 || 16785408 === (subtreeFlags & 16785408)) + didSkipSuspendedSiblings = finishedWork.subtreeFlags; + if ( + didSkipSuspendedSiblings & 8192 || + 16785408 === (didSkipSuspendedSiblings & 16785408) + ) if ( ((suspendedState = { stylesheets: null, count: 0, unsuspend: noop }), accumulateSuspenseyCommitOnFiber(finishedWork), @@ -14490,10 +14470,13 @@ didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes + suspendedRetryLanes, + SUSPENDED_COMMIT, + completedRenderStartTime, + completedRenderEndTime ) ); - markRootSuspended(root, lanes, spawnedLane, didSkipSuspendedSiblings); + markRootSuspended(root, lanes, spawnedLane); return; } commitRoot( @@ -14503,7 +14486,10 @@ didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes + suspendedRetryLanes, + suspendedCommitReason, + completedRenderStartTime, + completedRenderEndTime ); } function isRenderConsistentWithExternalStores(finishedWork) { @@ -14552,80 +14538,24 @@ (didIncludeCommitPhaseUpdate = !0); throwIfInfiniteUpdateLoopDetected(); } - function markRootSuspended( - root, - suspendedLanes, - spawnedLane, - didSkipSuspendedSiblings - ) { + function markRootSuspended(root, suspendedLanes, spawnedLane) { suspendedLanes &= ~workInProgressRootPingedLanes; suspendedLanes &= ~workInProgressRootInterleavedUpdatedLanes; root.suspendedLanes |= suspendedLanes; root.pingedLanes &= ~suspendedLanes; - didSkipSuspendedSiblings || (root.warmLanes |= suspendedLanes); - didSkipSuspendedSiblings = root.expirationTimes; - for (var lanes = suspendedLanes; 0 < lanes; ) { + for ( + var expirationTimes = root.expirationTimes, lanes = suspendedLanes; + 0 < lanes; + + ) { var index = 31 - clz32(lanes), lane = 1 << index; - didSkipSuspendedSiblings[index] = -1; + expirationTimes[index] = -1; lanes &= ~lane; } 0 !== spawnedLane && markSpawnedDeferredLane(root, spawnedLane, suspendedLanes); } - function performSyncWorkOnRoot(root, lanes) { - if ((executionContext & (RenderContext | CommitContext)) !== NoContext) - throw Error("Should not already be working."); - if (flushPassiveEffects()) return ensureRootIsScheduled(root), null; - currentUpdateIsNested = nestedUpdateScheduled; - nestedUpdateScheduled = !1; - var exitStatus = renderRootSync(root, lanes); - if (exitStatus === RootErrored) { - var originallyAttemptedLanes = lanes, - errorRetryLanes = getLanesToRetrySynchronouslyOnError( - root, - originallyAttemptedLanes - ); - 0 !== errorRetryLanes && - ((lanes = errorRetryLanes), - (exitStatus = recoverFromConcurrentError( - root, - originallyAttemptedLanes, - errorRetryLanes - ))); - } - if (exitStatus === RootFatalErrored) - return ( - prepareFreshStack(root, 0), - markRootSuspended(root, lanes, 0, !1), - ensureRootIsScheduled(root), - null - ); - if (exitStatus === RootDidNotComplete) - return ( - markRootSuspended( - root, - lanes, - workInProgressDeferredLane, - workInProgressRootDidSkipSuspendedSiblings - ), - ensureRootIsScheduled(root), - null - ); - root.finishedWork = root.current.alternate; - root.finishedLanes = lanes; - commitRoot( - root, - workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, - workInProgressDeferredLane, - workInProgressRootInterleavedUpdatedLanes, - workInProgressSuspendedRetryLanes - ); - ensureRootIsScheduled(root); - return null; - } function flushSyncWork$1() { return (executionContext & (RenderContext | CommitContext)) === NoContext ? (flushSyncWorkAcrossRoots_impl(0, !1), !1) @@ -14663,8 +14593,9 @@ workInProgressRootRenderLanes = lanes; workInProgressSuspendedReason = NotSuspended; workInProgressThrownValue = null; - workInProgressRootDidAttachPingListener = - workInProgressRootDidSkipSuspendedSiblings = !1; + workInProgressRootDidSkipSuspendedSiblings = !1; + checkIfRootIsPrerendering(root, lanes); + workInProgressRootDidAttachPingListener = !1; workInProgressRootExitStatus = RootInProgress; workInProgressSuspendedRetryLanes = workInProgressDeferredLane = @@ -14790,8 +14721,7 @@ markRootSuspended( workInProgressRoot, workInProgressRootRenderLanes, - workInProgressDeferredLane, - workInProgressRootDidSkipSuspendedSiblings + workInProgressDeferredLane ); } function renderRootSync(root, lanes) { @@ -14815,37 +14745,38 @@ } markRenderStarted(lanes); lanes = !1; + memoizedUpdaters = workInProgressRootExitStatus; a: do try { if ( workInProgressSuspendedReason !== NotSuspended && null !== workInProgress ) { - memoizedUpdaters = workInProgress; - var thrownValue = workInProgressThrownValue; + var unitOfWork = workInProgress, + thrownValue = workInProgressThrownValue; switch (workInProgressSuspendedReason) { case SuspendedOnHydration: resetWorkInProgressStack(); - workInProgressRootExitStatus = RootDidNotComplete; + memoizedUpdaters = RootDidNotComplete; break a; case SuspendedOnImmediate: case SuspendedOnData: - lanes || - null !== suspenseHandlerStackCursor.current || - (lanes = !0); - default: + case SuspendedOnDeprecatedThrowPromise: + null === suspenseHandlerStackCursor.current && (lanes = !0); var reason = workInProgressSuspendedReason; workInProgressSuspendedReason = NotSuspended; workInProgressThrownValue = null; - throwAndUnwindWorkLoop( - root, - memoizedUpdaters, - thrownValue, - reason - ); + throwAndUnwindWorkLoop(root, unitOfWork, thrownValue, reason); + break; + default: + (reason = workInProgressSuspendedReason), + (workInProgressSuspendedReason = NotSuspended), + (workInProgressThrownValue = null), + throwAndUnwindWorkLoop(root, unitOfWork, thrownValue, reason); } } workLoopSync(); + memoizedUpdaters = workInProgressRootExitStatus; break; } catch (thrownValue$8) { handleThrow(root, thrownValue$8); @@ -14856,15 +14787,12 @@ executionContext = prevExecutionContext; ReactSharedInternals.H = prevDispatcher; ReactSharedInternals.A = prevAsyncDispatcher; - if (null !== workInProgress) - throw Error( - "Cannot commit an incomplete root. This error is likely caused by a bug in React. Please file an issue." - ); markRenderStopped(); - workInProgressRoot = null; - workInProgressRootRenderLanes = 0; - finishQueueingConcurrentUpdates(); - return workInProgressRootExitStatus; + null === workInProgress && + ((workInProgressRoot = null), + (workInProgressRootRenderLanes = 0), + finishQueueingConcurrentUpdates()); + return memoizedUpdaters; } function workLoopSync() { for (; null !== workInProgress; ) performUnitOfWork(workInProgress); @@ -14888,7 +14816,7 @@ workInProgressTransitions = null; workInProgressRootRenderTargetTime = now$1() + RENDER_TIMEOUT_MS; prepareFreshStack(root, lanes); - } + } else checkIfRootIsPrerendering(root, lanes); markRenderStarted(lanes); a: do try { @@ -15213,7 +15141,10 @@ didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes + suspendedRetryLanes, + suspendedCommitReason, + completedRenderStartTime, + completedRenderEndTime ) { var prevTransition = ReactSharedInternals.T, previousUpdateLanePriority = ReactDOMSharedInternals.p; @@ -15228,13 +15159,15 @@ previousUpdateLanePriority, spawnedLane, updatedLanes, - suspendedRetryLanes + suspendedRetryLanes, + suspendedCommitReason, + completedRenderStartTime, + completedRenderEndTime ); } finally { (ReactSharedInternals.T = prevTransition), (ReactDOMSharedInternals.p = previousUpdateLanePriority); } - return null; } function commitRootImpl( root, @@ -15242,9 +15175,7 @@ transitions, didIncludeRenderPhaseUpdate, renderPriorityLevel, - spawnedLane, - updatedLanes, - suspendedRetryLanes + spawnedLane ) { do flushPassiveEffects(); while (null !== rootWithPendingPassiveEffects); @@ -15273,14 +15204,7 @@ root.cancelPendingCommit = null; var remainingLanes = finishedWork.lanes | finishedWork.childLanes; remainingLanes |= concurrentlyUpdatedLanes; - markRootFinished( - root, - lanes, - remainingLanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes - ); + markRootFinished(root, lanes, remainingLanes, spawnedLane); didIncludeCommitPhaseUpdate = !1; root === workInProgressRoot && ((workInProgress = workInProgressRoot = null), @@ -15292,38 +15216,38 @@ (pendingPassiveEffectsRemainingLanes = remainingLanes), (pendingPassiveTransitions = transitions), scheduleCallback$1(NormalPriority$1, function () { - flushPassiveEffects(); + flushPassiveEffects(!0); return null; })); + commitStartTime = now(); transitions = 0 !== (finishedWork.flags & 15990); - 0 !== (finishedWork.subtreeFlags & 15990) || transitions - ? ((transitions = ReactSharedInternals.T), - (ReactSharedInternals.T = null), - (spawnedLane = ReactDOMSharedInternals.p), - (ReactDOMSharedInternals.p = DiscreteEventPriority), - (updatedLanes = executionContext), - (executionContext |= CommitContext), - commitBeforeMutationEffects(root, finishedWork), - (commitTime = now()), - commitMutationEffects(root, finishedWork, lanes), - restoreSelection(selectionInformation, root.containerInfo), - (_enabled = !!eventsEnabled), - (selectionInformation = eventsEnabled = null), - (root.current = finishedWork), - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markLayoutEffectsStarted && - injectedProfilingHooks.markLayoutEffectsStarted(lanes), - commitLayoutEffects(finishedWork, root, lanes), - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markLayoutEffectsStopped && - injectedProfilingHooks.markLayoutEffectsStopped(), - requestPaint(), - (executionContext = updatedLanes), - (ReactDOMSharedInternals.p = spawnedLane), - (ReactSharedInternals.T = transitions)) - : ((root.current = finishedWork), (commitTime = now())); + if (0 !== (finishedWork.subtreeFlags & 15990) || transitions) { + transitions = ReactSharedInternals.T; + ReactSharedInternals.T = null; + spawnedLane = ReactDOMSharedInternals.p; + ReactDOMSharedInternals.p = DiscreteEventPriority; + var prevExecutionContext = executionContext; + executionContext |= CommitContext; + commitBeforeMutationEffects(root, finishedWork); + commitMutationEffects(root, finishedWork, lanes); + restoreSelection(selectionInformation, root.containerInfo); + _enabled = !!eventsEnabled; + selectionInformation = eventsEnabled = null; + root.current = finishedWork; + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markLayoutEffectsStarted && + injectedProfilingHooks.markLayoutEffectsStarted(lanes); + commitLayoutEffects(finishedWork, root, lanes); + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markLayoutEffectsStopped && + injectedProfilingHooks.markLayoutEffectsStopped(); + requestPaint(); + executionContext = prevExecutionContext; + ReactDOMSharedInternals.p = spawnedLane; + ReactSharedInternals.T = transitions; + } else root.current = finishedWork; (transitions = rootDoesHavePassiveEffects) ? ((rootDoesHavePassiveEffects = !1), (rootWithPendingPassiveEffects = root), @@ -15789,7 +15713,8 @@ root, root === workInProgressRoot ? nextLanes : 0 )), - 0 !== (nextLanes & 3) && + 0 === (nextLanes & 3) || + checkIfRootIsPrerendering(root, nextLanes) || ((didPerformSomeWork = !0), performSyncWorkOnRoot(root, nextLanes)); root = root.next; @@ -15880,8 +15805,6 @@ else return currentTime; switch (lanesToEventPriority(suspendedLanes)) { case DiscreteEventPriority: - suspendedLanes = ImmediatePriority; - break; case ContinuousEventPriority: suspendedLanes = UserBlockingPriority; break; @@ -15894,7 +15817,7 @@ default: suspendedLanes = NormalPriority$1; } - pingedLanes = performConcurrentWorkOnRoot.bind(null, root); + pingedLanes = performWorkOnRootViaSchedulerTask.bind(null, root); null !== ReactSharedInternals.actQueue ? (ReactSharedInternals.actQueue.push(pingedLanes), (suspendedLanes = fakeActCallbackNode)) @@ -15903,6 +15826,34 @@ root.callbackNode = suspendedLanes; return currentTime; } + function performWorkOnRootViaSchedulerTask(root, didTimeout) { + nestedUpdateScheduled = currentUpdateIsNested = !1; + var originalCallbackNode = root.callbackNode; + if (flushPassiveEffects() && root.callbackNode !== originalCallbackNode) + return null; + var workInProgressRootRenderLanes$jscomp$0 = + workInProgressRootRenderLanes; + workInProgressRootRenderLanes$jscomp$0 = getNextLanes( + root, + root === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0 + ); + if (0 === workInProgressRootRenderLanes$jscomp$0) return null; + performWorkOnRoot( + root, + workInProgressRootRenderLanes$jscomp$0, + didTimeout + ); + scheduleTaskForRootDuringMicrotask(root, now$1()); + return root.callbackNode === originalCallbackNode + ? performWorkOnRootViaSchedulerTask.bind(null, root) + : null; + } + function performSyncWorkOnRoot(root, lanes) { + if (flushPassiveEffects()) return null; + currentUpdateIsNested = nestedUpdateScheduled; + nestedUpdateScheduled = !1; + performWorkOnRoot(root, lanes, !0); + } function cancelCallback(callbackNode) { callbackNode !== fakeActCallbackNode && null !== callbackNode && @@ -22143,7 +22094,8 @@ StrictEffectsMode = 16, NoStrictPassiveEffectsMode = 64, now = Scheduler.unstable_now, - commitTime = -0, + renderStartTime = -0, + commitStartTime = -0, profilerStartTime = -1.1, profilerEffectDuration = -0, currentUpdateIsNested = !1, @@ -23921,15 +23873,18 @@ pendingPassiveEffectsLanes = 0, pendingPassiveEffectsRemainingLanes = 0, pendingPassiveTransitions = null, - NESTED_UPDATE_LIMIT = 50, + NESTED_UPDATE_LIMIT = 100, nestedUpdateCount = 0, rootWithNestedUpdates = null, isFlushingPassiveEffects = !1, didScheduleUpdateDuringPassiveEffects = !1, - NESTED_PASSIVE_UPDATE_LIMIT = 50, + NESTED_PASSIVE_UPDATE_LIMIT = 100, nestedPassiveUpdateCount = 0, rootWithPassiveNestedUpdates = null, isRunningInsertionEffect = !1, + IMMEDIATE_COMMIT = 0, + SUSPENDED_COMMIT = 1, + THROTTLED_COMMIT = 2, didWarnStateUpdateForNotYetMountedComponent = null, didWarnAboutUpdateInRender = !1; var didWarnAboutUpdateInRenderForAnotherComponent = new Set(); @@ -24474,11 +24429,11 @@ }; (function () { var isomorphicReactPackageVersion = React.version; - if ("19.0.0-rc-5d19e1c8-20240923" !== isomorphicReactPackageVersion) + if ("19.0.0-rc-778e1ed2-20240926" !== isomorphicReactPackageVersion) throw Error( 'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion + - "\n - react-dom: 19.0.0-rc-5d19e1c8-20240923\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.0.0-rc-778e1ed2-20240926\nLearn more: https://react.dev/warnings/version-mismatch") ); })(); ("function" === typeof Map && @@ -24515,11 +24470,11 @@ !(function () { var internals = { bundleType: 1, - version: "19.0.0-rc-5d19e1c8-20240923", + version: "19.0.0-rc-778e1ed2-20240926", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, findFiberByHostInstance: getClosestInstanceFromNode, - reconcilerVersion: "19.0.0-rc-5d19e1c8-20240923" + reconcilerVersion: "19.0.0-rc-778e1ed2-20240926" }; internals.overrideHookState = overrideHookState; internals.overrideHookStateDeletePath = overrideHookStateDeletePath; @@ -24663,7 +24618,7 @@ listenToAllSupportedEvents(container); return new ReactDOMHydrationRoot(initialChildren); }; - exports.version = "19.0.0-rc-5d19e1c8-20240923"; + exports.version = "19.0.0-rc-778e1ed2-20240926"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom-client.production.js b/packages/next/src/compiled/react-dom/cjs/react-dom-client.production.js index dede7168330ff..a5534e93c4f43 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom-client.production.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom-client.production.js @@ -595,43 +595,39 @@ function getNextLanes(root, wipLanes) { var pendingLanes = root.pendingLanes; if (0 === pendingLanes) return 0; var nextLanes = 0, - suspendedLanes = root.suspendedLanes, - pingedLanes = root.pingedLanes, - warmLanes = root.warmLanes; - root = 0 !== root.finishedLanes; + suspendedLanes = root.suspendedLanes; + root = root.pingedLanes; var nonIdlePendingLanes = pendingLanes & 134217727; 0 !== nonIdlePendingLanes ? ((pendingLanes = nonIdlePendingLanes & ~suspendedLanes), 0 !== pendingLanes ? (nextLanes = getHighestPriorityLanes(pendingLanes)) - : ((pingedLanes &= nonIdlePendingLanes), - 0 !== pingedLanes - ? (nextLanes = getHighestPriorityLanes(pingedLanes)) - : root || - ((warmLanes = nonIdlePendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes))))) - : ((nonIdlePendingLanes = pendingLanes & ~suspendedLanes), - 0 !== nonIdlePendingLanes - ? (nextLanes = getHighestPriorityLanes(nonIdlePendingLanes)) - : 0 !== pingedLanes - ? (nextLanes = getHighestPriorityLanes(pingedLanes)) - : root || - ((warmLanes = pendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes)))); + : ((root &= nonIdlePendingLanes), + 0 !== root && (nextLanes = getHighestPriorityLanes(root)))) + : ((pendingLanes &= ~suspendedLanes), + 0 !== pendingLanes + ? (nextLanes = getHighestPriorityLanes(pendingLanes)) + : 0 !== root && (nextLanes = getHighestPriorityLanes(root))); return 0 === nextLanes ? 0 : 0 !== wipLanes && wipLanes !== nextLanes && 0 === (wipLanes & suspendedLanes) && ((suspendedLanes = nextLanes & -nextLanes), - (warmLanes = wipLanes & -wipLanes), - suspendedLanes >= warmLanes || - (32 === suspendedLanes && 0 !== (warmLanes & 4194176))) + (root = wipLanes & -wipLanes), + suspendedLanes >= root || + (32 === suspendedLanes && 0 !== (root & 4194176))) ? wipLanes : nextLanes; } +function checkIfRootIsPrerendering(root, renderLanes) { + return ( + 0 === + (root.pendingLanes & + ~(root.suspendedLanes & ~root.pingedLanes) & + renderLanes) + ); +} function computeExpirationTime(lane, currentTime) { switch (lane) { case 1: @@ -673,11 +669,6 @@ function computeExpirationTime(lane, currentTime) { return -1; } } -function getLanesToRetrySynchronouslyOnError(root, originallyAttemptedLanes) { - if (root.errorRecoveryDisabledLanes & originallyAttemptedLanes) return 0; - root = root.pendingLanes & -536870913; - return 0 !== root ? root : root & 536870912 ? 536870912 : 0; -} function claimNextTransitionLane() { var lane = nextTransitionLane; nextTransitionLane <<= 1; @@ -694,14 +685,7 @@ function createLaneMap(initial) { for (var laneMap = [], i = 0; 31 > i; i++) laneMap.push(initial); return laneMap; } -function markRootFinished( - root, - finishedLanes, - remainingLanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes -) { +function markRootFinished(root, finishedLanes, remainingLanes, spawnedLane) { var previouslyPendingLanes = root.pendingLanes; root.pendingLanes = remainingLanes; root.suspendedLanes = 0; @@ -711,36 +695,31 @@ function markRootFinished( root.entangledLanes &= remainingLanes; root.errorRecoveryDisabledLanes &= remainingLanes; root.shellSuspendCounter = 0; - var entanglements = root.entanglements, - expirationTimes = root.expirationTimes, + finishedLanes = root.entanglements; + var expirationTimes = root.expirationTimes, hiddenUpdates = root.hiddenUpdates; for ( remainingLanes = previouslyPendingLanes & ~remainingLanes; 0 < remainingLanes; ) { - var index$7 = 31 - clz32(remainingLanes), - lane = 1 << index$7; - entanglements[index$7] = 0; - expirationTimes[index$7] = -1; - var hiddenUpdatesForLane = hiddenUpdates[index$7]; + var index$6 = 31 - clz32(remainingLanes); + previouslyPendingLanes = 1 << index$6; + finishedLanes[index$6] = 0; + expirationTimes[index$6] = -1; + var hiddenUpdatesForLane = hiddenUpdates[index$6]; if (null !== hiddenUpdatesForLane) for ( - hiddenUpdates[index$7] = null, index$7 = 0; - index$7 < hiddenUpdatesForLane.length; - index$7++ + hiddenUpdates[index$6] = null, index$6 = 0; + index$6 < hiddenUpdatesForLane.length; + index$6++ ) { - var update = hiddenUpdatesForLane[index$7]; + var update = hiddenUpdatesForLane[index$6]; null !== update && (update.lane &= -536870913); } - remainingLanes &= ~lane; + remainingLanes &= ~previouslyPendingLanes; } 0 !== spawnedLane && markSpawnedDeferredLane(root, spawnedLane, 0); - 0 !== suspendedRetryLanes && - 0 === updatedLanes && - 0 !== root.tag && - (root.suspendedLanes |= - suspendedRetryLanes & ~(previouslyPendingLanes & ~finishedLanes)); } function markSpawnedDeferredLane(root, spawnedLane, entangledLanes) { root.pendingLanes |= spawnedLane; @@ -755,10 +734,10 @@ function markSpawnedDeferredLane(root, spawnedLane, entangledLanes) { function markRootEntangled(root, entangledLanes) { var rootEntangledLanes = (root.entangledLanes |= entangledLanes); for (root = root.entanglements; rootEntangledLanes; ) { - var index$8 = 31 - clz32(rootEntangledLanes), - lane = 1 << index$8; - (lane & entangledLanes) | (root[index$8] & entangledLanes) && - (root[index$8] |= entangledLanes); + var index$7 = 31 - clz32(rootEntangledLanes), + lane = 1 << index$7; + (lane & entangledLanes) | (root[index$7] & entangledLanes) && + (root[index$7] |= entangledLanes); rootEntangledLanes &= ~lane; } } @@ -908,8 +887,8 @@ function setValueForAttribute(node, name, value) { node.removeAttribute(name); return; case "boolean": - var prefix$10 = name.toLowerCase().slice(0, 5); - if ("data-" !== prefix$10 && "aria-" !== prefix$10) { + var prefix$9 = name.toLowerCase().slice(0, 5); + if ("data-" !== prefix$9 && "aria-" !== prefix$9) { node.removeAttribute(name); return; } @@ -1242,15 +1221,15 @@ function setValueForStyles(node, styles, prevStyles) { : "float" === styleName ? (node.cssFloat = "") : (node[styleName] = "")); - for (var styleName$16 in styles) - (styleName = styles[styleName$16]), - styles.hasOwnProperty(styleName$16) && - prevStyles[styleName$16] !== styleName && - setValueForStyle(node, styleName$16, styleName); + for (var styleName$15 in styles) + (styleName = styles[styleName$15]), + styles.hasOwnProperty(styleName$15) && + prevStyles[styleName$15] !== styleName && + setValueForStyle(node, styleName$15, styleName); } else - for (var styleName$17 in styles) - styles.hasOwnProperty(styleName$17) && - setValueForStyle(node, styleName$17, styles[styleName$17]); + for (var styleName$16 in styles) + styles.hasOwnProperty(styleName$16) && + setValueForStyle(node, styleName$16, styles[styleName$16]); } function isCustomElement(tagName) { if (-1 === tagName.indexOf("-")) return !1; @@ -1981,14 +1960,14 @@ var isInputEventSupported = !1; if (canUseDOM) { var JSCompiler_inline_result$jscomp$278; if (canUseDOM) { - var isSupported$jscomp$inline_414 = "oninput" in document; - if (!isSupported$jscomp$inline_414) { - var element$jscomp$inline_415 = document.createElement("div"); - element$jscomp$inline_415.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_414 = - "function" === typeof element$jscomp$inline_415.oninput; + var isSupported$jscomp$inline_413 = "oninput" in document; + if (!isSupported$jscomp$inline_413) { + var element$jscomp$inline_414 = document.createElement("div"); + element$jscomp$inline_414.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_413 = + "function" === typeof element$jscomp$inline_414.oninput; } - JSCompiler_inline_result$jscomp$278 = isSupported$jscomp$inline_414; + JSCompiler_inline_result$jscomp$278 = isSupported$jscomp$inline_413; } else JSCompiler_inline_result$jscomp$278 = !1; isInputEventSupported = JSCompiler_inline_result$jscomp$278 && @@ -3893,7 +3872,7 @@ function updateReducerImpl(hook, current, reducer) { var newBaseQueueFirst = (baseFirst = null), newBaseQueueLast = null, update = current, - didReadFromEntangledAsyncAction$54 = !1; + didReadFromEntangledAsyncAction$53 = !1; do { var updateLane = update.lane & -536870913; if ( @@ -3914,11 +3893,11 @@ function updateReducerImpl(hook, current, reducer) { next: null }), updateLane === currentEntangledLane && - (didReadFromEntangledAsyncAction$54 = !0); + (didReadFromEntangledAsyncAction$53 = !0); else if ((renderLanes & revertLane) === revertLane) { update = update.next; revertLane === currentEntangledLane && - (didReadFromEntangledAsyncAction$54 = !0); + (didReadFromEntangledAsyncAction$53 = !0); continue; } else (updateLane = { @@ -3964,7 +3943,7 @@ function updateReducerImpl(hook, current, reducer) { if ( !objectIs(pendingQueue, hook.memoizedState) && ((didReceiveUpdate = !0), - didReadFromEntangledAsyncAction$54 && + didReadFromEntangledAsyncAction$53 && ((reducer = currentEntangledActionThenable), null !== reducer)) ) throw reducer; @@ -4162,8 +4141,8 @@ function runActionStateAction(actionQueue, node) { try { (prevTransition = action(prevState, payload)), handleActionReturnValue(actionQueue, node, prevTransition); - } catch (error$60) { - onActionError(actionQueue, node, error$60); + } catch (error$59) { + onActionError(actionQueue, node, error$59); } } function handleActionReturnValue(actionQueue, node, returnValue) { @@ -4590,10 +4569,10 @@ function refreshCache(fiber) { case 3: var lane = requestUpdateLane(); fiber = createUpdate(lane); - var root$63 = enqueueUpdate(provider, fiber, lane); - null !== root$63 && - (scheduleUpdateOnFiber(root$63, provider, lane), - entangleTransitions(root$63, provider, lane)); + var root$62 = enqueueUpdate(provider, fiber, lane); + null !== root$62 && + (scheduleUpdateOnFiber(root$62, provider, lane), + entangleTransitions(root$62, provider, lane)); provider = { cache: createCache() }; fiber.payload = provider; return; @@ -5112,9 +5091,9 @@ function resolveClassComponentProps(Component, baseProps) { } if ((Component = Component.defaultProps)) { newProps === baseProps && (newProps = assign({}, newProps)); - for (var propName$67 in Component) - void 0 === newProps[propName$67] && - (newProps[propName$67] = Component[propName$67]); + for (var propName$66 in Component) + void 0 === newProps[propName$66] && + (newProps[propName$66] = Component[propName$66]); } return newProps; } @@ -5160,9 +5139,9 @@ function logUncaughtError(root, errorInfo) { try { var onUncaughtError = root.onUncaughtError; onUncaughtError(errorInfo.value, { componentStack: errorInfo.stack }); - } catch (e$68) { + } catch (e$67) { setTimeout(function () { - throw e$68; + throw e$67; }); } } @@ -5173,9 +5152,9 @@ function logCaughtError(root, boundary, errorInfo) { componentStack: errorInfo.stack, errorBoundary: 1 === boundary.tag ? boundary.stateNode : null }); - } catch (e$69) { + } catch (e$68) { setTimeout(function () { - throw e$69; + throw e$68; }); } } @@ -7575,8 +7554,8 @@ function safelyDetachRef(current, nearestMountedAncestor) { else if ("function" === typeof ref) try { ref(null); - } catch (error$112) { - captureCommitPhaseError(current, nearestMountedAncestor, error$112); + } catch (error$111) { + captureCommitPhaseError(current, nearestMountedAncestor, error$111); } else ref.current = null; } @@ -7710,7 +7689,7 @@ function commitBeforeMutationEffects(root, firstChild) { selection = selection.focusOffset; try { JSCompiler_temp.nodeType, focusNode.nodeType; - } catch (e$20) { + } catch (e$19) { JSCompiler_temp = null; break a; } @@ -7872,11 +7851,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } catch (error$111) { + } catch (error$110) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$111 + error$110 ); } } @@ -8030,7 +8009,7 @@ function commitDeletionEffectsOnFiber( safelyDetachRef(deletedFiber, nearestMountedAncestor); case 6: prevHostParentIsContainer = hostParent; - var prevHostParentIsContainer$119 = hostParentIsContainer; + var prevHostParentIsContainer$118 = hostParentIsContainer; hostParent = null; recursivelyTraverseDeletionEffects( finishedRoot, @@ -8038,7 +8017,7 @@ function commitDeletionEffectsOnFiber( deletedFiber ); hostParent = prevHostParentIsContainer; - hostParentIsContainer = prevHostParentIsContainer$119; + hostParentIsContainer = prevHostParentIsContainer$118; if (null !== hostParent) if (hostParentIsContainer) try { @@ -8666,21 +8645,21 @@ function commitReconciliationEffects(finishedWork) { insertOrAppendPlacementNode(finishedWork, before, parent$jscomp$0); break; case 5: - var parent$113 = JSCompiler_inline_result.stateNode; + var parent$112 = JSCompiler_inline_result.stateNode; JSCompiler_inline_result.flags & 32 && - (setTextContent(parent$113, ""), + (setTextContent(parent$112, ""), (JSCompiler_inline_result.flags &= -33)); - var before$114 = getHostSibling(finishedWork); - insertOrAppendPlacementNode(finishedWork, before$114, parent$113); + var before$113 = getHostSibling(finishedWork); + insertOrAppendPlacementNode(finishedWork, before$113, parent$112); break; case 3: case 4: - var parent$115 = JSCompiler_inline_result.stateNode.containerInfo, - before$116 = getHostSibling(finishedWork); + var parent$114 = JSCompiler_inline_result.stateNode.containerInfo, + before$115 = getHostSibling(finishedWork); insertOrAppendPlacementNodeIntoContainer( finishedWork, - before$116, - parent$115 + before$115, + parent$114 ); break; default: @@ -9577,8 +9556,7 @@ function scheduleRetryEffect(workInProgress, retryQueue) { workInProgress.flags & 16384 && ((retryQueue = 22 !== workInProgress.tag ? claimNextRetryLane() : 536870912), - (workInProgress.lanes |= retryQueue), - (workInProgressSuspendedRetryLanes |= retryQueue)); + (workInProgress.lanes |= retryQueue)); } function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { if (!isHydrating) @@ -9595,14 +9573,14 @@ function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { break; case "collapsed": lastTailNode = renderState.tail; - for (var lastTailNode$131 = null; null !== lastTailNode; ) - null !== lastTailNode.alternate && (lastTailNode$131 = lastTailNode), + for (var lastTailNode$130 = null; null !== lastTailNode; ) + null !== lastTailNode.alternate && (lastTailNode$130 = lastTailNode), (lastTailNode = lastTailNode.sibling); - null === lastTailNode$131 + null === lastTailNode$130 ? hasRenderedATailFallback || null === renderState.tail ? (renderState.tail = null) : (renderState.tail.sibling = null) - : (lastTailNode$131.sibling = null); + : (lastTailNode$130.sibling = null); } } function bubbleProperties(completedWork) { @@ -9612,19 +9590,19 @@ function bubbleProperties(completedWork) { newChildLanes = 0, subtreeFlags = 0; if (didBailout) - for (var child$132 = completedWork.child; null !== child$132; ) - (newChildLanes |= child$132.lanes | child$132.childLanes), - (subtreeFlags |= child$132.subtreeFlags & 31457280), - (subtreeFlags |= child$132.flags & 31457280), - (child$132.return = completedWork), - (child$132 = child$132.sibling); + for (var child$131 = completedWork.child; null !== child$131; ) + (newChildLanes |= child$131.lanes | child$131.childLanes), + (subtreeFlags |= child$131.subtreeFlags & 31457280), + (subtreeFlags |= child$131.flags & 31457280), + (child$131.return = completedWork), + (child$131 = child$131.sibling); else - for (child$132 = completedWork.child; null !== child$132; ) - (newChildLanes |= child$132.lanes | child$132.childLanes), - (subtreeFlags |= child$132.subtreeFlags), - (subtreeFlags |= child$132.flags), - (child$132.return = completedWork), - (child$132 = child$132.sibling); + for (child$131 = completedWork.child; null !== child$131; ) + (newChildLanes |= child$131.lanes | child$131.childLanes), + (subtreeFlags |= child$131.subtreeFlags), + (subtreeFlags |= child$131.flags), + (child$131.return = completedWork), + (child$131 = child$131.sibling); completedWork.subtreeFlags |= subtreeFlags; completedWork.childLanes = newChildLanes; return didBailout; @@ -9901,11 +9879,11 @@ function completeWork(current, workInProgress, renderLanes) { null !== newProps.alternate.memoizedState && null !== newProps.alternate.memoizedState.cachePool && (type = newProps.alternate.memoizedState.cachePool.pool); - var cache$144 = null; + var cache$143 = null; null !== newProps.memoizedState && null !== newProps.memoizedState.cachePool && - (cache$144 = newProps.memoizedState.cachePool.pool); - cache$144 !== type && (newProps.flags |= 2048); + (cache$143 = newProps.memoizedState.cachePool.pool); + cache$143 !== type && (newProps.flags |= 2048); } renderLanes !== current && renderLanes && @@ -9930,8 +9908,8 @@ function completeWork(current, workInProgress, renderLanes) { type = workInProgress.memoizedState; if (null === type) return bubbleProperties(workInProgress), null; newProps = 0 !== (workInProgress.flags & 128); - cache$144 = type.rendering; - if (null === cache$144) + cache$143 = type.rendering; + if (null === cache$143) if (newProps) cutOffTailIfNeeded(type, !1); else { if ( @@ -9939,11 +9917,11 @@ function completeWork(current, workInProgress, renderLanes) { (null !== current && 0 !== (current.flags & 128)) ) for (current = workInProgress.child; null !== current; ) { - cache$144 = findFirstSuspended(current); - if (null !== cache$144) { + cache$143 = findFirstSuspended(current); + if (null !== cache$143) { workInProgress.flags |= 128; cutOffTailIfNeeded(type, !1); - current = cache$144.updateQueue; + current = cache$143.updateQueue; workInProgress.updateQueue = current; scheduleRetryEffect(workInProgress, current); workInProgress.subtreeFlags = 0; @@ -9968,7 +9946,7 @@ function completeWork(current, workInProgress, renderLanes) { } else { if (!newProps) - if (((current = findFirstSuspended(cache$144)), null !== current)) { + if (((current = findFirstSuspended(cache$143)), null !== current)) { if ( ((workInProgress.flags |= 128), (newProps = !0), @@ -9978,7 +9956,7 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(type, !0), null === type.tail && "hidden" === type.tailMode && - !cache$144.alternate && + !cache$143.alternate && !isHydrating) ) return bubbleProperties(workInProgress), null; @@ -9991,13 +9969,13 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(type, !1), (workInProgress.lanes = 4194304)); type.isBackwards - ? ((cache$144.sibling = workInProgress.child), - (workInProgress.child = cache$144)) + ? ((cache$143.sibling = workInProgress.child), + (workInProgress.child = cache$143)) : ((current = type.last), null !== current - ? (current.sibling = cache$144) - : (workInProgress.child = cache$144), - (type.last = cache$144)); + ? (current.sibling = cache$143) + : (workInProgress.child = cache$143), + (type.last = cache$143)); } if (null !== type.tail) return ( @@ -10222,8 +10200,7 @@ function scheduleUpdateOnFiber(root, fiber, lane) { markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane, - workInProgressRootDidSkipSuspendedSiblings + workInProgressDeferredLane ); markRootUpdated(root, lane); if (0 === (executionContext & 2) || root !== workInProgressRoot) @@ -10234,179 +10211,159 @@ function scheduleUpdateOnFiber(root, fiber, lane) { markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane, - workInProgressRootDidSkipSuspendedSiblings + workInProgressDeferredLane )), ensureRootIsScheduled(root); } -function performConcurrentWorkOnRoot(root, didTimeout) { +function performWorkOnRoot(root$jscomp$0, lanes, forceSync) { if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(327)); - var originalCallbackNode = root.callbackNode; - if (flushPassiveEffects() && root.callbackNode !== originalCallbackNode) - return null; - var lanes = getNextLanes( - root, - root === workInProgressRoot ? workInProgressRootRenderLanes : 0 - ); - if (0 === lanes) return null; var shouldTimeSlice = - 0 === (lanes & 60) && 0 === (lanes & root.expiredLanes) && !didTimeout; - didTimeout = shouldTimeSlice - ? renderRootConcurrent(root, lanes) - : renderRootSync(root, lanes); - if (0 !== didTimeout) { + (!forceSync && + 0 === (lanes & 60) && + 0 === (lanes & root$jscomp$0.expiredLanes)) || + !1, + exitStatus = shouldTimeSlice + ? renderRootConcurrent(root$jscomp$0, lanes) + : renderRootSync(root$jscomp$0, lanes, !0); + do { var renderWasConcurrent = shouldTimeSlice; - do { - if (6 === didTimeout) - markRootSuspended( - root, - lanes, - 0, - workInProgressRootDidSkipSuspendedSiblings - ); - else { - shouldTimeSlice = root.current.alternate; - if ( - renderWasConcurrent && - !isRenderConsistentWithExternalStores(shouldTimeSlice) - ) { - didTimeout = renderRootSync(root, lanes); - renderWasConcurrent = !1; - continue; - } - if (2 === didTimeout) { - renderWasConcurrent = lanes; - var errorRetryLanes = getLanesToRetrySynchronouslyOnError( - root, - renderWasConcurrent - ); - if ( - 0 !== errorRetryLanes && - ((lanes = errorRetryLanes), - (didTimeout = recoverFromConcurrentError( + if (0 === exitStatus) break; + else if (6 === exitStatus) markRootSuspended(root$jscomp$0, lanes, 0); + else { + forceSync = root$jscomp$0.current.alternate; + if ( + renderWasConcurrent && + !isRenderConsistentWithExternalStores(forceSync) + ) { + exitStatus = renderRootSync(root$jscomp$0, lanes, !1); + continue; + } + if (2 === exitStatus) { + renderWasConcurrent = lanes; + if (root$jscomp$0.errorRecoveryDisabledLanes & renderWasConcurrent) + var JSCompiler_inline_result = 0; + else + (JSCompiler_inline_result = root$jscomp$0.pendingLanes & -536870913), + (JSCompiler_inline_result = + 0 !== JSCompiler_inline_result + ? JSCompiler_inline_result + : JSCompiler_inline_result & 536870912 + ? 536870912 + : 0); + if (0 !== JSCompiler_inline_result) { + lanes = JSCompiler_inline_result; + a: { + var root = root$jscomp$0; + exitStatus = workInProgressRootConcurrentErrors; + var wasRootDehydrated = root.current.memoizedState.isDehydrated; + wasRootDehydrated && + (prepareFreshStack(root, JSCompiler_inline_result).flags |= 256); + JSCompiler_inline_result = renderRootSync( root, - renderWasConcurrent, - errorRetryLanes - )), - (renderWasConcurrent = !1), - 2 !== didTimeout) - ) - continue; - } - if (1 === didTimeout) { - prepareFreshStack(root, 0); - markRootSuspended( - root, - lanes, - 0, - workInProgressRootDidSkipSuspendedSiblings - ); - break; - } - a: { - renderWasConcurrent = root; - switch (didTimeout) { - case 0: - case 1: - throw Error(formatProdErrorMessage(345)); - case 4: - if ((lanes & 4194176) === lanes) { - markRootSuspended( - renderWasConcurrent, - lanes, - workInProgressDeferredLane, - workInProgressRootDidSkipSuspendedSiblings - ); + JSCompiler_inline_result, + !1 + ); + if (2 !== JSCompiler_inline_result) { + if ( + workInProgressRootDidAttachPingListener && + !wasRootDehydrated + ) { + root.errorRecoveryDisabledLanes |= renderWasConcurrent; + workInProgressRootInterleavedUpdatedLanes |= + renderWasConcurrent; + exitStatus = 4; break a; } - break; - case 2: - workInProgressRootRecoverableErrors = null; - break; - case 3: - case 5: - break; - default: - throw Error(formatProdErrorMessage(329)); + renderWasConcurrent = workInProgressRootRecoverableErrors; + workInProgressRootRecoverableErrors = exitStatus; + null !== renderWasConcurrent && + queueRecoverableErrors(renderWasConcurrent); + } + exitStatus = JSCompiler_inline_result; } - renderWasConcurrent.finishedWork = shouldTimeSlice; - renderWasConcurrent.finishedLanes = lanes; - if ( - (lanes & 62914560) === lanes && - ((didTimeout = globalMostRecentFallbackTime + 300 - now()), - 10 < didTimeout) - ) { - markRootSuspended( - renderWasConcurrent, - lanes, - workInProgressDeferredLane, - workInProgressRootDidSkipSuspendedSiblings - ); - if (0 !== getNextLanes(renderWasConcurrent, 0)) break a; - renderWasConcurrent.timeoutHandle = scheduleTimeout( - commitRootWhenReady.bind( - null, - renderWasConcurrent, + if (2 !== exitStatus) continue; + } + } + if (1 === exitStatus) { + prepareFreshStack(root$jscomp$0, 0); + markRootSuspended(root$jscomp$0, lanes, 0); + break; + } + a: { + shouldTimeSlice = root$jscomp$0; + switch (exitStatus) { + case 0: + case 1: + throw Error(formatProdErrorMessage(345)); + case 4: + if ((lanes & 4194176) === lanes) { + markRootSuspended( shouldTimeSlice, - workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, lanes, - workInProgressDeferredLane, - workInProgressRootInterleavedUpdatedLanes, - workInProgressSuspendedRetryLanes, - workInProgressRootDidSkipSuspendedSiblings - ), - didTimeout - ); - break a; - } - commitRootWhenReady( - renderWasConcurrent, - shouldTimeSlice, - workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, - lanes, - workInProgressDeferredLane, - workInProgressRootInterleavedUpdatedLanes, - workInProgressSuspendedRetryLanes, - workInProgressRootDidSkipSuspendedSiblings + workInProgressDeferredLane + ); + break a; + } + break; + case 2: + workInProgressRootRecoverableErrors = null; + break; + case 3: + case 5: + break; + default: + throw Error(formatProdErrorMessage(329)); + } + shouldTimeSlice.finishedWork = forceSync; + shouldTimeSlice.finishedLanes = lanes; + if ( + (lanes & 62914560) === lanes && + ((renderWasConcurrent = globalMostRecentFallbackTime + 300 - now()), + 10 < renderWasConcurrent) + ) { + markRootSuspended(shouldTimeSlice, lanes, workInProgressDeferredLane); + if (0 !== getNextLanes(shouldTimeSlice, 0)) break a; + shouldTimeSlice.timeoutHandle = scheduleTimeout( + commitRootWhenReady.bind( + null, + shouldTimeSlice, + forceSync, + workInProgressRootRecoverableErrors, + workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, + lanes, + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + workInProgressRootDidSkipSuspendedSiblings, + 2, + -0, + 0 + ), + renderWasConcurrent ); + break a; } + commitRootWhenReady( + shouldTimeSlice, + forceSync, + workInProgressRootRecoverableErrors, + workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, + lanes, + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + workInProgressRootDidSkipSuspendedSiblings, + 0, + -0, + 0 + ); } - break; - } while (1); - } - ensureRootIsScheduled(root); - scheduleTaskForRootDuringMicrotask(root, now()); - root = - root.callbackNode === originalCallbackNode - ? performConcurrentWorkOnRoot.bind(null, root) - : null; - return root; -} -function recoverFromConcurrentError( - root, - originallyAttemptedLanes, - errorRetryLanes -) { - var errorsFromFirstAttempt = workInProgressRootConcurrentErrors, - wasRootDehydrated = root.current.memoizedState.isDehydrated; - wasRootDehydrated && (prepareFreshStack(root, errorRetryLanes).flags |= 256); - errorRetryLanes = renderRootSync(root, errorRetryLanes); - if (2 !== errorRetryLanes) { - if (workInProgressRootDidAttachPingListener && !wasRootDehydrated) - return ( - (root.errorRecoveryDisabledLanes |= originallyAttemptedLanes), - (workInProgressRootInterleavedUpdatedLanes |= originallyAttemptedLanes), - 4 - ); - root = workInProgressRootRecoverableErrors; - workInProgressRootRecoverableErrors = errorsFromFirstAttempt; - null !== root && queueRecoverableErrors(root); - } - return errorRetryLanes; + } + break; + } while (1); + ensureRootIsScheduled(root$jscomp$0); } function queueRecoverableErrors(errors) { null === workInProgressRootRecoverableErrors @@ -10426,10 +10383,16 @@ function commitRootWhenReady( spawnedLane, updatedLanes, suspendedRetryLanes, - didSkipSuspendedSiblings + didSkipSuspendedSiblings, + suspendedCommitReason, + completedRenderStartTime, + completedRenderEndTime ) { - var subtreeFlags = finishedWork.subtreeFlags; - if (subtreeFlags & 8192 || 16785408 === (subtreeFlags & 16785408)) + didSkipSuspendedSiblings = finishedWork.subtreeFlags; + if ( + didSkipSuspendedSiblings & 8192 || + 16785408 === (didSkipSuspendedSiblings & 16785408) + ) if ( ((suspendedState = { stylesheets: null, count: 0, unsuspend: noop }), accumulateSuspenseyCommitOnFiber(finishedWork), @@ -10445,10 +10408,13 @@ function commitRootWhenReady( didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes + suspendedRetryLanes, + 1, + completedRenderStartTime, + completedRenderEndTime ) ); - markRootSuspended(root, lanes, spawnedLane, didSkipSuspendedSiblings); + markRootSuspended(root, lanes, spawnedLane); return; } commitRoot( @@ -10458,7 +10424,10 @@ function commitRootWhenReady( didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes + suspendedRetryLanes, + suspendedCommitReason, + completedRenderStartTime, + completedRenderEndTime ); } function isRenderConsistentWithExternalStores(finishedWork) { @@ -10504,77 +10473,24 @@ function markRootUpdated(root, updatedLanes) { : executionContext & 4 && (didIncludeCommitPhaseUpdate = !0); throwIfInfiniteUpdateLoopDetected(); } -function markRootSuspended( - root, - suspendedLanes, - spawnedLane, - didSkipSuspendedSiblings -) { +function markRootSuspended(root, suspendedLanes, spawnedLane) { suspendedLanes &= ~workInProgressRootPingedLanes; suspendedLanes &= ~workInProgressRootInterleavedUpdatedLanes; root.suspendedLanes |= suspendedLanes; root.pingedLanes &= ~suspendedLanes; - didSkipSuspendedSiblings || (root.warmLanes |= suspendedLanes); - didSkipSuspendedSiblings = root.expirationTimes; - for (var lanes = suspendedLanes; 0 < lanes; ) { - var index$6 = 31 - clz32(lanes), - lane = 1 << index$6; - didSkipSuspendedSiblings[index$6] = -1; + for ( + var expirationTimes = root.expirationTimes, lanes = suspendedLanes; + 0 < lanes; + + ) { + var index$5 = 31 - clz32(lanes), + lane = 1 << index$5; + expirationTimes[index$5] = -1; lanes &= ~lane; } 0 !== spawnedLane && markSpawnedDeferredLane(root, spawnedLane, suspendedLanes); } -function performSyncWorkOnRoot(root, lanes) { - if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(327)); - if (flushPassiveEffects()) return ensureRootIsScheduled(root), null; - var exitStatus = renderRootSync(root, lanes); - if (2 === exitStatus) { - var originallyAttemptedLanes = lanes, - errorRetryLanes = getLanesToRetrySynchronouslyOnError( - root, - originallyAttemptedLanes - ); - 0 !== errorRetryLanes && - ((lanes = errorRetryLanes), - (exitStatus = recoverFromConcurrentError( - root, - originallyAttemptedLanes, - errorRetryLanes - ))); - } - if (1 === exitStatus) - return ( - prepareFreshStack(root, 0), - markRootSuspended(root, lanes, 0, !1), - ensureRootIsScheduled(root), - null - ); - if (6 === exitStatus) - return ( - markRootSuspended( - root, - lanes, - workInProgressDeferredLane, - workInProgressRootDidSkipSuspendedSiblings - ), - ensureRootIsScheduled(root), - null - ); - root.finishedWork = root.current.alternate; - root.finishedLanes = lanes; - commitRoot( - root, - workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, - workInProgressDeferredLane, - workInProgressRootInterleavedUpdatedLanes, - workInProgressSuspendedRetryLanes - ); - ensureRootIsScheduled(root); - return null; -} function flushSyncWork$1() { return 0 === (executionContext & 6) ? (flushSyncWorkAcrossRoots_impl(0, !1), !1) @@ -10612,8 +10528,9 @@ function prepareFreshStack(root, lanes) { workInProgressRootRenderLanes = lanes; workInProgressSuspendedReason = 0; workInProgressThrownValue = null; - workInProgressRootDidAttachPingListener = - workInProgressRootDidSkipSuspendedSiblings = !1; + workInProgressRootDidSkipSuspendedSiblings = !1; + checkIfRootIsPrerendering(root, lanes); + workInProgressRootDidAttachPingListener = !1; workInProgressSuspendedRetryLanes = workInProgressDeferredLane = workInProgressRootPingedLanes = @@ -10632,9 +10549,9 @@ function prepareFreshStack(root, lanes) { 0 < allEntangledLanes; ) { - var index$4 = 31 - clz32(allEntangledLanes), - lane = 1 << index$4; - lanes |= root[index$4]; + var index$3 = 31 - clz32(allEntangledLanes), + lane = 1 << index$3; + lanes |= root[index$3]; allEntangledLanes &= ~lane; } entangledRenderLanes = lanes; @@ -10704,8 +10621,7 @@ function renderDidSuspendDelayIfPossible() { markRootSuspended( workInProgressRoot, workInProgressRootRenderLanes, - workInProgressDeferredLane, - workInProgressRootDidSkipSuspendedSiblings + workInProgressDeferredLane ); } function renderRootSync(root, lanes) { @@ -10716,6 +10632,7 @@ function renderRootSync(root, lanes) { if (workInProgressRoot !== root || workInProgressRootRenderLanes !== lanes) (workInProgressTransitions = null), prepareFreshStack(root, lanes); lanes = !1; + var exitStatus = workInProgressRootExitStatus; a: do try { if (0 !== workInProgressSuspendedReason && null !== workInProgress) { @@ -10724,21 +10641,26 @@ function renderRootSync(root, lanes) { switch (workInProgressSuspendedReason) { case 8: resetWorkInProgressStack(); - workInProgressRootExitStatus = 6; + exitStatus = 6; break a; case 3: case 2: - lanes || - null !== suspenseHandlerStackCursor.current || - (lanes = !0); - default: + case 6: + null === suspenseHandlerStackCursor.current && (lanes = !0); var reason = workInProgressSuspendedReason; workInProgressSuspendedReason = 0; workInProgressThrownValue = null; throwAndUnwindWorkLoop(root, unitOfWork, thrownValue, reason); + break; + default: + (reason = workInProgressSuspendedReason), + (workInProgressSuspendedReason = 0), + (workInProgressThrownValue = null), + throwAndUnwindWorkLoop(root, unitOfWork, thrownValue, reason); } } workLoopSync(); + exitStatus = workInProgressRootExitStatus; break; } catch (thrownValue$159) { handleThrow(root, thrownValue$159); @@ -10749,11 +10671,11 @@ function renderRootSync(root, lanes) { executionContext = prevExecutionContext; ReactSharedInternals.H = prevDispatcher; ReactSharedInternals.A = prevAsyncDispatcher; - if (null !== workInProgress) throw Error(formatProdErrorMessage(261)); - workInProgressRoot = null; - workInProgressRootRenderLanes = 0; - finishQueueingConcurrentUpdates(); - return workInProgressRootExitStatus; + null === workInProgress && + ((workInProgressRoot = null), + (workInProgressRootRenderLanes = 0), + finishQueueingConcurrentUpdates()); + return exitStatus; } function workLoopSync() { for (; null !== workInProgress; ) performUnitOfWork(workInProgress); @@ -10763,10 +10685,11 @@ function renderRootConcurrent(root, lanes) { executionContext |= 2; var prevDispatcher = pushDispatcher(), prevAsyncDispatcher = pushAsyncDispatcher(); - if (workInProgressRoot !== root || workInProgressRootRenderLanes !== lanes) - (workInProgressTransitions = null), + workInProgressRoot !== root || workInProgressRootRenderLanes !== lanes + ? ((workInProgressTransitions = null), (workInProgressRootRenderTargetTime = now() + 500), - prepareFreshStack(root, lanes); + prepareFreshStack(root, lanes)) + : checkIfRootIsPrerendering(root, lanes); a: do try { if (0 !== workInProgressSuspendedReason && null !== workInProgress) { @@ -11006,7 +10929,10 @@ function commitRoot( didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes + suspendedRetryLanes, + suspendedCommitReason, + completedRenderStartTime, + completedRenderEndTime ) { var prevTransition = ReactSharedInternals.T, previousUpdateLanePriority = ReactDOMSharedInternals.p; @@ -11021,13 +10947,15 @@ function commitRoot( previousUpdateLanePriority, spawnedLane, updatedLanes, - suspendedRetryLanes + suspendedRetryLanes, + suspendedCommitReason, + completedRenderStartTime, + completedRenderEndTime ); } finally { (ReactSharedInternals.T = prevTransition), (ReactDOMSharedInternals.p = previousUpdateLanePriority); } - return null; } function commitRootImpl( root, @@ -11035,9 +10963,7 @@ function commitRootImpl( transitions, didIncludeRenderPhaseUpdate, renderPriorityLevel, - spawnedLane, - updatedLanes, - suspendedRetryLanes + spawnedLane ) { do flushPassiveEffects(); while (null !== rootWithPendingPassiveEffects); @@ -11053,14 +10979,7 @@ function commitRootImpl( root.cancelPendingCommit = null; var remainingLanes = finishedWork.lanes | finishedWork.childLanes; remainingLanes |= concurrentlyUpdatedLanes; - markRootFinished( - root, - lanes, - remainingLanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes - ); + markRootFinished(root, lanes, remainingLanes, spawnedLane); didIncludeCommitPhaseUpdate = !1; root === workInProgressRoot && ((workInProgress = workInProgressRoot = null), @@ -11072,29 +10991,29 @@ function commitRootImpl( (pendingPassiveEffectsRemainingLanes = remainingLanes), (pendingPassiveTransitions = transitions), scheduleCallback$1(NormalPriority$1, function () { - flushPassiveEffects(); + flushPassiveEffects(!0); return null; })); transitions = 0 !== (finishedWork.flags & 15990); - 0 !== (finishedWork.subtreeFlags & 15990) || transitions - ? ((transitions = ReactSharedInternals.T), - (ReactSharedInternals.T = null), - (spawnedLane = ReactDOMSharedInternals.p), - (ReactDOMSharedInternals.p = 2), - (updatedLanes = executionContext), - (executionContext |= 4), - commitBeforeMutationEffects(root, finishedWork), - commitMutationEffectsOnFiber(finishedWork, root), - restoreSelection(selectionInformation, root.containerInfo), - (_enabled = !!eventsEnabled), - (selectionInformation = eventsEnabled = null), - (root.current = finishedWork), - commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork), - requestPaint(), - (executionContext = updatedLanes), - (ReactDOMSharedInternals.p = spawnedLane), - (ReactSharedInternals.T = transitions)) - : (root.current = finishedWork); + if (0 !== (finishedWork.subtreeFlags & 15990) || transitions) { + transitions = ReactSharedInternals.T; + ReactSharedInternals.T = null; + spawnedLane = ReactDOMSharedInternals.p; + ReactDOMSharedInternals.p = 2; + var prevExecutionContext = executionContext; + executionContext |= 4; + commitBeforeMutationEffects(root, finishedWork); + commitMutationEffectsOnFiber(finishedWork, root); + restoreSelection(selectionInformation, root.containerInfo); + _enabled = !!eventsEnabled; + selectionInformation = eventsEnabled = null; + root.current = finishedWork; + commitLayoutEffectOnFiber(root, finishedWork.alternate, finishedWork); + requestPaint(); + executionContext = prevExecutionContext; + ReactDOMSharedInternals.p = spawnedLane; + ReactSharedInternals.T = transitions; + } else root.current = finishedWork; rootDoesHavePassiveEffects ? ((rootDoesHavePassiveEffects = !1), (rootWithPendingPassiveEffects = root), @@ -11296,7 +11215,7 @@ function resolveRetryWakeable(boundaryFiber, wakeable) { retryTimedOutBoundary(boundaryFiber, retryLane); } function throwIfInfiniteUpdateLoopDetected() { - if (50 < nestedUpdateCount) + if (100 < nestedUpdateCount) throw ( ((nestedUpdateCount = 0), (rootWithNestedUpdates = null), @@ -11360,7 +11279,8 @@ function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) { root$167, root$167 === workInProgressRoot ? JSCompiler_inline_result : 0 )), - 0 !== (JSCompiler_inline_result & 3) && + 0 === (JSCompiler_inline_result & 3) || + checkIfRootIsPrerendering(root$167, JSCompiler_inline_result) || ((didPerformSomeWork = !0), performSyncWorkOnRoot(root$167, JSCompiler_inline_result)); root$167 = root$167.next; @@ -11404,12 +11324,12 @@ function scheduleTaskForRootDuringMicrotask(root, currentTime) { 0 < lanes; ) { - var index$5 = 31 - clz32(lanes), - lane = 1 << index$5, - expirationTime = expirationTimes[index$5]; + var index$4 = 31 - clz32(lanes), + lane = 1 << index$4, + expirationTime = expirationTimes[index$4]; if (-1 === expirationTime) { if (0 === (lane & suspendedLanes) || 0 !== (lane & pingedLanes)) - expirationTimes[index$5] = computeExpirationTime(lane, currentTime); + expirationTimes[index$4] = computeExpirationTime(lane, currentTime); } else expirationTime <= currentTime && (root.expiredLanes |= lane); lanes &= ~lane; } @@ -11446,8 +11366,6 @@ function scheduleTaskForRootDuringMicrotask(root, currentTime) { null !== pingedLanes && cancelCallback$1(pingedLanes); switch (lanesToEventPriority(suspendedLanes)) { case 2: - suspendedLanes = ImmediatePriority; - break; case 8: suspendedLanes = UserBlockingPriority; break; @@ -11460,12 +11378,32 @@ function scheduleTaskForRootDuringMicrotask(root, currentTime) { default: suspendedLanes = NormalPriority$1; } - pingedLanes = performConcurrentWorkOnRoot.bind(null, root); + pingedLanes = performWorkOnRootViaSchedulerTask.bind(null, root); suspendedLanes = scheduleCallback$3(suspendedLanes, pingedLanes); root.callbackPriority = currentTime; root.callbackNode = suspendedLanes; return currentTime; } +function performWorkOnRootViaSchedulerTask(root, didTimeout) { + var originalCallbackNode = root.callbackNode; + if (flushPassiveEffects() && root.callbackNode !== originalCallbackNode) + return null; + var workInProgressRootRenderLanes$jscomp$0 = workInProgressRootRenderLanes; + workInProgressRootRenderLanes$jscomp$0 = getNextLanes( + root, + root === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0 + ); + if (0 === workInProgressRootRenderLanes$jscomp$0) return null; + performWorkOnRoot(root, workInProgressRootRenderLanes$jscomp$0, didTimeout); + scheduleTaskForRootDuringMicrotask(root, now()); + return root.callbackNode === originalCallbackNode + ? performWorkOnRootViaSchedulerTask.bind(null, root) + : null; +} +function performSyncWorkOnRoot(root, lanes) { + if (flushPassiveEffects()) return null; + performWorkOnRoot(root, lanes, !0); +} function scheduleImmediateTask(cb) { scheduleMicrotask(function () { 0 !== (executionContext & 6) @@ -11573,20 +11511,20 @@ function extractEvents$1( } } for ( - var i$jscomp$inline_1411 = 0; - i$jscomp$inline_1411 < simpleEventPluginEvents.length; - i$jscomp$inline_1411++ + var i$jscomp$inline_1417 = 0; + i$jscomp$inline_1417 < simpleEventPluginEvents.length; + i$jscomp$inline_1417++ ) { - var eventName$jscomp$inline_1412 = - simpleEventPluginEvents[i$jscomp$inline_1411], - domEventName$jscomp$inline_1413 = - eventName$jscomp$inline_1412.toLowerCase(), - capitalizedEvent$jscomp$inline_1414 = - eventName$jscomp$inline_1412[0].toUpperCase() + - eventName$jscomp$inline_1412.slice(1); + var eventName$jscomp$inline_1418 = + simpleEventPluginEvents[i$jscomp$inline_1417], + domEventName$jscomp$inline_1419 = + eventName$jscomp$inline_1418.toLowerCase(), + capitalizedEvent$jscomp$inline_1420 = + eventName$jscomp$inline_1418[0].toUpperCase() + + eventName$jscomp$inline_1418.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1413, - "on" + capitalizedEvent$jscomp$inline_1414 + domEventName$jscomp$inline_1419, + "on" + capitalizedEvent$jscomp$inline_1420 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -15027,16 +14965,16 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) { 0 === i && attemptExplicitHydrationTarget(target); } }; -var isomorphicReactPackageVersion$jscomp$inline_1658 = React.version; +var isomorphicReactPackageVersion$jscomp$inline_1664 = React.version; if ( - "19.0.0-rc-5d19e1c8-20240923" !== - isomorphicReactPackageVersion$jscomp$inline_1658 + "19.0.0-rc-778e1ed2-20240926" !== + isomorphicReactPackageVersion$jscomp$inline_1664 ) throw Error( formatProdErrorMessage( 527, - isomorphicReactPackageVersion$jscomp$inline_1658, - "19.0.0-rc-5d19e1c8-20240923" + isomorphicReactPackageVersion$jscomp$inline_1664, + "19.0.0-rc-778e1ed2-20240926" ) ); ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { @@ -15056,25 +14994,25 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { null === componentOrElement ? null : componentOrElement.stateNode; return componentOrElement; }; -var internals$jscomp$inline_2124 = { +var internals$jscomp$inline_2135 = { bundleType: 0, - version: "19.0.0-rc-5d19e1c8-20240923", + version: "19.0.0-rc-778e1ed2-20240926", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, findFiberByHostInstance: getClosestInstanceFromNode, - reconcilerVersion: "19.0.0-rc-5d19e1c8-20240923" + reconcilerVersion: "19.0.0-rc-778e1ed2-20240926" }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_2125 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_2136 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_2125.isDisabled && - hook$jscomp$inline_2125.supportsFiber + !hook$jscomp$inline_2136.isDisabled && + hook$jscomp$inline_2136.supportsFiber ) try { - (rendererID = hook$jscomp$inline_2125.inject( - internals$jscomp$inline_2124 + (rendererID = hook$jscomp$inline_2136.inject( + internals$jscomp$inline_2135 )), - (injectedHook = hook$jscomp$inline_2125); + (injectedHook = hook$jscomp$inline_2136); } catch (err) {} } exports.createRoot = function (container, options) { @@ -15166,4 +15104,4 @@ exports.hydrateRoot = function (container, initialChildren, options) { listenToAllSupportedEvents(container); return new ReactDOMHydrationRoot(initialChildren); }; -exports.version = "19.0.0-rc-5d19e1c8-20240923"; +exports.version = "19.0.0-rc-778e1ed2-20240926"; diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom-profiling.development.js b/packages/next/src/compiled/react-dom/cjs/react-dom-profiling.development.js index 40a3092689065..4249be1de375a 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom-profiling.development.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom-profiling.development.js @@ -1006,43 +1006,39 @@ var pendingLanes = root.pendingLanes; if (0 === pendingLanes) return 0; var nextLanes = 0, - suspendedLanes = root.suspendedLanes, - pingedLanes = root.pingedLanes, - warmLanes = root.warmLanes; - root = 0 !== root.finishedLanes; + suspendedLanes = root.suspendedLanes; + root = root.pingedLanes; var nonIdlePendingLanes = pendingLanes & 134217727; 0 !== nonIdlePendingLanes ? ((pendingLanes = nonIdlePendingLanes & ~suspendedLanes), 0 !== pendingLanes ? (nextLanes = getHighestPriorityLanes(pendingLanes)) - : ((pingedLanes &= nonIdlePendingLanes), - 0 !== pingedLanes - ? (nextLanes = getHighestPriorityLanes(pingedLanes)) - : root || - ((warmLanes = nonIdlePendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes))))) - : ((nonIdlePendingLanes = pendingLanes & ~suspendedLanes), - 0 !== nonIdlePendingLanes - ? (nextLanes = getHighestPriorityLanes(nonIdlePendingLanes)) - : 0 !== pingedLanes - ? (nextLanes = getHighestPriorityLanes(pingedLanes)) - : root || - ((warmLanes = pendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes)))); + : ((root &= nonIdlePendingLanes), + 0 !== root && (nextLanes = getHighestPriorityLanes(root)))) + : ((pendingLanes &= ~suspendedLanes), + 0 !== pendingLanes + ? (nextLanes = getHighestPriorityLanes(pendingLanes)) + : 0 !== root && (nextLanes = getHighestPriorityLanes(root))); return 0 === nextLanes ? 0 : 0 !== wipLanes && wipLanes !== nextLanes && 0 === (wipLanes & suspendedLanes) && ((suspendedLanes = nextLanes & -nextLanes), - (warmLanes = wipLanes & -wipLanes), - suspendedLanes >= warmLanes || - (32 === suspendedLanes && 0 !== (warmLanes & 4194176))) + (root = wipLanes & -wipLanes), + suspendedLanes >= root || + (32 === suspendedLanes && 0 !== (root & 4194176))) ? wipLanes : nextLanes; } + function checkIfRootIsPrerendering(root, renderLanes) { + return ( + 0 === + (root.pendingLanes & + ~(root.suspendedLanes & ~root.pingedLanes) & + renderLanes) + ); + } function computeExpirationTime(lane, currentTime) { switch (lane) { case 1: @@ -1089,14 +1085,6 @@ ); } } - function getLanesToRetrySynchronouslyOnError( - root, - originallyAttemptedLanes - ) { - if (root.errorRecoveryDisabledLanes & originallyAttemptedLanes) return 0; - root = root.pendingLanes & -536870913; - return 0 !== root ? root : root & 536870912 ? 536870912 : 0; - } function claimNextTransitionLane() { var lane = nextTransitionLane; nextTransitionLane <<= 1; @@ -1117,9 +1105,7 @@ root, finishedLanes, remainingLanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes + spawnedLane ) { var previouslyPendingLanes = root.pendingLanes; root.pendingLanes = remainingLanes; @@ -1130,17 +1116,17 @@ root.entangledLanes &= remainingLanes; root.errorRecoveryDisabledLanes &= remainingLanes; root.shellSuspendCounter = 0; - var entanglements = root.entanglements, - expirationTimes = root.expirationTimes, + finishedLanes = root.entanglements; + var expirationTimes = root.expirationTimes, hiddenUpdates = root.hiddenUpdates; for ( remainingLanes = previouslyPendingLanes & ~remainingLanes; 0 < remainingLanes; ) { - var index = 31 - clz32(remainingLanes), - lane = 1 << index; - entanglements[index] = 0; + var index = 31 - clz32(remainingLanes); + previouslyPendingLanes = 1 << index; + finishedLanes[index] = 0; expirationTimes[index] = -1; var hiddenUpdatesForLane = hiddenUpdates[index]; if (null !== hiddenUpdatesForLane) @@ -1152,14 +1138,9 @@ var update = hiddenUpdatesForLane[index]; null !== update && (update.lane &= -536870913); } - remainingLanes &= ~lane; + remainingLanes &= ~previouslyPendingLanes; } 0 !== spawnedLane && markSpawnedDeferredLane(root, spawnedLane, 0); - 0 !== suspendedRetryLanes && - 0 === updatedLanes && - 0 !== root.tag && - (root.suspendedLanes |= - suspendedRetryLanes & ~(previouslyPendingLanes & ~finishedLanes)); } function markSpawnedDeferredLane(root, spawnedLane, entangledLanes) { root.pendingLanes |= spawnedLane; @@ -8644,32 +8625,32 @@ return current; } function updateSuspenseComponent(current, workInProgress, renderLanes) { - var JSCompiler_object_inline_digest_2292; - var JSCompiler_object_inline_stack_2293 = workInProgress.pendingProps; + var JSCompiler_object_inline_digest_2301; + var JSCompiler_object_inline_stack_2302 = workInProgress.pendingProps; shouldSuspendImpl(workInProgress) && (workInProgress.flags |= 128); - var JSCompiler_object_inline_componentStack_2294 = !1; + var JSCompiler_object_inline_componentStack_2303 = !1; var didSuspend = 0 !== (workInProgress.flags & 128); - (JSCompiler_object_inline_digest_2292 = didSuspend) || - (JSCompiler_object_inline_digest_2292 = + (JSCompiler_object_inline_digest_2301 = didSuspend) || + (JSCompiler_object_inline_digest_2301 = null !== current && null === current.memoizedState ? !1 : 0 !== (suspenseStackCursor.current & ForceSuspenseFallback)); - JSCompiler_object_inline_digest_2292 && - ((JSCompiler_object_inline_componentStack_2294 = !0), + JSCompiler_object_inline_digest_2301 && + ((JSCompiler_object_inline_componentStack_2303 = !0), (workInProgress.flags &= -129)); - JSCompiler_object_inline_digest_2292 = 0 !== (workInProgress.flags & 32); + JSCompiler_object_inline_digest_2301 = 0 !== (workInProgress.flags & 32); workInProgress.flags &= -33; if (null === current) { if (isHydrating) { - JSCompiler_object_inline_componentStack_2294 + JSCompiler_object_inline_componentStack_2303 ? pushPrimaryTreeSuspenseHandler(workInProgress) : reuseSuspenseHandlerOnStack(workInProgress); if (isHydrating) { - var JSCompiler_object_inline_message_2291 = nextHydratableInstance; + var JSCompiler_object_inline_message_2300 = nextHydratableInstance; var JSCompiler_temp; - if (!(JSCompiler_temp = !JSCompiler_object_inline_message_2291)) { + if (!(JSCompiler_temp = !JSCompiler_object_inline_message_2300)) { c: { - var instance = JSCompiler_object_inline_message_2291; + var instance = JSCompiler_object_inline_message_2300; for ( JSCompiler_temp = rootOrSingletonContext; 8 !== instance.nodeType; @@ -8710,19 +8691,19 @@ JSCompiler_temp && (warnNonHydratedInstance( workInProgress, - JSCompiler_object_inline_message_2291 + JSCompiler_object_inline_message_2300 ), throwOnHydrationMismatch(workInProgress)); } - JSCompiler_object_inline_message_2291 = workInProgress.memoizedState; + JSCompiler_object_inline_message_2300 = workInProgress.memoizedState; if ( - null !== JSCompiler_object_inline_message_2291 && - ((JSCompiler_object_inline_message_2291 = - JSCompiler_object_inline_message_2291.dehydrated), - null !== JSCompiler_object_inline_message_2291) + null !== JSCompiler_object_inline_message_2300 && + ((JSCompiler_object_inline_message_2300 = + JSCompiler_object_inline_message_2300.dehydrated), + null !== JSCompiler_object_inline_message_2300) ) return ( - JSCompiler_object_inline_message_2291.data === + JSCompiler_object_inline_message_2300.data === SUSPENSE_FALLBACK_START_DATA ? (workInProgress.lanes = 16) : (workInProgress.lanes = 536870912), @@ -8730,58 +8711,58 @@ ); popSuspenseHandler(workInProgress); } - JSCompiler_object_inline_message_2291 = - JSCompiler_object_inline_stack_2293.children; - JSCompiler_object_inline_stack_2293 = - JSCompiler_object_inline_stack_2293.fallback; - if (JSCompiler_object_inline_componentStack_2294) + JSCompiler_object_inline_message_2300 = + JSCompiler_object_inline_stack_2302.children; + JSCompiler_object_inline_stack_2302 = + JSCompiler_object_inline_stack_2302.fallback; + if (JSCompiler_object_inline_componentStack_2303) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_componentStack_2294 = + (JSCompiler_object_inline_componentStack_2303 = workInProgress.mode), - (JSCompiler_object_inline_message_2291 = + (JSCompiler_object_inline_message_2300 = mountWorkInProgressOffscreenFiber( { mode: "hidden", - children: JSCompiler_object_inline_message_2291 + children: JSCompiler_object_inline_message_2300 }, - JSCompiler_object_inline_componentStack_2294 + JSCompiler_object_inline_componentStack_2303 )), - (JSCompiler_object_inline_stack_2293 = createFiberFromFragment( - JSCompiler_object_inline_stack_2293, - JSCompiler_object_inline_componentStack_2294, + (JSCompiler_object_inline_stack_2302 = createFiberFromFragment( + JSCompiler_object_inline_stack_2302, + JSCompiler_object_inline_componentStack_2303, renderLanes, null )), - (JSCompiler_object_inline_message_2291.return = workInProgress), - (JSCompiler_object_inline_stack_2293.return = workInProgress), - (JSCompiler_object_inline_message_2291.sibling = - JSCompiler_object_inline_stack_2293), - (workInProgress.child = JSCompiler_object_inline_message_2291), - (JSCompiler_object_inline_componentStack_2294 = + (JSCompiler_object_inline_message_2300.return = workInProgress), + (JSCompiler_object_inline_stack_2302.return = workInProgress), + (JSCompiler_object_inline_message_2300.sibling = + JSCompiler_object_inline_stack_2302), + (workInProgress.child = JSCompiler_object_inline_message_2300), + (JSCompiler_object_inline_componentStack_2303 = workInProgress.child), - (JSCompiler_object_inline_componentStack_2294.memoizedState = + (JSCompiler_object_inline_componentStack_2303.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_componentStack_2294.childLanes = + (JSCompiler_object_inline_componentStack_2303.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2292, + JSCompiler_object_inline_digest_2301, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2293 + JSCompiler_object_inline_stack_2302 ); pushPrimaryTreeSuspenseHandler(workInProgress); return mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_message_2291 + JSCompiler_object_inline_message_2300 ); } var prevState = current.memoizedState; if ( null !== prevState && - ((JSCompiler_object_inline_message_2291 = prevState.dehydrated), - null !== JSCompiler_object_inline_message_2291) + ((JSCompiler_object_inline_message_2300 = prevState.dehydrated), + null !== JSCompiler_object_inline_message_2300) ) { if (didSuspend) workInProgress.flags & 256 @@ -8798,94 +8779,94 @@ (workInProgress.flags |= 128), (workInProgress = null)) : (reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_componentStack_2294 = - JSCompiler_object_inline_stack_2293.fallback), - (JSCompiler_object_inline_message_2291 = workInProgress.mode), - (JSCompiler_object_inline_stack_2293 = + (JSCompiler_object_inline_componentStack_2303 = + JSCompiler_object_inline_stack_2302.fallback), + (JSCompiler_object_inline_message_2300 = workInProgress.mode), + (JSCompiler_object_inline_stack_2302 = mountWorkInProgressOffscreenFiber( { mode: "visible", - children: JSCompiler_object_inline_stack_2293.children + children: JSCompiler_object_inline_stack_2302.children }, - JSCompiler_object_inline_message_2291 + JSCompiler_object_inline_message_2300 )), - (JSCompiler_object_inline_componentStack_2294 = + (JSCompiler_object_inline_componentStack_2303 = createFiberFromFragment( - JSCompiler_object_inline_componentStack_2294, - JSCompiler_object_inline_message_2291, + JSCompiler_object_inline_componentStack_2303, + JSCompiler_object_inline_message_2300, renderLanes, null )), - (JSCompiler_object_inline_componentStack_2294.flags |= 2), - (JSCompiler_object_inline_stack_2293.return = workInProgress), - (JSCompiler_object_inline_componentStack_2294.return = + (JSCompiler_object_inline_componentStack_2303.flags |= 2), + (JSCompiler_object_inline_stack_2302.return = workInProgress), + (JSCompiler_object_inline_componentStack_2303.return = workInProgress), - (JSCompiler_object_inline_stack_2293.sibling = - JSCompiler_object_inline_componentStack_2294), - (workInProgress.child = JSCompiler_object_inline_stack_2293), + (JSCompiler_object_inline_stack_2302.sibling = + JSCompiler_object_inline_componentStack_2303), + (workInProgress.child = JSCompiler_object_inline_stack_2302), reconcileChildFibers( workInProgress, current.child, null, renderLanes ), - (JSCompiler_object_inline_stack_2293 = workInProgress.child), - (JSCompiler_object_inline_stack_2293.memoizedState = + (JSCompiler_object_inline_stack_2302 = workInProgress.child), + (JSCompiler_object_inline_stack_2302.memoizedState = mountSuspenseOffscreenState(renderLanes)), - (JSCompiler_object_inline_stack_2293.childLanes = + (JSCompiler_object_inline_stack_2302.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2292, + JSCompiler_object_inline_digest_2301, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), (workInProgress = - JSCompiler_object_inline_componentStack_2294)); + JSCompiler_object_inline_componentStack_2303)); else if ( (pushPrimaryTreeSuspenseHandler(workInProgress), isHydrating && console.error( "We should not be hydrating here. This is a bug in React. Please file a bug." ), - JSCompiler_object_inline_message_2291.data === + JSCompiler_object_inline_message_2300.data === SUSPENSE_FALLBACK_START_DATA) ) { - JSCompiler_object_inline_digest_2292 = - JSCompiler_object_inline_message_2291.nextSibling && - JSCompiler_object_inline_message_2291.nextSibling.dataset; - if (JSCompiler_object_inline_digest_2292) { - JSCompiler_temp = JSCompiler_object_inline_digest_2292.dgst; - var message = JSCompiler_object_inline_digest_2292.msg; - instance = JSCompiler_object_inline_digest_2292.stck; - var componentStack = JSCompiler_object_inline_digest_2292.cstck; + JSCompiler_object_inline_digest_2301 = + JSCompiler_object_inline_message_2300.nextSibling && + JSCompiler_object_inline_message_2300.nextSibling.dataset; + if (JSCompiler_object_inline_digest_2301) { + JSCompiler_temp = JSCompiler_object_inline_digest_2301.dgst; + var message = JSCompiler_object_inline_digest_2301.msg; + instance = JSCompiler_object_inline_digest_2301.stck; + var componentStack = JSCompiler_object_inline_digest_2301.cstck; } - JSCompiler_object_inline_message_2291 = message; - JSCompiler_object_inline_digest_2292 = JSCompiler_temp; - JSCompiler_object_inline_stack_2293 = instance; - JSCompiler_object_inline_componentStack_2294 = componentStack; - JSCompiler_object_inline_message_2291 = - JSCompiler_object_inline_message_2291 - ? Error(JSCompiler_object_inline_message_2291) + JSCompiler_object_inline_message_2300 = message; + JSCompiler_object_inline_digest_2301 = JSCompiler_temp; + JSCompiler_object_inline_stack_2302 = instance; + JSCompiler_object_inline_componentStack_2303 = componentStack; + JSCompiler_object_inline_message_2300 = + JSCompiler_object_inline_message_2300 + ? Error(JSCompiler_object_inline_message_2300) : Error( "The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering." ); - JSCompiler_object_inline_message_2291.stack = - JSCompiler_object_inline_stack_2293 || ""; - JSCompiler_object_inline_message_2291.digest = - JSCompiler_object_inline_digest_2292; - JSCompiler_object_inline_digest_2292 = - void 0 === JSCompiler_object_inline_componentStack_2294 + JSCompiler_object_inline_message_2300.stack = + JSCompiler_object_inline_stack_2302 || ""; + JSCompiler_object_inline_message_2300.digest = + JSCompiler_object_inline_digest_2301; + JSCompiler_object_inline_digest_2301 = + void 0 === JSCompiler_object_inline_componentStack_2303 ? null - : JSCompiler_object_inline_componentStack_2294; - "string" === typeof JSCompiler_object_inline_digest_2292 && + : JSCompiler_object_inline_componentStack_2303; + "string" === typeof JSCompiler_object_inline_digest_2301 && CapturedStacks.set( - JSCompiler_object_inline_message_2291, - JSCompiler_object_inline_digest_2292 + JSCompiler_object_inline_message_2300, + JSCompiler_object_inline_digest_2301 ); queueHydrationError({ - value: JSCompiler_object_inline_message_2291, + value: JSCompiler_object_inline_message_2300, source: null, - stack: JSCompiler_object_inline_digest_2292 + stack: JSCompiler_object_inline_digest_2301 }); workInProgress = retrySuspenseComponentWithoutHydrating( current, @@ -8900,25 +8881,25 @@ renderLanes, !1 ), - (JSCompiler_object_inline_digest_2292 = + (JSCompiler_object_inline_digest_2301 = 0 !== (renderLanes & current.childLanes)), - didReceiveUpdate || JSCompiler_object_inline_digest_2292) + didReceiveUpdate || JSCompiler_object_inline_digest_2301) ) { - JSCompiler_object_inline_digest_2292 = workInProgressRoot; - if (null !== JSCompiler_object_inline_digest_2292) { - JSCompiler_object_inline_stack_2293 = renderLanes & -renderLanes; - if (0 !== (JSCompiler_object_inline_stack_2293 & 42)) - JSCompiler_object_inline_stack_2293 = 1; + JSCompiler_object_inline_digest_2301 = workInProgressRoot; + if (null !== JSCompiler_object_inline_digest_2301) { + JSCompiler_object_inline_stack_2302 = renderLanes & -renderLanes; + if (0 !== (JSCompiler_object_inline_stack_2302 & 42)) + JSCompiler_object_inline_stack_2302 = 1; else - switch (JSCompiler_object_inline_stack_2293) { + switch (JSCompiler_object_inline_stack_2302) { case 2: - JSCompiler_object_inline_stack_2293 = 1; + JSCompiler_object_inline_stack_2302 = 1; break; case 8: - JSCompiler_object_inline_stack_2293 = 4; + JSCompiler_object_inline_stack_2302 = 4; break; case 32: - JSCompiler_object_inline_stack_2293 = 16; + JSCompiler_object_inline_stack_2302 = 16; break; case 128: case 256: @@ -8939,40 +8920,40 @@ case 8388608: case 16777216: case 33554432: - JSCompiler_object_inline_stack_2293 = 64; + JSCompiler_object_inline_stack_2302 = 64; break; case 268435456: - JSCompiler_object_inline_stack_2293 = 134217728; + JSCompiler_object_inline_stack_2302 = 134217728; break; default: - JSCompiler_object_inline_stack_2293 = 0; + JSCompiler_object_inline_stack_2302 = 0; } - JSCompiler_object_inline_stack_2293 = + JSCompiler_object_inline_stack_2302 = 0 !== - (JSCompiler_object_inline_stack_2293 & - (JSCompiler_object_inline_digest_2292.suspendedLanes | + (JSCompiler_object_inline_stack_2302 & + (JSCompiler_object_inline_digest_2301.suspendedLanes | renderLanes)) ? 0 - : JSCompiler_object_inline_stack_2293; + : JSCompiler_object_inline_stack_2302; if ( - 0 !== JSCompiler_object_inline_stack_2293 && - JSCompiler_object_inline_stack_2293 !== prevState.retryLane + 0 !== JSCompiler_object_inline_stack_2302 && + JSCompiler_object_inline_stack_2302 !== prevState.retryLane ) throw ( - ((prevState.retryLane = JSCompiler_object_inline_stack_2293), + ((prevState.retryLane = JSCompiler_object_inline_stack_2302), enqueueConcurrentRenderForLane( current, - JSCompiler_object_inline_stack_2293 + JSCompiler_object_inline_stack_2302 ), scheduleUpdateOnFiber( - JSCompiler_object_inline_digest_2292, + JSCompiler_object_inline_digest_2301, current, - JSCompiler_object_inline_stack_2293 + JSCompiler_object_inline_stack_2302 ), SelectiveHydrationException) ); } - JSCompiler_object_inline_message_2291.data === + JSCompiler_object_inline_message_2300.data === SUSPENSE_PENDING_START_DATA || renderDidSuspendDelayIfPossible(); workInProgress = retrySuspenseComponentWithoutHydrating( current, @@ -8980,7 +8961,7 @@ renderLanes ); } else - JSCompiler_object_inline_message_2291.data === + JSCompiler_object_inline_message_2300.data === SUSPENSE_PENDING_START_DATA ? ((workInProgress.flags |= 128), (workInProgress.child = current.child), @@ -8988,12 +8969,12 @@ null, current )), - (JSCompiler_object_inline_message_2291._reactRetry = + (JSCompiler_object_inline_message_2300._reactRetry = workInProgress), (workInProgress = null)) : ((current = prevState.treeContext), (nextHydratableInstance = getNextHydratable( - JSCompiler_object_inline_message_2291.nextSibling + JSCompiler_object_inline_message_2300.nextSibling )), (hydrationParentFiber = workInProgress), (isHydrating = !0), @@ -9011,57 +8992,57 @@ (treeContextProvider = workInProgress)), (workInProgress = mountSuspensePrimaryChildren( workInProgress, - JSCompiler_object_inline_stack_2293.children + JSCompiler_object_inline_stack_2302.children )), (workInProgress.flags |= 4096)); return workInProgress; } - if (JSCompiler_object_inline_componentStack_2294) + if (JSCompiler_object_inline_componentStack_2303) return ( reuseSuspenseHandlerOnStack(workInProgress), - (JSCompiler_object_inline_componentStack_2294 = - JSCompiler_object_inline_stack_2293.fallback), - (JSCompiler_object_inline_message_2291 = workInProgress.mode), + (JSCompiler_object_inline_componentStack_2303 = + JSCompiler_object_inline_stack_2302.fallback), + (JSCompiler_object_inline_message_2300 = workInProgress.mode), (JSCompiler_temp = current.child), (instance = JSCompiler_temp.sibling), - (JSCompiler_object_inline_stack_2293 = createWorkInProgress( + (JSCompiler_object_inline_stack_2302 = createWorkInProgress( JSCompiler_temp, { mode: "hidden", - children: JSCompiler_object_inline_stack_2293.children + children: JSCompiler_object_inline_stack_2302.children } )), - (JSCompiler_object_inline_stack_2293.subtreeFlags = + (JSCompiler_object_inline_stack_2302.subtreeFlags = JSCompiler_temp.subtreeFlags & 31457280), null !== instance - ? (JSCompiler_object_inline_componentStack_2294 = + ? (JSCompiler_object_inline_componentStack_2303 = createWorkInProgress( instance, - JSCompiler_object_inline_componentStack_2294 + JSCompiler_object_inline_componentStack_2303 )) - : ((JSCompiler_object_inline_componentStack_2294 = + : ((JSCompiler_object_inline_componentStack_2303 = createFiberFromFragment( - JSCompiler_object_inline_componentStack_2294, - JSCompiler_object_inline_message_2291, + JSCompiler_object_inline_componentStack_2303, + JSCompiler_object_inline_message_2300, renderLanes, null )), - (JSCompiler_object_inline_componentStack_2294.flags |= 2)), - (JSCompiler_object_inline_componentStack_2294.return = + (JSCompiler_object_inline_componentStack_2303.flags |= 2)), + (JSCompiler_object_inline_componentStack_2303.return = workInProgress), - (JSCompiler_object_inline_stack_2293.return = workInProgress), - (JSCompiler_object_inline_stack_2293.sibling = - JSCompiler_object_inline_componentStack_2294), - (workInProgress.child = JSCompiler_object_inline_stack_2293), - (JSCompiler_object_inline_stack_2293 = - JSCompiler_object_inline_componentStack_2294), - (JSCompiler_object_inline_componentStack_2294 = workInProgress.child), - (JSCompiler_object_inline_message_2291 = current.child.memoizedState), - null === JSCompiler_object_inline_message_2291 - ? (JSCompiler_object_inline_message_2291 = + (JSCompiler_object_inline_stack_2302.return = workInProgress), + (JSCompiler_object_inline_stack_2302.sibling = + JSCompiler_object_inline_componentStack_2303), + (workInProgress.child = JSCompiler_object_inline_stack_2302), + (JSCompiler_object_inline_stack_2302 = + JSCompiler_object_inline_componentStack_2303), + (JSCompiler_object_inline_componentStack_2303 = workInProgress.child), + (JSCompiler_object_inline_message_2300 = current.child.memoizedState), + null === JSCompiler_object_inline_message_2300 + ? (JSCompiler_object_inline_message_2300 = mountSuspenseOffscreenState(renderLanes)) : ((JSCompiler_temp = - JSCompiler_object_inline_message_2291.cachePool), + JSCompiler_object_inline_message_2300.cachePool), null !== JSCompiler_temp ? ((instance = CacheContext._currentValue), (JSCompiler_temp = @@ -9069,37 +9050,37 @@ ? { parent: instance, pool: instance } : JSCompiler_temp)) : (JSCompiler_temp = getSuspendedCache()), - (JSCompiler_object_inline_message_2291 = { + (JSCompiler_object_inline_message_2300 = { baseLanes: - JSCompiler_object_inline_message_2291.baseLanes | renderLanes, + JSCompiler_object_inline_message_2300.baseLanes | renderLanes, cachePool: JSCompiler_temp })), - (JSCompiler_object_inline_componentStack_2294.memoizedState = - JSCompiler_object_inline_message_2291), - (JSCompiler_object_inline_componentStack_2294.childLanes = + (JSCompiler_object_inline_componentStack_2303.memoizedState = + JSCompiler_object_inline_message_2300), + (JSCompiler_object_inline_componentStack_2303.childLanes = getRemainingWorkInPrimaryTree( current, - JSCompiler_object_inline_digest_2292, + JSCompiler_object_inline_digest_2301, renderLanes )), (workInProgress.memoizedState = SUSPENDED_MARKER), - JSCompiler_object_inline_stack_2293 + JSCompiler_object_inline_stack_2302 ); pushPrimaryTreeSuspenseHandler(workInProgress); renderLanes = current.child; current = renderLanes.sibling; renderLanes = createWorkInProgress(renderLanes, { mode: "visible", - children: JSCompiler_object_inline_stack_2293.children + children: JSCompiler_object_inline_stack_2302.children }); renderLanes.return = workInProgress; renderLanes.sibling = null; null !== current && - ((JSCompiler_object_inline_digest_2292 = workInProgress.deletions), - null === JSCompiler_object_inline_digest_2292 + ((JSCompiler_object_inline_digest_2301 = workInProgress.deletions), + null === JSCompiler_object_inline_digest_2301 ? ((workInProgress.deletions = [current]), (workInProgress.flags |= 16)) - : JSCompiler_object_inline_digest_2292.push(current)); + : JSCompiler_object_inline_digest_2301.push(current)); workInProgress.child = renderLanes; workInProgress.memoizedState = null; return renderLanes; @@ -11042,7 +11023,12 @@ } else ref.current = null; } - function commitProfiler(finishedWork, current, commitTime, effectDuration) { + function commitProfiler( + finishedWork, + current, + commitStartTime, + effectDuration + ) { var _finishedWork$memoize = finishedWork.memoizedProps, id = _finishedWork$memoize.id, onCommit = _finishedWork$memoize.onCommit; @@ -11056,20 +11042,20 @@ finishedWork.actualDuration, finishedWork.treeBaseDuration, finishedWork.actualStartTime, - commitTime + commitStartTime ); "function" === typeof onCommit && onCommit( finishedWork.memoizedProps.id, current, effectDuration, - commitTime + commitStartTime ); } function commitProfilerPostCommitImpl( finishedWork, current, - commitTime, + commitStartTime, passiveEffectDuration ) { var _finishedWork$memoize2 = finishedWork.memoizedProps; @@ -11082,7 +11068,7 @@ finishedWork, current, passiveEffectDuration, - commitTime + commitStartTime ); } function commitHostMount(finishedWork) { @@ -11512,7 +11498,7 @@ commitProfiler, finishedWork, current, - commitTime, + commitStartTime, finishedRoot.effectDuration ); } catch (error) { @@ -12503,7 +12489,7 @@ commitProfiler, finishedWork, current, - commitTime, + commitStartTime, includeWorkInProgressEffects.effectDuration ); } catch (error) { @@ -12654,7 +12640,7 @@ commitProfilerPostCommitImpl, finishedWork, finishedWork.alternate, - commitTime, + commitStartTime, finishedRoot.passiveEffectDuration ); } catch (error) { @@ -13427,8 +13413,7 @@ workInProgress.flags & 16384 && ((retryQueue = 22 !== workInProgress.tag ? claimNextRetryLane() : 536870912), - (workInProgress.lanes |= retryQueue), - (workInProgressSuspendedRetryLanes |= retryQueue)); + (workInProgress.lanes |= retryQueue)); } function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { if (!isHydrating) @@ -14225,8 +14210,7 @@ markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane, - workInProgressRootDidSkipSuspendedSiblings + workInProgressDeferredLane ); markRootUpdated(root, lane); if ( @@ -14268,198 +14252,188 @@ markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane, - workInProgressRootDidSkipSuspendedSiblings + workInProgressDeferredLane )), ensureRootIsScheduled(root); } - function performConcurrentWorkOnRoot(root, didTimeout) { - nestedUpdateScheduled = currentUpdateIsNested = !1; + function performWorkOnRoot(root, lanes, forceSync) { if ((executionContext & (RenderContext | CommitContext)) !== NoContext) throw Error("Should not already be working."); - var originalCallbackNode = root.callbackNode; - if (flushPassiveEffects() && root.callbackNode !== originalCallbackNode) - return null; - var lanes = getNextLanes( - root, - root === workInProgressRoot ? workInProgressRootRenderLanes : 0 - ); - if (0 === lanes) return null; var shouldTimeSlice = - 0 === (lanes & 60) && 0 === (lanes & root.expiredLanes) && !didTimeout; - didTimeout = shouldTimeSlice - ? renderRootConcurrent(root, lanes) - : renderRootSync(root, lanes); - if (didTimeout !== RootInProgress) { + (!forceSync && + 0 === (lanes & 60) && + 0 === (lanes & root.expiredLanes)) || + !1, + exitStatus = shouldTimeSlice + ? renderRootConcurrent(root, lanes) + : renderRootSync(root, lanes, !0); + do { var renderWasConcurrent = shouldTimeSlice; - do { - if (didTimeout === RootDidNotComplete) - markRootSuspended( - root, - lanes, - 0, - workInProgressRootDidSkipSuspendedSiblings - ); - else { - shouldTimeSlice = root.current.alternate; - if ( - renderWasConcurrent && - !isRenderConsistentWithExternalStores(shouldTimeSlice) - ) { - didTimeout = renderRootSync(root, lanes); - renderWasConcurrent = !1; - continue; - } - if (didTimeout === RootErrored) { - renderWasConcurrent = lanes; - var errorRetryLanes = getLanesToRetrySynchronouslyOnError( - root, - renderWasConcurrent - ); - if ( - 0 !== errorRetryLanes && - ((lanes = errorRetryLanes), - (didTimeout = recoverFromConcurrentError( - root, - renderWasConcurrent, - errorRetryLanes - )), - (renderWasConcurrent = !1), - didTimeout !== RootErrored) - ) - continue; - } - if (didTimeout === RootFatalErrored) { - prepareFreshStack(root, 0); - markRootSuspended( - root, - lanes, - 0, - workInProgressRootDidSkipSuspendedSiblings - ); - break; - } - a: { - renderWasConcurrent = root; - switch (didTimeout) { - case RootInProgress: - case RootFatalErrored: - throw Error("Root did not complete. This is a bug in React."); - case RootSuspendedWithDelay: - if ((lanes & 4194176) === lanes) { - markRootSuspended( - renderWasConcurrent, - lanes, - workInProgressDeferredLane, - workInProgressRootDidSkipSuspendedSiblings - ); + if (exitStatus === RootInProgress) break; + else if (exitStatus === RootDidNotComplete) + markRootSuspended(root, lanes, 0); + else { + forceSync = root.current.alternate; + if ( + renderWasConcurrent && + !isRenderConsistentWithExternalStores(forceSync) + ) { + exitStatus = renderRootSync(root, lanes, !1); + continue; + } + if (exitStatus === RootErrored) { + renderWasConcurrent = lanes; + if (root.errorRecoveryDisabledLanes & renderWasConcurrent) + var errorRetryLanes = 0; + else + (errorRetryLanes = root.pendingLanes & -536870913), + (errorRetryLanes = + 0 !== errorRetryLanes + ? errorRetryLanes + : errorRetryLanes & 536870912 + ? 536870912 + : 0); + if (0 !== errorRetryLanes) { + lanes = errorRetryLanes; + a: { + exitStatus = root; + var errorRetryLanes$jscomp$0 = errorRetryLanes; + errorRetryLanes = workInProgressRootConcurrentErrors; + var wasRootDehydrated = + exitStatus.current.memoizedState.isDehydrated; + wasRootDehydrated && + (prepareFreshStack( + exitStatus, + errorRetryLanes$jscomp$0 + ).flags |= 256); + errorRetryLanes$jscomp$0 = renderRootSync( + exitStatus, + errorRetryLanes$jscomp$0, + !1 + ); + if (errorRetryLanes$jscomp$0 !== RootErrored) { + if ( + workInProgressRootDidAttachPingListener && + !wasRootDehydrated + ) { + exitStatus.errorRecoveryDisabledLanes |= + renderWasConcurrent; + workInProgressRootInterleavedUpdatedLanes |= + renderWasConcurrent; + exitStatus = RootSuspendedWithDelay; break a; } - break; - case RootErrored: - workInProgressRootRecoverableErrors = null; - break; - case RootSuspended: - case RootCompleted: - break; - default: - throw Error("Unknown root exit status."); + exitStatus = workInProgressRootRecoverableErrors; + workInProgressRootRecoverableErrors = errorRetryLanes; + null !== exitStatus && queueRecoverableErrors(exitStatus); + } + exitStatus = errorRetryLanes$jscomp$0; } - renderWasConcurrent.finishedWork = shouldTimeSlice; - renderWasConcurrent.finishedLanes = lanes; - if (null !== ReactSharedInternals.actQueue) - commitRoot( - renderWasConcurrent, - workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, - workInProgressDeferredLane, - workInProgressRootInterleavedUpdatedLanes, - workInProgressSuspendedRetryLanes - ); - else { - if ( - (lanes & 62914560) === lanes && - ((didTimeout = - globalMostRecentFallbackTime + - FALLBACK_THROTTLE_MS - - now$1()), - 10 < didTimeout) - ) { + if (exitStatus !== RootErrored) continue; + } + } + if (exitStatus === RootFatalErrored) { + prepareFreshStack(root, 0); + markRootSuspended(root, lanes, 0); + break; + } + a: { + shouldTimeSlice = root; + switch (exitStatus) { + case RootInProgress: + case RootFatalErrored: + throw Error("Root did not complete. This is a bug in React."); + case RootSuspendedWithDelay: + if ((lanes & 4194176) === lanes) { markRootSuspended( - renderWasConcurrent, + shouldTimeSlice, lanes, - workInProgressDeferredLane, - workInProgressRootDidSkipSuspendedSiblings - ); - if (0 !== getNextLanes(renderWasConcurrent, 0)) break a; - renderWasConcurrent.timeoutHandle = scheduleTimeout( - commitRootWhenReady.bind( - null, - renderWasConcurrent, - shouldTimeSlice, - workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, - lanes, - workInProgressDeferredLane, - workInProgressRootInterleavedUpdatedLanes, - workInProgressSuspendedRetryLanes, - workInProgressRootDidSkipSuspendedSiblings - ), - didTimeout + workInProgressDeferredLane ); break a; } - commitRootWhenReady( - renderWasConcurrent, + break; + case RootErrored: + workInProgressRootRecoverableErrors = null; + break; + case RootSuspended: + case RootCompleted: + break; + default: + throw Error("Unknown root exit status."); + } + shouldTimeSlice.finishedWork = forceSync; + shouldTimeSlice.finishedLanes = lanes; + if (null !== ReactSharedInternals.actQueue) + commitRoot( + shouldTimeSlice, + workInProgressRootRecoverableErrors, + workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + IMMEDIATE_COMMIT, + renderStartTime, + 0 + ); + else { + if ( + (lanes & 62914560) === lanes && + ((exitStatus = + globalMostRecentFallbackTime + + FALLBACK_THROTTLE_MS - + now$1()), + 10 < exitStatus) + ) { + markRootSuspended( shouldTimeSlice, - workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, lanes, - workInProgressDeferredLane, - workInProgressRootInterleavedUpdatedLanes, - workInProgressSuspendedRetryLanes, - workInProgressRootDidSkipSuspendedSiblings + workInProgressDeferredLane + ); + if (0 !== getNextLanes(shouldTimeSlice, 0)) break a; + shouldTimeSlice.timeoutHandle = scheduleTimeout( + commitRootWhenReady.bind( + null, + shouldTimeSlice, + forceSync, + workInProgressRootRecoverableErrors, + workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, + lanes, + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + workInProgressRootDidSkipSuspendedSiblings, + THROTTLED_COMMIT, + renderStartTime, + 0 + ), + exitStatus ); + break a; } + commitRootWhenReady( + shouldTimeSlice, + forceSync, + workInProgressRootRecoverableErrors, + workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, + lanes, + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + workInProgressRootDidSkipSuspendedSiblings, + IMMEDIATE_COMMIT, + renderStartTime, + 0 + ); } } - break; - } while (1); - } + } + break; + } while (1); ensureRootIsScheduled(root); - scheduleTaskForRootDuringMicrotask(root, now$1()); - root = - root.callbackNode === originalCallbackNode - ? performConcurrentWorkOnRoot.bind(null, root) - : null; - return root; - } - function recoverFromConcurrentError( - root, - originallyAttemptedLanes, - errorRetryLanes - ) { - var errorsFromFirstAttempt = workInProgressRootConcurrentErrors, - wasRootDehydrated = root.current.memoizedState.isDehydrated; - wasRootDehydrated && - (prepareFreshStack(root, errorRetryLanes).flags |= 256); - errorRetryLanes = renderRootSync(root, errorRetryLanes); - if (errorRetryLanes !== RootErrored) { - if (workInProgressRootDidAttachPingListener && !wasRootDehydrated) - return ( - (root.errorRecoveryDisabledLanes |= originallyAttemptedLanes), - (workInProgressRootInterleavedUpdatedLanes |= - originallyAttemptedLanes), - RootSuspendedWithDelay - ); - root = workInProgressRootRecoverableErrors; - workInProgressRootRecoverableErrors = errorsFromFirstAttempt; - null !== root && queueRecoverableErrors(root); - } - return errorRetryLanes; } function queueRecoverableErrors(errors) { null === workInProgressRootRecoverableErrors @@ -14479,10 +14453,16 @@ spawnedLane, updatedLanes, suspendedRetryLanes, - didSkipSuspendedSiblings + didSkipSuspendedSiblings, + suspendedCommitReason, + completedRenderStartTime, + completedRenderEndTime ) { - var subtreeFlags = finishedWork.subtreeFlags; - if (subtreeFlags & 8192 || 16785408 === (subtreeFlags & 16785408)) + didSkipSuspendedSiblings = finishedWork.subtreeFlags; + if ( + didSkipSuspendedSiblings & 8192 || + 16785408 === (didSkipSuspendedSiblings & 16785408) + ) if ( ((suspendedState = { stylesheets: null, @@ -14502,10 +14482,13 @@ didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes + suspendedRetryLanes, + SUSPENDED_COMMIT, + completedRenderStartTime, + completedRenderEndTime ) ); - markRootSuspended(root, lanes, spawnedLane, didSkipSuspendedSiblings); + markRootSuspended(root, lanes, spawnedLane); return; } commitRoot( @@ -14515,7 +14498,10 @@ didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes + suspendedRetryLanes, + suspendedCommitReason, + completedRenderStartTime, + completedRenderEndTime ); } function isRenderConsistentWithExternalStores(finishedWork) { @@ -14564,80 +14550,24 @@ (didIncludeCommitPhaseUpdate = !0); throwIfInfiniteUpdateLoopDetected(); } - function markRootSuspended( - root, - suspendedLanes, - spawnedLane, - didSkipSuspendedSiblings - ) { + function markRootSuspended(root, suspendedLanes, spawnedLane) { suspendedLanes &= ~workInProgressRootPingedLanes; suspendedLanes &= ~workInProgressRootInterleavedUpdatedLanes; root.suspendedLanes |= suspendedLanes; root.pingedLanes &= ~suspendedLanes; - didSkipSuspendedSiblings || (root.warmLanes |= suspendedLanes); - didSkipSuspendedSiblings = root.expirationTimes; - for (var lanes = suspendedLanes; 0 < lanes; ) { + for ( + var expirationTimes = root.expirationTimes, lanes = suspendedLanes; + 0 < lanes; + + ) { var index = 31 - clz32(lanes), lane = 1 << index; - didSkipSuspendedSiblings[index] = -1; + expirationTimes[index] = -1; lanes &= ~lane; } 0 !== spawnedLane && markSpawnedDeferredLane(root, spawnedLane, suspendedLanes); } - function performSyncWorkOnRoot(root, lanes) { - if ((executionContext & (RenderContext | CommitContext)) !== NoContext) - throw Error("Should not already be working."); - if (flushPassiveEffects()) return ensureRootIsScheduled(root), null; - currentUpdateIsNested = nestedUpdateScheduled; - nestedUpdateScheduled = !1; - var exitStatus = renderRootSync(root, lanes); - if (exitStatus === RootErrored) { - var originallyAttemptedLanes = lanes, - errorRetryLanes = getLanesToRetrySynchronouslyOnError( - root, - originallyAttemptedLanes - ); - 0 !== errorRetryLanes && - ((lanes = errorRetryLanes), - (exitStatus = recoverFromConcurrentError( - root, - originallyAttemptedLanes, - errorRetryLanes - ))); - } - if (exitStatus === RootFatalErrored) - return ( - prepareFreshStack(root, 0), - markRootSuspended(root, lanes, 0, !1), - ensureRootIsScheduled(root), - null - ); - if (exitStatus === RootDidNotComplete) - return ( - markRootSuspended( - root, - lanes, - workInProgressDeferredLane, - workInProgressRootDidSkipSuspendedSiblings - ), - ensureRootIsScheduled(root), - null - ); - root.finishedWork = root.current.alternate; - root.finishedLanes = lanes; - commitRoot( - root, - workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, - workInProgressDeferredLane, - workInProgressRootInterleavedUpdatedLanes, - workInProgressSuspendedRetryLanes - ); - ensureRootIsScheduled(root); - return null; - } function flushSyncWork$1() { return (executionContext & (RenderContext | CommitContext)) === NoContext ? (flushSyncWorkAcrossRoots_impl(0, !1), !1) @@ -14675,8 +14605,9 @@ workInProgressRootRenderLanes = lanes; workInProgressSuspendedReason = NotSuspended; workInProgressThrownValue = null; - workInProgressRootDidAttachPingListener = - workInProgressRootDidSkipSuspendedSiblings = !1; + workInProgressRootDidSkipSuspendedSiblings = !1; + checkIfRootIsPrerendering(root, lanes); + workInProgressRootDidAttachPingListener = !1; workInProgressRootExitStatus = RootInProgress; workInProgressSuspendedRetryLanes = workInProgressDeferredLane = @@ -14802,8 +14733,7 @@ markRootSuspended( workInProgressRoot, workInProgressRootRenderLanes, - workInProgressDeferredLane, - workInProgressRootDidSkipSuspendedSiblings + workInProgressDeferredLane ); } function renderRootSync(root, lanes) { @@ -14827,37 +14757,38 @@ } markRenderStarted(lanes); lanes = !1; + memoizedUpdaters = workInProgressRootExitStatus; a: do try { if ( workInProgressSuspendedReason !== NotSuspended && null !== workInProgress ) { - memoizedUpdaters = workInProgress; - var thrownValue = workInProgressThrownValue; + var unitOfWork = workInProgress, + thrownValue = workInProgressThrownValue; switch (workInProgressSuspendedReason) { case SuspendedOnHydration: resetWorkInProgressStack(); - workInProgressRootExitStatus = RootDidNotComplete; + memoizedUpdaters = RootDidNotComplete; break a; case SuspendedOnImmediate: case SuspendedOnData: - lanes || - null !== suspenseHandlerStackCursor.current || - (lanes = !0); - default: + case SuspendedOnDeprecatedThrowPromise: + null === suspenseHandlerStackCursor.current && (lanes = !0); var reason = workInProgressSuspendedReason; workInProgressSuspendedReason = NotSuspended; workInProgressThrownValue = null; - throwAndUnwindWorkLoop( - root, - memoizedUpdaters, - thrownValue, - reason - ); + throwAndUnwindWorkLoop(root, unitOfWork, thrownValue, reason); + break; + default: + (reason = workInProgressSuspendedReason), + (workInProgressSuspendedReason = NotSuspended), + (workInProgressThrownValue = null), + throwAndUnwindWorkLoop(root, unitOfWork, thrownValue, reason); } } workLoopSync(); + memoizedUpdaters = workInProgressRootExitStatus; break; } catch (thrownValue$8) { handleThrow(root, thrownValue$8); @@ -14868,15 +14799,12 @@ executionContext = prevExecutionContext; ReactSharedInternals.H = prevDispatcher; ReactSharedInternals.A = prevAsyncDispatcher; - if (null !== workInProgress) - throw Error( - "Cannot commit an incomplete root. This error is likely caused by a bug in React. Please file an issue." - ); markRenderStopped(); - workInProgressRoot = null; - workInProgressRootRenderLanes = 0; - finishQueueingConcurrentUpdates(); - return workInProgressRootExitStatus; + null === workInProgress && + ((workInProgressRoot = null), + (workInProgressRootRenderLanes = 0), + finishQueueingConcurrentUpdates()); + return memoizedUpdaters; } function workLoopSync() { for (; null !== workInProgress; ) performUnitOfWork(workInProgress); @@ -14900,7 +14828,7 @@ workInProgressTransitions = null; workInProgressRootRenderTargetTime = now$1() + RENDER_TIMEOUT_MS; prepareFreshStack(root, lanes); - } + } else checkIfRootIsPrerendering(root, lanes); markRenderStarted(lanes); a: do try { @@ -15225,7 +15153,10 @@ didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes + suspendedRetryLanes, + suspendedCommitReason, + completedRenderStartTime, + completedRenderEndTime ) { var prevTransition = ReactSharedInternals.T, previousUpdateLanePriority = ReactDOMSharedInternals.p; @@ -15240,13 +15171,15 @@ previousUpdateLanePriority, spawnedLane, updatedLanes, - suspendedRetryLanes + suspendedRetryLanes, + suspendedCommitReason, + completedRenderStartTime, + completedRenderEndTime ); } finally { (ReactSharedInternals.T = prevTransition), (ReactDOMSharedInternals.p = previousUpdateLanePriority); } - return null; } function commitRootImpl( root, @@ -15254,9 +15187,7 @@ transitions, didIncludeRenderPhaseUpdate, renderPriorityLevel, - spawnedLane, - updatedLanes, - suspendedRetryLanes + spawnedLane ) { do flushPassiveEffects(); while (null !== rootWithPendingPassiveEffects); @@ -15285,14 +15216,7 @@ root.cancelPendingCommit = null; var remainingLanes = finishedWork.lanes | finishedWork.childLanes; remainingLanes |= concurrentlyUpdatedLanes; - markRootFinished( - root, - lanes, - remainingLanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes - ); + markRootFinished(root, lanes, remainingLanes, spawnedLane); didIncludeCommitPhaseUpdate = !1; root === workInProgressRoot && ((workInProgress = workInProgressRoot = null), @@ -15304,38 +15228,38 @@ (pendingPassiveEffectsRemainingLanes = remainingLanes), (pendingPassiveTransitions = transitions), scheduleCallback$1(NormalPriority$1, function () { - flushPassiveEffects(); + flushPassiveEffects(!0); return null; })); + commitStartTime = now(); transitions = 0 !== (finishedWork.flags & 15990); - 0 !== (finishedWork.subtreeFlags & 15990) || transitions - ? ((transitions = ReactSharedInternals.T), - (ReactSharedInternals.T = null), - (spawnedLane = ReactDOMSharedInternals.p), - (ReactDOMSharedInternals.p = DiscreteEventPriority), - (updatedLanes = executionContext), - (executionContext |= CommitContext), - commitBeforeMutationEffects(root, finishedWork), - (commitTime = now()), - commitMutationEffects(root, finishedWork, lanes), - restoreSelection(selectionInformation, root.containerInfo), - (_enabled = !!eventsEnabled), - (selectionInformation = eventsEnabled = null), - (root.current = finishedWork), - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markLayoutEffectsStarted && - injectedProfilingHooks.markLayoutEffectsStarted(lanes), - commitLayoutEffects(finishedWork, root, lanes), - null !== injectedProfilingHooks && - "function" === - typeof injectedProfilingHooks.markLayoutEffectsStopped && - injectedProfilingHooks.markLayoutEffectsStopped(), - requestPaint(), - (executionContext = updatedLanes), - (ReactDOMSharedInternals.p = spawnedLane), - (ReactSharedInternals.T = transitions)) - : ((root.current = finishedWork), (commitTime = now())); + if (0 !== (finishedWork.subtreeFlags & 15990) || transitions) { + transitions = ReactSharedInternals.T; + ReactSharedInternals.T = null; + spawnedLane = ReactDOMSharedInternals.p; + ReactDOMSharedInternals.p = DiscreteEventPriority; + var prevExecutionContext = executionContext; + executionContext |= CommitContext; + commitBeforeMutationEffects(root, finishedWork); + commitMutationEffects(root, finishedWork, lanes); + restoreSelection(selectionInformation, root.containerInfo); + _enabled = !!eventsEnabled; + selectionInformation = eventsEnabled = null; + root.current = finishedWork; + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markLayoutEffectsStarted && + injectedProfilingHooks.markLayoutEffectsStarted(lanes); + commitLayoutEffects(finishedWork, root, lanes); + null !== injectedProfilingHooks && + "function" === + typeof injectedProfilingHooks.markLayoutEffectsStopped && + injectedProfilingHooks.markLayoutEffectsStopped(); + requestPaint(); + executionContext = prevExecutionContext; + ReactDOMSharedInternals.p = spawnedLane; + ReactSharedInternals.T = transitions; + } else root.current = finishedWork; (transitions = rootDoesHavePassiveEffects) ? ((rootDoesHavePassiveEffects = !1), (rootWithPendingPassiveEffects = root), @@ -15801,7 +15725,8 @@ root, root === workInProgressRoot ? nextLanes : 0 )), - 0 !== (nextLanes & 3) && + 0 === (nextLanes & 3) || + checkIfRootIsPrerendering(root, nextLanes) || ((didPerformSomeWork = !0), performSyncWorkOnRoot(root, nextLanes)); root = root.next; @@ -15892,8 +15817,6 @@ else return currentTime; switch (lanesToEventPriority(suspendedLanes)) { case DiscreteEventPriority: - suspendedLanes = ImmediatePriority; - break; case ContinuousEventPriority: suspendedLanes = UserBlockingPriority; break; @@ -15906,7 +15829,7 @@ default: suspendedLanes = NormalPriority$1; } - pingedLanes = performConcurrentWorkOnRoot.bind(null, root); + pingedLanes = performWorkOnRootViaSchedulerTask.bind(null, root); null !== ReactSharedInternals.actQueue ? (ReactSharedInternals.actQueue.push(pingedLanes), (suspendedLanes = fakeActCallbackNode)) @@ -15915,6 +15838,34 @@ root.callbackNode = suspendedLanes; return currentTime; } + function performWorkOnRootViaSchedulerTask(root, didTimeout) { + nestedUpdateScheduled = currentUpdateIsNested = !1; + var originalCallbackNode = root.callbackNode; + if (flushPassiveEffects() && root.callbackNode !== originalCallbackNode) + return null; + var workInProgressRootRenderLanes$jscomp$0 = + workInProgressRootRenderLanes; + workInProgressRootRenderLanes$jscomp$0 = getNextLanes( + root, + root === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0 + ); + if (0 === workInProgressRootRenderLanes$jscomp$0) return null; + performWorkOnRoot( + root, + workInProgressRootRenderLanes$jscomp$0, + didTimeout + ); + scheduleTaskForRootDuringMicrotask(root, now$1()); + return root.callbackNode === originalCallbackNode + ? performWorkOnRootViaSchedulerTask.bind(null, root) + : null; + } + function performSyncWorkOnRoot(root, lanes) { + if (flushPassiveEffects()) return null; + currentUpdateIsNested = nestedUpdateScheduled; + nestedUpdateScheduled = !1; + performWorkOnRoot(root, lanes, !0); + } function cancelCallback(callbackNode) { callbackNode !== fakeActCallbackNode && null !== callbackNode && @@ -22200,7 +22151,8 @@ StrictEffectsMode = 16, NoStrictPassiveEffectsMode = 64, now = Scheduler.unstable_now, - commitTime = -0, + renderStartTime = -0, + commitStartTime = -0, profilerStartTime = -1.1, profilerEffectDuration = -0, currentUpdateIsNested = !1, @@ -23978,15 +23930,18 @@ pendingPassiveEffectsLanes = 0, pendingPassiveEffectsRemainingLanes = 0, pendingPassiveTransitions = null, - NESTED_UPDATE_LIMIT = 50, + NESTED_UPDATE_LIMIT = 100, nestedUpdateCount = 0, rootWithNestedUpdates = null, isFlushingPassiveEffects = !1, didScheduleUpdateDuringPassiveEffects = !1, - NESTED_PASSIVE_UPDATE_LIMIT = 50, + NESTED_PASSIVE_UPDATE_LIMIT = 100, nestedPassiveUpdateCount = 0, rootWithPassiveNestedUpdates = null, isRunningInsertionEffect = !1, + IMMEDIATE_COMMIT = 0, + SUSPENDED_COMMIT = 1, + THROTTLED_COMMIT = 2, didWarnStateUpdateForNotYetMountedComponent = null, didWarnAboutUpdateInRender = !1; var didWarnAboutUpdateInRenderForAnotherComponent = new Set(); @@ -24531,11 +24486,11 @@ }; (function () { var isomorphicReactPackageVersion = React.version; - if ("19.0.0-rc-5d19e1c8-20240923" !== isomorphicReactPackageVersion) + if ("19.0.0-rc-778e1ed2-20240926" !== isomorphicReactPackageVersion) throw Error( 'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion + - "\n - react-dom: 19.0.0-rc-5d19e1c8-20240923\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.0.0-rc-778e1ed2-20240926\nLearn more: https://react.dev/warnings/version-mismatch") ); })(); ("function" === typeof Map && @@ -24572,11 +24527,11 @@ !(function () { var internals = { bundleType: 1, - version: "19.0.0-rc-5d19e1c8-20240923", + version: "19.0.0-rc-778e1ed2-20240926", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, findFiberByHostInstance: getClosestInstanceFromNode, - reconcilerVersion: "19.0.0-rc-5d19e1c8-20240923" + reconcilerVersion: "19.0.0-rc-778e1ed2-20240926" }; internals.overrideHookState = overrideHookState; internals.overrideHookStateDeletePath = overrideHookStateDeletePath; @@ -25050,7 +25005,7 @@ exports.useFormStatus = function () { return resolveDispatcher().useHostTransitionStatus(); }; - exports.version = "19.0.0-rc-5d19e1c8-20240923"; + exports.version = "19.0.0-rc-778e1ed2-20240926"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom-profiling.profiling.js b/packages/next/src/compiled/react-dom/cjs/react-dom-profiling.profiling.js index fe190f362124f..083f0901ebf77 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom-profiling.profiling.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom-profiling.profiling.js @@ -664,43 +664,39 @@ function getNextLanes(root, wipLanes) { var pendingLanes = root.pendingLanes; if (0 === pendingLanes) return 0; var nextLanes = 0, - suspendedLanes = root.suspendedLanes, - pingedLanes = root.pingedLanes, - warmLanes = root.warmLanes; - root = 0 !== root.finishedLanes; + suspendedLanes = root.suspendedLanes; + root = root.pingedLanes; var nonIdlePendingLanes = pendingLanes & 134217727; 0 !== nonIdlePendingLanes ? ((pendingLanes = nonIdlePendingLanes & ~suspendedLanes), 0 !== pendingLanes ? (nextLanes = getHighestPriorityLanes(pendingLanes)) - : ((pingedLanes &= nonIdlePendingLanes), - 0 !== pingedLanes - ? (nextLanes = getHighestPriorityLanes(pingedLanes)) - : root || - ((warmLanes = nonIdlePendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes))))) - : ((nonIdlePendingLanes = pendingLanes & ~suspendedLanes), - 0 !== nonIdlePendingLanes - ? (nextLanes = getHighestPriorityLanes(nonIdlePendingLanes)) - : 0 !== pingedLanes - ? (nextLanes = getHighestPriorityLanes(pingedLanes)) - : root || - ((warmLanes = pendingLanes & ~warmLanes), - 0 !== warmLanes && - (nextLanes = getHighestPriorityLanes(warmLanes)))); + : ((root &= nonIdlePendingLanes), + 0 !== root && (nextLanes = getHighestPriorityLanes(root)))) + : ((pendingLanes &= ~suspendedLanes), + 0 !== pendingLanes + ? (nextLanes = getHighestPriorityLanes(pendingLanes)) + : 0 !== root && (nextLanes = getHighestPriorityLanes(root))); return 0 === nextLanes ? 0 : 0 !== wipLanes && wipLanes !== nextLanes && 0 === (wipLanes & suspendedLanes) && ((suspendedLanes = nextLanes & -nextLanes), - (warmLanes = wipLanes & -wipLanes), - suspendedLanes >= warmLanes || - (32 === suspendedLanes && 0 !== (warmLanes & 4194176))) + (root = wipLanes & -wipLanes), + suspendedLanes >= root || + (32 === suspendedLanes && 0 !== (root & 4194176))) ? wipLanes : nextLanes; } +function checkIfRootIsPrerendering(root, renderLanes) { + return ( + 0 === + (root.pendingLanes & + ~(root.suspendedLanes & ~root.pingedLanes) & + renderLanes) + ); +} function computeExpirationTime(lane, currentTime) { switch (lane) { case 1: @@ -742,11 +738,6 @@ function computeExpirationTime(lane, currentTime) { return -1; } } -function getLanesToRetrySynchronouslyOnError(root, originallyAttemptedLanes) { - if (root.errorRecoveryDisabledLanes & originallyAttemptedLanes) return 0; - root = root.pendingLanes & -536870913; - return 0 !== root ? root : root & 536870912 ? 536870912 : 0; -} function claimNextTransitionLane() { var lane = nextTransitionLane; nextTransitionLane <<= 1; @@ -763,14 +754,7 @@ function createLaneMap(initial) { for (var laneMap = [], i = 0; 31 > i; i++) laneMap.push(initial); return laneMap; } -function markRootFinished( - root, - finishedLanes, - remainingLanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes -) { +function markRootFinished(root, finishedLanes, remainingLanes, spawnedLane) { var previouslyPendingLanes = root.pendingLanes; root.pendingLanes = remainingLanes; root.suspendedLanes = 0; @@ -780,36 +764,31 @@ function markRootFinished( root.entangledLanes &= remainingLanes; root.errorRecoveryDisabledLanes &= remainingLanes; root.shellSuspendCounter = 0; - var entanglements = root.entanglements, - expirationTimes = root.expirationTimes, + finishedLanes = root.entanglements; + var expirationTimes = root.expirationTimes, hiddenUpdates = root.hiddenUpdates; for ( remainingLanes = previouslyPendingLanes & ~remainingLanes; 0 < remainingLanes; ) { - var index$7 = 31 - clz32(remainingLanes), - lane = 1 << index$7; - entanglements[index$7] = 0; - expirationTimes[index$7] = -1; - var hiddenUpdatesForLane = hiddenUpdates[index$7]; + var index$6 = 31 - clz32(remainingLanes); + previouslyPendingLanes = 1 << index$6; + finishedLanes[index$6] = 0; + expirationTimes[index$6] = -1; + var hiddenUpdatesForLane = hiddenUpdates[index$6]; if (null !== hiddenUpdatesForLane) for ( - hiddenUpdates[index$7] = null, index$7 = 0; - index$7 < hiddenUpdatesForLane.length; - index$7++ + hiddenUpdates[index$6] = null, index$6 = 0; + index$6 < hiddenUpdatesForLane.length; + index$6++ ) { - var update = hiddenUpdatesForLane[index$7]; + var update = hiddenUpdatesForLane[index$6]; null !== update && (update.lane &= -536870913); } - remainingLanes &= ~lane; + remainingLanes &= ~previouslyPendingLanes; } 0 !== spawnedLane && markSpawnedDeferredLane(root, spawnedLane, 0); - 0 !== suspendedRetryLanes && - 0 === updatedLanes && - 0 !== root.tag && - (root.suspendedLanes |= - suspendedRetryLanes & ~(previouslyPendingLanes & ~finishedLanes)); } function markSpawnedDeferredLane(root, spawnedLane, entangledLanes) { root.pendingLanes |= spawnedLane; @@ -824,19 +803,19 @@ function markSpawnedDeferredLane(root, spawnedLane, entangledLanes) { function markRootEntangled(root, entangledLanes) { var rootEntangledLanes = (root.entangledLanes |= entangledLanes); for (root = root.entanglements; rootEntangledLanes; ) { - var index$8 = 31 - clz32(rootEntangledLanes), - lane = 1 << index$8; - (lane & entangledLanes) | (root[index$8] & entangledLanes) && - (root[index$8] |= entangledLanes); + var index$7 = 31 - clz32(rootEntangledLanes), + lane = 1 << index$7; + (lane & entangledLanes) | (root[index$7] & entangledLanes) && + (root[index$7] |= entangledLanes); rootEntangledLanes &= ~lane; } } function addFiberToLanesMap(root, fiber, lanes) { if (isDevToolsPresent) for (root = root.pendingUpdatersLaneMap; 0 < lanes; ) { - var index$10 = 31 - clz32(lanes), - lane = 1 << index$10; - root[index$10].add(fiber); + var index$9 = 31 - clz32(lanes), + lane = 1 << index$9; + root[index$9].add(fiber); lanes &= ~lane; } } @@ -848,16 +827,16 @@ function movePendingFibersToMemoized(root, lanes) { 0 < lanes; ) { - var index$11 = 31 - clz32(lanes); - root = 1 << index$11; - index$11 = pendingUpdatersLaneMap[index$11]; - 0 < index$11.size && - (index$11.forEach(function (fiber) { + var index$10 = 31 - clz32(lanes); + root = 1 << index$10; + index$10 = pendingUpdatersLaneMap[index$10]; + 0 < index$10.size && + (index$10.forEach(function (fiber) { var alternate = fiber.alternate; (null !== alternate && memoizedUpdaters.has(alternate)) || memoizedUpdaters.add(fiber); }), - index$11.clear()); + index$10.clear()); lanes &= ~root; } } @@ -1007,8 +986,8 @@ function setValueForAttribute(node, name, value) { node.removeAttribute(name); return; case "boolean": - var prefix$12 = name.toLowerCase().slice(0, 5); - if ("data-" !== prefix$12 && "aria-" !== prefix$12) { + var prefix$11 = name.toLowerCase().slice(0, 5); + if ("data-" !== prefix$11 && "aria-" !== prefix$11) { node.removeAttribute(name); return; } @@ -1341,15 +1320,15 @@ function setValueForStyles(node, styles, prevStyles) { : "float" === styleName ? (node.cssFloat = "") : (node[styleName] = "")); - for (var styleName$18 in styles) - (styleName = styles[styleName$18]), - styles.hasOwnProperty(styleName$18) && - prevStyles[styleName$18] !== styleName && - setValueForStyle(node, styleName$18, styleName); + for (var styleName$17 in styles) + (styleName = styles[styleName$17]), + styles.hasOwnProperty(styleName$17) && + prevStyles[styleName$17] !== styleName && + setValueForStyle(node, styleName$17, styleName); } else - for (var styleName$19 in styles) - styles.hasOwnProperty(styleName$19) && - setValueForStyle(node, styleName$19, styles[styleName$19]); + for (var styleName$18 in styles) + styles.hasOwnProperty(styleName$18) && + setValueForStyle(node, styleName$18, styles[styleName$18]); } function isCustomElement(tagName) { if (-1 === tagName.indexOf("-")) return !1; @@ -2080,14 +2059,14 @@ var isInputEventSupported = !1; if (canUseDOM) { var JSCompiler_inline_result$jscomp$294; if (canUseDOM) { - var isSupported$jscomp$inline_431 = "oninput" in document; - if (!isSupported$jscomp$inline_431) { - var element$jscomp$inline_432 = document.createElement("div"); - element$jscomp$inline_432.setAttribute("oninput", "return;"); - isSupported$jscomp$inline_431 = - "function" === typeof element$jscomp$inline_432.oninput; + var isSupported$jscomp$inline_430 = "oninput" in document; + if (!isSupported$jscomp$inline_430) { + var element$jscomp$inline_431 = document.createElement("div"); + element$jscomp$inline_431.setAttribute("oninput", "return;"); + isSupported$jscomp$inline_430 = + "function" === typeof element$jscomp$inline_431.oninput; } - JSCompiler_inline_result$jscomp$294 = isSupported$jscomp$inline_431; + JSCompiler_inline_result$jscomp$294 = isSupported$jscomp$inline_430; } else JSCompiler_inline_result$jscomp$294 = !1; isInputEventSupported = JSCompiler_inline_result$jscomp$294 && @@ -2507,7 +2486,7 @@ function getRootForUpdatedFiber(sourceFiber) { } var emptyContextObject = {}, now = Scheduler.unstable_now, - commitTime = -0, + commitStartTime = -0, profilerStartTime = -1.1, profilerEffectDuration = -0; function pushNestedEffectDurations() { @@ -4046,7 +4025,7 @@ function updateReducerImpl(hook, current, reducer) { var newBaseQueueFirst = (baseFirst = null), newBaseQueueLast = null, update = current, - didReadFromEntangledAsyncAction$56 = !1; + didReadFromEntangledAsyncAction$55 = !1; do { var updateLane = update.lane & -536870913; if ( @@ -4067,11 +4046,11 @@ function updateReducerImpl(hook, current, reducer) { next: null }), updateLane === currentEntangledLane && - (didReadFromEntangledAsyncAction$56 = !0); + (didReadFromEntangledAsyncAction$55 = !0); else if ((renderLanes & revertLane) === revertLane) { update = update.next; revertLane === currentEntangledLane && - (didReadFromEntangledAsyncAction$56 = !0); + (didReadFromEntangledAsyncAction$55 = !0); continue; } else (updateLane = { @@ -4117,7 +4096,7 @@ function updateReducerImpl(hook, current, reducer) { if ( !objectIs(pendingQueue, hook.memoizedState) && ((didReceiveUpdate = !0), - didReadFromEntangledAsyncAction$56 && + didReadFromEntangledAsyncAction$55 && ((reducer = currentEntangledActionThenable), null !== reducer)) ) throw reducer; @@ -4315,8 +4294,8 @@ function runActionStateAction(actionQueue, node) { try { (prevTransition = action(prevState, payload)), handleActionReturnValue(actionQueue, node, prevTransition); - } catch (error$62) { - onActionError(actionQueue, node, error$62); + } catch (error$61) { + onActionError(actionQueue, node, error$61); } } function handleActionReturnValue(actionQueue, node, returnValue) { @@ -4743,10 +4722,10 @@ function refreshCache(fiber) { case 3: var lane = requestUpdateLane(); fiber = createUpdate(lane); - var root$65 = enqueueUpdate(provider, fiber, lane); - null !== root$65 && - (scheduleUpdateOnFiber(root$65, provider, lane), - entangleTransitions(root$65, provider, lane)); + var root$64 = enqueueUpdate(provider, fiber, lane); + null !== root$64 && + (scheduleUpdateOnFiber(root$64, provider, lane), + entangleTransitions(root$64, provider, lane)); provider = { cache: createCache() }; fiber.payload = provider; return; @@ -5273,9 +5252,9 @@ function resolveClassComponentProps(Component, baseProps) { } if ((Component = Component.defaultProps)) { newProps === baseProps && (newProps = assign({}, newProps)); - for (var propName$69 in Component) - void 0 === newProps[propName$69] && - (newProps[propName$69] = Component[propName$69]); + for (var propName$68 in Component) + void 0 === newProps[propName$68] && + (newProps[propName$68] = Component[propName$68]); } return newProps; } @@ -5321,9 +5300,9 @@ function logUncaughtError(root, errorInfo) { try { var onUncaughtError = root.onUncaughtError; onUncaughtError(errorInfo.value, { componentStack: errorInfo.stack }); - } catch (e$70) { + } catch (e$69) { setTimeout(function () { - throw e$70; + throw e$69; }); } } @@ -5334,9 +5313,9 @@ function logCaughtError(root, boundary, errorInfo) { componentStack: errorInfo.stack, errorBoundary: 1 === boundary.tag ? boundary.stateNode : null }); - } catch (e$71) { + } catch (e$70) { setTimeout(function () { - throw e$71; + throw e$70; }); } } @@ -7829,8 +7808,8 @@ function safelyCallComponentWillUnmount( } else try { instance.componentWillUnmount(); - } catch (error$117) { - captureCommitPhaseError(current, nearestMountedAncestor, error$117); + } catch (error$116) { + captureCommitPhaseError(current, nearestMountedAncestor, error$116); } } function safelyAttachRef(current, nearestMountedAncestor) { @@ -7890,15 +7869,15 @@ function safelyDetachRef(current, nearestMountedAncestor) { recordEffectDuration(current); } else ref(null); - } catch (error$118) { - captureCommitPhaseError(current, nearestMountedAncestor, error$118); + } catch (error$117) { + captureCommitPhaseError(current, nearestMountedAncestor, error$117); } else ref.current = null; } function commitProfilerUpdate( finishedWork, current, - commitTime, + commitStartTime, effectDuration ) { try { @@ -7915,14 +7894,14 @@ function commitProfilerUpdate( finishedWork.actualDuration, finishedWork.treeBaseDuration, finishedWork.actualStartTime, - commitTime + commitStartTime ); "function" === typeof onCommit && onCommit( finishedWork.memoizedProps.id, current, effectDuration, - commitTime + commitStartTime ); } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); @@ -8060,7 +8039,7 @@ function commitBeforeMutationEffects(root, firstChild) { selection = selection.focusOffset; try { JSCompiler_temp.nodeType, focusNode.nodeType; - } catch (e$22) { + } catch (e$21) { JSCompiler_temp = null; break a; } @@ -8216,11 +8195,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { } else try { finishedRoot.componentDidMount(); - } catch (error$114) { + } catch (error$113) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$114 + error$113 ); } else { @@ -8237,11 +8216,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } catch (error$115) { + } catch (error$114) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$115 + error$114 ); } recordEffectDuration(); @@ -8252,11 +8231,11 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { current, finishedRoot.__reactInternalSnapshotBeforeUpdate ); - } catch (error$116) { + } catch (error$115) { captureCommitPhaseError( finishedWork, finishedWork.return, - error$116 + error$115 ); } } @@ -8304,7 +8283,7 @@ function commitLayoutEffectOnFiber(finishedRoot, current, finishedWork) { commitProfilerUpdate( finishedWork, current, - commitTime, + commitStartTime, finishedRoot.effectDuration )) : recursivelyTraverseLayoutEffects(finishedRoot, finishedWork); @@ -8423,7 +8402,7 @@ function commitDeletionEffectsOnFiber( safelyDetachRef(deletedFiber, nearestMountedAncestor); case 6: prevHostParentIsContainer = hostParent; - var prevHostParentIsContainer$126 = hostParentIsContainer; + var prevHostParentIsContainer$125 = hostParentIsContainer; hostParent = null; recursivelyTraverseDeletionEffects( finishedRoot, @@ -8431,7 +8410,7 @@ function commitDeletionEffectsOnFiber( deletedFiber ); hostParent = prevHostParentIsContainer; - hostParentIsContainer = prevHostParentIsContainer$126; + hostParentIsContainer = prevHostParentIsContainer$125; if (null !== hostParent) if (hostParentIsContainer) try { @@ -9074,21 +9053,21 @@ function commitReconciliationEffects(finishedWork) { insertOrAppendPlacementNode(finishedWork, before, parent$jscomp$0); break; case 5: - var parent$119 = JSCompiler_inline_result.stateNode; + var parent$118 = JSCompiler_inline_result.stateNode; JSCompiler_inline_result.flags & 32 && - (setTextContent(parent$119, ""), + (setTextContent(parent$118, ""), (JSCompiler_inline_result.flags &= -33)); - var before$120 = getHostSibling(finishedWork); - insertOrAppendPlacementNode(finishedWork, before$120, parent$119); + var before$119 = getHostSibling(finishedWork); + insertOrAppendPlacementNode(finishedWork, before$119, parent$118); break; case 3: case 4: - var parent$121 = JSCompiler_inline_result.stateNode.containerInfo, - before$122 = getHostSibling(finishedWork); + var parent$120 = JSCompiler_inline_result.stateNode.containerInfo, + before$121 = getHostSibling(finishedWork); insertOrAppendPlacementNodeIntoContainer( finishedWork, - before$122, - parent$121 + before$121, + parent$120 ); break; default: @@ -9248,7 +9227,7 @@ function recursivelyTraverseReappearLayoutEffects( commitProfilerUpdate( finishedWork, current, - commitTime, + commitStartTime, finishedRoot.effectDuration )) : recursivelyTraverseReappearLayoutEffects( @@ -9385,7 +9364,7 @@ function commitPassiveMountOnFiber( id, phase, finishedRoot.passiveEffectDuration, - commitTime + commitStartTime ); } catch (error) { captureCommitPhaseError(finishedWork, finishedWork.return, error); @@ -10032,8 +10011,7 @@ function scheduleRetryEffect(workInProgress, retryQueue) { workInProgress.flags & 16384 && ((retryQueue = 22 !== workInProgress.tag ? claimNextRetryLane() : 536870912), - (workInProgress.lanes |= retryQueue), - (workInProgressSuspendedRetryLanes |= retryQueue)); + (workInProgress.lanes |= retryQueue)); } function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { if (!isHydrating) @@ -10050,14 +10028,14 @@ function cutOffTailIfNeeded(renderState, hasRenderedATailFallback) { break; case "collapsed": lastTailNode = renderState.tail; - for (var lastTailNode$141 = null; null !== lastTailNode; ) - null !== lastTailNode.alternate && (lastTailNode$141 = lastTailNode), + for (var lastTailNode$140 = null; null !== lastTailNode; ) + null !== lastTailNode.alternate && (lastTailNode$140 = lastTailNode), (lastTailNode = lastTailNode.sibling); - null === lastTailNode$141 + null === lastTailNode$140 ? hasRenderedATailFallback || null === renderState.tail ? (renderState.tail = null) : (renderState.tail.sibling = null) - : (lastTailNode$141.sibling = null); + : (lastTailNode$140.sibling = null); } } function bubbleProperties(completedWork) { @@ -10069,53 +10047,53 @@ function bubbleProperties(completedWork) { if (didBailout) if (0 !== (completedWork.mode & 2)) { for ( - var treeBaseDuration$143 = completedWork.selfBaseDuration, - child$144 = completedWork.child; - null !== child$144; + var treeBaseDuration$142 = completedWork.selfBaseDuration, + child$143 = completedWork.child; + null !== child$143; ) - (newChildLanes |= child$144.lanes | child$144.childLanes), - (subtreeFlags |= child$144.subtreeFlags & 31457280), - (subtreeFlags |= child$144.flags & 31457280), - (treeBaseDuration$143 += child$144.treeBaseDuration), - (child$144 = child$144.sibling); - completedWork.treeBaseDuration = treeBaseDuration$143; + (newChildLanes |= child$143.lanes | child$143.childLanes), + (subtreeFlags |= child$143.subtreeFlags & 31457280), + (subtreeFlags |= child$143.flags & 31457280), + (treeBaseDuration$142 += child$143.treeBaseDuration), + (child$143 = child$143.sibling); + completedWork.treeBaseDuration = treeBaseDuration$142; } else for ( - treeBaseDuration$143 = completedWork.child; - null !== treeBaseDuration$143; + treeBaseDuration$142 = completedWork.child; + null !== treeBaseDuration$142; ) (newChildLanes |= - treeBaseDuration$143.lanes | treeBaseDuration$143.childLanes), - (subtreeFlags |= treeBaseDuration$143.subtreeFlags & 31457280), - (subtreeFlags |= treeBaseDuration$143.flags & 31457280), - (treeBaseDuration$143.return = completedWork), - (treeBaseDuration$143 = treeBaseDuration$143.sibling); + treeBaseDuration$142.lanes | treeBaseDuration$142.childLanes), + (subtreeFlags |= treeBaseDuration$142.subtreeFlags & 31457280), + (subtreeFlags |= treeBaseDuration$142.flags & 31457280), + (treeBaseDuration$142.return = completedWork), + (treeBaseDuration$142 = treeBaseDuration$142.sibling); else if (0 !== (completedWork.mode & 2)) { - treeBaseDuration$143 = completedWork.actualDuration; - child$144 = completedWork.selfBaseDuration; + treeBaseDuration$142 = completedWork.actualDuration; + child$143 = completedWork.selfBaseDuration; for (var child = completedWork.child; null !== child; ) (newChildLanes |= child.lanes | child.childLanes), (subtreeFlags |= child.subtreeFlags), (subtreeFlags |= child.flags), - (treeBaseDuration$143 += child.actualDuration), - (child$144 += child.treeBaseDuration), + (treeBaseDuration$142 += child.actualDuration), + (child$143 += child.treeBaseDuration), (child = child.sibling); - completedWork.actualDuration = treeBaseDuration$143; - completedWork.treeBaseDuration = child$144; + completedWork.actualDuration = treeBaseDuration$142; + completedWork.treeBaseDuration = child$143; } else for ( - treeBaseDuration$143 = completedWork.child; - null !== treeBaseDuration$143; + treeBaseDuration$142 = completedWork.child; + null !== treeBaseDuration$142; ) (newChildLanes |= - treeBaseDuration$143.lanes | treeBaseDuration$143.childLanes), - (subtreeFlags |= treeBaseDuration$143.subtreeFlags), - (subtreeFlags |= treeBaseDuration$143.flags), - (treeBaseDuration$143.return = completedWork), - (treeBaseDuration$143 = treeBaseDuration$143.sibling); + treeBaseDuration$142.lanes | treeBaseDuration$142.childLanes), + (subtreeFlags |= treeBaseDuration$142.subtreeFlags), + (subtreeFlags |= treeBaseDuration$142.flags), + (treeBaseDuration$142.return = completedWork), + (treeBaseDuration$142 = treeBaseDuration$142.sibling); completedWork.subtreeFlags |= subtreeFlags; completedWork.childLanes = newChildLanes; return didBailout; @@ -10408,11 +10386,11 @@ function completeWork(current, workInProgress, renderLanes) { null !== newProps.alternate.memoizedState && null !== newProps.alternate.memoizedState.cachePool && (type = newProps.alternate.memoizedState.cachePool.pool); - var cache$159 = null; + var cache$158 = null; null !== newProps.memoizedState && null !== newProps.memoizedState.cachePool && - (cache$159 = newProps.memoizedState.cachePool.pool); - cache$159 !== type && (newProps.flags |= 2048); + (cache$158 = newProps.memoizedState.cachePool.pool); + cache$158 !== type && (newProps.flags |= 2048); } renderLanes !== current && renderLanes && @@ -10442,8 +10420,8 @@ function completeWork(current, workInProgress, renderLanes) { type = workInProgress.memoizedState; if (null === type) return bubbleProperties(workInProgress), null; newProps = 0 !== (workInProgress.flags & 128); - cache$159 = type.rendering; - if (null === cache$159) + cache$158 = type.rendering; + if (null === cache$158) if (newProps) cutOffTailIfNeeded(type, !1); else { if ( @@ -10451,11 +10429,11 @@ function completeWork(current, workInProgress, renderLanes) { (null !== current && 0 !== (current.flags & 128)) ) for (current = workInProgress.child; null !== current; ) { - cache$159 = findFirstSuspended(current); - if (null !== cache$159) { + cache$158 = findFirstSuspended(current); + if (null !== cache$158) { workInProgress.flags |= 128; cutOffTailIfNeeded(type, !1); - current = cache$159.updateQueue; + current = cache$158.updateQueue; workInProgress.updateQueue = current; scheduleRetryEffect(workInProgress, current); workInProgress.subtreeFlags = 0; @@ -10480,7 +10458,7 @@ function completeWork(current, workInProgress, renderLanes) { } else { if (!newProps) - if (((current = findFirstSuspended(cache$159)), null !== current)) { + if (((current = findFirstSuspended(cache$158)), null !== current)) { if ( ((workInProgress.flags |= 128), (newProps = !0), @@ -10490,7 +10468,7 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(type, !0), null === type.tail && "hidden" === type.tailMode && - !cache$159.alternate && + !cache$158.alternate && !isHydrating) ) return bubbleProperties(workInProgress), null; @@ -10503,13 +10481,13 @@ function completeWork(current, workInProgress, renderLanes) { cutOffTailIfNeeded(type, !1), (workInProgress.lanes = 4194304)); type.isBackwards - ? ((cache$159.sibling = workInProgress.child), - (workInProgress.child = cache$159)) + ? ((cache$158.sibling = workInProgress.child), + (workInProgress.child = cache$158)) : ((current = type.last), null !== current - ? (current.sibling = cache$159) - : (workInProgress.child = cache$159), - (type.last = cache$159)); + ? (current.sibling = cache$158) + : (workInProgress.child = cache$158), + (type.last = cache$158)); } if (null !== type.tail) return ( @@ -10743,8 +10721,7 @@ function scheduleUpdateOnFiber(root, fiber, lane) { markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane, - workInProgressRootDidSkipSuspendedSiblings + workInProgressDeferredLane ); markRootUpdated(root, lane); if (0 === (executionContext & 2) || root !== workInProgressRoot) @@ -10756,180 +10733,159 @@ function scheduleUpdateOnFiber(root, fiber, lane) { markRootSuspended( root, workInProgressRootRenderLanes, - workInProgressDeferredLane, - workInProgressRootDidSkipSuspendedSiblings + workInProgressDeferredLane )), ensureRootIsScheduled(root); } -function performConcurrentWorkOnRoot(root, didTimeout) { - nestedUpdateScheduled = currentUpdateIsNested = !1; +function performWorkOnRoot(root$jscomp$0, lanes, forceSync) { if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(327)); - var originalCallbackNode = root.callbackNode; - if (flushPassiveEffects() && root.callbackNode !== originalCallbackNode) - return null; - var lanes = getNextLanes( - root, - root === workInProgressRoot ? workInProgressRootRenderLanes : 0 - ); - if (0 === lanes) return null; var shouldTimeSlice = - 0 === (lanes & 60) && 0 === (lanes & root.expiredLanes) && !didTimeout; - didTimeout = shouldTimeSlice - ? renderRootConcurrent(root, lanes) - : renderRootSync(root, lanes); - if (0 !== didTimeout) { + (!forceSync && + 0 === (lanes & 60) && + 0 === (lanes & root$jscomp$0.expiredLanes)) || + !1, + exitStatus = shouldTimeSlice + ? renderRootConcurrent(root$jscomp$0, lanes) + : renderRootSync(root$jscomp$0, lanes, !0); + do { var renderWasConcurrent = shouldTimeSlice; - do { - if (6 === didTimeout) - markRootSuspended( - root, - lanes, - 0, - workInProgressRootDidSkipSuspendedSiblings - ); - else { - shouldTimeSlice = root.current.alternate; - if ( - renderWasConcurrent && - !isRenderConsistentWithExternalStores(shouldTimeSlice) - ) { - didTimeout = renderRootSync(root, lanes); - renderWasConcurrent = !1; - continue; - } - if (2 === didTimeout) { - renderWasConcurrent = lanes; - var errorRetryLanes = getLanesToRetrySynchronouslyOnError( - root, - renderWasConcurrent - ); - if ( - 0 !== errorRetryLanes && - ((lanes = errorRetryLanes), - (didTimeout = recoverFromConcurrentError( + if (0 === exitStatus) break; + else if (6 === exitStatus) markRootSuspended(root$jscomp$0, lanes, 0); + else { + forceSync = root$jscomp$0.current.alternate; + if ( + renderWasConcurrent && + !isRenderConsistentWithExternalStores(forceSync) + ) { + exitStatus = renderRootSync(root$jscomp$0, lanes, !1); + continue; + } + if (2 === exitStatus) { + renderWasConcurrent = lanes; + if (root$jscomp$0.errorRecoveryDisabledLanes & renderWasConcurrent) + var JSCompiler_inline_result = 0; + else + (JSCompiler_inline_result = root$jscomp$0.pendingLanes & -536870913), + (JSCompiler_inline_result = + 0 !== JSCompiler_inline_result + ? JSCompiler_inline_result + : JSCompiler_inline_result & 536870912 + ? 536870912 + : 0); + if (0 !== JSCompiler_inline_result) { + lanes = JSCompiler_inline_result; + a: { + var root = root$jscomp$0; + exitStatus = workInProgressRootConcurrentErrors; + var wasRootDehydrated = root.current.memoizedState.isDehydrated; + wasRootDehydrated && + (prepareFreshStack(root, JSCompiler_inline_result).flags |= 256); + JSCompiler_inline_result = renderRootSync( root, - renderWasConcurrent, - errorRetryLanes - )), - (renderWasConcurrent = !1), - 2 !== didTimeout) - ) - continue; - } - if (1 === didTimeout) { - prepareFreshStack(root, 0); - markRootSuspended( - root, - lanes, - 0, - workInProgressRootDidSkipSuspendedSiblings - ); - break; - } - a: { - renderWasConcurrent = root; - switch (didTimeout) { - case 0: - case 1: - throw Error(formatProdErrorMessage(345)); - case 4: - if ((lanes & 4194176) === lanes) { - markRootSuspended( - renderWasConcurrent, - lanes, - workInProgressDeferredLane, - workInProgressRootDidSkipSuspendedSiblings - ); + JSCompiler_inline_result, + !1 + ); + if (2 !== JSCompiler_inline_result) { + if ( + workInProgressRootDidAttachPingListener && + !wasRootDehydrated + ) { + root.errorRecoveryDisabledLanes |= renderWasConcurrent; + workInProgressRootInterleavedUpdatedLanes |= + renderWasConcurrent; + exitStatus = 4; break a; } - break; - case 2: - workInProgressRootRecoverableErrors = null; - break; - case 3: - case 5: - break; - default: - throw Error(formatProdErrorMessage(329)); + renderWasConcurrent = workInProgressRootRecoverableErrors; + workInProgressRootRecoverableErrors = exitStatus; + null !== renderWasConcurrent && + queueRecoverableErrors(renderWasConcurrent); + } + exitStatus = JSCompiler_inline_result; } - renderWasConcurrent.finishedWork = shouldTimeSlice; - renderWasConcurrent.finishedLanes = lanes; - if ( - (lanes & 62914560) === lanes && - ((didTimeout = globalMostRecentFallbackTime + 300 - now$1()), - 10 < didTimeout) - ) { - markRootSuspended( - renderWasConcurrent, - lanes, - workInProgressDeferredLane, - workInProgressRootDidSkipSuspendedSiblings - ); - if (0 !== getNextLanes(renderWasConcurrent, 0)) break a; - renderWasConcurrent.timeoutHandle = scheduleTimeout( - commitRootWhenReady.bind( - null, - renderWasConcurrent, + if (2 !== exitStatus) continue; + } + } + if (1 === exitStatus) { + prepareFreshStack(root$jscomp$0, 0); + markRootSuspended(root$jscomp$0, lanes, 0); + break; + } + a: { + shouldTimeSlice = root$jscomp$0; + switch (exitStatus) { + case 0: + case 1: + throw Error(formatProdErrorMessage(345)); + case 4: + if ((lanes & 4194176) === lanes) { + markRootSuspended( shouldTimeSlice, - workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, lanes, - workInProgressDeferredLane, - workInProgressRootInterleavedUpdatedLanes, - workInProgressSuspendedRetryLanes, - workInProgressRootDidSkipSuspendedSiblings - ), - didTimeout - ); - break a; - } - commitRootWhenReady( - renderWasConcurrent, - shouldTimeSlice, - workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, - lanes, - workInProgressDeferredLane, - workInProgressRootInterleavedUpdatedLanes, - workInProgressSuspendedRetryLanes, - workInProgressRootDidSkipSuspendedSiblings + workInProgressDeferredLane + ); + break a; + } + break; + case 2: + workInProgressRootRecoverableErrors = null; + break; + case 3: + case 5: + break; + default: + throw Error(formatProdErrorMessage(329)); + } + shouldTimeSlice.finishedWork = forceSync; + shouldTimeSlice.finishedLanes = lanes; + if ( + (lanes & 62914560) === lanes && + ((renderWasConcurrent = globalMostRecentFallbackTime + 300 - now$1()), + 10 < renderWasConcurrent) + ) { + markRootSuspended(shouldTimeSlice, lanes, workInProgressDeferredLane); + if (0 !== getNextLanes(shouldTimeSlice, 0)) break a; + shouldTimeSlice.timeoutHandle = scheduleTimeout( + commitRootWhenReady.bind( + null, + shouldTimeSlice, + forceSync, + workInProgressRootRecoverableErrors, + workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, + lanes, + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + workInProgressRootDidSkipSuspendedSiblings, + 2, + -0, + 0 + ), + renderWasConcurrent ); + break a; } + commitRootWhenReady( + shouldTimeSlice, + forceSync, + workInProgressRootRecoverableErrors, + workInProgressTransitions, + workInProgressRootDidIncludeRecursiveRenderUpdate, + lanes, + workInProgressDeferredLane, + workInProgressRootInterleavedUpdatedLanes, + workInProgressSuspendedRetryLanes, + workInProgressRootDidSkipSuspendedSiblings, + 0, + -0, + 0 + ); } - break; - } while (1); - } - ensureRootIsScheduled(root); - scheduleTaskForRootDuringMicrotask(root, now$1()); - root = - root.callbackNode === originalCallbackNode - ? performConcurrentWorkOnRoot.bind(null, root) - : null; - return root; -} -function recoverFromConcurrentError( - root, - originallyAttemptedLanes, - errorRetryLanes -) { - var errorsFromFirstAttempt = workInProgressRootConcurrentErrors, - wasRootDehydrated = root.current.memoizedState.isDehydrated; - wasRootDehydrated && (prepareFreshStack(root, errorRetryLanes).flags |= 256); - errorRetryLanes = renderRootSync(root, errorRetryLanes); - if (2 !== errorRetryLanes) { - if (workInProgressRootDidAttachPingListener && !wasRootDehydrated) - return ( - (root.errorRecoveryDisabledLanes |= originallyAttemptedLanes), - (workInProgressRootInterleavedUpdatedLanes |= originallyAttemptedLanes), - 4 - ); - root = workInProgressRootRecoverableErrors; - workInProgressRootRecoverableErrors = errorsFromFirstAttempt; - null !== root && queueRecoverableErrors(root); - } - return errorRetryLanes; + } + break; + } while (1); + ensureRootIsScheduled(root$jscomp$0); } function queueRecoverableErrors(errors) { null === workInProgressRootRecoverableErrors @@ -10949,10 +10905,16 @@ function commitRootWhenReady( spawnedLane, updatedLanes, suspendedRetryLanes, - didSkipSuspendedSiblings + didSkipSuspendedSiblings, + suspendedCommitReason, + completedRenderStartTime, + completedRenderEndTime ) { - var subtreeFlags = finishedWork.subtreeFlags; - if (subtreeFlags & 8192 || 16785408 === (subtreeFlags & 16785408)) + didSkipSuspendedSiblings = finishedWork.subtreeFlags; + if ( + didSkipSuspendedSiblings & 8192 || + 16785408 === (didSkipSuspendedSiblings & 16785408) + ) if ( ((suspendedState = { stylesheets: null, count: 0, unsuspend: noop$1 }), accumulateSuspenseyCommitOnFiber(finishedWork), @@ -10968,10 +10930,13 @@ function commitRootWhenReady( didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes + suspendedRetryLanes, + 1, + completedRenderStartTime, + completedRenderEndTime ) ); - markRootSuspended(root, lanes, spawnedLane, didSkipSuspendedSiblings); + markRootSuspended(root, lanes, spawnedLane); return; } commitRoot( @@ -10981,7 +10946,10 @@ function commitRootWhenReady( didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes + suspendedRetryLanes, + suspendedCommitReason, + completedRenderStartTime, + completedRenderEndTime ); } function isRenderConsistentWithExternalStores(finishedWork) { @@ -11027,79 +10995,24 @@ function markRootUpdated(root, updatedLanes) { : executionContext & 4 && (didIncludeCommitPhaseUpdate = !0); throwIfInfiniteUpdateLoopDetected(); } -function markRootSuspended( - root, - suspendedLanes, - spawnedLane, - didSkipSuspendedSiblings -) { +function markRootSuspended(root, suspendedLanes, spawnedLane) { suspendedLanes &= ~workInProgressRootPingedLanes; suspendedLanes &= ~workInProgressRootInterleavedUpdatedLanes; root.suspendedLanes |= suspendedLanes; root.pingedLanes &= ~suspendedLanes; - didSkipSuspendedSiblings || (root.warmLanes |= suspendedLanes); - didSkipSuspendedSiblings = root.expirationTimes; - for (var lanes = suspendedLanes; 0 < lanes; ) { - var index$6 = 31 - clz32(lanes), - lane = 1 << index$6; - didSkipSuspendedSiblings[index$6] = -1; + for ( + var expirationTimes = root.expirationTimes, lanes = suspendedLanes; + 0 < lanes; + + ) { + var index$5 = 31 - clz32(lanes), + lane = 1 << index$5; + expirationTimes[index$5] = -1; lanes &= ~lane; } 0 !== spawnedLane && markSpawnedDeferredLane(root, spawnedLane, suspendedLanes); } -function performSyncWorkOnRoot(root, lanes) { - if (0 !== (executionContext & 6)) throw Error(formatProdErrorMessage(327)); - if (flushPassiveEffects()) return ensureRootIsScheduled(root), null; - currentUpdateIsNested = nestedUpdateScheduled; - nestedUpdateScheduled = !1; - var exitStatus = renderRootSync(root, lanes); - if (2 === exitStatus) { - var originallyAttemptedLanes = lanes, - errorRetryLanes = getLanesToRetrySynchronouslyOnError( - root, - originallyAttemptedLanes - ); - 0 !== errorRetryLanes && - ((lanes = errorRetryLanes), - (exitStatus = recoverFromConcurrentError( - root, - originallyAttemptedLanes, - errorRetryLanes - ))); - } - if (1 === exitStatus) - return ( - prepareFreshStack(root, 0), - markRootSuspended(root, lanes, 0, !1), - ensureRootIsScheduled(root), - null - ); - if (6 === exitStatus) - return ( - markRootSuspended( - root, - lanes, - workInProgressDeferredLane, - workInProgressRootDidSkipSuspendedSiblings - ), - ensureRootIsScheduled(root), - null - ); - root.finishedWork = root.current.alternate; - root.finishedLanes = lanes; - commitRoot( - root, - workInProgressRootRecoverableErrors, - workInProgressTransitions, - workInProgressRootDidIncludeRecursiveRenderUpdate, - workInProgressDeferredLane, - workInProgressRootInterleavedUpdatedLanes, - workInProgressSuspendedRetryLanes - ); - ensureRootIsScheduled(root); - return null; -} function flushSyncWork$1() { return 0 === (executionContext & 6) ? (flushSyncWorkAcrossRoots_impl(0, !1), !1) @@ -11137,8 +11050,9 @@ function prepareFreshStack(root, lanes) { workInProgressRootRenderLanes = lanes; workInProgressSuspendedReason = 0; workInProgressThrownValue = null; - workInProgressRootDidAttachPingListener = - workInProgressRootDidSkipSuspendedSiblings = !1; + workInProgressRootDidSkipSuspendedSiblings = !1; + checkIfRootIsPrerendering(root, lanes); + workInProgressRootDidAttachPingListener = !1; workInProgressSuspendedRetryLanes = workInProgressDeferredLane = workInProgressRootPingedLanes = @@ -11157,9 +11071,9 @@ function prepareFreshStack(root, lanes) { 0 < allEntangledLanes; ) { - var index$4 = 31 - clz32(allEntangledLanes), - lane = 1 << index$4; - lanes |= root[index$4]; + var index$3 = 31 - clz32(allEntangledLanes), + lane = 1 << index$3; + lanes |= root[index$3]; allEntangledLanes &= ~lane; } entangledRenderLanes = lanes; @@ -11258,8 +11172,7 @@ function renderDidSuspendDelayIfPossible() { markRootSuspended( workInProgressRoot, workInProgressRootRenderLanes, - workInProgressDeferredLane, - workInProgressRootDidSkipSuspendedSiblings + workInProgressDeferredLane ); } function renderRootSync(root, lanes) { @@ -11280,29 +11193,35 @@ function renderRootSync(root, lanes) { } markRenderStarted(lanes); lanes = !1; + memoizedUpdaters = workInProgressRootExitStatus; a: do try { if (0 !== workInProgressSuspendedReason && null !== workInProgress) { - memoizedUpdaters = workInProgress; - var thrownValue = workInProgressThrownValue; + var unitOfWork = workInProgress, + thrownValue = workInProgressThrownValue; switch (workInProgressSuspendedReason) { case 8: resetWorkInProgressStack(); - workInProgressRootExitStatus = 6; + memoizedUpdaters = 6; break a; case 3: case 2: - lanes || - null !== suspenseHandlerStackCursor.current || - (lanes = !0); - default: + case 6: + null === suspenseHandlerStackCursor.current && (lanes = !0); var reason = workInProgressSuspendedReason; workInProgressSuspendedReason = 0; workInProgressThrownValue = null; - throwAndUnwindWorkLoop(root, memoizedUpdaters, thrownValue, reason); + throwAndUnwindWorkLoop(root, unitOfWork, thrownValue, reason); + break; + default: + (reason = workInProgressSuspendedReason), + (workInProgressSuspendedReason = 0), + (workInProgressThrownValue = null), + throwAndUnwindWorkLoop(root, unitOfWork, thrownValue, reason); } } workLoopSync(); + memoizedUpdaters = workInProgressRootExitStatus; break; } catch (thrownValue$174) { handleThrow(root, thrownValue$174); @@ -11313,12 +11232,12 @@ function renderRootSync(root, lanes) { executionContext = prevExecutionContext; ReactSharedInternals.H = prevDispatcher; ReactSharedInternals.A = prevAsyncDispatcher; - if (null !== workInProgress) throw Error(formatProdErrorMessage(261)); markRenderStopped(); - workInProgressRoot = null; - workInProgressRootRenderLanes = 0; - finishQueueingConcurrentUpdates(); - return workInProgressRootExitStatus; + null === workInProgress && + ((workInProgressRoot = null), + (workInProgressRootRenderLanes = 0), + finishQueueingConcurrentUpdates()); + return memoizedUpdaters; } function workLoopSync() { for (; null !== workInProgress; ) performUnitOfWork(workInProgress); @@ -11339,7 +11258,7 @@ function renderRootConcurrent(root, lanes) { workInProgressTransitions = null; workInProgressRootRenderTargetTime = now$1() + 500; prepareFreshStack(root, lanes); - } + } else checkIfRootIsPrerendering(root, lanes); markRenderStarted(lanes); a: do try { @@ -11606,7 +11525,10 @@ function commitRoot( didIncludeRenderPhaseUpdate, spawnedLane, updatedLanes, - suspendedRetryLanes + suspendedRetryLanes, + suspendedCommitReason, + completedRenderStartTime, + completedRenderEndTime ) { var prevTransition = ReactSharedInternals.T, previousUpdateLanePriority = ReactDOMSharedInternals.p; @@ -11621,13 +11543,15 @@ function commitRoot( previousUpdateLanePriority, spawnedLane, updatedLanes, - suspendedRetryLanes + suspendedRetryLanes, + suspendedCommitReason, + completedRenderStartTime, + completedRenderEndTime ); } finally { (ReactSharedInternals.T = prevTransition), (ReactDOMSharedInternals.p = previousUpdateLanePriority); } - return null; } function commitRootImpl( root, @@ -11635,9 +11559,7 @@ function commitRootImpl( transitions, didIncludeRenderPhaseUpdate, renderPriorityLevel, - spawnedLane, - updatedLanes, - suspendedRetryLanes + spawnedLane ) { do flushPassiveEffects(); while (null !== rootWithPendingPassiveEffects); @@ -11656,14 +11578,7 @@ function commitRootImpl( root.cancelPendingCommit = null; var remainingLanes = finishedWork.lanes | finishedWork.childLanes; remainingLanes |= concurrentlyUpdatedLanes; - markRootFinished( - root, - lanes, - remainingLanes, - spawnedLane, - updatedLanes, - suspendedRetryLanes - ); + markRootFinished(root, lanes, remainingLanes, spawnedLane); didIncludeCommitPhaseUpdate = !1; root === workInProgressRoot && ((workInProgress = workInProgressRoot = null), @@ -11675,36 +11590,36 @@ function commitRootImpl( (pendingPassiveEffectsRemainingLanes = remainingLanes), (pendingPassiveTransitions = transitions), scheduleCallback$1(NormalPriority$1, function () { - flushPassiveEffects(); + flushPassiveEffects(!0); return null; })); + commitStartTime = now(); transitions = 0 !== (finishedWork.flags & 15990); - 0 !== (finishedWork.subtreeFlags & 15990) || transitions - ? ((transitions = ReactSharedInternals.T), - (ReactSharedInternals.T = null), - (spawnedLane = ReactDOMSharedInternals.p), - (ReactDOMSharedInternals.p = 2), - (updatedLanes = executionContext), - (executionContext |= 4), - commitBeforeMutationEffects(root, finishedWork), - (commitTime = now()), - commitMutationEffects(root, finishedWork, lanes), - restoreSelection(selectionInformation, root.containerInfo), - (_enabled = !!eventsEnabled), - (selectionInformation = eventsEnabled = null), - (root.current = finishedWork), - null !== injectedProfilingHooks && - "function" === typeof injectedProfilingHooks.markLayoutEffectsStarted && - injectedProfilingHooks.markLayoutEffectsStarted(lanes), - commitLayoutEffects(finishedWork, root, lanes), - null !== injectedProfilingHooks && - "function" === typeof injectedProfilingHooks.markLayoutEffectsStopped && - injectedProfilingHooks.markLayoutEffectsStopped(), - requestPaint(), - (executionContext = updatedLanes), - (ReactDOMSharedInternals.p = spawnedLane), - (ReactSharedInternals.T = transitions)) - : ((root.current = finishedWork), (commitTime = now())); + if (0 !== (finishedWork.subtreeFlags & 15990) || transitions) { + transitions = ReactSharedInternals.T; + ReactSharedInternals.T = null; + spawnedLane = ReactDOMSharedInternals.p; + ReactDOMSharedInternals.p = 2; + var prevExecutionContext = executionContext; + executionContext |= 4; + commitBeforeMutationEffects(root, finishedWork); + commitMutationEffects(root, finishedWork, lanes); + restoreSelection(selectionInformation, root.containerInfo); + _enabled = !!eventsEnabled; + selectionInformation = eventsEnabled = null; + root.current = finishedWork; + null !== injectedProfilingHooks && + "function" === typeof injectedProfilingHooks.markLayoutEffectsStarted && + injectedProfilingHooks.markLayoutEffectsStarted(lanes); + commitLayoutEffects(finishedWork, root, lanes); + null !== injectedProfilingHooks && + "function" === typeof injectedProfilingHooks.markLayoutEffectsStopped && + injectedProfilingHooks.markLayoutEffectsStopped(); + requestPaint(); + executionContext = prevExecutionContext; + ReactDOMSharedInternals.p = spawnedLane; + ReactSharedInternals.T = transitions; + } else root.current = finishedWork; rootDoesHavePassiveEffects ? ((rootDoesHavePassiveEffects = !1), (rootWithPendingPassiveEffects = root), @@ -11921,7 +11836,7 @@ function resolveRetryWakeable(boundaryFiber, wakeable) { retryTimedOutBoundary(boundaryFiber, retryLane); } function throwIfInfiniteUpdateLoopDetected() { - if (50 < nestedUpdateCount) + if (100 < nestedUpdateCount) throw ( ((nestedUpdateCount = 0), (rootWithNestedUpdates = null), @@ -11991,7 +11906,8 @@ function flushSyncWorkAcrossRoots_impl(syncTransitionLanes, onlyLegacy) { root$182, root$182 === workInProgressRoot ? JSCompiler_inline_result : 0 )), - 0 !== (JSCompiler_inline_result & 3) && + 0 === (JSCompiler_inline_result & 3) || + checkIfRootIsPrerendering(root$182, JSCompiler_inline_result) || ((didPerformSomeWork = !0), performSyncWorkOnRoot(root$182, JSCompiler_inline_result)); root$182 = root$182.next; @@ -12035,12 +11951,12 @@ function scheduleTaskForRootDuringMicrotask(root, currentTime) { 0 < lanes; ) { - var index$5 = 31 - clz32(lanes), - lane = 1 << index$5, - expirationTime = expirationTimes[index$5]; + var index$4 = 31 - clz32(lanes), + lane = 1 << index$4, + expirationTime = expirationTimes[index$4]; if (-1 === expirationTime) { if (0 === (lane & suspendedLanes) || 0 !== (lane & pingedLanes)) - expirationTimes[index$5] = computeExpirationTime(lane, currentTime); + expirationTimes[index$4] = computeExpirationTime(lane, currentTime); } else expirationTime <= currentTime && (root.expiredLanes |= lane); lanes &= ~lane; } @@ -12077,8 +11993,6 @@ function scheduleTaskForRootDuringMicrotask(root, currentTime) { null !== pingedLanes && cancelCallback$1(pingedLanes); switch (lanesToEventPriority(suspendedLanes)) { case 2: - suspendedLanes = ImmediatePriority; - break; case 8: suspendedLanes = UserBlockingPriority; break; @@ -12091,12 +12005,35 @@ function scheduleTaskForRootDuringMicrotask(root, currentTime) { default: suspendedLanes = NormalPriority$1; } - pingedLanes = performConcurrentWorkOnRoot.bind(null, root); + pingedLanes = performWorkOnRootViaSchedulerTask.bind(null, root); suspendedLanes = scheduleCallback$3(suspendedLanes, pingedLanes); root.callbackPriority = currentTime; root.callbackNode = suspendedLanes; return currentTime; } +function performWorkOnRootViaSchedulerTask(root, didTimeout) { + nestedUpdateScheduled = currentUpdateIsNested = !1; + var originalCallbackNode = root.callbackNode; + if (flushPassiveEffects() && root.callbackNode !== originalCallbackNode) + return null; + var workInProgressRootRenderLanes$jscomp$0 = workInProgressRootRenderLanes; + workInProgressRootRenderLanes$jscomp$0 = getNextLanes( + root, + root === workInProgressRoot ? workInProgressRootRenderLanes$jscomp$0 : 0 + ); + if (0 === workInProgressRootRenderLanes$jscomp$0) return null; + performWorkOnRoot(root, workInProgressRootRenderLanes$jscomp$0, didTimeout); + scheduleTaskForRootDuringMicrotask(root, now$1()); + return root.callbackNode === originalCallbackNode + ? performWorkOnRootViaSchedulerTask.bind(null, root) + : null; +} +function performSyncWorkOnRoot(root, lanes) { + if (flushPassiveEffects()) return null; + currentUpdateIsNested = nestedUpdateScheduled; + nestedUpdateScheduled = !1; + performWorkOnRoot(root, lanes, !0); +} function scheduleImmediateTask(cb) { scheduleMicrotask(function () { 0 !== (executionContext & 6) @@ -12204,20 +12141,20 @@ function extractEvents$1( } } for ( - var i$jscomp$inline_1501 = 0; - i$jscomp$inline_1501 < simpleEventPluginEvents.length; - i$jscomp$inline_1501++ + var i$jscomp$inline_1506 = 0; + i$jscomp$inline_1506 < simpleEventPluginEvents.length; + i$jscomp$inline_1506++ ) { - var eventName$jscomp$inline_1502 = - simpleEventPluginEvents[i$jscomp$inline_1501], - domEventName$jscomp$inline_1503 = - eventName$jscomp$inline_1502.toLowerCase(), - capitalizedEvent$jscomp$inline_1504 = - eventName$jscomp$inline_1502[0].toUpperCase() + - eventName$jscomp$inline_1502.slice(1); + var eventName$jscomp$inline_1507 = + simpleEventPluginEvents[i$jscomp$inline_1506], + domEventName$jscomp$inline_1508 = + eventName$jscomp$inline_1507.toLowerCase(), + capitalizedEvent$jscomp$inline_1509 = + eventName$jscomp$inline_1507[0].toUpperCase() + + eventName$jscomp$inline_1507.slice(1); registerSimpleEvent( - domEventName$jscomp$inline_1503, - "on" + capitalizedEvent$jscomp$inline_1504 + domEventName$jscomp$inline_1508, + "on" + capitalizedEvent$jscomp$inline_1509 ); } registerSimpleEvent(ANIMATION_END, "onAnimationEnd"); @@ -15677,16 +15614,16 @@ ReactDOMHydrationRoot.prototype.unstable_scheduleHydration = function (target) { 0 === i && attemptExplicitHydrationTarget(target); } }; -var isomorphicReactPackageVersion$jscomp$inline_1750 = React.version; +var isomorphicReactPackageVersion$jscomp$inline_1755 = React.version; if ( - "19.0.0-rc-5d19e1c8-20240923" !== - isomorphicReactPackageVersion$jscomp$inline_1750 + "19.0.0-rc-778e1ed2-20240926" !== + isomorphicReactPackageVersion$jscomp$inline_1755 ) throw Error( formatProdErrorMessage( 527, - isomorphicReactPackageVersion$jscomp$inline_1750, - "19.0.0-rc-5d19e1c8-20240923" + isomorphicReactPackageVersion$jscomp$inline_1755, + "19.0.0-rc-778e1ed2-20240926" ) ); ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { @@ -15706,13 +15643,13 @@ ReactDOMSharedInternals.findDOMNode = function (componentOrElement) { null === componentOrElement ? null : componentOrElement.stateNode; return componentOrElement; }; -var internals$jscomp$inline_1757 = { +var internals$jscomp$inline_1762 = { bundleType: 0, - version: "19.0.0-rc-5d19e1c8-20240923", + version: "19.0.0-rc-778e1ed2-20240926", rendererPackageName: "react-dom", currentDispatcherRef: ReactSharedInternals, findFiberByHostInstance: getClosestInstanceFromNode, - reconcilerVersion: "19.0.0-rc-5d19e1c8-20240923", + reconcilerVersion: "19.0.0-rc-778e1ed2-20240926", getLaneLabelMap: function () { for ( var map = new Map(), lane = 1, index$275 = 0; @@ -15730,16 +15667,16 @@ var internals$jscomp$inline_1757 = { } }; if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) { - var hook$jscomp$inline_2181 = __REACT_DEVTOOLS_GLOBAL_HOOK__; + var hook$jscomp$inline_2191 = __REACT_DEVTOOLS_GLOBAL_HOOK__; if ( - !hook$jscomp$inline_2181.isDisabled && - hook$jscomp$inline_2181.supportsFiber + !hook$jscomp$inline_2191.isDisabled && + hook$jscomp$inline_2191.supportsFiber ) try { - (rendererID = hook$jscomp$inline_2181.inject( - internals$jscomp$inline_1757 + (rendererID = hook$jscomp$inline_2191.inject( + internals$jscomp$inline_1762 )), - (injectedHook = hook$jscomp$inline_2181); + (injectedHook = hook$jscomp$inline_2191); } catch (err) {} } function noop() {} @@ -15992,7 +15929,7 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactSharedInternals.H.useHostTransitionStatus(); }; -exports.version = "19.0.0-rc-5d19e1c8-20240923"; +exports.version = "19.0.0-rc-778e1ed2-20240926"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom-server-legacy.browser.development.js b/packages/next/src/compiled/react-dom/cjs/react-dom-server-legacy.browser.development.js index e5936d293da7c..5bc1f8725f93e 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom-server-legacy.browser.development.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom-server-legacy.browser.development.js @@ -8563,5 +8563,5 @@ 'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server' ); }; - exports.version = "19.0.0-rc-5d19e1c8-20240923"; + exports.version = "19.0.0-rc-778e1ed2-20240926"; })(); diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom-server-legacy.browser.production.js b/packages/next/src/compiled/react-dom/cjs/react-dom-server-legacy.browser.production.js index bfc17470f4ddf..7ce294f902a7e 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom-server-legacy.browser.production.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom-server-legacy.browser.production.js @@ -5621,4 +5621,4 @@ exports.renderToString = function (children, options) { 'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server' ); }; -exports.version = "19.0.0-rc-5d19e1c8-20240923"; +exports.version = "19.0.0-rc-778e1ed2-20240926"; diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom-server-legacy.node.development.js b/packages/next/src/compiled/react-dom/cjs/react-dom-server-legacy.node.development.js index d23525e0471ad..65bf2e61412d2 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom-server-legacy.node.development.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom-server-legacy.node.development.js @@ -8563,5 +8563,5 @@ 'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToPipeableStream" which supports Suspense on the server' ); }; - exports.version = "19.0.0-rc-5d19e1c8-20240923"; + exports.version = "19.0.0-rc-778e1ed2-20240926"; })(); diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom-server-legacy.node.production.js b/packages/next/src/compiled/react-dom/cjs/react-dom-server-legacy.node.production.js index 8648b8abe4737..1a9e748bc8ede 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom-server-legacy.node.production.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom-server-legacy.node.production.js @@ -5699,4 +5699,4 @@ exports.renderToString = function (children, options) { 'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToPipeableStream" which supports Suspense on the server' ); }; -exports.version = "19.0.0-rc-5d19e1c8-20240923"; +exports.version = "19.0.0-rc-778e1ed2-20240926"; diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom-server.browser.development.js b/packages/next/src/compiled/react-dom/cjs/react-dom-server.browser.development.js index 0b0ec2dfd3f70..611cb99fbd945 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom-server.browser.development.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom-server.browser.development.js @@ -8750,11 +8750,11 @@ didWarnAboutMaps = !1; (function () { var isomorphicReactPackageVersion = React.version; - if ("19.0.0-rc-5d19e1c8-20240923" !== isomorphicReactPackageVersion) + if ("19.0.0-rc-778e1ed2-20240926" !== isomorphicReactPackageVersion) throw Error( 'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion + - "\n - react-dom: 19.0.0-rc-5d19e1c8-20240923\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.0.0-rc-778e1ed2-20240926\nLearn more: https://react.dev/warnings/version-mismatch") ); })(); exports.renderToReadableStream = function (children, options) { @@ -8847,5 +8847,5 @@ startWork(request$jscomp$0); }); }; - exports.version = "19.0.0-rc-5d19e1c8-20240923"; + exports.version = "19.0.0-rc-778e1ed2-20240926"; })(); diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom-server.browser.production.js b/packages/next/src/compiled/react-dom/cjs/react-dom-server.browser.production.js index 886738c9eca75..b4bd2c7af553e 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom-server.browser.production.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom-server.browser.production.js @@ -5910,14 +5910,14 @@ function abort(request, reason) { } var isomorphicReactPackageVersion$jscomp$inline_730 = React.version; if ( - "19.0.0-rc-5d19e1c8-20240923" !== + "19.0.0-rc-778e1ed2-20240926" !== isomorphicReactPackageVersion$jscomp$inline_730 ) throw Error( formatProdErrorMessage( 527, isomorphicReactPackageVersion$jscomp$inline_730, - "19.0.0-rc-5d19e1c8-20240923" + "19.0.0-rc-778e1ed2-20240926" ) ); exports.renderToReadableStream = function (children, options) { @@ -6006,4 +6006,4 @@ exports.renderToReadableStream = function (children, options) { startWork(request); }); }; -exports.version = "19.0.0-rc-5d19e1c8-20240923"; +exports.version = "19.0.0-rc-778e1ed2-20240926"; diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom-server.bun.production.js b/packages/next/src/compiled/react-dom/cjs/react-dom-server.bun.production.js index 17bd1525a2930..675014e647147 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom-server.bun.production.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom-server.bun.production.js @@ -5594,13 +5594,13 @@ function abort(request, reason) { } var isomorphicReactPackageVersion$jscomp$inline_734 = React.version; if ( - "19.0.0-rc-5d19e1c8-20240923" !== + "19.0.0-rc-778e1ed2-20240926" !== isomorphicReactPackageVersion$jscomp$inline_734 ) throw Error( 'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion$jscomp$inline_734 + - "\n - react-dom: 19.0.0-rc-5d19e1c8-20240923\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.0.0-rc-778e1ed2-20240926\nLearn more: https://react.dev/warnings/version-mismatch") ); exports.renderToReadableStream = function (children, options) { return new Promise(function (resolve, reject) { @@ -5688,4 +5688,4 @@ exports.renderToReadableStream = function (children, options) { startWork(request); }); }; -exports.version = "19.0.0-rc-5d19e1c8-20240923"; +exports.version = "19.0.0-rc-778e1ed2-20240926"; diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom-server.edge.development.js b/packages/next/src/compiled/react-dom/cjs/react-dom-server.edge.development.js index d46ad5daf2050..54282f5f127c9 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom-server.edge.development.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom-server.edge.development.js @@ -8769,11 +8769,11 @@ didWarnAboutMaps = !1; (function () { var isomorphicReactPackageVersion = React.version; - if ("19.0.0-rc-5d19e1c8-20240923" !== isomorphicReactPackageVersion) + if ("19.0.0-rc-778e1ed2-20240926" !== isomorphicReactPackageVersion) throw Error( 'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion + - "\n - react-dom: 19.0.0-rc-5d19e1c8-20240923\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.0.0-rc-778e1ed2-20240926\nLearn more: https://react.dev/warnings/version-mismatch") ); })(); exports.renderToReadableStream = function (children, options) { @@ -8877,5 +8877,5 @@ const setTimeoutOrImmediate = ? globalThis['set' + 'Immediate'] : setTimeout; - exports.version = "19.0.0-rc-5d19e1c8-20240923"; + exports.version = "19.0.0-rc-778e1ed2-20240926"; })(); diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom-server.edge.production.js b/packages/next/src/compiled/react-dom/cjs/react-dom-server.edge.production.js index a45426f6020f3..4cd10a78f2802 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom-server.edge.production.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom-server.edge.production.js @@ -6004,13 +6004,13 @@ function abort(request, reason) { } var isomorphicReactPackageVersion$jscomp$inline_738 = React.version; if ( - "19.0.0-rc-5d19e1c8-20240923" !== + "19.0.0-rc-778e1ed2-20240926" !== isomorphicReactPackageVersion$jscomp$inline_738 ) throw Error( 'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion$jscomp$inline_738 + - "\n - react-dom: 19.0.0-rc-5d19e1c8-20240923\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.0.0-rc-778e1ed2-20240926\nLearn more: https://react.dev/warnings/version-mismatch") ); exports.renderToReadableStream = function (children, options) { return new Promise(function (resolve, reject) { @@ -6109,4 +6109,4 @@ const setTimeoutOrImmediate = ? globalThis['set' + 'Immediate'] : setTimeout; -exports.version = "19.0.0-rc-5d19e1c8-20240923"; +exports.version = "19.0.0-rc-778e1ed2-20240926"; diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom-server.node.development.js b/packages/next/src/compiled/react-dom/cjs/react-dom-server.node.development.js index a7078d069454b..7a9255c0a4c3b 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom-server.node.development.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom-server.node.development.js @@ -8620,11 +8620,11 @@ didWarnAboutMaps = !1; (function () { var isomorphicReactPackageVersion = React.version; - if ("19.0.0-rc-5d19e1c8-20240923" !== isomorphicReactPackageVersion) + if ("19.0.0-rc-778e1ed2-20240926" !== isomorphicReactPackageVersion) throw Error( 'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion + - "\n - react-dom: 19.0.0-rc-5d19e1c8-20240923\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.0.0-rc-778e1ed2-20240926\nLearn more: https://react.dev/warnings/version-mismatch") ); })(); exports.renderToPipeableStream = function (children, options) { @@ -8666,5 +8666,5 @@ } }; }; - exports.version = "19.0.0-rc-5d19e1c8-20240923"; + exports.version = "19.0.0-rc-778e1ed2-20240926"; })(); diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom-server.node.production.js b/packages/next/src/compiled/react-dom/cjs/react-dom-server.node.production.js index d5af938502a79..6a92dc8ea05f1 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom-server.node.production.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom-server.node.production.js @@ -5626,13 +5626,13 @@ function abort(request, reason) { } var isomorphicReactPackageVersion$jscomp$inline_761 = React.version; if ( - "19.0.0-rc-5d19e1c8-20240923" !== + "19.0.0-rc-778e1ed2-20240926" !== isomorphicReactPackageVersion$jscomp$inline_761 ) throw Error( 'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' + (isomorphicReactPackageVersion$jscomp$inline_761 + - "\n - react-dom: 19.0.0-rc-5d19e1c8-20240923\nLearn more: https://react.dev/warnings/version-mismatch") + "\n - react-dom: 19.0.0-rc-778e1ed2-20240926\nLearn more: https://react.dev/warnings/version-mismatch") ); function createDrainHandler(destination, request) { return function () { @@ -5934,4 +5934,4 @@ exports.renderToPipeableStream = function (children, options) { } }; }; -exports.version = "19.0.0-rc-5d19e1c8-20240923"; +exports.version = "19.0.0-rc-778e1ed2-20240926"; diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom.development.js b/packages/next/src/compiled/react-dom/cjs/react-dom.development.js index b18bada73cd5c..e1b4e2e681323 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom.development.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom.development.js @@ -416,7 +416,7 @@ exports.useFormStatus = function () { return resolveDispatcher().useHostTransitionStatus(); }; - exports.version = "19.0.0-rc-5d19e1c8-20240923"; + exports.version = "19.0.0-rc-778e1ed2-20240926"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom.production.js b/packages/next/src/compiled/react-dom/cjs/react-dom.production.js index fca3c0b79bc2a..bcc0c04add43a 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom.production.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom.production.js @@ -207,4 +207,4 @@ exports.useFormState = function (action, initialState, permalink) { exports.useFormStatus = function () { return ReactSharedInternals.H.useHostTransitionStatus(); }; -exports.version = "19.0.0-rc-5d19e1c8-20240923"; +exports.version = "19.0.0-rc-778e1ed2-20240926"; diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom.react-server.development.js b/packages/next/src/compiled/react-dom/cjs/react-dom.react-server.development.js index 1e0a5ee5c020b..5d8d5ec594208 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom.react-server.development.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom.react-server.development.js @@ -336,5 +336,5 @@ })) : Internals.d.m(href)); }; - exports.version = "19.0.0-rc-5d19e1c8-20240923"; + exports.version = "19.0.0-rc-778e1ed2-20240926"; })(); diff --git a/packages/next/src/compiled/react-dom/cjs/react-dom.react-server.production.js b/packages/next/src/compiled/react-dom/cjs/react-dom.react-server.production.js index d1e860cca9295..1c761a754a80d 100644 --- a/packages/next/src/compiled/react-dom/cjs/react-dom.react-server.production.js +++ b/packages/next/src/compiled/react-dom/cjs/react-dom.react-server.production.js @@ -149,4 +149,4 @@ exports.preloadModule = function (href, options) { }); } else Internals.d.m(href); }; -exports.version = "19.0.0-rc-5d19e1c8-20240923"; +exports.version = "19.0.0-rc-778e1ed2-20240926"; diff --git a/packages/next/src/compiled/react-dom/package.json b/packages/next/src/compiled/react-dom/package.json index 0627ac85ded77..b7085be8d070f 100644 --- a/packages/next/src/compiled/react-dom/package.json +++ b/packages/next/src/compiled/react-dom/package.json @@ -67,10 +67,10 @@ "./package.json": "./package.json" }, "dependencies": { - "scheduler": "0.25.0-rc-5d19e1c8-20240923" + "scheduler": "0.25.0-rc-778e1ed2-20240926" }, "peerDependencies": { - "react": "19.0.0-rc-5d19e1c8-20240923" + "react": "19.0.0-rc-778e1ed2-20240926" }, "browser": { "./server.js": "./server.browser.js", diff --git a/packages/next/src/compiled/react-experimental/cjs/react.development.js b/packages/next/src/compiled/react-experimental/cjs/react.development.js index adfe3da7b01bc..8a6aeb01bf5c9 100644 --- a/packages/next/src/compiled/react-experimental/cjs/react.development.js +++ b/packages/next/src/compiled/react-experimental/cjs/react.development.js @@ -1232,7 +1232,7 @@ exports.useTransition = function () { return resolveDispatcher().useTransition(); }; - exports.version = "19.0.0-experimental-5d19e1c8-20240923"; + exports.version = "19.0.0-experimental-778e1ed2-20240926"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/packages/next/src/compiled/react-experimental/cjs/react.production.js b/packages/next/src/compiled/react-experimental/cjs/react.production.js index 49de22e03c415..ea640dc9a60ab 100644 --- a/packages/next/src/compiled/react-experimental/cjs/react.production.js +++ b/packages/next/src/compiled/react-experimental/cjs/react.production.js @@ -562,4 +562,4 @@ exports.useSyncExternalStore = function ( exports.useTransition = function () { return ReactSharedInternals.H.useTransition(); }; -exports.version = "19.0.0-experimental-5d19e1c8-20240923"; +exports.version = "19.0.0-experimental-778e1ed2-20240926"; diff --git a/packages/next/src/compiled/react-experimental/cjs/react.react-server.development.js b/packages/next/src/compiled/react-experimental/cjs/react.react-server.development.js index 52e72ca8405ee..29c14f632ef9c 100644 --- a/packages/next/src/compiled/react-experimental/cjs/react.react-server.development.js +++ b/packages/next/src/compiled/react-experimental/cjs/react.react-server.development.js @@ -978,5 +978,5 @@ exports.useMemo = function (create, deps) { return resolveDispatcher().useMemo(create, deps); }; - exports.version = "19.0.0-experimental-5d19e1c8-20240923"; + exports.version = "19.0.0-experimental-778e1ed2-20240926"; })(); diff --git a/packages/next/src/compiled/react-experimental/cjs/react.react-server.production.js b/packages/next/src/compiled/react-experimental/cjs/react.react-server.production.js index 4504dea11332c..b762863d354c4 100644 --- a/packages/next/src/compiled/react-experimental/cjs/react.react-server.production.js +++ b/packages/next/src/compiled/react-experimental/cjs/react.react-server.production.js @@ -567,4 +567,4 @@ exports.useId = function () { exports.useMemo = function (create, deps) { return ReactSharedInternals.H.useMemo(create, deps); }; -exports.version = "19.0.0-experimental-5d19e1c8-20240923"; +exports.version = "19.0.0-experimental-778e1ed2-20240926"; diff --git a/packages/next/src/compiled/react-is/package.json b/packages/next/src/compiled/react-is/package.json index efbc81f019b61..c24af1373dacc 100644 --- a/packages/next/src/compiled/react-is/package.json +++ b/packages/next/src/compiled/react-is/package.json @@ -1,6 +1,6 @@ { "name": "react-is", - "version": "19.0.0-rc-5d19e1c8-20240923", + "version": "19.0.0-rc-778e1ed2-20240926", "description": "Brand checking of React Elements.", "main": "index.js", "sideEffects": false, diff --git a/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-client.browser.development.js b/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-client.browser.development.js index 86ffb5d480abc..b2575d8de05ee 100644 --- a/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-client.browser.development.js +++ b/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-client.browser.development.js @@ -1092,17 +1092,22 @@ } value = value[path[i]]; } - parentObject[key] = map(response, value); - "" === key && - null === handler.value && - (handler.value = parentObject[key]); - parentObject[0] === REACT_ELEMENT_TYPE && - "3" === key && + i = map(response, value); + parentObject[key] = i; + "" === key && null === handler.value && (handler.value = i); + if ( + parentObject[0] === REACT_ELEMENT_TYPE && "object" === typeof handler.value && null !== handler.value && - handler.value.$$typeof === REACT_ELEMENT_TYPE && - null === handler.value.props && - (handler.value.props = parentObject[key]); + handler.value.$$typeof === REACT_ELEMENT_TYPE + ) + switch (((value = handler.value), key)) { + case "3": + value.props = i; + break; + case "4": + value._owner = i; + } handler.deps--; 0 === handler.deps && ((i = handler.chunk), @@ -2494,10 +2499,10 @@ return hook.checkDCE ? !0 : !1; })({ bundleType: 1, - version: "19.0.0-experimental-5d19e1c8-20240923", + version: "19.0.0-experimental-778e1ed2-20240926", rendererPackageName: "react-server-dom-turbopack", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.0.0-experimental-5d19e1c8-20240923", + reconcilerVersion: "19.0.0-experimental-778e1ed2-20240926", getCurrentComponentInfo: function () { return currentOwnerInDEV; } diff --git a/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-client.browser.production.js b/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-client.browser.production.js index 8700544b471d1..f0ff41e81568c 100644 --- a/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-client.browser.production.js +++ b/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-client.browser.production.js @@ -688,15 +688,19 @@ function waitForReference( } value = value[path[i]]; } - parentObject[key] = map(response, value); - "" === key && null === handler.value && (handler.value = parentObject[key]); - parentObject[0] === REACT_ELEMENT_TYPE && - "3" === key && + i = map(response, value); + parentObject[key] = i; + "" === key && null === handler.value && (handler.value = i); + if ( + parentObject[0] === REACT_ELEMENT_TYPE && "object" === typeof handler.value && null !== handler.value && - handler.value.$$typeof === REACT_ELEMENT_TYPE && - null === handler.value.props && - (handler.value.props = parentObject[key]); + handler.value.$$typeof === REACT_ELEMENT_TYPE + ) + switch (((value = handler.value), key)) { + case "3": + value.props = i; + } handler.deps--; 0 === handler.deps && ((i = handler.chunk), diff --git a/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-client.edge.development.js b/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-client.edge.development.js index 3f1cad640f710..6ff93eafd9324 100644 --- a/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-client.edge.development.js +++ b/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-client.edge.development.js @@ -1300,17 +1300,22 @@ } value = value[path[i]]; } - parentObject[key] = map(response, value); - "" === key && - null === handler.value && - (handler.value = parentObject[key]); - parentObject[0] === REACT_ELEMENT_TYPE && - "3" === key && + i = map(response, value); + parentObject[key] = i; + "" === key && null === handler.value && (handler.value = i); + if ( + parentObject[0] === REACT_ELEMENT_TYPE && "object" === typeof handler.value && null !== handler.value && - handler.value.$$typeof === REACT_ELEMENT_TYPE && - null === handler.value.props && - (handler.value.props = parentObject[key]); + handler.value.$$typeof === REACT_ELEMENT_TYPE + ) + switch (((value = handler.value), key)) { + case "3": + value.props = i; + break; + case "4": + value._owner = i; + } handler.deps--; 0 === handler.deps && ((i = handler.chunk), diff --git a/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-client.edge.production.js b/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-client.edge.production.js index 879f6eee46526..27beef6e83cdc 100644 --- a/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-client.edge.production.js +++ b/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-client.edge.production.js @@ -851,15 +851,19 @@ function waitForReference( } value = value[path[i]]; } - parentObject[key] = map(response, value); - "" === key && null === handler.value && (handler.value = parentObject[key]); - parentObject[0] === REACT_ELEMENT_TYPE && - "3" === key && + i = map(response, value); + parentObject[key] = i; + "" === key && null === handler.value && (handler.value = i); + if ( + parentObject[0] === REACT_ELEMENT_TYPE && "object" === typeof handler.value && null !== handler.value && - handler.value.$$typeof === REACT_ELEMENT_TYPE && - null === handler.value.props && - (handler.value.props = parentObject[key]); + handler.value.$$typeof === REACT_ELEMENT_TYPE + ) + switch (((value = handler.value), key)) { + case "3": + value.props = i; + } handler.deps--; 0 === handler.deps && ((i = handler.chunk), diff --git a/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-client.node.development.js b/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-client.node.development.js index a6c74cfd4893d..4fd90c5b15325 100644 --- a/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-client.node.development.js +++ b/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-client.node.development.js @@ -1300,17 +1300,22 @@ } value = value[path[i]]; } - parentObject[key] = map(response, value); - "" === key && - null === handler.value && - (handler.value = parentObject[key]); - parentObject[0] === REACT_ELEMENT_TYPE && - "3" === key && + i = map(response, value); + parentObject[key] = i; + "" === key && null === handler.value && (handler.value = i); + if ( + parentObject[0] === REACT_ELEMENT_TYPE && "object" === typeof handler.value && null !== handler.value && - handler.value.$$typeof === REACT_ELEMENT_TYPE && - null === handler.value.props && - (handler.value.props = parentObject[key]); + handler.value.$$typeof === REACT_ELEMENT_TYPE + ) + switch (((value = handler.value), key)) { + case "3": + value.props = i; + break; + case "4": + value._owner = i; + } handler.deps--; 0 === handler.deps && ((i = handler.chunk), diff --git a/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-client.node.production.js b/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-client.node.production.js index dc8b6851a4dff..966be4694ea1e 100644 --- a/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-client.node.production.js +++ b/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-client.node.production.js @@ -852,15 +852,19 @@ function waitForReference( } value = value[path[i]]; } - parentObject[key] = map(response, value); - "" === key && null === handler.value && (handler.value = parentObject[key]); - parentObject[0] === REACT_ELEMENT_TYPE && - "3" === key && + i = map(response, value); + parentObject[key] = i; + "" === key && null === handler.value && (handler.value = i); + if ( + parentObject[0] === REACT_ELEMENT_TYPE && "object" === typeof handler.value && null !== handler.value && - handler.value.$$typeof === REACT_ELEMENT_TYPE && - null === handler.value.props && - (handler.value.props = parentObject[key]); + handler.value.$$typeof === REACT_ELEMENT_TYPE + ) + switch (((value = handler.value), key)) { + case "3": + value.props = i; + } handler.deps--; 0 === handler.deps && ((i = handler.chunk), diff --git a/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-server.browser.development.js b/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-server.browser.development.js index 5dad00f4cce96..e191eddf26cab 100644 --- a/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-server.browser.development.js +++ b/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-server.browser.development.js @@ -1850,6 +1850,9 @@ break; case "3": _existingReference = "props"; + break; + case "4": + _existingReference = "_owner"; } elementReference.set( value, diff --git a/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-server.browser.production.js b/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-server.browser.production.js index 46bbf48ae9648..d35aaca564e0b 100644 --- a/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-server.browser.production.js +++ b/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-server.browser.production.js @@ -1523,6 +1523,9 @@ function renderModelDestructive( break; case "3": existingReference = "props"; + break; + case "4": + existingReference = "_owner"; } elementReference.set(value, writtenObjects + ":" + existingReference); } diff --git a/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-server.edge.development.js b/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-server.edge.development.js index 9f1197595520a..10d7b52135a3c 100644 --- a/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-server.edge.development.js +++ b/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-server.edge.development.js @@ -1907,6 +1907,9 @@ break; case "3": _existingReference = "props"; + break; + case "4": + _existingReference = "_owner"; } elementReference.set( value, diff --git a/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-server.edge.production.js b/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-server.edge.production.js index f17d75ca0c93c..bafb4e460b56a 100644 --- a/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-server.edge.production.js +++ b/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-server.edge.production.js @@ -1528,6 +1528,9 @@ function renderModelDestructive( break; case "3": existingReference = "props"; + break; + case "4": + existingReference = "_owner"; } elementReference.set(value, writtenObjects + ":" + existingReference); } diff --git a/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-server.node.development.js b/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-server.node.development.js index ebb1411c93b7d..f00c6945e615f 100644 --- a/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-server.node.development.js +++ b/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-server.node.development.js @@ -1903,6 +1903,9 @@ break; case "3": _existingReference = "props"; + break; + case "4": + _existingReference = "_owner"; } elementReference.set( value, diff --git a/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-server.node.production.js b/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-server.node.production.js index 0154cc7d24125..b5d45794c3b49 100644 --- a/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-server.node.production.js +++ b/packages/next/src/compiled/react-server-dom-turbopack-experimental/cjs/react-server-dom-turbopack-server.node.production.js @@ -1542,6 +1542,9 @@ function renderModelDestructive( break; case "3": existingReference = "props"; + break; + case "4": + existingReference = "_owner"; } elementReference.set(value, writtenObjects + ":" + existingReference); } diff --git a/packages/next/src/compiled/react-server-dom-turbopack-experimental/package.json b/packages/next/src/compiled/react-server-dom-turbopack-experimental/package.json index 5aa4d631c244b..e260c6d163e56 100644 --- a/packages/next/src/compiled/react-server-dom-turbopack-experimental/package.json +++ b/packages/next/src/compiled/react-server-dom-turbopack-experimental/package.json @@ -48,7 +48,7 @@ "neo-async": "^2.6.1" }, "peerDependencies": { - "react": "0.0.0-experimental-5d19e1c8-20240923", - "react-dom": "0.0.0-experimental-5d19e1c8-20240923" + "react": "0.0.0-experimental-778e1ed2-20240926", + "react-dom": "0.0.0-experimental-778e1ed2-20240926" } } \ No newline at end of file diff --git a/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.browser.development.js b/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.browser.development.js index 522f4e49903df..f514d1c5b28e5 100644 --- a/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.browser.development.js +++ b/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.browser.development.js @@ -1108,17 +1108,22 @@ } value = value[path[i]]; } - parentObject[key] = map(response, value); - "" === key && - null === handler.value && - (handler.value = parentObject[key]); - parentObject[0] === REACT_ELEMENT_TYPE && - "3" === key && + i = map(response, value); + parentObject[key] = i; + "" === key && null === handler.value && (handler.value = i); + if ( + parentObject[0] === REACT_ELEMENT_TYPE && "object" === typeof handler.value && null !== handler.value && - handler.value.$$typeof === REACT_ELEMENT_TYPE && - null === handler.value.props && - (handler.value.props = parentObject[key]); + handler.value.$$typeof === REACT_ELEMENT_TYPE + ) + switch (((value = handler.value), key)) { + case "3": + value.props = i; + break; + case "4": + value._owner = i; + } handler.deps--; 0 === handler.deps && ((i = handler.chunk), @@ -2294,10 +2299,10 @@ return hook.checkDCE ? !0 : !1; })({ bundleType: 1, - version: "19.0.0-rc-5d19e1c8-20240923", + version: "19.0.0-rc-778e1ed2-20240926", rendererPackageName: "react-server-dom-turbopack", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.0.0-rc-5d19e1c8-20240923", + reconcilerVersion: "19.0.0-rc-778e1ed2-20240926", getCurrentComponentInfo: function () { return currentOwnerInDEV; } diff --git a/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.browser.production.js b/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.browser.production.js index 473d7b4a3ae92..a2cab896a7f1b 100644 --- a/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.browser.production.js +++ b/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.browser.production.js @@ -687,15 +687,19 @@ function waitForReference( } value = value[path[i]]; } - parentObject[key] = map(response, value); - "" === key && null === handler.value && (handler.value = parentObject[key]); - parentObject[0] === REACT_ELEMENT_TYPE && - "3" === key && + i = map(response, value); + parentObject[key] = i; + "" === key && null === handler.value && (handler.value = i); + if ( + parentObject[0] === REACT_ELEMENT_TYPE && "object" === typeof handler.value && null !== handler.value && - handler.value.$$typeof === REACT_ELEMENT_TYPE && - null === handler.value.props && - (handler.value.props = parentObject[key]); + handler.value.$$typeof === REACT_ELEMENT_TYPE + ) + switch (((value = handler.value), key)) { + case "3": + value.props = i; + } handler.deps--; 0 === handler.deps && ((i = handler.chunk), diff --git a/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.edge.development.js b/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.edge.development.js index e174798a9bf2b..73103e5411e38 100644 --- a/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.edge.development.js +++ b/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.edge.development.js @@ -1316,17 +1316,22 @@ } value = value[path[i]]; } - parentObject[key] = map(response, value); - "" === key && - null === handler.value && - (handler.value = parentObject[key]); - parentObject[0] === REACT_ELEMENT_TYPE && - "3" === key && + i = map(response, value); + parentObject[key] = i; + "" === key && null === handler.value && (handler.value = i); + if ( + parentObject[0] === REACT_ELEMENT_TYPE && "object" === typeof handler.value && null !== handler.value && - handler.value.$$typeof === REACT_ELEMENT_TYPE && - null === handler.value.props && - (handler.value.props = parentObject[key]); + handler.value.$$typeof === REACT_ELEMENT_TYPE + ) + switch (((value = handler.value), key)) { + case "3": + value.props = i; + break; + case "4": + value._owner = i; + } handler.deps--; 0 === handler.deps && ((i = handler.chunk), diff --git a/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.edge.production.js b/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.edge.production.js index f4c58a33d6d9c..435913724c14f 100644 --- a/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.edge.production.js +++ b/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.edge.production.js @@ -850,15 +850,19 @@ function waitForReference( } value = value[path[i]]; } - parentObject[key] = map(response, value); - "" === key && null === handler.value && (handler.value = parentObject[key]); - parentObject[0] === REACT_ELEMENT_TYPE && - "3" === key && + i = map(response, value); + parentObject[key] = i; + "" === key && null === handler.value && (handler.value = i); + if ( + parentObject[0] === REACT_ELEMENT_TYPE && "object" === typeof handler.value && null !== handler.value && - handler.value.$$typeof === REACT_ELEMENT_TYPE && - null === handler.value.props && - (handler.value.props = parentObject[key]); + handler.value.$$typeof === REACT_ELEMENT_TYPE + ) + switch (((value = handler.value), key)) { + case "3": + value.props = i; + } handler.deps--; 0 === handler.deps && ((i = handler.chunk), diff --git a/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.node.development.js b/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.node.development.js index d4f671cfaa6b6..0d03e46523530 100644 --- a/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.node.development.js +++ b/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.node.development.js @@ -1316,17 +1316,22 @@ } value = value[path[i]]; } - parentObject[key] = map(response, value); - "" === key && - null === handler.value && - (handler.value = parentObject[key]); - parentObject[0] === REACT_ELEMENT_TYPE && - "3" === key && + i = map(response, value); + parentObject[key] = i; + "" === key && null === handler.value && (handler.value = i); + if ( + parentObject[0] === REACT_ELEMENT_TYPE && "object" === typeof handler.value && null !== handler.value && - handler.value.$$typeof === REACT_ELEMENT_TYPE && - null === handler.value.props && - (handler.value.props = parentObject[key]); + handler.value.$$typeof === REACT_ELEMENT_TYPE + ) + switch (((value = handler.value), key)) { + case "3": + value.props = i; + break; + case "4": + value._owner = i; + } handler.deps--; 0 === handler.deps && ((i = handler.chunk), diff --git a/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.node.production.js b/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.node.production.js index 3c10208e7c61f..ebfb140491e98 100644 --- a/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.node.production.js +++ b/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-client.node.production.js @@ -851,15 +851,19 @@ function waitForReference( } value = value[path[i]]; } - parentObject[key] = map(response, value); - "" === key && null === handler.value && (handler.value = parentObject[key]); - parentObject[0] === REACT_ELEMENT_TYPE && - "3" === key && + i = map(response, value); + parentObject[key] = i; + "" === key && null === handler.value && (handler.value = i); + if ( + parentObject[0] === REACT_ELEMENT_TYPE && "object" === typeof handler.value && null !== handler.value && - handler.value.$$typeof === REACT_ELEMENT_TYPE && - null === handler.value.props && - (handler.value.props = parentObject[key]); + handler.value.$$typeof === REACT_ELEMENT_TYPE + ) + switch (((value = handler.value), key)) { + case "3": + value.props = i; + } handler.deps--; 0 === handler.deps && ((i = handler.chunk), diff --git a/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.browser.development.js b/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.browser.development.js index 7f5599edc04df..9412fc82a4908 100644 --- a/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.browser.development.js +++ b/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.browser.development.js @@ -1582,6 +1582,9 @@ break; case "3": _existingReference = "props"; + break; + case "4": + _existingReference = "_owner"; } elementReference.set( value, diff --git a/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.browser.production.js b/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.browser.production.js index 68b64ae53f2b3..c8f8dcf3f6dd3 100644 --- a/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.browser.production.js +++ b/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.browser.production.js @@ -1437,6 +1437,9 @@ function renderModelDestructive( break; case "3": existingReference = "props"; + break; + case "4": + existingReference = "_owner"; } elementReference.set(value, writtenObjects + ":" + existingReference); } diff --git a/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.edge.development.js b/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.edge.development.js index efb75849aa881..2de6917697524 100644 --- a/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.edge.development.js +++ b/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.edge.development.js @@ -1599,6 +1599,9 @@ break; case "3": _existingReference = "props"; + break; + case "4": + _existingReference = "_owner"; } elementReference.set( value, diff --git a/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.edge.production.js b/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.edge.production.js index aa3edfbddc7cd..c51b670753fc1 100644 --- a/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.edge.production.js +++ b/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.edge.production.js @@ -1442,6 +1442,9 @@ function renderModelDestructive( break; case "3": existingReference = "props"; + break; + case "4": + existingReference = "_owner"; } elementReference.set(value, writtenObjects + ":" + existingReference); } diff --git a/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.development.js b/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.development.js index 3635441716a59..feaa02910e419 100644 --- a/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.development.js +++ b/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.development.js @@ -1615,6 +1615,9 @@ break; case "3": _existingReference = "props"; + break; + case "4": + _existingReference = "_owner"; } elementReference.set( value, diff --git a/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.production.js b/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.production.js index c856009746427..451412483fb86 100644 --- a/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.production.js +++ b/packages/next/src/compiled/react-server-dom-turbopack/cjs/react-server-dom-turbopack-server.node.production.js @@ -1455,6 +1455,9 @@ function renderModelDestructive( break; case "3": existingReference = "props"; + break; + case "4": + existingReference = "_owner"; } elementReference.set(value, writtenObjects + ":" + existingReference); } diff --git a/packages/next/src/compiled/react-server-dom-turbopack/package.json b/packages/next/src/compiled/react-server-dom-turbopack/package.json index bd029e41b8b32..6e1ce031513dc 100644 --- a/packages/next/src/compiled/react-server-dom-turbopack/package.json +++ b/packages/next/src/compiled/react-server-dom-turbopack/package.json @@ -48,7 +48,7 @@ "neo-async": "^2.6.1" }, "peerDependencies": { - "react": "19.0.0-rc-5d19e1c8-20240923", - "react-dom": "19.0.0-rc-5d19e1c8-20240923" + "react": "19.0.0-rc-778e1ed2-20240926", + "react-dom": "19.0.0-rc-778e1ed2-20240926" } } \ No newline at end of file diff --git a/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-client.browser.development.js b/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-client.browser.development.js index 937a776e058ec..413f424215da2 100644 --- a/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-client.browser.development.js +++ b/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-client.browser.development.js @@ -1097,17 +1097,22 @@ } value = value[path[i]]; } - parentObject[key] = map(response, value); - "" === key && - null === handler.value && - (handler.value = parentObject[key]); - parentObject[0] === REACT_ELEMENT_TYPE && - "3" === key && + i = map(response, value); + parentObject[key] = i; + "" === key && null === handler.value && (handler.value = i); + if ( + parentObject[0] === REACT_ELEMENT_TYPE && "object" === typeof handler.value && null !== handler.value && - handler.value.$$typeof === REACT_ELEMENT_TYPE && - null === handler.value.props && - (handler.value.props = parentObject[key]); + handler.value.$$typeof === REACT_ELEMENT_TYPE + ) + switch (((value = handler.value), key)) { + case "3": + value.props = i; + break; + case "4": + value._owner = i; + } handler.deps--; 0 === handler.deps && ((i = handler.chunk), @@ -2507,10 +2512,10 @@ return hook.checkDCE ? !0 : !1; })({ bundleType: 1, - version: "19.0.0-experimental-5d19e1c8-20240923", + version: "19.0.0-experimental-778e1ed2-20240926", rendererPackageName: "react-server-dom-webpack", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.0.0-experimental-5d19e1c8-20240923", + reconcilerVersion: "19.0.0-experimental-778e1ed2-20240926", getCurrentComponentInfo: function () { return currentOwnerInDEV; } diff --git a/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-client.browser.production.js b/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-client.browser.production.js index 5caae01c843af..5e9fb3131031a 100644 --- a/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-client.browser.production.js +++ b/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-client.browser.production.js @@ -698,15 +698,19 @@ function waitForReference( } value = value[path[i]]; } - parentObject[key] = map(response, value); - "" === key && null === handler.value && (handler.value = parentObject[key]); - parentObject[0] === REACT_ELEMENT_TYPE && - "3" === key && + i = map(response, value); + parentObject[key] = i; + "" === key && null === handler.value && (handler.value = i); + if ( + parentObject[0] === REACT_ELEMENT_TYPE && "object" === typeof handler.value && null !== handler.value && - handler.value.$$typeof === REACT_ELEMENT_TYPE && - null === handler.value.props && - (handler.value.props = parentObject[key]); + handler.value.$$typeof === REACT_ELEMENT_TYPE + ) + switch (((value = handler.value), key)) { + case "3": + value.props = i; + } handler.deps--; 0 === handler.deps && ((i = handler.chunk), diff --git a/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-client.edge.development.js b/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-client.edge.development.js index e573d9bccfbff..9926673a9ce66 100644 --- a/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-client.edge.development.js +++ b/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-client.edge.development.js @@ -1301,17 +1301,22 @@ } value = value[path[i]]; } - parentObject[key] = map(response, value); - "" === key && - null === handler.value && - (handler.value = parentObject[key]); - parentObject[0] === REACT_ELEMENT_TYPE && - "3" === key && + i = map(response, value); + parentObject[key] = i; + "" === key && null === handler.value && (handler.value = i); + if ( + parentObject[0] === REACT_ELEMENT_TYPE && "object" === typeof handler.value && null !== handler.value && - handler.value.$$typeof === REACT_ELEMENT_TYPE && - null === handler.value.props && - (handler.value.props = parentObject[key]); + handler.value.$$typeof === REACT_ELEMENT_TYPE + ) + switch (((value = handler.value), key)) { + case "3": + value.props = i; + break; + case "4": + value._owner = i; + } handler.deps--; 0 === handler.deps && ((i = handler.chunk), diff --git a/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-client.edge.production.js b/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-client.edge.production.js index 7d1248377cb4f..379be5588c48a 100644 --- a/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-client.edge.production.js +++ b/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-client.edge.production.js @@ -852,15 +852,19 @@ function waitForReference( } value = value[path[i]]; } - parentObject[key] = map(response, value); - "" === key && null === handler.value && (handler.value = parentObject[key]); - parentObject[0] === REACT_ELEMENT_TYPE && - "3" === key && + i = map(response, value); + parentObject[key] = i; + "" === key && null === handler.value && (handler.value = i); + if ( + parentObject[0] === REACT_ELEMENT_TYPE && "object" === typeof handler.value && null !== handler.value && - handler.value.$$typeof === REACT_ELEMENT_TYPE && - null === handler.value.props && - (handler.value.props = parentObject[key]); + handler.value.$$typeof === REACT_ELEMENT_TYPE + ) + switch (((value = handler.value), key)) { + case "3": + value.props = i; + } handler.deps--; 0 === handler.deps && ((i = handler.chunk), diff --git a/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-client.node.development.js b/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-client.node.development.js index 8d881e0006140..26568ec942508 100644 --- a/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-client.node.development.js +++ b/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-client.node.development.js @@ -1301,17 +1301,22 @@ } value = value[path[i]]; } - parentObject[key] = map(response, value); - "" === key && - null === handler.value && - (handler.value = parentObject[key]); - parentObject[0] === REACT_ELEMENT_TYPE && - "3" === key && + i = map(response, value); + parentObject[key] = i; + "" === key && null === handler.value && (handler.value = i); + if ( + parentObject[0] === REACT_ELEMENT_TYPE && "object" === typeof handler.value && null !== handler.value && - handler.value.$$typeof === REACT_ELEMENT_TYPE && - null === handler.value.props && - (handler.value.props = parentObject[key]); + handler.value.$$typeof === REACT_ELEMENT_TYPE + ) + switch (((value = handler.value), key)) { + case "3": + value.props = i; + break; + case "4": + value._owner = i; + } handler.deps--; 0 === handler.deps && ((i = handler.chunk), diff --git a/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-client.node.production.js b/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-client.node.production.js index 4e2c5f1552c6e..33b33c8e7a9d3 100644 --- a/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-client.node.production.js +++ b/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-client.node.production.js @@ -853,15 +853,19 @@ function waitForReference( } value = value[path[i]]; } - parentObject[key] = map(response, value); - "" === key && null === handler.value && (handler.value = parentObject[key]); - parentObject[0] === REACT_ELEMENT_TYPE && - "3" === key && + i = map(response, value); + parentObject[key] = i; + "" === key && null === handler.value && (handler.value = i); + if ( + parentObject[0] === REACT_ELEMENT_TYPE && "object" === typeof handler.value && null !== handler.value && - handler.value.$$typeof === REACT_ELEMENT_TYPE && - null === handler.value.props && - (handler.value.props = parentObject[key]); + handler.value.$$typeof === REACT_ELEMENT_TYPE + ) + switch (((value = handler.value), key)) { + case "3": + value.props = i; + } handler.deps--; 0 === handler.deps && ((i = handler.chunk), diff --git a/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-client.node.unbundled.development.js b/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-client.node.unbundled.development.js index b83ecf9d4f611..5c3b6d8a8e2fb 100644 --- a/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-client.node.unbundled.development.js +++ b/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-client.node.unbundled.development.js @@ -1276,17 +1276,22 @@ } value = value[path[i]]; } - parentObject[key] = map(response, value); - "" === key && - null === handler.value && - (handler.value = parentObject[key]); - parentObject[0] === REACT_ELEMENT_TYPE && - "3" === key && + i = map(response, value); + parentObject[key] = i; + "" === key && null === handler.value && (handler.value = i); + if ( + parentObject[0] === REACT_ELEMENT_TYPE && "object" === typeof handler.value && null !== handler.value && - handler.value.$$typeof === REACT_ELEMENT_TYPE && - null === handler.value.props && - (handler.value.props = parentObject[key]); + handler.value.$$typeof === REACT_ELEMENT_TYPE + ) + switch (((value = handler.value), key)) { + case "3": + value.props = i; + break; + case "4": + value._owner = i; + } handler.deps--; 0 === handler.deps && ((i = handler.chunk), diff --git a/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-client.node.unbundled.production.js b/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-client.node.unbundled.production.js index 9bd60529c3603..0b46271364b46 100644 --- a/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-client.node.unbundled.production.js +++ b/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-client.node.unbundled.production.js @@ -832,15 +832,19 @@ function waitForReference( } value = value[path[i]]; } - parentObject[key] = map(response, value); - "" === key && null === handler.value && (handler.value = parentObject[key]); - parentObject[0] === REACT_ELEMENT_TYPE && - "3" === key && + i = map(response, value); + parentObject[key] = i; + "" === key && null === handler.value && (handler.value = i); + if ( + parentObject[0] === REACT_ELEMENT_TYPE && "object" === typeof handler.value && null !== handler.value && - handler.value.$$typeof === REACT_ELEMENT_TYPE && - null === handler.value.props && - (handler.value.props = parentObject[key]); + handler.value.$$typeof === REACT_ELEMENT_TYPE + ) + switch (((value = handler.value), key)) { + case "3": + value.props = i; + } handler.deps--; 0 === handler.deps && ((i = handler.chunk), diff --git a/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-server.browser.development.js b/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-server.browser.development.js index 2ce86b8cd6c77..adfd63037a303 100644 --- a/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-server.browser.development.js +++ b/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-server.browser.development.js @@ -1850,6 +1850,9 @@ break; case "3": _existingReference = "props"; + break; + case "4": + _existingReference = "_owner"; } elementReference.set( value, diff --git a/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-server.browser.production.js b/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-server.browser.production.js index 93b55a6c7774f..507f1bff591e6 100644 --- a/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-server.browser.production.js +++ b/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-server.browser.production.js @@ -1523,6 +1523,9 @@ function renderModelDestructive( break; case "3": existingReference = "props"; + break; + case "4": + existingReference = "_owner"; } elementReference.set(value, writtenObjects + ":" + existingReference); } diff --git a/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-server.edge.development.js b/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-server.edge.development.js index 4df5553ac1f75..45f38a29e5243 100644 --- a/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-server.edge.development.js +++ b/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-server.edge.development.js @@ -1907,6 +1907,9 @@ break; case "3": _existingReference = "props"; + break; + case "4": + _existingReference = "_owner"; } elementReference.set( value, diff --git a/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-server.edge.production.js b/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-server.edge.production.js index 9d804423215f1..66cd986cb8b6f 100644 --- a/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-server.edge.production.js +++ b/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-server.edge.production.js @@ -1528,6 +1528,9 @@ function renderModelDestructive( break; case "3": existingReference = "props"; + break; + case "4": + existingReference = "_owner"; } elementReference.set(value, writtenObjects + ":" + existingReference); } diff --git a/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-server.node.development.js b/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-server.node.development.js index cae7c350bac0e..60c33f50624a6 100644 --- a/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-server.node.development.js +++ b/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-server.node.development.js @@ -1903,6 +1903,9 @@ break; case "3": _existingReference = "props"; + break; + case "4": + _existingReference = "_owner"; } elementReference.set( value, diff --git a/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-server.node.production.js b/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-server.node.production.js index 97556d6677078..7342f80a6866b 100644 --- a/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-server.node.production.js +++ b/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-server.node.production.js @@ -1542,6 +1542,9 @@ function renderModelDestructive( break; case "3": existingReference = "props"; + break; + case "4": + existingReference = "_owner"; } elementReference.set(value, writtenObjects + ":" + existingReference); } diff --git a/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-server.node.unbundled.development.js b/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-server.node.unbundled.development.js index bb4e5874c39fc..27c73a2b9b74a 100644 --- a/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-server.node.unbundled.development.js +++ b/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-server.node.unbundled.development.js @@ -1903,6 +1903,9 @@ break; case "3": _existingReference = "props"; + break; + case "4": + _existingReference = "_owner"; } elementReference.set( value, diff --git a/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-server.node.unbundled.production.js b/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-server.node.unbundled.production.js index ea91b1fd97df0..c78253048b9e4 100644 --- a/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-server.node.unbundled.production.js +++ b/packages/next/src/compiled/react-server-dom-webpack-experimental/cjs/react-server-dom-webpack-server.node.unbundled.production.js @@ -1542,6 +1542,9 @@ function renderModelDestructive( break; case "3": existingReference = "props"; + break; + case "4": + existingReference = "_owner"; } elementReference.set(value, writtenObjects + ":" + existingReference); } diff --git a/packages/next/src/compiled/react-server-dom-webpack-experimental/package.json b/packages/next/src/compiled/react-server-dom-webpack-experimental/package.json index 0e610e256c190..7994131f0a142 100644 --- a/packages/next/src/compiled/react-server-dom-webpack-experimental/package.json +++ b/packages/next/src/compiled/react-server-dom-webpack-experimental/package.json @@ -64,8 +64,8 @@ "webpack-sources": "^3.2.0" }, "peerDependencies": { - "react": "0.0.0-experimental-5d19e1c8-20240923", - "react-dom": "0.0.0-experimental-5d19e1c8-20240923", + "react": "0.0.0-experimental-778e1ed2-20240926", + "react-dom": "0.0.0-experimental-778e1ed2-20240926", "webpack": "^5.59.0" } } \ No newline at end of file diff --git a/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.development.js b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.development.js index e05286b6976a1..be75e126fe616 100644 --- a/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.development.js +++ b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.development.js @@ -1113,17 +1113,22 @@ } value = value[path[i]]; } - parentObject[key] = map(response, value); - "" === key && - null === handler.value && - (handler.value = parentObject[key]); - parentObject[0] === REACT_ELEMENT_TYPE && - "3" === key && + i = map(response, value); + parentObject[key] = i; + "" === key && null === handler.value && (handler.value = i); + if ( + parentObject[0] === REACT_ELEMENT_TYPE && "object" === typeof handler.value && null !== handler.value && - handler.value.$$typeof === REACT_ELEMENT_TYPE && - null === handler.value.props && - (handler.value.props = parentObject[key]); + handler.value.$$typeof === REACT_ELEMENT_TYPE + ) + switch (((value = handler.value), key)) { + case "3": + value.props = i; + break; + case "4": + value._owner = i; + } handler.deps--; 0 === handler.deps && ((i = handler.chunk), @@ -2307,10 +2312,10 @@ return hook.checkDCE ? !0 : !1; })({ bundleType: 1, - version: "19.0.0-rc-5d19e1c8-20240923", + version: "19.0.0-rc-778e1ed2-20240926", rendererPackageName: "react-server-dom-webpack", currentDispatcherRef: ReactSharedInternals, - reconcilerVersion: "19.0.0-rc-5d19e1c8-20240923", + reconcilerVersion: "19.0.0-rc-778e1ed2-20240926", getCurrentComponentInfo: function () { return currentOwnerInDEV; } diff --git a/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.production.js b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.production.js index 3aeb36f755057..dbb05bff6351a 100644 --- a/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.production.js +++ b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.browser.production.js @@ -697,15 +697,19 @@ function waitForReference( } value = value[path[i]]; } - parentObject[key] = map(response, value); - "" === key && null === handler.value && (handler.value = parentObject[key]); - parentObject[0] === REACT_ELEMENT_TYPE && - "3" === key && + i = map(response, value); + parentObject[key] = i; + "" === key && null === handler.value && (handler.value = i); + if ( + parentObject[0] === REACT_ELEMENT_TYPE && "object" === typeof handler.value && null !== handler.value && - handler.value.$$typeof === REACT_ELEMENT_TYPE && - null === handler.value.props && - (handler.value.props = parentObject[key]); + handler.value.$$typeof === REACT_ELEMENT_TYPE + ) + switch (((value = handler.value), key)) { + case "3": + value.props = i; + } handler.deps--; 0 === handler.deps && ((i = handler.chunk), diff --git a/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.edge.development.js b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.edge.development.js index dfb1939cdaadb..128d518568bc7 100644 --- a/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.edge.development.js +++ b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.edge.development.js @@ -1317,17 +1317,22 @@ } value = value[path[i]]; } - parentObject[key] = map(response, value); - "" === key && - null === handler.value && - (handler.value = parentObject[key]); - parentObject[0] === REACT_ELEMENT_TYPE && - "3" === key && + i = map(response, value); + parentObject[key] = i; + "" === key && null === handler.value && (handler.value = i); + if ( + parentObject[0] === REACT_ELEMENT_TYPE && "object" === typeof handler.value && null !== handler.value && - handler.value.$$typeof === REACT_ELEMENT_TYPE && - null === handler.value.props && - (handler.value.props = parentObject[key]); + handler.value.$$typeof === REACT_ELEMENT_TYPE + ) + switch (((value = handler.value), key)) { + case "3": + value.props = i; + break; + case "4": + value._owner = i; + } handler.deps--; 0 === handler.deps && ((i = handler.chunk), diff --git a/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.edge.production.js b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.edge.production.js index d932b5ec40950..d37850f831c83 100644 --- a/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.edge.production.js +++ b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.edge.production.js @@ -851,15 +851,19 @@ function waitForReference( } value = value[path[i]]; } - parentObject[key] = map(response, value); - "" === key && null === handler.value && (handler.value = parentObject[key]); - parentObject[0] === REACT_ELEMENT_TYPE && - "3" === key && + i = map(response, value); + parentObject[key] = i; + "" === key && null === handler.value && (handler.value = i); + if ( + parentObject[0] === REACT_ELEMENT_TYPE && "object" === typeof handler.value && null !== handler.value && - handler.value.$$typeof === REACT_ELEMENT_TYPE && - null === handler.value.props && - (handler.value.props = parentObject[key]); + handler.value.$$typeof === REACT_ELEMENT_TYPE + ) + switch (((value = handler.value), key)) { + case "3": + value.props = i; + } handler.deps--; 0 === handler.deps && ((i = handler.chunk), diff --git a/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.development.js b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.development.js index 1868544c9e076..76cde1d3f7ef2 100644 --- a/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.development.js +++ b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.development.js @@ -1317,17 +1317,22 @@ } value = value[path[i]]; } - parentObject[key] = map(response, value); - "" === key && - null === handler.value && - (handler.value = parentObject[key]); - parentObject[0] === REACT_ELEMENT_TYPE && - "3" === key && + i = map(response, value); + parentObject[key] = i; + "" === key && null === handler.value && (handler.value = i); + if ( + parentObject[0] === REACT_ELEMENT_TYPE && "object" === typeof handler.value && null !== handler.value && - handler.value.$$typeof === REACT_ELEMENT_TYPE && - null === handler.value.props && - (handler.value.props = parentObject[key]); + handler.value.$$typeof === REACT_ELEMENT_TYPE + ) + switch (((value = handler.value), key)) { + case "3": + value.props = i; + break; + case "4": + value._owner = i; + } handler.deps--; 0 === handler.deps && ((i = handler.chunk), diff --git a/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.production.js b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.production.js index dba982993db33..50258515567f2 100644 --- a/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.production.js +++ b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.production.js @@ -852,15 +852,19 @@ function waitForReference( } value = value[path[i]]; } - parentObject[key] = map(response, value); - "" === key && null === handler.value && (handler.value = parentObject[key]); - parentObject[0] === REACT_ELEMENT_TYPE && - "3" === key && + i = map(response, value); + parentObject[key] = i; + "" === key && null === handler.value && (handler.value = i); + if ( + parentObject[0] === REACT_ELEMENT_TYPE && "object" === typeof handler.value && null !== handler.value && - handler.value.$$typeof === REACT_ELEMENT_TYPE && - null === handler.value.props && - (handler.value.props = parentObject[key]); + handler.value.$$typeof === REACT_ELEMENT_TYPE + ) + switch (((value = handler.value), key)) { + case "3": + value.props = i; + } handler.deps--; 0 === handler.deps && ((i = handler.chunk), diff --git a/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.unbundled.development.js b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.unbundled.development.js index cbde5bea52acf..52b18b183411f 100644 --- a/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.unbundled.development.js +++ b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.unbundled.development.js @@ -1292,17 +1292,22 @@ } value = value[path[i]]; } - parentObject[key] = map(response, value); - "" === key && - null === handler.value && - (handler.value = parentObject[key]); - parentObject[0] === REACT_ELEMENT_TYPE && - "3" === key && + i = map(response, value); + parentObject[key] = i; + "" === key && null === handler.value && (handler.value = i); + if ( + parentObject[0] === REACT_ELEMENT_TYPE && "object" === typeof handler.value && null !== handler.value && - handler.value.$$typeof === REACT_ELEMENT_TYPE && - null === handler.value.props && - (handler.value.props = parentObject[key]); + handler.value.$$typeof === REACT_ELEMENT_TYPE + ) + switch (((value = handler.value), key)) { + case "3": + value.props = i; + break; + case "4": + value._owner = i; + } handler.deps--; 0 === handler.deps && ((i = handler.chunk), diff --git a/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.unbundled.production.js b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.unbundled.production.js index 4a9d065c2846b..bfe9e0469a5a0 100644 --- a/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.unbundled.production.js +++ b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-client.node.unbundled.production.js @@ -831,15 +831,19 @@ function waitForReference( } value = value[path[i]]; } - parentObject[key] = map(response, value); - "" === key && null === handler.value && (handler.value = parentObject[key]); - parentObject[0] === REACT_ELEMENT_TYPE && - "3" === key && + i = map(response, value); + parentObject[key] = i; + "" === key && null === handler.value && (handler.value = i); + if ( + parentObject[0] === REACT_ELEMENT_TYPE && "object" === typeof handler.value && null !== handler.value && - handler.value.$$typeof === REACT_ELEMENT_TYPE && - null === handler.value.props && - (handler.value.props = parentObject[key]); + handler.value.$$typeof === REACT_ELEMENT_TYPE + ) + switch (((value = handler.value), key)) { + case "3": + value.props = i; + } handler.deps--; 0 === handler.deps && ((i = handler.chunk), diff --git a/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.development.js b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.development.js index dfa52a2934125..736c01c78101c 100644 --- a/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.development.js +++ b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.development.js @@ -1582,6 +1582,9 @@ break; case "3": _existingReference = "props"; + break; + case "4": + _existingReference = "_owner"; } elementReference.set( value, diff --git a/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.production.js b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.production.js index e3caaf10b475c..9f8436e528cb2 100644 --- a/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.production.js +++ b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.browser.production.js @@ -1437,6 +1437,9 @@ function renderModelDestructive( break; case "3": existingReference = "props"; + break; + case "4": + existingReference = "_owner"; } elementReference.set(value, writtenObjects + ":" + existingReference); } diff --git a/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.development.js b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.development.js index 1d036dcaeb91d..4bb05c5c1b019 100644 --- a/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.development.js +++ b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.development.js @@ -1599,6 +1599,9 @@ break; case "3": _existingReference = "props"; + break; + case "4": + _existingReference = "_owner"; } elementReference.set( value, diff --git a/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.production.js b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.production.js index 77f4dce6c4782..3693cda7d9df4 100644 --- a/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.production.js +++ b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.edge.production.js @@ -1442,6 +1442,9 @@ function renderModelDestructive( break; case "3": existingReference = "props"; + break; + case "4": + existingReference = "_owner"; } elementReference.set(value, writtenObjects + ":" + existingReference); } diff --git a/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.development.js b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.development.js index ffbe637fc5f37..19bc1046a49c6 100644 --- a/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.development.js +++ b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.development.js @@ -1615,6 +1615,9 @@ break; case "3": _existingReference = "props"; + break; + case "4": + _existingReference = "_owner"; } elementReference.set( value, diff --git a/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.production.js b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.production.js index 4f4cec30a7112..a60144160e89e 100644 --- a/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.production.js +++ b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.production.js @@ -1455,6 +1455,9 @@ function renderModelDestructive( break; case "3": existingReference = "props"; + break; + case "4": + existingReference = "_owner"; } elementReference.set(value, writtenObjects + ":" + existingReference); } diff --git a/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.development.js b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.development.js index fd7f79c0dc876..94042eac2e09a 100644 --- a/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.development.js +++ b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.development.js @@ -1615,6 +1615,9 @@ break; case "3": _existingReference = "props"; + break; + case "4": + _existingReference = "_owner"; } elementReference.set( value, diff --git a/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.production.js b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.production.js index 46533f22925d0..cf3c6c75cd473 100644 --- a/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.production.js +++ b/packages/next/src/compiled/react-server-dom-webpack/cjs/react-server-dom-webpack-server.node.unbundled.production.js @@ -1455,6 +1455,9 @@ function renderModelDestructive( break; case "3": existingReference = "props"; + break; + case "4": + existingReference = "_owner"; } elementReference.set(value, writtenObjects + ":" + existingReference); } diff --git a/packages/next/src/compiled/react-server-dom-webpack/package.json b/packages/next/src/compiled/react-server-dom-webpack/package.json index 770ea93398082..2944551331953 100644 --- a/packages/next/src/compiled/react-server-dom-webpack/package.json +++ b/packages/next/src/compiled/react-server-dom-webpack/package.json @@ -64,8 +64,8 @@ "webpack-sources": "^3.2.0" }, "peerDependencies": { - "react": "19.0.0-rc-5d19e1c8-20240923", - "react-dom": "19.0.0-rc-5d19e1c8-20240923", + "react": "19.0.0-rc-778e1ed2-20240926", + "react-dom": "19.0.0-rc-778e1ed2-20240926", "webpack": "^5.59.0" } } \ No newline at end of file diff --git a/packages/next/src/compiled/react/cjs/react.development.js b/packages/next/src/compiled/react/cjs/react.development.js index 61ec3d426b287..55ef1fdf232af 100644 --- a/packages/next/src/compiled/react/cjs/react.development.js +++ b/packages/next/src/compiled/react/cjs/react.development.js @@ -1516,7 +1516,7 @@ exports.useTransition = function () { return resolveDispatcher().useTransition(); }; - exports.version = "19.0.0-rc-5d19e1c8-20240923"; + exports.version = "19.0.0-rc-778e1ed2-20240926"; "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && diff --git a/packages/next/src/compiled/react/cjs/react.production.js b/packages/next/src/compiled/react/cjs/react.production.js index 565023ae300b6..591e107da2fc1 100644 --- a/packages/next/src/compiled/react/cjs/react.production.js +++ b/packages/next/src/compiled/react/cjs/react.production.js @@ -536,4 +536,4 @@ exports.useSyncExternalStore = function ( exports.useTransition = function () { return ReactSharedInternals.H.useTransition(); }; -exports.version = "19.0.0-rc-5d19e1c8-20240923"; +exports.version = "19.0.0-rc-778e1ed2-20240926"; diff --git a/packages/next/src/compiled/react/cjs/react.react-server.development.js b/packages/next/src/compiled/react/cjs/react.react-server.development.js index ca76e7626ecec..3bf9fe3df577c 100644 --- a/packages/next/src/compiled/react/cjs/react.react-server.development.js +++ b/packages/next/src/compiled/react/cjs/react.react-server.development.js @@ -1113,5 +1113,5 @@ exports.useMemo = function (create, deps) { return resolveDispatcher().useMemo(create, deps); }; - exports.version = "19.0.0-rc-5d19e1c8-20240923"; + exports.version = "19.0.0-rc-778e1ed2-20240926"; })(); diff --git a/packages/next/src/compiled/react/cjs/react.react-server.production.js b/packages/next/src/compiled/react/cjs/react.react-server.production.js index 544cd20a5e461..e61ce39588f62 100644 --- a/packages/next/src/compiled/react/cjs/react.react-server.production.js +++ b/packages/next/src/compiled/react/cjs/react.react-server.production.js @@ -424,4 +424,4 @@ exports.useId = function () { exports.useMemo = function (create, deps) { return ReactSharedInternals.H.useMemo(create, deps); }; -exports.version = "19.0.0-rc-5d19e1c8-20240923"; +exports.version = "19.0.0-rc-778e1ed2-20240926"; diff --git a/packages/next/src/compiled/unistore/unistore.js b/packages/next/src/compiled/unistore/unistore.js index 5e9eb6e285ff8..d06b59c7ec233 100644 --- a/packages/next/src/compiled/unistore/unistore.js +++ b/packages/next/src/compiled/unistore/unistore.js @@ -1 +1 @@ -(()=>{var t={768:t=>{function n(t,i){for(var _ in i)t[_]=i[_];return t}t.exports=function(t){var i=[];function u(t){for(var _=[],a=0;a{var t={128:t=>{function n(t,i){for(var _ in i)t[_]=i[_];return t}t.exports=function(t){var i=[];function u(t){for(var _=[],a=0;a=18'} peerDependencies: '@types/react': npm:types-react@19.0.0-rc.0 - react: 19.0.0-rc-5d19e1c8-20240923 - react-dom: 19.0.0-rc-5d19e1c8-20240923 + react: 19.0.0-rc-778e1ed2-20240926 + react-dom: 19.0.0-rc-778e1ed2-20240926 peerDependenciesMeta: '@types/react': optional: true @@ -10350,7 +10350,7 @@ packages: lucide-react@0.383.0: resolution: {integrity: sha512-13xlG0CQCJtzjSQYwwJ3WRqMHtRj3EXmLlorrARt7y+IHnxUCp3XyFNL1DfaGySWxHObDvnu1u1dV+0VMKHUSg==} peerDependencies: - react: 19.0.0-rc-5d19e1c8-20240923 + react: 19.0.0-rc-778e1ed2-20240926 lz-string@1.5.0: resolution: {integrity: sha512-h5bgJWpxJNswbU7qCrV0tIKQCaS3blPDrqKWx+QxzuzL1zGUzij9XCWLrSLsJPu5t+eWA/ycetzYAO5IOMcWAQ==} @@ -12565,28 +12565,28 @@ packages: resolution: {integrity: sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==} hasBin: true - react-dom@0.0.0-experimental-5d19e1c8-20240923: - resolution: {integrity: sha512-0k45pTmdiI0loGpwbu0V9Wd1wle3iZt9T9yC3Dd6m2xbBxHxl5L8ypIbbQwPPcsVfQLvx7DhRPGs95DAi2ZayA==} + react-dom@0.0.0-experimental-778e1ed2-20240926: + resolution: {integrity: sha512-iuYUtM155fRJxpQEfw24ArX91rvhZ9JCyXoJ3+DUExPvyxvTH8tQaZNDv2Ap7dV15kJJTrblSWSOUqHSnNlFTQ==} peerDependencies: - react: 19.0.0-rc-5d19e1c8-20240923 + react: 19.0.0-rc-778e1ed2-20240926 react-dom@17.0.2: resolution: {integrity: sha512-s4h96KtLDUQlsENhMn1ar8t2bEa+q/YAtj8pPPdIjPDGBDIVNsrD9aXNWqspUe6AzKCIG0C1HZZLqLV7qpOBGA==} peerDependencies: - react: 19.0.0-rc-5d19e1c8-20240923 + react: 19.0.0-rc-778e1ed2-20240926 - react-dom@19.0.0-rc-5d19e1c8-20240923: - resolution: {integrity: sha512-1O1KWGV/Lmlr1d1RePwiqZOuq2/EZLPpD/9fwlgJer4KKYTr6KlIEPEjC6u1iMQEUvs/r+maxdKSgeHjsNWFfg==} + react-dom@19.0.0-rc-778e1ed2-20240926: + resolution: {integrity: sha512-9FLXiKN8/nxd+TcrjIPKxxWQZVTr4lBbuPIcRly8Ch6FZsTrFmpF3I++0+1HoKDlg4JwPvQ/H3+4OfRpgNn7bQ==} peerDependencies: - react: 19.0.0-rc-5d19e1c8-20240923 + react: 19.0.0-rc-778e1ed2-20240926 react-dom@19.0.0-rc-f90a6bcc-20240827: resolution: {integrity: sha512-oUa/reDvGtjRcxi8u+GYHaDHanudaO28+G+Wvxm50CItW1xwIFN2Nn7foJxxDS9lFLGdRWZvjxldZEPAUSuXbg==} peerDependencies: - react: 19.0.0-rc-5d19e1c8-20240923 + react: 19.0.0-rc-778e1ed2-20240926 - react-is@19.0.0-rc-5d19e1c8-20240923: - resolution: {integrity: sha512-vX1YsII4H0lgVOgeRvslngSKI86O0Q/VTFanouP34zBqKv5aTnjrBjkSS1bWuyiLPaB6cV+ixBFplAljiHAcOg==} + react-is@19.0.0-rc-778e1ed2-20240926: + resolution: {integrity: sha512-ybXnSjhvDcE+o3/7HTNBNj6YfX+Xr+lUkvHZ375KAlBN6jozgiGhyJG+52SEoRpdERXkPQ2wPgmSStvoOg4w/w==} react-is@19.0.0-rc-f90a6bcc-20240827: resolution: {integrity: sha512-1tXoLFzVbqHAQeY3CwpyF5IYbkwgSoNHhrhS8qOrfiZIh2461h/C1BP/JVIxwyL51wHhUgLsAc/M8g0OcEhV1A==} @@ -12597,8 +12597,8 @@ packages: react-number-format@5.4.0: resolution: {integrity: sha512-NWdICrqLhI7rAS8yUeLVd6Wr4cN7UjJ9IBTS0f/a9i7UB4x4Ti70kGnksBtZ7o4Z7YRbvCMMR/jQmkoOBa/4fg==} peerDependencies: - react: 19.0.0-rc-5d19e1c8-20240923 - react-dom: 19.0.0-rc-5d19e1c8-20240923 + react: 19.0.0-rc-778e1ed2-20240926 + react-dom: 19.0.0-rc-778e1ed2-20240926 react-refresh@0.12.0: resolution: {integrity: sha512-suLIhrU2IHKL5JEKR/fAwJv7bbeq4kJ+pJopf77jHwuR+HmJS/HbrPIGsTBUVfw7tXPOmYv7UJ7PCaN49e8x4A==} @@ -12609,7 +12609,7 @@ packages: engines: {node: '>=10'} peerDependencies: '@types/react': npm:types-react@19.0.0-rc.0 - react: 19.0.0-rc-5d19e1c8-20240923 + react: 19.0.0-rc-778e1ed2-20240926 peerDependenciesMeta: '@types/react': optional: true @@ -12619,58 +12619,58 @@ packages: engines: {node: '>=10'} peerDependencies: '@types/react': npm:types-react@19.0.0-rc.0 - react: 19.0.0-rc-5d19e1c8-20240923 + react: 19.0.0-rc-778e1ed2-20240926 peerDependenciesMeta: '@types/react': optional: true - react-server-dom-turbopack@0.0.0-experimental-5d19e1c8-20240923: - resolution: {integrity: sha512-IyqOOby4ZHRg2VCJ/wG4wN/+YLhNsjhBd0GrgoroXGYnPPFRmULKZ57wSukBpHdUlAOis6gq014yfEKZoZUoSQ==} + react-server-dom-turbopack@0.0.0-experimental-778e1ed2-20240926: + resolution: {integrity: sha512-xv/x1dxuAmptBazg7NNznUlwi+1hXiOM0UBfGNj977a23ychNzAYfb3RWqtnRDK7dIdvfQP8fBYR9FFL33Ue1g==} engines: {node: '>=0.10.0'} peerDependencies: - react: 19.0.0-rc-5d19e1c8-20240923 - react-dom: 19.0.0-rc-5d19e1c8-20240923 + react: 19.0.0-rc-778e1ed2-20240926 + react-dom: 19.0.0-rc-778e1ed2-20240926 - react-server-dom-turbopack@19.0.0-rc-5d19e1c8-20240923: - resolution: {integrity: sha512-ueaVIxCVj3RwtOW8I33WfrxHnnuMCaoiinvVBUNKAVBjgm0W4rpb8yPAJR0O6fmY8PG4kBZ+xmD2KQcY+BGSLQ==} + react-server-dom-turbopack@19.0.0-rc-778e1ed2-20240926: + resolution: {integrity: sha512-WOBipbB894RGEgVjrSXeaCd85EJrHRs2s06MlXIMtXAS4yFXpwsnnJrqajCnk8RPU4je3aYAELPT6MZoY3re3g==} engines: {node: '>=0.10.0'} peerDependencies: - react: 19.0.0-rc-5d19e1c8-20240923 - react-dom: 19.0.0-rc-5d19e1c8-20240923 + react: 19.0.0-rc-778e1ed2-20240926 + react-dom: 19.0.0-rc-778e1ed2-20240926 - react-server-dom-webpack@0.0.0-experimental-5d19e1c8-20240923: - resolution: {integrity: sha512-O5qvoJjPChSnTc56wHvQyPldiAU/MgvOvzUbvUp53PjghokIUx7axJg4pX4/zOY7lbSHbfINQp/EKDNO4jZvyg==} + react-server-dom-webpack@0.0.0-experimental-778e1ed2-20240926: + resolution: {integrity: sha512-qqPkrskmgUQnj9ZNIDKCsrHTSPN3rRtZSCVdCVFU+HF+lPlwqsqcTVJaoHnRn/JlJIzWMfU+OAXmHRdGXmbUww==} engines: {node: '>=0.10.0'} peerDependencies: - react: 19.0.0-rc-5d19e1c8-20240923 - react-dom: 19.0.0-rc-5d19e1c8-20240923 + react: 19.0.0-rc-778e1ed2-20240926 + react-dom: 19.0.0-rc-778e1ed2-20240926 webpack: 5.90.0 - react-server-dom-webpack@19.0.0-rc-5d19e1c8-20240923: - resolution: {integrity: sha512-hGkbo+YFRNoqw9d/xV3FTHmI2rljBDEsr6z3mI1sH8q4DrUI3gkfPt3lxgy2PwXQtXkEit3Ko72o91gcdIntAg==} + react-server-dom-webpack@19.0.0-rc-778e1ed2-20240926: + resolution: {integrity: sha512-5vBLKb9B2EUi0kqrF0SMu3wwEPwOchyxgsQg0M6EouIW7bE/PX8uV2VWmXzd3+Zm/4TKeGzCsaMPAi8qyBIk7A==} engines: {node: '>=0.10.0'} peerDependencies: - react: 19.0.0-rc-5d19e1c8-20240923 - react-dom: 19.0.0-rc-5d19e1c8-20240923 + react: 19.0.0-rc-778e1ed2-20240926 + react-dom: 19.0.0-rc-778e1ed2-20240926 webpack: 5.90.0 react-shallow-renderer@16.15.0: resolution: {integrity: sha512-oScf2FqQ9LFVQgA73vr86xl2NaOIX73rh+YFqcOp68CWj56tSfgtGKrEbyhCj0rSijyG9M1CYprTh39fBi5hzA==} peerDependencies: - react: 19.0.0-rc-5d19e1c8-20240923 + react: 19.0.0-rc-778e1ed2-20240926 react-ssr-prepass@1.0.8: resolution: {integrity: sha512-O0gfRA1SaK+9ITKxqfnXsej2jF+OHGP/+GxD4unROQaM/0/UczGF9fuF+wTboxaQoKdIf4FvS3h/OigWh704VA==} peerDependencies: - react: 19.0.0-rc-5d19e1c8-20240923 - react-is: 19.0.0-rc-5d19e1c8-20240923 + react: 19.0.0-rc-778e1ed2-20240926 + react-is: 19.0.0-rc-778e1ed2-20240926 react-style-singleton@2.2.1: resolution: {integrity: sha512-ZWj0fHEMyWkHzKYUr2Bs/4zU6XLmq9HsgBURm7g5pAVfyn49DgUiNgY2d4lXRlYSiCif9YBGpQleewkcqddc7g==} engines: {node: '>=10'} peerDependencies: '@types/react': npm:types-react@19.0.0-rc.0 - react: 19.0.0-rc-5d19e1c8-20240923 + react: 19.0.0-rc-778e1ed2-20240926 peerDependenciesMeta: '@types/react': optional: true @@ -12678,30 +12678,30 @@ packages: react-test-renderer@18.2.0: resolution: {integrity: sha512-JWD+aQ0lh2gvh4NM3bBM42Kx+XybOxCpgYK7F8ugAlpaTSnWsX+39Z4XkOykGZAHrjwwTZT3x3KxswVWxHPUqA==} peerDependencies: - react: 19.0.0-rc-5d19e1c8-20240923 + react: 19.0.0-rc-778e1ed2-20240926 react-textarea-autosize@8.5.3: resolution: {integrity: sha512-XT1024o2pqCuZSuBt9FwHlaDeNtVrtCXu0Rnz88t1jUGheCLa3PhjE1GH8Ctm2axEtvdCl5SUHYschyQ0L5QHQ==} engines: {node: '>=10'} peerDependencies: - react: 19.0.0-rc-5d19e1c8-20240923 + react: 19.0.0-rc-778e1ed2-20240926 react-virtualized@9.22.3: resolution: {integrity: sha512-MKovKMxWTcwPSxE1kK1HcheQTWfuCxAuBoSTf2gwyMM21NdX/PXUhnoP8Uc5dRKd+nKm8v41R36OellhdCpkrw==} peerDependencies: - react: 19.0.0-rc-5d19e1c8-20240923 - react-dom: 19.0.0-rc-5d19e1c8-20240923 + react: 19.0.0-rc-778e1ed2-20240926 + react-dom: 19.0.0-rc-778e1ed2-20240926 - react@0.0.0-experimental-5d19e1c8-20240923: - resolution: {integrity: sha512-Gj4QEoaMrdPspWXPXnExlgYEkBFuui6xYW81tswLnguthYhVzR8L8PZ8cppTQqQsklNPoWKWcWNh7YBaLTLoUg==} + react@0.0.0-experimental-778e1ed2-20240926: + resolution: {integrity: sha512-TaWvaisD/bM/tYZmVQNAWS23jS4I2CsBRgEIwF7ByMLotebJMQ+38KnDLDVv28QLesHgErHaJuYKo3/472B/cg==} engines: {node: '>=0.10.0'} react@17.0.2: resolution: {integrity: sha512-gnhPt75i/dq/z3/6q/0asP78D0u592D5L1pd7M8P+dck6Fu/jJeL6iVVK23fptSUZj8Vjf++7wXA8UNclGQcbA==} engines: {node: '>=0.10.0'} - react@19.0.0-rc-5d19e1c8-20240923: - resolution: {integrity: sha512-ZmgGzqPoYKevfJa+BThu1qkvDFFAVYQIbG9oPvAbNk1/4A+wJqplwDT1rhbRZmxV8n67oawoZkf5xAup99cyUA==} + react@19.0.0-rc-778e1ed2-20240926: + resolution: {integrity: sha512-Z0qJs/iVQ+tHmnTa+4jK9kx+GEwDj5GmbqX26CQE6RPx2RCHzpls/o/UeN6IC8xCZL5hQiLcF5dtq3cWo7F8Fg==} engines: {node: '>=0.10.0'} react@19.0.0-rc-f90a6bcc-20240827: @@ -13226,11 +13226,11 @@ packages: resolution: {integrity: sha512-xAg7SOnEhrm5zI3puOOKyy1OMcMlIJZYNJY7xLBwSze0UjhPLnWfj2GF2EpT0jmzaJKIWKHLsaSSajf35bcYnA==} engines: {node: '>=v12.22.7'} - scheduler@0.0.0-experimental-5d19e1c8-20240923: - resolution: {integrity: sha512-U4lYFxZO7Xm9vrcKhVs/tIV1ea8qQyDAwGOYBRY6y5Ki6NJu012riisAQS7WRb/fsENb0hwjbfgjvpxPNMEELQ==} + scheduler@0.0.0-experimental-778e1ed2-20240926: + resolution: {integrity: sha512-7Rk2AmqBVtnTO3RERI6vxZ/LMtm50MmKCpzIQzAr97dqlXU3HjWlSCa4uADyxTdDBS76GINyw9ZSYKD1slQtig==} - scheduler@0.25.0-rc-5d19e1c8-20240923: - resolution: {integrity: sha512-lyXuqeq6jwl7PPmOBJcqrfbm5qczKdgDTdIc0JYq6nJq0CATvNBSP95s+8TqPwcesmE3t+0jh9W1w6WOAtR7Aw==} + scheduler@0.25.0-rc-778e1ed2-20240926: + resolution: {integrity: sha512-X3XrKE/18iWn/pG0QA9WEx7P1ohOzrddY5Jv8V7tC3U1+mO/eQTn7OjemdWAJ+BOyhbeYZxye5BIOq6Auvo67A==} schema-utils@2.7.1: resolution: {integrity: sha512-SHiNtMOUGWBQJwzISiVYKu82GiV4QYGePp3odlY1tuKO7gPtphAT5R/py0fA6xtbgLL/RvtJZnU9b8s0F1q0Xg==} @@ -13795,8 +13795,8 @@ packages: engines: {node: '>= 16'} peerDependencies: babel-plugin-styled-components: '>= 2' - react: 19.0.0-rc-5d19e1c8-20240923 - react-dom: 19.0.0-rc-5d19e1c8-20240923 + react: 19.0.0-rc-778e1ed2-20240926 + react-dom: 19.0.0-rc-778e1ed2-20240926 peerDependenciesMeta: babel-plugin-styled-components: optional: true @@ -13810,7 +13810,7 @@ packages: peerDependencies: '@babel/core': '*' babel-plugin-macros: '*' - react: 19.0.0-rc-5d19e1c8-20240923 + react: 19.0.0-rc-778e1ed2-20240926 peerDependenciesMeta: '@babel/core': optional: true @@ -13887,7 +13887,7 @@ packages: swr@2.2.4: resolution: {integrity: sha512-njiZ/4RiIhoOlAaLYDqwz5qH/KZXVilRLvomrx83HjzCWTfa+InyfAjv05PSFxnmLzZkNO9ZfvgoqzAaEI4sGQ==} peerDependencies: - react: 19.0.0-rc-5d19e1c8-20240923 + react: 19.0.0-rc-778e1ed2-20240926 symbol-observable@1.0.1: resolution: {integrity: sha512-Kb3PrPYz4HanVF1LVGuAdW6LoVgIwjUYJGzFe7NDrBLCN4lsV/5J0MFurV+ygS4bRVwrCEt2c7MQ1R2a72oJDw==} @@ -14628,7 +14628,7 @@ packages: engines: {node: '>=10'} peerDependencies: '@types/react': npm:types-react@19.0.0-rc.0 - react: 19.0.0-rc-5d19e1c8-20240923 + react: 19.0.0-rc-778e1ed2-20240926 peerDependenciesMeta: '@types/react': optional: true @@ -14636,13 +14636,13 @@ packages: use-composed-ref@1.3.0: resolution: {integrity: sha512-GLMG0Jc/jiKov/3Ulid1wbv3r54K9HlMW29IWcDFPEqFkSO2nS0MuefWgMJpeHQ9YJeXDL3ZUF+P3jdXlZX/cQ==} peerDependencies: - react: 19.0.0-rc-5d19e1c8-20240923 + react: 19.0.0-rc-778e1ed2-20240926 use-isomorphic-layout-effect@1.1.2: resolution: {integrity: sha512-49L8yCO3iGT/ZF9QttjwLF/ZD9Iwto5LnH5LmEdk/6cFmXddqi2ulF0edxTwjj+7mqvpVVGQWvbXZdn32wRSHA==} peerDependencies: '@types/react': '*' - react: 19.0.0-rc-5d19e1c8-20240923 + react: 19.0.0-rc-778e1ed2-20240926 peerDependenciesMeta: '@types/react': optional: true @@ -14651,7 +14651,7 @@ packages: resolution: {integrity: sha512-xA+AVm/Wlg3e2P/JiItTziwS7FK92LWrDB0p+hgXloIMuVCeJJ8v6f0eeHyPZaJrM+usM1FkFfbNCrJGs8A/zw==} peerDependencies: '@types/react': '*' - react: 19.0.0-rc-5d19e1c8-20240923 + react: 19.0.0-rc-778e1ed2-20240926 peerDependenciesMeta: '@types/react': optional: true @@ -14661,7 +14661,7 @@ packages: engines: {node: '>=10'} peerDependencies: '@types/react': npm:types-react@19.0.0-rc.0 - react: 19.0.0-rc-5d19e1c8-20240923 + react: 19.0.0-rc-778e1ed2-20240926 peerDependenciesMeta: '@types/react': optional: true @@ -14669,7 +14669,7 @@ packages: use-sync-external-store@1.2.0: resolution: {integrity: sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA==} peerDependencies: - react: 19.0.0-rc-5d19e1c8-20240923 + react: 19.0.0-rc-778e1ed2-20240926 util-deprecate@1.0.2: resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} @@ -17194,17 +17194,17 @@ snapshots: '@emotion/memoize@0.8.1': {} - '@emotion/react@11.11.1(react@19.0.0-rc-5d19e1c8-20240923)(types-react@19.0.0-rc.0)': + '@emotion/react@11.11.1(react@19.0.0-rc-778e1ed2-20240926)(types-react@19.0.0-rc.0)': dependencies: '@babel/runtime': 7.22.5 '@emotion/babel-plugin': 11.11.0 '@emotion/cache': 11.11.0 '@emotion/serialize': 1.1.2 - '@emotion/use-insertion-effect-with-fallbacks': 1.0.1(react@19.0.0-rc-5d19e1c8-20240923) + '@emotion/use-insertion-effect-with-fallbacks': 1.0.1(react@19.0.0-rc-778e1ed2-20240926) '@emotion/utils': 1.2.1 '@emotion/weak-memoize': 0.3.1 hoist-non-react-statics: 3.3.2 - react: 19.0.0-rc-5d19e1c8-20240923 + react: 19.0.0-rc-778e1ed2-20240926 optionalDependencies: '@types/react': types-react@19.0.0-rc.0 transitivePeerDependencies: @@ -17222,9 +17222,9 @@ snapshots: '@emotion/unitless@0.8.1': {} - '@emotion/use-insertion-effect-with-fallbacks@1.0.1(react@19.0.0-rc-5d19e1c8-20240923)': + '@emotion/use-insertion-effect-with-fallbacks@1.0.1(react@19.0.0-rc-778e1ed2-20240926)': dependencies: - react: 19.0.0-rc-5d19e1c8-20240923 + react: 19.0.0-rc-778e1ed2-20240926 '@emotion/utils@1.2.1': {} @@ -18584,11 +18584,11 @@ snapshots: transitivePeerDependencies: - supports-color - '@mdx-js/react@2.2.1(react@19.0.0-rc-5d19e1c8-20240923)': + '@mdx-js/react@2.2.1(react@19.0.0-rc-778e1ed2-20240926)': dependencies: '@types/mdx': 2.0.3 '@types/react': types-react@19.0.0-rc.0 - react: 19.0.0-rc-5d19e1c8-20240923 + react: 19.0.0-rc-778e1ed2-20240926 '@mdx-js/react@2.2.1(react@19.0.0-rc-f90a6bcc-20240827)': dependencies: @@ -19409,13 +19409,13 @@ snapshots: '@types/jest': 29.5.5 jest: 29.7.0(@types/node@20.12.3)(babel-plugin-macros@3.1.0) - '@testing-library/react@15.0.7(react-dom@19.0.0-rc-5d19e1c8-20240923(react@19.0.0-rc-5d19e1c8-20240923))(react@19.0.0-rc-5d19e1c8-20240923)(types-react@19.0.0-rc.0)': + '@testing-library/react@15.0.7(react-dom@19.0.0-rc-778e1ed2-20240926(react@19.0.0-rc-778e1ed2-20240926))(react@19.0.0-rc-778e1ed2-20240926)(types-react@19.0.0-rc.0)': dependencies: '@babel/runtime': 7.22.5 '@testing-library/dom': 10.1.0 '@types/react-dom': types-react-dom@19.0.0-rc.0 - react: 19.0.0-rc-5d19e1c8-20240923 - react-dom: 19.0.0-rc-5d19e1c8-20240923(react@19.0.0-rc-5d19e1c8-20240923) + react: 19.0.0-rc-778e1ed2-20240926 + react-dom: 19.0.0-rc-778e1ed2-20240926(react@19.0.0-rc-778e1ed2-20240926) optionalDependencies: '@types/react': types-react@19.0.0-rc.0 @@ -24360,7 +24360,7 @@ snapshots: hoist-non-react-statics@3.3.2: dependencies: - react-is: 19.0.0-rc-5d19e1c8-20240923 + react-is: 19.0.0-rc-778e1ed2-20240926 homedir-polyfill@1.0.3: dependencies: @@ -28716,25 +28716,25 @@ snapshots: '@jest/types': 24.9.0 ansi-regex: 4.1.0 ansi-styles: 3.2.1 - react-is: 19.0.0-rc-5d19e1c8-20240923 + react-is: 19.0.0-rc-778e1ed2-20240926 pretty-format@27.5.1: dependencies: ansi-regex: 5.0.1 ansi-styles: 5.2.0 - react-is: 19.0.0-rc-5d19e1c8-20240923 + react-is: 19.0.0-rc-778e1ed2-20240926 pretty-format@29.5.0: dependencies: '@jest/schemas': 29.4.3 ansi-styles: 5.2.0 - react-is: 19.0.0-rc-5d19e1c8-20240923 + react-is: 19.0.0-rc-778e1ed2-20240926 pretty-format@29.7.0: dependencies: '@jest/schemas': 29.6.3 ansi-styles: 5.2.0 - react-is: 19.0.0-rc-5d19e1c8-20240923 + react-is: 19.0.0-rc-778e1ed2-20240926 pretty-ms@7.0.0: dependencies: @@ -28791,7 +28791,7 @@ snapshots: dependencies: loose-envify: 1.4.0 object-assign: 4.1.1 - react-is: 19.0.0-rc-5d19e1c8-20240923 + react-is: 19.0.0-rc-778e1ed2-20240926 property-information@5.6.0: dependencies: @@ -28965,29 +28965,29 @@ snapshots: minimist: 1.2.8 strip-json-comments: 2.0.1 - react-dom@0.0.0-experimental-5d19e1c8-20240923(react@19.0.0-rc-5d19e1c8-20240923): + react-dom@0.0.0-experimental-778e1ed2-20240926(react@19.0.0-rc-778e1ed2-20240926): dependencies: - react: 19.0.0-rc-5d19e1c8-20240923 - scheduler: 0.25.0-rc-5d19e1c8-20240923 + react: 19.0.0-rc-778e1ed2-20240926 + scheduler: 0.25.0-rc-778e1ed2-20240926 - react-dom@17.0.2(react@19.0.0-rc-5d19e1c8-20240923): + react-dom@17.0.2(react@19.0.0-rc-778e1ed2-20240926): dependencies: loose-envify: 1.4.0 object-assign: 4.1.1 - react: 19.0.0-rc-5d19e1c8-20240923 - scheduler: 0.25.0-rc-5d19e1c8-20240923 + react: 19.0.0-rc-778e1ed2-20240926 + scheduler: 0.25.0-rc-778e1ed2-20240926 - react-dom@19.0.0-rc-5d19e1c8-20240923(react@19.0.0-rc-5d19e1c8-20240923): + react-dom@19.0.0-rc-778e1ed2-20240926(react@19.0.0-rc-778e1ed2-20240926): dependencies: - react: 19.0.0-rc-5d19e1c8-20240923 - scheduler: 0.25.0-rc-5d19e1c8-20240923 + react: 19.0.0-rc-778e1ed2-20240926 + scheduler: 0.25.0-rc-778e1ed2-20240926 react-dom@19.0.0-rc-f90a6bcc-20240827(react@19.0.0-rc-f90a6bcc-20240827): dependencies: react: 19.0.0-rc-f90a6bcc-20240827 - scheduler: 0.25.0-rc-5d19e1c8-20240923 + scheduler: 0.25.0-rc-778e1ed2-20240926 - react-is@19.0.0-rc-5d19e1c8-20240923: {} + react-is@19.0.0-rc-778e1ed2-20240926: {} react-is@19.0.0-rc-f90a6bcc-20240827: {} @@ -29020,48 +29020,48 @@ snapshots: optionalDependencies: '@types/react': types-react@19.0.0-rc.0 - react-server-dom-turbopack@0.0.0-experimental-5d19e1c8-20240923(react-dom@19.0.0-rc-5d19e1c8-20240923(react@19.0.0-rc-5d19e1c8-20240923))(react@19.0.0-rc-5d19e1c8-20240923): + react-server-dom-turbopack@0.0.0-experimental-778e1ed2-20240926(react-dom@19.0.0-rc-778e1ed2-20240926(react@19.0.0-rc-778e1ed2-20240926))(react@19.0.0-rc-778e1ed2-20240926): dependencies: acorn-loose: 8.3.0 neo-async: 2.6.1 - react: 19.0.0-rc-5d19e1c8-20240923 - react-dom: 19.0.0-rc-5d19e1c8-20240923(react@19.0.0-rc-5d19e1c8-20240923) + react: 19.0.0-rc-778e1ed2-20240926 + react-dom: 19.0.0-rc-778e1ed2-20240926(react@19.0.0-rc-778e1ed2-20240926) - react-server-dom-turbopack@19.0.0-rc-5d19e1c8-20240923(react-dom@19.0.0-rc-5d19e1c8-20240923(react@19.0.0-rc-5d19e1c8-20240923))(react@19.0.0-rc-5d19e1c8-20240923): + react-server-dom-turbopack@19.0.0-rc-778e1ed2-20240926(react-dom@19.0.0-rc-778e1ed2-20240926(react@19.0.0-rc-778e1ed2-20240926))(react@19.0.0-rc-778e1ed2-20240926): dependencies: acorn-loose: 8.3.0 neo-async: 2.6.1 - react: 19.0.0-rc-5d19e1c8-20240923 - react-dom: 19.0.0-rc-5d19e1c8-20240923(react@19.0.0-rc-5d19e1c8-20240923) + react: 19.0.0-rc-778e1ed2-20240926 + react-dom: 19.0.0-rc-778e1ed2-20240926(react@19.0.0-rc-778e1ed2-20240926) - react-server-dom-webpack@0.0.0-experimental-5d19e1c8-20240923(react-dom@19.0.0-rc-5d19e1c8-20240923(react@19.0.0-rc-5d19e1c8-20240923))(react@19.0.0-rc-5d19e1c8-20240923)(webpack@5.90.0(@swc/core@1.6.13(@swc/helpers@0.5.13))): + react-server-dom-webpack@0.0.0-experimental-778e1ed2-20240926(react-dom@19.0.0-rc-778e1ed2-20240926(react@19.0.0-rc-778e1ed2-20240926))(react@19.0.0-rc-778e1ed2-20240926)(webpack@5.90.0(@swc/core@1.6.13(@swc/helpers@0.5.13))): dependencies: acorn-loose: 8.3.0 neo-async: 2.6.1 - react: 19.0.0-rc-5d19e1c8-20240923 - react-dom: 19.0.0-rc-5d19e1c8-20240923(react@19.0.0-rc-5d19e1c8-20240923) + react: 19.0.0-rc-778e1ed2-20240926 + react-dom: 19.0.0-rc-778e1ed2-20240926(react@19.0.0-rc-778e1ed2-20240926) webpack: 5.90.0(@swc/core@1.6.13(@swc/helpers@0.5.13)) webpack-sources: 3.2.3(patch_hash=jbynf5dc46ambamq3wuyho6hkq) - react-server-dom-webpack@19.0.0-rc-5d19e1c8-20240923(react-dom@19.0.0-rc-5d19e1c8-20240923(react@19.0.0-rc-5d19e1c8-20240923))(react@19.0.0-rc-5d19e1c8-20240923)(webpack@5.90.0(@swc/core@1.6.13(@swc/helpers@0.5.13))): + react-server-dom-webpack@19.0.0-rc-778e1ed2-20240926(react-dom@19.0.0-rc-778e1ed2-20240926(react@19.0.0-rc-778e1ed2-20240926))(react@19.0.0-rc-778e1ed2-20240926)(webpack@5.90.0(@swc/core@1.6.13(@swc/helpers@0.5.13))): dependencies: acorn-loose: 8.3.0 neo-async: 2.6.1 - react: 19.0.0-rc-5d19e1c8-20240923 - react-dom: 19.0.0-rc-5d19e1c8-20240923(react@19.0.0-rc-5d19e1c8-20240923) + react: 19.0.0-rc-778e1ed2-20240926 + react-dom: 19.0.0-rc-778e1ed2-20240926(react@19.0.0-rc-778e1ed2-20240926) webpack: 5.90.0(@swc/core@1.6.13(@swc/helpers@0.5.13)) webpack-sources: 3.2.3(patch_hash=jbynf5dc46ambamq3wuyho6hkq) - react-shallow-renderer@16.15.0(react@19.0.0-rc-5d19e1c8-20240923): + react-shallow-renderer@16.15.0(react@19.0.0-rc-778e1ed2-20240926): dependencies: object-assign: 4.1.1 - react: 19.0.0-rc-5d19e1c8-20240923 - react-is: 19.0.0-rc-5d19e1c8-20240923 + react: 19.0.0-rc-778e1ed2-20240926 + react-is: 19.0.0-rc-778e1ed2-20240926 - react-ssr-prepass@1.0.8(react-is@19.0.0-rc-f90a6bcc-20240827)(react@19.0.0-rc-5d19e1c8-20240923): + react-ssr-prepass@1.0.8(react-is@19.0.0-rc-f90a6bcc-20240827)(react@19.0.0-rc-778e1ed2-20240926): dependencies: object-is: 1.0.2 - react: 19.0.0-rc-5d19e1c8-20240923 + react: 19.0.0-rc-778e1ed2-20240926 react-is: 19.0.0-rc-f90a6bcc-20240827 react-style-singleton@2.2.1(react@19.0.0-rc-f90a6bcc-20240827)(types-react@19.0.0-rc.0): @@ -29073,12 +29073,12 @@ snapshots: optionalDependencies: '@types/react': types-react@19.0.0-rc.0 - react-test-renderer@18.2.0(react@19.0.0-rc-5d19e1c8-20240923): + react-test-renderer@18.2.0(react@19.0.0-rc-778e1ed2-20240926): dependencies: - react: 19.0.0-rc-5d19e1c8-20240923 - react-is: 19.0.0-rc-5d19e1c8-20240923 - react-shallow-renderer: 16.15.0(react@19.0.0-rc-5d19e1c8-20240923) - scheduler: 0.25.0-rc-5d19e1c8-20240923 + react: 19.0.0-rc-778e1ed2-20240926 + react-is: 19.0.0-rc-778e1ed2-20240926 + react-shallow-renderer: 16.15.0(react@19.0.0-rc-778e1ed2-20240926) + scheduler: 0.25.0-rc-778e1ed2-20240926 react-textarea-autosize@8.5.3(react@19.0.0-rc-f90a6bcc-20240827)(types-react@19.0.0-rc.0): dependencies: @@ -29089,25 +29089,25 @@ snapshots: transitivePeerDependencies: - '@types/react' - react-virtualized@9.22.3(react-dom@19.0.0-rc-5d19e1c8-20240923(react@19.0.0-rc-5d19e1c8-20240923))(react@19.0.0-rc-5d19e1c8-20240923): + react-virtualized@9.22.3(react-dom@19.0.0-rc-778e1ed2-20240926(react@19.0.0-rc-778e1ed2-20240926))(react@19.0.0-rc-778e1ed2-20240926): dependencies: '@babel/runtime': 7.22.5 clsx: 1.1.1 dom-helpers: 5.2.1 loose-envify: 1.4.0 prop-types: 15.8.1 - react: 19.0.0-rc-5d19e1c8-20240923 - react-dom: 19.0.0-rc-5d19e1c8-20240923(react@19.0.0-rc-5d19e1c8-20240923) + react: 19.0.0-rc-778e1ed2-20240926 + react-dom: 19.0.0-rc-778e1ed2-20240926(react@19.0.0-rc-778e1ed2-20240926) react-lifecycles-compat: 3.0.4 - react@0.0.0-experimental-5d19e1c8-20240923: {} + react@0.0.0-experimental-778e1ed2-20240926: {} react@17.0.2: dependencies: loose-envify: 1.4.0 object-assign: 4.1.1 - react@19.0.0-rc-5d19e1c8-20240923: {} + react@19.0.0-rc-778e1ed2-20240926: {} react@19.0.0-rc-f90a6bcc-20240827: {} @@ -29809,9 +29809,9 @@ snapshots: dependencies: xmlchars: 2.2.0 - scheduler@0.0.0-experimental-5d19e1c8-20240923: {} + scheduler@0.0.0-experimental-778e1ed2-20240926: {} - scheduler@0.25.0-rc-5d19e1c8-20240923: {} + scheduler@0.25.0-rc-778e1ed2-20240926: {} schema-utils@2.7.1: dependencies: @@ -30448,7 +30448,7 @@ snapshots: dependencies: inline-style-parser: 0.1.1 - styled-components@6.0.0-rc.3(react-dom@19.0.0-rc-5d19e1c8-20240923(react@19.0.0-rc-5d19e1c8-20240923))(react@19.0.0-rc-5d19e1c8-20240923): + styled-components@6.0.0-rc.3(react-dom@19.0.0-rc-778e1ed2-20240926(react@19.0.0-rc-778e1ed2-20240926))(react@19.0.0-rc-778e1ed2-20240926): dependencies: '@babel/cli': 7.21.5(@babel/core@7.22.5) '@babel/core': 7.22.5 @@ -30463,8 +30463,8 @@ snapshots: '@emotion/unitless': 0.8.1 css-to-react-native: 3.2.0 postcss: 8.4.31 - react: 19.0.0-rc-5d19e1c8-20240923 - react-dom: 19.0.0-rc-5d19e1c8-20240923(react@19.0.0-rc-5d19e1c8-20240923) + react: 19.0.0-rc-778e1ed2-20240926 + react-dom: 19.0.0-rc-778e1ed2-20240926(react@19.0.0-rc-778e1ed2-20240926) shallowequal: 1.1.0 stylis: 4.2.0 tslib: 2.5.3 @@ -30476,10 +30476,10 @@ snapshots: postcss: 7.0.32 postcss-load-plugins: 2.3.0 - styled-jsx@5.1.6(@babel/core@7.22.5)(babel-plugin-macros@3.1.0)(react@19.0.0-rc-5d19e1c8-20240923): + styled-jsx@5.1.6(@babel/core@7.22.5)(babel-plugin-macros@3.1.0)(react@19.0.0-rc-778e1ed2-20240926): dependencies: client-only: 0.0.1 - react: 19.0.0-rc-5d19e1c8-20240923 + react: 19.0.0-rc-778e1ed2-20240926 optionalDependencies: '@babel/core': 7.22.5 babel-plugin-macros: 3.1.0 @@ -30569,11 +30569,11 @@ snapshots: picocolors: 1.0.1 stable: 0.1.8 - swr@2.2.4(react@19.0.0-rc-5d19e1c8-20240923): + swr@2.2.4(react@19.0.0-rc-778e1ed2-20240926): dependencies: client-only: 0.0.1 - react: 19.0.0-rc-5d19e1c8-20240923 - use-sync-external-store: 1.2.0(react@19.0.0-rc-5d19e1c8-20240923) + react: 19.0.0-rc-778e1ed2-20240926 + use-sync-external-store: 1.2.0(react@19.0.0-rc-778e1ed2-20240926) symbol-observable@1.0.1: {} @@ -31275,9 +31275,9 @@ snapshots: unist-util-is: 5.2.0 unist-util-visit-parents: 5.1.3 - unistore@3.4.1(react@19.0.0-rc-5d19e1c8-20240923): + unistore@3.4.1(react@19.0.0-rc-778e1ed2-20240926): optionalDependencies: - react: 19.0.0-rc-5d19e1c8-20240923 + react: 19.0.0-rc-778e1ed2-20240926 universal-github-app-jwt@1.1.1: dependencies: @@ -31395,9 +31395,9 @@ snapshots: optionalDependencies: '@types/react': types-react@19.0.0-rc.0 - use-sync-external-store@1.2.0(react@19.0.0-rc-5d19e1c8-20240923): + use-sync-external-store@1.2.0(react@19.0.0-rc-778e1ed2-20240926): dependencies: - react: 19.0.0-rc-5d19e1c8-20240923 + react: 19.0.0-rc-778e1ed2-20240926 util-deprecate@1.0.2: {} diff --git a/run-tests.js b/run-tests.js index 8a0e6cebb18ec..1c0055d119442 100644 --- a/run-tests.js +++ b/run-tests.js @@ -20,7 +20,7 @@ const { getTestFilter } = require('./test/get-test-filter') // Do not rename or format. sync-react script relies on this line. // prettier-ignore -const nextjsReactPeerVersion = "19.0.0-rc-5d19e1c8-20240923"; +const nextjsReactPeerVersion = "19.0.0-rc-778e1ed2-20240926"; let argv = require('yargs/yargs')(process.argv.slice(2)) .string('type') diff --git a/test/.stats-app/package.json b/test/.stats-app/package.json index f3cbdc2a012f0..bb008c9437928 100644 --- a/test/.stats-app/package.json +++ b/test/.stats-app/package.json @@ -4,8 +4,8 @@ "license": "MIT", "dependencies": { "next": "latest", - "react": "19.0.0-rc-5d19e1c8-20240923", - "react-dom": "19.0.0-rc-5d19e1c8-20240923" + "react": "19.0.0-rc-778e1ed2-20240926", + "react-dom": "19.0.0-rc-778e1ed2-20240926" }, "engines": { "node": ">=18.18.0" diff --git a/test/e2e/next-test/first-time-setup-js/package.json b/test/e2e/next-test/first-time-setup-js/package.json index 25ab27fa9618d..73983616a0de7 100644 --- a/test/e2e/next-test/first-time-setup-js/package.json +++ b/test/e2e/next-test/first-time-setup-js/package.json @@ -8,7 +8,7 @@ }, "dependencies": { "next": "canary", - "react": "19.0.0-rc-5d19e1c8-20240923", - "react-dom": "19.0.0-rc-5d19e1c8-20240923" + "react": "19.0.0-rc-778e1ed2-20240926", + "react-dom": "19.0.0-rc-778e1ed2-20240926" } } diff --git a/test/e2e/next-test/first-time-setup-ts/package.json b/test/e2e/next-test/first-time-setup-ts/package.json index 216b01d931d3f..f030bcd58f9d2 100644 --- a/test/e2e/next-test/first-time-setup-ts/package.json +++ b/test/e2e/next-test/first-time-setup-ts/package.json @@ -8,8 +8,8 @@ }, "dependencies": { "next": "canary", - "react": "19.0.0-rc-5d19e1c8-20240923", - "react-dom": "19.0.0-rc-5d19e1c8-20240923" + "react": "19.0.0-rc-778e1ed2-20240926", + "react-dom": "19.0.0-rc-778e1ed2-20240926" }, "devDependencies": { "@types/react": "^18", diff --git a/test/lib/next-modes/base.ts b/test/lib/next-modes/base.ts index 3097edea97ef6..798214f398c40 100644 --- a/test/lib/next-modes/base.ts +++ b/test/lib/next-modes/base.ts @@ -51,7 +51,7 @@ type OmitFirstArgument = F extends ( // Do not rename or format. sync-react script relies on this line. // prettier-ignore -const nextjsReactPeerVersion = "19.0.0-rc-5d19e1c8-20240923"; +const nextjsReactPeerVersion = "19.0.0-rc-778e1ed2-20240926"; export class NextInstance { protected files: FileRef | { [filename: string]: string | FileRef } From e1ea01defe0618b2e83a4040454b579851d69a0d Mon Sep 17 00:00:00 2001 From: Benjamin Woodruff Date: Thu, 26 Sep 2024 06:35:07 -0700 Subject: [PATCH 10/13] codemod(turbopack): Remove unused `Result<...>` return types from `#[turbo_task::function]`s (#70492) The `#[turbo_tasks::function]` macro always exposes a `impl Future>>`, regardless of the function's actual return type. We only need to use a `Result<...>` return type when the function can fail. If it's infallible, this just adds noise. I left a bunch of these behind in #70412, plus I think we had a lot of these independent of that PR. This cleans them up. ```yaml language: rust id: remove_unused_result_return_type utils: last-expression-inside-block: any: - inside: # single-line blocks just have the expression as the only child kind: block nthChild: position: 1 reverse: true - inside: # multi-line blocks wrap their final expression in an expression_statement kind: expression_statement inside: kind: block nthChild: position: 1 reverse: true ok-expression: kind: call_expression any: - pattern: Ok($_ARG) - pattern: $$$::Ok($_ARG) ok-expression-capturing: kind: call_expression any: - pattern: Ok($ARG) - pattern: $$$::Ok($ARG) # ast-grep does not appear to allow utils to be recursive, split out "simple blocks", and limit supported nesting simple-block-with-implicit-ok-return: kind: block has: nthChild: position: 1 reverse: true matches: ok-expression simple-expression-ok-value: any: - matches: simple-block-with-implicit-ok-return - kind: if_expression all: - has: field: consequence matches: simple-block-with-implicit-ok-return - has: field: alternative has: matches: simple-block-with-implicit-ok-return - kind: match_expression has: field: body not: has: kind: match_arm has: field: value not: any: - matches: ok-expression - matches: simple-block-with-implicit-ok-return block-with-implicit-ok-return: any: - matches: simple-block-with-implicit-ok-return - kind: block has: nthChild: position: 1 reverse: true any: - kind: expression_statement has: matches: simple-expression-ok-value - matches: simple-expression-ok-value # single-line blocks don't result-return-type: pattern: context: fn func() -> Result<$INNER_RET_TY> {} selector: generic_type infallible-fn: # this function only appears to return `Ok(...)`, it does not use try_expression (`?`) or `anyhow::bail!(...)` kind: function_item not: has: field: body any: - not: matches: block-with-implicit-ok-return - has: stopBy: kind: function_item any: - kind: try_expression - pattern: "?" inside: kind: macro_invocation stopBy: end - pattern: bail!($$$) - pattern: $$$::bail!($$$) - kind: return_expression not: has: matches: ok-expression rule: all: - pattern: $FUNC - kind: function_item has: field: return_type matches: result-return-type follows: pattern: context: | #[turbo_tasks::function] selector: attribute_item stopBy: not: kind: attribute_item - matches: infallible-fn rewriters: # this rewriter is far from perfect, and might rewrite too much - id: rewrite-return-type rule: matches: result-return-type inside: kind: function_item field: return_type fix: $INNER_RET_TY - id: unwrap-ok-values rule: all: - matches: ok-expression-capturing - any: - matches: last-expression-inside-block - inside: kind: return_expression - inside: kind: match_arm fix: $ARG transform: NEW_FUNC: rewrite: rewriters: - rewrite-return-type - unwrap-ok-values source: $FUNC fix: $NEW_FUNC ignores: - "**/turbo-tasks-testing/**" - "**/turbo-tasks-memory/tests/**" ``` ``` sg scan -U -r ../codemod_remove_unused_result_return_type.yml && cargo fix --lib --allow-dirty && cargo fmt ``` I used `cargo fix` in this case to auto-remove the now-unused `anyhow::Result` imports. I manually fixed clippy lints that now violated the `let_and_return` lint rule (using a separate commit inside this PR), as `cargo clippy --fix` seemed to hang when processing our `build.rs` files? --- crates/next-api/src/app.rs | 101 ++++++++-------- .../next-api/src/global_module_id_strategy.rs | 6 +- crates/next-api/src/instrumentation.rs | 6 +- crates/next-api/src/middleware.rs | 11 +- crates/next-api/src/pages.rs | 84 +++++++------- crates/next-api/src/project.rs | 56 +++++---- crates/next-api/src/versioned_content_map.rs | 8 +- crates/next-core/src/app_structure.rs | 8 +- crates/next-core/src/bootstrap.rs | 6 +- crates/next-core/src/hmr_entry.rs | 4 +- .../src/next_app/include_modules_module.rs | 10 +- crates/next-core/src/next_build.rs | 8 +- .../ecmascript_client_reference_module.rs | 4 +- crates/next-core/src/next_config.rs | 108 +++++++++--------- crates/next-core/src/next_edge/entry.rs | 8 +- .../next-core/src/next_font/google/options.rs | 4 +- crates/next-core/src/next_font/local/mod.rs | 4 +- .../next-core/src/next_font/local/options.rs | 4 +- crates/next-core/src/next_image/module.rs | 8 +- crates/next-core/src/next_pages/page_entry.rs | 7 +- .../next-core/src/next_route_matcher/mod.rs | 4 +- crates/next-core/src/next_server/resolve.rs | 6 +- .../server_component_module.rs | 10 +- crates/next-core/src/next_shared/resolve.rs | 6 +- .../transforms/next_page_static_info.rs | 6 +- crates/next-core/src/pages_structure.rs | 10 +- turbopack/crates/node-file-trace/src/lib.rs | 6 +- .../crates/turbo-tasks-env/src/dotenv.rs | 10 +- turbopack/crates/turbo-tasks-env/src/lib.rs | 4 +- .../crates/turbo-tasks-fs/src/embed/file.rs | 4 +- turbopack/crates/turbo-tasks-fs/src/lib.rs | 24 ++-- .../turbopack-browser/src/chunking_context.rs | 4 +- .../turbopack-browser/src/ecmascript/chunk.rs | 4 +- .../src/ecmascript/content.rs | 10 +- .../src/ecmascript/evaluate/chunk.rs | 11 +- .../src/ecmascript/list/asset.rs | 8 +- .../src/ecmascript/runtime.rs | 4 +- .../crates/turbopack-cli/src/contexts.rs | 4 +- turbopack/crates/turbopack-cli/src/dev/mod.rs | 8 +- .../crates/turbopack-core/src/chunk/data.rs | 4 +- .../crates/turbopack-core/src/code_builder.rs | 4 +- .../turbopack-core/src/compile_time_info.rs | 5 +- .../crates/turbopack-core/src/environment.rs | 54 ++++----- .../crates/turbopack-core/src/issue/mod.rs | 8 +- .../turbopack-core/src/reference/mod.rs | 8 +- .../crates/turbopack-core/src/resolve/mod.rs | 44 ++++--- .../src/source_map/source_map_asset.rs | 6 +- .../turbopack-core/src/source_transform.rs | 8 +- .../crates/turbopack-core/src/version.rs | 8 +- turbopack/crates/turbopack-css/src/asset.rs | 12 +- .../src/chunk/single_item_chunk/chunk.rs | 6 +- .../src/chunk/single_item_chunk/source_map.rs | 6 +- .../turbopack-css/src/chunk/source_map.rs | 6 +- .../crates/turbopack-css/src/module_asset.rs | 29 ++--- .../crates/turbopack-dev-server/src/html.rs | 4 +- .../src/source/conditional.rs | 6 +- .../turbopack-dev-server/src/source/router.rs | 6 +- .../turbopack-dev-server/src/update/stream.rs | 4 +- .../transform/swc_ecma_transform_plugins.rs | 8 +- .../src/async_chunk/module.rs | 6 +- .../turbopack-ecmascript/src/chunk/mod.rs | 10 +- .../src/chunk_group_files_asset.rs | 4 +- .../crates/turbopack-ecmascript/src/lib.rs | 22 ++-- .../src/manifest/chunk_asset.rs | 13 +-- .../src/manifest/chunk_item.rs | 7 +- .../src/manifest/loader_item.rs | 11 +- .../src/references/async_module.rs | 8 +- .../src/references/external_module.rs | 12 +- .../src/references/require_context.rs | 10 +- .../src/references/typescript.rs | 12 +- .../facade/chunk_item.rs | 4 +- .../side_effect_optimization/facade/module.rs | 14 +-- .../locals/chunk_item.rs | 4 +- .../side_effect_optimization/locals/module.rs | 10 +- .../src/tree_shake/asset.rs | 37 +++--- .../src/tree_shake/chunk_item.rs | 4 +- .../turbopack-ecmascript/src/webpack/mod.rs | 8 +- .../src/worker_chunk/chunk_item.rs | 4 +- .../src/worker_chunk/module.rs | 6 +- turbopack/crates/turbopack-json/src/lib.rs | 6 +- .../turbopack-node/src/execution_context.rs | 13 +-- turbopack/crates/turbopack-node/src/lib.rs | 6 +- .../crates/turbopack-node/src/render/issue.rs | 5 +- .../src/render/node_api_source.rs | 10 +- .../src/render/rendered_source.rs | 10 +- .../turbopack-node/src/transforms/postcss.rs | 12 +- .../turbopack-node/src/transforms/webpack.rs | 4 +- .../turbopack-nodejs/src/chunking_context.rs | 4 +- .../src/ecmascript/node/chunk.rs | 4 +- .../src/ecmascript/node/content.rs | 6 +- .../src/ecmascript/node/entry/chunk.rs | 8 +- .../src/ecmascript/node/entry/runtime.rs | 4 +- .../turbopack-resolve/src/typescript.rs | 7 +- .../crates/turbopack-static/src/fixed.rs | 5 +- turbopack/crates/turbopack-static/src/lib.rs | 13 +-- turbopack/crates/turbopack-wasm/src/loader.rs | 8 +- .../crates/turbopack-wasm/src/module_asset.rs | 10 +- .../crates/turbopack-wasm/src/output_asset.rs | 5 +- turbopack/crates/turbopack-wasm/src/raw.rs | 6 +- turbopack/crates/turbopack/src/lib.rs | 8 +- .../turbopack/src/module_options/mod.rs | 8 +- .../src/transition/context_transition.rs | 7 +- .../src/transition/full_context_transition.rs | 5 +- 103 files changed, 571 insertions(+), 643 deletions(-) diff --git a/crates/next-api/src/app.rs b/crates/next-api/src/app.rs index 15f9446b177a1..8cafb6bb7dd9b 100644 --- a/crates/next-api/src/app.rs +++ b/crates/next-api/src/app.rs @@ -152,26 +152,26 @@ impl AppProject { } #[turbo_tasks::function] - fn client_module_options_context(self: Vc) -> Result> { - Ok(get_client_module_options_context( + fn client_module_options_context(self: Vc) -> Vc { + get_client_module_options_context( self.project().project_path(), self.project().execution_context(), self.project().client_compile_time_info().environment(), Value::new(self.client_ty()), self.project().next_mode(), self.project().next_config(), - )) + ) } #[turbo_tasks::function] - fn client_resolve_options_context(self: Vc) -> Result> { - Ok(get_client_resolve_options_context( + fn client_resolve_options_context(self: Vc) -> Vc { + get_client_resolve_options_context( self.project().project_path(), Value::new(self.client_ty()), self.project().next_mode(), self.project().next_config(), self.project().execution_context(), - )) + ) } #[turbo_tasks::function] @@ -180,101 +180,101 @@ impl AppProject { } #[turbo_tasks::function] - fn client_transition(self: Vc) -> Result> { + fn client_transition(self: Vc) -> Vc { let module_context = self.client_module_context(); - Ok(FullContextTransition::new(module_context)) + FullContextTransition::new(module_context) } #[turbo_tasks::function] - fn rsc_module_options_context(self: Vc) -> Result> { - Ok(get_server_module_options_context( + fn rsc_module_options_context(self: Vc) -> Vc { + get_server_module_options_context( self.project().project_path(), self.project().execution_context(), Value::new(self.rsc_ty()), self.project().next_mode(), self.project().next_config(), NextRuntime::NodeJs, - )) + ) } #[turbo_tasks::function] - fn edge_rsc_module_options_context(self: Vc) -> Result> { - Ok(get_server_module_options_context( + fn edge_rsc_module_options_context(self: Vc) -> Vc { + get_server_module_options_context( self.project().project_path(), self.project().execution_context(), Value::new(self.rsc_ty()), self.project().next_mode(), self.project().next_config(), NextRuntime::Edge, - )) + ) } #[turbo_tasks::function] - fn route_module_options_context(self: Vc) -> Result> { - Ok(get_server_module_options_context( + fn route_module_options_context(self: Vc) -> Vc { + get_server_module_options_context( self.project().project_path(), self.project().execution_context(), Value::new(self.route_ty()), self.project().next_mode(), self.project().next_config(), NextRuntime::NodeJs, - )) + ) } #[turbo_tasks::function] - fn edge_route_module_options_context(self: Vc) -> Result> { - Ok(get_server_module_options_context( + fn edge_route_module_options_context(self: Vc) -> Vc { + get_server_module_options_context( self.project().project_path(), self.project().execution_context(), Value::new(self.route_ty()), self.project().next_mode(), self.project().next_config(), NextRuntime::Edge, - )) + ) } #[turbo_tasks::function] - fn rsc_resolve_options_context(self: Vc) -> Result> { - Ok(get_server_resolve_options_context( + fn rsc_resolve_options_context(self: Vc) -> Vc { + get_server_resolve_options_context( self.project().project_path(), Value::new(self.rsc_ty()), self.project().next_mode(), self.project().next_config(), self.project().execution_context(), - )) + ) } #[turbo_tasks::function] - fn edge_rsc_resolve_options_context(self: Vc) -> Result> { - Ok(get_edge_resolve_options_context( + fn edge_rsc_resolve_options_context(self: Vc) -> Vc { + get_edge_resolve_options_context( self.project().project_path(), Value::new(self.rsc_ty()), self.project().next_mode(), self.project().next_config(), self.project().execution_context(), - )) + ) } #[turbo_tasks::function] - fn route_resolve_options_context(self: Vc) -> Result> { - Ok(get_server_resolve_options_context( + fn route_resolve_options_context(self: Vc) -> Vc { + get_server_resolve_options_context( self.project().project_path(), Value::new(self.route_ty()), self.project().next_mode(), self.project().next_config(), self.project().execution_context(), - )) + ) } #[turbo_tasks::function] - fn edge_route_resolve_options_context(self: Vc) -> Result> { - Ok(get_edge_resolve_options_context( + fn edge_route_resolve_options_context(self: Vc) -> Vc { + get_edge_resolve_options_context( self.project().project_path(), Value::new(self.route_ty()), self.project().next_mode(), self.project().next_config(), self.project().execution_context(), - )) + ) } #[turbo_tasks::function] @@ -444,49 +444,49 @@ impl AppProject { } #[turbo_tasks::function] - fn ssr_module_options_context(self: Vc) -> Result> { - Ok(get_server_module_options_context( + fn ssr_module_options_context(self: Vc) -> Vc { + get_server_module_options_context( self.project().project_path(), self.project().execution_context(), Value::new(self.ssr_ty()), self.project().next_mode(), self.project().next_config(), NextRuntime::NodeJs, - )) + ) } #[turbo_tasks::function] - fn edge_ssr_module_options_context(self: Vc) -> Result> { - Ok(get_server_module_options_context( + fn edge_ssr_module_options_context(self: Vc) -> Vc { + get_server_module_options_context( self.project().project_path(), self.project().execution_context(), Value::new(self.ssr_ty()), self.project().next_mode(), self.project().next_config(), NextRuntime::Edge, - )) + ) } #[turbo_tasks::function] - fn ssr_resolve_options_context(self: Vc) -> Result> { - Ok(get_server_resolve_options_context( + fn ssr_resolve_options_context(self: Vc) -> Vc { + get_server_resolve_options_context( self.project().project_path(), Value::new(self.ssr_ty()), self.project().next_mode(), self.project().next_config(), self.project().execution_context(), - )) + ) } #[turbo_tasks::function] - fn edge_ssr_resolve_options_context(self: Vc) -> Result> { - Ok(get_edge_resolve_options_context( + fn edge_ssr_resolve_options_context(self: Vc) -> Vc { + get_edge_resolve_options_context( self.project().project_path(), Value::new(self.ssr_ty()), self.project().next_mode(), self.project().next_config(), self.project().execution_context(), - )) + ) } #[turbo_tasks::function] @@ -530,11 +530,8 @@ impl AppProject { } #[turbo_tasks::function] - fn runtime_entries(self: Vc) -> Result> { - Ok(get_server_runtime_entries( - Value::new(self.rsc_ty()), - self.project().next_mode(), - )) + fn runtime_entries(self: Vc) -> Vc { + get_server_runtime_entries(Value::new(self.rsc_ty()), self.project().next_mode()) } #[turbo_tasks::function] @@ -558,15 +555,15 @@ impl AppProject { } #[turbo_tasks::function] - fn client_runtime_entries(self: Vc) -> Result> { - Ok(get_client_runtime_entries( + fn client_runtime_entries(self: Vc) -> Vc { + get_client_runtime_entries( self.project().project_path(), Value::new(self.client_ty()), self.project().next_mode(), self.project().next_config(), self.project().execution_context(), ) - .resolve_entries(Vc::upcast(self.client_module_context()))) + .resolve_entries(Vc::upcast(self.client_module_context())) } #[turbo_tasks::function] diff --git a/crates/next-api/src/global_module_id_strategy.rs b/crates/next-api/src/global_module_id_strategy.rs index 93bc3f39cdf12..4b03bc94669c5 100644 --- a/crates/next-api/src/global_module_id_strategy.rs +++ b/crates/next-api/src/global_module_id_strategy.rs @@ -84,9 +84,7 @@ impl GlobalModuleIdStrategyBuilder { // NOTE(LichuAcu) We can't move this function to `turbopack-core` because we need access to // `Endpoint`, which is not available there. #[turbo_tasks::function] -fn preprocess_module_ids( - endpoint: Vc>, -) -> Result> { +fn preprocess_module_ids(endpoint: Vc>) -> Vc { let root_modules = endpoint.root_modules(); - Ok(children_modules_idents(root_modules)) + children_modules_idents(root_modules) } diff --git a/crates/next-api/src/instrumentation.rs b/crates/next-api/src/instrumentation.rs index 1811ac55700a7..a0ce8a84509bc 100644 --- a/crates/next-api/src/instrumentation.rs +++ b/crates/next-api/src/instrumentation.rs @@ -65,7 +65,7 @@ impl InstrumentationEndpoint { } #[turbo_tasks::function] - fn core_modules(&self) -> Result> { + fn core_modules(&self) -> Vc { let userland_module = self .asset_context .process( @@ -81,11 +81,11 @@ impl InstrumentationEndpoint { "instrumentation".into(), ); - Ok(InstrumentationCoreModules { + InstrumentationCoreModules { userland_module, edge_entry_module, } - .cell()) + .cell() } #[turbo_tasks::function] diff --git a/crates/next-api/src/middleware.rs b/crates/next-api/src/middleware.rs index f4fab591527aa..c30686f2f9de5 100644 --- a/crates/next-api/src/middleware.rs +++ b/crates/next-api/src/middleware.rs @@ -255,14 +255,13 @@ impl MiddlewareEndpoint { } #[turbo_tasks::function] - fn userland_module(&self) -> Result>> { - Ok(self - .asset_context + fn userland_module(&self) -> Vc> { + self.asset_context .process( self.source, Value::new(ReferenceType::Entry(EntryReferenceSubType::Middleware)), ) - .module()) + .module() } } @@ -311,7 +310,7 @@ impl Endpoint for MiddlewareEndpoint { } #[turbo_tasks::function] - fn root_modules(self: Vc) -> Result> { - Ok(Vc::cell(vec![self.userland_module()])) + fn root_modules(self: Vc) -> Vc { + Vc::cell(vec![self.userland_module()]) } } diff --git a/crates/next-api/src/pages.rs b/crates/next-api/src/pages.rs index e49fa8cda2e12..144a622427ff3 100644 --- a/crates/next-api/src/pages.rs +++ b/crates/next-api/src/pages.rs @@ -81,8 +81,8 @@ pub struct PagesProject { #[turbo_tasks::value_impl] impl PagesProject { #[turbo_tasks::function] - pub fn new(project: Vc) -> Result> { - Ok(PagesProject { project }.cell()) + pub fn new(project: Vc) -> Vc { + PagesProject { project }.cell() } #[turbo_tasks::function] @@ -279,8 +279,8 @@ impl PagesProject { } #[turbo_tasks::function] - fn client_module_options_context(self: Vc) -> Result> { - Ok(get_client_module_options_context( + fn client_module_options_context(self: Vc) -> Vc { + get_client_module_options_context( self.project().project_path(), self.project().execution_context(), self.project().client_compile_time_info().environment(), @@ -289,12 +289,12 @@ impl PagesProject { }), self.project().next_mode(), self.project().next_config(), - )) + ) } #[turbo_tasks::function] - fn client_resolve_options_context(self: Vc) -> Result> { - Ok(get_client_resolve_options_context( + fn client_resolve_options_context(self: Vc) -> Vc { + get_client_resolve_options_context( self.project().project_path(), Value::new(ClientContextType::Pages { pages_dir: self.pages_dir(), @@ -302,7 +302,7 @@ impl PagesProject { self.project().next_mode(), self.project().next_config(), self.project().execution_context(), - )) + ) } #[turbo_tasks::function] @@ -385,8 +385,8 @@ impl PagesProject { } #[turbo_tasks::function] - fn ssr_module_options_context(self: Vc) -> Result> { - Ok(get_server_module_options_context( + fn ssr_module_options_context(self: Vc) -> Vc { + get_server_module_options_context( self.project().project_path(), self.project().execution_context(), Value::new(ServerContextType::Pages { @@ -395,12 +395,12 @@ impl PagesProject { self.project().next_mode(), self.project().next_config(), NextRuntime::NodeJs, - )) + ) } #[turbo_tasks::function] - fn edge_ssr_module_options_context(self: Vc) -> Result> { - Ok(get_server_module_options_context( + fn edge_ssr_module_options_context(self: Vc) -> Vc { + get_server_module_options_context( self.project().project_path(), self.project().execution_context(), Value::new(ServerContextType::Pages { @@ -409,12 +409,12 @@ impl PagesProject { self.project().next_mode(), self.project().next_config(), NextRuntime::Edge, - )) + ) } #[turbo_tasks::function] - fn api_module_options_context(self: Vc) -> Result> { - Ok(get_server_module_options_context( + fn api_module_options_context(self: Vc) -> Vc { + get_server_module_options_context( self.project().project_path(), self.project().execution_context(), Value::new(ServerContextType::PagesApi { @@ -423,12 +423,12 @@ impl PagesProject { self.project().next_mode(), self.project().next_config(), NextRuntime::NodeJs, - )) + ) } #[turbo_tasks::function] - fn edge_api_module_options_context(self: Vc) -> Result> { - Ok(get_server_module_options_context( + fn edge_api_module_options_context(self: Vc) -> Vc { + get_server_module_options_context( self.project().project_path(), self.project().execution_context(), Value::new(ServerContextType::PagesApi { @@ -437,12 +437,12 @@ impl PagesProject { self.project().next_mode(), self.project().next_config(), NextRuntime::Edge, - )) + ) } #[turbo_tasks::function] - fn ssr_data_module_options_context(self: Vc) -> Result> { - Ok(get_server_module_options_context( + fn ssr_data_module_options_context(self: Vc) -> Vc { + get_server_module_options_context( self.project().project_path(), self.project().execution_context(), Value::new(ServerContextType::PagesData { @@ -451,12 +451,12 @@ impl PagesProject { self.project().next_mode(), self.project().next_config(), NextRuntime::NodeJs, - )) + ) } #[turbo_tasks::function] - fn edge_ssr_data_module_options_context(self: Vc) -> Result> { - Ok(get_server_module_options_context( + fn edge_ssr_data_module_options_context(self: Vc) -> Vc { + get_server_module_options_context( self.project().project_path(), self.project().execution_context(), Value::new(ServerContextType::PagesData { @@ -465,12 +465,12 @@ impl PagesProject { self.project().next_mode(), self.project().next_config(), NextRuntime::Edge, - )) + ) } #[turbo_tasks::function] - fn ssr_resolve_options_context(self: Vc) -> Result> { - Ok(get_server_resolve_options_context( + fn ssr_resolve_options_context(self: Vc) -> Vc { + get_server_resolve_options_context( self.project().project_path(), // NOTE(alexkirsz) This could be `PagesData` for the data endpoint, but it doesn't // matter (for now at least) because `get_server_resolve_options_context` doesn't @@ -481,12 +481,12 @@ impl PagesProject { self.project().next_mode(), self.project().next_config(), self.project().execution_context(), - )) + ) } #[turbo_tasks::function] - fn edge_ssr_resolve_options_context(self: Vc) -> Result> { - Ok(get_edge_resolve_options_context( + fn edge_ssr_resolve_options_context(self: Vc) -> Vc { + get_edge_resolve_options_context( self.project().project_path(), // NOTE(alexkirsz) This could be `PagesData` for the data endpoint, but it doesn't // matter (for now at least) because `get_server_resolve_options_context` doesn't @@ -497,11 +497,11 @@ impl PagesProject { self.project().next_mode(), self.project().next_config(), self.project().execution_context(), - )) + ) } #[turbo_tasks::function] - fn client_runtime_entries(self: Vc) -> Result> { + fn client_runtime_entries(self: Vc) -> Vc { let client_runtime_entries = get_client_runtime_entries( self.project().project_path(), Value::new(ClientContextType::Pages { @@ -511,27 +511,27 @@ impl PagesProject { self.project().next_config(), self.project().execution_context(), ); - Ok(client_runtime_entries.resolve_entries(self.client_module_context())) + client_runtime_entries.resolve_entries(self.client_module_context()) } #[turbo_tasks::function] - fn runtime_entries(self: Vc) -> Result> { - Ok(get_server_runtime_entries( + fn runtime_entries(self: Vc) -> Vc { + get_server_runtime_entries( Value::new(ServerContextType::Pages { pages_dir: self.pages_dir(), }), self.project().next_mode(), - )) + ) } #[turbo_tasks::function] - fn data_runtime_entries(self: Vc) -> Result> { - Ok(get_server_runtime_entries( + fn data_runtime_entries(self: Vc) -> Vc { + get_server_runtime_entries( Value::new(ServerContextType::PagesData { pages_dir: self.pages_dir(), }), self.project().next_mode(), - )) + ) } #[turbo_tasks::function] @@ -638,8 +638,8 @@ impl PageEndpoint { } #[turbo_tasks::function] - fn source(&self) -> Result>> { - Ok(Vc::upcast(FileSource::new(self.page.project_path()))) + fn source(&self) -> Vc> { + Vc::upcast(FileSource::new(self.page.project_path())) } #[turbo_tasks::function] diff --git a/crates/next-api/src/project.rs b/crates/next-api/src/project.rs index 5727cb51ba11b..45ff88b696b8d 100644 --- a/crates/next-api/src/project.rs +++ b/crates/next-api/src/project.rs @@ -386,12 +386,12 @@ impl ProjectContainer { &self, file_path: Vc, section: Option, - ) -> Result> { - Ok(if let Some(map) = self.versioned_content_map { + ) -> Vc { + if let Some(map) = self.versioned_content_map { map.get_source_map(file_path, section) } else { OptionSourceMap::none() - }) + } } } @@ -510,8 +510,8 @@ impl Project { } #[turbo_tasks::function] - pub fn pages_project(self: Vc) -> Result> { - Ok(PagesProject::new(self)) + pub fn pages_project(self: Vc) -> Vc { + PagesProject::new(self) } #[turbo_tasks::function] @@ -528,20 +528,19 @@ impl Project { } #[turbo_tasks::function] - fn client_fs(self: Vc) -> Result>> { + fn client_fs(self: Vc) -> Vc> { let virtual_fs = VirtualFileSystem::new(); - Ok(Vc::upcast(virtual_fs)) + Vc::upcast(virtual_fs) } #[turbo_tasks::function] - pub fn output_fs(&self) -> Result> { - let disk_fs = DiskFileSystem::new("output".into(), self.project_path.clone(), vec![]); - Ok(disk_fs) + pub fn output_fs(&self) -> Vc { + DiskFileSystem::new("output".into(), self.project_path.clone(), vec![]) } #[turbo_tasks::function] - pub fn dist_dir(&self) -> Result> { - Ok(Vc::cell(self.dist_dir.clone())) + pub fn dist_dir(&self) -> Vc { + Vc::cell(self.dist_dir.clone()) } #[turbo_tasks::function] @@ -585,23 +584,23 @@ impl Project { } #[turbo_tasks::function] - pub(super) fn env(&self) -> Result>> { - Ok(self.env) + pub(super) fn env(&self) -> Vc> { + self.env } #[turbo_tasks::function] - pub(super) fn next_config(&self) -> Result> { - Ok(self.next_config) + pub(super) fn next_config(&self) -> Vc { + self.next_config } #[turbo_tasks::function] - pub(super) fn next_mode(&self) -> Result> { - Ok(self.mode) + pub(super) fn next_mode(&self) -> Vc { + self.mode } #[turbo_tasks::function] - pub(super) fn js_config(&self) -> Result> { - Ok(self.js_config) + pub(super) fn js_config(&self) -> Vc { + self.js_config } #[turbo_tasks::function] @@ -630,11 +629,8 @@ impl Project { } #[turbo_tasks::function] - pub(super) fn client_compile_time_info(&self) -> Result> { - Ok(get_client_compile_time_info( - self.browserslist_query.clone(), - self.define_env.client(), - )) + pub(super) fn client_compile_time_info(&self) -> Vc { + get_client_compile_time_info(self.browserslist_query.clone(), self.define_env.client()) } #[turbo_tasks::function] @@ -668,15 +664,15 @@ impl Project { } #[turbo_tasks::function] - pub(super) fn client_chunking_context(self: Vc) -> Result>> { - Ok(get_client_chunking_context( + pub(super) fn client_chunking_context(self: Vc) -> Vc> { + get_client_chunking_context( self.project_path(), self.client_relative_path(), self.next_config().computed_asset_prefix(), self.client_compile_time_info().environment(), self.next_mode(), self.module_id_strategy(), - )) + ) } #[turbo_tasks::function] @@ -1322,6 +1318,6 @@ fn all_assets_from_entries_operation( } #[turbo_tasks::function] -fn stable_endpoint(endpoint: Vc>) -> Result>> { - Ok(endpoint) +fn stable_endpoint(endpoint: Vc>) -> Vc> { + endpoint } diff --git a/crates/next-api/src/versioned_content_map.rs b/crates/next-api/src/versioned_content_map.rs index a07553d2bdbb1..d08c63e9877ac 100644 --- a/crates/next-api/src/versioned_content_map.rs +++ b/crates/next-api/src/versioned_content_map.rs @@ -230,13 +230,13 @@ impl VersionedContentMap { } #[turbo_tasks::function] - fn raw_get(&self, path: Vc) -> Result> { + fn raw_get(&self, path: Vc) -> Vc { let assets = { let map = self.map_path_to_op.get(); map.get(&path).and_then(|m| m.iter().last().copied()) }; let Some(assets) = assets else { - return Ok(Vc::cell(None)); + return Vc::cell(None); }; // Need to reconnect the operation to the map Vc::connect(assets); @@ -246,11 +246,11 @@ impl VersionedContentMap { map.get(&assets).copied() }; let Some(compute_entry) = compute_entry else { - return Ok(Vc::cell(None)); + return Vc::cell(None); }; // Need to reconnect the operation to the map Vc::connect(compute_entry); - Ok(compute_entry) + compute_entry } } diff --git a/crates/next-core/src/app_structure.rs b/crates/next-core/src/app_structure.rs index a9483fbd81ace..c36b7a6f6ab54 100644 --- a/crates/next-core/src/app_structure.rs +++ b/crates/next-core/src/app_structure.rs @@ -732,8 +732,8 @@ struct DuplicateParallelRouteIssue { #[turbo_tasks::value_impl] impl Issue for DuplicateParallelRouteIssue { #[turbo_tasks::function] - fn file_path(&self) -> Result> { - Ok(self.app_dir.join(self.page.to_string().into())) + fn file_path(&self) -> Vc { + self.app_dir.join(self.page.to_string().into()) } #[turbo_tasks::function] @@ -1355,8 +1355,8 @@ impl Issue for DirectoryTreeIssue { } #[turbo_tasks::function] - fn title(&self) -> Result> { - Ok(StyledString::Text("An issue occurred while preparing your Next.js app".into()).cell()) + fn title(&self) -> Vc { + StyledString::Text("An issue occurred while preparing your Next.js app".into()).cell() } #[turbo_tasks::function] diff --git a/crates/next-core/src/bootstrap.rs b/crates/next-core/src/bootstrap.rs index 273a0709dc446..869e6acd033e3 100644 --- a/crates/next-core/src/bootstrap.rs +++ b/crates/next-core/src/bootstrap.rs @@ -20,15 +20,15 @@ pub fn route_bootstrap( base_path: Vc, bootstrap_asset: Vc>, config: Vc, -) -> Result>> { - Ok(bootstrap( +) -> Vc> { + bootstrap( asset, asset_context, base_path, bootstrap_asset, Vc::cell(IndexMap::new()), config, - )) + ) } #[turbo_tasks::value(transparent)] diff --git a/crates/next-core/src/hmr_entry.rs b/crates/next-core/src/hmr_entry.rs index c969b1020fc7e..4da74f6b9b572 100644 --- a/crates/next-core/src/hmr_entry.rs +++ b/crates/next-core/src/hmr_entry.rs @@ -121,8 +121,8 @@ impl ValueToString for HmrEntryModuleReference { #[turbo_tasks::value_impl] impl ModuleReference for HmrEntryModuleReference { #[turbo_tasks::function] - fn resolve_reference(&self) -> Result> { - Ok(ModuleResolveResult::module(self.module).cell()) + fn resolve_reference(&self) -> Vc { + ModuleResolveResult::module(self.module).cell() } } diff --git a/crates/next-core/src/next_app/include_modules_module.rs b/crates/next-core/src/next_app/include_modules_module.rs index 65d4a3f3069b8..bd1485e54dbf0 100644 --- a/crates/next-core/src/next_app/include_modules_module.rs +++ b/crates/next-core/src/next_app/include_modules_module.rs @@ -78,14 +78,14 @@ impl ChunkableModule for IncludeModulesModule { fn as_chunk_item( self: Vc, chunking_context: Vc>, - ) -> Result>> { - Ok(Vc::upcast( + ) -> Vc> { + Vc::upcast( IncludeModulesChunkItem { module: self, chunking_context, } .cell(), - )) + ) } } @@ -165,8 +165,8 @@ impl ValueToString for IncludedModuleReference { #[turbo_tasks::value_impl] impl ModuleReference for IncludedModuleReference { #[turbo_tasks::function] - fn resolve_reference(&self) -> Result> { - Ok(ModuleResolveResult::module(self.module).cell()) + fn resolve_reference(&self) -> Vc { + ModuleResolveResult::module(self.module).cell() } } diff --git a/crates/next-core/src/next_build.rs b/crates/next-core/src/next_build.rs index 57c55bc7f40b7..bec017dcc0506 100644 --- a/crates/next-core/src/next_build.rs +++ b/crates/next-core/src/next_build.rs @@ -6,16 +6,14 @@ use turbopack_core::resolve::{options::ImportMapping, ExternalType}; use crate::next_import_map::get_next_package; #[turbo_tasks::function] -pub async fn get_postcss_package_mapping( - project_path: Vc, -) -> Result> { - Ok(ImportMapping::Alternatives(vec![ +pub async fn get_postcss_package_mapping(project_path: Vc) -> Vc { + ImportMapping::Alternatives(vec![ // Prefer the local installed version over the next.js version ImportMapping::PrimaryAlternative("postcss".into(), Some(project_path)).cell(), ImportMapping::PrimaryAlternative("postcss".into(), Some(get_next_package(project_path))) .cell(), ]) - .cell()) + .cell() } #[turbo_tasks::function] diff --git a/crates/next-core/src/next_client_reference/ecmascript_client_reference/ecmascript_client_reference_module.rs b/crates/next-core/src/next_client_reference/ecmascript_client_reference/ecmascript_client_reference_module.rs index fc04e3ba8d33e..871a655c3f263 100644 --- a/crates/next-core/src/next_client_reference/ecmascript_client_reference/ecmascript_client_reference_module.rs +++ b/crates/next-core/src/next_client_reference/ecmascript_client_reference/ecmascript_client_reference_module.rs @@ -57,10 +57,10 @@ impl Module for EcmascriptClientReferenceModule { } #[turbo_tasks::function] - fn additional_layers_modules(&self) -> Result> { + fn additional_layers_modules(&self) -> Vc { let client_module = Vc::upcast(self.client_module); let ssr_module = Vc::upcast(self.ssr_module); - Ok(Vc::cell(vec![client_module, ssr_module])) + Vc::cell(vec![client_module, ssr_module]) } } diff --git a/crates/next-core/src/next_config.rs b/crates/next-core/src/next_config.rs index f3ca4eb9cbee3..14b90f4544b83 100644 --- a/crates/next-core/src/next_config.rs +++ b/crates/next-core/src/next_config.rs @@ -792,17 +792,17 @@ impl NextConfig { } #[turbo_tasks::function] - pub fn server_external_packages(&self) -> Result>> { - Ok(Vc::cell( + pub fn server_external_packages(&self) -> Vc> { + Vc::cell( self.server_external_packages .as_ref() .cloned() .unwrap_or_default(), - )) + ) } #[turbo_tasks::function] - pub fn env(&self) -> Result> { + pub fn env(&self) -> Vc { // The value expected for env is Record, but config itself // allows arbitrary object (https://github.com/vercel/next.js/blob/25ba8a74b7544dfb6b30d1b67c47b9cb5360cb4e/packages/next/src/server/config-schema.ts#L203) // then stringifies it. We do the interop here as well. @@ -822,38 +822,36 @@ impl NextConfig { }) .collect(); - Ok(Vc::cell(env)) + Vc::cell(env) } #[turbo_tasks::function] - pub fn image_config(&self) -> Result> { - Ok(self.images.clone().cell()) + pub fn image_config(&self) -> Vc { + self.images.clone().cell() } #[turbo_tasks::function] - pub fn page_extensions(&self) -> Result>> { - Ok(Vc::cell(self.page_extensions.clone())) + pub fn page_extensions(&self) -> Vc> { + Vc::cell(self.page_extensions.clone()) } #[turbo_tasks::function] - pub fn transpile_packages(&self) -> Result>> { - Ok(Vc::cell( - self.transpile_packages.clone().unwrap_or_default(), - )) + pub fn transpile_packages(&self) -> Vc> { + Vc::cell(self.transpile_packages.clone().unwrap_or_default()) } #[turbo_tasks::function] - pub fn webpack_rules(&self, active_conditions: Vec) -> Result> { + pub fn webpack_rules(&self, active_conditions: Vec) -> Vc { let Some(turbo_rules) = self .experimental .turbo .as_ref() .and_then(|t| t.rules.as_ref()) else { - return Ok(Vc::cell(None)); + return Vc::cell(None); }; if turbo_rules.is_empty() { - return Ok(Vc::cell(None)); + return Vc::cell(None); } let active_conditions = active_conditions.into_iter().collect::>(); let mut rules = IndexMap::new(); @@ -927,7 +925,7 @@ impl NextConfig { } } } - Ok(Vc::cell(Some(Vc::cell(rules)))) + Vc::cell(Some(Vc::cell(rules))) } #[turbo_tasks::function] @@ -945,16 +943,16 @@ impl NextConfig { } #[turbo_tasks::function] - pub fn resolve_extension(&self) -> Result> { + pub fn resolve_extension(&self) -> Vc { let Some(resolve_extensions) = self .experimental .turbo .as_ref() .and_then(|t| t.resolve_extensions.as_ref()) else { - return Ok(Vc::cell(None)); + return Vc::cell(None); }; - Ok(Vc::cell(Some(resolve_extensions.clone()))) + Vc::cell(Some(resolve_extensions.clone())) } #[turbo_tasks::function] @@ -967,7 +965,7 @@ impl NextConfig { } #[turbo_tasks::function] - pub fn mdx_rs(&self) -> Result> { + pub fn mdx_rs(&self) -> Vc { let options = &self.experimental.mdx_rs; let options = match options { @@ -993,11 +991,11 @@ impl NextConfig { _ => OptionalMdxTransformOptions(None), }; - Ok(options.cell()) + options.cell() } #[turbo_tasks::function] - pub fn react_compiler(&self) -> Result> { + pub fn react_compiler(&self) -> Vc { let options = &self.experimental.react_compiler; let options = match options { @@ -1016,24 +1014,22 @@ impl NextConfig { _ => OptionalReactCompilerOptions(None), }; - Ok(options.cell()) + options.cell() } #[turbo_tasks::function] - pub fn sass_config(&self) -> Result> { - Ok(Vc::cell(self.sass_options.clone().unwrap_or_default())) + pub fn sass_config(&self) -> Vc { + Vc::cell(self.sass_options.clone().unwrap_or_default()) } #[turbo_tasks::function] - pub fn skip_middleware_url_normalize(&self) -> Result> { - Ok(Vc::cell( - self.skip_middleware_url_normalize.unwrap_or(false), - )) + pub fn skip_middleware_url_normalize(&self) -> Vc { + Vc::cell(self.skip_middleware_url_normalize.unwrap_or(false)) } #[turbo_tasks::function] - pub fn skip_trailing_slash_redirect(&self) -> Result> { - Ok(Vc::cell(self.skip_trailing_slash_redirect.unwrap_or(false))) + pub fn skip_trailing_slash_redirect(&self) -> Vc { + Vc::cell(self.skip_trailing_slash_redirect.unwrap_or(false)) } /// Returns the final asset prefix. If an assetPrefix is set, it's used. @@ -1057,8 +1053,8 @@ impl NextConfig { } #[turbo_tasks::function] - pub fn enable_ppr(&self) -> Result> { - Ok(Vc::cell( + pub fn enable_ppr(&self) -> Vc { + Vc::cell( self.experimental .ppr .as_ref() @@ -1069,52 +1065,52 @@ impl NextConfig { ExperimentalPartialPrerendering::Boolean(b) => *b, }) .unwrap_or(false), - )) + ) } #[turbo_tasks::function] - pub fn enable_taint(&self) -> Result> { - Ok(Vc::cell(self.experimental.taint.unwrap_or(false))) + pub fn enable_taint(&self) -> Vc { + Vc::cell(self.experimental.taint.unwrap_or(false)) } #[turbo_tasks::function] - pub fn enable_dynamic_io(&self) -> Result> { - Ok(Vc::cell(self.experimental.dynamic_io.unwrap_or(false))) + pub fn enable_dynamic_io(&self) -> Vc { + Vc::cell(self.experimental.dynamic_io.unwrap_or(false)) } #[turbo_tasks::function] - pub fn use_swc_css(&self) -> Result> { - Ok(Vc::cell( + pub fn use_swc_css(&self) -> Vc { + Vc::cell( self.experimental .turbo .as_ref() .and_then(|turbo| turbo.use_swc_css) .unwrap_or(false), - )) + ) } #[turbo_tasks::function] - pub fn optimize_package_imports(&self) -> Result>> { - Ok(Vc::cell( + pub fn optimize_package_imports(&self) -> Vc> { + Vc::cell( self.experimental .optimize_package_imports .clone() .unwrap_or_default(), - )) + ) } #[turbo_tasks::function] pub fn tree_shaking_mode_for_foreign_code( &self, is_development: bool, - ) -> Result> { + ) -> Vc { let tree_shaking = self .experimental .turbo .as_ref() .and_then(|v| v.tree_shaking); - Ok(OptionTreeShaking(match tree_shaking { + OptionTreeShaking(match tree_shaking { Some(false) => Some(TreeShakingMode::ReexportsOnly), Some(true) => Some(TreeShakingMode::ModuleFragments), None => { @@ -1125,32 +1121,32 @@ impl NextConfig { } } }) - .cell()) + .cell() } #[turbo_tasks::function] pub fn tree_shaking_mode_for_user_code( self: Vc, is_development: bool, - ) -> Result> { - Ok(Vc::cell(Some(if is_development { + ) -> Vc { + Vc::cell(Some(if is_development { TreeShakingMode::ReexportsOnly } else { TreeShakingMode::ModuleFragments - }))) + })) } #[turbo_tasks::function] - pub fn module_id_strategy_config(&self) -> Result> { + pub fn module_id_strategy_config(&self) -> Vc { let Some(module_id_strategy) = self .experimental .turbo .as_ref() .and_then(|t| t.module_id_strategy.as_ref()) else { - return Ok(Vc::cell(None)); + return Vc::cell(None); }; - Ok(Vc::cell(Some(module_id_strategy.clone()))) + Vc::cell(Some(module_id_strategy.clone())) } } @@ -1175,8 +1171,8 @@ impl JsConfig { } #[turbo_tasks::function] - pub fn compiler_options(&self) -> Result> { - Ok(Vc::cell(self.compiler_options.clone().unwrap_or_default())) + pub fn compiler_options(&self) -> Vc { + Vc::cell(self.compiler_options.clone().unwrap_or_default()) } } diff --git a/crates/next-core/src/next_edge/entry.rs b/crates/next-core/src/next_edge/entry.rs index e3adc6c6b5362..017ad57717136 100644 --- a/crates/next-core/src/next_edge/entry.rs +++ b/crates/next-core/src/next_edge/entry.rs @@ -1,4 +1,3 @@ -use anyhow::Result; use indexmap::indexmap; use indoc::formatdoc; use turbo_tasks::{RcStr, Value, Vc}; @@ -15,7 +14,7 @@ pub async fn wrap_edge_entry( project_root: Vc, entry: Vc>, pathname: RcStr, -) -> Result>> { +) -> Vc> { // The wrapped module could be an async module, we handle that with the proxy // here. The comma expression makes sure we don't call the function with the // module as the "this" arg. @@ -38,11 +37,10 @@ pub async fn wrap_edge_entry( "MODULE".into() => entry }; - let module = asset_context + asset_context .process( Vc::upcast(virtual_source), Value::new(ReferenceType::Internal(Vc::cell(inner_assets))), ) - .module(); - Ok(module) + .module() } diff --git a/crates/next-core/src/next_font/google/options.rs b/crates/next-core/src/next_font/google/options.rs index 74b0db71c72d9..45430e67ede44 100644 --- a/crates/next-core/src/next_font/google/options.rs +++ b/crates/next-core/src/next_font/google/options.rs @@ -35,8 +35,8 @@ impl NextFontGoogleOptions { } #[turbo_tasks::function] - pub fn font_family(&self) -> Result> { - Ok(Vc::cell((*self.font_family).into())) + pub fn font_family(&self) -> Vc { + Vc::cell((*self.font_family).into()) } } diff --git a/crates/next-core/src/next_font/local/mod.rs b/crates/next-core/src/next_font/local/mod.rs index 62ce9730f2ca2..8ea8f79eec64d 100644 --- a/crates/next-core/src/next_font/local/mod.rs +++ b/crates/next-core/src/next_font/local/mod.rs @@ -321,8 +321,8 @@ impl Issue for FontResolvingIssue { } #[turbo_tasks::function] - fn file_path(&self) -> Result> { - Ok(self.origin_path) + fn file_path(&self) -> Vc { + self.origin_path } #[turbo_tasks::function] diff --git a/crates/next-core/src/next_font/local/options.rs b/crates/next-core/src/next_font/local/options.rs index cffd94152f426..7f9ea6809a610 100644 --- a/crates/next-core/src/next_font/local/options.rs +++ b/crates/next-core/src/next_font/local/options.rs @@ -41,8 +41,8 @@ impl NextFontLocalOptions { } #[turbo_tasks::function] - pub fn font_family(&self) -> Result> { - Ok(Vc::cell(self.variable_name.clone())) + pub fn font_family(&self) -> Vc { + Vc::cell(self.variable_name.clone()) } } diff --git a/crates/next-core/src/next_image/module.rs b/crates/next-core/src/next_image/module.rs index 346def33933ab..f6eb67358dfc8 100644 --- a/crates/next-core/src/next_image/module.rs +++ b/crates/next-core/src/next_image/module.rs @@ -1,4 +1,3 @@ -use anyhow::Result; use indexmap::indexmap; use turbo_tasks::{TaskInput, Value, Vc}; use turbopack::{module_options::CustomModuleType, ModuleAssetContext}; @@ -40,9 +39,9 @@ impl StructuredImageModuleType { source: Vc>, blur_placeholder_mode: BlurPlaceholderMode, module_asset_context: Vc, - ) -> Result>> { + ) -> Vc> { let static_asset = StaticModuleAsset::new(source, Vc::upcast(module_asset_context)); - let module = module_asset_context + module_asset_context .process( Vc::upcast( StructuredImageFileSource { @@ -55,8 +54,7 @@ impl StructuredImageModuleType { "IMAGE".into() => Vc::upcast(static_asset) )))), ) - .module(); - Ok(module) + .module() } #[turbo_tasks::function] diff --git a/crates/next-core/src/next_pages/page_entry.rs b/crates/next-core/src/next_pages/page_entry.rs index 33a4043a24513..2d1baaccdddac 100644 --- a/crates/next-core/src/next_pages/page_entry.rs +++ b/crates/next-core/src/next_pages/page_entry.rs @@ -170,12 +170,9 @@ fn process_global_item( item: Vc, reference_type: Value, module_context: Vc>, -) -> Result>> { +) -> Vc> { let source = Vc::upcast(FileSource::new(item.project_path())); - - let module = module_context.process(source, reference_type).module(); - - Ok(module) + module_context.process(source, reference_type).module() } #[turbo_tasks::function] diff --git a/crates/next-core/src/next_route_matcher/mod.rs b/crates/next-core/src/next_route_matcher/mod.rs index affb4329226b1..aa7c46c467bbc 100644 --- a/crates/next-core/src/next_route_matcher/mod.rs +++ b/crates/next-core/src/next_route_matcher/mod.rs @@ -21,8 +21,8 @@ pub(crate) struct NextExactMatcher { #[turbo_tasks::value_impl] impl NextExactMatcher { #[turbo_tasks::function] - pub fn new(path: Vc) -> Result> { - Ok(Self::cell(NextExactMatcher { path })) + pub fn new(path: Vc) -> Vc { + Self::cell(NextExactMatcher { path }) } } diff --git a/crates/next-core/src/next_server/resolve.rs b/crates/next-core/src/next_server/resolve.rs index e79fc228f00a5..ad0de304dd1e4 100644 --- a/crates/next-core/src/next_server/resolve.rs +++ b/crates/next-core/src/next_server/resolve.rs @@ -476,7 +476,7 @@ impl Issue for UnableToExternalize { } #[turbo_tasks::function] - async fn title(&self) -> Result> { + async fn title(&self) -> Vc { let request = &self.request; let package = if request.starts_with('@') { request @@ -490,14 +490,14 @@ impl Issue for UnableToExternalize { } else { request.clone() }; - Ok(StyledString::Line(vec![ + StyledString::Line(vec![ StyledString::Text("Package ".into()), StyledString::Code(package), StyledString::Text(" (".into()), StyledString::Code("serverExternalPackages".into()), StyledString::Text(" or default list) can't be external".into()), ]) - .cell()) + .cell() } #[turbo_tasks::function] diff --git a/crates/next-core/src/next_server_component/server_component_module.rs b/crates/next-core/src/next_server_component/server_component_module.rs index 3b50935dc46d4..5c684e69d52e3 100644 --- a/crates/next-core/src/next_server_component/server_component_module.rs +++ b/crates/next-core/src/next_server_component/server_component_module.rs @@ -46,8 +46,8 @@ impl NextServerComponentModule { } #[turbo_tasks::function] - pub fn server_path(&self) -> Result> { - Ok(self.module.ident().path()) + pub fn server_path(&self) -> Vc { + self.module.ident().path() } } @@ -92,14 +92,14 @@ impl ChunkableModule for NextServerComponentModule { fn as_chunk_item( self: Vc, chunking_context: Vc>, - ) -> Result>> { - Ok(Vc::upcast( + ) -> Vc> { + Vc::upcast( NextServerComponentChunkItem { chunking_context, inner: self, } .cell(), - )) + ) } } diff --git a/crates/next-core/src/next_shared/resolve.rs b/crates/next-core/src/next_shared/resolve.rs index 02b585e539df2..21c650675587c 100644 --- a/crates/next-core/src/next_shared/resolve.rs +++ b/crates/next-core/src/next_shared/resolve.rs @@ -130,7 +130,7 @@ impl BeforeResolvePlugin for InvalidImportResolvePlugin { lookup_path: Vc, _reference_type: Value, _request: Vc, - ) -> Result> { + ) -> Vc { InvalidImportModuleIssue { file_path: lookup_path, messages: self.message.clone(), @@ -140,12 +140,12 @@ impl BeforeResolvePlugin for InvalidImportResolvePlugin { .cell() .emit(); - Ok(ResolveResultOption::some( + ResolveResultOption::some( ResolveResult::primary(ResolveResultItem::Error(Vc::cell( self.message.join("\n").into(), ))) .cell(), - )) + ) } } diff --git a/crates/next-core/src/next_shared/transforms/next_page_static_info.rs b/crates/next-core/src/next_shared/transforms/next_page_static_info.rs index 3f8beee7a97c5..16202e9e2b469 100644 --- a/crates/next-core/src/next_shared/transforms/next_page_static_info.rs +++ b/crates/next-core/src/next_shared/transforms/next_page_static_info.rs @@ -157,8 +157,8 @@ impl Issue for PageStaticInfoIssue { } #[turbo_tasks::function] - fn description(&self) -> Result> { - Ok(Vc::cell(Some( + fn description(&self) -> Vc { + Vc::cell(Some( StyledString::Line( self.messages .iter() @@ -166,6 +166,6 @@ impl Issue for PageStaticInfoIssue { .collect::>(), ) .cell(), - ))) + )) } } diff --git a/crates/next-core/src/pages_structure.rs b/crates/next-core/src/pages_structure.rs index 44644aac8d1e1..d90fc5a97ec4c 100644 --- a/crates/next-core/src/pages_structure.rs +++ b/crates/next-core/src/pages_structure.rs @@ -32,15 +32,15 @@ impl PagesStructureItem { fallback_path: Option>, next_router_path: Vc, original_path: Vc, - ) -> Result> { - Ok(PagesStructureItem { + ) -> Vc { + PagesStructureItem { base_path, extensions, fallback_path, next_router_path, original_path, } - .cell()) + .cell() } #[turbo_tasks::function] @@ -102,8 +102,8 @@ impl PagesDirectoryStructure { /// Returns the path to the directory of this structure in the project file /// system. #[turbo_tasks::function] - pub fn project_path(&self) -> Result> { - Ok(self.project_path) + pub fn project_path(&self) -> Vc { + self.project_path } } diff --git a/turbopack/crates/node-file-trace/src/lib.rs b/turbopack/crates/node-file-trace/src/lib.rs index d4f54341f78e8..fc72f5f5a99bc 100644 --- a/turbopack/crates/node-file-trace/src/lib.rs +++ b/turbopack/crates/node-file-trace/src/lib.rs @@ -632,7 +632,7 @@ async fn create_module_asset( process_cwd: Option, module_options: TransientInstance, resolve_options: TransientInstance, -) -> Result> { +) -> Vc { let env = Environment::new(Value::new(ExecutionEnvironment::NodeJsLambda( NodeJsEnvironment { cwd: Vc::cell(process_cwd), @@ -666,13 +666,13 @@ async fn create_module_asset( ); } - Ok(ModuleAssetContext::new( + ModuleAssetContext::new( Default::default(), compile_time_info, ModuleOptionsContext::clone(&*module_options).cell(), resolve_options.cell(), Vc::cell("node_file_trace".into()), - )) + ) } fn register() { diff --git a/turbopack/crates/turbo-tasks-env/src/dotenv.rs b/turbopack/crates/turbo-tasks-env/src/dotenv.rs index f83d55785d592..b77b473bde1fb 100644 --- a/turbopack/crates/turbo-tasks-env/src/dotenv.rs +++ b/turbopack/crates/turbo-tasks-env/src/dotenv.rs @@ -24,10 +24,10 @@ impl DotenvProcessEnv { } #[turbo_tasks::function] - pub fn read_prior(&self) -> Result> { + pub fn read_prior(&self) -> Vc { match self.prior { - None => Ok(EnvMap::empty()), - Some(p) => Ok(p.read_all()), + None => EnvMap::empty(), + Some(p) => p.read_all(), } } @@ -76,9 +76,9 @@ impl DotenvProcessEnv { #[turbo_tasks::value_impl] impl ProcessEnv for DotenvProcessEnv { #[turbo_tasks::function] - fn read_all(self: Vc) -> Result> { + fn read_all(self: Vc) -> Vc { let prior = self.read_prior(); - Ok(self.read_all_with_prior(prior)) + self.read_all_with_prior(prior) } } diff --git a/turbopack/crates/turbo-tasks-env/src/lib.rs b/turbopack/crates/turbo-tasks-env/src/lib.rs index e6b71932dcb89..285d8f82a7a55 100644 --- a/turbopack/crates/turbo-tasks-env/src/lib.rs +++ b/turbopack/crates/turbo-tasks-env/src/lib.rs @@ -30,8 +30,8 @@ impl EnvMap { #[turbo_tasks::value_impl] impl ProcessEnv for EnvMap { #[turbo_tasks::function] - fn read_all(self: Vc) -> Result> { - Ok(self) + fn read_all(self: Vc) -> Vc { + self } #[turbo_tasks::function] diff --git a/turbopack/crates/turbo-tasks-fs/src/embed/file.rs b/turbopack/crates/turbo-tasks-fs/src/embed/file.rs index c6376de43dd78..992f577da7356 100644 --- a/turbopack/crates/turbo-tasks-fs/src/embed/file.rs +++ b/turbopack/crates/turbo-tasks-fs/src/embed/file.rs @@ -30,8 +30,8 @@ pub async fn content_from_relative_path( } #[turbo_tasks::function] -pub fn content_from_str(string: RcStr) -> Result> { - Ok(File::from(string).into()) +pub fn content_from_str(string: RcStr) -> Vc { + File::from(string).into() } /// Loads a file's content from disk and invalidates on change (debug builds). diff --git a/turbopack/crates/turbo-tasks-fs/src/lib.rs b/turbopack/crates/turbo-tasks-fs/src/lib.rs index 358e5aad95007..3493b88d40133 100644 --- a/turbopack/crates/turbo-tasks-fs/src/lib.rs +++ b/turbopack/crates/turbo-tasks-fs/src/lib.rs @@ -1209,13 +1209,13 @@ impl FileSystemPath { } #[turbo_tasks::function] - pub fn fs(&self) -> Result>> { - Ok(self.fs) + pub fn fs(&self) -> Vc> { + self.fs } #[turbo_tasks::function] - pub fn extension(&self) -> Result> { - Ok(Vc::cell(self.extension_ref().unwrap_or("").into())) + pub fn extension(&self) -> Vc { + Vc::cell(self.extension_ref().unwrap_or("").into()) } #[turbo_tasks::function] @@ -1231,9 +1231,9 @@ impl FileSystemPath { /// Creates a new [`Vc`] like `self` but with the given /// extension. #[turbo_tasks::function] - pub async fn with_extension(&self, extension: RcStr) -> Result> { + pub async fn with_extension(&self, extension: RcStr) -> Vc { let (path_without_extension, _) = self.split_extension(); - Ok(Self::new_normalized( + Self::new_normalized( self.fs, // Like `Path::with_extension` and `PathBuf::set_extension`, if the extension is empty, // we remove the extension altogether. @@ -1241,7 +1241,7 @@ impl FileSystemPath { true => path_without_extension.into(), false => format!("{path_without_extension}.{extension}").into(), }, - )) + ) } /// Extracts the stem (non-extension) portion of self.file_name. @@ -1253,12 +1253,12 @@ impl FileSystemPath { /// * The entire file name if the file name begins with `.` and has no other `.`s within; /// * Otherwise, the portion of the file name before the final `.` #[turbo_tasks::function] - pub fn file_stem(&self) -> Result>> { + pub fn file_stem(&self) -> Vc> { let (_, file_stem, _) = self.split_file_stem_extension(); if file_stem.is_empty() { - return Ok(Vc::cell(None)); + return Vc::cell(None); } - Ok(Vc::cell(Some(file_stem.into()))) + Vc::cell(Some(file_stem.into())) } /// See [`truncate_file_name_with_hash`]. Preserves the input [`Vc`] if no truncation was @@ -1478,8 +1478,8 @@ pub struct RealPathResult { #[turbo_tasks::value_impl] impl RealPathResult { #[turbo_tasks::function] - pub fn path(&self) -> Result> { - Ok(self.path) + pub fn path(&self) -> Vc { + self.path } } diff --git a/turbopack/crates/turbopack-browser/src/chunking_context.rs b/turbopack/crates/turbopack-browser/src/chunking_context.rs index d187c7601eb84..88139b824e250 100644 --- a/turbopack/crates/turbopack-browser/src/chunking_context.rs +++ b/turbopack/crates/turbopack-browser/src/chunking_context.rs @@ -485,8 +485,8 @@ impl ChunkingContext for BrowserChunkingContext { } #[turbo_tasks::function] - fn chunk_item_id_from_ident(&self, ident: Vc) -> Result> { - Ok(self.module_id_strategy.get_module_id(ident)) + fn chunk_item_id_from_ident(&self, ident: Vc) -> Vc { + self.module_id_strategy.get_module_id(ident) } #[turbo_tasks::function] diff --git a/turbopack/crates/turbopack-browser/src/ecmascript/chunk.rs b/turbopack/crates/turbopack-browser/src/ecmascript/chunk.rs index adf1b8a05d472..6d4671107d3be 100644 --- a/turbopack/crates/turbopack-browser/src/ecmascript/chunk.rs +++ b/turbopack/crates/turbopack-browser/src/ecmascript/chunk.rs @@ -40,8 +40,8 @@ impl EcmascriptDevChunk { #[turbo_tasks::value_impl] impl ValueToString for EcmascriptDevChunk { #[turbo_tasks::function] - fn to_string(&self) -> Result> { - Ok(Vc::cell("Ecmascript Dev Chunk".into())) + fn to_string(&self) -> Vc { + Vc::cell("Ecmascript Dev Chunk".into()) } } diff --git a/turbopack/crates/turbopack-browser/src/ecmascript/content.rs b/turbopack/crates/turbopack-browser/src/ecmascript/content.rs index 95d53351d409b..f0ef941ed077e 100644 --- a/turbopack/crates/turbopack-browser/src/ecmascript/content.rs +++ b/turbopack/crates/turbopack-browser/src/ecmascript/content.rs @@ -47,20 +47,20 @@ impl EcmascriptDevChunkContent { } #[turbo_tasks::function] - pub fn entries(&self) -> Result> { - Ok(self.entries) + pub fn entries(&self) -> Vc { + self.entries } } #[turbo_tasks::value_impl] impl EcmascriptDevChunkContent { #[turbo_tasks::function] - pub(crate) fn own_version(&self) -> Result> { - Ok(EcmascriptDevChunkVersion::new( + pub(crate) fn own_version(&self) -> Vc { + EcmascriptDevChunkVersion::new( self.chunking_context.output_root(), self.chunk.ident().path(), self.entries, - )) + ) } #[turbo_tasks::function] diff --git a/turbopack/crates/turbopack-browser/src/ecmascript/evaluate/chunk.rs b/turbopack/crates/turbopack-browser/src/ecmascript/evaluate/chunk.rs index 8416b828bf9dd..7d0aec369ce7f 100644 --- a/turbopack/crates/turbopack-browser/src/ecmascript/evaluate/chunk.rs +++ b/turbopack/crates/turbopack-browser/src/ecmascript/evaluate/chunk.rs @@ -57,11 +57,8 @@ impl EcmascriptDevEvaluateChunk { } #[turbo_tasks::function] - fn chunks_data(&self) -> Result> { - Ok(ChunkData::from_assets( - self.chunking_context.output_root(), - self.other_chunks, - )) + fn chunks_data(&self) -> Vc { + ChunkData::from_assets(self.chunking_context.output_root(), self.other_chunks) } #[turbo_tasks::function] @@ -191,8 +188,8 @@ impl EcmascriptDevEvaluateChunk { #[turbo_tasks::value_impl] impl ValueToString for EcmascriptDevEvaluateChunk { #[turbo_tasks::function] - fn to_string(&self) -> Result> { - Ok(Vc::cell("Ecmascript Dev Evaluate Chunk".into())) + fn to_string(&self) -> Vc { + Vc::cell("Ecmascript Dev Evaluate Chunk".into()) } } diff --git a/turbopack/crates/turbopack-browser/src/ecmascript/list/asset.rs b/turbopack/crates/turbopack-browser/src/ecmascript/list/asset.rs index eb6639ff63614..9e312e9930260 100644 --- a/turbopack/crates/turbopack-browser/src/ecmascript/list/asset.rs +++ b/turbopack/crates/turbopack-browser/src/ecmascript/list/asset.rs @@ -61,8 +61,8 @@ impl EcmascriptDevChunkList { #[turbo_tasks::value_impl] impl ValueToString for EcmascriptDevChunkList { #[turbo_tasks::function] - fn to_string(&self) -> Result> { - Ok(Vc::cell("Ecmascript Dev Chunk List".into())) + fn to_string(&self) -> Vc { + Vc::cell("Ecmascript Dev Chunk List".into()) } } @@ -111,8 +111,8 @@ impl OutputAsset for EcmascriptDevChunkList { } #[turbo_tasks::function] - fn references(&self) -> Result> { - Ok(self.chunks) + fn references(&self) -> Vc { + self.chunks } } diff --git a/turbopack/crates/turbopack-browser/src/ecmascript/runtime.rs b/turbopack/crates/turbopack-browser/src/ecmascript/runtime.rs index 4c68b95738ec5..9d21a5afab615 100644 --- a/turbopack/crates/turbopack-browser/src/ecmascript/runtime.rs +++ b/turbopack/crates/turbopack-browser/src/ecmascript/runtime.rs @@ -46,8 +46,8 @@ impl EcmascriptDevChunkRuntime { #[turbo_tasks::value_impl] impl ValueToString for EcmascriptDevChunkRuntime { #[turbo_tasks::function] - fn to_string(&self) -> Result> { - Ok(Vc::cell("Ecmascript Dev Runtime".to_string())) + fn to_string(&self) -> Vc { + Vc::cell("Ecmascript Dev Runtime".to_string()) } } diff --git a/turbopack/crates/turbopack-cli/src/contexts.rs b/turbopack/crates/turbopack-cli/src/contexts.rs index 87c6cf317687a..6d6566e57c82e 100644 --- a/turbopack/crates/turbopack-cli/src/contexts.rs +++ b/turbopack/crates/turbopack-cli/src/contexts.rs @@ -50,7 +50,7 @@ async fn foreign_code_context_condition() -> Result { } #[turbo_tasks::function] -pub fn get_client_import_map(project_path: Vc) -> Result> { +pub fn get_client_import_map(project_path: Vc) -> Vc { let mut import_map = ImportMap::empty(); import_map.insert_singleton_alias("@swc/helpers", project_path); @@ -67,7 +67,7 @@ pub fn get_client_import_map(project_path: Vc) -> Result>, eager_compile: bool, browserslist_query: RcStr, -) -> Result>> { +) -> Vc> { let project_relative = project_dir.strip_prefix(&*root_dir).unwrap(); let project_relative: RcStr = project_relative .strip_prefix(MAIN_SEPARATOR) @@ -303,13 +303,11 @@ async fn source( .cell(), ); let main_source = Vc::upcast(main_source); - let source = Vc::upcast(PrefixedRouterContentSource::new( + Vc::upcast(PrefixedRouterContentSource::new( Default::default(), vec![("__turbopack__".into(), introspect)], main_source, - )); - - Ok(source) + )) } pub fn register() { diff --git a/turbopack/crates/turbopack-core/src/chunk/data.rs b/turbopack/crates/turbopack-core/src/chunk/data.rs index 77eae0d15d018..0374359338544 100644 --- a/turbopack/crates/turbopack-core/src/chunk/data.rs +++ b/turbopack/crates/turbopack-core/src/chunk/data.rs @@ -137,7 +137,7 @@ impl ChunkData { /// Returns [`OutputAsset`]s that this chunk data references. #[turbo_tasks::function] - pub fn references(&self) -> Result> { - Ok(self.references) + pub fn references(&self) -> Vc { + self.references } } diff --git a/turbopack/crates/turbopack-core/src/code_builder.rs b/turbopack/crates/turbopack-core/src/code_builder.rs index 8112c94310246..bdecf513ef13e 100644 --- a/turbopack/crates/turbopack-core/src/code_builder.rs +++ b/turbopack/crates/turbopack-core/src/code_builder.rs @@ -191,9 +191,9 @@ impl GenerateSourceMap for Code { impl Code { /// Returns the hash of the source code of this Code. #[turbo_tasks::function] - pub fn source_code_hash(&self) -> Result> { + pub fn source_code_hash(&self) -> Vc { let code = self; let hash = hash_xxh3_hash64(code.source_code()); - Ok(Vc::cell(hash)) + Vc::cell(hash) } } diff --git a/turbopack/crates/turbopack-core/src/compile_time_info.rs b/turbopack/crates/turbopack-core/src/compile_time_info.rs index 5d1a5ad7c71bb..05e7f8796cb2a 100644 --- a/turbopack/crates/turbopack-core/src/compile_time_info.rs +++ b/turbopack/crates/turbopack-core/src/compile_time_info.rs @@ -1,4 +1,3 @@ -use anyhow::Result; use indexmap::IndexMap; use turbo_tasks::{RcStr, Vc}; use turbo_tasks_fs::FileSystemPath; @@ -263,8 +262,8 @@ impl CompileTimeInfo { } #[turbo_tasks::function] - pub fn environment(&self) -> Result> { - Ok(self.environment) + pub fn environment(&self) -> Vc { + self.environment } } diff --git a/turbopack/crates/turbopack-core/src/environment.rs b/turbopack/crates/turbopack-core/src/environment.rs index aa6e32c367f22..31812a7a9b380 100644 --- a/turbopack/crates/turbopack-core/src/environment.rs +++ b/turbopack/crates/turbopack-core/src/environment.rs @@ -93,57 +93,57 @@ impl Environment { } #[turbo_tasks::function] - pub fn node_externals(&self) -> Result> { - Ok(match self.execution { + pub fn node_externals(&self) -> Vc { + match self.execution { ExecutionEnvironment::NodeJsBuildTime(..) | ExecutionEnvironment::NodeJsLambda(_) => { Vc::cell(true) } ExecutionEnvironment::Browser(_) => Vc::cell(false), ExecutionEnvironment::EdgeWorker(_) => Vc::cell(false), ExecutionEnvironment::Custom(_) => todo!(), - }) + } } #[turbo_tasks::function] - pub fn supports_esm_externals(&self) -> Result> { - Ok(match self.execution { + pub fn supports_esm_externals(&self) -> Vc { + match self.execution { ExecutionEnvironment::NodeJsBuildTime(..) | ExecutionEnvironment::NodeJsLambda(_) => { Vc::cell(true) } ExecutionEnvironment::Browser(_) => Vc::cell(false), ExecutionEnvironment::EdgeWorker(_) => Vc::cell(false), ExecutionEnvironment::Custom(_) => todo!(), - }) + } } #[turbo_tasks::function] - pub fn supports_commonjs_externals(&self) -> Result> { - Ok(match self.execution { + pub fn supports_commonjs_externals(&self) -> Vc { + match self.execution { ExecutionEnvironment::NodeJsBuildTime(..) | ExecutionEnvironment::NodeJsLambda(_) => { Vc::cell(true) } ExecutionEnvironment::Browser(_) => Vc::cell(false), ExecutionEnvironment::EdgeWorker(_) => Vc::cell(true), ExecutionEnvironment::Custom(_) => todo!(), - }) + } } #[turbo_tasks::function] - pub fn supports_wasm(&self) -> Result> { - Ok(match self.execution { + pub fn supports_wasm(&self) -> Vc { + match self.execution { ExecutionEnvironment::NodeJsBuildTime(..) | ExecutionEnvironment::NodeJsLambda(_) => { Vc::cell(true) } ExecutionEnvironment::Browser(_) => Vc::cell(false), ExecutionEnvironment::EdgeWorker(_) => Vc::cell(false), ExecutionEnvironment::Custom(_) => todo!(), - }) + } } #[turbo_tasks::function] - pub fn resolve_extensions(&self) -> Result>> { + pub fn resolve_extensions(&self) -> Vc> { let env = self; - Ok(match env.execution { + match env.execution { ExecutionEnvironment::NodeJsBuildTime(..) | ExecutionEnvironment::NodeJsLambda(_) => { Vc::cell(vec![".js".into(), ".node".into(), ".json".into()]) } @@ -151,13 +151,13 @@ impl Environment { Vc::>::default() } ExecutionEnvironment::Custom(_) => todo!(), - }) + } } #[turbo_tasks::function] - pub fn resolve_node_modules(&self) -> Result> { + pub fn resolve_node_modules(&self) -> Vc { let env = self; - Ok(match env.execution { + match env.execution { ExecutionEnvironment::NodeJsBuildTime(..) | ExecutionEnvironment::NodeJsLambda(_) => { Vc::cell(true) } @@ -165,13 +165,13 @@ impl Environment { Vc::cell(false) } ExecutionEnvironment::Custom(_) => todo!(), - }) + } } #[turbo_tasks::function] - pub fn resolve_conditions(&self) -> Result>> { + pub fn resolve_conditions(&self) -> Vc> { let env = self; - Ok(match env.execution { + match env.execution { ExecutionEnvironment::NodeJsBuildTime(..) | ExecutionEnvironment::NodeJsLambda(_) => { Vc::cell(vec!["node".into()]) } @@ -180,7 +180,7 @@ impl Environment { Vc::cell(vec!["edge-light".into(), "worker".into()]) } ExecutionEnvironment::Custom(_) => todo!(), - }) + } } #[turbo_tasks::function] @@ -194,29 +194,29 @@ impl Environment { } #[turbo_tasks::function] - pub fn rendering(&self) -> Result> { + pub fn rendering(&self) -> Vc { let env = self; - Ok(match env.execution { + match env.execution { ExecutionEnvironment::NodeJsBuildTime(_) | ExecutionEnvironment::NodeJsLambda(_) => { Rendering::Server.cell() } ExecutionEnvironment::EdgeWorker(_) => Rendering::Server.cell(), ExecutionEnvironment::Browser(_) => Rendering::Client.cell(), _ => Rendering::None.cell(), - }) + } } #[turbo_tasks::function] - pub fn chunk_loading(&self) -> Result> { + pub fn chunk_loading(&self) -> Vc { let env = self; - Ok(match env.execution { + match env.execution { ExecutionEnvironment::NodeJsBuildTime(_) | ExecutionEnvironment::NodeJsLambda(_) => { ChunkLoading::NodeJs.cell() } ExecutionEnvironment::EdgeWorker(_) => ChunkLoading::Edge.cell(), ExecutionEnvironment::Browser(_) => ChunkLoading::Dom.cell(), ExecutionEnvironment::Custom(_) => todo!(), - }) + } } } diff --git a/turbopack/crates/turbopack-core/src/issue/mod.rs b/turbopack/crates/turbopack-core/src/issue/mod.rs index 2ffa9d6d29ca4..eb8281e394c6e 100644 --- a/turbopack/crates/turbopack-core/src/issue/mod.rs +++ b/turbopack/crates/turbopack-core/src/issue/mod.rs @@ -368,8 +368,8 @@ pub struct CapturedIssues { #[turbo_tasks::value_impl] impl CapturedIssues { #[turbo_tasks::function] - pub fn is_empty(&self) -> Result> { - Ok(Vc::cell(self.is_empty_ref())) + pub fn is_empty(&self) -> Vc { + Vc::cell(self.is_empty_ref()) } } @@ -761,8 +761,8 @@ impl PlainIssue { /// same issue to pass from multiple processing paths, making for overly /// verbose logging. #[turbo_tasks::function] - pub fn internal_hash(&self, full: bool) -> Result> { - Ok(Vc::cell(self.internal_hash_ref(full))) + pub fn internal_hash(&self, full: bool) -> Vc { + Vc::cell(self.internal_hash_ref(full)) } } diff --git a/turbopack/crates/turbopack-core/src/reference/mod.rs b/turbopack/crates/turbopack-core/src/reference/mod.rs index 81859a482ed42..ae57b33e7019c 100644 --- a/turbopack/crates/turbopack-core/src/reference/mod.rs +++ b/turbopack/crates/turbopack-core/src/reference/mod.rs @@ -86,8 +86,8 @@ impl SingleModuleReference { /// The [Vc>] that this reference resolves to. #[turbo_tasks::function] - pub fn asset(&self) -> Result>> { - Ok(self.asset) + pub fn asset(&self) -> Vc> { + self.asset } } @@ -132,8 +132,8 @@ impl SingleOutputAssetReference { /// The [Vc>] that this reference resolves to. #[turbo_tasks::function] - pub fn asset(&self) -> Result>> { - Ok(self.asset) + pub fn asset(&self) -> Vc> { + self.asset } } diff --git a/turbopack/crates/turbopack-core/src/resolve/mod.rs b/turbopack/crates/turbopack-core/src/resolve/mod.rs index ae066ae897dcd..fa9ad1e0cb147 100644 --- a/turbopack/crates/turbopack-core/src/resolve/mod.rs +++ b/turbopack/crates/turbopack-core/src/resolve/mod.rs @@ -319,18 +319,16 @@ impl ModuleResolveResult { } #[turbo_tasks::function] - pub fn is_unresolveable(&self) -> Result> { - Ok(Vc::cell(self.is_unresolveable_ref())) + pub fn is_unresolveable(&self) -> Vc { + Vc::cell(self.is_unresolveable_ref()) } #[turbo_tasks::function] - pub fn first_module(&self) -> Result> { - Ok(Vc::cell(self.primary.iter().find_map( - |(_, item)| match item { - &ModuleResolveResultItem::Module(a) => Some(a), - _ => None, - }, - ))) + pub fn first_module(&self) -> Vc { + Vc::cell(self.primary.iter().find_map(|(_, item)| match item { + &ModuleResolveResultItem::Module(a) => Some(a), + _ => None, + })) } /// Returns a set (no duplicates) of primary modules in the result. All @@ -357,8 +355,8 @@ impl ModuleResolveResult { } #[turbo_tasks::function] - pub fn primary_output_assets(&self) -> Result> { - Ok(Vc::cell( + pub fn primary_output_assets(&self) -> Vc { + Vc::cell( self.primary .iter() .filter_map(|(_, item)| match item { @@ -366,7 +364,7 @@ impl ModuleResolveResult { _ => None, }) .collect(), - )) + ) } } @@ -847,24 +845,24 @@ impl ResolveResult { } #[turbo_tasks::function] - pub fn is_unresolveable(&self) -> Result> { - Ok(Vc::cell(self.is_unresolveable_ref())) + pub fn is_unresolveable(&self) -> Vc { + Vc::cell(self.is_unresolveable_ref()) } #[turbo_tasks::function] - pub fn first_source(&self) -> Result> { - Ok(Vc::cell(self.primary.iter().find_map(|(_, item)| { + pub fn first_source(&self) -> Vc { + Vc::cell(self.primary.iter().find_map(|(_, item)| { if let &ResolveResultItem::Source(a) = item { Some(a) } else { None } - }))) + })) } #[turbo_tasks::function] - pub fn primary_sources(&self) -> Result> { - Ok(Vc::cell( + pub fn primary_sources(&self) -> Vc { + Vc::cell( self.primary .iter() .filter_map(|(_, item)| { @@ -875,7 +873,7 @@ impl ResolveResult { } }) .collect(), - )) + ) } /// Returns a new [ResolveResult] where all [RequestKey]s are updated. The `old_request_key` @@ -953,7 +951,7 @@ impl ResolveResult { /// Returns a new [ResolveResult] where all [RequestKey]s are set to the /// passed `request`. #[turbo_tasks::function] - pub fn with_request(&self, request: RcStr) -> Result> { + pub fn with_request(&self, request: RcStr) -> Vc { let new_primary = self .primary .iter() @@ -967,11 +965,11 @@ impl ResolveResult { ) }) .collect(); - Ok(ResolveResult { + ResolveResult { primary: new_primary, affecting_sources: self.affecting_sources.clone(), } - .into()) + .into() } } diff --git a/turbopack/crates/turbopack-core/src/source_map/source_map_asset.rs b/turbopack/crates/turbopack-core/src/source_map/source_map_asset.rs index 97944a69be620..2716d17b749d2 100644 --- a/turbopack/crates/turbopack-core/src/source_map/source_map_asset.rs +++ b/turbopack/crates/turbopack-core/src/source_map/source_map_asset.rs @@ -28,12 +28,10 @@ impl SourceMapAsset { #[turbo_tasks::value_impl] impl OutputAsset for SourceMapAsset { #[turbo_tasks::function] - fn ident(&self) -> Result> { + fn ident(&self) -> Vc { // NOTE(alexkirsz) We used to include the asset's version id in the path, // but this caused `all_assets_map` to be recomputed on every change. - Ok(AssetIdent::from_path( - self.asset.ident().path().append(".map".into()), - )) + AssetIdent::from_path(self.asset.ident().path().append(".map".into())) } } diff --git a/turbopack/crates/turbopack-core/src/source_transform.rs b/turbopack/crates/turbopack-core/src/source_transform.rs index bed7fde8692fe..64efc665928c2 100644 --- a/turbopack/crates/turbopack-core/src/source_transform.rs +++ b/turbopack/crates/turbopack-core/src/source_transform.rs @@ -1,4 +1,3 @@ -use anyhow::Result; use turbo_tasks::Vc; use crate::source::Source; @@ -14,10 +13,9 @@ pub struct SourceTransforms(Vec>>); #[turbo_tasks::value_impl] impl SourceTransforms { #[turbo_tasks::function] - pub fn transform(&self, source: Vc>) -> Result>> { - Ok(self - .0 + pub fn transform(&self, source: Vc>) -> Vc> { + self.0 .iter() - .fold(source, |source, transform| transform.transform(source))) + .fold(source, |source, transform| transform.transform(source)) } } diff --git a/turbopack/crates/turbopack-core/src/version.rs b/turbopack/crates/turbopack-core/src/version.rs index 9ab28c3477524..0d49e255f2059 100644 --- a/turbopack/crates/turbopack-core/src/version.rs +++ b/turbopack/crates/turbopack-core/src/version.rs @@ -236,8 +236,8 @@ impl FileHashVersion { #[turbo_tasks::value_impl] impl Version for FileHashVersion { #[turbo_tasks::function] - fn id(&self) -> Result> { - Ok(Vc::cell(self.hash.clone())) + fn id(&self) -> Vc { + Vc::cell(self.hash.clone()) } } @@ -250,9 +250,9 @@ pub struct VersionState { #[turbo_tasks::value_impl] impl VersionState { #[turbo_tasks::function] - pub fn get(&self) -> Result>> { + pub fn get(&self) -> Vc> { let version = TraitRef::cell(self.version.get().clone()); - Ok(version) + version } } diff --git a/turbopack/crates/turbopack-css/src/asset.rs b/turbopack/crates/turbopack-css/src/asset.rs index 2b3830ca75e82..e3495efd5425a 100644 --- a/turbopack/crates/turbopack-css/src/asset.rs +++ b/turbopack/crates/turbopack-css/src/asset.rs @@ -65,8 +65,8 @@ impl CssModuleAsset { /// Retrns the asset ident of the source without the "css" modifier #[turbo_tasks::function] - pub fn source_ident(&self) -> Result> { - Ok(self.source.ident()) + pub fn source_ident(&self) -> Vc { + self.source.ident() } } @@ -90,20 +90,20 @@ impl ParseCss for CssModuleAsset { #[turbo_tasks::value_impl] impl ProcessCss for CssModuleAsset { #[turbo_tasks::function] - fn get_css_with_placeholder(self: Vc) -> Result> { + fn get_css_with_placeholder(self: Vc) -> Vc { let parse_result = self.parse_css(); - Ok(process_css_with_placeholder(parse_result)) + process_css_with_placeholder(parse_result) } #[turbo_tasks::function] fn finalize_css( self: Vc, chunking_context: Vc>, - ) -> Result> { + ) -> Vc { let process_result = self.get_css_with_placeholder(); - Ok(finalize_css(process_result, chunking_context)) + finalize_css(process_result, chunking_context) } } diff --git a/turbopack/crates/turbopack-css/src/chunk/single_item_chunk/chunk.rs b/turbopack/crates/turbopack-css/src/chunk/single_item_chunk/chunk.rs index 3460f6ca8161e..6b2560d46e95d 100644 --- a/turbopack/crates/turbopack-css/src/chunk/single_item_chunk/chunk.rs +++ b/turbopack/crates/turbopack-css/src/chunk/single_item_chunk/chunk.rs @@ -100,15 +100,15 @@ fn single_item_modifier() -> Vc { #[turbo_tasks::value_impl] impl OutputAsset for SingleItemCssChunk { #[turbo_tasks::function] - fn ident(&self) -> Result> { - Ok(AssetIdent::from_path( + fn ident(&self) -> Vc { + AssetIdent::from_path( self.chunking_context.chunk_path( self.item .asset_ident() .with_modifier(single_item_modifier()), ".css".into(), ), - )) + ) } #[turbo_tasks::function] diff --git a/turbopack/crates/turbopack-css/src/chunk/single_item_chunk/source_map.rs b/turbopack/crates/turbopack-css/src/chunk/single_item_chunk/source_map.rs index d9b07ce9539ef..a02dd1b48c78c 100644 --- a/turbopack/crates/turbopack-css/src/chunk/single_item_chunk/source_map.rs +++ b/turbopack/crates/turbopack-css/src/chunk/single_item_chunk/source_map.rs @@ -28,10 +28,8 @@ impl SingleItemCssChunkSourceMapAsset { #[turbo_tasks::value_impl] impl OutputAsset for SingleItemCssChunkSourceMapAsset { #[turbo_tasks::function] - fn ident(&self) -> Result> { - Ok(AssetIdent::from_path( - self.chunk.path().append(".map".into()), - )) + fn ident(&self) -> Vc { + AssetIdent::from_path(self.chunk.path().append(".map".into())) } } diff --git a/turbopack/crates/turbopack-css/src/chunk/source_map.rs b/turbopack/crates/turbopack-css/src/chunk/source_map.rs index 840634b257072..cdc5978f01f1c 100644 --- a/turbopack/crates/turbopack-css/src/chunk/source_map.rs +++ b/turbopack/crates/turbopack-css/src/chunk/source_map.rs @@ -28,10 +28,8 @@ impl CssChunkSourceMapAsset { #[turbo_tasks::value_impl] impl OutputAsset for CssChunkSourceMapAsset { #[turbo_tasks::function] - fn ident(&self) -> Result> { - Ok(AssetIdent::from_path( - self.chunk.path().append(".map".into()), - )) + fn ident(&self) -> Vc { + AssetIdent::from_path(self.chunk.path().append(".map".into())) } } diff --git a/turbopack/crates/turbopack-css/src/module_asset.rs b/turbopack/crates/turbopack-css/src/module_asset.rs index 7afeebc834c3e..ded5b82c09040 100644 --- a/turbopack/crates/turbopack-css/src/module_asset.rs +++ b/turbopack/crates/turbopack-css/src/module_asset.rs @@ -49,14 +49,11 @@ pub struct ModuleCssAsset { #[turbo_tasks::value_impl] impl ModuleCssAsset { #[turbo_tasks::function] - pub fn new( - source: Vc>, - asset_context: Vc>, - ) -> Result> { - Ok(Self::cell(ModuleCssAsset { + pub fn new(source: Vc>, asset_context: Vc>) -> Vc { + Self::cell(ModuleCssAsset { source, asset_context, - })) + }) } } @@ -152,11 +149,11 @@ struct ModuleCssClasses(IndexMap>); #[turbo_tasks::value_impl] impl ModuleCssAsset { #[turbo_tasks::function] - fn inner(&self) -> Result> { - Ok(self.asset_context.process( + fn inner(&self) -> Vc { + self.asset_context.process( self.source, Value::new(ReferenceType::Css(CssReferenceSubType::Internal)), - )) + ) } #[turbo_tasks::function] @@ -237,14 +234,14 @@ impl ChunkableModule for ModuleCssAsset { fn as_chunk_item( self: Vc, chunking_context: Vc>, - ) -> Result>> { - Ok(Vc::upcast( + ) -> Vc> { + Vc::upcast( ModuleChunkItem { chunking_context, module: self, } .cell(), - )) + ) } } @@ -439,11 +436,9 @@ impl Issue for CssModuleComposesIssue { } #[turbo_tasks::function] - fn title(&self) -> Result> { - Ok(StyledString::Text( - "An issue occurred while resolving a CSS module `composes:` rule".into(), - ) - .cell()) + fn title(&self) -> Vc { + StyledString::Text("An issue occurred while resolving a CSS module `composes:` rule".into()) + .cell() } #[turbo_tasks::function] diff --git a/turbopack/crates/turbopack-dev-server/src/html.rs b/turbopack/crates/turbopack-dev-server/src/html.rs index abb134fb237a6..a628d268ecb61 100644 --- a/turbopack/crates/turbopack-dev-server/src/html.rs +++ b/turbopack/crates/turbopack-dev-server/src/html.rs @@ -241,7 +241,7 @@ struct DevHtmlAssetVersion { #[turbo_tasks::value_impl] impl Version for DevHtmlAssetVersion { #[turbo_tasks::function] - fn id(&self) -> Result> { + fn id(&self) -> Vc { let mut hasher = Xxh3Hash64Hasher::new(); for relative_path in &*self.content.chunk_paths { hasher.write_ref(relative_path); @@ -251,6 +251,6 @@ impl Version for DevHtmlAssetVersion { } let hash = hasher.finish(); let hex_hash = encode_hex(hash); - Ok(Vc::cell(hex_hash.into())) + Vc::cell(hex_hash.into()) } } diff --git a/turbopack/crates/turbopack-dev-server/src/source/conditional.rs b/turbopack/crates/turbopack-dev-server/src/source/conditional.rs index 7d22af561452f..182ca218f84f4 100644 --- a/turbopack/crates/turbopack-dev-server/src/source/conditional.rs +++ b/turbopack/crates/turbopack-dev-server/src/source/conditional.rs @@ -108,15 +108,15 @@ impl Introspectable for ConditionalContentSource { } #[turbo_tasks::function] - fn details(&self) -> Result> { - Ok(Vc::cell( + fn details(&self) -> Vc { + Vc::cell( if *self.activated.get() { "activated" } else { "not activated" } .into(), - )) + ) } #[turbo_tasks::function] diff --git a/turbopack/crates/turbopack-dev-server/src/source/router.rs b/turbopack/crates/turbopack-dev-server/src/source/router.rs index fea17074e90ef..d0fc8dcb91787 100644 --- a/turbopack/crates/turbopack-dev-server/src/source/router.rs +++ b/turbopack/crates/turbopack-dev-server/src/source/router.rs @@ -29,13 +29,13 @@ impl PrefixedRouterContentSource { prefix: Vc, routes: Vec<(RcStr, Vc>)>, fallback: Vc>, - ) -> Result> { - Ok(PrefixedRouterContentSource { + ) -> Vc { + PrefixedRouterContentSource { prefix, routes, fallback, } - .cell()) + .cell() } } diff --git a/turbopack/crates/turbopack-dev-server/src/update/stream.rs b/turbopack/crates/turbopack-dev-server/src/update/stream.rs index e62d2c88e5c0b..ff502a8d56462 100644 --- a/turbopack/crates/turbopack-dev-server/src/update/stream.rs +++ b/turbopack/crates/turbopack-dev-server/src/update/stream.rs @@ -164,7 +164,7 @@ async fn compute_update_stream( from: Vc, get_content: TransientInstance, sender: TransientInstance>>>, -) -> Result> { +) -> Vc<()> { let item = get_update_stream_item(resource, from, get_content) .strongly_consistent() .await; @@ -172,7 +172,7 @@ async fn compute_update_stream( // Send update. Ignore channel closed error. let _ = sender.send(item).await; - Ok(Default::default()) + Default::default() } pub(super) struct UpdateStream( diff --git a/turbopack/crates/turbopack-ecmascript-plugins/src/transform/swc_ecma_transform_plugins.rs b/turbopack/crates/turbopack-ecmascript-plugins/src/transform/swc_ecma_transform_plugins.rs index fe7a4be6a92cd..f72bb4ec2ec3d 100644 --- a/turbopack/crates/turbopack-ecmascript-plugins/src/transform/swc_ecma_transform_plugins.rs +++ b/turbopack/crates/turbopack-ecmascript-plugins/src/transform/swc_ecma_transform_plugins.rs @@ -64,11 +64,9 @@ impl Issue for UnsupportedSwcEcmaTransformPluginsIssue { } #[turbo_tasks::function] - fn title(&self) -> Result> { - Ok(StyledString::Text( - "Unsupported SWC EcmaScript transform plugins on this platform.".into(), - ) - .cell()) + fn title(&self) -> Vc { + StyledString::Text("Unsupported SWC EcmaScript transform plugins on this platform.".into()) + .cell() } #[turbo_tasks::function] diff --git a/turbopack/crates/turbopack-ecmascript/src/async_chunk/module.rs b/turbopack/crates/turbopack-ecmascript/src/async_chunk/module.rs index 94daedfed109f..b0600289fbca8 100644 --- a/turbopack/crates/turbopack-ecmascript/src/async_chunk/module.rs +++ b/turbopack/crates/turbopack-ecmascript/src/async_chunk/module.rs @@ -80,13 +80,13 @@ impl ChunkableModule for AsyncLoaderModule { fn as_chunk_item( self: Vc, chunking_context: Vc>, - ) -> Result>> { - Ok(Vc::upcast( + ) -> Vc> { + Vc::upcast( AsyncLoaderChunkItem { chunking_context, module: self, } .cell(), - )) + ) } } diff --git a/turbopack/crates/turbopack-ecmascript/src/chunk/mod.rs b/turbopack/crates/turbopack-ecmascript/src/chunk/mod.rs index ff631b9d6f80d..ccfcc77c527c9 100644 --- a/turbopack/crates/turbopack-ecmascript/src/chunk/mod.rs +++ b/turbopack/crates/turbopack-ecmascript/src/chunk/mod.rs @@ -48,18 +48,18 @@ impl EcmascriptChunk { pub fn new( chunking_context: Vc>, content: Vc, - ) -> Result> { - Ok(EcmascriptChunk { + ) -> Vc { + EcmascriptChunk { chunking_context, content, } - .cell()) + .cell() } #[turbo_tasks::function] - pub fn entry_ids(self: Vc) -> Result> { + pub fn entry_ids(self: Vc) -> Vc { // TODO return something usefull - Ok(Vc::cell(Default::default())) + Vc::cell(Default::default()) } } diff --git a/turbopack/crates/turbopack-ecmascript/src/chunk_group_files_asset.rs b/turbopack/crates/turbopack-ecmascript/src/chunk_group_files_asset.rs index fd9c8d972b34e..47979ca5dd6ce 100644 --- a/turbopack/crates/turbopack-ecmascript/src/chunk_group_files_asset.rs +++ b/turbopack/crates/turbopack-ecmascript/src/chunk_group_files_asset.rs @@ -249,12 +249,12 @@ impl Introspectable for ChunkGroupFilesAsset { } #[turbo_tasks::function] - fn children(&self) -> Result> { + fn children(&self) -> Vc { let mut children = IndexSet::new(); children.insert(( Vc::cell("inner asset".into()), IntrospectableModule::new(Vc::upcast(self.module)), )); - Ok(Vc::cell(children)) + Vc::cell(children) } } diff --git a/turbopack/crates/turbopack-ecmascript/src/lib.rs b/turbopack/crates/turbopack-ecmascript/src/lib.rs index 4b45c88067ab7..cd1e487df7273 100644 --- a/turbopack/crates/turbopack-ecmascript/src/lib.rs +++ b/turbopack/crates/turbopack-ecmascript/src/lib.rs @@ -352,13 +352,13 @@ impl EcmascriptParsable for EcmascriptModuleAsset { } #[turbo_tasks::function] - fn parse_original(self: Vc) -> Result> { - Ok(self.failsafe_parse()) + fn parse_original(self: Vc) -> Vc { + self.failsafe_parse() } #[turbo_tasks::function] - fn ty(&self) -> Result> { - Ok(self.ty.cell()) + fn ty(&self) -> Vc { + self.ty.cell() } } @@ -461,8 +461,8 @@ impl EcmascriptModuleAsset { } #[turbo_tasks::function] - pub fn source(&self) -> Result>> { - Ok(self.source) + pub fn source(&self) -> Vc> { + self.source } #[turbo_tasks::function] @@ -471,8 +471,8 @@ impl EcmascriptModuleAsset { } #[turbo_tasks::function] - pub fn options(&self) -> Result> { - Ok(self.options) + pub fn options(&self) -> Vc { + self.options } #[turbo_tasks::function] @@ -572,11 +572,11 @@ impl ChunkableModule for EcmascriptModuleAsset { fn as_chunk_item( self: Vc, chunking_context: Vc>, - ) -> Result>> { - Ok(Vc::upcast(ModuleChunkItem::cell(ModuleChunkItem { + ) -> Vc> { + Vc::upcast(ModuleChunkItem::cell(ModuleChunkItem { module: self, chunking_context, - }))) + })) } } diff --git a/turbopack/crates/turbopack-ecmascript/src/manifest/chunk_asset.rs b/turbopack/crates/turbopack-ecmascript/src/manifest/chunk_asset.rs index eed27101735f8..5aebe9d7716e6 100644 --- a/turbopack/crates/turbopack-ecmascript/src/manifest/chunk_asset.rs +++ b/turbopack/crates/turbopack-ecmascript/src/manifest/chunk_asset.rs @@ -52,10 +52,9 @@ impl ManifestAsyncModule { } #[turbo_tasks::function] - pub(super) fn chunks(&self) -> Result> { - Ok(self - .chunking_context - .chunk_group_assets(Vc::upcast(self.inner), Value::new(self.availability_info))) + pub(super) fn chunks(&self) -> Vc { + self.chunking_context + .chunk_group_assets(Vc::upcast(self.inner), Value::new(self.availability_info)) } #[turbo_tasks::function] @@ -142,14 +141,14 @@ impl ChunkableModule for ManifestAsyncModule { fn as_chunk_item( self: Vc, chunking_context: Vc>, - ) -> Result>> { - Ok(Vc::upcast( + ) -> Vc> { + Vc::upcast( ManifestChunkItem { chunking_context, manifest: self, } .cell(), - )) + ) } } diff --git a/turbopack/crates/turbopack-ecmascript/src/manifest/chunk_item.rs b/turbopack/crates/turbopack-ecmascript/src/manifest/chunk_item.rs index 4d09a1aac005e..3fe862d4d321a 100644 --- a/turbopack/crates/turbopack-ecmascript/src/manifest/chunk_item.rs +++ b/turbopack/crates/turbopack-ecmascript/src/manifest/chunk_item.rs @@ -29,11 +29,8 @@ pub(super) struct ManifestChunkItem { #[turbo_tasks::value_impl] impl ManifestChunkItem { #[turbo_tasks::function] - fn chunks_data(&self) -> Result> { - Ok(ChunkData::from_assets( - self.chunking_context.output_root(), - self.manifest.chunks(), - )) + fn chunks_data(&self) -> Vc { + ChunkData::from_assets(self.chunking_context.output_root(), self.manifest.chunks()) } } diff --git a/turbopack/crates/turbopack-ecmascript/src/manifest/loader_item.rs b/turbopack/crates/turbopack-ecmascript/src/manifest/loader_item.rs index ece48fa38f8b1..986d4d88c6116 100644 --- a/turbopack/crates/turbopack-ecmascript/src/manifest/loader_item.rs +++ b/turbopack/crates/turbopack-ecmascript/src/manifest/loader_item.rs @@ -58,12 +58,9 @@ impl ManifestLoaderChunkItem { } #[turbo_tasks::function] - pub fn chunks_data(&self) -> Result> { + pub fn chunks_data(&self) -> Vc { let chunks = self.manifest.manifest_chunks(); - Ok(ChunkData::from_assets( - self.chunking_context.output_root(), - chunks, - )) + ChunkData::from_assets(self.chunking_context.output_root(), chunks) } #[turbo_tasks::function] @@ -124,8 +121,8 @@ impl ChunkItem for ManifestLoaderChunkItem { } #[turbo_tasks::function] - fn chunking_context(&self) -> Result>> { - Ok(Vc::upcast(self.chunking_context)) + fn chunking_context(&self) -> Vc> { + Vc::upcast(self.chunking_context) } #[turbo_tasks::function] diff --git a/turbopack/crates/turbopack-ecmascript/src/references/async_module.rs b/turbopack/crates/turbopack-ecmascript/src/references/async_module.rs index 72635f242690c..870eff270d907 100644 --- a/turbopack/crates/turbopack-ecmascript/src/references/async_module.rs +++ b/turbopack/crates/turbopack-ecmascript/src/references/async_module.rs @@ -176,14 +176,14 @@ impl AsyncModule { pub fn module_options( &self, async_module_info: Option>, - ) -> Result> { + ) -> Vc { if async_module_info.is_none() { - return Ok(Vc::cell(None)); + return Vc::cell(None); } - Ok(Vc::cell(Some(AsyncModuleOptions { + Vc::cell(Some(AsyncModuleOptions { has_top_level_await: self.has_top_level_await, - }))) + })) } #[turbo_tasks::function] diff --git a/turbopack/crates/turbopack-ecmascript/src/references/external_module.rs b/turbopack/crates/turbopack-ecmascript/src/references/external_module.rs index 7b2f8876f9582..69872667adff6 100644 --- a/turbopack/crates/turbopack-ecmascript/src/references/external_module.rs +++ b/turbopack/crates/turbopack-ecmascript/src/references/external_module.rs @@ -125,14 +125,14 @@ impl ChunkableModule for CachedExternalModule { fn as_chunk_item( self: Vc, chunking_context: Vc>, - ) -> Result>> { - Ok(Vc::upcast( + ) -> Vc> { + Vc::upcast( CachedExternalModuleChunkItem { module: self, chunking_context, } .cell(), - )) + ) } } @@ -230,18 +230,18 @@ impl EcmascriptChunkItem for CachedExternalModuleChunkItem { fn content_with_async_module_info( &self, async_module_info: Option>, - ) -> Result> { + ) -> Vc { let async_module_options = self .module .get_async_module() .module_options(async_module_info); - Ok(EcmascriptChunkItemContent::new( + EcmascriptChunkItemContent::new( self.module.content(), self.chunking_context, EcmascriptOptions::default().cell(), async_module_options, - )) + ) } } diff --git a/turbopack/crates/turbopack-ecmascript/src/references/require_context.rs b/turbopack/crates/turbopack-ecmascript/src/references/require_context.rs index 8a067f9dd16fd..24f1beb39a358 100644 --- a/turbopack/crates/turbopack-ecmascript/src/references/require_context.rs +++ b/turbopack/crates/turbopack-ecmascript/src/references/require_context.rs @@ -262,15 +262,15 @@ impl ModuleReference for RequireContextAssetReference { #[turbo_tasks::value_impl] impl ValueToString for RequireContextAssetReference { #[turbo_tasks::function] - async fn to_string(&self) -> Result> { - Ok(Vc::cell( + async fn to_string(&self) -> Vc { + Vc::cell( format!( "require.context {}/{}", self.dir, if self.include_subdirs { "**" } else { "*" }, ) .into(), - )) + ) } } @@ -317,8 +317,8 @@ impl ModuleReference for ResolvedModuleReference { #[turbo_tasks::value_impl] impl ValueToString for ResolvedModuleReference { #[turbo_tasks::function] - fn to_string(&self) -> Result> { - Ok(Vc::cell("resolved reference".into())) + fn to_string(&self) -> Vc { + Vc::cell("resolved reference".into()) } } diff --git a/turbopack/crates/turbopack-ecmascript/src/references/typescript.rs b/turbopack/crates/turbopack-ecmascript/src/references/typescript.rs index c7e177b80e366..b6347fc845a8e 100644 --- a/turbopack/crates/turbopack-ecmascript/src/references/typescript.rs +++ b/turbopack/crates/turbopack-ecmascript/src/references/typescript.rs @@ -97,10 +97,8 @@ impl ModuleReference for TsReferencePathAssetReference { #[turbo_tasks::value_impl] impl ValueToString for TsReferencePathAssetReference { #[turbo_tasks::function] - async fn to_string(&self) -> Result> { - Ok(Vc::cell( - format!("typescript reference path comment {}", self.path,).into(), - )) + async fn to_string(&self) -> Vc { + Vc::cell(format!("typescript reference path comment {}", self.path,).into()) } } @@ -138,9 +136,7 @@ impl ModuleReference for TsReferenceTypeAssetReference { #[turbo_tasks::value_impl] impl ValueToString for TsReferenceTypeAssetReference { #[turbo_tasks::function] - async fn to_string(&self) -> Result> { - Ok(Vc::cell( - format!("typescript reference type comment {}", self.module,).into(), - )) + async fn to_string(&self) -> Vc { + Vc::cell(format!("typescript reference type comment {}", self.module,).into()) } } diff --git a/turbopack/crates/turbopack-ecmascript/src/side_effect_optimization/facade/chunk_item.rs b/turbopack/crates/turbopack-ecmascript/src/side_effect_optimization/facade/chunk_item.rs index acf8a191af13b..0814e6399c2ca 100644 --- a/turbopack/crates/turbopack-ecmascript/src/side_effect_optimization/facade/chunk_item.rs +++ b/turbopack/crates/turbopack-ecmascript/src/side_effect_optimization/facade/chunk_item.rs @@ -162,8 +162,8 @@ impl ChunkItem for EcmascriptModuleFacadeChunkItem { } #[turbo_tasks::function] - fn asset_ident(&self) -> Result> { - Ok(self.module.ident()) + fn asset_ident(&self) -> Vc { + self.module.ident() } #[turbo_tasks::function] diff --git a/turbopack/crates/turbopack-ecmascript/src/side_effect_optimization/facade/module.rs b/turbopack/crates/turbopack-ecmascript/src/side_effect_optimization/facade/module.rs index b8de4653482b9..8dcec1e902f94 100644 --- a/turbopack/crates/turbopack-ecmascript/src/side_effect_optimization/facade/module.rs +++ b/turbopack/crates/turbopack-ecmascript/src/side_effect_optimization/facade/module.rs @@ -61,10 +61,10 @@ impl EcmascriptModuleFacadeModule { #[turbo_tasks::value_impl] impl Module for EcmascriptModuleFacadeModule { #[turbo_tasks::function] - fn ident(&self) -> Result> { + fn ident(&self) -> Vc { let inner = self.module.ident(); - Ok(inner.with_part(self.ty)) + inner.with_part(self.ty) } #[turbo_tasks::function] @@ -135,10 +135,10 @@ impl Module for EcmascriptModuleFacadeModule { #[turbo_tasks::value_impl] impl Asset for EcmascriptModuleFacadeModule { #[turbo_tasks::function] - fn content(&self) -> Result> { + fn content(&self) -> Vc { let f = File::from(""); - Ok(AssetContent::file(FileContent::Content(f).cell())) + AssetContent::file(FileContent::Content(f).cell()) } } @@ -286,14 +286,14 @@ impl ChunkableModule for EcmascriptModuleFacadeModule { fn as_chunk_item( self: Vc, chunking_context: Vc>, - ) -> Result>> { - Ok(Vc::upcast( + ) -> Vc> { + Vc::upcast( EcmascriptModuleFacadeChunkItem { module: self, chunking_context, } .cell(), - )) + ) } } diff --git a/turbopack/crates/turbopack-ecmascript/src/side_effect_optimization/locals/chunk_item.rs b/turbopack/crates/turbopack-ecmascript/src/side_effect_optimization/locals/chunk_item.rs index d547bab77f80d..7fba3a91d88aa 100644 --- a/turbopack/crates/turbopack-ecmascript/src/side_effect_optimization/locals/chunk_item.rs +++ b/turbopack/crates/turbopack-ecmascript/src/side_effect_optimization/locals/chunk_item.rs @@ -83,8 +83,8 @@ impl ChunkItem for EcmascriptModuleLocalsChunkItem { } #[turbo_tasks::function] - fn asset_ident(&self) -> Result> { - Ok(self.module.ident()) + fn asset_ident(&self) -> Vc { + self.module.ident() } #[turbo_tasks::function] diff --git a/turbopack/crates/turbopack-ecmascript/src/side_effect_optimization/locals/module.rs b/turbopack/crates/turbopack-ecmascript/src/side_effect_optimization/locals/module.rs index 97b20bbcdcfbb..167108ff51e37 100644 --- a/turbopack/crates/turbopack-ecmascript/src/side_effect_optimization/locals/module.rs +++ b/turbopack/crates/turbopack-ecmascript/src/side_effect_optimization/locals/module.rs @@ -41,10 +41,10 @@ impl EcmascriptModuleLocalsModule { #[turbo_tasks::value_impl] impl Module for EcmascriptModuleLocalsModule { #[turbo_tasks::function] - fn ident(&self) -> Result> { + fn ident(&self) -> Vc { let inner = self.module.ident(); - Ok(inner.with_part(ModulePart::locals())) + inner.with_part(ModulePart::locals()) } #[turbo_tasks::function] @@ -115,13 +115,13 @@ impl ChunkableModule for EcmascriptModuleLocalsModule { fn as_chunk_item( self: Vc, chunking_context: Vc>, - ) -> Result>> { - Ok(Vc::upcast( + ) -> Vc> { + Vc::upcast( EcmascriptModuleLocalsChunkItem { module: self, chunking_context, } .cell(), - )) + ) } } diff --git a/turbopack/crates/turbopack-ecmascript/src/tree_shake/asset.rs b/turbopack/crates/turbopack-ecmascript/src/tree_shake/asset.rs index 155ec5a95872b..2773d61d6c3c4 100644 --- a/turbopack/crates/turbopack-ecmascript/src/tree_shake/asset.rs +++ b/turbopack/crates/turbopack-ecmascript/src/tree_shake/asset.rs @@ -44,27 +44,27 @@ impl EcmascriptParsable for EcmascriptModulePartAsset { Ok(part_of_module(split_data, self.part)) } #[turbo_tasks::function] - fn parse_original(&self) -> Result> { - Ok(self.full_module.parse_original()) + fn parse_original(&self) -> Vc { + self.full_module.parse_original() } #[turbo_tasks::function] - fn ty(&self) -> Result> { - Ok(self.full_module.ty()) + fn ty(&self) -> Vc { + self.full_module.ty() } } #[turbo_tasks::value_impl] impl EcmascriptAnalyzable for EcmascriptModulePartAsset { #[turbo_tasks::function] - fn analyze(&self) -> Result> { + fn analyze(&self) -> Vc { let part = self.part; - Ok(analyse_ecmascript_module(self.full_module, Some(part))) + analyse_ecmascript_module(self.full_module, Some(part)) } #[turbo_tasks::function] - fn module_content_without_analysis(&self) -> Result> { - Ok(self.full_module.module_content_without_analysis()) + fn module_content_without_analysis(&self) -> Vc { + self.full_module.module_content_without_analysis() } #[turbo_tasks::function] @@ -72,10 +72,9 @@ impl EcmascriptAnalyzable for EcmascriptModulePartAsset { &self, chunking_context: Vc>, async_module_info: Option>, - ) -> Result> { - Ok(self - .full_module - .module_content(chunking_context, async_module_info)) + ) -> Vc { + self.full_module + .module_content(chunking_context, async_module_info) } } @@ -207,22 +206,22 @@ impl ChunkableModule for EcmascriptModulePartAsset { fn as_chunk_item( self: Vc, chunking_context: Vc>, - ) -> Result>> { - Ok(Vc::upcast( + ) -> Vc> { + Vc::upcast( EcmascriptModulePartChunkItem { module: self, chunking_context, } .cell(), - )) + ) } } #[turbo_tasks::value_impl] impl EcmascriptModulePartAsset { #[turbo_tasks::function] - pub(super) fn analyze(&self) -> Result> { - Ok(analyze(self.full_module, self.part)) + pub(super) fn analyze(&self) -> Vc { + analyze(self.full_module, self.part) } } @@ -230,8 +229,8 @@ impl EcmascriptModulePartAsset { fn analyze( module: Vc, part: Vc, -) -> Result> { - Ok(analyse_ecmascript_module(module, Some(part))) +) -> Vc { + analyse_ecmascript_module(module, Some(part)) } #[turbo_tasks::value_impl] diff --git a/turbopack/crates/turbopack-ecmascript/src/tree_shake/chunk_item.rs b/turbopack/crates/turbopack-ecmascript/src/tree_shake/chunk_item.rs index ef58aa17deeea..9d7c8d4a29feb 100644 --- a/turbopack/crates/turbopack-ecmascript/src/tree_shake/chunk_item.rs +++ b/turbopack/crates/turbopack-ecmascript/src/tree_shake/chunk_item.rs @@ -80,8 +80,8 @@ impl ChunkItem for EcmascriptModulePartChunkItem { } #[turbo_tasks::function] - fn asset_ident(&self) -> Result> { - Ok(self.module.ident()) + fn asset_ident(&self) -> Vc { + self.module.ident() } #[turbo_tasks::function] diff --git a/turbopack/crates/turbopack-ecmascript/src/webpack/mod.rs b/turbopack/crates/turbopack-ecmascript/src/webpack/mod.rs index 3a332a812daf3..ac7471021b998 100644 --- a/turbopack/crates/turbopack-ecmascript/src/webpack/mod.rs +++ b/turbopack/crates/turbopack-ecmascript/src/webpack/mod.rs @@ -114,13 +114,13 @@ impl ModuleReference for WebpackChunkAssetReference { #[turbo_tasks::value_impl] impl ValueToString for WebpackChunkAssetReference { #[turbo_tasks::function] - async fn to_string(&self) -> Result> { + async fn to_string(&self) -> Vc { let chunk_id = match &self.chunk_id { Lit::Str(str) => str.value.to_string(), Lit::Num(num) => format!("{num}"), _ => todo!(), }; - Ok(Vc::cell(format!("webpack chunk {}", chunk_id).into())) + Vc::cell(format!("webpack chunk {}", chunk_id).into()) } } @@ -147,8 +147,8 @@ impl ModuleReference for WebpackEntryAssetReference { #[turbo_tasks::value_impl] impl ValueToString for WebpackEntryAssetReference { #[turbo_tasks::function] - fn to_string(&self) -> Result> { - Ok(Vc::cell("webpack entry".into())) + fn to_string(&self) -> Vc { + Vc::cell("webpack entry".into()) } } diff --git a/turbopack/crates/turbopack-ecmascript/src/worker_chunk/chunk_item.rs b/turbopack/crates/turbopack-ecmascript/src/worker_chunk/chunk_item.rs index 174c3d8a8a994..004c4884df2b6 100644 --- a/turbopack/crates/turbopack-ecmascript/src/worker_chunk/chunk_item.rs +++ b/turbopack/crates/turbopack-ecmascript/src/worker_chunk/chunk_item.rs @@ -112,8 +112,8 @@ impl ChunkItem for WorkerLoaderChunkItem { } #[turbo_tasks::function] - fn content_ident(&self) -> Result> { - Ok(self.module.ident()) + fn content_ident(&self) -> Vc { + self.module.ident() } #[turbo_tasks::function] diff --git a/turbopack/crates/turbopack-ecmascript/src/worker_chunk/module.rs b/turbopack/crates/turbopack-ecmascript/src/worker_chunk/module.rs index 3468d9734930b..9867ace428afa 100644 --- a/turbopack/crates/turbopack-ecmascript/src/worker_chunk/module.rs +++ b/turbopack/crates/turbopack-ecmascript/src/worker_chunk/module.rs @@ -70,13 +70,13 @@ impl ChunkableModule for WorkerLoaderModule { fn as_chunk_item( self: Vc, chunking_context: Vc>, - ) -> Result>> { - Ok(Vc::upcast( + ) -> Vc> { + Vc::upcast( WorkerLoaderChunkItem { chunking_context, module: self, } .cell(), - )) + ) } } diff --git a/turbopack/crates/turbopack-json/src/lib.rs b/turbopack/crates/turbopack-json/src/lib.rs index af2d42ab2e17e..a69199410bfc8 100644 --- a/turbopack/crates/turbopack-json/src/lib.rs +++ b/turbopack/crates/turbopack-json/src/lib.rs @@ -66,11 +66,11 @@ impl ChunkableModule for JsonModuleAsset { fn as_chunk_item( self: Vc, chunking_context: Vc>, - ) -> Result>> { - Ok(Vc::upcast(JsonChunkItem::cell(JsonChunkItem { + ) -> Vc> { + Vc::upcast(JsonChunkItem::cell(JsonChunkItem { module: self, chunking_context, - }))) + })) } } diff --git a/turbopack/crates/turbopack-node/src/execution_context.rs b/turbopack/crates/turbopack-node/src/execution_context.rs index 1b831721c52d8..a2a0c633a7fb8 100644 --- a/turbopack/crates/turbopack-node/src/execution_context.rs +++ b/turbopack/crates/turbopack-node/src/execution_context.rs @@ -1,4 +1,3 @@ -use anyhow::Result; use turbo_tasks::Vc; use turbo_tasks_env::ProcessEnv; use turbo_tasks_fs::FileSystemPath; @@ -28,17 +27,17 @@ impl ExecutionContext { } #[turbo_tasks::function] - pub fn project_path(&self) -> Result> { - Ok(self.project_path) + pub fn project_path(&self) -> Vc { + self.project_path } #[turbo_tasks::function] - pub fn chunking_context(&self) -> Result>> { - Ok(self.chunking_context) + pub fn chunking_context(&self) -> Vc> { + self.chunking_context } #[turbo_tasks::function] - pub fn env(&self) -> Result>> { - Ok(self.env) + pub fn env(&self) -> Vc> { + self.env } } diff --git a/turbopack/crates/turbopack-node/src/lib.rs b/turbopack/crates/turbopack-node/src/lib.rs index 3aadebbfaf0c0..a325072c353f2 100644 --- a/turbopack/crates/turbopack-node/src/lib.rs +++ b/turbopack/crates/turbopack-node/src/lib.rs @@ -261,13 +261,13 @@ pub fn get_intermediate_asset( chunking_context: Vc>, main_entry: Vc>, other_entries: Vc, -) -> Result>> { - Ok(Vc::upcast(chunking_context.root_entry_chunk_group_asset( +) -> Vc> { + Vc::upcast(chunking_context.root_entry_chunk_group_asset( chunking_context.chunk_path(main_entry.ident(), ".js".into()), main_entry, OutputAssets::empty(), other_entries, - ))) + )) } #[derive(Clone, Debug)] diff --git a/turbopack/crates/turbopack-node/src/render/issue.rs b/turbopack/crates/turbopack-node/src/render/issue.rs index 96dfeeb7a5483..1e943d333f14f 100644 --- a/turbopack/crates/turbopack-node/src/render/issue.rs +++ b/turbopack/crates/turbopack-node/src/render/issue.rs @@ -1,4 +1,3 @@ -use anyhow::Result; use turbo_tasks::Vc; use turbo_tasks_fs::FileSystemPath; use turbopack_core::issue::{Issue, IssueStage, OptionStyledString, StyledString}; @@ -34,7 +33,7 @@ impl Issue for RenderingIssue { } #[turbo_tasks::function] - async fn detail(&self) -> Result> { + async fn detail(&self) -> Vc { let mut details = vec![]; if let Some(status) = self.status { @@ -45,7 +44,7 @@ impl Issue for RenderingIssue { } } - Ok(Vc::cell(Some(StyledString::Stack(details).cell()))) + Vc::cell(Some(StyledString::Stack(details).cell())) } // TODO parse stack trace into source location diff --git a/turbopack/crates/turbopack-node/src/render/node_api_source.rs b/turbopack/crates/turbopack-node/src/render/node_api_source.rs index 8b83c3961b517..feceeb43b81d4 100644 --- a/turbopack/crates/turbopack-node/src/render/node_api_source.rs +++ b/turbopack/crates/turbopack-node/src/render/node_api_source.rs @@ -71,8 +71,8 @@ pub struct NodeApiContentSource { #[turbo_tasks::value_impl] impl NodeApiContentSource { #[turbo_tasks::function] - pub fn get_pathname(&self) -> Result> { - Ok(self.pathname) + pub fn get_pathname(&self) -> Vc { + self.pathname } } @@ -174,14 +174,14 @@ impl Introspectable for NodeApiContentSource { } #[turbo_tasks::function] - async fn details(&self) -> Result> { - Ok(Vc::cell( + async fn details(&self) -> Vc { + Vc::cell( format!( "base: {:?}\ntype: {:?}", self.base_segments, self.route_type ) .into(), - )) + ) } #[turbo_tasks::function] diff --git a/turbopack/crates/turbopack-node/src/render/rendered_source.rs b/turbopack/crates/turbopack-node/src/render/rendered_source.rs index cf0d5851ff47b..f89841db18616 100644 --- a/turbopack/crates/turbopack-node/src/render/rendered_source.rs +++ b/turbopack/crates/turbopack-node/src/render/rendered_source.rs @@ -99,8 +99,8 @@ pub struct NodeRenderContentSource { #[turbo_tasks::value_impl] impl NodeRenderContentSource { #[turbo_tasks::function] - pub fn get_pathname(&self) -> Result> { - Ok(self.pathname) + pub fn get_pathname(&self) -> Vc { + self.pathname } } @@ -263,14 +263,14 @@ impl Introspectable for NodeRenderContentSource { } #[turbo_tasks::function] - async fn details(&self) -> Result> { - Ok(Vc::cell( + async fn details(&self) -> Vc { + Vc::cell( format!( "base: {:?}\ntype: {:?}", self.base_segments, self.route_type ) .into(), - )) + ) } #[turbo_tasks::function] diff --git a/turbopack/crates/turbopack-node/src/transforms/postcss.rs b/turbopack/crates/turbopack-node/src/transforms/postcss.rs index af9f2fc6267e8..d24197bbe1a14 100644 --- a/turbopack/crates/turbopack-node/src/transforms/postcss.rs +++ b/turbopack/crates/turbopack-node/src/transforms/postcss.rs @@ -171,7 +171,7 @@ struct ProcessPostCssResult { async fn config_changed( asset_context: Vc>, postcss_config_path: Vc, -) -> Result> { +) -> Vc { let config_asset = asset_context .process( Vc::upcast(FileSource::new(postcss_config_path)), @@ -179,11 +179,11 @@ async fn config_changed( ) .module(); - Ok(Vc::::cell(vec![ + Vc::::cell(vec![ any_content_changed_of_module(config_asset), extra_configs_changed(asset_context, postcss_config_path), ]) - .completed()) + .completed() } #[turbo_tasks::function] @@ -360,7 +360,7 @@ fn postcss_executor( asset_context: Vc>, project_path: Vc, postcss_config_path: Vc, -) -> Result> { +) -> Vc { let config_asset = asset_context .process( config_loader_source(project_path, postcss_config_path), @@ -368,7 +368,7 @@ fn postcss_executor( ) .module(); - Ok(asset_context.process( + asset_context.process( Vc::upcast(VirtualSource::new( postcss_config_path.join("transform.ts".into()), AssetContent::File(embed_file("transforms/postcss.ts".into())).cell(), @@ -376,7 +376,7 @@ fn postcss_executor( Value::new(ReferenceType::Internal(Vc::cell(indexmap! { "CONFIG".into() => config_asset }))), - )) + ) } async fn find_config_in_location( diff --git a/turbopack/crates/turbopack-node/src/transforms/webpack.rs b/turbopack/crates/turbopack-node/src/transforms/webpack.rs index 118808443a248..5460599d78927 100644 --- a/turbopack/crates/turbopack-node/src/transforms/webpack.rs +++ b/turbopack/crates/turbopack-node/src/transforms/webpack.rs @@ -820,7 +820,7 @@ impl Issue for EvaluateErrorLoggingIssue { } #[turbo_tasks::function] - fn description(&self) -> Result> { + fn description(&self) -> Vc { fn fmt_args(prefix: String, args: &[JsonValue]) -> String { let mut iter = args.iter(); let Some(first) = iter.next() else { @@ -854,6 +854,6 @@ impl Issue for EvaluateErrorLoggingIssue { } }) .collect::>(); - Ok(Vc::cell(Some(StyledString::Stack(lines).cell()))) + Vc::cell(Some(StyledString::Stack(lines).cell())) } } diff --git a/turbopack/crates/turbopack-nodejs/src/chunking_context.rs b/turbopack/crates/turbopack-nodejs/src/chunking_context.rs index c764bb20afd44..297d5b8de1348 100644 --- a/turbopack/crates/turbopack-nodejs/src/chunking_context.rs +++ b/turbopack/crates/turbopack-nodejs/src/chunking_context.rs @@ -363,8 +363,8 @@ impl ChunkingContext for NodeJsChunkingContext { } #[turbo_tasks::function] - fn chunk_item_id_from_ident(&self, ident: Vc) -> Result> { - Ok(self.module_id_strategy.get_module_id(ident)) + fn chunk_item_id_from_ident(&self, ident: Vc) -> Vc { + self.module_id_strategy.get_module_id(ident) } #[turbo_tasks::function] diff --git a/turbopack/crates/turbopack-nodejs/src/ecmascript/node/chunk.rs b/turbopack/crates/turbopack-nodejs/src/ecmascript/node/chunk.rs index 9bb2679641de4..c958bb73dc7ad 100644 --- a/turbopack/crates/turbopack-nodejs/src/ecmascript/node/chunk.rs +++ b/turbopack/crates/turbopack-nodejs/src/ecmascript/node/chunk.rs @@ -41,8 +41,8 @@ impl EcmascriptBuildNodeChunk { #[turbo_tasks::value_impl] impl ValueToString for EcmascriptBuildNodeChunk { #[turbo_tasks::function] - fn to_string(&self) -> Result> { - Ok(Vc::cell("Ecmascript Build Node Chunk".into())) + fn to_string(&self) -> Vc { + Vc::cell("Ecmascript Build Node Chunk".into()) } } diff --git a/turbopack/crates/turbopack-nodejs/src/ecmascript/node/content.rs b/turbopack/crates/turbopack-nodejs/src/ecmascript/node/content.rs index 58394fe768e14..24bbe720d83fb 100644 --- a/turbopack/crates/turbopack-nodejs/src/ecmascript/node/content.rs +++ b/turbopack/crates/turbopack-nodejs/src/ecmascript/node/content.rs @@ -35,13 +35,13 @@ impl EcmascriptBuildNodeChunkContent { chunking_context: Vc, chunk: Vc, content: Vc, - ) -> Result> { - Ok(EcmascriptBuildNodeChunkContent { + ) -> Vc { + EcmascriptBuildNodeChunkContent { content, chunking_context, chunk, } - .cell()) + .cell() } } diff --git a/turbopack/crates/turbopack-nodejs/src/ecmascript/node/entry/chunk.rs b/turbopack/crates/turbopack-nodejs/src/ecmascript/node/entry/chunk.rs index 06f5c37e01ad5..5f91dbe53a9e4 100644 --- a/turbopack/crates/turbopack-nodejs/src/ecmascript/node/entry/chunk.rs +++ b/turbopack/crates/turbopack-nodejs/src/ecmascript/node/entry/chunk.rs @@ -144,16 +144,16 @@ impl EcmascriptBuildNodeEntryChunk { } #[turbo_tasks::function] - fn runtime_chunk(&self) -> Result> { - Ok(EcmascriptBuildNodeRuntimeChunk::new(self.chunking_context)) + fn runtime_chunk(&self) -> Vc { + EcmascriptBuildNodeRuntimeChunk::new(self.chunking_context) } } #[turbo_tasks::value_impl] impl ValueToString for EcmascriptBuildNodeEntryChunk { #[turbo_tasks::function] - fn to_string(&self) -> Result> { - Ok(Vc::cell("Ecmascript Build Node Evaluate Chunk".into())) + fn to_string(&self) -> Vc { + Vc::cell("Ecmascript Build Node Evaluate Chunk".into()) } } diff --git a/turbopack/crates/turbopack-nodejs/src/ecmascript/node/entry/runtime.rs b/turbopack/crates/turbopack-nodejs/src/ecmascript/node/entry/runtime.rs index c0a1f580548b7..aad1779610112 100644 --- a/turbopack/crates/turbopack-nodejs/src/ecmascript/node/entry/runtime.rs +++ b/turbopack/crates/turbopack-nodejs/src/ecmascript/node/entry/runtime.rs @@ -91,8 +91,8 @@ impl EcmascriptBuildNodeRuntimeChunk { #[turbo_tasks::value_impl] impl ValueToString for EcmascriptBuildNodeRuntimeChunk { #[turbo_tasks::function] - fn to_string(&self) -> Result> { - Ok(Vc::cell("Ecmascript Build Node Runtime Chunk".into())) + fn to_string(&self) -> Vc { + Vc::cell("Ecmascript Build Node Runtime Chunk".into()) } } diff --git a/turbopack/crates/turbopack-resolve/src/typescript.rs b/turbopack/crates/turbopack-resolve/src/typescript.rs index 18daee0caae02..ee5f27517bc59 100644 --- a/turbopack/crates/turbopack-resolve/src/typescript.rs +++ b/turbopack/crates/turbopack-resolve/src/typescript.rs @@ -519,11 +519,8 @@ impl Issue for TsConfigIssue { } #[turbo_tasks::function] - fn title(&self) -> Result> { - Ok( - StyledString::Text("An issue occurred while parsing a tsconfig.json file.".into()) - .cell(), - ) + fn title(&self) -> Vc { + StyledString::Text("An issue occurred while parsing a tsconfig.json file.".into()).cell() } #[turbo_tasks::function] diff --git a/turbopack/crates/turbopack-static/src/fixed.rs b/turbopack/crates/turbopack-static/src/fixed.rs index 45c2924d6b69e..e99f0111b01d2 100644 --- a/turbopack/crates/turbopack-static/src/fixed.rs +++ b/turbopack/crates/turbopack-static/src/fixed.rs @@ -1,4 +1,3 @@ -use anyhow::Result; use turbo_tasks::Vc; use turbo_tasks_fs::FileSystemPath; use turbopack_core::{ @@ -31,8 +30,8 @@ impl FixedStaticAsset { #[turbo_tasks::value_impl] impl OutputAsset for FixedStaticAsset { #[turbo_tasks::function] - fn ident(&self) -> Result> { - Ok(AssetIdent::from_path(self.output_path)) + fn ident(&self) -> Vc { + AssetIdent::from_path(self.output_path) } } diff --git a/turbopack/crates/turbopack-static/src/lib.rs b/turbopack/crates/turbopack-static/src/lib.rs index 51b47a37cb748..b02640e36fad3 100644 --- a/turbopack/crates/turbopack-static/src/lib.rs +++ b/turbopack/crates/turbopack-static/src/lib.rs @@ -60,11 +60,8 @@ impl StaticModuleAsset { } #[turbo_tasks::function] - fn static_asset( - &self, - chunking_context: Vc>, - ) -> Result> { - Ok(StaticAsset::new(chunking_context, self.source)) + fn static_asset(&self, chunking_context: Vc>) -> Vc { + StaticAsset::new(chunking_context, self.source) } } @@ -93,12 +90,12 @@ impl ChunkableModule for StaticModuleAsset { fn as_chunk_item( self: Vc, chunking_context: Vc>, - ) -> Result>> { - Ok(Vc::upcast(ModuleChunkItem::cell(ModuleChunkItem { + ) -> Vc> { + Vc::upcast(ModuleChunkItem::cell(ModuleChunkItem { module: self, chunking_context, static_asset: self.static_asset(Vc::upcast(chunking_context)), - }))) + })) } } diff --git a/turbopack/crates/turbopack-wasm/src/loader.rs b/turbopack/crates/turbopack-wasm/src/loader.rs index 661e304348d49..e7f5594b4ad3e 100644 --- a/turbopack/crates/turbopack-wasm/src/loader.rs +++ b/turbopack/crates/turbopack-wasm/src/loader.rs @@ -62,9 +62,7 @@ pub(crate) async fn instantiating_loader_source( /// Create a javascript loader to compile the WebAssembly module and export it /// without instantiating. #[turbo_tasks::function] -pub(crate) fn compiling_loader_source( - source: Vc, -) -> Result>> { +pub(crate) fn compiling_loader_source(source: Vc) -> Vc> { let code: RcStr = formatdoc! { r#" import wasmPath from "WASM_PATH"; @@ -76,8 +74,8 @@ pub(crate) fn compiling_loader_source( } .into(); - Ok(Vc::upcast(VirtualSource::new( + Vc::upcast(VirtualSource::new( source.ident().path().append("_.loader.mjs".into()), AssetContent::file(File::from(code).into()), - ))) + )) } diff --git a/turbopack/crates/turbopack-wasm/src/module_asset.rs b/turbopack/crates/turbopack-wasm/src/module_asset.rs index 9475f5f030017..8dd568a7c0413 100644 --- a/turbopack/crates/turbopack-wasm/src/module_asset.rs +++ b/turbopack/crates/turbopack-wasm/src/module_asset.rs @@ -136,14 +136,14 @@ impl ChunkableModule for WebAssemblyModuleAsset { fn as_chunk_item( self: Vc, chunking_context: Vc>, - ) -> Result>> { - Ok(Vc::upcast( + ) -> Vc> { + Vc::upcast( ModuleChunkItem { module: self, chunking_context, } .cell(), - )) + ) } } @@ -192,13 +192,13 @@ impl ChunkItem for ModuleChunkItem { } #[turbo_tasks::function] - fn references(&self) -> Result> { + fn references(&self) -> Vc { let loader = self .module .loader() .as_chunk_item(Vc::upcast(self.chunking_context)); - Ok(loader.references()) + loader.references() } #[turbo_tasks::function] diff --git a/turbopack/crates/turbopack-wasm/src/output_asset.rs b/turbopack/crates/turbopack-wasm/src/output_asset.rs index 19d0d60132a52..31453ec89893a 100644 --- a/turbopack/crates/turbopack-wasm/src/output_asset.rs +++ b/turbopack/crates/turbopack-wasm/src/output_asset.rs @@ -1,4 +1,3 @@ -use anyhow::Result; use turbo_tasks::{RcStr, Vc}; use turbopack_core::{ asset::{Asset, AssetContent}, @@ -40,12 +39,12 @@ impl WebAssemblyAsset { #[turbo_tasks::value_impl] impl OutputAsset for WebAssemblyAsset { #[turbo_tasks::function] - fn ident(&self) -> Result> { + fn ident(&self) -> Vc { let ident = self.source.ident().with_modifier(modifier()); let asset_path = self.chunking_context.chunk_path(ident, ".wasm".into()); - Ok(AssetIdent::from_path(asset_path)) + AssetIdent::from_path(asset_path) } } diff --git a/turbopack/crates/turbopack-wasm/src/raw.rs b/turbopack/crates/turbopack-wasm/src/raw.rs index fc2e0d0e162c0..d5004c0950e46 100644 --- a/turbopack/crates/turbopack-wasm/src/raw.rs +++ b/turbopack/crates/turbopack-wasm/src/raw.rs @@ -77,15 +77,15 @@ impl ChunkableModule for RawWebAssemblyModuleAsset { fn as_chunk_item( self: Vc, chunking_context: Vc>, - ) -> Result>> { - Ok(Vc::upcast( + ) -> Vc> { + Vc::upcast( RawModuleChunkItem { module: self, chunking_context, wasm_asset: self.wasm_asset(Vc::upcast(chunking_context)), } .cell(), - )) + ) } } diff --git a/turbopack/crates/turbopack/src/lib.rs b/turbopack/crates/turbopack/src/lib.rs index 6ed1f95e2015f..8672b15d3ea58 100644 --- a/turbopack/crates/turbopack/src/lib.rs +++ b/turbopack/crates/turbopack/src/lib.rs @@ -368,13 +368,13 @@ impl ModuleAssetContext { } #[turbo_tasks::function] - pub fn module_options_context(&self) -> Result> { - Ok(self.module_options_context) + pub fn module_options_context(&self) -> Vc { + self.module_options_context } #[turbo_tasks::function] - pub fn resolve_options_context(&self) -> Result> { - Ok(self.resolve_options_context) + pub fn resolve_options_context(&self) -> Vc { + self.resolve_options_context } #[turbo_tasks::function] diff --git a/turbopack/crates/turbopack/src/module_options/mod.rs b/turbopack/crates/turbopack/src/module_options/mod.rs index 4599bcccc6522..28180f8b8c745 100644 --- a/turbopack/crates/turbopack/src/module_options/mod.rs +++ b/turbopack/crates/turbopack/src/module_options/mod.rs @@ -30,26 +30,26 @@ use crate::{ async fn package_import_map_from_import_mapping( package_name: RcStr, package_mapping: Vc, -) -> Result> { +) -> Vc { let mut import_map = ImportMap::default(); import_map.insert_exact_alias( format!("@vercel/turbopack/{}", package_name), package_mapping, ); - Ok(import_map.cell()) + import_map.cell() } #[turbo_tasks::function] async fn package_import_map_from_context( package_name: RcStr, context_path: Vc, -) -> Result> { +) -> Vc { let mut import_map = ImportMap::default(); import_map.insert_exact_alias( format!("@vercel/turbopack/{}", package_name), ImportMapping::PrimaryAlternative(package_name, Some(context_path)).cell(), ); - Ok(import_map.cell()) + import_map.cell() } #[turbo_tasks::value(cell = "new", eq = "manual")] diff --git a/turbopack/crates/turbopack/src/transition/context_transition.rs b/turbopack/crates/turbopack/src/transition/context_transition.rs index 6509f7f05b8fa..111423d70380e 100644 --- a/turbopack/crates/turbopack/src/transition/context_transition.rs +++ b/turbopack/crates/turbopack/src/transition/context_transition.rs @@ -1,4 +1,3 @@ -use anyhow::Result; use turbo_tasks::{RcStr, Vc}; use turbopack_core::compile_time_info::CompileTimeInfo; use turbopack_resolve::resolve_options_context::ResolveOptionsContext; @@ -22,14 +21,14 @@ impl ContextTransition { module_options_context: Vc, resolve_options_context: Vc, layer: Vc, - ) -> Result> { - Ok(ContextTransition { + ) -> Vc { + ContextTransition { module_options_context, resolve_options_context, compile_time_info, layer, } - .cell()) + .cell() } } diff --git a/turbopack/crates/turbopack/src/transition/full_context_transition.rs b/turbopack/crates/turbopack/src/transition/full_context_transition.rs index 79e431aa7dfe0..a1a183bb6b566 100644 --- a/turbopack/crates/turbopack/src/transition/full_context_transition.rs +++ b/turbopack/crates/turbopack/src/transition/full_context_transition.rs @@ -1,4 +1,3 @@ -use anyhow::Result; use turbo_tasks::Vc; use crate::{transition::Transition, ModuleAssetContext}; @@ -12,8 +11,8 @@ pub struct FullContextTransition { #[turbo_tasks::value_impl] impl FullContextTransition { #[turbo_tasks::function] - pub fn new(module_context: Vc) -> Result> { - Ok(FullContextTransition { module_context }.cell()) + pub fn new(module_context: Vc) -> Vc { + FullContextTransition { module_context }.cell() } } From 154dd2405020e2783a66846d0232f7b3469681dc Mon Sep 17 00:00:00 2001 From: Archana Agivale Date: Thu, 26 Sep 2024 19:32:56 +0530 Subject: [PATCH 11/13] Sitemap video tag support (#69349) Co-authored-by: Sam Ko Co-authored-by: Jiachi Liu --- .../01-metadata/sitemap.mdx | 48 +++++++++++++ .../metadata/resolve-route-data.test.ts | 72 +++++++++++++++++++ .../loaders/metadata/resolve-route-data.ts | 41 +++++++++++ .../lib/metadata/types/metadata-interface.ts | 2 + .../src/lib/metadata/types/metadata-types.ts | 28 ++++++++ .../app/sitemap-video/sitemap.ts | 39 ++++++++++ .../metadata-dynamic-routes/index.test.ts | 32 +++++++++ test/turbopack-build-tests-manifest.json | 2 + 8 files changed, 264 insertions(+) create mode 100644 test/e2e/app-dir/metadata-dynamic-routes/app/sitemap-video/sitemap.ts diff --git a/docs/02-app/02-api-reference/02-file-conventions/01-metadata/sitemap.mdx b/docs/02-app/02-api-reference/02-file-conventions/01-metadata/sitemap.mdx index 32342d172f8c2..f7e0cba5539f3 100644 --- a/docs/02-app/02-api-reference/02-file-conventions/01-metadata/sitemap.mdx +++ b/docs/02-app/02-api-reference/02-file-conventions/01-metadata/sitemap.mdx @@ -160,6 +160,54 @@ Output: ``` +### Video Sitemaps + +You can use `videos` property to create video sitemaps. Learn more details in the [Google Developer Docs](https://developers.google.com/search/docs/crawling-indexing/sitemaps/video-sitemaps). + +```ts filename="app/sitemap.ts" switcher +import type { MetadataRoute } from 'next' + +export default function sitemap(): MetadataRoute.Sitemap { + return [ + { + url: 'https://example.com', + lastModified: '2021-01-01', + changeFrequency: 'weekly', + priority: 0.5, + videos: [ + { + title: 'example', + thumbnail_loc: 'https://example.com/image.jpg', + description: 'this is the description', + }, + ], + }, + ] +} +``` + +Output: + +```xml filename="acme.com/sitemap.xml" + + + + https://example.com + + example + https://example.com/image.jpg + this is the description + + 2021-01-01 + weekly + 0.5 + + +``` + ### Generate a localized Sitemap ```ts filename="app/sitemap.ts" switcher diff --git a/packages/next/src/build/webpack/loaders/metadata/resolve-route-data.test.ts b/packages/next/src/build/webpack/loaders/metadata/resolve-route-data.test.ts index 82e686afd6707..dd163ecd3c846 100644 --- a/packages/next/src/build/webpack/loaders/metadata/resolve-route-data.test.ts +++ b/packages/next/src/build/webpack/loaders/metadata/resolve-route-data.test.ts @@ -153,5 +153,77 @@ describe('resolveRouteData', () => { " `) }) + it('should resolve sitemap.xml with videos', () => { + expect( + resolveSitemap([ + { + url: 'https://example.com', + lastModified: '2021-01-01', + changeFrequency: 'weekly', + priority: 0.5, + videos: [ + { + title: 'example', + thumbnail_loc: 'https://example.com/image.jpg', + description: 'this is the description', + content_loc: 'http://streamserver.example.com/video123.mp4', + player_loc: 'https://www.example.com/videoplayer.php?video=123', + duration: 2, + view_count: 50, + tag: 'summer', + rating: 4, + expiration_date: '2025-09-16', + publication_date: '2024-09-16', + family_friendly: 'yes', + requires_subscription: 'no', + live: 'no', + restriction: { + relationship: 'allow', + content: 'IE GB US CA', + }, + platform: { + relationship: 'allow', + content: 'web', + }, + uploader: { + info: 'https://www.example.com/users/grillymcgrillerson', + content: 'GrillyMcGrillerson', + }, + }, + ], + }, + ]) + ).toMatchInlineSnapshot(` + " + + + https://example.com + + example + https://example.com/image.jpg + this is the description + http://streamserver.example.com/video123.mp4 + https://www.example.com/videoplayer.php?video=123 + 2 + 50 + summer + 4 + 2025-09-16 + 2024-09-16 + yes + no + no + IE GB US CA + web + GrillyMcGrillerson + + 2021-01-01 + weekly + 0.5 + + + " + `) + }) }) }) diff --git a/packages/next/src/build/webpack/loaders/metadata/resolve-route-data.ts b/packages/next/src/build/webpack/loaders/metadata/resolve-route-data.ts index 4c10b73bb9881..ca8a28720f82c 100644 --- a/packages/next/src/build/webpack/loaders/metadata/resolve-route-data.ts +++ b/packages/next/src/build/webpack/loaders/metadata/resolve-route-data.ts @@ -48,6 +48,7 @@ export function resolveSitemap(data: MetadataRoute.Sitemap): string { (item) => Object.keys(item.alternates ?? {}).length > 0 ) const hasImages = data.some((item) => Boolean(item.images?.length)) + const hasVideos = data.some((item) => Boolean(item.videos?.length)) let content = '' content += '\n' @@ -55,6 +56,9 @@ export function resolveSitemap(data: MetadataRoute.Sitemap): string { if (hasImages) { content += ' xmlns:image="http://www.google.com/schemas/sitemap-image/1.1"' } + if (hasVideos) { + content += ' xmlns:video="http://www.google.com/schemas/sitemap-video/1.1"' + } if (hasAlternates) { content += ' xmlns:xhtml="http://www.w3.org/1999/xhtml">\n' } else { @@ -79,6 +83,43 @@ export function resolveSitemap(data: MetadataRoute.Sitemap): string { content += `\n${image}\n\n` } } + if (item.videos?.length) { + for (const video of item.videos) { + let videoFields = [ + ``, + `${video.title}`, + `${video.thumbnail_loc}`, + `${video.description}`, + video.content_loc && + `${video.content_loc}`, + video.player_loc && + `${video.player_loc}`, + video.duration && + `${video.duration}`, + video.view_count && + `${video.view_count}`, + video.tag && `${video.tag}`, + video.rating && `${video.rating}`, + video.expiration_date && + `${video.expiration_date}`, + video.publication_date && + `${video.publication_date}`, + video.family_friendly && + `${video.family_friendly}`, + video.requires_subscription && + `${video.requires_subscription}`, + video.live && `${video.live}`, + video.restriction && + `${video.restriction.content}`, + video.platform && + `${video.platform.content}`, + video.uploader && + `${video.uploader.content}`, + `\n`, + ].filter(Boolean) + content += videoFields.join('\n') + } + } if (item.lastModified) { const serializedDate = item.lastModified instanceof Date diff --git a/packages/next/src/lib/metadata/types/metadata-interface.ts b/packages/next/src/lib/metadata/types/metadata-interface.ts index eece6b99a43a3..ac919b2096b0b 100644 --- a/packages/next/src/lib/metadata/types/metadata-interface.ts +++ b/packages/next/src/lib/metadata/types/metadata-interface.ts @@ -30,6 +30,7 @@ import type { TemplateString, Verification, ThemeColorDescriptor, + Videos, } from './metadata-types' import type { Manifest as ManifestFile } from './manifest-types' import type { OpenGraph, ResolvedOpenGraph } from './opengraph-types' @@ -607,6 +608,7 @@ type SitemapFile = Array<{ languages?: Languages } images?: string[] + videos?: Videos[] }> type ResolvingMetadata = Promise diff --git a/packages/next/src/lib/metadata/types/metadata-types.ts b/packages/next/src/lib/metadata/types/metadata-types.ts index e8be1feeeb9d0..ae54c8677e48e 100644 --- a/packages/next/src/lib/metadata/types/metadata-types.ts +++ b/packages/next/src/lib/metadata/types/metadata-types.ts @@ -156,3 +156,31 @@ export type ThemeColorDescriptor = { color: string media?: string } + +export type Restriction = { + relationship: 'allow' | 'deny' + content: string +} + +export type Videos = { + title: string + thumbnail_loc: string + description: string + content_loc?: string + player_loc?: string + duration?: number + expiration_date?: Date | string + rating?: number + view_count?: number + publication_date?: Date | string + family_friendly?: 'yes' | 'no' + restriction?: Restriction + platform?: Restriction + requires_subscription?: 'yes' | 'no' + uploader?: { + info?: string + content?: string + } + live?: 'yes' | 'no' + tag?: string +} diff --git a/test/e2e/app-dir/metadata-dynamic-routes/app/sitemap-video/sitemap.ts b/test/e2e/app-dir/metadata-dynamic-routes/app/sitemap-video/sitemap.ts new file mode 100644 index 0000000000000..94cf6319b0e54 --- /dev/null +++ b/test/e2e/app-dir/metadata-dynamic-routes/app/sitemap-video/sitemap.ts @@ -0,0 +1,39 @@ +import { MetadataRoute } from 'next' + +export default function sitemap(): MetadataRoute.Sitemap { + return [ + { + url: 'https://example.com/about', + videos: [ + { + title: 'example', + thumbnail_loc: 'https://example.com/image.jpg', + description: 'this is the description', + content_loc: 'http://streamserver.example.com/video123.mp4', + player_loc: 'https://www.example.com/videoplayer.php?video=123', + duration: 2, + view_count: 50, + tag: 'summer', + rating: 4, + expiration_date: '2025-09-16', + publication_date: '2024-09-16', + family_friendly: 'yes', + requires_subscription: 'no', + live: 'no', + restriction: { + relationship: 'allow', + content: 'IE GB US CA', + }, + platform: { + relationship: 'allow', + content: 'web', + }, + uploader: { + info: 'https://www.example.com/users/grillymcgrillerson', + content: 'GrillyMcGrillerson', + }, + }, + ], + }, + ] +} diff --git a/test/e2e/app-dir/metadata-dynamic-routes/index.test.ts b/test/e2e/app-dir/metadata-dynamic-routes/index.test.ts index f1613464ac123..f8953261d9f20 100644 --- a/test/e2e/app-dir/metadata-dynamic-routes/index.test.ts +++ b/test/e2e/app-dir/metadata-dynamic-routes/index.test.ts @@ -115,6 +115,38 @@ describe('app dir - metadata dynamic routes', () => { ) }) + it('should support videos in sitemap', async () => { + const xml = await (await next.fetch('/sitemap-video/sitemap.xml')).text() + expect(xml).toMatchInlineSnapshot(` + " + + + https://example.com/about + + example + https://example.com/image.jpg + this is the description + http://streamserver.example.com/video123.mp4 + https://www.example.com/videoplayer.php?video=123 + 2 + 50 + summer + 4 + 2025-09-16 + 2024-09-16 + yes + no + no + IE GB US CA + web + GrillyMcGrillerson + + + + " + `) + }) + if (isNextStart) { it('should optimize routes without multiple generation API as static routes', async () => { const appPathsManifest = JSON.parse( diff --git a/test/turbopack-build-tests-manifest.json b/test/turbopack-build-tests-manifest.json index 0e4ba5ab383e2..ac91c72ed04e0 100644 --- a/test/turbopack-build-tests-manifest.json +++ b/test/turbopack-build-tests-manifest.json @@ -2100,6 +2100,8 @@ "app dir - metadata dynamic routes sitemap should not throw if client components are imported but not used in sitemap", "app dir - metadata dynamic routes sitemap should optimize routes without multiple generation API as static routes", "app dir - metadata dynamic routes sitemap should support alternate.languages in sitemap", + "app dir - metadata dynamic routes sitemap should support images in sitemap", + "app dir - metadata dynamic routes sitemap should support videos in sitemap", "app dir - metadata dynamic routes sitemap should support generate multi sitemaps with generateSitemaps", "app dir - metadata dynamic routes sitemap should support images in sitemap", "app dir - metadata dynamic routes social image routes should fill params into dynamic routes url of metadata images", From 3ed9f4b3f4d1f8b431ff04d4e6a45a949680a31f Mon Sep 17 00:00:00 2001 From: Jiachi Liu Date: Thu, 26 Sep 2024 16:22:59 +0200 Subject: [PATCH 12/13] Respect reexports from metadata API routes (#70508) --- .../loaders/next-metadata-route-loader.ts | 51 ++++++++++++------- .../metadata-revalidate/app/manifest.ts | 22 ++++++++ .../app/revalidate/og/opengraph-image.tsx | 24 +++++++++ .../app-dir/metadata-revalidate/app/robots.ts | 14 +++++ .../metadata-revalidate/app/sitemap.ts | 12 +++++ .../metadata-revalidate.test.ts | 26 ++++++++++ test/turbopack-build-tests-manifest.json | 9 ++++ 7 files changed, 141 insertions(+), 17 deletions(-) create mode 100644 test/production/app-dir/metadata-revalidate/app/manifest.ts create mode 100644 test/production/app-dir/metadata-revalidate/app/revalidate/og/opengraph-image.tsx create mode 100644 test/production/app-dir/metadata-revalidate/app/robots.ts create mode 100644 test/production/app-dir/metadata-revalidate/app/sitemap.ts create mode 100644 test/production/app-dir/metadata-revalidate/metadata-revalidate.test.ts diff --git a/packages/next/src/build/webpack/loaders/next-metadata-route-loader.ts b/packages/next/src/build/webpack/loaders/next-metadata-route-loader.ts index e49475b52fb4c..14159ef2d3f5e 100644 --- a/packages/next/src/build/webpack/loaders/next-metadata-route-loader.ts +++ b/packages/next/src/build/webpack/loaders/next-metadata-route-loader.ts @@ -14,6 +14,27 @@ function errorOnBadHandler(resourcePath: string) { ` } +/* re-export the userland route configs */ +async function createReExportsCode( + resourcePath: string, + loaderContext: webpack.LoaderContext +) { + const exportNames = await getLoaderModuleNamedExports( + resourcePath, + loaderContext + ) + // Re-export configs but avoid conflicted exports + const reExportNames = exportNames.filter( + (name) => name !== 'default' && name !== 'generateSitemaps' + ) + + return reExportNames.length > 0 + ? `export { ${reExportNames.join(', ')} } from ${JSON.stringify( + resourcePath + )}\n` + : '' +} + const cacheHeader = { none: 'no-cache, no-store', longCache: 'public, immutable, no-transform, max-age=31536000', @@ -85,7 +106,10 @@ export const dynamic = 'force-static' return code } -function getDynamicTextRouteCode(resourcePath: string) { +async function getDynamicTextRouteCode( + resourcePath: string, + loaderContext: webpack.LoaderContext +) { return `\ /* dynamic asset route */ import { NextResponse } from 'next/server' @@ -96,6 +120,7 @@ const contentType = ${JSON.stringify(getContentType(resourcePath))} const fileType = ${JSON.stringify(getFilenameAndExtension(resourcePath).name)} ${errorOnBadHandler(resourcePath)} +${await createReExportsCode(resourcePath, loaderContext)} export async function GET() { const data = await handler() @@ -112,7 +137,10 @@ export async function GET() { } // /[id]/route.js -function getDynamicImageRouteCode(resourcePath: string) { +async function getDynamicImageRouteCode( + resourcePath: string, + loaderContext: webpack.LoaderContext +) { return `\ /* dynamic image route */ import { NextResponse } from 'next/server' @@ -124,6 +152,7 @@ const handler = imageModule.default const generateImageMetadata = imageModule.generateImageMetadata ${errorOnBadHandler(resourcePath)} +${await createReExportsCode(resourcePath, loaderContext)} export async function GET(_, ctx) { const { __metadata_id__, ...params } = ctx.params || {} @@ -162,10 +191,6 @@ async function getDynamicSitemapRouteCode( resourcePath, loaderContext ) - // Re-export configs but avoid conflicted exports - const reExportNames = exportNames.filter( - (name) => name !== 'default' && name !== 'generateSitemaps' - ) const hasGenerateSitemaps = exportNames.includes('generateSitemaps') @@ -195,15 +220,7 @@ const contentType = ${JSON.stringify(getContentType(resourcePath))} const fileType = ${JSON.stringify(getFilenameAndExtension(resourcePath).name)} ${errorOnBadHandler(resourcePath)} - -${'' /* re-export the userland route configs */} -${ - reExportNames.length > 0 - ? `export { ${reExportNames.join(', ')} } from ${JSON.stringify( - resourcePath - )}\n` - : '' -} +${await createReExportsCode(resourcePath, loaderContext)} export async function GET(_, ctx) { const { __metadata_id__: id, ...params } = ctx.params || {} @@ -253,11 +270,11 @@ const nextMetadataRouterLoader: webpack.LoaderDefinitionFunction + Open Graph + + ) + ) +} + +export const revalidate = 5 diff --git a/test/production/app-dir/metadata-revalidate/app/robots.ts b/test/production/app-dir/metadata-revalidate/app/robots.ts new file mode 100644 index 0000000000000..83daa5af5f719 --- /dev/null +++ b/test/production/app-dir/metadata-revalidate/app/robots.ts @@ -0,0 +1,14 @@ +import type { MetadataRoute } from 'next' + +export default function robots(): MetadataRoute.Robots { + return { + rules: { + userAgent: '*', + allow: '/', + disallow: '/private/', + }, + sitemap: 'https://acme.com/sitemap.xml', + } +} + +export const revalidate = 5 diff --git a/test/production/app-dir/metadata-revalidate/app/sitemap.ts b/test/production/app-dir/metadata-revalidate/app/sitemap.ts new file mode 100644 index 0000000000000..8f301a61ef068 --- /dev/null +++ b/test/production/app-dir/metadata-revalidate/app/sitemap.ts @@ -0,0 +1,12 @@ +export default function sitemap() { + return [ + { + url: 'https://acme.com', + lastModified: new Date(), + changeFrequency: 'yearly', + priority: 1, + }, + ] +} + +export const revalidate = 5 diff --git a/test/production/app-dir/metadata-revalidate/metadata-revalidate.test.ts b/test/production/app-dir/metadata-revalidate/metadata-revalidate.test.ts new file mode 100644 index 0000000000000..e4a0517d274d1 --- /dev/null +++ b/test/production/app-dir/metadata-revalidate/metadata-revalidate.test.ts @@ -0,0 +1,26 @@ +import { nextTestSetup } from 'e2e-utils' + +describe('app-dir - metadata-revalidate', () => { + const { next } = nextTestSetup({ + files: __dirname, + }) + + it('should contain the routes in prerender manifest', async () => { + const manifestContent = await next.readFile('.next/prerender-manifest.json') + const prerenderManifest = JSON.parse(manifestContent) + + expect( + prerenderManifest.routes['/revalidate/og/opengraph-image'] + .initialRevalidateSeconds + ).toBe(5) + expect( + prerenderManifest.routes['/manifest.webmanifest'].initialRevalidateSeconds + ).toBe(5) + expect( + prerenderManifest.routes['/robots.txt'].initialRevalidateSeconds + ).toBe(5) + expect( + prerenderManifest.routes['/sitemap.xml'].initialRevalidateSeconds + ).toBe(5) + }) +}) diff --git a/test/turbopack-build-tests-manifest.json b/test/turbopack-build-tests-manifest.json index ac91c72ed04e0..1b766dfa481b4 100644 --- a/test/turbopack-build-tests-manifest.json +++ b/test/turbopack-build-tests-manifest.json @@ -16302,6 +16302,15 @@ "flakey": [], "runtimeError": false }, + "test/production/app-dir/metadata-revalidate/metadata-revalidate.test.ts": { + "passed": [], + "failed": [ + "app-dir - metadata-revalidate should contain the routes in prerender manifest" + ], + "pending": [], + "flakey": [], + "runtimeError": false + }, "test/production/middleware-typescript/test/index.test.ts": { "passed": ["middleware-typescript should have built and started"], "failed": [], From 0b926ff4929ab5efaa9378d5be1c263880f6f57c Mon Sep 17 00:00:00 2001 From: Shu Ding Date: Thu, 26 Sep 2024 16:38:05 +0200 Subject: [PATCH 13/13] Move ci-info utility to be under the server folder (#70514) This is because CI info will be used by other modules of the server, not just Telemetry. This refactoring doesn't change any functionalities. --- packages/next/src/build/collect-build-traces.ts | 2 +- packages/next/src/build/index.ts | 2 +- packages/next/src/build/utils.ts | 2 +- packages/next/src/export/helpers/create-incremental-cache.ts | 2 +- packages/next/src/export/index.ts | 2 +- packages/next/src/export/routes/app-page.ts | 2 +- packages/next/src/export/routes/app-route.ts | 2 +- packages/next/src/export/worker.ts | 2 +- packages/next/src/lib/patch-incorrect-lockfile.ts | 2 +- packages/next/src/lib/verify-typescript-setup.ts | 2 +- packages/next/src/{telemetry => server}/ci-info.ts | 0 packages/next/src/server/config.ts | 2 +- packages/next/src/telemetry/anonymous-meta.ts | 2 +- packages/next/src/telemetry/storage.ts | 2 +- 14 files changed, 13 insertions(+), 13 deletions(-) rename packages/next/src/{telemetry => server}/ci-info.ts (100%) diff --git a/packages/next/src/build/collect-build-traces.ts b/packages/next/src/build/collect-build-traces.ts index cb23aa5bd2793..498aced6a9922 100644 --- a/packages/next/src/build/collect-build-traces.ts +++ b/packages/next/src/build/collect-build-traces.ts @@ -17,7 +17,7 @@ import path from 'path' import fs from 'fs/promises' import { loadBindings } from './swc' import { nonNullable } from '../lib/non-nullable' -import * as ciEnvironment from '../telemetry/ci-info' +import * as ciEnvironment from '../server/ci-info' import debugOriginal from 'next/dist/compiled/debug' import picomatch from 'next/dist/compiled/picomatch' import { defaultOverrides } from '../server/require-hook' diff --git a/packages/next/src/build/index.ts b/packages/next/src/build/index.ts index 0e8520aa15894..3d5cb5002d982 100644 --- a/packages/next/src/build/index.ts +++ b/packages/next/src/build/index.ts @@ -86,7 +86,7 @@ import loadConfig from '../server/config' import type { BuildManifest } from '../server/get-page-files' import { normalizePagePath } from '../shared/lib/page-path/normalize-page-path' import { getPagePath } from '../server/require' -import * as ciEnvironment from '../telemetry/ci-info' +import * as ciEnvironment from '../server/ci-info' import { turborepoTraceAccess, TurborepoAccessTraceResult, diff --git a/packages/next/src/build/utils.ts b/packages/next/src/build/utils.ts index 46f1ffb2707d1..de351bd48df7e 100644 --- a/packages/next/src/build/utils.ts +++ b/packages/next/src/build/utils.ts @@ -79,7 +79,7 @@ import { isClientReference } from '../lib/client-reference' import { withStaticGenerationStore } from '../server/async-storage/with-static-generation-store' import { IncrementalCache } from '../server/lib/incremental-cache' import { nodeFs } from '../server/lib/node-fs-methods' -import * as ciEnvironment from '../telemetry/ci-info' +import * as ciEnvironment from '../server/ci-info' import { normalizeAppPath } from '../shared/lib/router/utils/app-paths' import { denormalizeAppPagePath } from '../shared/lib/page-path/denormalize-app-path' import { RouteKind } from '../server/route-kind' diff --git a/packages/next/src/export/helpers/create-incremental-cache.ts b/packages/next/src/export/helpers/create-incremental-cache.ts index f021a5e55687b..00dd82f9166dd 100644 --- a/packages/next/src/export/helpers/create-incremental-cache.ts +++ b/packages/next/src/export/helpers/create-incremental-cache.ts @@ -1,6 +1,6 @@ import path from 'path' import { IncrementalCache } from '../../server/lib/incremental-cache' -import { hasNextSupport } from '../../telemetry/ci-info' +import { hasNextSupport } from '../../server/ci-info' import { nodeFs } from '../../server/lib/node-fs-methods' import { interopDefault } from '../../lib/interop-default' import { formatDynamicImportPath } from '../../lib/format-dynamic-import-path' diff --git a/packages/next/src/export/index.ts b/packages/next/src/export/index.ts index cd16b3e21c91a..3e5d4ce3c5ef4 100644 --- a/packages/next/src/export/index.ts +++ b/packages/next/src/export/index.ts @@ -36,7 +36,7 @@ import { import loadConfig from '../server/config' import type { ExportPathMap } from '../server/config-shared' import { eventCliSession } from '../telemetry/events' -import { hasNextSupport } from '../telemetry/ci-info' +import { hasNextSupport } from '../server/ci-info' import { Telemetry } from '../telemetry/storage' import { normalizePagePath } from '../shared/lib/page-path/normalize-page-path' import { denormalizePagePath } from '../shared/lib/page-path/denormalize-page-path' diff --git a/packages/next/src/export/routes/app-page.ts b/packages/next/src/export/routes/app-page.ts index 8f4aef67412ec..bd763fccc5311 100644 --- a/packages/next/src/export/routes/app-page.ts +++ b/packages/next/src/export/routes/app-page.ts @@ -15,7 +15,7 @@ import { RSC_PREFETCH_SUFFIX, RSC_SUFFIX, } from '../../lib/constants' -import { hasNextSupport } from '../../telemetry/ci-info' +import { hasNextSupport } from '../../server/ci-info' import { lazyRenderAppPage } from '../../server/route-modules/app-page/module.render' import { isBailoutToCSRError } from '../../shared/lib/lazy-dynamic/bailout-to-csr' import { NodeNextRequest, NodeNextResponse } from '../../server/base-http/node' diff --git a/packages/next/src/export/routes/app-route.ts b/packages/next/src/export/routes/app-route.ts index 938c98661da1b..5bb09ccd67c03 100644 --- a/packages/next/src/export/routes/app-route.ts +++ b/packages/next/src/export/routes/app-route.ts @@ -22,7 +22,7 @@ import type { } from '../../server/lib/mock-request' import { isDynamicUsageError } from '../helpers/is-dynamic-usage-error' import { SERVER_DIRECTORY } from '../../shared/lib/constants' -import { hasNextSupport } from '../../telemetry/ci-info' +import { hasNextSupport } from '../../server/ci-info' import { isStaticGenEnabled } from '../../server/route-modules/app-route/helpers/is-static-gen-enabled' import type { ExperimentalConfig } from '../../server/config-shared' import { isMetadataRouteFile } from '../../lib/metadata/is-metadata-route' diff --git a/packages/next/src/export/worker.ts b/packages/next/src/export/worker.ts index da601af742e75..1c0b8c988ba96 100644 --- a/packages/next/src/export/worker.ts +++ b/packages/next/src/export/worker.ts @@ -27,7 +27,7 @@ import { normalizeAppPath } from '../shared/lib/router/utils/app-paths' import { createRequestResponseMocks } from '../server/lib/mock-request' import { isAppRouteRoute } from '../lib/is-app-route-route' -import { hasNextSupport } from '../telemetry/ci-info' +import { hasNextSupport } from '../server/ci-info' import { exportAppRoute } from './routes/app-route' import { exportAppPage } from './routes/app-page' import { exportPagesPage } from './routes/pages' diff --git a/packages/next/src/lib/patch-incorrect-lockfile.ts b/packages/next/src/lib/patch-incorrect-lockfile.ts index b7678884f7fed..5b77109dedee2 100644 --- a/packages/next/src/lib/patch-incorrect-lockfile.ts +++ b/packages/next/src/lib/patch-incorrect-lockfile.ts @@ -4,7 +4,7 @@ import findUp from 'next/dist/compiled/find-up' // @ts-ignore no-json types import nextPkgJson from 'next/package.json' import type { UnwrapPromise } from './coalesced-function' -import { isCI } from '../telemetry/ci-info' +import { isCI } from '../server/ci-info' import { getRegistry } from './helpers/get-registry' let registry: string | undefined diff --git a/packages/next/src/lib/verify-typescript-setup.ts b/packages/next/src/lib/verify-typescript-setup.ts index 74e8bd41b117c..56641078bceb1 100644 --- a/packages/next/src/lib/verify-typescript-setup.ts +++ b/packages/next/src/lib/verify-typescript-setup.ts @@ -12,7 +12,7 @@ import type { TypeCheckResult } from './typescript/runTypeCheck' import { writeAppTypeDeclarations } from './typescript/writeAppTypeDeclarations' import { writeConfigurationDefaults } from './typescript/writeConfigurationDefaults' import { installDependencies } from './install-dependencies' -import { isCI } from '../telemetry/ci-info' +import { isCI } from '../server/ci-info' import { missingDepsError } from './typescript/missingDependencyError' const requiredPackages = [ diff --git a/packages/next/src/telemetry/ci-info.ts b/packages/next/src/server/ci-info.ts similarity index 100% rename from packages/next/src/telemetry/ci-info.ts rename to packages/next/src/server/ci-info.ts diff --git a/packages/next/src/server/config.ts b/packages/next/src/server/config.ts index 0436a63ad1863..cd7f4810464e8 100644 --- a/packages/next/src/server/config.ts +++ b/packages/next/src/server/config.ts @@ -24,7 +24,7 @@ import { matchRemotePattern } from '../shared/lib/match-remote-pattern' import { ZodParsedType, util as ZodUtil } from 'next/dist/compiled/zod' import type { ZodError, ZodIssue } from 'next/dist/compiled/zod' -import { hasNextSupport } from '../telemetry/ci-info' +import { hasNextSupport } from '../server/ci-info' import { transpileConfig } from '../build/next-config-ts/transpile-config' import { dset } from '../shared/lib/dset' diff --git a/packages/next/src/telemetry/anonymous-meta.ts b/packages/next/src/telemetry/anonymous-meta.ts index 418ccd00815f3..c50aa5057ef11 100644 --- a/packages/next/src/telemetry/anonymous-meta.ts +++ b/packages/next/src/telemetry/anonymous-meta.ts @@ -2,7 +2,7 @@ import isDockerFunction from 'next/dist/compiled/is-docker' import isWslBoolean from 'next/dist/compiled/is-wsl' import os from 'os' -import * as ciEnvironment from './ci-info' +import * as ciEnvironment from '../server/ci-info' type AnonymousMeta = { systemPlatform: NodeJS.Platform diff --git a/packages/next/src/telemetry/storage.ts b/packages/next/src/telemetry/storage.ts index cb45c8ad89ba3..7f75421efbf71 100644 --- a/packages/next/src/telemetry/storage.ts +++ b/packages/next/src/telemetry/storage.ts @@ -6,7 +6,7 @@ import isDockerFunction from 'next/dist/compiled/is-docker' import path from 'path' import { getAnonymousMeta } from './anonymous-meta' -import * as ciEnvironment from './ci-info' +import * as ciEnvironment from '../server/ci-info' import { _postPayload } from './post-payload' import { getRawProjectId } from './project-id' import { AbortController } from 'next/dist/compiled/@edge-runtime/ponyfill'