next 15.4.0-canary.64 → 15.4.0-canary.65
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/plugins/flight-client-entry-plugin.js +18 -18
- package/dist/build/webpack/plugins/flight-client-entry-plugin.js.map +1 -1
- package/dist/build/webpack-config.js +2 -2
- package/dist/client/app-bootstrap.js +1 -1
- package/dist/client/components/react-dev-overlay/pages/pages-dev-overlay-error-boundary.d.ts +0 -1
- package/dist/client/components/react-dev-overlay/pages/pages-dev-overlay-error-boundary.js +0 -5
- package/dist/client/components/react-dev-overlay/pages/pages-dev-overlay-error-boundary.js.map +1 -1
- package/dist/client/components/react-dev-overlay/pages/pages-dev-overlay.js +1 -1
- package/dist/client/components/react-dev-overlay/pages/pages-dev-overlay.js.map +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 +2 -2
- package/dist/compiled/next-server/pages-turbo.runtime.prod.js.map +1 -1
- package/dist/compiled/next-server/pages.runtime.dev.js +2 -2
- package/dist/compiled/next-server/pages.runtime.dev.js.map +1 -1
- package/dist/compiled/next-server/pages.runtime.prod.js +2 -2
- package/dist/compiled/next-server/pages.runtime.prod.js.map +1 -1
- package/dist/compiled/next-server/server.runtime.prod.js +4 -4
- package/dist/compiled/next-server/server.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/plugins/flight-client-entry-plugin.js +18 -18
- package/dist/esm/build/webpack/plugins/flight-client-entry-plugin.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/components/react-dev-overlay/pages/pages-dev-overlay-error-boundary.js +0 -5
- package/dist/esm/client/components/react-dev-overlay/pages/pages-dev-overlay-error-boundary.js.map +1 -1
- package/dist/esm/client/components/react-dev-overlay/pages/pages-dev-overlay.js +1 -1
- package/dist/esm/client/components/react-dev-overlay/pages/pages-dev-overlay.js.map +1 -1
- package/dist/esm/client/index.js +1 -1
- package/dist/esm/server/base-server.js +4 -2
- package/dist/esm/server/base-server.js.map +1 -1
- package/dist/esm/server/config-schema.js +1 -0
- package/dist/esm/server/config-schema.js.map +1 -1
- package/dist/esm/server/config-shared.js +1 -0
- package/dist/esm/server/config-shared.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/esm/shared/lib/turbopack/utils.js +7 -1
- package/dist/esm/shared/lib/turbopack/utils.js.map +1 -1
- package/dist/server/base-server.js +4 -2
- package/dist/server/base-server.js.map +1 -1
- package/dist/server/config-schema.js +1 -0
- package/dist/server/config-schema.js.map +1 -1
- package/dist/server/config-shared.d.ts +6 -0
- package/dist/server/config-shared.js +1 -0
- package/dist/server/config-shared.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/shared/lib/turbopack/utils.js +7 -1
- package/dist/shared/lib/turbopack/utils.js.map +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/package.json +15 -15
package/dist/esm/build/index.js
CHANGED
@@ -296,7 +296,7 @@ export default async function build(dir, reactProductionProfiling = false, debug
|
|
296
296
|
const nextBuildSpan = trace('next-build', undefined, {
|
297
297
|
buildMode: experimentalBuildMode,
|
298
298
|
isTurboBuild: String(isTurbopack),
|
299
|
-
version: "15.4.0-canary.
|
299
|
+
version: "15.4.0-canary.65"
|
300
300
|
});
|
301
301
|
NextBuildContext.nextBuildSpan = nextBuildSpan;
|
302
302
|
NextBuildContext.dir = dir;
|
@@ -677,7 +677,7 @@ export default async function build(dir, reactProductionProfiling = false, debug
|
|
677
677
|
// Files outside of the distDir can be "type": "module"
|
678
678
|
await writeFileUtf8(path.join(distDir, 'package.json'), '{"type": "commonjs"}');
|
679
679
|
// These are written to distDir, so they need to come after creating and cleaning distDr.
|
680
|
-
await recordFrameworkVersion("15.4.0-canary.
|
680
|
+
await recordFrameworkVersion("15.4.0-canary.65");
|
681
681
|
await updateBuildDiagnostics({
|
682
682
|
buildStage: 'start'
|
683
683
|
});
|
@@ -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 { TurbopackInternalError } from '../../shared/lib/turbopack/utils';
|
14
|
-
const nextVersion = "15.4.0-canary.
|
14
|
+
const nextVersion = "15.4.0-canary.65";
|
15
15
|
const ArchName = arch();
|
16
16
|
const PlatformName = platform();
|
17
17
|
function infoLog(...args) {
|
@@ -28,6 +28,11 @@ const pluginState = getProxiedPluginState({
|
|
28
28
|
edgeRscModules: {},
|
29
29
|
injectedClientEntries: {}
|
30
30
|
});
|
31
|
+
const POSSIBLE_SHARED_CONVENTIONS = [
|
32
|
+
'template',
|
33
|
+
'layout'
|
34
|
+
];
|
35
|
+
const STANDALONE_BUNDLE_CONVENTION = 'global-not-found';
|
31
36
|
function deduplicateCSSImportsForEntry(mergedCSSimports) {
|
32
37
|
// If multiple entry module connections are having the same CSS import,
|
33
38
|
// we only need to have one module to keep track of that CSS import.
|
@@ -53,35 +58,30 @@ function deduplicateCSSImportsForEntry(mergedCSSimports) {
|
|
53
58
|
}
|
54
59
|
const aName = path.parse(aPath).name;
|
55
60
|
const bName = path.parse(bPath).name;
|
56
|
-
const indexA =
|
57
|
-
|
58
|
-
'layout'
|
59
|
-
].indexOf(aName);
|
60
|
-
const indexB = [
|
61
|
-
'template',
|
62
|
-
'layout'
|
63
|
-
].indexOf(bName);
|
61
|
+
const indexA = POSSIBLE_SHARED_CONVENTIONS.indexOf(aName);
|
62
|
+
const indexB = POSSIBLE_SHARED_CONVENTIONS.indexOf(bName);
|
64
63
|
if (indexA === -1) return 1;
|
65
64
|
if (indexB === -1) return -1;
|
66
65
|
return indexA - indexB;
|
67
66
|
});
|
68
67
|
const dedupedCSSImports = {};
|
69
68
|
const trackedCSSImports = new Set();
|
70
|
-
for (const [
|
69
|
+
for (const [entryFilePath, cssImports] of sortedCSSImports){
|
70
|
+
const entryConventionName = path.parse(entryFilePath).name;
|
71
71
|
for (const cssImport of cssImports){
|
72
|
-
|
72
|
+
// If the CSS import is already tracked, we can skip it.
|
73
|
+
// Or if it's any standalone entry such as `global-not-found`, it won't share any resources with other entry, skip it.
|
74
|
+
if (trackedCSSImports.has(cssImport) && STANDALONE_BUNDLE_CONVENTION !== entryConventionName) {
|
75
|
+
continue;
|
76
|
+
}
|
73
77
|
// Only track CSS imports that are in files that can inherit CSS.
|
74
|
-
|
75
|
-
if ([
|
76
|
-
'template',
|
77
|
-
'layout'
|
78
|
-
].includes(filename)) {
|
78
|
+
if (POSSIBLE_SHARED_CONVENTIONS.includes(entryConventionName)) {
|
79
79
|
trackedCSSImports.add(cssImport);
|
80
80
|
}
|
81
|
-
if (!dedupedCSSImports[
|
82
|
-
dedupedCSSImports[
|
81
|
+
if (!dedupedCSSImports[entryFilePath]) {
|
82
|
+
dedupedCSSImports[entryFilePath] = [];
|
83
83
|
}
|
84
|
-
dedupedCSSImports[
|
84
|
+
dedupedCSSImports[entryFilePath].push(cssImport);
|
85
85
|
}
|
86
86
|
}
|
87
87
|
return dedupedCSSImports;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../../src/build/webpack/plugins/flight-client-entry-plugin.ts"],"sourcesContent":["import type {\n CssImports,\n ClientComponentImports,\n} from '../loaders/next-flight-client-entry-loader'\n\nimport { webpack } from 'next/dist/compiled/webpack/webpack'\nimport { parse, stringify } from 'querystring'\nimport path from 'path'\nimport { sources } from 'next/dist/compiled/webpack/webpack'\nimport {\n getInvalidator,\n getEntries,\n EntryTypes,\n getEntryKey,\n} from '../../../server/dev/on-demand-entry-handler'\nimport {\n WEBPACK_LAYERS,\n WEBPACK_RESOURCE_QUERIES,\n} from '../../../lib/constants'\nimport {\n APP_CLIENT_INTERNALS,\n BARREL_OPTIMIZATION_PREFIX,\n COMPILER_NAMES,\n DEFAULT_RUNTIME_WEBPACK,\n EDGE_RUNTIME_WEBPACK,\n SERVER_REFERENCE_MANIFEST,\n UNDERSCORE_NOT_FOUND_ROUTE_ENTRY,\n} from '../../../shared/lib/constants'\nimport {\n isClientComponentEntryModule,\n isCSSMod,\n regexCSS,\n} from '../loaders/utils'\nimport {\n traverseModules,\n forEachEntryModule,\n formatBarrelOptimizedResource,\n getModuleReferencesInOrder,\n} from '../utils'\nimport { normalizePathSep } from '../../../shared/lib/page-path/normalize-path-sep'\nimport { getProxiedPluginState } from '../../build-context'\nimport { PAGE_TYPES } from '../../../lib/page-types'\nimport { getModuleBuildInfo } from '../loaders/get-module-build-info'\nimport { getAssumedSourceType } from '../loaders/next-flight-loader'\nimport { isAppRouteRoute } from '../../../lib/is-app-route-route'\nimport {\n DEFAULT_METADATA_ROUTE_EXTENSIONS,\n isMetadataRouteFile,\n} from '../../../lib/metadata/is-metadata-route'\nimport type { MetadataRouteLoaderOptions } from '../loaders/next-metadata-route-loader'\nimport type { FlightActionEntryLoaderActions } from '../loaders/next-flight-action-entry-loader'\nimport getWebpackBundler from '../../../shared/lib/get-webpack-bundler'\n\ninterface Options {\n dev: boolean\n appDir: string\n isEdgeServer: boolean\n encryptionKey: string\n}\n\nconst PLUGIN_NAME = 'FlightClientEntryPlugin'\n\ntype Actions = {\n [actionId: string]: {\n workers: {\n [name: string]: { moduleId: string | number; async: boolean }\n }\n // Record which layer the action is in (rsc or sc_action), in the specific entry.\n layer: {\n [name: string]: string\n }\n }\n}\n\ntype ActionIdNamePair = { id: string; exportedName: string }\n\nexport type ActionManifest = {\n // Assign a unique encryption key during production build.\n encryptionKey: string\n node: Actions\n edge: Actions\n}\n\nexport interface ModuleInfo {\n moduleId: string | number\n async: boolean\n}\n\nconst pluginState = getProxiedPluginState({\n // A map to track \"action\" -> \"list of bundles\".\n serverActions: {} as ActionManifest['node'],\n edgeServerActions: {} as ActionManifest['edge'],\n\n serverActionModules: {} as {\n [workerName: string]: { server?: ModuleInfo; client?: ModuleInfo }\n },\n\n edgeServerActionModules: {} as {\n [workerName: string]: { server?: ModuleInfo; client?: ModuleInfo }\n },\n\n ssrModules: {} as { [ssrModuleId: string]: ModuleInfo },\n edgeSsrModules: {} as { [ssrModuleId: string]: ModuleInfo },\n\n rscModules: {} as { [rscModuleId: string]: ModuleInfo },\n edgeRscModules: {} as { [rscModuleId: string]: ModuleInfo },\n\n injectedClientEntries: {} as Record<string, string>,\n})\n\nfunction deduplicateCSSImportsForEntry(mergedCSSimports: CssImports) {\n // If multiple entry module connections are having the same CSS import,\n // we only need to have one module to keep track of that CSS import.\n // It is based on the fact that if a page or a layout is rendered in the\n // given entry, all its parent layouts are always rendered too.\n // This can avoid duplicate CSS imports in the generated CSS manifest,\n // for example, if a page and its parent layout are both using the same\n // CSS import, we only need to have the layout to keep track of that CSS\n // import.\n // To achieve this, we need to first collect all the CSS imports from\n // every connection, and deduplicate them in the order of layers from\n // top to bottom. The implementation can be generally described as:\n // - Sort by number of `/` in the request path (the more `/`, the deeper)\n // - When in the same depth, sort by the filename (template < layout < page and others)\n\n // Sort the connections as described above.\n const sortedCSSImports = Object.entries(mergedCSSimports).sort((a, b) => {\n const [aPath] = a\n const [bPath] = b\n\n const aDepth = aPath.split('/').length\n const bDepth = bPath.split('/').length\n\n if (aDepth !== bDepth) {\n return aDepth - bDepth\n }\n\n const aName = path.parse(aPath).name\n const bName = path.parse(bPath).name\n\n const indexA = ['template', 'layout'].indexOf(aName)\n const indexB = ['template', 'layout'].indexOf(bName)\n\n if (indexA === -1) return 1\n if (indexB === -1) return -1\n return indexA - indexB\n })\n\n const dedupedCSSImports: CssImports = {}\n const trackedCSSImports = new Set<string>()\n for (const [entryName, cssImports] of sortedCSSImports) {\n for (const cssImport of cssImports) {\n if (trackedCSSImports.has(cssImport)) continue\n\n // Only track CSS imports that are in files that can inherit CSS.\n const filename = path.parse(entryName).name\n if (['template', 'layout'].includes(filename)) {\n trackedCSSImports.add(cssImport)\n }\n\n if (!dedupedCSSImports[entryName]) {\n dedupedCSSImports[entryName] = []\n }\n dedupedCSSImports[entryName].push(cssImport)\n }\n }\n\n return dedupedCSSImports\n}\n\nexport class FlightClientEntryPlugin {\n dev: boolean\n appDir: string\n encryptionKey: string\n isEdgeServer: boolean\n assetPrefix: string\n webpackRuntime: string\n\n constructor(options: Options) {\n this.dev = options.dev\n this.appDir = options.appDir\n this.isEdgeServer = options.isEdgeServer\n this.assetPrefix = !this.dev && !this.isEdgeServer ? '../' : ''\n this.encryptionKey = options.encryptionKey\n this.webpackRuntime = this.isEdgeServer\n ? EDGE_RUNTIME_WEBPACK\n : DEFAULT_RUNTIME_WEBPACK\n }\n\n apply(compiler: webpack.Compiler) {\n compiler.hooks.finishMake.tapPromise(PLUGIN_NAME, (compilation) =>\n this.createClientEntries(compiler, compilation)\n )\n\n compiler.hooks.afterCompile.tap(PLUGIN_NAME, (compilation) => {\n const recordModule = (modId: string, mod: any) => {\n // Match Resource is undefined unless an import is using the inline match resource syntax\n // https://webpack.js.org/api/loaders/#inline-matchresource\n const modPath = mod.matchResource || mod.resourceResolveData?.path\n const modQuery = mod.resourceResolveData?.query || ''\n // query is already part of mod.resource\n // so it's only necessary to add it for matchResource or mod.resourceResolveData\n const modResource = modPath\n ? modPath.startsWith(BARREL_OPTIMIZATION_PREFIX)\n ? formatBarrelOptimizedResource(mod.resource, modPath)\n : modPath + modQuery\n : mod.resource\n\n if (typeof modId !== 'undefined' && modResource) {\n if (mod.layer === WEBPACK_LAYERS.reactServerComponents) {\n const key = path\n .relative(compiler.context, modResource)\n .replace(/\\/next\\/dist\\/esm\\//, '/next/dist/')\n\n const moduleInfo: ModuleInfo = {\n moduleId: modId,\n async: compilation.moduleGraph.isAsync(mod),\n }\n\n if (this.isEdgeServer) {\n pluginState.edgeRscModules[key] = moduleInfo\n } else {\n pluginState.rscModules[key] = moduleInfo\n }\n }\n }\n\n if (mod.layer !== WEBPACK_LAYERS.serverSideRendering) {\n return\n }\n\n // Check mod resource to exclude the empty resource module like virtual module created by next-flight-client-entry-loader\n if (typeof modId !== 'undefined' && modResource) {\n // Note that this isn't that reliable as webpack is still possible to assign\n // additional queries to make sure there's no conflict even using the `named`\n // module ID strategy.\n let ssrNamedModuleId = path.relative(compiler.context, modResource)\n\n if (!ssrNamedModuleId.startsWith('.')) {\n // TODO use getModuleId instead\n ssrNamedModuleId = `./${normalizePathSep(ssrNamedModuleId)}`\n }\n\n const moduleInfo: ModuleInfo = {\n moduleId: modId,\n async: compilation.moduleGraph.isAsync(mod),\n }\n\n if (this.isEdgeServer) {\n pluginState.edgeSsrModules[\n ssrNamedModuleId.replace(/\\/next\\/dist\\/esm\\//, '/next/dist/')\n ] = moduleInfo\n } else {\n pluginState.ssrModules[ssrNamedModuleId] = moduleInfo\n }\n }\n }\n\n traverseModules(compilation, (mod, _chunk, _chunkGroup, modId) => {\n if (modId) recordModule(modId, mod)\n })\n })\n\n compiler.hooks.make.tap(PLUGIN_NAME, (compilation) => {\n compilation.hooks.processAssets.tapPromise(\n {\n name: PLUGIN_NAME,\n stage: webpack.Compilation.PROCESS_ASSETS_STAGE_OPTIMIZE_HASH,\n },\n () => this.createActionAssets(compilation)\n )\n })\n }\n\n async createClientEntries(\n compiler: webpack.Compiler,\n compilation: webpack.Compilation\n ) {\n const addClientEntryAndSSRModulesList: Array<\n ReturnType<typeof this.injectClientEntryAndSSRModules>\n > = []\n const createdSSRDependenciesForEntry: Record<\n string,\n ReturnType<typeof this.injectClientEntryAndSSRModules>[3][]\n > = {}\n\n const addActionEntryList: Array<ReturnType<typeof this.injectActionEntry>> =\n []\n const actionMapsPerEntry: Record<\n string,\n Map<string, ActionIdNamePair[]>\n > = {}\n const createdActionIds = new Set<string>()\n\n // For each SC server compilation entry, we need to create its corresponding\n // client component entry.\n forEachEntryModule(compilation, ({ name, entryModule }) => {\n const internalClientComponentEntryImports: ClientComponentImports = {}\n const actionEntryImports = new Map<string, ActionIdNamePair[]>()\n const clientEntriesToInject = []\n const mergedCSSimports: CssImports = {}\n\n for (const connection of getModuleReferencesInOrder(\n entryModule,\n compilation.moduleGraph\n )) {\n // Entry can be any user defined entry files such as layout, page, error, loading, etc.\n let entryRequest = (\n connection.dependency as unknown as webpack.NormalModule\n ).request\n\n if (entryRequest.endsWith(WEBPACK_RESOURCE_QUERIES.metadataRoute)) {\n const { filePath, isDynamicRouteExtension } =\n getMetadataRouteResource(entryRequest)\n\n if (isDynamicRouteExtension === '1') {\n entryRequest = filePath\n }\n }\n\n const { clientComponentImports, actionImports, cssImports } =\n this.collectComponentInfoFromServerEntryDependency({\n entryRequest,\n compilation,\n resolvedModule: connection.resolvedModule,\n })\n\n actionImports.forEach(([dep, actions]) =>\n actionEntryImports.set(dep, actions)\n )\n\n const isAbsoluteRequest = path.isAbsolute(entryRequest)\n\n // Next.js internals are put into a separate entry.\n if (!isAbsoluteRequest) {\n Object.keys(clientComponentImports).forEach(\n (value) => (internalClientComponentEntryImports[value] = new Set())\n )\n continue\n }\n\n // TODO-APP: Enable these lines. This ensures no entrypoint is created for layout/page when there are no client components.\n // Currently disabled because it causes test failures in CI.\n // if (clientImports.length === 0 && actionImports.length === 0) {\n // continue\n // }\n\n const relativeRequest = isAbsoluteRequest\n ? path.relative(compilation.options.context!, entryRequest)\n : entryRequest\n\n // Replace file suffix as `.js` will be added.\n // bundlePath will have app/ prefix but not src/.\n // e.g. src/app/foo/page.js -> app/foo/page\n let bundlePath = normalizePathSep(\n relativeRequest.replace(/\\.[^.\\\\/]+$/, '').replace(/^src[\\\\/]/, '')\n )\n\n // For metadata routes, the entry name can be used as the bundle path,\n // as it has been normalized already.\n // e.g.\n // When `relativeRequest` is 'src/app/sitemap.js',\n // `appDirRelativeRequest` will be '/sitemap.js'\n // then `isMetadataEntryFile` will be `true`\n const appDirRelativeRequest = relativeRequest\n .replace(/^src[\\\\/]/, '')\n .replace(/^app[\\\\/]/, '/')\n const isMetadataEntryFile = isMetadataRouteFile(\n appDirRelativeRequest,\n DEFAULT_METADATA_ROUTE_EXTENSIONS,\n true\n )\n if (isMetadataEntryFile) {\n bundlePath = name\n }\n\n Object.assign(mergedCSSimports, cssImports)\n clientEntriesToInject.push({\n compiler,\n compilation,\n entryName: name,\n clientComponentImports,\n bundlePath,\n absolutePagePath: entryRequest,\n })\n\n // The webpack implementation of writing the client reference manifest relies on all entrypoints writing a page.js even when there is no client components in the page.\n // It needs the file in order to write the reference manifest for the path in the `.next/server` folder.\n // TODO-APP: This could be better handled, however Turbopack does not have the same problem as we resolve client components in a single graph.\n if (\n name === `app${UNDERSCORE_NOT_FOUND_ROUTE_ENTRY}` &&\n bundlePath === 'app/not-found'\n ) {\n clientEntriesToInject.push({\n compiler,\n compilation,\n entryName: name,\n clientComponentImports: {},\n bundlePath: `app${UNDERSCORE_NOT_FOUND_ROUTE_ENTRY}`,\n absolutePagePath: entryRequest,\n })\n }\n\n if (\n name === `app${UNDERSCORE_NOT_FOUND_ROUTE_ENTRY}` &&\n bundlePath === 'app/global-not-found'\n ) {\n clientEntriesToInject.push({\n compiler,\n compilation,\n entryName: name,\n clientComponentImports,\n bundlePath: `app${UNDERSCORE_NOT_FOUND_ROUTE_ENTRY}`,\n absolutePagePath: entryRequest,\n })\n }\n }\n\n // Make sure CSS imports are deduplicated before injecting the client entry\n // and SSR modules.\n const dedupedCSSImports = deduplicateCSSImportsForEntry(mergedCSSimports)\n for (const clientEntryToInject of clientEntriesToInject) {\n const injected = this.injectClientEntryAndSSRModules({\n ...clientEntryToInject,\n clientImports: {\n ...clientEntryToInject.clientComponentImports,\n ...(\n dedupedCSSImports[clientEntryToInject.absolutePagePath] || []\n ).reduce<ClientComponentImports>((res, curr) => {\n res[curr] = new Set()\n return res\n }, {}),\n },\n })\n\n // Track all created SSR dependencies for each entry from the server layer.\n if (!createdSSRDependenciesForEntry[clientEntryToInject.entryName]) {\n createdSSRDependenciesForEntry[clientEntryToInject.entryName] = []\n }\n createdSSRDependenciesForEntry[clientEntryToInject.entryName].push(\n injected[3]\n )\n\n addClientEntryAndSSRModulesList.push(injected)\n }\n\n if (!isAppRouteRoute(name)) {\n // Create internal app\n addClientEntryAndSSRModulesList.push(\n this.injectClientEntryAndSSRModules({\n compiler,\n compilation,\n entryName: name,\n clientImports: { ...internalClientComponentEntryImports },\n bundlePath: APP_CLIENT_INTERNALS,\n })\n )\n }\n\n if (actionEntryImports.size > 0) {\n if (!actionMapsPerEntry[name]) {\n actionMapsPerEntry[name] = new Map()\n }\n actionMapsPerEntry[name] = new Map([\n ...actionMapsPerEntry[name],\n ...actionEntryImports,\n ])\n }\n })\n\n for (const [name, actionEntryImports] of Object.entries(\n actionMapsPerEntry\n )) {\n addActionEntryList.push(\n this.injectActionEntry({\n compiler,\n compilation,\n actions: actionEntryImports,\n entryName: name,\n bundlePath: name,\n createdActionIds,\n })\n )\n }\n\n // Invalidate in development to trigger recompilation\n const invalidator = getInvalidator(compiler.outputPath)\n // Check if any of the entry injections need an invalidation\n if (\n invalidator &&\n addClientEntryAndSSRModulesList.some(\n ([shouldInvalidate]) => shouldInvalidate === true\n )\n ) {\n invalidator.invalidate([COMPILER_NAMES.client])\n }\n\n // Client compiler is invalidated before awaiting the compilation of the SSR\n // and RSC client component entries so that the client compiler is running\n // in parallel to the server compiler.\n await Promise.all(\n addClientEntryAndSSRModulesList.flatMap((addClientEntryAndSSRModules) => [\n addClientEntryAndSSRModules[1],\n addClientEntryAndSSRModules[2],\n ])\n )\n\n // Wait for action entries to be added.\n await Promise.all(addActionEntryList)\n\n const addedClientActionEntryList: Promise<any>[] = []\n const actionMapsPerClientEntry: Record<\n string,\n Map<string, ActionIdNamePair[]>\n > = {}\n\n // We need to create extra action entries that are created from the\n // client layer.\n // Start from each entry's created SSR dependency from our previous step.\n for (const [name, ssrEntryDependencies] of Object.entries(\n createdSSRDependenciesForEntry\n )) {\n // Collect from all entries, e.g. layout.js, page.js, loading.js, ...\n // add aggregate them.\n const actionEntryImports = this.collectClientActionsFromDependencies({\n compilation,\n dependencies: ssrEntryDependencies,\n })\n\n if (actionEntryImports.size > 0) {\n if (!actionMapsPerClientEntry[name]) {\n actionMapsPerClientEntry[name] = new Map()\n }\n actionMapsPerClientEntry[name] = new Map([\n ...actionMapsPerClientEntry[name],\n ...actionEntryImports,\n ])\n }\n }\n\n for (const [entryName, actionEntryImports] of Object.entries(\n actionMapsPerClientEntry\n )) {\n // If an action method is already created in the server layer, we don't\n // need to create it again in the action layer.\n // This is to avoid duplicate action instances and make sure the module\n // state is shared.\n let remainingClientImportedActions = false\n const remainingActionEntryImports = new Map<string, ActionIdNamePair[]>()\n for (const [dep, actions] of actionEntryImports) {\n const remainingActionNames = []\n for (const action of actions) {\n if (!createdActionIds.has(entryName + '@' + action.id)) {\n remainingActionNames.push(action)\n }\n }\n if (remainingActionNames.length > 0) {\n remainingActionEntryImports.set(dep, remainingActionNames)\n remainingClientImportedActions = true\n }\n }\n\n if (remainingClientImportedActions) {\n addedClientActionEntryList.push(\n this.injectActionEntry({\n compiler,\n compilation,\n actions: remainingActionEntryImports,\n entryName,\n bundlePath: entryName,\n fromClient: true,\n createdActionIds,\n })\n )\n }\n }\n\n await Promise.all(addedClientActionEntryList)\n }\n\n collectClientActionsFromDependencies({\n compilation,\n dependencies,\n }: {\n compilation: webpack.Compilation\n dependencies: ReturnType<typeof webpack.EntryPlugin.createDependency>[]\n }) {\n // action file path -> action names\n const collectedActions = new Map<string, ActionIdNamePair[]>()\n\n // Keep track of checked modules to avoid infinite loops with recursive imports.\n const visitedModule = new Set<string>()\n const visitedEntry = new Set<string>()\n\n const collectActions = ({\n entryRequest,\n resolvedModule,\n }: {\n entryRequest: string\n resolvedModule: any\n }) => {\n const collectActionsInDep = (mod: webpack.NormalModule): void => {\n if (!mod) return\n\n const modResource = getModuleResource(mod)\n\n if (!modResource) return\n\n if (visitedModule.has(modResource)) return\n visitedModule.add(modResource)\n\n const actionIds = getModuleBuildInfo(mod).rsc?.actionIds\n if (actionIds) {\n collectedActions.set(\n modResource,\n Object.entries(actionIds).map(([id, exportedName]) => ({\n id,\n exportedName,\n }))\n )\n }\n\n // Collect used exported actions transversely.\n getModuleReferencesInOrder(mod, compilation.moduleGraph).forEach(\n (connection: any) => {\n collectActionsInDep(\n connection.resolvedModule as webpack.NormalModule\n )\n }\n )\n }\n\n // Don't traverse the module graph anymore once hitting the action layer.\n if (\n entryRequest &&\n !entryRequest.includes('next-flight-action-entry-loader')\n ) {\n // Traverse the module graph to find all client components.\n collectActionsInDep(resolvedModule)\n }\n }\n\n for (const entryDependency of dependencies) {\n const ssrEntryModule =\n compilation.moduleGraph.getResolvedModule(entryDependency)!\n for (const connection of getModuleReferencesInOrder(\n ssrEntryModule,\n compilation.moduleGraph\n )) {\n const depModule = connection.dependency\n const request = (depModule as unknown as webpack.NormalModule).request\n\n // It is possible that the same entry is added multiple times in the\n // connection graph. We can just skip these to speed up the process.\n if (visitedEntry.has(request)) continue\n visitedEntry.add(request)\n\n collectActions({\n entryRequest: request,\n resolvedModule: connection.resolvedModule,\n })\n }\n }\n\n return collectedActions\n }\n\n collectComponentInfoFromServerEntryDependency({\n entryRequest,\n compilation,\n resolvedModule,\n }: {\n entryRequest: string\n compilation: webpack.Compilation\n resolvedModule: any /* Dependency */\n }): {\n cssImports: CssImports\n clientComponentImports: ClientComponentImports\n actionImports: [string, ActionIdNamePair[]][]\n } {\n // Keep track of checked modules to avoid infinite loops with recursive imports.\n const visitedOfClientComponentsTraverse = new Set()\n\n // Info to collect.\n const clientComponentImports: ClientComponentImports = {}\n const actionImports: [string, ActionIdNamePair[]][] = []\n const CSSImports = new Set<string>()\n\n const filterClientComponents = (\n mod: webpack.NormalModule,\n importedIdentifiers: string[]\n ): void => {\n if (!mod) return\n\n const modResource = getModuleResource(mod)\n\n if (!modResource) return\n if (visitedOfClientComponentsTraverse.has(modResource)) {\n if (clientComponentImports[modResource]) {\n addClientImport(\n mod,\n modResource,\n clientComponentImports,\n importedIdentifiers,\n false\n )\n }\n return\n }\n visitedOfClientComponentsTraverse.add(modResource)\n\n const actionIds = getModuleBuildInfo(mod).rsc?.actionIds\n if (actionIds) {\n actionImports.push([\n modResource,\n Object.entries(actionIds).map(([id, exportedName]) => ({\n id,\n exportedName,\n })),\n ])\n }\n\n if (isCSSMod(mod)) {\n const sideEffectFree =\n mod.factoryMeta && (mod.factoryMeta as any).sideEffectFree\n\n if (sideEffectFree) {\n const unused = !compilation.moduleGraph\n .getExportsInfo(mod)\n .isModuleUsed(this.webpackRuntime)\n\n if (unused) return\n }\n\n CSSImports.add(modResource)\n } else if (isClientComponentEntryModule(mod)) {\n if (!clientComponentImports[modResource]) {\n clientComponentImports[modResource] = new Set()\n }\n addClientImport(\n mod,\n modResource,\n clientComponentImports,\n importedIdentifiers,\n true\n )\n\n return\n }\n\n getModuleReferencesInOrder(mod, compilation.moduleGraph).forEach(\n (connection: any) => {\n let dependencyIds: string[] = []\n\n // `ids` are the identifiers that are imported from the dependency,\n // if it's present, it's an array of strings.\n if (connection.dependency?.ids) {\n dependencyIds.push(...connection.dependency.ids)\n } else {\n dependencyIds = ['*']\n }\n\n filterClientComponents(connection.resolvedModule, dependencyIds)\n }\n )\n }\n\n // Traverse the module graph to find all client components.\n filterClientComponents(resolvedModule, [])\n\n return {\n clientComponentImports,\n cssImports: CSSImports.size\n ? {\n [entryRequest]: Array.from(CSSImports),\n }\n : {},\n actionImports,\n }\n }\n\n injectClientEntryAndSSRModules({\n compiler,\n compilation,\n entryName,\n clientImports,\n bundlePath,\n absolutePagePath,\n }: {\n compiler: webpack.Compiler\n compilation: webpack.Compilation\n entryName: string\n clientImports: ClientComponentImports\n bundlePath: string\n absolutePagePath?: string\n }): [\n shouldInvalidate: boolean,\n addSSREntryPromise: Promise<void>,\n addRSCEntryPromise: Promise<void>,\n ssrDep: ReturnType<typeof webpack.EntryPlugin.createDependency>,\n ] {\n const bundler = getWebpackBundler()\n let shouldInvalidate = false\n\n const modules = Object.keys(clientImports)\n .sort((a, b) => (regexCSS.test(b) ? 1 : a.localeCompare(b)))\n .map((clientImportPath) => ({\n request: clientImportPath,\n ids: [...clientImports[clientImportPath]],\n }))\n\n // For the client entry, we always use the CJS build of Next.js. If the\n // server is using the ESM build (when using the Edge runtime), we need to\n // replace them.\n const clientBrowserLoader = `next-flight-client-entry-loader?${stringify({\n modules: (this.isEdgeServer\n ? modules.map(({ request, ids }) => ({\n request: request.replace(\n /[\\\\/]next[\\\\/]dist[\\\\/]esm[\\\\/]/,\n '/next/dist/'.replace(/\\//g, path.sep)\n ),\n ids,\n }))\n : modules\n ).map((x) => JSON.stringify(x)),\n server: false,\n })}!`\n\n const clientServerLoader = `next-flight-client-entry-loader?${stringify({\n modules: modules.map((x) => JSON.stringify(x)),\n server: true,\n })}!`\n\n // Add for the client compilation\n // Inject the entry to the client compiler.\n if (this.dev) {\n const entries = getEntries(compiler.outputPath)\n const pageKey = getEntryKey(\n COMPILER_NAMES.client,\n PAGE_TYPES.APP,\n bundlePath\n )\n\n if (!entries[pageKey]) {\n entries[pageKey] = {\n type: EntryTypes.CHILD_ENTRY,\n parentEntries: new Set([entryName]),\n absoluteEntryFilePath: absolutePagePath,\n bundlePath,\n request: clientBrowserLoader,\n dispose: false,\n lastActiveTime: Date.now(),\n }\n shouldInvalidate = true\n } else {\n const entryData = entries[pageKey]\n // New version of the client loader\n if (entryData.request !== clientBrowserLoader) {\n entryData.request = clientBrowserLoader\n shouldInvalidate = true\n }\n if (entryData.type === EntryTypes.CHILD_ENTRY) {\n entryData.parentEntries.add(entryName)\n }\n entryData.dispose = false\n entryData.lastActiveTime = Date.now()\n }\n } else {\n pluginState.injectedClientEntries[bundlePath] = clientBrowserLoader\n }\n\n const clientComponentSSREntryDep = bundler.EntryPlugin.createDependency(\n clientServerLoader,\n { name: bundlePath }\n )\n\n const clientComponentRSCEntryDep = bundler.EntryPlugin.createDependency(\n clientServerLoader,\n { name: bundlePath }\n )\n\n return [\n shouldInvalidate,\n // Add the entries to the server compiler for the SSR and RSC layers. The\n // promises are awaited later using `Promise.all` in order to parallelize\n // adding the entries.\n this.addEntry(compilation, compiler.context, clientComponentSSREntryDep, {\n name: entryName,\n layer: WEBPACK_LAYERS.serverSideRendering,\n }),\n this.addEntry(compilation, compiler.context, clientComponentRSCEntryDep, {\n name: entryName,\n layer: WEBPACK_LAYERS.reactServerComponents,\n }),\n clientComponentSSREntryDep,\n ]\n }\n\n injectActionEntry({\n compiler,\n compilation,\n actions,\n entryName,\n bundlePath,\n fromClient,\n createdActionIds,\n }: {\n compiler: webpack.Compiler\n compilation: webpack.Compilation\n actions: Map<string, ActionIdNamePair[]>\n entryName: string\n bundlePath: string\n createdActionIds: Set<string>\n fromClient?: boolean\n }) {\n const bundler = getWebpackBundler()\n const actionsArray = Array.from(actions.entries())\n for (const [, actionsFromModule] of actions) {\n for (const { id } of actionsFromModule) {\n createdActionIds.add(entryName + '@' + id)\n }\n }\n\n if (actionsArray.length === 0) {\n return Promise.resolve()\n }\n\n const actionLoader = `next-flight-action-entry-loader?${stringify({\n actions: JSON.stringify(\n actionsArray satisfies FlightActionEntryLoaderActions\n ),\n __client_imported__: fromClient,\n })}!`\n\n const currentCompilerServerActions = this.isEdgeServer\n ? pluginState.edgeServerActions\n : pluginState.serverActions\n\n for (const [, actionsFromModule] of actionsArray) {\n for (const { id } of actionsFromModule) {\n if (typeof currentCompilerServerActions[id] === 'undefined') {\n currentCompilerServerActions[id] = {\n workers: {},\n layer: {},\n }\n }\n currentCompilerServerActions[id].workers[bundlePath] = {\n moduleId: '', // TODO: What's the meaning of this?\n async: false,\n }\n\n currentCompilerServerActions[id].layer[bundlePath] = fromClient\n ? WEBPACK_LAYERS.actionBrowser\n : WEBPACK_LAYERS.reactServerComponents\n }\n }\n\n // Inject the entry to the server compiler\n const actionEntryDep = bundler.EntryPlugin.createDependency(actionLoader, {\n name: bundlePath,\n })\n\n return this.addEntry(\n compilation,\n // Reuse compilation context.\n compiler.context,\n actionEntryDep,\n {\n name: entryName,\n layer: fromClient\n ? WEBPACK_LAYERS.actionBrowser\n : WEBPACK_LAYERS.reactServerComponents,\n }\n )\n }\n\n addEntry(\n compilation: webpack.Compilation,\n context: string,\n dependency: webpack.Dependency,\n options: webpack.EntryOptions\n ): Promise<any> /* Promise<module> */ {\n return new Promise((resolve, reject) => {\n if ('rspack' in compilation.compiler) {\n compilation.addInclude(context, dependency, options, (err, module) => {\n if (err) {\n return reject(err)\n }\n\n compilation.moduleGraph\n .getExportsInfo(module!)\n .setUsedInUnknownWay(\n this.isEdgeServer ? EDGE_RUNTIME_WEBPACK : DEFAULT_RUNTIME_WEBPACK\n )\n return resolve(module)\n })\n } else {\n const entry = compilation.entries.get(options.name!)!\n entry.includeDependencies.push(dependency)\n compilation.hooks.addEntry.call(entry as any, options)\n compilation.addModuleTree(\n {\n context,\n dependency,\n contextInfo: { issuerLayer: options.layer },\n },\n (err: any, module: any) => {\n if (err) {\n compilation.hooks.failedEntry.call(dependency, options, err)\n return reject(err)\n }\n\n compilation.hooks.succeedEntry.call(dependency, options, module)\n\n compilation.moduleGraph\n .getExportsInfo(module)\n .setUsedInUnknownWay(\n this.isEdgeServer\n ? EDGE_RUNTIME_WEBPACK\n : DEFAULT_RUNTIME_WEBPACK\n )\n\n return resolve(module)\n }\n )\n }\n })\n }\n\n async createActionAssets(compilation: webpack.Compilation) {\n const serverActions: ActionManifest['node'] = {}\n const edgeServerActions: ActionManifest['edge'] = {}\n\n traverseModules(compilation, (mod, _chunk, chunkGroup, modId) => {\n // Go through all action entries and record the module ID for each entry.\n if (\n chunkGroup.name &&\n mod.request &&\n modId &&\n /next-flight-action-entry-loader/.test(mod.request)\n ) {\n const fromClient = /&__client_imported__=true/.test(mod.request)\n\n const mapping = this.isEdgeServer\n ? pluginState.edgeServerActionModules\n : pluginState.serverActionModules\n\n if (!mapping[chunkGroup.name]) {\n mapping[chunkGroup.name] = {}\n }\n mapping[chunkGroup.name][fromClient ? 'client' : 'server'] = {\n moduleId: modId,\n async: compilation.moduleGraph.isAsync(mod),\n }\n }\n })\n\n for (let id in pluginState.serverActions) {\n const action = pluginState.serverActions[id]\n for (let name in action.workers) {\n const modId =\n pluginState.serverActionModules[name][\n action.layer[name] === WEBPACK_LAYERS.actionBrowser\n ? 'client'\n : 'server'\n ]\n action.workers[name] = modId!\n }\n serverActions[id] = action\n }\n\n for (let id in pluginState.edgeServerActions) {\n const action = pluginState.edgeServerActions[id]\n for (let name in action.workers) {\n const modId =\n pluginState.edgeServerActionModules[name][\n action.layer[name] === WEBPACK_LAYERS.actionBrowser\n ? 'client'\n : 'server'\n ]\n action.workers[name] = modId!\n }\n edgeServerActions[id] = action\n }\n\n const serverManifest = {\n node: serverActions,\n edge: edgeServerActions,\n encryptionKey: this.encryptionKey,\n }\n const edgeServerManifest = {\n ...serverManifest,\n encryptionKey: 'process.env.NEXT_SERVER_ACTIONS_ENCRYPTION_KEY',\n }\n\n const json = JSON.stringify(serverManifest, null, this.dev ? 2 : undefined)\n const edgeJson = JSON.stringify(\n edgeServerManifest,\n null,\n this.dev ? 2 : undefined\n )\n\n compilation.emitAsset(\n `${this.assetPrefix}${SERVER_REFERENCE_MANIFEST}.js`,\n new sources.RawSource(\n `self.__RSC_SERVER_MANIFEST=${JSON.stringify(edgeJson)}`\n ) as unknown as webpack.sources.RawSource\n )\n compilation.emitAsset(\n `${this.assetPrefix}${SERVER_REFERENCE_MANIFEST}.json`,\n new sources.RawSource(json) as unknown as webpack.sources.RawSource\n )\n }\n}\n\nfunction addClientImport(\n mod: webpack.NormalModule,\n modRequest: string,\n clientComponentImports: ClientComponentImports,\n importedIdentifiers: string[],\n isFirstVisitModule: boolean\n) {\n const clientEntryType = getModuleBuildInfo(mod).rsc?.clientEntryType\n const isCjsModule = clientEntryType === 'cjs'\n const assumedSourceType = getAssumedSourceType(\n mod,\n isCjsModule ? 'commonjs' : 'auto'\n )\n\n const clientImportsSet = clientComponentImports[modRequest]\n\n if (importedIdentifiers[0] === '*') {\n // If there's collected import path with named import identifiers,\n // or there's nothing in collected imports are empty.\n // we should include the whole module.\n if (!isFirstVisitModule && [...clientImportsSet][0] !== '*') {\n clientComponentImports[modRequest] = new Set(['*'])\n }\n } else {\n const isAutoModuleSourceType = assumedSourceType === 'auto'\n if (isAutoModuleSourceType) {\n clientComponentImports[modRequest] = new Set(['*'])\n } else {\n // If it's not analyzed as named ESM exports, e.g. if it's mixing `export *` with named exports,\n // We'll include all modules since it's not able to do tree-shaking.\n for (const name of importedIdentifiers) {\n // For cjs module default import, we include the whole module since\n const isCjsDefaultImport = isCjsModule && name === 'default'\n\n // Always include __esModule along with cjs module default export,\n // to make sure it work with client module proxy from React.\n if (isCjsDefaultImport) {\n clientComponentImports[modRequest].add('__esModule')\n }\n\n clientComponentImports[modRequest].add(name)\n }\n }\n }\n}\n\nfunction getModuleResource(mod: webpack.NormalModule): string {\n const modPath: string = mod.resourceResolveData?.path || ''\n const modQuery = mod.resourceResolveData?.query || ''\n // We have to always use the resolved request here to make sure the\n // server and client are using the same module path (required by RSC), as\n // the server compiler and client compiler have different resolve configs.\n let modResource: string = modPath + modQuery\n\n // Context modules don't have a resource path, we use the identifier instead.\n if (mod.constructor.name === 'ContextModule') {\n modResource = mod.identifier()\n }\n\n // For the barrel optimization, we need to use the match resource instead\n // because there will be 2 modules for the same file (same resource path)\n // but they're different modules and can't be deduped via `visitedModule`.\n // The first module is a virtual re-export module created by the loader.\n if (mod.matchResource?.startsWith(BARREL_OPTIMIZATION_PREFIX)) {\n modResource = mod.matchResource + ':' + modResource\n }\n\n if (mod.resource === `?${WEBPACK_RESOURCE_QUERIES.metadataRoute}`) {\n return getMetadataRouteResource(mod.rawRequest).filePath\n }\n\n return modResource\n}\n\nfunction getMetadataRouteResource(request: string): MetadataRouteLoaderOptions {\n // e.g. next-metadata-route-loader?filePath=<some-url-encoded-path>&isDynamicRouteExtension=1!?__next_metadata_route__\n const query = request.split('!')[0].split('next-metadata-route-loader?')[1]\n\n return parse(query) as MetadataRouteLoaderOptions\n}\n"],"names":["webpack","parse","stringify","path","sources","getInvalidator","getEntries","EntryTypes","getEntryKey","WEBPACK_LAYERS","WEBPACK_RESOURCE_QUERIES","APP_CLIENT_INTERNALS","BARREL_OPTIMIZATION_PREFIX","COMPILER_NAMES","DEFAULT_RUNTIME_WEBPACK","EDGE_RUNTIME_WEBPACK","SERVER_REFERENCE_MANIFEST","UNDERSCORE_NOT_FOUND_ROUTE_ENTRY","isClientComponentEntryModule","isCSSMod","regexCSS","traverseModules","forEachEntryModule","formatBarrelOptimizedResource","getModuleReferencesInOrder","normalizePathSep","getProxiedPluginState","PAGE_TYPES","getModuleBuildInfo","getAssumedSourceType","isAppRouteRoute","DEFAULT_METADATA_ROUTE_EXTENSIONS","isMetadataRouteFile","getWebpackBundler","PLUGIN_NAME","pluginState","serverActions","edgeServerActions","serverActionModules","edgeServerActionModules","ssrModules","edgeSsrModules","rscModules","edgeRscModules","injectedClientEntries","deduplicateCSSImportsForEntry","mergedCSSimports","sortedCSSImports","Object","entries","sort","a","b","aPath","bPath","aDepth","split","length","bDepth","aName","name","bName","indexA","indexOf","indexB","dedupedCSSImports","trackedCSSImports","Set","entryName","cssImports","cssImport","has","filename","includes","add","push","FlightClientEntryPlugin","constructor","options","dev","appDir","isEdgeServer","assetPrefix","encryptionKey","webpackRuntime","apply","compiler","hooks","finishMake","tapPromise","compilation","createClientEntries","afterCompile","tap","recordModule","modId","mod","modPath","matchResource","resourceResolveData","modQuery","query","modResource","startsWith","resource","layer","reactServerComponents","key","relative","context","replace","moduleInfo","moduleId","async","moduleGraph","isAsync","serverSideRendering","ssrNamedModuleId","_chunk","_chunkGroup","make","processAssets","stage","Compilation","PROCESS_ASSETS_STAGE_OPTIMIZE_HASH","createActionAssets","addClientEntryAndSSRModulesList","createdSSRDependenciesForEntry","addActionEntryList","actionMapsPerEntry","createdActionIds","entryModule","internalClientComponentEntryImports","actionEntryImports","Map","clientEntriesToInject","connection","entryRequest","dependency","request","endsWith","metadataRoute","filePath","isDynamicRouteExtension","getMetadataRouteResource","clientComponentImports","actionImports","collectComponentInfoFromServerEntryDependency","resolvedModule","forEach","dep","actions","set","isAbsoluteRequest","isAbsolute","keys","value","relativeRequest","bundlePath","appDirRelativeRequest","isMetadataEntryFile","assign","absolutePagePath","clientEntryToInject","injected","injectClientEntryAndSSRModules","clientImports","reduce","res","curr","size","injectActionEntry","invalidator","outputPath","some","shouldInvalidate","invalidate","client","Promise","all","flatMap","addClientEntryAndSSRModules","addedClientActionEntryList","actionMapsPerClientEntry","ssrEntryDependencies","collectClientActionsFromDependencies","dependencies","remainingClientImportedActions","remainingActionEntryImports","remainingActionNames","action","id","fromClient","collectedActions","visitedModule","visitedEntry","collectActions","collectActionsInDep","getModuleResource","actionIds","rsc","map","exportedName","entryDependency","ssrEntryModule","getResolvedModule","depModule","visitedOfClientComponentsTraverse","CSSImports","filterClientComponents","importedIdentifiers","addClientImport","sideEffectFree","factoryMeta","unused","getExportsInfo","isModuleUsed","dependencyIds","ids","Array","from","bundler","modules","test","localeCompare","clientImportPath","clientBrowserLoader","sep","x","JSON","server","clientServerLoader","pageKey","APP","type","CHILD_ENTRY","parentEntries","absoluteEntryFilePath","dispose","lastActiveTime","Date","now","entryData","clientComponentSSREntryDep","EntryPlugin","createDependency","clientComponentRSCEntryDep","addEntry","actionsArray","actionsFromModule","resolve","actionLoader","__client_imported__","currentCompilerServerActions","workers","actionBrowser","actionEntryDep","reject","addInclude","err","module","setUsedInUnknownWay","entry","get","includeDependencies","call","addModuleTree","contextInfo","issuerLayer","failedEntry","succeedEntry","chunkGroup","mapping","serverManifest","node","edge","edgeServerManifest","json","undefined","edgeJson","emitAsset","RawSource","modRequest","isFirstVisitModule","clientEntryType","isCjsModule","assumedSourceType","clientImportsSet","isAutoModuleSourceType","isCjsDefaultImport","identifier","rawRequest"],"mappings":"AAKA,SAASA,OAAO,QAAQ,qCAAoC;AAC5D,SAASC,KAAK,EAAEC,SAAS,QAAQ,cAAa;AAC9C,OAAOC,UAAU,OAAM;AACvB,SAASC,OAAO,QAAQ,qCAAoC;AAC5D,SACEC,cAAc,EACdC,UAAU,EACVC,UAAU,EACVC,WAAW,QACN,8CAA6C;AACpD,SACEC,cAAc,EACdC,wBAAwB,QACnB,yBAAwB;AAC/B,SACEC,oBAAoB,EACpBC,0BAA0B,EAC1BC,cAAc,EACdC,uBAAuB,EACvBC,oBAAoB,EACpBC,yBAAyB,EACzBC,gCAAgC,QAC3B,gCAA+B;AACtC,SACEC,4BAA4B,EAC5BC,QAAQ,EACRC,QAAQ,QACH,mBAAkB;AACzB,SACEC,eAAe,EACfC,kBAAkB,EAClBC,6BAA6B,EAC7BC,0BAA0B,QACrB,WAAU;AACjB,SAASC,gBAAgB,QAAQ,mDAAkD;AACnF,SAASC,qBAAqB,QAAQ,sBAAqB;AAC3D,SAASC,UAAU,QAAQ,0BAAyB;AACpD,SAASC,kBAAkB,QAAQ,mCAAkC;AACrE,SAASC,oBAAoB,QAAQ,gCAA+B;AACpE,SAASC,eAAe,QAAQ,kCAAiC;AACjE,SACEC,iCAAiC,EACjCC,mBAAmB,QACd,0CAAy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J,sBAAsB,CAACyI,WAAW,CAAChN,GAAG,CAAC;gBACzC;gBAEAuE,sBAAsB,CAACyI,WAAW,CAAChN,GAAG,CAACd;YACzC;QACF;IACF;AACF;AAEA,SAAS0I,kBAAkBtG,GAAyB;QAC1BA,0BACPA,2BAebA;IAhBJ,MAAMC,UAAkBD,EAAAA,2BAAAA,IAAIG,mBAAmB,qBAAvBH,yBAAyB7F,IAAI,KAAI;IACzD,MAAMiG,WAAWJ,EAAAA,4BAAAA,IAAIG,mBAAmB,qBAAvBH,0BAAyBK,KAAK,KAAI;IACnD,mEAAmE;IACnE,yEAAyE;IACzE,0EAA0E;IAC1E,IAAIC,cAAsBL,UAAUG;IAEpC,6EAA6E;IAC7E,IAAIJ,IAAInB,WAAW,CAACjB,IAAI,KAAK,iBAAiB;QAC5C0C,cAAcN,IAAIkM,UAAU;IAC9B;IAEA,yEAAyE;IACzE,yEAAyE;IACzE,0EAA0E;IAC1E,wEAAwE;IACxE,KAAIlM,qBAAAA,IAAIE,aAAa,qBAAjBF,mBAAmBO,UAAU,CAAC3F,6BAA6B;QAC7D0F,cAAcN,IAAIE,aAAa,GAAG,MAAMI;IAC1C;IAEA,IAAIN,IAAIQ,QAAQ,KAAK,CAAC,CAAC,EAAE9F,yBAAyBmI,aAAa,EAAE,EAAE;QACjE,OAAOG,yBAAyBhD,IAAImM,UAAU,EAAErJ,QAAQ;IAC1D;IAEA,OAAOxC;AACT;AAEA,SAAS0C,yBAAyBL,OAAe;IAC/C,sHAAsH;IACtH,MAAMtC,QAAQsC,QAAQnF,KAAK,CAAC,IAAI,CAAC,EAAE,CAACA,KAAK,CAAC,8BAA8B,CAAC,EAAE;IAE3E,OAAOvD,MAAMoG;AACf","ignoreList":[0]}
|
1
|
+
{"version":3,"sources":["../../../../src/build/webpack/plugins/flight-client-entry-plugin.ts"],"sourcesContent":["import type {\n CssImports,\n ClientComponentImports,\n} from '../loaders/next-flight-client-entry-loader'\n\nimport { webpack } from 'next/dist/compiled/webpack/webpack'\nimport { parse, stringify } from 'querystring'\nimport path from 'path'\nimport { sources } from 'next/dist/compiled/webpack/webpack'\nimport {\n getInvalidator,\n getEntries,\n EntryTypes,\n getEntryKey,\n} from '../../../server/dev/on-demand-entry-handler'\nimport {\n WEBPACK_LAYERS,\n WEBPACK_RESOURCE_QUERIES,\n} from '../../../lib/constants'\nimport {\n APP_CLIENT_INTERNALS,\n BARREL_OPTIMIZATION_PREFIX,\n COMPILER_NAMES,\n DEFAULT_RUNTIME_WEBPACK,\n EDGE_RUNTIME_WEBPACK,\n SERVER_REFERENCE_MANIFEST,\n UNDERSCORE_NOT_FOUND_ROUTE_ENTRY,\n} from '../../../shared/lib/constants'\nimport {\n isClientComponentEntryModule,\n isCSSMod,\n regexCSS,\n} from '../loaders/utils'\nimport {\n traverseModules,\n forEachEntryModule,\n formatBarrelOptimizedResource,\n getModuleReferencesInOrder,\n} from '../utils'\nimport { normalizePathSep } from '../../../shared/lib/page-path/normalize-path-sep'\nimport { getProxiedPluginState } from '../../build-context'\nimport { PAGE_TYPES } from '../../../lib/page-types'\nimport { getModuleBuildInfo } from '../loaders/get-module-build-info'\nimport { getAssumedSourceType } from '../loaders/next-flight-loader'\nimport { isAppRouteRoute } from '../../../lib/is-app-route-route'\nimport {\n DEFAULT_METADATA_ROUTE_EXTENSIONS,\n isMetadataRouteFile,\n} from '../../../lib/metadata/is-metadata-route'\nimport type { MetadataRouteLoaderOptions } from '../loaders/next-metadata-route-loader'\nimport type { FlightActionEntryLoaderActions } from '../loaders/next-flight-action-entry-loader'\nimport getWebpackBundler from '../../../shared/lib/get-webpack-bundler'\n\ninterface Options {\n dev: boolean\n appDir: string\n isEdgeServer: boolean\n encryptionKey: string\n}\n\nconst PLUGIN_NAME = 'FlightClientEntryPlugin'\n\ntype Actions = {\n [actionId: string]: {\n workers: {\n [name: string]: { moduleId: string | number; async: boolean }\n }\n // Record which layer the action is in (rsc or sc_action), in the specific entry.\n layer: {\n [name: string]: string\n }\n }\n}\n\ntype ActionIdNamePair = { id: string; exportedName: string }\n\nexport type ActionManifest = {\n // Assign a unique encryption key during production build.\n encryptionKey: string\n node: Actions\n edge: Actions\n}\n\nexport interface ModuleInfo {\n moduleId: string | number\n async: boolean\n}\n\nconst pluginState = getProxiedPluginState({\n // A map to track \"action\" -> \"list of bundles\".\n serverActions: {} as ActionManifest['node'],\n edgeServerActions: {} as ActionManifest['edge'],\n\n serverActionModules: {} as {\n [workerName: string]: { server?: ModuleInfo; client?: ModuleInfo }\n },\n\n edgeServerActionModules: {} as {\n [workerName: string]: { server?: ModuleInfo; client?: ModuleInfo }\n },\n\n ssrModules: {} as { [ssrModuleId: string]: ModuleInfo },\n edgeSsrModules: {} as { [ssrModuleId: string]: ModuleInfo },\n\n rscModules: {} as { [rscModuleId: string]: ModuleInfo },\n edgeRscModules: {} as { [rscModuleId: string]: ModuleInfo },\n\n injectedClientEntries: {} as Record<string, string>,\n})\n\nconst POSSIBLE_SHARED_CONVENTIONS = ['template', 'layout']\nconst STANDALONE_BUNDLE_CONVENTION = 'global-not-found'\n\nfunction deduplicateCSSImportsForEntry(mergedCSSimports: CssImports) {\n // If multiple entry module connections are having the same CSS import,\n // we only need to have one module to keep track of that CSS import.\n // It is based on the fact that if a page or a layout is rendered in the\n // given entry, all its parent layouts are always rendered too.\n // This can avoid duplicate CSS imports in the generated CSS manifest,\n // for example, if a page and its parent layout are both using the same\n // CSS import, we only need to have the layout to keep track of that CSS\n // import.\n // To achieve this, we need to first collect all the CSS imports from\n // every connection, and deduplicate them in the order of layers from\n // top to bottom. The implementation can be generally described as:\n // - Sort by number of `/` in the request path (the more `/`, the deeper)\n // - When in the same depth, sort by the filename (template < layout < page and others)\n\n // Sort the connections as described above.\n const sortedCSSImports = Object.entries(mergedCSSimports).sort((a, b) => {\n const [aPath] = a\n const [bPath] = b\n\n const aDepth = aPath.split('/').length\n const bDepth = bPath.split('/').length\n\n if (aDepth !== bDepth) {\n return aDepth - bDepth\n }\n\n const aName = path.parse(aPath).name\n const bName = path.parse(bPath).name\n\n const indexA = POSSIBLE_SHARED_CONVENTIONS.indexOf(aName)\n const indexB = POSSIBLE_SHARED_CONVENTIONS.indexOf(bName)\n\n if (indexA === -1) return 1\n if (indexB === -1) return -1\n return indexA - indexB\n })\n\n const dedupedCSSImports: CssImports = {}\n const trackedCSSImports = new Set<string>()\n\n for (const [entryFilePath, cssImports] of sortedCSSImports) {\n const entryConventionName = path.parse(entryFilePath).name\n\n for (const cssImport of cssImports) {\n // If the CSS import is already tracked, we can skip it.\n // Or if it's any standalone entry such as `global-not-found`, it won't share any resources with other entry, skip it.\n if (\n trackedCSSImports.has(cssImport) &&\n STANDALONE_BUNDLE_CONVENTION !== entryConventionName\n ) {\n continue\n }\n\n // Only track CSS imports that are in files that can inherit CSS.\n if (POSSIBLE_SHARED_CONVENTIONS.includes(entryConventionName)) {\n trackedCSSImports.add(cssImport)\n }\n\n if (!dedupedCSSImports[entryFilePath]) {\n dedupedCSSImports[entryFilePath] = []\n }\n dedupedCSSImports[entryFilePath].push(cssImport)\n }\n }\n\n return dedupedCSSImports\n}\n\nexport class FlightClientEntryPlugin {\n dev: boolean\n appDir: string\n encryptionKey: string\n isEdgeServer: boolean\n assetPrefix: string\n webpackRuntime: string\n\n constructor(options: Options) {\n this.dev = options.dev\n this.appDir = options.appDir\n this.isEdgeServer = options.isEdgeServer\n this.assetPrefix = !this.dev && !this.isEdgeServer ? '../' : ''\n this.encryptionKey = options.encryptionKey\n this.webpackRuntime = this.isEdgeServer\n ? EDGE_RUNTIME_WEBPACK\n : DEFAULT_RUNTIME_WEBPACK\n }\n\n apply(compiler: webpack.Compiler) {\n compiler.hooks.finishMake.tapPromise(PLUGIN_NAME, (compilation) =>\n this.createClientEntries(compiler, compilation)\n )\n\n compiler.hooks.afterCompile.tap(PLUGIN_NAME, (compilation) => {\n const recordModule = (modId: string, mod: any) => {\n // Match Resource is undefined unless an import is using the inline match resource syntax\n // https://webpack.js.org/api/loaders/#inline-matchresource\n const modPath = mod.matchResource || mod.resourceResolveData?.path\n const modQuery = mod.resourceResolveData?.query || ''\n // query is already part of mod.resource\n // so it's only necessary to add it for matchResource or mod.resourceResolveData\n const modResource = modPath\n ? modPath.startsWith(BARREL_OPTIMIZATION_PREFIX)\n ? formatBarrelOptimizedResource(mod.resource, modPath)\n : modPath + modQuery\n : mod.resource\n\n if (typeof modId !== 'undefined' && modResource) {\n if (mod.layer === WEBPACK_LAYERS.reactServerComponents) {\n const key = path\n .relative(compiler.context, modResource)\n .replace(/\\/next\\/dist\\/esm\\//, '/next/dist/')\n\n const moduleInfo: ModuleInfo = {\n moduleId: modId,\n async: compilation.moduleGraph.isAsync(mod),\n }\n\n if (this.isEdgeServer) {\n pluginState.edgeRscModules[key] = moduleInfo\n } else {\n pluginState.rscModules[key] = moduleInfo\n }\n }\n }\n\n if (mod.layer !== WEBPACK_LAYERS.serverSideRendering) {\n return\n }\n\n // Check mod resource to exclude the empty resource module like virtual module created by next-flight-client-entry-loader\n if (typeof modId !== 'undefined' && modResource) {\n // Note that this isn't that reliable as webpack is still possible to assign\n // additional queries to make sure there's no conflict even using the `named`\n // module ID strategy.\n let ssrNamedModuleId = path.relative(compiler.context, modResource)\n\n if (!ssrNamedModuleId.startsWith('.')) {\n // TODO use getModuleId instead\n ssrNamedModuleId = `./${normalizePathSep(ssrNamedModuleId)}`\n }\n\n const moduleInfo: ModuleInfo = {\n moduleId: modId,\n async: compilation.moduleGraph.isAsync(mod),\n }\n\n if (this.isEdgeServer) {\n pluginState.edgeSsrModules[\n ssrNamedModuleId.replace(/\\/next\\/dist\\/esm\\//, '/next/dist/')\n ] = moduleInfo\n } else {\n pluginState.ssrModules[ssrNamedModuleId] = moduleInfo\n }\n }\n }\n\n traverseModules(compilation, (mod, _chunk, _chunkGroup, modId) => {\n if (modId) recordModule(modId, mod)\n })\n })\n\n compiler.hooks.make.tap(PLUGIN_NAME, (compilation) => {\n compilation.hooks.processAssets.tapPromise(\n {\n name: PLUGIN_NAME,\n stage: webpack.Compilation.PROCESS_ASSETS_STAGE_OPTIMIZE_HASH,\n },\n () => this.createActionAssets(compilation)\n )\n })\n }\n\n async createClientEntries(\n compiler: webpack.Compiler,\n compilation: webpack.Compilation\n ) {\n const addClientEntryAndSSRModulesList: Array<\n ReturnType<typeof this.injectClientEntryAndSSRModules>\n > = []\n const createdSSRDependenciesForEntry: Record<\n string,\n ReturnType<typeof this.injectClientEntryAndSSRModules>[3][]\n > = {}\n\n const addActionEntryList: Array<ReturnType<typeof this.injectActionEntry>> =\n []\n const actionMapsPerEntry: Record<\n string,\n Map<string, ActionIdNamePair[]>\n > = {}\n const createdActionIds = new Set<string>()\n\n // For each SC server compilation entry, we need to create its corresponding\n // client component entry.\n forEachEntryModule(compilation, ({ name, entryModule }) => {\n const internalClientComponentEntryImports: ClientComponentImports = {}\n const actionEntryImports = new Map<string, ActionIdNamePair[]>()\n const clientEntriesToInject = []\n const mergedCSSimports: CssImports = {}\n\n for (const connection of getModuleReferencesInOrder(\n entryModule,\n compilation.moduleGraph\n )) {\n // Entry can be any user defined entry files such as layout, page, error, loading, etc.\n let entryRequest = (\n connection.dependency as unknown as webpack.NormalModule\n ).request\n\n if (entryRequest.endsWith(WEBPACK_RESOURCE_QUERIES.metadataRoute)) {\n const { filePath, isDynamicRouteExtension } =\n getMetadataRouteResource(entryRequest)\n\n if (isDynamicRouteExtension === '1') {\n entryRequest = filePath\n }\n }\n\n const { clientComponentImports, actionImports, cssImports } =\n this.collectComponentInfoFromServerEntryDependency({\n entryRequest,\n compilation,\n resolvedModule: connection.resolvedModule,\n })\n\n actionImports.forEach(([dep, actions]) =>\n actionEntryImports.set(dep, actions)\n )\n\n const isAbsoluteRequest = path.isAbsolute(entryRequest)\n\n // Next.js internals are put into a separate entry.\n if (!isAbsoluteRequest) {\n Object.keys(clientComponentImports).forEach(\n (value) => (internalClientComponentEntryImports[value] = new Set())\n )\n continue\n }\n\n // TODO-APP: Enable these lines. This ensures no entrypoint is created for layout/page when there are no client components.\n // Currently disabled because it causes test failures in CI.\n // if (clientImports.length === 0 && actionImports.length === 0) {\n // continue\n // }\n\n const relativeRequest = isAbsoluteRequest\n ? path.relative(compilation.options.context!, entryRequest)\n : entryRequest\n\n // Replace file suffix as `.js` will be added.\n // bundlePath will have app/ prefix but not src/.\n // e.g. src/app/foo/page.js -> app/foo/page\n let bundlePath = normalizePathSep(\n relativeRequest.replace(/\\.[^.\\\\/]+$/, '').replace(/^src[\\\\/]/, '')\n )\n\n // For metadata routes, the entry name can be used as the bundle path,\n // as it has been normalized already.\n // e.g.\n // When `relativeRequest` is 'src/app/sitemap.js',\n // `appDirRelativeRequest` will be '/sitemap.js'\n // then `isMetadataEntryFile` will be `true`\n const appDirRelativeRequest = relativeRequest\n .replace(/^src[\\\\/]/, '')\n .replace(/^app[\\\\/]/, '/')\n const isMetadataEntryFile = isMetadataRouteFile(\n appDirRelativeRequest,\n DEFAULT_METADATA_ROUTE_EXTENSIONS,\n true\n )\n if (isMetadataEntryFile) {\n bundlePath = name\n }\n\n Object.assign(mergedCSSimports, cssImports)\n clientEntriesToInject.push({\n compiler,\n compilation,\n entryName: name,\n clientComponentImports,\n bundlePath,\n absolutePagePath: entryRequest,\n })\n\n // The webpack implementation of writing the client reference manifest relies on all entrypoints writing a page.js even when there is no client components in the page.\n // It needs the file in order to write the reference manifest for the path in the `.next/server` folder.\n // TODO-APP: This could be better handled, however Turbopack does not have the same problem as we resolve client components in a single graph.\n if (\n name === `app${UNDERSCORE_NOT_FOUND_ROUTE_ENTRY}` &&\n bundlePath === 'app/not-found'\n ) {\n clientEntriesToInject.push({\n compiler,\n compilation,\n entryName: name,\n clientComponentImports: {},\n bundlePath: `app${UNDERSCORE_NOT_FOUND_ROUTE_ENTRY}`,\n absolutePagePath: entryRequest,\n })\n }\n\n if (\n name === `app${UNDERSCORE_NOT_FOUND_ROUTE_ENTRY}` &&\n bundlePath === 'app/global-not-found'\n ) {\n clientEntriesToInject.push({\n compiler,\n compilation,\n entryName: name,\n clientComponentImports,\n bundlePath: `app${UNDERSCORE_NOT_FOUND_ROUTE_ENTRY}`,\n absolutePagePath: entryRequest,\n })\n }\n }\n\n // Make sure CSS imports are deduplicated before injecting the client entry\n // and SSR modules.\n const dedupedCSSImports = deduplicateCSSImportsForEntry(mergedCSSimports)\n for (const clientEntryToInject of clientEntriesToInject) {\n const injected = this.injectClientEntryAndSSRModules({\n ...clientEntryToInject,\n clientImports: {\n ...clientEntryToInject.clientComponentImports,\n ...(\n dedupedCSSImports[clientEntryToInject.absolutePagePath] || []\n ).reduce<ClientComponentImports>((res, curr) => {\n res[curr] = new Set()\n return res\n }, {}),\n },\n })\n\n // Track all created SSR dependencies for each entry from the server layer.\n if (!createdSSRDependenciesForEntry[clientEntryToInject.entryName]) {\n createdSSRDependenciesForEntry[clientEntryToInject.entryName] = []\n }\n createdSSRDependenciesForEntry[clientEntryToInject.entryName].push(\n injected[3]\n )\n\n addClientEntryAndSSRModulesList.push(injected)\n }\n\n if (!isAppRouteRoute(name)) {\n // Create internal app\n addClientEntryAndSSRModulesList.push(\n this.injectClientEntryAndSSRModules({\n compiler,\n compilation,\n entryName: name,\n clientImports: { ...internalClientComponentEntryImports },\n bundlePath: APP_CLIENT_INTERNALS,\n })\n )\n }\n\n if (actionEntryImports.size > 0) {\n if (!actionMapsPerEntry[name]) {\n actionMapsPerEntry[name] = new Map()\n }\n actionMapsPerEntry[name] = new Map([\n ...actionMapsPerEntry[name],\n ...actionEntryImports,\n ])\n }\n })\n\n for (const [name, actionEntryImports] of Object.entries(\n actionMapsPerEntry\n )) {\n addActionEntryList.push(\n this.injectActionEntry({\n compiler,\n compilation,\n actions: actionEntryImports,\n entryName: name,\n bundlePath: name,\n createdActionIds,\n })\n )\n }\n\n // Invalidate in development to trigger recompilation\n const invalidator = getInvalidator(compiler.outputPath)\n // Check if any of the entry injections need an invalidation\n if (\n invalidator &&\n addClientEntryAndSSRModulesList.some(\n ([shouldInvalidate]) => shouldInvalidate === true\n )\n ) {\n invalidator.invalidate([COMPILER_NAMES.client])\n }\n\n // Client compiler is invalidated before awaiting the compilation of the SSR\n // and RSC client component entries so that the client compiler is running\n // in parallel to the server compiler.\n await Promise.all(\n addClientEntryAndSSRModulesList.flatMap((addClientEntryAndSSRModules) => [\n addClientEntryAndSSRModules[1],\n addClientEntryAndSSRModules[2],\n ])\n )\n\n // Wait for action entries to be added.\n await Promise.all(addActionEntryList)\n\n const addedClientActionEntryList: Promise<any>[] = []\n const actionMapsPerClientEntry: Record<\n string,\n Map<string, ActionIdNamePair[]>\n > = {}\n\n // We need to create extra action entries that are created from the\n // client layer.\n // Start from each entry's created SSR dependency from our previous step.\n for (const [name, ssrEntryDependencies] of Object.entries(\n createdSSRDependenciesForEntry\n )) {\n // Collect from all entries, e.g. layout.js, page.js, loading.js, ...\n // add aggregate them.\n const actionEntryImports = this.collectClientActionsFromDependencies({\n compilation,\n dependencies: ssrEntryDependencies,\n })\n\n if (actionEntryImports.size > 0) {\n if (!actionMapsPerClientEntry[name]) {\n actionMapsPerClientEntry[name] = new Map()\n }\n actionMapsPerClientEntry[name] = new Map([\n ...actionMapsPerClientEntry[name],\n ...actionEntryImports,\n ])\n }\n }\n\n for (const [entryName, actionEntryImports] of Object.entries(\n actionMapsPerClientEntry\n )) {\n // If an action method is already created in the server layer, we don't\n // need to create it again in the action layer.\n // This is to avoid duplicate action instances and make sure the module\n // state is shared.\n let remainingClientImportedActions = false\n const remainingActionEntryImports = new Map<string, ActionIdNamePair[]>()\n for (const [dep, actions] of actionEntryImports) {\n const remainingActionNames = []\n for (const action of actions) {\n if (!createdActionIds.has(entryName + '@' + action.id)) {\n remainingActionNames.push(action)\n }\n }\n if (remainingActionNames.length > 0) {\n remainingActionEntryImports.set(dep, remainingActionNames)\n remainingClientImportedActions = true\n }\n }\n\n if (remainingClientImportedActions) {\n addedClientActionEntryList.push(\n this.injectActionEntry({\n compiler,\n compilation,\n actions: remainingActionEntryImports,\n entryName,\n bundlePath: entryName,\n fromClient: true,\n createdActionIds,\n })\n )\n }\n }\n\n await Promise.all(addedClientActionEntryList)\n }\n\n collectClientActionsFromDependencies({\n compilation,\n dependencies,\n }: {\n compilation: webpack.Compilation\n dependencies: ReturnType<typeof webpack.EntryPlugin.createDependency>[]\n }) {\n // action file path -> action names\n const collectedActions = new Map<string, ActionIdNamePair[]>()\n\n // Keep track of checked modules to avoid infinite loops with recursive imports.\n const visitedModule = new Set<string>()\n const visitedEntry = new Set<string>()\n\n const collectActions = ({\n entryRequest,\n resolvedModule,\n }: {\n entryRequest: string\n resolvedModule: any\n }) => {\n const collectActionsInDep = (mod: webpack.NormalModule): void => {\n if (!mod) return\n\n const modResource = getModuleResource(mod)\n\n if (!modResource) return\n\n if (visitedModule.has(modResource)) return\n visitedModule.add(modResource)\n\n const actionIds = getModuleBuildInfo(mod).rsc?.actionIds\n if (actionIds) {\n collectedActions.set(\n modResource,\n Object.entries(actionIds).map(([id, exportedName]) => ({\n id,\n exportedName,\n }))\n )\n }\n\n // Collect used exported actions transversely.\n getModuleReferencesInOrder(mod, compilation.moduleGraph).forEach(\n (connection: any) => {\n collectActionsInDep(\n connection.resolvedModule as webpack.NormalModule\n )\n }\n )\n }\n\n // Don't traverse the module graph anymore once hitting the action layer.\n if (\n entryRequest &&\n !entryRequest.includes('next-flight-action-entry-loader')\n ) {\n // Traverse the module graph to find all client components.\n collectActionsInDep(resolvedModule)\n }\n }\n\n for (const entryDependency of dependencies) {\n const ssrEntryModule =\n compilation.moduleGraph.getResolvedModule(entryDependency)!\n for (const connection of getModuleReferencesInOrder(\n ssrEntryModule,\n compilation.moduleGraph\n )) {\n const depModule = connection.dependency\n const request = (depModule as unknown as webpack.NormalModule).request\n\n // It is possible that the same entry is added multiple times in the\n // connection graph. We can just skip these to speed up the process.\n if (visitedEntry.has(request)) continue\n visitedEntry.add(request)\n\n collectActions({\n entryRequest: request,\n resolvedModule: connection.resolvedModule,\n })\n }\n }\n\n return collectedActions\n }\n\n collectComponentInfoFromServerEntryDependency({\n entryRequest,\n compilation,\n resolvedModule,\n }: {\n entryRequest: string\n compilation: webpack.Compilation\n resolvedModule: any /* Dependency */\n }): {\n cssImports: CssImports\n clientComponentImports: ClientComponentImports\n actionImports: [string, ActionIdNamePair[]][]\n } {\n // Keep track of checked modules to avoid infinite loops with recursive imports.\n const visitedOfClientComponentsTraverse = new Set()\n\n // Info to collect.\n const clientComponentImports: ClientComponentImports = {}\n const actionImports: [string, ActionIdNamePair[]][] = []\n const CSSImports = new Set<string>()\n\n const filterClientComponents = (\n mod: webpack.NormalModule,\n importedIdentifiers: string[]\n ): void => {\n if (!mod) return\n\n const modResource = getModuleResource(mod)\n\n if (!modResource) return\n if (visitedOfClientComponentsTraverse.has(modResource)) {\n if (clientComponentImports[modResource]) {\n addClientImport(\n mod,\n modResource,\n clientComponentImports,\n importedIdentifiers,\n false\n )\n }\n return\n }\n visitedOfClientComponentsTraverse.add(modResource)\n\n const actionIds = getModuleBuildInfo(mod).rsc?.actionIds\n if (actionIds) {\n actionImports.push([\n modResource,\n Object.entries(actionIds).map(([id, exportedName]) => ({\n id,\n exportedName,\n })),\n ])\n }\n\n if (isCSSMod(mod)) {\n const sideEffectFree =\n mod.factoryMeta && (mod.factoryMeta as any).sideEffectFree\n\n if (sideEffectFree) {\n const unused = !compilation.moduleGraph\n .getExportsInfo(mod)\n .isModuleUsed(this.webpackRuntime)\n\n if (unused) return\n }\n\n CSSImports.add(modResource)\n } else if (isClientComponentEntryModule(mod)) {\n if (!clientComponentImports[modResource]) {\n clientComponentImports[modResource] = new Set()\n }\n addClientImport(\n mod,\n modResource,\n clientComponentImports,\n importedIdentifiers,\n true\n )\n\n return\n }\n\n getModuleReferencesInOrder(mod, compilation.moduleGraph).forEach(\n (connection: any) => {\n let dependencyIds: string[] = []\n\n // `ids` are the identifiers that are imported from the dependency,\n // if it's present, it's an array of strings.\n if (connection.dependency?.ids) {\n dependencyIds.push(...connection.dependency.ids)\n } else {\n dependencyIds = ['*']\n }\n\n filterClientComponents(connection.resolvedModule, dependencyIds)\n }\n )\n }\n\n // Traverse the module graph to find all client components.\n filterClientComponents(resolvedModule, [])\n\n return {\n clientComponentImports,\n cssImports: CSSImports.size\n ? {\n [entryRequest]: Array.from(CSSImports),\n }\n : {},\n actionImports,\n }\n }\n\n injectClientEntryAndSSRModules({\n compiler,\n compilation,\n entryName,\n clientImports,\n bundlePath,\n absolutePagePath,\n }: {\n compiler: webpack.Compiler\n compilation: webpack.Compilation\n entryName: string\n clientImports: ClientComponentImports\n bundlePath: string\n absolutePagePath?: string\n }): [\n shouldInvalidate: boolean,\n addSSREntryPromise: Promise<void>,\n addRSCEntryPromise: Promise<void>,\n ssrDep: ReturnType<typeof webpack.EntryPlugin.createDependency>,\n ] {\n const bundler = getWebpackBundler()\n let shouldInvalidate = false\n\n const modules = Object.keys(clientImports)\n .sort((a, b) => (regexCSS.test(b) ? 1 : a.localeCompare(b)))\n .map((clientImportPath) => ({\n request: clientImportPath,\n ids: [...clientImports[clientImportPath]],\n }))\n\n // For the client entry, we always use the CJS build of Next.js. If the\n // server is using the ESM build (when using the Edge runtime), we need to\n // replace them.\n const clientBrowserLoader = `next-flight-client-entry-loader?${stringify({\n modules: (this.isEdgeServer\n ? modules.map(({ request, ids }) => ({\n request: request.replace(\n /[\\\\/]next[\\\\/]dist[\\\\/]esm[\\\\/]/,\n '/next/dist/'.replace(/\\//g, path.sep)\n ),\n ids,\n }))\n : modules\n ).map((x) => JSON.stringify(x)),\n server: false,\n })}!`\n\n const clientServerLoader = `next-flight-client-entry-loader?${stringify({\n modules: modules.map((x) => JSON.stringify(x)),\n server: true,\n })}!`\n\n // Add for the client compilation\n // Inject the entry to the client compiler.\n if (this.dev) {\n const entries = getEntries(compiler.outputPath)\n const pageKey = getEntryKey(\n COMPILER_NAMES.client,\n PAGE_TYPES.APP,\n bundlePath\n )\n\n if (!entries[pageKey]) {\n entries[pageKey] = {\n type: EntryTypes.CHILD_ENTRY,\n parentEntries: new Set([entryName]),\n absoluteEntryFilePath: absolutePagePath,\n bundlePath,\n request: clientBrowserLoader,\n dispose: false,\n lastActiveTime: Date.now(),\n }\n shouldInvalidate = true\n } else {\n const entryData = entries[pageKey]\n // New version of the client loader\n if (entryData.request !== clientBrowserLoader) {\n entryData.request = clientBrowserLoader\n shouldInvalidate = true\n }\n if (entryData.type === EntryTypes.CHILD_ENTRY) {\n entryData.parentEntries.add(entryName)\n }\n entryData.dispose = false\n entryData.lastActiveTime = Date.now()\n }\n } else {\n pluginState.injectedClientEntries[bundlePath] = clientBrowserLoader\n }\n\n const clientComponentSSREntryDep = bundler.EntryPlugin.createDependency(\n clientServerLoader,\n { name: bundlePath }\n )\n\n const clientComponentRSCEntryDep = bundler.EntryPlugin.createDependency(\n clientServerLoader,\n { name: bundlePath }\n )\n\n return [\n shouldInvalidate,\n // Add the entries to the server compiler for the SSR and RSC layers. The\n // promises are awaited later using `Promise.all` in order to parallelize\n // adding the entries.\n this.addEntry(compilation, compiler.context, clientComponentSSREntryDep, {\n name: entryName,\n layer: WEBPACK_LAYERS.serverSideRendering,\n }),\n this.addEntry(compilation, compiler.context, clientComponentRSCEntryDep, {\n name: entryName,\n layer: WEBPACK_LAYERS.reactServerComponents,\n }),\n clientComponentSSREntryDep,\n ]\n }\n\n injectActionEntry({\n compiler,\n compilation,\n actions,\n entryName,\n bundlePath,\n fromClient,\n createdActionIds,\n }: {\n compiler: webpack.Compiler\n compilation: webpack.Compilation\n actions: Map<string, ActionIdNamePair[]>\n entryName: string\n bundlePath: string\n createdActionIds: Set<string>\n fromClient?: boolean\n }) {\n const bundler = getWebpackBundler()\n const actionsArray = Array.from(actions.entries())\n for (const [, actionsFromModule] of actions) {\n for (const { id } of actionsFromModule) {\n createdActionIds.add(entryName + '@' + id)\n }\n }\n\n if (actionsArray.length === 0) {\n return Promise.resolve()\n }\n\n const actionLoader = `next-flight-action-entry-loader?${stringify({\n actions: JSON.stringify(\n actionsArray satisfies FlightActionEntryLoaderActions\n ),\n __client_imported__: fromClient,\n })}!`\n\n const currentCompilerServerActions = this.isEdgeServer\n ? pluginState.edgeServerActions\n : pluginState.serverActions\n\n for (const [, actionsFromModule] of actionsArray) {\n for (const { id } of actionsFromModule) {\n if (typeof currentCompilerServerActions[id] === 'undefined') {\n currentCompilerServerActions[id] = {\n workers: {},\n layer: {},\n }\n }\n currentCompilerServerActions[id].workers[bundlePath] = {\n moduleId: '', // TODO: What's the meaning of this?\n async: false,\n }\n\n currentCompilerServerActions[id].layer[bundlePath] = fromClient\n ? WEBPACK_LAYERS.actionBrowser\n : WEBPACK_LAYERS.reactServerComponents\n }\n }\n\n // Inject the entry to the server compiler\n const actionEntryDep = bundler.EntryPlugin.createDependency(actionLoader, {\n name: bundlePath,\n })\n\n return this.addEntry(\n compilation,\n // Reuse compilation context.\n compiler.context,\n actionEntryDep,\n {\n name: entryName,\n layer: fromClient\n ? WEBPACK_LAYERS.actionBrowser\n : WEBPACK_LAYERS.reactServerComponents,\n }\n )\n }\n\n addEntry(\n compilation: webpack.Compilation,\n context: string,\n dependency: webpack.Dependency,\n options: webpack.EntryOptions\n ): Promise<any> /* Promise<module> */ {\n return new Promise((resolve, reject) => {\n if ('rspack' in compilation.compiler) {\n compilation.addInclude(context, dependency, options, (err, module) => {\n if (err) {\n return reject(err)\n }\n\n compilation.moduleGraph\n .getExportsInfo(module!)\n .setUsedInUnknownWay(\n this.isEdgeServer ? EDGE_RUNTIME_WEBPACK : DEFAULT_RUNTIME_WEBPACK\n )\n return resolve(module)\n })\n } else {\n const entry = compilation.entries.get(options.name!)!\n entry.includeDependencies.push(dependency)\n compilation.hooks.addEntry.call(entry as any, options)\n compilation.addModuleTree(\n {\n context,\n dependency,\n contextInfo: { issuerLayer: options.layer },\n },\n (err: any, module: any) => {\n if (err) {\n compilation.hooks.failedEntry.call(dependency, options, err)\n return reject(err)\n }\n\n compilation.hooks.succeedEntry.call(dependency, options, module)\n\n compilation.moduleGraph\n .getExportsInfo(module)\n .setUsedInUnknownWay(\n this.isEdgeServer\n ? EDGE_RUNTIME_WEBPACK\n : DEFAULT_RUNTIME_WEBPACK\n )\n\n return resolve(module)\n }\n )\n }\n })\n }\n\n async createActionAssets(compilation: webpack.Compilation) {\n const serverActions: ActionManifest['node'] = {}\n const edgeServerActions: ActionManifest['edge'] = {}\n\n traverseModules(compilation, (mod, _chunk, chunkGroup, modId) => {\n // Go through all action entries and record the module ID for each entry.\n if (\n chunkGroup.name &&\n mod.request &&\n modId &&\n /next-flight-action-entry-loader/.test(mod.request)\n ) {\n const fromClient = /&__client_imported__=true/.test(mod.request)\n\n const mapping = this.isEdgeServer\n ? pluginState.edgeServerActionModules\n : pluginState.serverActionModules\n\n if (!mapping[chunkGroup.name]) {\n mapping[chunkGroup.name] = {}\n }\n mapping[chunkGroup.name][fromClient ? 'client' : 'server'] = {\n moduleId: modId,\n async: compilation.moduleGraph.isAsync(mod),\n }\n }\n })\n\n for (let id in pluginState.serverActions) {\n const action = pluginState.serverActions[id]\n for (let name in action.workers) {\n const modId =\n pluginState.serverActionModules[name][\n action.layer[name] === WEBPACK_LAYERS.actionBrowser\n ? 'client'\n : 'server'\n ]\n action.workers[name] = modId!\n }\n serverActions[id] = action\n }\n\n for (let id in pluginState.edgeServerActions) {\n const action = pluginState.edgeServerActions[id]\n for (let name in action.workers) {\n const modId =\n pluginState.edgeServerActionModules[name][\n action.layer[name] === WEBPACK_LAYERS.actionBrowser\n ? 'client'\n : 'server'\n ]\n action.workers[name] = modId!\n }\n edgeServerActions[id] = action\n }\n\n const serverManifest = {\n node: serverActions,\n edge: edgeServerActions,\n encryptionKey: this.encryptionKey,\n }\n const edgeServerManifest = {\n ...serverManifest,\n encryptionKey: 'process.env.NEXT_SERVER_ACTIONS_ENCRYPTION_KEY',\n }\n\n const json = JSON.stringify(serverManifest, null, this.dev ? 2 : undefined)\n const edgeJson = JSON.stringify(\n edgeServerManifest,\n null,\n this.dev ? 2 : undefined\n )\n\n compilation.emitAsset(\n `${this.assetPrefix}${SERVER_REFERENCE_MANIFEST}.js`,\n new sources.RawSource(\n `self.__RSC_SERVER_MANIFEST=${JSON.stringify(edgeJson)}`\n ) as unknown as webpack.sources.RawSource\n )\n compilation.emitAsset(\n `${this.assetPrefix}${SERVER_REFERENCE_MANIFEST}.json`,\n new sources.RawSource(json) as unknown as webpack.sources.RawSource\n )\n }\n}\n\nfunction addClientImport(\n mod: webpack.NormalModule,\n modRequest: string,\n clientComponentImports: ClientComponentImports,\n importedIdentifiers: string[],\n isFirstVisitModule: boolean\n) {\n const clientEntryType = getModuleBuildInfo(mod).rsc?.clientEntryType\n const isCjsModule = clientEntryType === 'cjs'\n const assumedSourceType = getAssumedSourceType(\n mod,\n isCjsModule ? 'commonjs' : 'auto'\n )\n\n const clientImportsSet = clientComponentImports[modRequest]\n\n if (importedIdentifiers[0] === '*') {\n // If there's collected import path with named import identifiers,\n // or there's nothing in collected imports are empty.\n // we should include the whole module.\n if (!isFirstVisitModule && [...clientImportsSet][0] !== '*') {\n clientComponentImports[modRequest] = new Set(['*'])\n }\n } else {\n const isAutoModuleSourceType = assumedSourceType === 'auto'\n if (isAutoModuleSourceType) {\n clientComponentImports[modRequest] = new Set(['*'])\n } else {\n // If it's not analyzed as named ESM exports, e.g. if it's mixing `export *` with named exports,\n // We'll include all modules since it's not able to do tree-shaking.\n for (const name of importedIdentifiers) {\n // For cjs module default import, we include the whole module since\n const isCjsDefaultImport = isCjsModule && name === 'default'\n\n // Always include __esModule along with cjs module default export,\n // to make sure it work with client module proxy from React.\n if (isCjsDefaultImport) {\n clientComponentImports[modRequest].add('__esModule')\n }\n\n clientComponentImports[modRequest].add(name)\n }\n }\n }\n}\n\nfunction getModuleResource(mod: webpack.NormalModule): string {\n const modPath: string = mod.resourceResolveData?.path || ''\n const modQuery = mod.resourceResolveData?.query || ''\n // We have to always use the resolved request here to make sure the\n // server and client are using the same module path (required by RSC), as\n // the server compiler and client compiler have different resolve configs.\n let modResource: string = modPath + modQuery\n\n // Context modules don't have a resource path, we use the identifier instead.\n if (mod.constructor.name === 'ContextModule') {\n modResource = mod.identifier()\n }\n\n // For the barrel optimization, we need to use the match resource instead\n // because there will be 2 modules for the same file (same resource path)\n // but they're different modules and can't be deduped via `visitedModule`.\n // The first module is a virtual re-export module created by the loader.\n if (mod.matchResource?.startsWith(BARREL_OPTIMIZATION_PREFIX)) {\n modResource = mod.matchResource + ':' + modResource\n }\n\n if (mod.resource === `?${WEBPACK_RESOURCE_QUERIES.metadataRoute}`) {\n return getMetadataRouteResource(mod.rawRequest).filePath\n }\n\n return modResource\n}\n\nfunction getMetadataRouteResource(request: string): MetadataRouteLoaderOptions {\n // e.g. next-metadata-route-loader?filePath=<some-url-encoded-path>&isDynamicRouteExtension=1!?__next_metadata_route__\n const query = request.split('!')[0].split('next-metadata-route-loader?')[1]\n\n return parse(query) as MetadataRouteLoaderOptions\n}\n"],"names":["webpack","parse","stringify","path","sources","getInvalidator","getEntries","EntryTypes","getEntryKey","WEBPACK_LAYERS","WEBPACK_RESOURCE_QUERIES","APP_CLIENT_INTERNALS","BARREL_OPTIMIZATION_PREFIX","COMPILER_NAMES","DEFAULT_RUNTIME_WEBPACK","EDGE_RUNTIME_WEBPACK","SERVER_REFERENCE_MANIFEST","UNDERSCORE_NOT_FOUND_ROUTE_ENTRY","isClientComponentEntryModule","isCSSMod","regexCSS","traverseModules","forEachEntryModule","formatBarrelOptimizedResource","getModuleReferencesInOrder","normalizePathSep","getProxiedPluginState","PAGE_TYPES","getModuleBuildInfo","getAssumedSourceType","isAppRouteRoute","DEFAULT_METADATA_ROUTE_EXTENSIONS","isMetadataRouteFile","getWebpackBundler","PLUGIN_NAME","pluginState","serverActions","edgeServerActions","serverActionModules","edgeServerActionModules","ssrModules","edgeSsrModules","rscModules","edgeRscModules","injectedClientEntries","POSSIBLE_SHARED_CONVENTIONS","STANDALONE_BUNDLE_CONVENTION","deduplicateCSSImportsForEntry","mergedCSSimports","sortedCSSImports","Object","entries","sort","a","b","aPath","bPath","aDepth","split","length","bDepth","aName","name","bName","indexA","indexOf","indexB","dedupedCSSImports","trackedCSSImports","Set","entryFilePath","cssImports","entryConventionName","cssImport","has","includes","add","push","FlightClientEntryPlugin","constructor","options","dev","appDir","isEdgeServer","assetPrefix","encryptionKey","webpackRuntime","apply","compiler","hooks","finishMake","tapPromise","compilation","createClientEntries","afterCompile","tap","recordModule","modId","mod","modPath","matchResource","resourceResolveData","modQuery","query","modResource","startsWith","resource","layer","reactServerComponents","key","relative","context","replace","moduleInfo","moduleId","async","moduleGraph","isAsync","serverSideRendering","ssrNamedModuleId","_chunk","_chunkGroup","make","processAssets","stage","Compilation","PROCESS_ASSETS_STAGE_OPTIMIZE_HASH","createActionAssets","addClientEntryAndSSRModulesList","createdSSRDependenciesForEntry","addActionEntryList","actionMapsPerEntry","createdActionIds","entryModule","internalClientComponentEntryImports","actionEntryImports","Map","clientEntriesToInject","connection","entryRequest","dependency","request","endsWith","metadataRoute","filePath","isDynamicRouteExtension","getMetadataRouteResource","clientComponentImports","actionImports","collectComponentInfoFromServerEntryDependency","resolvedModule","forEach","dep","actions","set","isAbsoluteRequest","isAbsolute","keys","value","relativeRequest","bundlePath","appDirRelativeRequest","isMetadataEntryFile","assign","entryName","absolutePagePath","clientEntryToInject","injected","injectClientEntryAndSSRModules","clientImports","reduce","res","curr","size","injectActionEntry","invalidator","outputPath","some","shouldInvalidate","invalidate","client","Promise","all","flatMap","addClientEntryAndSSRModules","addedClientActionEntryList","actionMapsPerClientEntry","ssrEntryDependencies","collectClientActionsFromDependencies","dependencies","remainingClientImportedActions","remainingActionEntryImports","remainingActionNames","action","id","fromClient","collectedActions","visitedModule","visitedEntry","collectActions","collectActionsInDep","getModuleResource","actionIds","rsc","map","exportedName","entryDependency","ssrEntryModule","getResolvedModule","depModule","visitedOfClientComponentsTraverse","CSSImports","filterClientComponents","importedIdentifiers","addClientImport","sideEffectFree","factoryMeta","unused","getExportsInfo","isModuleUsed","dependencyIds","ids","Array","from","bundler","modules","test","localeCompare","clientImportPath","clientBrowserLoader","sep","x","JSON","server","clientServerLoader","pageKey","APP","type","CHILD_ENTRY","parentEntries","absoluteEntryFilePath","dispose","lastActiveTime","Date","now","entryData","clientComponentSSREntryDep","EntryPlugin","createDependency","clientComponentRSCEntryDep","addEntry","actionsArray","actionsFromModule","resolve","actionLoader","__client_imported__","currentCompilerServerActions","workers","actionBrowser","actionEntryDep","reject","addInclude","err","module","setUsedInUnknownWay","entry","get","includeDependencies","call","addModuleTree","contextInfo","issuerLayer","failedEntry","succeedEntry","chunkGroup","mapping","serverManifest","node","edge","edgeServerManifest","json","undefined","edgeJson","emitAsset","RawSource","modRequest","isFirstVisitModule","clientEntryType","isCjsModule","assumedSourceType","clientImportsSet","isAutoModuleSourceType","isCjsDefaultImport","identifier","rawRequest"],"mappings":"AAKA,SAASA,OAAO,QAAQ,qCAAoC;AAC5D,SAASC,KAAK,EAAEC,SAAS,QAAQ,cAAa;AAC9C,OAAOC,UAAU,OAAM;AACvB,SAASC,OAAO,QAAQ,qCAAoC;AAC5D,SACEC,cAAc,EACdC,UAAU,EACVC,UAAU,EACVC,WAAW,QACN,8CAA6C;AACpD,SACEC,cAAc,EACdC,wBAAwB,QACnB,yBAAwB;AAC/B,SACEC,oBAAoB,EACpBC,0BAA0B,EAC1BC,cAAc,EACdC,uBAAuB,EACvBC,oBAAoB,EACpBC,yBAAyB,EACzBC,gCAAgC,QAC3B,gCAA+B;AACtC,SACEC,4BAA4B,EAC5BC,QAAQ,EACRC,QAAQ,QACH,mBAAkB;AACzB,SACEC,eAAe,EACfC,kBAAkB,EAClBC,6BAA6B,EAC7BC,0BAA0B,QACrB,WAAU;AACjB,SAASC,gBAAgB,QAAQ,mDAAkD;AACnF,SAASC,qBAAqB,QAAQ,sBAAqB;AAC3D,SAASC,UAAU,QAAQ,0BAAyB;AACpD,SAASC,kBAAkB,QAAQ,mCAAkC;AACrE,SAASC,oBAAoB,QAAQ,gCAA+B;AACpE,SAASC,eAAe,QAAQ,kCAAiC;AACjE,SACEC,iCAAiC,EACjCC,mBAAmB,Q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Id, encryptionKey
|
|
1576
1576
|
isClient && new CopyFilePlugin({
|
1577
1577
|
// file path to build output of `@next/polyfill-nomodule`
|
1578
1578
|
filePath: require.resolve('./polyfills/polyfill-nomodule'),
|
1579
|
-
cacheKey: "15.4.0-canary.
|
1579
|
+
cacheKey: "15.4.0-canary.65",
|
1580
1580
|
name: `static/chunks/polyfills${dev ? '' : '-[hash]'}.js`,
|
1581
1581
|
minimize: false,
|
1582
1582
|
info: {
|
@@ -1756,7 +1756,7 @@ export default async function getBaseWebpackConfig(dir, { buildId, encryptionKey
|
|
1756
1756
|
// - Next.js location on disk (some loaders use absolute paths and some resolve options depend on absolute paths)
|
1757
1757
|
// - Next.js version
|
1758
1758
|
// - next.config.js keys that affect compilation
|
1759
|
-
version: `${__dirname}|${"15.4.0-canary.
|
1759
|
+
version: `${__dirname}|${"15.4.0-canary.65"}|${configVars}`,
|
1760
1760
|
cacheDirectory: path.join(distDir, 'cache', 'webpack'),
|
1761
1761
|
// For production builds, it's more efficient to compress all cache files together instead of compression each one individually.
|
1762
1762
|
// So we disable compression here and allow the build runner to take care of compressing the cache as a whole.
|
package/dist/esm/client/components/react-dev-overlay/pages/pages-dev-overlay-error-boundary.js
CHANGED
@@ -5,11 +5,6 @@ export class PagesDevOverlayErrorBoundary extends React.PureComponent {
|
|
5
5
|
error
|
6
6
|
};
|
7
7
|
}
|
8
|
-
componentDidCatch(error) {
|
9
|
-
this.setState({
|
10
|
-
error
|
11
|
-
});
|
12
|
-
}
|
13
8
|
// Explicit type is needed to avoid the generated `.d.ts` having a wide return type that could be specific to the `@types/react` version.
|
14
9
|
render() {
|
15
10
|
// The component has to be unmounted or else it would continue to error
|
package/dist/esm/client/components/react-dev-overlay/pages/pages-dev-overlay-error-boundary.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../../../src/client/components/react-dev-overlay/pages/pages-dev-overlay-error-boundary.tsx"],"sourcesContent":["import React from 'react'\n\ntype PagesDevOverlayErrorBoundaryProps = {\n children?: React.ReactNode\n}\ntype PagesDevOverlayErrorBoundaryState = { error: Error | null }\n\nexport class PagesDevOverlayErrorBoundary extends React.PureComponent<\n PagesDevOverlayErrorBoundaryProps,\n PagesDevOverlayErrorBoundaryState\n> {\n state = { error: null }\n\n static getDerivedStateFromError(error: Error) {\n return { error }\n }\n\n
|
1
|
+
{"version":3,"sources":["../../../../../src/client/components/react-dev-overlay/pages/pages-dev-overlay-error-boundary.tsx"],"sourcesContent":["import React from 'react'\n\ntype PagesDevOverlayErrorBoundaryProps = {\n children?: React.ReactNode\n}\ntype PagesDevOverlayErrorBoundaryState = { error: Error | null }\n\nexport class PagesDevOverlayErrorBoundary extends React.PureComponent<\n PagesDevOverlayErrorBoundaryProps,\n PagesDevOverlayErrorBoundaryState\n> {\n state = { error: null }\n\n static getDerivedStateFromError(error: Error) {\n return { error }\n }\n\n // Explicit type is needed to avoid the generated `.d.ts` having a wide return type that could be specific to the `@types/react` version.\n render(): React.ReactNode {\n // The component has to be unmounted or else it would continue to error\n return this.state.error ? null : this.props.children\n }\n}\n"],"names":["React","PagesDevOverlayErrorBoundary","PureComponent","getDerivedStateFromError","error","render","state","props","children"],"mappings":"AAAA,OAAOA,WAAW,QAAO;AAOzB,OAAO,MAAMC,qCAAqCD,MAAME,aAAa;IAMnE,OAAOC,yBAAyBC,KAAY,EAAE;QAC5C,OAAO;YAAEA;QAAM;IACjB;IAEA,yIAAyI;IACzIC,SAA0B;QACxB,uEAAuE;QACvE,OAAO,IAAI,CAACC,KAAK,CAACF,KAAK,GAAG,OAAO,IAAI,CAACG,KAAK,CAACC,QAAQ;IACtD;;QAdK,qBAILF,QAAQ;YAAEF,OAAO;QAAK;;AAWxB","ignoreList":[0]}
|
@@ -10,7 +10,7 @@ export function PagesDevOverlay(param) {
|
|
10
10
|
return /*#__PURE__*/ _jsxs(_Fragment, {
|
11
11
|
children: [
|
12
12
|
/*#__PURE__*/ _jsx(PagesDevOverlayErrorBoundary, {
|
13
|
-
children: children
|
13
|
+
children: children
|
14
14
|
}),
|
15
15
|
/*#__PURE__*/ _jsx(FontStyles, {}),
|
16
16
|
/*#__PURE__*/ _jsx(DevOverlay, {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../../../src/client/components/react-dev-overlay/pages/pages-dev-overlay.tsx"],"sourcesContent":["import { PagesDevOverlayErrorBoundary } from './pages-dev-overlay-error-boundary'\nimport { usePagesDevOverlay } from './hooks'\nimport { FontStyles } from '../font/font-styles'\nimport { DevOverlay } from '../ui/dev-overlay'\nimport { getSquashedHydrationErrorDetails } from './hydration-error-state'\n\nexport type ErrorType = 'runtime' | 'build'\n\nexport type PagesDevOverlayType = typeof PagesDevOverlay\n\ninterface PagesDevOverlayProps {\n children?: React.ReactNode\n}\n\nexport function PagesDevOverlay({ children }: PagesDevOverlayProps) {\n const { state, dispatch } = usePagesDevOverlay()\n\n return (\n <>\n <PagesDevOverlayErrorBoundary
|
1
|
+
{"version":3,"sources":["../../../../../src/client/components/react-dev-overlay/pages/pages-dev-overlay.tsx"],"sourcesContent":["import { PagesDevOverlayErrorBoundary } from './pages-dev-overlay-error-boundary'\nimport { usePagesDevOverlay } from './hooks'\nimport { FontStyles } from '../font/font-styles'\nimport { DevOverlay } from '../ui/dev-overlay'\nimport { getSquashedHydrationErrorDetails } from './hydration-error-state'\n\nexport type ErrorType = 'runtime' | 'build'\n\nexport type PagesDevOverlayType = typeof PagesDevOverlay\n\ninterface PagesDevOverlayProps {\n children?: React.ReactNode\n}\n\nexport function PagesDevOverlay({ children }: PagesDevOverlayProps) {\n const { state, dispatch } = usePagesDevOverlay()\n\n return (\n <>\n <PagesDevOverlayErrorBoundary>{children}</PagesDevOverlayErrorBoundary>\n\n {/* Fonts can only be loaded outside the Shadow DOM. */}\n <FontStyles />\n <DevOverlay\n state={state}\n dispatch={dispatch}\n getSquashedHydrationErrorDetails={getSquashedHydrationErrorDetails}\n />\n </>\n )\n}\n"],"names":["PagesDevOverlayErrorBoundary","usePagesDevOverlay","FontStyles","DevOverlay","getSquashedHydrationErrorDetails","PagesDevOverlay","children","state","dispatch"],"mappings":";AAAA,SAASA,4BAA4B,QAAQ,qCAAoC;AACjF,SAASC,kBAAkB,QAAQ,UAAS;AAC5C,SAASC,UAAU,QAAQ,sBAAqB;AAChD,SAASC,UAAU,QAAQ,oBAAmB;AAC9C,SAASC,gCAAgC,QAAQ,0BAAyB;AAU1E,OAAO,SAASC,gBAAgB,KAAkC;IAAlC,IAAA,EAAEC,QAAQ,EAAwB,GAAlC;IAC9B,MAAM,EAAEC,KAAK,EAAEC,QAAQ,EAAE,GAAGP;IAE5B,qBACE;;0BACE,KAACD;0BAA8BM;;0BAG/B,KAACJ;0BACD,KAACC;gBACCI,OAAOA;gBACPC,UAAUA;gBACVJ,kCAAkCA;;;;AAI1C","ignoreList":[0]}
|
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.0-canary.
|
29
|
+
export const version = "15.4.0-canary.65";
|
30
30
|
export let router;
|
31
31
|
export const emitter = mitt();
|
32
32
|
const looseToArray = (input)=>[].slice.call(input);
|
@@ -1139,7 +1139,7 @@ export default class Server {
|
|
1139
1139
|
// corresponding cache-busting search param.
|
1140
1140
|
// TODO: Consider not using custom request headers at all, and instead fully
|
1141
1141
|
// encode everything into the search param.
|
1142
|
-
if (this.isAppSegmentPrefetchEnabled && getRequestMeta(req, 'segmentPrefetchRSCRequest')) {
|
1142
|
+
if (!this.minimalMode && this.nextConfig.experimental.validateRSCRequestHeaders && this.isAppSegmentPrefetchEnabled && getRequestMeta(req, 'segmentPrefetchRSCRequest')) {
|
1143
1143
|
const headers = req.headers;
|
1144
1144
|
const expectedHash = computeCacheBustingSearchParam(headers[NEXT_ROUTER_PREFETCH_HEADER.toLowerCase()], headers[NEXT_ROUTER_SEGMENT_PREFETCH_HEADER.toLowerCase()], headers[NEXT_ROUTER_STATE_TREE_HEADER.toLowerCase()], headers[NEXT_URL.toLowerCase()]);
|
1145
1145
|
const actualHash = getRequestMeta(req, 'cacheBustingSearchParam') ?? null;
|
@@ -2331,7 +2331,9 @@ export default class Server {
|
|
2331
2331
|
const { req, res, query, pathname } = ctx;
|
2332
2332
|
let page = pathname;
|
2333
2333
|
const bubbleNoFallback = getRequestMeta(ctx.req, 'bubbleNoFallback') ?? false;
|
2334
|
-
|
2334
|
+
if (!this.minimalMode && this.nextConfig.experimental.validateRSCRequestHeaders) {
|
2335
|
+
addRequestMeta(ctx.req, 'cacheBustingSearchParam', query[NEXT_RSC_UNION_QUERY]);
|
2336
|
+
}
|
2335
2337
|
delete query[NEXT_RSC_UNION_QUERY];
|
2336
2338
|
const options = {
|
2337
2339
|
i18n: (_this_i18nProvider = this.i18nProvider) == null ? void 0 : _this_i18nProvider.fromRequest(req, pathname)
|