next 15.4.2-canary.40 → 15.4.2-canary.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/next +1 -1
- package/dist/build/index.js +2 -2
- package/dist/build/swc/index.js +1 -1
- package/dist/build/webpack/loaders/next-app-loader/index.js +5 -10
- package/dist/build/webpack/loaders/next-app-loader/index.js.map +1 -1
- package/dist/build/webpack-config.js +2 -2
- package/dist/client/app-bootstrap.js +1 -1
- package/dist/client/index.js +1 -1
- package/dist/compiled/next-server/pages-api-turbo.runtime.prod.js +1 -1
- package/dist/compiled/next-server/pages-api-turbo.runtime.prod.js.map +1 -1
- package/dist/compiled/next-server/pages-api.runtime.dev.js +1 -1
- package/dist/compiled/next-server/pages-api.runtime.dev.js.map +1 -1
- package/dist/compiled/next-server/pages-api.runtime.prod.js +1 -1
- package/dist/compiled/next-server/pages-api.runtime.prod.js.map +1 -1
- package/dist/compiled/next-server/pages-turbo.runtime.prod.js +1 -1
- package/dist/compiled/next-server/pages-turbo.runtime.prod.js.map +1 -1
- package/dist/compiled/next-server/pages.runtime.dev.js +1 -1
- package/dist/compiled/next-server/pages.runtime.dev.js.map +1 -1
- package/dist/compiled/next-server/pages.runtime.prod.js +1 -1
- package/dist/compiled/next-server/pages.runtime.prod.js.map +1 -1
- package/dist/esm/build/index.js +2 -2
- package/dist/esm/build/swc/index.js +1 -1
- package/dist/esm/build/webpack/loaders/next-app-loader/index.js +5 -10
- package/dist/esm/build/webpack/loaders/next-app-loader/index.js.map +1 -1
- package/dist/esm/build/webpack-config.js +2 -2
- package/dist/esm/client/app-bootstrap.js +1 -1
- package/dist/esm/client/index.js +1 -1
- package/dist/esm/server/config.js +8 -8
- package/dist/esm/server/config.js.map +1 -1
- package/dist/esm/server/dev/hot-reloader-turbopack.js +1 -1
- package/dist/esm/server/dev/hot-reloader-webpack.js +1 -1
- package/dist/esm/server/lib/app-info-log.js +1 -1
- package/dist/esm/server/lib/start-server.js +1 -1
- package/dist/esm/shared/lib/canary-only.js +1 -1
- package/dist/server/config.js +8 -8
- package/dist/server/config.js.map +1 -1
- package/dist/server/dev/hot-reloader-turbopack.js +1 -1
- package/dist/server/dev/hot-reloader-webpack.js +1 -1
- package/dist/server/lib/app-info-log.js +1 -1
- package/dist/server/lib/start-server.js +1 -1
- package/dist/shared/lib/canary-only.js +1 -1
- package/dist/telemetry/anonymous-meta.js +1 -1
- package/dist/telemetry/events/session-stopped.js +2 -2
- package/dist/telemetry/events/version.js +2 -2
- package/dist/types.d.ts +4 -0
- package/package.json +15 -15
package/dist/esm/build/index.js
CHANGED
@@ -299,7 +299,7 @@ export default async function build(dir, reactProductionProfiling = false, debug
|
|
299
299
|
const nextBuildSpan = trace('next-build', undefined, {
|
300
300
|
buildMode: experimentalBuildMode,
|
301
301
|
isTurboBuild: String(isTurbopack),
|
302
|
-
version: "15.4.2-canary.
|
302
|
+
version: "15.4.2-canary.41"
|
303
303
|
});
|
304
304
|
NextBuildContext.nextBuildSpan = nextBuildSpan;
|
305
305
|
NextBuildContext.dir = dir;
|
@@ -736,7 +736,7 @@ export default async function build(dir, reactProductionProfiling = false, debug
|
|
736
736
|
// Files outside of the distDir can be "type": "module"
|
737
737
|
await writeFileUtf8(path.join(distDir, 'package.json'), '{"type": "commonjs"}');
|
738
738
|
// These are written to distDir, so they need to come after creating and cleaning distDr.
|
739
|
-
await recordFrameworkVersion("15.4.2-canary.
|
739
|
+
await recordFrameworkVersion("15.4.2-canary.41");
|
740
740
|
await updateBuildDiagnostics({
|
741
741
|
buildStage: 'start'
|
742
742
|
});
|
@@ -11,7 +11,7 @@ import { isDeepStrictEqual } from 'util';
|
|
11
11
|
import { getDefineEnv } from '../define-env';
|
12
12
|
import { getReactCompilerLoader } from '../get-babel-loader-config';
|
13
13
|
import { throwTurbopackInternalError } from '../../shared/lib/turbopack/internal-error';
|
14
|
-
const nextVersion = "15.4.2-canary.
|
14
|
+
const nextVersion = "15.4.2-canary.41";
|
15
15
|
const ArchName = arch();
|
16
16
|
const PlatformName = platform();
|
17
17
|
function infoLog(...args) {
|
@@ -159,13 +159,14 @@ async function createTreeCodeFromPath(pagePath, { page, resolveDir, resolver, re
|
|
159
159
|
const parallelSegmentPath = subSegmentPath.join('/');
|
160
160
|
// Fill in the loader tree for all of the special files types (layout, default, etc) at this level
|
161
161
|
// `page` is not included here as it's added above.
|
162
|
-
const
|
162
|
+
const filePathEntries = await Promise.all(Object.values(FILE_TYPES).map(async (file)=>{
|
163
163
|
return [
|
164
164
|
file,
|
165
165
|
await resolver(`${appDirPrefix}${// TODO-APP: parallelSegmentPath sometimes ends in `/` but sometimes it doesn't. This should be consistent.
|
166
166
|
parallelSegmentPath.endsWith('/') ? parallelSegmentPath : parallelSegmentPath + '/'}${file}`)
|
167
167
|
];
|
168
168
|
}));
|
169
|
+
const filePaths = new Map(filePathEntries);
|
169
170
|
// Only resolve global-* convention files at the root layer
|
170
171
|
if (isRootLayer) {
|
171
172
|
const resolvedGlobalErrorPath = await resolver(`${appDirPrefix}/${GLOBAL_ERROR_FILE_TYPE}`);
|
@@ -174,10 +175,7 @@ async function createTreeCodeFromPath(pagePath, { page, resolveDir, resolver, re
|
|
174
175
|
}
|
175
176
|
// Add global-error to root layer's filePaths, so that it's always available,
|
176
177
|
// by default it's the built-in global-error.js
|
177
|
-
filePaths.
|
178
|
-
GLOBAL_ERROR_FILE_TYPE,
|
179
|
-
globalError
|
180
|
-
]);
|
178
|
+
filePaths.set(GLOBAL_ERROR_FILE_TYPE, globalError);
|
181
179
|
// TODO(global-not-found): remove this flag assertion condition
|
182
180
|
// once global-not-found is stable
|
183
181
|
if (isGlobalNotFoundEnabled) {
|
@@ -187,13 +185,10 @@ async function createTreeCodeFromPath(pagePath, { page, resolveDir, resolver, re
|
|
187
185
|
}
|
188
186
|
// Add global-not-found to root layer's filePaths, so that it's always available,
|
189
187
|
// by default it's the built-in global-not-found.js
|
190
|
-
filePaths.
|
191
|
-
GLOBAL_NOT_FOUND_FILE_TYPE,
|
192
|
-
globalNotFound
|
193
|
-
]);
|
188
|
+
filePaths.set(GLOBAL_NOT_FOUND_FILE_TYPE, globalNotFound);
|
194
189
|
}
|
195
190
|
}
|
196
|
-
let definedFilePaths = filePaths.filter(([, filePath])=>filePath !== undefined);
|
191
|
+
let definedFilePaths = Array.from(filePaths.entries()).filter(([, filePath])=>filePath !== undefined);
|
197
192
|
// Add default access fallback as root fallback if not present
|
198
193
|
const existedConventionNames = new Set(definedFilePaths.map(([type])=>type));
|
199
194
|
// If the first layer is a group route, we treat it as root layer
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../../../src/build/webpack/loaders/next-app-loader/index.ts"],"sourcesContent":["import type webpack from 'next/dist/compiled/webpack/webpack'\nimport {\n UNDERSCORE_NOT_FOUND_ROUTE,\n UNDERSCORE_NOT_FOUND_ROUTE_ENTRY,\n type ValueOf,\n} from '../../../../shared/lib/constants'\nimport type { ModuleTuple, CollectedMetadata } from '../metadata/types'\n\nimport path from 'path'\nimport { bold } from '../../../../lib/picocolors'\nimport { getModuleBuildInfo } from '../get-module-build-info'\nimport { verifyRootLayout } from '../../../../lib/verify-root-layout'\nimport * as Log from '../../../output/log'\nimport { APP_DIR_ALIAS } from '../../../../lib/constants'\nimport {\n createMetadataExportsCode,\n createStaticMetadataFromRoute,\n} from '../metadata/discover'\nimport { promises as fs } from 'fs'\nimport { isAppRouteRoute } from '../../../../lib/is-app-route-route'\nimport type { NextConfig } from '../../../../server/config-shared'\nimport { AppPathnameNormalizer } from '../../../../server/normalizers/built/app/app-pathname-normalizer'\nimport type { MiddlewareConfig } from '../../../analysis/get-page-static-info'\nimport { isAppBuiltinNotFoundPage } from '../../../utils'\nimport { loadEntrypoint } from '../../../load-entrypoint'\nimport {\n isGroupSegment,\n DEFAULT_SEGMENT_KEY,\n PAGE_SEGMENT_KEY,\n} from '../../../../shared/lib/segment'\nimport { getFilesInDir } from '../../../../lib/get-files-in-dir'\nimport type { PageExtensions } from '../../../page-extensions-type'\nimport { PARALLEL_ROUTE_DEFAULT_PATH } from '../../../../client/components/builtin/default'\nimport type { Compilation } from 'webpack'\nimport { createAppRouteCode } from './create-app-route-code'\n\nexport type AppLoaderOptions = {\n name: string\n page: string\n pagePath: string\n appDir: string\n appPaths: readonly string[] | null\n preferredRegion: string | string[] | undefined\n pageExtensions: PageExtensions\n assetPrefix: string\n rootDir?: string\n tsconfigPath?: string\n isDev?: true\n basePath: string\n nextConfigOutput?: NextConfig['output']\n middlewareConfig: string\n isGlobalNotFoundEnabled: true | undefined\n}\ntype AppLoader = webpack.LoaderDefinitionFunction<AppLoaderOptions>\n\nconst HTTP_ACCESS_FALLBACKS = {\n 'not-found': 'not-found',\n forbidden: 'forbidden',\n unauthorized: 'unauthorized',\n} as const\nconst defaultHTTPAccessFallbackPaths = {\n 'not-found': 'next/dist/client/components/builtin/not-found.js',\n forbidden: 'next/dist/client/components/builtin/forbidden.js',\n unauthorized: 'next/dist/client/components/builtin/unauthorized.js',\n} as const\n\nconst FILE_TYPES = {\n layout: 'layout',\n template: 'template',\n error: 'error',\n loading: 'loading',\n 'global-error': 'global-error',\n 'global-not-found': 'global-not-found',\n ...HTTP_ACCESS_FALLBACKS,\n} as const\n\nconst GLOBAL_ERROR_FILE_TYPE = 'global-error'\nconst GLOBAL_NOT_FOUND_FILE_TYPE = 'global-not-found'\nconst PAGE_SEGMENT = 'page$'\nconst PARALLEL_VIRTUAL_SEGMENT = 'slot$'\n\nconst defaultGlobalErrorPath =\n 'next/dist/client/components/builtin/global-error.js'\nconst defaultNotFoundPath = 'next/dist/client/components/builtin/not-found.js'\nconst defaultLayoutPath = 'next/dist/client/components/builtin/layout.js'\nconst defaultGlobalNotFoundPath =\n 'next/dist/client/components/builtin/global-not-found.js'\n\ntype DirResolver = (pathToResolve: string) => string\ntype PathResolver = (\n pathname: string\n) => Promise<string | undefined> | string | undefined\nexport type MetadataResolver = (\n dir: string,\n filename: string,\n extensions: readonly string[]\n) => Promise<string | undefined>\n\nexport type AppDirModules = {\n readonly [moduleKey in ValueOf<typeof FILE_TYPES>]?: ModuleTuple\n} & {\n readonly page?: ModuleTuple\n} & {\n readonly metadata?: CollectedMetadata\n} & {\n readonly defaultPage?: ModuleTuple\n}\n\nconst normalizeParallelKey = (key: string) =>\n key.startsWith('@') ? key.slice(1) : key\n\nconst isDirectory = async (pathname: string) => {\n try {\n const stat = await fs.stat(pathname)\n return stat.isDirectory()\n } catch (err) {\n return false\n }\n}\n\nasync function createTreeCodeFromPath(\n pagePath: string,\n {\n page,\n resolveDir,\n resolver,\n resolveParallelSegments,\n metadataResolver,\n pageExtensions,\n basePath,\n collectedDeclarations,\n isGlobalNotFoundEnabled,\n }: {\n page: string\n resolveDir: DirResolver\n resolver: PathResolver\n metadataResolver: MetadataResolver\n resolveParallelSegments: (\n pathname: string\n ) => [key: string, segment: string | string[]][]\n loaderContext: webpack.LoaderContext<AppLoaderOptions>\n pageExtensions: PageExtensions\n basePath: string\n collectedDeclarations: [string, string][]\n isGlobalNotFoundEnabled: boolean\n }\n): Promise<{\n treeCode: string\n pages: string\n rootLayout: string | undefined\n globalError: string\n globalNotFound: string\n}> {\n const splittedPath = pagePath.split(/[\\\\/]/, 1)\n const isNotFoundRoute = page === UNDERSCORE_NOT_FOUND_ROUTE_ENTRY\n const isDefaultNotFound = isAppBuiltinNotFoundPage(pagePath)\n\n const appDirPrefix = isDefaultNotFound ? APP_DIR_ALIAS : splittedPath[0]\n const pages: string[] = []\n\n let rootLayout: string | undefined\n let globalError: string = defaultGlobalErrorPath\n let globalNotFound: string = defaultNotFoundPath\n\n async function resolveAdjacentParallelSegments(\n segmentPath: string\n ): Promise<string[]> {\n const absoluteSegmentPath = await resolveDir(\n `${appDirPrefix}${segmentPath}`\n )\n\n if (!absoluteSegmentPath) {\n return []\n }\n\n const segmentIsDirectory = await isDirectory(absoluteSegmentPath)\n\n if (!segmentIsDirectory) {\n return []\n }\n\n // We need to resolve all parallel routes in this level.\n const files = await fs.opendir(absoluteSegmentPath)\n\n const parallelSegments: string[] = ['children']\n\n for await (const dirent of files) {\n // Make sure name starts with \"@\" and is a directory.\n if (dirent.isDirectory() && dirent.name.charCodeAt(0) === 64) {\n parallelSegments.push(dirent.name)\n }\n }\n\n return parallelSegments\n }\n\n async function createSubtreePropsFromSegmentPath(\n segments: string[],\n nestedCollectedDeclarations: [string, string][]\n ): Promise<{\n treeCode: string\n }> {\n const segmentPath = segments.join('/')\n\n // Existing tree are the children of the current segment\n const props: Record<string, string> = {}\n // Root layer could be 1st layer of normal routes\n const isRootLayer = segments.length === 0\n const isRootLayoutOrRootPage = segments.length <= 1\n\n // We need to resolve all parallel routes in this level.\n const parallelSegments: [key: string, segment: string | string[]][] = []\n if (isRootLayer) {\n parallelSegments.push(['children', ''])\n } else {\n parallelSegments.push(...resolveParallelSegments(segmentPath))\n }\n\n let metadata: Awaited<ReturnType<typeof createStaticMetadataFromRoute>> =\n null\n const routerDirPath = `${appDirPrefix}${segmentPath}`\n const resolvedRouteDir = resolveDir(routerDirPath)\n\n if (resolvedRouteDir) {\n metadata = await createStaticMetadataFromRoute(resolvedRouteDir, {\n basePath,\n segment: segmentPath,\n metadataResolver,\n isRootLayoutOrRootPage,\n pageExtensions,\n })\n }\n\n for (const [parallelKey, parallelSegment] of parallelSegments) {\n // if parallelSegment is the page segment (ie, `page$` and not ['page$']), it gets loaded into the __PAGE__ slot\n // as it's the page for the current route.\n if (parallelSegment === PAGE_SEGMENT) {\n const matchedPagePath = `${appDirPrefix}${segmentPath}${\n parallelKey === 'children' ? '' : `/${parallelKey}`\n }/page`\n\n const resolvedPagePath = await resolver(matchedPagePath)\n if (resolvedPagePath) {\n pages.push(resolvedPagePath)\n\n const varName = `page${nestedCollectedDeclarations.length}`\n nestedCollectedDeclarations.push([varName, resolvedPagePath])\n\n // Use '' for segment as it's the page. There can't be a segment called '' so this is the safest way to add it.\n props[normalizeParallelKey(parallelKey)] =\n `['${PAGE_SEGMENT_KEY}', {}, {\n page: [${varName}, ${JSON.stringify(resolvedPagePath)}],\n ${createMetadataExportsCode(metadata)}\n }]`\n continue\n } else {\n throw new Error(`Can't resolve ${matchedPagePath}`)\n }\n }\n\n // if the parallelSegment was not matched to the __PAGE__ slot, then it's a parallel route at this level.\n // the code below recursively traverses the parallel slots directory to match the corresponding __PAGE__ for each parallel slot\n // while also filling in layout/default/etc files into the loader tree at each segment level.\n\n const subSegmentPath = [...segments]\n if (parallelKey !== 'children') {\n // A `children` parallel key should have already been processed in the above segment\n // So we exclude it when constructing the subsegment path for the remaining segment levels\n subSegmentPath.push(parallelKey)\n }\n\n const normalizedParallelSegment = Array.isArray(parallelSegment)\n ? parallelSegment[0]\n : parallelSegment\n\n if (\n normalizedParallelSegment !== PAGE_SEGMENT &&\n normalizedParallelSegment !== PARALLEL_VIRTUAL_SEGMENT\n ) {\n // If we don't have a page segment, nor a special $children marker, it means we need to traverse the next directory\n // (ie, `normalizedParallelSegment` would correspond with the folder that contains the next level of pages/layout/etc)\n // we push it to the subSegmentPath so that we can fill in the loader tree for that segment.\n subSegmentPath.push(normalizedParallelSegment)\n }\n\n const parallelSegmentPath = subSegmentPath.join('/')\n\n // Fill in the loader tree for all of the special files types (layout, default, etc) at this level\n // `page` is not included here as it's added above.\n const filePaths = await Promise.all(\n Object.values(FILE_TYPES).map(async (file) => {\n return [\n file,\n await resolver(\n `${appDirPrefix}${\n // TODO-APP: parallelSegmentPath sometimes ends in `/` but sometimes it doesn't. This should be consistent.\n parallelSegmentPath.endsWith('/')\n ? parallelSegmentPath\n : parallelSegmentPath + '/'\n }${file}`\n ),\n ] as const\n })\n )\n\n // Only resolve global-* convention files at the root layer\n if (isRootLayer) {\n const resolvedGlobalErrorPath = await resolver(\n `${appDirPrefix}/${GLOBAL_ERROR_FILE_TYPE}`\n )\n if (resolvedGlobalErrorPath) {\n globalError = resolvedGlobalErrorPath\n }\n // Add global-error to root layer's filePaths, so that it's always available,\n // by default it's the built-in global-error.js\n filePaths.push([GLOBAL_ERROR_FILE_TYPE, globalError])\n\n // TODO(global-not-found): remove this flag assertion condition\n // once global-not-found is stable\n if (isGlobalNotFoundEnabled) {\n const resolvedGlobalNotFoundPath = await resolver(\n `${appDirPrefix}/${GLOBAL_NOT_FOUND_FILE_TYPE}`\n )\n if (resolvedGlobalNotFoundPath) {\n globalNotFound = resolvedGlobalNotFoundPath\n }\n // Add global-not-found to root layer's filePaths, so that it's always available,\n // by default it's the built-in global-not-found.js\n filePaths.push([GLOBAL_NOT_FOUND_FILE_TYPE, globalNotFound])\n }\n }\n\n let definedFilePaths = filePaths.filter(\n ([, filePath]) => filePath !== undefined\n ) as [ValueOf<typeof FILE_TYPES>, string][]\n\n // Add default access fallback as root fallback if not present\n const existedConventionNames = new Set(\n definedFilePaths.map(([type]) => type)\n )\n // If the first layer is a group route, we treat it as root layer\n const isFirstLayerGroupRoute =\n segments.length === 1 &&\n subSegmentPath.filter((seg) => isGroupSegment(seg)).length === 1\n\n if (isRootLayer || isFirstLayerGroupRoute) {\n const accessFallbackTypes = Object.keys(\n defaultHTTPAccessFallbackPaths\n ) as (keyof typeof defaultHTTPAccessFallbackPaths)[]\n for (const type of accessFallbackTypes) {\n const hasRootFallbackFile = await resolver(\n `${appDirPrefix}/${FILE_TYPES[type]}`\n )\n const hasLayerFallbackFile = existedConventionNames.has(type)\n\n // If you already have a root access error fallback, don't insert default access error boundary to group routes root\n if (\n // Is treated as root layout and without boundary\n !(hasRootFallbackFile && isFirstLayerGroupRoute) &&\n // Does not have a fallback boundary file\n !hasLayerFallbackFile\n ) {\n const defaultFallbackPath = defaultHTTPAccessFallbackPaths[type]\n if (!(isDefaultNotFound && type === 'not-found')) {\n definedFilePaths.push([type, defaultFallbackPath])\n }\n }\n }\n }\n\n if (!rootLayout) {\n const layoutPath = definedFilePaths.find(\n ([type]) => type === 'layout'\n )?.[1]\n rootLayout = layoutPath\n\n // When `global-not-found` is disabled, we insert a default layout if\n // root layout is presented. This logic and the default layout will be removed\n // once `global-not-found` is stabilized.\n if (\n !isGlobalNotFoundEnabled &&\n isDefaultNotFound &&\n !layoutPath &&\n !rootLayout\n ) {\n rootLayout = defaultLayoutPath\n definedFilePaths.push(['layout', rootLayout])\n }\n }\n\n let parallelSegmentKey = Array.isArray(parallelSegment)\n ? parallelSegment[0]\n : parallelSegment\n\n // normalize the parallel segment key to remove any special markers that we inserted in the\n // earlier logic (such as children$ and page$). These should never appear in the loader tree, and\n // should instead be the corresponding segment keys (ie `__PAGE__`) or the `children` parallel route.\n parallelSegmentKey =\n parallelSegmentKey === PARALLEL_VIRTUAL_SEGMENT\n ? '(slot)'\n : parallelSegmentKey === PAGE_SEGMENT\n ? PAGE_SEGMENT_KEY\n : parallelSegmentKey\n\n const normalizedParallelKey = normalizeParallelKey(parallelKey)\n let subtreeCode\n // If it's root not found page, set not-found boundary as children page\n if (isNotFoundRoute) {\n if (normalizedParallelKey === 'children') {\n const matchedGlobalNotFound = isGlobalNotFoundEnabled\n ? definedFilePaths.find(\n ([type]) => type === GLOBAL_NOT_FOUND_FILE_TYPE\n )?.[1] ?? defaultGlobalNotFoundPath\n : undefined\n\n // If custom global-not-found.js is defined, use global-not-found.js\n if (matchedGlobalNotFound) {\n const varName = `notFound${nestedCollectedDeclarations.length}`\n nestedCollectedDeclarations.push([varName, matchedGlobalNotFound])\n subtreeCode = `{\n children: [${JSON.stringify(UNDERSCORE_NOT_FOUND_ROUTE)}, {\n children: ['${PAGE_SEGMENT_KEY}', {}, {\n page: [\n ${varName},\n ${JSON.stringify(matchedGlobalNotFound)}\n ]\n }]\n }, {}]\n }`\n } else {\n // If custom not-found.js is found, use it and layout to compose the page,\n // and fallback to built-in not-found component if doesn't exist.\n const notFoundPath =\n definedFilePaths.find(([type]) => type === 'not-found')?.[1] ??\n defaultNotFoundPath\n const varName = `notFound${nestedCollectedDeclarations.length}`\n nestedCollectedDeclarations.push([varName, notFoundPath])\n subtreeCode = `{\n children: [${JSON.stringify(UNDERSCORE_NOT_FOUND_ROUTE)}, {\n children: ['${PAGE_SEGMENT_KEY}', {}, {\n page: [\n ${varName},\n ${JSON.stringify(notFoundPath)}\n ]\n }]\n }, {}]\n }`\n }\n }\n }\n\n // For 404 route\n // if global-not-found is in definedFilePaths, remove root layout for /_not-found\n // TODO: remove this once global-not-found is stable.\n if (isNotFoundRoute && isGlobalNotFoundEnabled) {\n definedFilePaths = definedFilePaths.filter(\n ([type]) => type !== 'layout'\n )\n }\n\n const modulesCode = `{\n ${definedFilePaths\n .map(([file, filePath]) => {\n const varName = `module${nestedCollectedDeclarations.length}`\n nestedCollectedDeclarations.push([varName, filePath])\n return `'${file}': [${varName}, ${JSON.stringify(filePath)}],`\n })\n .join('\\n')}\n ${createMetadataExportsCode(metadata)}\n }`\n\n if (!subtreeCode) {\n const { treeCode: pageSubtreeCode } =\n await createSubtreePropsFromSegmentPath(\n subSegmentPath,\n nestedCollectedDeclarations\n )\n\n subtreeCode = pageSubtreeCode\n }\n\n props[normalizedParallelKey] = `[\n '${parallelSegmentKey}',\n ${subtreeCode},\n ${modulesCode}\n ]`\n }\n\n const adjacentParallelSegments =\n await resolveAdjacentParallelSegments(segmentPath)\n\n for (const adjacentParallelSegment of adjacentParallelSegments) {\n if (!props[normalizeParallelKey(adjacentParallelSegment)]) {\n const actualSegment =\n adjacentParallelSegment === 'children'\n ? ''\n : `/${adjacentParallelSegment}`\n\n // if a default is found, use that. Otherwise use the fallback, which will trigger a `notFound()`\n const defaultPath =\n (await resolver(\n `${appDirPrefix}${segmentPath}${actualSegment}/default`\n )) ?? PARALLEL_ROUTE_DEFAULT_PATH\n\n const varName = `default${nestedCollectedDeclarations.length}`\n nestedCollectedDeclarations.push([varName, defaultPath])\n props[normalizeParallelKey(adjacentParallelSegment)] = `[\n '${DEFAULT_SEGMENT_KEY}',\n {},\n {\n defaultPage: [${varName}, ${JSON.stringify(defaultPath)}],\n }\n ]`\n }\n }\n return {\n treeCode: `{\n ${Object.entries(props)\n .map(([key, value]) => `${key}: ${value}`)\n .join(',\\n')}\n }`,\n }\n }\n\n const { treeCode } = await createSubtreePropsFromSegmentPath(\n [],\n collectedDeclarations\n )\n\n return {\n treeCode: `${treeCode}.children;`,\n pages: `${JSON.stringify(pages)};`,\n rootLayout,\n globalError,\n globalNotFound,\n }\n}\n\nfunction createAbsolutePath(appDir: string, pathToTurnAbsolute: string) {\n return (\n pathToTurnAbsolute\n // Replace all POSIX path separators with the current OS path separator\n .replace(/\\//g, path.sep)\n .replace(/^private-next-app-dir/, appDir)\n )\n}\n\nconst filesInDirMapMap: WeakMap<\n Compilation,\n Map<string, Promise<Set<string>>>\n> = new WeakMap()\nconst nextAppLoader: AppLoader = async function nextAppLoader() {\n const loaderOptions = this.getOptions()\n const {\n name,\n appDir,\n appPaths,\n pagePath,\n pageExtensions,\n rootDir,\n tsconfigPath,\n isDev,\n nextConfigOutput,\n preferredRegion,\n basePath,\n middlewareConfig: middlewareConfigBase64,\n } = loaderOptions\n\n const isGlobalNotFoundEnabled = !!loaderOptions.isGlobalNotFoundEnabled\n\n // Update FILE_TYPES on the very top-level of the loader\n if (!isGlobalNotFoundEnabled) {\n // @ts-expect-error this delete is only necessary while experimental\n delete FILE_TYPES['global-not-found']\n }\n\n const buildInfo = getModuleBuildInfo((this as any)._module)\n const collectedDeclarations: [string, string][] = []\n const page = name.replace(/^app/, '')\n const middlewareConfig: MiddlewareConfig = JSON.parse(\n Buffer.from(middlewareConfigBase64, 'base64').toString()\n )\n buildInfo.route = {\n page,\n absolutePagePath: createAbsolutePath(appDir, pagePath),\n preferredRegion,\n middlewareConfig,\n relatedModules: [],\n }\n\n const extensions =\n typeof pageExtensions === 'string'\n ? [pageExtensions]\n : pageExtensions.map((extension) => `.${extension}`)\n\n const normalizedAppPaths =\n typeof appPaths === 'string' ? [appPaths] : appPaths || []\n\n const resolveParallelSegments = (\n pathname: string\n ): [string, string | string[]][] => {\n const matched: Record<string, string | string[]> = {}\n let existingChildrenPath: string | undefined\n for (const appPath of normalizedAppPaths) {\n if (appPath.startsWith(pathname + '/')) {\n const rest = appPath.slice(pathname.length + 1).split('/')\n\n // It is the actual page, mark it specially.\n if (rest.length === 1 && rest[0] === 'page') {\n existingChildrenPath = appPath\n matched.children = PAGE_SEGMENT\n continue\n }\n\n const isParallelRoute = rest[0].startsWith('@')\n if (isParallelRoute) {\n if (rest.length === 2 && rest[1] === 'page') {\n // We found a parallel route at this level. We don't want to mark it explicitly as the page segment,\n // as that should be matched to the `children` slot. Instead, we use an array, to signal to `createSubtreePropsFromSegmentPath`\n // that it needs to recursively fill in the loader tree code for the parallel route at the appropriate levels.\n matched[rest[0]] = [PAGE_SEGMENT]\n continue\n }\n // If it was a parallel route but we weren't able to find the page segment (ie, maybe the page is nested further)\n // we first insert a special marker to ensure that we still process layout/default/etc at the slot level prior to continuing\n // on to the page segment.\n matched[rest[0]] = [PARALLEL_VIRTUAL_SEGMENT, ...rest.slice(1)]\n continue\n }\n\n if (existingChildrenPath && matched.children !== rest[0]) {\n // If we get here, it means we already set a `page` segment earlier in the loop,\n // meaning we already matched a page to the `children` parallel segment.\n const isIncomingParallelPage = appPath.includes('@')\n const hasCurrentParallelPage = existingChildrenPath.includes('@')\n\n if (isIncomingParallelPage) {\n // The duplicate segment was for a parallel slot. In this case,\n // rather than throwing an error, we can ignore it since this can happen for valid reasons.\n // For example, when we attempt to normalize catch-all routes, we'll push potential slot matches so\n // that they are available in the loader tree when we go to render the page.\n // We only need to throw an error if the duplicate segment was for a regular page.\n // For example, /app/(groupa)/page & /app/(groupb)/page is an error since it corresponds\n // with the same path.\n continue\n } else if (!hasCurrentParallelPage && !isIncomingParallelPage) {\n // Both the current `children` and the incoming `children` are regular pages.\n throw new Error(\n `You cannot have two parallel pages that resolve to the same path. Please check ${existingChildrenPath} and ${appPath}. Refer to the route group docs for more information: https://nextjs.org/docs/app/building-your-application/routing/route-groups`\n )\n }\n }\n\n existingChildrenPath = appPath\n matched.children = rest[0]\n }\n }\n\n return Object.entries(matched)\n }\n\n const resolveDir: DirResolver = (pathToResolve) => {\n return createAbsolutePath(appDir, pathToResolve)\n }\n\n const resolveAppRoute: PathResolver = (pathToResolve) => {\n return createAbsolutePath(appDir, pathToResolve)\n }\n\n // Cached checker to see if a file exists in a given directory.\n // This can be more efficient than checking them with `fs.stat` one by one\n // because all the thousands of files are likely in a few possible directories.\n // Note that it should only be cached for this compilation, not globally.\n const fileExistsInDirectory = async (dirname: string, fileName: string) => {\n // I don't think we should ever hit this code path, but if we do we should handle it gracefully.\n if (this._compilation === undefined) {\n try {\n return (await getFilesInDir(dirname).catch(() => new Set())).has(\n fileName\n )\n } catch (e) {\n return false\n }\n }\n const map =\n filesInDirMapMap.get(this._compilation) ||\n new Map<string, Promise<Set<string>>>()\n if (!filesInDirMapMap.has(this._compilation)) {\n filesInDirMapMap.set(this._compilation, map)\n }\n if (!map.has(dirname)) {\n map.set(\n dirname,\n getFilesInDir(dirname).catch(() => new Set())\n )\n }\n return ((await map.get(dirname)) || new Set()).has(fileName)\n }\n\n const resolver: PathResolver = async (pathname) => {\n const absolutePath = createAbsolutePath(appDir, pathname)\n\n const filenameIndex = absolutePath.lastIndexOf(path.sep)\n const dirname = absolutePath.slice(0, filenameIndex)\n const filename = absolutePath.slice(filenameIndex + 1)\n\n let result: string | undefined\n\n for (const ext of extensions) {\n const absolutePathWithExtension = `${absolutePath}${ext}`\n if (\n !result &&\n (await fileExistsInDirectory(dirname, `${filename}${ext}`))\n ) {\n result = absolutePathWithExtension\n }\n // Call `addMissingDependency` for all files even if they didn't match,\n // because they might be added or removed during development.\n this.addMissingDependency(absolutePathWithExtension)\n }\n\n return result\n }\n\n const metadataResolver: MetadataResolver = async (\n dirname,\n filename,\n exts\n ) => {\n const absoluteDir = createAbsolutePath(appDir, dirname)\n\n let result: string | undefined\n\n for (const ext of exts) {\n // Compared to `resolver` above the exts do not have the `.` included already, so it's added here.\n const filenameWithExt = `${filename}.${ext}`\n const absolutePathWithExtension = `${absoluteDir}${path.sep}${filenameWithExt}`\n if (!result && (await fileExistsInDirectory(dirname, filenameWithExt))) {\n result = absolutePathWithExtension\n }\n // Call `addMissingDependency` for all files even if they didn't match,\n // because they might be added or removed during development.\n this.addMissingDependency(absolutePathWithExtension)\n }\n\n return result\n }\n\n if (isAppRouteRoute(name)) {\n return createAppRouteCode({\n appDir,\n // TODO: investigate if the local `page` is the same as the loaderOptions.page\n page: loaderOptions.page,\n name,\n pagePath,\n resolveAppRoute,\n pageExtensions,\n nextConfigOutput,\n })\n }\n\n let treeCodeResult = await createTreeCodeFromPath(pagePath, {\n page,\n resolveDir,\n resolver,\n metadataResolver,\n resolveParallelSegments,\n loaderContext: this,\n pageExtensions,\n basePath,\n collectedDeclarations,\n isGlobalNotFoundEnabled,\n })\n\n const isGlobalNotFoundPath =\n page === UNDERSCORE_NOT_FOUND_ROUTE_ENTRY &&\n !!treeCodeResult.globalNotFound &&\n isGlobalNotFoundEnabled\n\n if (!treeCodeResult.rootLayout && !isGlobalNotFoundPath) {\n if (!isDev) {\n // If we're building and missing a root layout, exit the build\n Log.error(\n `${bold(\n pagePath.replace(`${APP_DIR_ALIAS}/`, '')\n )} doesn't have a root layout. To fix this error, make sure every page has a root layout.`\n )\n process.exit(1)\n } else {\n // In dev we'll try to create a root layout\n const [createdRootLayout, rootLayoutPath] = await verifyRootLayout({\n appDir: appDir,\n dir: rootDir!,\n tsconfigPath: tsconfigPath!,\n pagePath,\n pageExtensions,\n })\n if (!createdRootLayout) {\n let message = `${bold(\n pagePath.replace(`${APP_DIR_ALIAS}/`, '')\n )} doesn't have a root layout. `\n\n if (rootLayoutPath) {\n message += `We tried to create ${bold(\n path.relative(this._compiler?.context ?? '', rootLayoutPath)\n )} for you but something went wrong.`\n } else {\n message +=\n 'To fix this error, make sure every page has a root layout.'\n }\n\n throw new Error(message)\n }\n\n // Clear fs cache, get the new result with the created root layout.\n if (this._compilation) filesInDirMapMap.get(this._compilation)?.clear()\n treeCodeResult = await createTreeCodeFromPath(pagePath, {\n page,\n resolveDir,\n resolver,\n metadataResolver,\n resolveParallelSegments,\n loaderContext: this,\n pageExtensions,\n basePath,\n collectedDeclarations,\n isGlobalNotFoundEnabled,\n })\n }\n }\n\n const pathname = new AppPathnameNormalizer().normalize(page)\n\n // Prefer to modify next/src/server/app-render/entry-base.ts since this is shared with Turbopack.\n // Any changes to this code should be reflected in Turbopack's app_source.rs and/or app-renderer.tsx as well.\n const code = await loadEntrypoint(\n 'app-page',\n {\n VAR_DEFINITION_PAGE: page,\n VAR_DEFINITION_PATHNAME: pathname,\n VAR_MODULE_GLOBAL_ERROR: treeCodeResult.globalError,\n },\n {\n tree: treeCodeResult.treeCode,\n pages: treeCodeResult.pages,\n __next_app_require__: '__webpack_require__',\n // all modules are in the entry chunk, so we never actually need to load chunks in webpack\n __next_app_load_chunk__: '() => Promise.resolve()',\n }\n )\n\n // Lazily evaluate the imported modules in the generated code\n const header = collectedDeclarations\n .map(([varName, modulePath]) => {\n return `const ${varName} = () => import(/* webpackMode: \"eager\" */ ${JSON.stringify(\n modulePath\n )});\\n`\n })\n .join('')\n\n return header + code\n}\n\nexport default nextAppLoader\n"],"names":["UNDERSCORE_NOT_FOUND_ROUTE","UNDERSCORE_NOT_FOUND_ROUTE_ENTRY","path","bold","getModuleBuildInfo","verifyRootLayout","Log","APP_DIR_ALIAS","createMetadataExportsCode","createStaticMetadataFromRoute","promises","fs","isAppRouteRoute","AppPathnameNormalizer","isAppBuiltinNotFoundPage","loadEntrypoint","isGroupSegment","DEFAULT_SEGMENT_KEY","PAGE_SEGMENT_KEY","getFilesInDir","PARALLEL_ROUTE_DEFAULT_PATH","createAppRouteCode","HTTP_ACCESS_FALLBACKS","forbidden","unauthorized","defaultHTTPAccessFallbackPaths","FILE_TYPES","layout","template","error","loading","GLOBAL_ERROR_FILE_TYPE","GLOBAL_NOT_FOUND_FILE_TYPE","PAGE_SEGMENT","PARALLEL_VIRTUAL_SEGMENT","defaultGlobalErrorPath","defaultNotFoundPath","defaultLayoutPath","defaultGlobalNotFoundPath","normalizeParallelKey","key","startsWith","slice","isDirectory","pathname","stat","err","createTreeCodeFromPath","pagePath","page","resolveDir","resolver","resolveParallelSegments","metadataResolver","pageExtensions","basePath","collectedDeclarations","isGlobalNotFoundEnabled","splittedPath","split","isNotFoundRoute","isDefaultNotFound","appDirPrefix","pages","rootLayout","globalError","globalNotFound","resolveAdjacentParallelSegments","segmentPath","absoluteSegmentPath","segmentIsDirectory","files","opendir","parallelSegments","dirent","name","charCodeAt","push","createSubtreePropsFromSegmentPath","segments","nestedCollectedDeclarations","join","props","isRootLayer","length","isRootLayoutOrRootPage","metadata","routerDirPath","resolvedRouteDir","segment","parallelKey","parallelSegment","matchedPagePath","resolvedPagePath","varName","JSON","stringify","Error","subSegmentPath","normalizedParallelSegment","Array","isArray","parallelSegmentPath","filePaths","Promise","all","Object","values","map","file","endsWith","resolvedGlobalErrorPath","resolvedGlobalNotFoundPath","definedFilePaths","filter","filePath","undefined","existedConventionNames","Set","type","isFirstLayerGroupRoute","seg","accessFallbackTypes","keys","hasRootFallbackFile","hasLayerFallbackFile","has","defaultFallbackPath","layoutPath","find","parallelSegmentKey","normalizedParallelKey","subtreeCode","matchedGlobalNotFound","notFoundPath","modulesCode","treeCode","pageSubtreeCode","adjacentParallelSegments","adjacentParallelSegment","actualSegment","defaultPath","entries","value","createAbsolutePath","appDir","pathToTurnAbsolute","replace","sep","filesInDirMapMap","WeakMap","nextAppLoader","loaderOptions","getOptions","appPaths","rootDir","tsconfigPath","isDev","nextConfigOutput","preferredRegion","middlewareConfig","middlewareConfigBase64","buildInfo","_module","parse","Buffer","from","toString","route","absolutePagePath","relatedModules","extensions","extension","normalizedAppPaths","matched","existingChildrenPath","appPath","rest","children","isParallelRoute","isIncomingParallelPage","includes","hasCurrentParallelPage","pathToResolve","resolveAppRoute","fileExistsInDirectory","dirname","fileName","_compilation","catch","e","get","Map","set","absolutePath","filenameIndex","lastIndexOf","filename","result","ext","absolutePathWithExtension","addMissingDependency","exts","absoluteDir","filenameWithExt","treeCodeResult","loaderContext","isGlobalNotFoundPath","process","exit","createdRootLayout","rootLayoutPath","dir","message","relative","_compiler","context","clear","normalize","code","VAR_DEFINITION_PAGE","VAR_DEFINITION_PATHNAME","VAR_MODULE_GLOBAL_ERROR","tree","__next_app_require__","__next_app_load_chunk__","header","modulePath"],"mappings":"AACA,SACEA,0BAA0B,EAC1BC,gCAAgC,QAE3B,mCAAkC;AAGzC,OAAOC,UAAU,OAAM;AACvB,SAASC,IAAI,QAAQ,6BAA4B;AACjD,SAASC,kBAAkB,QAAQ,2BAA0B;AAC7D,SAASC,gBAAgB,QAAQ,qCAAoC;AACrE,YAAYC,SAAS,sBAAqB;AAC1C,SAASC,aAAa,QAAQ,4BAA2B;AACzD,SACEC,yBAAyB,EACzBC,6BAA6B,QACxB,uBAAsB;AAC7B,SAASC,YAAYC,EAAE,QAAQ,KAAI;AACnC,SAASC,eAAe,QAAQ,qCAAoC;AAEpE,SAASC,qBAAqB,QAAQ,mEAAkE;AAExG,SAASC,wBAAwB,QAAQ,iBAAgB;AACzD,SAASC,cAAc,QAAQ,2BAA0B;AACzD,SACEC,cAAc,EACdC,mBAAmB,EACnBC,gBAAgB,QACX,iCAAgC;AACvC,SAASC,aAAa,QAAQ,mCAAkC;AAEhE,SAASC,2BAA2B,QAAQ,gDAA+C;AAE3F,SAASC,kBAAkB,QAAQ,0BAAyB;AAqB5D,MAAMC,wBAAwB;IAC5B,aAAa;IACbC,WAAW;IACXC,cAAc;AAChB;AACA,MAAMC,iCAAiC;IACrC,aAAa;IACbF,WAAW;IACXC,cAAc;AAChB;AAEA,MAAME,aAAa;IACjBC,QAAQ;IACRC,UAAU;IACVC,OAAO;IACPC,SAAS;IACT,gBAAgB;IAChB,oBAAoB;IACpB,GAAGR,qBAAqB;AAC1B;AAEA,MAAMS,yBAAyB;AAC/B,MAAMC,6BAA6B;AACnC,MAAMC,eAAe;AACrB,MAAMC,2BAA2B;AAEjC,MAAMC,yBACJ;AACF,MAAMC,sBAAsB;AAC5B,MAAMC,oBAAoB;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CAAC,EAAA,kBAAA,IAAI,CAACC,SAAS,qBAAd,gBAAgBC,OAAO,KAAI,IAAIL,iBAC7C,kCAAkC,CAAC;gBACvC,OAAO;oBACLE,WACE;gBACJ;gBAEA,MAAM,qBAAkB,CAAlB,IAAIpH,MAAMoH,UAAV,qBAAA;2BAAA;gCAAA;kCAAA;gBAAiB;YACzB;YAEA,mEAAmE;YACnE,IAAI,IAAI,CAACzB,YAAY,GAAEvC,wBAAAA,iBAAiB0C,GAAG,CAAC,IAAI,CAACH,YAAY,sBAAtCvC,sBAAyCoE,KAAK;YACrEZ,iBAAiB,MAAM9J,uBAAuBC,UAAU;gBACtDC;gBACAC;gBACAC;gBACAE;gBACAD;gBACA0J,eAAe,IAAI;gBACnBxJ;gBACAC;gBACAC;gBACAC;YACF;QACF;IACF;IAEA,MAAMb,WAAW,IAAI/B,wBAAwB6M,SAAS,CAACzK;IAEvD,iGAAiG;IACjG,6GAA6G;IAC7G,MAAM0K,OAAO,MAAM5M,eACjB,YACA;QACE6M,qBAAqB3K;QACrB4K,yBAAyBjL;QACzBkL,yBAAyBjB,eAAe5I,WAAW;IACrD,GACA;QACE8J,MAAMlB,eAAerE,QAAQ;QAC7BzE,OAAO8I,eAAe9I,KAAK;QAC3BiK,sBAAsB;QACtB,0FAA0F;QAC1FC,yBAAyB;IAC3B;IAGF,6DAA6D;IAC7D,MAAMC,SAAS1K,sBACZoD,GAAG,CAAC,CAAC,CAACd,SAASqI,WAAW;QACzB,OAAO,CAAC,MAAM,EAAErI,QAAQ,2CAA2C,EAAEC,KAAKC,SAAS,CACjFmI,YACA,IAAI,CAAC;IACT,GACClJ,IAAI,CAAC;IAER,OAAOiJ,SAASP;AAClB;AAEA,eAAepE,cAAa","ignoreList":[0]}
|
1
|
+
{"version":3,"sources":["../../../../../src/build/webpack/loaders/next-app-loader/index.ts"],"sourcesContent":["import type webpack from 'next/dist/compiled/webpack/webpack'\nimport {\n UNDERSCORE_NOT_FOUND_ROUTE,\n UNDERSCORE_NOT_FOUND_ROUTE_ENTRY,\n type ValueOf,\n} from '../../../../shared/lib/constants'\nimport type { ModuleTuple, CollectedMetadata } from '../metadata/types'\n\nimport path from 'path'\nimport { bold } from '../../../../lib/picocolors'\nimport { getModuleBuildInfo } from '../get-module-build-info'\nimport { verifyRootLayout } from '../../../../lib/verify-root-layout'\nimport * as Log from '../../../output/log'\nimport { APP_DIR_ALIAS } from '../../../../lib/constants'\nimport {\n createMetadataExportsCode,\n createStaticMetadataFromRoute,\n} from '../metadata/discover'\nimport { promises as fs } from 'fs'\nimport { isAppRouteRoute } from '../../../../lib/is-app-route-route'\nimport type { NextConfig } from '../../../../server/config-shared'\nimport { AppPathnameNormalizer } from '../../../../server/normalizers/built/app/app-pathname-normalizer'\nimport type { MiddlewareConfig } from '../../../analysis/get-page-static-info'\nimport { isAppBuiltinNotFoundPage } from '../../../utils'\nimport { loadEntrypoint } from '../../../load-entrypoint'\nimport {\n isGroupSegment,\n DEFAULT_SEGMENT_KEY,\n PAGE_SEGMENT_KEY,\n} from '../../../../shared/lib/segment'\nimport { getFilesInDir } from '../../../../lib/get-files-in-dir'\nimport type { PageExtensions } from '../../../page-extensions-type'\nimport { PARALLEL_ROUTE_DEFAULT_PATH } from '../../../../client/components/builtin/default'\nimport type { Compilation } from 'webpack'\nimport { createAppRouteCode } from './create-app-route-code'\n\nexport type AppLoaderOptions = {\n name: string\n page: string\n pagePath: string\n appDir: string\n appPaths: readonly string[] | null\n preferredRegion: string | string[] | undefined\n pageExtensions: PageExtensions\n assetPrefix: string\n rootDir?: string\n tsconfigPath?: string\n isDev?: true\n basePath: string\n nextConfigOutput?: NextConfig['output']\n middlewareConfig: string\n isGlobalNotFoundEnabled: true | undefined\n}\ntype AppLoader = webpack.LoaderDefinitionFunction<AppLoaderOptions>\n\nconst HTTP_ACCESS_FALLBACKS = {\n 'not-found': 'not-found',\n forbidden: 'forbidden',\n unauthorized: 'unauthorized',\n} as const\nconst defaultHTTPAccessFallbackPaths = {\n 'not-found': 'next/dist/client/components/builtin/not-found.js',\n forbidden: 'next/dist/client/components/builtin/forbidden.js',\n unauthorized: 'next/dist/client/components/builtin/unauthorized.js',\n} as const\n\nconst FILE_TYPES = {\n layout: 'layout',\n template: 'template',\n error: 'error',\n loading: 'loading',\n 'global-error': 'global-error',\n 'global-not-found': 'global-not-found',\n ...HTTP_ACCESS_FALLBACKS,\n} as const\n\nconst GLOBAL_ERROR_FILE_TYPE = 'global-error'\nconst GLOBAL_NOT_FOUND_FILE_TYPE = 'global-not-found'\nconst PAGE_SEGMENT = 'page$'\nconst PARALLEL_VIRTUAL_SEGMENT = 'slot$'\n\nconst defaultGlobalErrorPath =\n 'next/dist/client/components/builtin/global-error.js'\nconst defaultNotFoundPath = 'next/dist/client/components/builtin/not-found.js'\nconst defaultLayoutPath = 'next/dist/client/components/builtin/layout.js'\nconst defaultGlobalNotFoundPath =\n 'next/dist/client/components/builtin/global-not-found.js'\n\ntype DirResolver = (pathToResolve: string) => string\ntype PathResolver = (\n pathname: string\n) => Promise<string | undefined> | string | undefined\nexport type MetadataResolver = (\n dir: string,\n filename: string,\n extensions: readonly string[]\n) => Promise<string | undefined>\n\nexport type AppDirModules = {\n readonly [moduleKey in ValueOf<typeof FILE_TYPES>]?: ModuleTuple\n} & {\n readonly page?: ModuleTuple\n} & {\n readonly metadata?: CollectedMetadata\n} & {\n readonly defaultPage?: ModuleTuple\n}\n\nconst normalizeParallelKey = (key: string) =>\n key.startsWith('@') ? key.slice(1) : key\n\nconst isDirectory = async (pathname: string) => {\n try {\n const stat = await fs.stat(pathname)\n return stat.isDirectory()\n } catch (err) {\n return false\n }\n}\n\nasync function createTreeCodeFromPath(\n pagePath: string,\n {\n page,\n resolveDir,\n resolver,\n resolveParallelSegments,\n metadataResolver,\n pageExtensions,\n basePath,\n collectedDeclarations,\n isGlobalNotFoundEnabled,\n }: {\n page: string\n resolveDir: DirResolver\n resolver: PathResolver\n metadataResolver: MetadataResolver\n resolveParallelSegments: (\n pathname: string\n ) => [key: string, segment: string | string[]][]\n loaderContext: webpack.LoaderContext<AppLoaderOptions>\n pageExtensions: PageExtensions\n basePath: string\n collectedDeclarations: [string, string][]\n isGlobalNotFoundEnabled: boolean\n }\n): Promise<{\n treeCode: string\n pages: string\n rootLayout: string | undefined\n globalError: string\n globalNotFound: string\n}> {\n const splittedPath = pagePath.split(/[\\\\/]/, 1)\n const isNotFoundRoute = page === UNDERSCORE_NOT_FOUND_ROUTE_ENTRY\n const isDefaultNotFound = isAppBuiltinNotFoundPage(pagePath)\n\n const appDirPrefix = isDefaultNotFound ? APP_DIR_ALIAS : splittedPath[0]\n const pages: string[] = []\n\n let rootLayout: string | undefined\n let globalError: string = defaultGlobalErrorPath\n let globalNotFound: string = defaultNotFoundPath\n\n async function resolveAdjacentParallelSegments(\n segmentPath: string\n ): Promise<string[]> {\n const absoluteSegmentPath = await resolveDir(\n `${appDirPrefix}${segmentPath}`\n )\n\n if (!absoluteSegmentPath) {\n return []\n }\n\n const segmentIsDirectory = await isDirectory(absoluteSegmentPath)\n\n if (!segmentIsDirectory) {\n return []\n }\n\n // We need to resolve all parallel routes in this level.\n const files = await fs.opendir(absoluteSegmentPath)\n\n const parallelSegments: string[] = ['children']\n\n for await (const dirent of files) {\n // Make sure name starts with \"@\" and is a directory.\n if (dirent.isDirectory() && dirent.name.charCodeAt(0) === 64) {\n parallelSegments.push(dirent.name)\n }\n }\n\n return parallelSegments\n }\n\n async function createSubtreePropsFromSegmentPath(\n segments: string[],\n nestedCollectedDeclarations: [string, string][]\n ): Promise<{\n treeCode: string\n }> {\n const segmentPath = segments.join('/')\n\n // Existing tree are the children of the current segment\n const props: Record<string, string> = {}\n // Root layer could be 1st layer of normal routes\n const isRootLayer = segments.length === 0\n const isRootLayoutOrRootPage = segments.length <= 1\n\n // We need to resolve all parallel routes in this level.\n const parallelSegments: [key: string, segment: string | string[]][] = []\n if (isRootLayer) {\n parallelSegments.push(['children', ''])\n } else {\n parallelSegments.push(...resolveParallelSegments(segmentPath))\n }\n\n let metadata: Awaited<ReturnType<typeof createStaticMetadataFromRoute>> =\n null\n const routerDirPath = `${appDirPrefix}${segmentPath}`\n const resolvedRouteDir = resolveDir(routerDirPath)\n\n if (resolvedRouteDir) {\n metadata = await createStaticMetadataFromRoute(resolvedRouteDir, {\n basePath,\n segment: segmentPath,\n metadataResolver,\n isRootLayoutOrRootPage,\n pageExtensions,\n })\n }\n\n for (const [parallelKey, parallelSegment] of parallelSegments) {\n // if parallelSegment is the page segment (ie, `page$` and not ['page$']), it gets loaded into the __PAGE__ slot\n // as it's the page for the current route.\n if (parallelSegment === PAGE_SEGMENT) {\n const matchedPagePath = `${appDirPrefix}${segmentPath}${\n parallelKey === 'children' ? '' : `/${parallelKey}`\n }/page`\n\n const resolvedPagePath = await resolver(matchedPagePath)\n if (resolvedPagePath) {\n pages.push(resolvedPagePath)\n\n const varName = `page${nestedCollectedDeclarations.length}`\n nestedCollectedDeclarations.push([varName, resolvedPagePath])\n\n // Use '' for segment as it's the page. There can't be a segment called '' so this is the safest way to add it.\n props[normalizeParallelKey(parallelKey)] =\n `['${PAGE_SEGMENT_KEY}', {}, {\n page: [${varName}, ${JSON.stringify(resolvedPagePath)}],\n ${createMetadataExportsCode(metadata)}\n }]`\n continue\n } else {\n throw new Error(`Can't resolve ${matchedPagePath}`)\n }\n }\n\n // if the parallelSegment was not matched to the __PAGE__ slot, then it's a parallel route at this level.\n // the code below recursively traverses the parallel slots directory to match the corresponding __PAGE__ for each parallel slot\n // while also filling in layout/default/etc files into the loader tree at each segment level.\n\n const subSegmentPath = [...segments]\n if (parallelKey !== 'children') {\n // A `children` parallel key should have already been processed in the above segment\n // So we exclude it when constructing the subsegment path for the remaining segment levels\n subSegmentPath.push(parallelKey)\n }\n\n const normalizedParallelSegment = Array.isArray(parallelSegment)\n ? parallelSegment[0]\n : parallelSegment\n\n if (\n normalizedParallelSegment !== PAGE_SEGMENT &&\n normalizedParallelSegment !== PARALLEL_VIRTUAL_SEGMENT\n ) {\n // If we don't have a page segment, nor a special $children marker, it means we need to traverse the next directory\n // (ie, `normalizedParallelSegment` would correspond with the folder that contains the next level of pages/layout/etc)\n // we push it to the subSegmentPath so that we can fill in the loader tree for that segment.\n subSegmentPath.push(normalizedParallelSegment)\n }\n\n const parallelSegmentPath = subSegmentPath.join('/')\n\n // Fill in the loader tree for all of the special files types (layout, default, etc) at this level\n // `page` is not included here as it's added above.\n const filePathEntries = await Promise.all(\n Object.values(FILE_TYPES).map(async (file) => {\n return [\n file,\n await resolver(\n `${appDirPrefix}${\n // TODO-APP: parallelSegmentPath sometimes ends in `/` but sometimes it doesn't. This should be consistent.\n parallelSegmentPath.endsWith('/')\n ? parallelSegmentPath\n : parallelSegmentPath + '/'\n }${file}`\n ),\n ] as const\n })\n )\n const filePaths = new Map<ValueOf<typeof FILE_TYPES>, string | undefined>(\n filePathEntries\n )\n\n // Only resolve global-* convention files at the root layer\n if (isRootLayer) {\n const resolvedGlobalErrorPath = await resolver(\n `${appDirPrefix}/${GLOBAL_ERROR_FILE_TYPE}`\n )\n if (resolvedGlobalErrorPath) {\n globalError = resolvedGlobalErrorPath\n }\n // Add global-error to root layer's filePaths, so that it's always available,\n // by default it's the built-in global-error.js\n filePaths.set(GLOBAL_ERROR_FILE_TYPE, globalError)\n\n // TODO(global-not-found): remove this flag assertion condition\n // once global-not-found is stable\n if (isGlobalNotFoundEnabled) {\n const resolvedGlobalNotFoundPath = await resolver(\n `${appDirPrefix}/${GLOBAL_NOT_FOUND_FILE_TYPE}`\n )\n if (resolvedGlobalNotFoundPath) {\n globalNotFound = resolvedGlobalNotFoundPath\n }\n // Add global-not-found to root layer's filePaths, so that it's always available,\n // by default it's the built-in global-not-found.js\n filePaths.set(GLOBAL_NOT_FOUND_FILE_TYPE, globalNotFound)\n }\n }\n\n let definedFilePaths = Array.from(filePaths.entries()).filter(\n ([, filePath]) => filePath !== undefined\n ) as [ValueOf<typeof FILE_TYPES>, string][]\n\n // Add default access fallback as root fallback if not present\n const existedConventionNames = new Set(\n definedFilePaths.map(([type]) => type)\n )\n // If the first layer is a group route, we treat it as root layer\n const isFirstLayerGroupRoute =\n segments.length === 1 &&\n subSegmentPath.filter((seg) => isGroupSegment(seg)).length === 1\n\n if (isRootLayer || isFirstLayerGroupRoute) {\n const accessFallbackTypes = Object.keys(\n defaultHTTPAccessFallbackPaths\n ) as (keyof typeof defaultHTTPAccessFallbackPaths)[]\n for (const type of accessFallbackTypes) {\n const hasRootFallbackFile = await resolver(\n `${appDirPrefix}/${FILE_TYPES[type]}`\n )\n const hasLayerFallbackFile = existedConventionNames.has(type)\n\n // If you already have a root access error fallback, don't insert default access error boundary to group routes root\n if (\n // Is treated as root layout and without boundary\n !(hasRootFallbackFile && isFirstLayerGroupRoute) &&\n // Does not have a fallback boundary file\n !hasLayerFallbackFile\n ) {\n const defaultFallbackPath = defaultHTTPAccessFallbackPaths[type]\n if (!(isDefaultNotFound && type === 'not-found')) {\n definedFilePaths.push([type, defaultFallbackPath])\n }\n }\n }\n }\n\n if (!rootLayout) {\n const layoutPath = definedFilePaths.find(\n ([type]) => type === 'layout'\n )?.[1]\n rootLayout = layoutPath\n\n // When `global-not-found` is disabled, we insert a default layout if\n // root layout is presented. This logic and the default layout will be removed\n // once `global-not-found` is stabilized.\n if (\n !isGlobalNotFoundEnabled &&\n isDefaultNotFound &&\n !layoutPath &&\n !rootLayout\n ) {\n rootLayout = defaultLayoutPath\n definedFilePaths.push(['layout', rootLayout])\n }\n }\n\n let parallelSegmentKey = Array.isArray(parallelSegment)\n ? parallelSegment[0]\n : parallelSegment\n\n // normalize the parallel segment key to remove any special markers that we inserted in the\n // earlier logic (such as children$ and page$). These should never appear in the loader tree, and\n // should instead be the corresponding segment keys (ie `__PAGE__`) or the `children` parallel route.\n parallelSegmentKey =\n parallelSegmentKey === PARALLEL_VIRTUAL_SEGMENT\n ? '(slot)'\n : parallelSegmentKey === PAGE_SEGMENT\n ? PAGE_SEGMENT_KEY\n : parallelSegmentKey\n\n const normalizedParallelKey = normalizeParallelKey(parallelKey)\n let subtreeCode: string | undefined\n // If it's root not found page, set not-found boundary as children page\n if (isNotFoundRoute) {\n if (normalizedParallelKey === 'children') {\n const matchedGlobalNotFound = isGlobalNotFoundEnabled\n ? definedFilePaths.find(\n ([type]) => type === GLOBAL_NOT_FOUND_FILE_TYPE\n )?.[1] ?? defaultGlobalNotFoundPath\n : undefined\n\n // If custom global-not-found.js is defined, use global-not-found.js\n if (matchedGlobalNotFound) {\n const varName = `notFound${nestedCollectedDeclarations.length}`\n nestedCollectedDeclarations.push([varName, matchedGlobalNotFound])\n subtreeCode = `{\n children: [${JSON.stringify(UNDERSCORE_NOT_FOUND_ROUTE)}, {\n children: ['${PAGE_SEGMENT_KEY}', {}, {\n page: [\n ${varName},\n ${JSON.stringify(matchedGlobalNotFound)}\n ]\n }]\n }, {}]\n }`\n } else {\n // If custom not-found.js is found, use it and layout to compose the page,\n // and fallback to built-in not-found component if doesn't exist.\n const notFoundPath =\n definedFilePaths.find(([type]) => type === 'not-found')?.[1] ??\n defaultNotFoundPath\n const varName = `notFound${nestedCollectedDeclarations.length}`\n nestedCollectedDeclarations.push([varName, notFoundPath])\n subtreeCode = `{\n children: [${JSON.stringify(UNDERSCORE_NOT_FOUND_ROUTE)}, {\n children: ['${PAGE_SEGMENT_KEY}', {}, {\n page: [\n ${varName},\n ${JSON.stringify(notFoundPath)}\n ]\n }]\n }, {}]\n }`\n }\n }\n }\n\n // For 404 route\n // if global-not-found is in definedFilePaths, remove root layout for /_not-found\n // TODO: remove this once global-not-found is stable.\n if (isNotFoundRoute && isGlobalNotFoundEnabled) {\n definedFilePaths = definedFilePaths.filter(\n ([type]) => type !== 'layout'\n )\n }\n\n const modulesCode = `{\n ${definedFilePaths\n .map(([file, filePath]) => {\n const varName = `module${nestedCollectedDeclarations.length}`\n nestedCollectedDeclarations.push([varName, filePath])\n return `'${file}': [${varName}, ${JSON.stringify(filePath)}],`\n })\n .join('\\n')}\n ${createMetadataExportsCode(metadata)}\n }`\n\n if (!subtreeCode) {\n const { treeCode: pageSubtreeCode } =\n await createSubtreePropsFromSegmentPath(\n subSegmentPath,\n nestedCollectedDeclarations\n )\n\n subtreeCode = pageSubtreeCode\n }\n\n props[normalizedParallelKey] = `[\n '${parallelSegmentKey}',\n ${subtreeCode},\n ${modulesCode}\n ]`\n }\n\n const adjacentParallelSegments =\n await resolveAdjacentParallelSegments(segmentPath)\n\n for (const adjacentParallelSegment of adjacentParallelSegments) {\n if (!props[normalizeParallelKey(adjacentParallelSegment)]) {\n const actualSegment =\n adjacentParallelSegment === 'children'\n ? ''\n : `/${adjacentParallelSegment}`\n\n // if a default is found, use that. Otherwise use the fallback, which will trigger a `notFound()`\n const defaultPath =\n (await resolver(\n `${appDirPrefix}${segmentPath}${actualSegment}/default`\n )) ?? PARALLEL_ROUTE_DEFAULT_PATH\n\n const varName = `default${nestedCollectedDeclarations.length}`\n nestedCollectedDeclarations.push([varName, defaultPath])\n props[normalizeParallelKey(adjacentParallelSegment)] = `[\n '${DEFAULT_SEGMENT_KEY}',\n {},\n {\n defaultPage: [${varName}, ${JSON.stringify(defaultPath)}],\n }\n ]`\n }\n }\n return {\n treeCode: `{\n ${Object.entries(props)\n .map(([key, value]) => `${key}: ${value}`)\n .join(',\\n')}\n }`,\n }\n }\n\n const { treeCode } = await createSubtreePropsFromSegmentPath(\n [],\n collectedDeclarations\n )\n\n return {\n treeCode: `${treeCode}.children;`,\n pages: `${JSON.stringify(pages)};`,\n rootLayout,\n globalError,\n globalNotFound,\n }\n}\n\nfunction createAbsolutePath(appDir: string, pathToTurnAbsolute: string) {\n return (\n pathToTurnAbsolute\n // Replace all POSIX path separators with the current OS path separator\n .replace(/\\//g, path.sep)\n .replace(/^private-next-app-dir/, appDir)\n )\n}\n\nconst filesInDirMapMap: WeakMap<\n Compilation,\n Map<string, Promise<Set<string>>>\n> = new WeakMap()\nconst nextAppLoader: AppLoader = async function nextAppLoader() {\n const loaderOptions = this.getOptions()\n const {\n name,\n appDir,\n appPaths,\n pagePath,\n pageExtensions,\n rootDir,\n tsconfigPath,\n isDev,\n nextConfigOutput,\n preferredRegion,\n basePath,\n middlewareConfig: middlewareConfigBase64,\n } = loaderOptions\n\n const isGlobalNotFoundEnabled = !!loaderOptions.isGlobalNotFoundEnabled\n\n // Update FILE_TYPES on the very top-level of the loader\n if (!isGlobalNotFoundEnabled) {\n // @ts-expect-error this delete is only necessary while experimental\n delete FILE_TYPES['global-not-found']\n }\n\n const buildInfo = getModuleBuildInfo((this as any)._module)\n const collectedDeclarations: [string, string][] = []\n const page = name.replace(/^app/, '')\n const middlewareConfig: MiddlewareConfig = JSON.parse(\n Buffer.from(middlewareConfigBase64, 'base64').toString()\n )\n buildInfo.route = {\n page,\n absolutePagePath: createAbsolutePath(appDir, pagePath),\n preferredRegion,\n middlewareConfig,\n relatedModules: [],\n }\n\n const extensions =\n typeof pageExtensions === 'string'\n ? [pageExtensions]\n : pageExtensions.map((extension) => `.${extension}`)\n\n const normalizedAppPaths =\n typeof appPaths === 'string' ? [appPaths] : appPaths || []\n\n const resolveParallelSegments = (\n pathname: string\n ): [string, string | string[]][] => {\n const matched: Record<string, string | string[]> = {}\n let existingChildrenPath: string | undefined\n for (const appPath of normalizedAppPaths) {\n if (appPath.startsWith(pathname + '/')) {\n const rest = appPath.slice(pathname.length + 1).split('/')\n\n // It is the actual page, mark it specially.\n if (rest.length === 1 && rest[0] === 'page') {\n existingChildrenPath = appPath\n matched.children = PAGE_SEGMENT\n continue\n }\n\n const isParallelRoute = rest[0].startsWith('@')\n if (isParallelRoute) {\n if (rest.length === 2 && rest[1] === 'page') {\n // We found a parallel route at this level. We don't want to mark it explicitly as the page segment,\n // as that should be matched to the `children` slot. Instead, we use an array, to signal to `createSubtreePropsFromSegmentPath`\n // that it needs to recursively fill in the loader tree code for the parallel route at the appropriate levels.\n matched[rest[0]] = [PAGE_SEGMENT]\n continue\n }\n // If it was a parallel route but we weren't able to find the page segment (ie, maybe the page is nested further)\n // we first insert a special marker to ensure that we still process layout/default/etc at the slot level prior to continuing\n // on to the page segment.\n matched[rest[0]] = [PARALLEL_VIRTUAL_SEGMENT, ...rest.slice(1)]\n continue\n }\n\n if (existingChildrenPath && matched.children !== rest[0]) {\n // If we get here, it means we already set a `page` segment earlier in the loop,\n // meaning we already matched a page to the `children` parallel segment.\n const isIncomingParallelPage = appPath.includes('@')\n const hasCurrentParallelPage = existingChildrenPath.includes('@')\n\n if (isIncomingParallelPage) {\n // The duplicate segment was for a parallel slot. In this case,\n // rather than throwing an error, we can ignore it since this can happen for valid reasons.\n // For example, when we attempt to normalize catch-all routes, we'll push potential slot matches so\n // that they are available in the loader tree when we go to render the page.\n // We only need to throw an error if the duplicate segment was for a regular page.\n // For example, /app/(groupa)/page & /app/(groupb)/page is an error since it corresponds\n // with the same path.\n continue\n } else if (!hasCurrentParallelPage && !isIncomingParallelPage) {\n // Both the current `children` and the incoming `children` are regular pages.\n throw new Error(\n `You cannot have two parallel pages that resolve to the same path. Please check ${existingChildrenPath} and ${appPath}. Refer to the route group docs for more information: https://nextjs.org/docs/app/building-your-application/routing/route-groups`\n )\n }\n }\n\n existingChildrenPath = appPath\n matched.children = rest[0]\n }\n }\n\n return Object.entries(matched)\n }\n\n const resolveDir: DirResolver = (pathToResolve) => {\n return createAbsolutePath(appDir, pathToResolve)\n }\n\n const resolveAppRoute: PathResolver = (pathToResolve) => {\n return createAbsolutePath(appDir, pathToResolve)\n }\n\n // Cached checker to see if a file exists in a given directory.\n // This can be more efficient than checking them with `fs.stat` one by one\n // because all the thousands of files are likely in a few possible directories.\n // Note that it should only be cached for this compilation, not globally.\n const fileExistsInDirectory = async (dirname: string, fileName: string) => {\n // I don't think we should ever hit this code path, but if we do we should handle it gracefully.\n if (this._compilation === undefined) {\n try {\n return (await getFilesInDir(dirname).catch(() => new Set())).has(\n fileName\n )\n } catch (e) {\n return false\n }\n }\n const map =\n filesInDirMapMap.get(this._compilation) ||\n new Map<string, Promise<Set<string>>>()\n if (!filesInDirMapMap.has(this._compilation)) {\n filesInDirMapMap.set(this._compilation, map)\n }\n if (!map.has(dirname)) {\n map.set(\n dirname,\n getFilesInDir(dirname).catch(() => new Set())\n )\n }\n return ((await map.get(dirname)) || new Set()).has(fileName)\n }\n\n const resolver: PathResolver = async (pathname) => {\n const absolutePath = createAbsolutePath(appDir, pathname)\n\n const filenameIndex = absolutePath.lastIndexOf(path.sep)\n const dirname = absolutePath.slice(0, filenameIndex)\n const filename = absolutePath.slice(filenameIndex + 1)\n\n let result: string | undefined\n\n for (const ext of extensions) {\n const absolutePathWithExtension = `${absolutePath}${ext}`\n if (\n !result &&\n (await fileExistsInDirectory(dirname, `${filename}${ext}`))\n ) {\n result = absolutePathWithExtension\n }\n // Call `addMissingDependency` for all files even if they didn't match,\n // because they might be added or removed during development.\n this.addMissingDependency(absolutePathWithExtension)\n }\n\n return result\n }\n\n const metadataResolver: MetadataResolver = async (\n dirname,\n filename,\n exts\n ) => {\n const absoluteDir = createAbsolutePath(appDir, dirname)\n\n let result: string | undefined\n\n for (const ext of exts) {\n // Compared to `resolver` above the exts do not have the `.` included already, so it's added here.\n const filenameWithExt = `${filename}.${ext}`\n const absolutePathWithExtension = `${absoluteDir}${path.sep}${filenameWithExt}`\n if (!result && (await fileExistsInDirectory(dirname, filenameWithExt))) {\n result = absolutePathWithExtension\n }\n // Call `addMissingDependency` for all files even if they didn't match,\n // because they might be added or removed during development.\n this.addMissingDependency(absolutePathWithExtension)\n }\n\n return result\n }\n\n if (isAppRouteRoute(name)) {\n return createAppRouteCode({\n appDir,\n // TODO: investigate if the local `page` is the same as the loaderOptions.page\n page: loaderOptions.page,\n name,\n pagePath,\n resolveAppRoute,\n pageExtensions,\n nextConfigOutput,\n })\n }\n\n let treeCodeResult = await createTreeCodeFromPath(pagePath, {\n page,\n resolveDir,\n resolver,\n metadataResolver,\n resolveParallelSegments,\n loaderContext: this,\n pageExtensions,\n basePath,\n collectedDeclarations,\n isGlobalNotFoundEnabled,\n })\n\n const isGlobalNotFoundPath =\n page === UNDERSCORE_NOT_FOUND_ROUTE_ENTRY &&\n !!treeCodeResult.globalNotFound &&\n isGlobalNotFoundEnabled\n\n if (!treeCodeResult.rootLayout && !isGlobalNotFoundPath) {\n if (!isDev) {\n // If we're building and missing a root layout, exit the build\n Log.error(\n `${bold(\n pagePath.replace(`${APP_DIR_ALIAS}/`, '')\n )} doesn't have a root layout. To fix this error, make sure every page has a root layout.`\n )\n process.exit(1)\n } else {\n // In dev we'll try to create a root layout\n const [createdRootLayout, rootLayoutPath] = await verifyRootLayout({\n appDir: appDir,\n dir: rootDir!,\n tsconfigPath: tsconfigPath!,\n pagePath,\n pageExtensions,\n })\n if (!createdRootLayout) {\n let message = `${bold(\n pagePath.replace(`${APP_DIR_ALIAS}/`, '')\n )} doesn't have a root layout. `\n\n if (rootLayoutPath) {\n message += `We tried to create ${bold(\n path.relative(this._compiler?.context ?? '', rootLayoutPath)\n )} for you but something went wrong.`\n } else {\n message +=\n 'To fix this error, make sure every page has a root layout.'\n }\n\n throw new Error(message)\n }\n\n // Clear fs cache, get the new result with the created root layout.\n if (this._compilation) filesInDirMapMap.get(this._compilation)?.clear()\n treeCodeResult = await createTreeCodeFromPath(pagePath, {\n page,\n resolveDir,\n resolver,\n metadataResolver,\n resolveParallelSegments,\n loaderContext: this,\n pageExtensions,\n basePath,\n collectedDeclarations,\n isGlobalNotFoundEnabled,\n })\n }\n }\n\n const pathname = new AppPathnameNormalizer().normalize(page)\n\n // Prefer to modify next/src/server/app-render/entry-base.ts since this is shared with Turbopack.\n // Any changes to this code should be reflected in Turbopack's app_source.rs and/or app-renderer.tsx as well.\n const code = await loadEntrypoint(\n 'app-page',\n {\n VAR_DEFINITION_PAGE: page,\n VAR_DEFINITION_PATHNAME: pathname,\n VAR_MODULE_GLOBAL_ERROR: treeCodeResult.globalError,\n },\n {\n tree: treeCodeResult.treeCode,\n pages: treeCodeResult.pages,\n __next_app_require__: '__webpack_require__',\n // all modules are in the entry chunk, so we never actually need to load chunks in webpack\n __next_app_load_chunk__: '() => Promise.resolve()',\n }\n )\n\n // Lazily evaluate the imported modules in the generated code\n const header = collectedDeclarations\n .map(([varName, modulePath]) => {\n return `const ${varName} = () => import(/* webpackMode: \"eager\" */ ${JSON.stringify(\n modulePath\n )});\\n`\n })\n .join('')\n\n return header + code\n}\n\nexport default nextAppLoader\n"],"names":["UNDERSCORE_NOT_FOUND_ROUTE","UNDERSCORE_NOT_FOUND_ROUTE_ENTRY","path","bold","getModuleBuildInfo","verifyRootLayout","Log","APP_DIR_ALIAS","createMetadataExportsCode","createStaticMetadataFromRoute","promises","fs","isAppRouteRoute","AppPathnameNormalizer","isAppBuiltinNotFoundPage","loadEntrypoint","isGroupSegment","DEFAULT_SEGMENT_KEY","PAGE_SEGMENT_KEY","getFilesInDir","PARALLEL_ROUTE_DEFAULT_PATH","createAppRouteCode","HTTP_ACCESS_FALLBACKS","forbidden","unauthorized","defaultHTTPAccessFallbackPaths","FILE_TYPES","layout","template","error","loading","GLOBAL_ERROR_FILE_TYPE","GLOBAL_NOT_FOUND_FILE_TYPE","PAGE_SEGMENT","PARALLEL_VIRTUAL_SEGMENT","defaultGlobalErrorPath","defaultNotFoundPath","defaultLayoutPath","defaultGlobalNotFoundPath","normalizeParallelKey","key","startsWith","slice","isDirectory","pathname","stat","err","createTreeCodeFromPath","pagePath","page","resolveDir","resolver","resolveParallelSegments","metadataResolver","pageExtensions","basePath","collectedDeclarations","isGlobalNotFoundEnabled","splittedPath","split","isNotFoundRoute","isDefaultNotFound","appDirPrefix","pages","rootLayout","globalError","globalNotFound","resolveAdjacentParallelSegments","segmentPath","absoluteSegmentPath","segmentIsDirectory","files","opendir","parallelSegments","dirent","name","charCodeAt","push","createSubtreePropsFromSegmentPath","segments","nestedCollectedDeclarations","join","props","isRootLayer","length","isRootLayoutOrRootPage","metadata","routerDirPath","resolvedRouteDir","segment","parallelKey","parallelSegment","matchedPagePath","resolvedPagePath","varName","JSON","stringify","Error","subSegmentPath","normalizedParallelSegment","Array","isArray","parallelSegmentPath","filePathEntries","Promise","all","Object","values","map","file","endsWith","filePaths","Map","resolvedGlobalErrorPath","set","resolvedGlobalNotFoundPath","definedFilePaths","from","entries","filter","filePath","undefined","existedConventionNames","Set","type","isFirstLayerGroupRoute","seg","accessFallbackTypes","keys","hasRootFallbackFile","hasLayerFallbackFile","has","defaultFallbackPath","layoutPath","find","parallelSegmentKey","normalizedParallelKey","subtreeCode","matchedGlobalNotFound","notFoundPath","modulesCode","treeCode","pageSubtreeCode","adjacentParallelSegments","adjacentParallelSegment","actualSegment","defaultPath","value","createAbsolutePath","appDir","pathToTurnAbsolute","replace","sep","filesInDirMapMap","WeakMap","nextAppLoader","loaderOptions","getOptions","appPaths","rootDir","tsconfigPath","isDev","nextConfigOutput","preferredRegion","middlewareConfig","middlewareConfigBase64","buildInfo","_module","parse","Buffer","toString","route","absolutePagePath","relatedModules","extensions","extension","normalizedAppPaths","matched","existingChildrenPath","appPath","rest","children","isParallelRoute","isIncomingParallelPage","includes","hasCurrentParallelPage","pathToResolve","resolveAppRoute","fileExistsInDirectory","dirname","fileName","_compilation","catch","e","get","absolutePath","filenameIndex","lastIndexOf","filename","result","ext","absolutePathWithExtension","addMissingDependency","exts","absoluteDir","filenameWithExt","treeCodeResult","loaderContext","isGlobalNotFoundPath","process","exit","createdRootLayout","rootLayoutPath","dir","message","relative","_compiler","context","clear","normalize","code","VAR_DEFINITION_PAGE","VAR_DEFINITION_PATHNAME","VAR_MODULE_GLOBAL_ERROR","tree","__next_app_require__","__next_app_load_chunk__","header","modulePath"],"mappings":"AACA,SACEA,0BAA0B,EAC1BC,gCAAgC,QAE3B,mCAAkC;AAGzC,OAAOC,UAAU,OAAM;AACvB,SAASC,IAAI,QAAQ,6BAA4B;AACjD,SAASC,kBAAkB,QAAQ,2BAA0B;AAC7D,SAASC,gBAAgB,QAAQ,qCAAoC;AACrE,YAAYC,SAAS,sBAAqB;AAC1C,SAASC,aAAa,QAAQ,4BAA2B;AACzD,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/J,uBAAuBC,UAAU;gBACtDC;gBACAC;gBACAC;gBACAE;gBACAD;gBACA2J,eAAe,IAAI;gBACnBzJ;gBACAC;gBACAC;gBACAC;YACF;QACF;IACF;IAEA,MAAMb,WAAW,IAAI/B,wBAAwB8M,SAAS,CAAC1K;IAEvD,iGAAiG;IACjG,6GAA6G;IAC7G,MAAM2K,OAAO,MAAM7M,eACjB,YACA;QACE8M,qBAAqB5K;QACrB6K,yBAAyBlL;QACzBmL,yBAAyBjB,eAAe7I,WAAW;IACrD,GACA;QACE+J,MAAMlB,eAAejE,QAAQ;QAC7B9E,OAAO+I,eAAe/I,KAAK;QAC3BkK,sBAAsB;QACtB,0FAA0F;QAC1FC,yBAAyB;IAC3B;IAGF,6DAA6D;IAC7D,MAAMC,SAAS3K,sBACZoD,GAAG,CAAC,CAAC,CAACd,SAASsI,WAAW;QACzB,OAAO,CAAC,MAAM,EAAEtI,QAAQ,2CAA2C,EAAEC,KAAKC,SAAS,CACjFoI,YACA,IAAI,CAAC;IACT,GACCnJ,IAAI,CAAC;IAER,OAAOkJ,SAASP;AAClB;AAEA,eAAejE,cAAa","ignoreList":[0]}
|
@@ -1609,7 +1609,7 @@ export default async function getBaseWebpackConfig(dir, { buildId, encryptionKey
|
|
1609
1609
|
isClient && new CopyFilePlugin({
|
1610
1610
|
// file path to build output of `@next/polyfill-nomodule`
|
1611
1611
|
filePath: require.resolve('./polyfills/polyfill-nomodule'),
|
1612
|
-
cacheKey: "15.4.2-canary.
|
1612
|
+
cacheKey: "15.4.2-canary.41",
|
1613
1613
|
name: `static/chunks/polyfills${dev ? '' : '-[hash]'}.js`,
|
1614
1614
|
minimize: false,
|
1615
1615
|
info: {
|
@@ -1789,7 +1789,7 @@ export default async function getBaseWebpackConfig(dir, { buildId, encryptionKey
|
|
1789
1789
|
// - Next.js location on disk (some loaders use absolute paths and some resolve options depend on absolute paths)
|
1790
1790
|
// - Next.js version
|
1791
1791
|
// - next.config.js keys that affect compilation
|
1792
|
-
version: `${__dirname}|${"15.4.2-canary.
|
1792
|
+
version: `${__dirname}|${"15.4.2-canary.41"}|${configVars}`,
|
1793
1793
|
cacheDirectory: path.join(distDir, 'cache', 'webpack'),
|
1794
1794
|
// For production builds, it's more efficient to compress all cache files together instead of compression each one individually.
|
1795
1795
|
// So we disable compression here and allow the build runner to take care of compressing the cache as a whole.
|
package/dist/esm/client/index.js
CHANGED
@@ -26,7 +26,7 @@ import { SearchParamsContext, PathParamsContext } from '../shared/lib/hooks-clie
|
|
26
26
|
import { onRecoverableError } from './react-client-callbacks/on-recoverable-error';
|
27
27
|
import tracer from './tracing/tracer';
|
28
28
|
import { isNextRouterError } from './components/is-next-router-error';
|
29
|
-
export const version = "15.4.2-canary.
|
29
|
+
export const version = "15.4.2-canary.41";
|
30
30
|
export let router;
|
31
31
|
export const emitter = mitt();
|
32
32
|
const looseToArray = (input)=>[].slice.call(input);
|
@@ -101,6 +101,14 @@ function assignDefaults(dir, userConfig, silent) {
|
|
101
101
|
}
|
102
102
|
delete userConfig.exportTrailingSlash;
|
103
103
|
}
|
104
|
+
// There are a good amount of test fixtures that have amp enabled
|
105
|
+
// that also assert on stderr output being empty, so we're gating the
|
106
|
+
// warning to be skipped when running in Next.js tests until we fully
|
107
|
+
// remove the feature.
|
108
|
+
if (!process.env.__NEXT_TEST_MODE) {
|
109
|
+
warnOptionHasBeenDeprecated(userConfig, 'amp', `Built-in amp support is deprecated and the \`amp\` configuration option will be removed in Next.js 16.`, silent);
|
110
|
+
warnOptionHasBeenDeprecated(userConfig, 'experimental.amp', `Built-in amp support is deprecated and the \`experimental.amp\` configuration option will be removed in Next.js 16.`, silent);
|
111
|
+
}
|
104
112
|
// Handle deprecation of experimental.dynamicIO and migrate to experimental.cacheComponents
|
105
113
|
if (((_userConfig_experimental = userConfig.experimental) == null ? void 0 : _userConfig_experimental.dynamicIO) !== undefined) {
|
106
114
|
var _userConfig_experimental1;
|
@@ -431,14 +439,6 @@ function assignDefaults(dir, userConfig, silent) {
|
|
431
439
|
images.loaderFile = absolutePath;
|
432
440
|
}
|
433
441
|
}
|
434
|
-
// There are a good amount of test fixtures that have amp enabled
|
435
|
-
// that also assert on stderr output being empty, so we're gating the
|
436
|
-
// warning to be skipped when running in Next.js tests until we fully
|
437
|
-
// remove the feature.
|
438
|
-
if (!process.env.__NEXT_TEST_MODE) {
|
439
|
-
warnOptionHasBeenDeprecated(result, 'amp', `Built-in amp support is deprecated and the \`amp\` configuration option will be removed in Next.js 16.`, silent);
|
440
|
-
warnOptionHasBeenDeprecated(result, 'experimental.amp', `Built-in amp support is deprecated and the \`experimental.amp\` configuration option will be removed in Next.js 16.`, silent);
|
441
|
-
}
|
442
442
|
warnCustomizedOption(result, 'experimental.esmExternals', true, 'experimental.esmExternals is not recommended to be modified as it may disrupt module resolution', configFileName, silent);
|
443
443
|
warnOptionHasBeenDeprecated(result, 'experimental.instrumentationHook', `\`experimental.instrumentationHook\` is no longer needed, because \`instrumentation.js\` is available by default. You can remove it from ${configFileName}.`, silent);
|
444
444
|
warnOptionHasBeenDeprecated(result, 'experimental.after', `\`experimental.after\` is no longer needed, because \`after\` is available by default. You can remove it from ${configFileName}.`, silent);
|