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.
Files changed (69) hide show
  1. package/dist/bin/next +1 -1
  2. package/dist/build/index.js +2 -2
  3. package/dist/build/swc/index.js +1 -1
  4. package/dist/build/webpack/plugins/flight-client-entry-plugin.js +18 -18
  5. package/dist/build/webpack/plugins/flight-client-entry-plugin.js.map +1 -1
  6. package/dist/build/webpack-config.js +2 -2
  7. package/dist/client/app-bootstrap.js +1 -1
  8. package/dist/client/components/react-dev-overlay/pages/pages-dev-overlay-error-boundary.d.ts +0 -1
  9. package/dist/client/components/react-dev-overlay/pages/pages-dev-overlay-error-boundary.js +0 -5
  10. package/dist/client/components/react-dev-overlay/pages/pages-dev-overlay-error-boundary.js.map +1 -1
  11. package/dist/client/components/react-dev-overlay/pages/pages-dev-overlay.js +1 -1
  12. package/dist/client/components/react-dev-overlay/pages/pages-dev-overlay.js.map +1 -1
  13. package/dist/client/index.js +1 -1
  14. package/dist/compiled/next-server/pages-api-turbo.runtime.prod.js +1 -1
  15. package/dist/compiled/next-server/pages-api-turbo.runtime.prod.js.map +1 -1
  16. package/dist/compiled/next-server/pages-api.runtime.dev.js +1 -1
  17. package/dist/compiled/next-server/pages-api.runtime.dev.js.map +1 -1
  18. package/dist/compiled/next-server/pages-api.runtime.prod.js +1 -1
  19. package/dist/compiled/next-server/pages-api.runtime.prod.js.map +1 -1
  20. package/dist/compiled/next-server/pages-turbo.runtime.prod.js +2 -2
  21. package/dist/compiled/next-server/pages-turbo.runtime.prod.js.map +1 -1
  22. package/dist/compiled/next-server/pages.runtime.dev.js +2 -2
  23. package/dist/compiled/next-server/pages.runtime.dev.js.map +1 -1
  24. package/dist/compiled/next-server/pages.runtime.prod.js +2 -2
  25. package/dist/compiled/next-server/pages.runtime.prod.js.map +1 -1
  26. package/dist/compiled/next-server/server.runtime.prod.js +4 -4
  27. package/dist/compiled/next-server/server.runtime.prod.js.map +1 -1
  28. package/dist/esm/build/index.js +2 -2
  29. package/dist/esm/build/swc/index.js +1 -1
  30. package/dist/esm/build/webpack/plugins/flight-client-entry-plugin.js +18 -18
  31. package/dist/esm/build/webpack/plugins/flight-client-entry-plugin.js.map +1 -1
  32. package/dist/esm/build/webpack-config.js +2 -2
  33. package/dist/esm/client/app-bootstrap.js +1 -1
  34. package/dist/esm/client/components/react-dev-overlay/pages/pages-dev-overlay-error-boundary.js +0 -5
  35. package/dist/esm/client/components/react-dev-overlay/pages/pages-dev-overlay-error-boundary.js.map +1 -1
  36. package/dist/esm/client/components/react-dev-overlay/pages/pages-dev-overlay.js +1 -1
  37. package/dist/esm/client/components/react-dev-overlay/pages/pages-dev-overlay.js.map +1 -1
  38. package/dist/esm/client/index.js +1 -1
  39. package/dist/esm/server/base-server.js +4 -2
  40. package/dist/esm/server/base-server.js.map +1 -1
  41. package/dist/esm/server/config-schema.js +1 -0
  42. package/dist/esm/server/config-schema.js.map +1 -1
  43. package/dist/esm/server/config-shared.js +1 -0
  44. package/dist/esm/server/config-shared.js.map +1 -1
  45. package/dist/esm/server/dev/hot-reloader-turbopack.js +1 -1
  46. package/dist/esm/server/dev/hot-reloader-webpack.js +1 -1
  47. package/dist/esm/server/lib/app-info-log.js +1 -1
  48. package/dist/esm/server/lib/start-server.js +1 -1
  49. package/dist/esm/shared/lib/canary-only.js +1 -1
  50. package/dist/esm/shared/lib/turbopack/utils.js +7 -1
  51. package/dist/esm/shared/lib/turbopack/utils.js.map +1 -1
  52. package/dist/server/base-server.js +4 -2
  53. package/dist/server/base-server.js.map +1 -1
  54. package/dist/server/config-schema.js +1 -0
  55. package/dist/server/config-schema.js.map +1 -1
  56. package/dist/server/config-shared.d.ts +6 -0
  57. package/dist/server/config-shared.js +1 -0
  58. package/dist/server/config-shared.js.map +1 -1
  59. package/dist/server/dev/hot-reloader-turbopack.js +1 -1
  60. package/dist/server/dev/hot-reloader-webpack.js +1 -1
  61. package/dist/server/lib/app-info-log.js +1 -1
  62. package/dist/server/lib/start-server.js +1 -1
  63. package/dist/shared/lib/canary-only.js +1 -1
  64. package/dist/shared/lib/turbopack/utils.js +7 -1
  65. package/dist/shared/lib/turbopack/utils.js.map +1 -1
  66. package/dist/telemetry/anonymous-meta.js +1 -1
  67. package/dist/telemetry/events/session-stopped.js +2 -2
  68. package/dist/telemetry/events/version.js +2 -2
  69. package/package.json +15 -15
package/dist/bin/next CHANGED
@@ -79,7 +79,7 @@ const program = new NextRootCommand();
79
79
  program.name('next').description('The Next.js CLI allows you to develop, build, start your application, and more.').configureHelp({
80
80
  formatHelp: (cmd, helper)=>(0, _formatclihelpoutput.formatCliHelpOutput)(cmd, helper),
81
81
  subcommandTerm: (cmd)=>`${cmd.name()} ${cmd.usage()}`
82
- }).helpCommand(false).helpOption('-h, --help', 'Displays this message.').version(`Next.js v${"15.4.0-canary.64"}`, '-v, --version', 'Outputs the Next.js version.');
82
+ }).helpCommand(false).helpOption('-h, --help', 'Displays this message.').version(`Next.js v${"15.4.0-canary.65"}`, '-v, --version', 'Outputs the Next.js version.');
83
83
  program.command('build').description('Creates an optimized production build of your application. The output displays information about each route.').argument('[directory]', `A directory on which to build the application. ${(0, _picocolors.italic)('If no directory is provided, the current directory will be used.')}`).option('-d, --debug', 'Enables a more verbose build output.').option('--no-lint', 'Disables linting.').option('--no-mangling', 'Disables mangling.').option('--profile', 'Enables production profiling for React.').option('--experimental-app-only', 'Builds only App Router routes.').option('--turbo', 'Starts development mode using Turbopack.').option('--turbopack', 'Starts development mode using Turbopack.').addOption(new _commander.Option('--experimental-build-mode [mode]', 'Uses an experimental build mode.').choices([
84
84
  'compile',
85
85
  'generate',
@@ -364,7 +364,7 @@ async function build(dir, reactProductionProfiling = false, debugOutput = false,
364
364
  const nextBuildSpan = (0, _trace.trace)('next-build', undefined, {
365
365
  buildMode: experimentalBuildMode,
366
366
  isTurboBuild: String(isTurbopack),
367
- version: "15.4.0-canary.64"
367
+ version: "15.4.0-canary.65"
368
368
  });
369
369
  _buildcontext.NextBuildContext.nextBuildSpan = nextBuildSpan;
370
370
  _buildcontext.NextBuildContext.dir = dir;
@@ -745,7 +745,7 @@ async function build(dir, reactProductionProfiling = false, debugOutput = false,
745
745
  // Files outside of the distDir can be "type": "module"
746
746
  await writeFileUtf8(_path.default.join(distDir, 'package.json'), '{"type": "commonjs"}');
747
747
  // These are written to distDir, so they need to come after creating and cleaning distDr.
748
- await (0, _builddiagnostics.recordFrameworkVersion)("15.4.0-canary.64");
748
+ await (0, _builddiagnostics.recordFrameworkVersion)("15.4.0-canary.65");
749
749
  await (0, _builddiagnostics.updateBuildDiagnostics)({
750
750
  buildStage: 'start'
751
751
  });
@@ -123,7 +123,7 @@ function _interop_require_wildcard(obj, nodeInterop) {
123
123
  }
124
124
  return newObj;
125
125
  }
126
- const nextVersion = "15.4.0-canary.64";
126
+ const nextVersion = "15.4.0-canary.65";
127
127
  const ArchName = (0, _os.arch)();
128
128
  const PlatformName = (0, _os.platform)();
129
129
  function infoLog(...args) {
@@ -42,6 +42,11 @@ const pluginState = (0, _buildcontext.getProxiedPluginState)({
42
42
  edgeRscModules: {},
43
43
  injectedClientEntries: {}
44
44
  });
45
+ const POSSIBLE_SHARED_CONVENTIONS = [
46
+ 'template',
47
+ 'layout'
48
+ ];
49
+ const STANDALONE_BUNDLE_CONVENTION = 'global-not-found';
45
50
  function deduplicateCSSImportsForEntry(mergedCSSimports) {
46
51
  // If multiple entry module connections are having the same CSS import,
47
52
  // we only need to have one module to keep track of that CSS import.
@@ -67,35 +72,30 @@ function deduplicateCSSImportsForEntry(mergedCSSimports) {
67
72
  }
68
73
  const aName = _path.default.parse(aPath).name;
69
74
  const bName = _path.default.parse(bPath).name;
70
- const indexA = [
71
- 'template',
72
- 'layout'
73
- ].indexOf(aName);
74
- const indexB = [
75
- 'template',
76
- 'layout'
77
- ].indexOf(bName);
75
+ const indexA = POSSIBLE_SHARED_CONVENTIONS.indexOf(aName);
76
+ const indexB = POSSIBLE_SHARED_CONVENTIONS.indexOf(bName);
78
77
  if (indexA === -1) return 1;
79
78
  if (indexB === -1) return -1;
80
79
  return indexA - indexB;
81
80
  });
82
81
  const dedupedCSSImports = {};
83
82
  const trackedCSSImports = new Set();
84
- for (const [entryName, cssImports] of sortedCSSImports){
83
+ for (const [entryFilePath, cssImports] of sortedCSSImports){
84
+ const entryConventionName = _path.default.parse(entryFilePath).name;
85
85
  for (const cssImport of cssImports){
86
- if (trackedCSSImports.has(cssImport)) continue;
86
+ // If the CSS import is already tracked, we can skip it.
87
+ // Or if it's any standalone entry such as `global-not-found`, it won't share any resources with other entry, skip it.
88
+ if (trackedCSSImports.has(cssImport) && STANDALONE_BUNDLE_CONVENTION !== entryConventionName) {
89
+ continue;
90
+ }
87
91
  // Only track CSS imports that are in files that can inherit CSS.
88
- const filename = _path.default.parse(entryName).name;
89
- if ([
90
- 'template',
91
- 'layout'
92
- ].includes(filename)) {
92
+ if (POSSIBLE_SHARED_CONVENTIONS.includes(entryConventionName)) {
93
93
  trackedCSSImports.add(cssImport);
94
94
  }
95
- if (!dedupedCSSImports[entryName]) {
96
- dedupedCSSImports[entryName] = [];
95
+ if (!dedupedCSSImports[entryFilePath]) {
96
+ dedupedCSSImports[entryFilePath] = [];
97
97
  }
98
- dedupedCSSImports[entryName].push(cssImport);
98
+ dedupedCSSImports[entryFilePath].push(cssImport);
99
99
  }
100
100
  }
101
101
  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":["FlightClientEntryPlugin","PLUGIN_NAME","pluginState","getProxiedPluginState","serverActions","edgeServerActions","serverActionModules","edgeServerActionModules","ssrModules","edgeSsrModules","rscModules","edgeRscModules","injectedClientEntries","deduplicateCSSImportsForEntry","mergedCSSimports","sortedCSSImports","Object","entries","sort","a","b","aPath","bPath","aDepth","split","length","bDepth","aName","path","parse","name","bName","indexA","indexOf","indexB","dedupedCSSImports","trackedCSSImports","Set","entryName","cssImports","cssImport","has","filename","includes","add","push","constructor","options","dev","appDir","isEdgeServer","assetPrefix","encryptionKey","webpackRuntime","EDGE_RUNTIME_WEBPACK","DEFAULT_RUNTIME_WEBPACK","apply","compiler","hooks","finishMake","tapPromise","compilation","createClientEntries","afterCompile","tap","recordModule","modId","mod","modPath","matchResource","resourceResolveData","modQuery","query","modResource","startsWith","BARREL_OPTIMIZATION_PREFIX","formatBarrelOptimizedResource","resource","layer","WEBPACK_LAYERS","reactServerComponents","key","relative","context","replace","moduleInfo","moduleId","async","moduleGraph","isAsync","serverSideRendering","ssrNamedModuleId","normalizePathSep","traverseModules","_chunk","_chunkGroup","make","processAssets","stage","webpack","Compilation","PROCESS_ASSETS_STAGE_OPTIMIZE_HASH","createActionAssets","addClientEntryAndSSRModulesList","createdSSRDependenciesForEntry","addActionEntryList","actionMapsPerEntry","createdActionIds","forEachEntryModule","entryModule","internalClientComponentEntryImports","actionEntryImports","Map","clientEntriesToInject","connection","getModuleReferencesInOrder","entryRequest","dependency","request","endsWith","WEBPACK_RESOURCE_QUERIES","metadataRoute","filePath","isDynamicRouteExtension","getMetadataRouteResource","clientComponentImports","actionImports","collectComponentInfoFromServerEntryDependency","resolvedModule","forEach","dep","actions","set","isAbsoluteRequest","isAbsolute","keys","value","relativeRequest","bundlePath","appDirRelativeRequest","isMetadataEntryFile","isMetadataRouteFile","DEFAULT_METADATA_ROUTE_EXTENSIONS","assign","absolutePagePath","UNDERSCORE_NOT_FOUND_ROUTE_ENTRY","clientEntryToInject","injected","injectClientEntryAndSSRModules","clientImports","reduce","res","curr","isAppRouteRoute","APP_CLIENT_INTERNALS","size","injectActionEntry","invalidator","getInvalidator","outputPath","some","shouldInvalidate","invalidate","COMPILER_NAMES","client","Promise","all","flatMap","addClientEntryAndSSRModules","addedClientActionEntryList","actionMapsPerClientEntry","ssrEntryDependencies","collectClientActionsFromDependencies","dependencies","remainingClientImportedActions","remainingActionEntryImports","remainingActionNames","action","id","fromClient","collectedActions","visitedModule","visitedEntry","collectActions","collectActionsInDep","getModuleBuildInfo","getModuleResource","actionIds","rsc","map","exportedName","entryDependency","ssrEntryModule","getResolvedModule","depModule","visitedOfClientComponentsTraverse","CSSImports","filterClientComponents","importedIdentifiers","addClientImport","isCSSMod","sideEffectFree","factoryMeta","unused","getExportsInfo","isModuleUsed","isClientComponentEntryModule","dependencyIds","ids","Array","from","bundler","getWebpackBundler","modules","regexCSS","test","localeCompare","clientImportPath","clientBrowserLoader","stringify","sep","x","JSON","server","clientServerLoader","getEntries","pageKey","getEntryKey","PAGE_TYPES","APP","type","EntryTypes","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","SERVER_REFERENCE_MANIFEST","sources","RawSource","modRequest","isFirstVisitModule","clientEntryType","isCjsModule","assumedSourceType","getAssumedSourceType","clientImportsSet","isAutoModuleSourceType","isCjsDefaultImport","identifier","rawRequest"],"mappings":";;;;+BA0KaA;;;eAAAA;;;yBArKW;6BACS;6DAChB;sCAOV;2BAIA;4BASA;uBAKA;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mBAAmBO,UAAU,CAACC,sCAA0B,GAAG;QAC7DF,cAAcN,IAAIE,aAAa,GAAG,MAAMI;IAC1C;IAEA,IAAIN,IAAIU,QAAQ,KAAK,CAAC,CAAC,EAAE2C,mCAAwB,CAACC,aAAa,EAAE,EAAE;QACjE,OAAOG,yBAAyBzD,IAAIgO,UAAU,EAAEzK,QAAQ;IAC1D;IAEA,OAAOjD;AACT;AAEA,SAASmD,yBAAyBN,OAAe;IAC/C,sHAAsH;IACtH,MAAM9C,QAAQ8C,QAAQ9F,KAAK,CAAC,IAAI,CAAC,EAAE,CAACA,KAAK,CAAC,8BAA8B,CAAC,EAAE;IAE3E,OAAOK,IAAAA,kBAAK,EAAC2C;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":["FlightClientEntryPlugin","PLUGIN_NAME","pluginState","getProxiedPluginState","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","path","parse","name","bName","indexA","indexOf","indexB","dedupedCSSImports","trackedCSSImports","Set","entryFilePath","cssImports","entryConventionName","cssImport","has","includes","add","push","constructor","options","dev","appDir","isEdgeServer","assetPrefix","encryptionKey","webpackRuntime","EDGE_RUNTIME_WEBPACK","DEFAULT_RUNTIME_WEBPACK","apply","compiler","hooks","finishMake","tapPromise","compilation","createClientEntries","afterCompile","tap","recordModule","modId","mod","modPath","matchResource","resourceResolveData","modQuery","query","modResource","startsWith","BARREL_OPTIMIZATION_PREFIX","formatBarrelOptimizedResource","resource","layer","WEBPACK_LAYERS","reactServerComponents","key","relative","context","replace","moduleInfo","moduleId","async","moduleGraph","isAsync","serverSideRendering","ssrNamedModuleId","normalizePathSep","traverseModules","_chunk","_chunkGroup","make","processAssets","stage","webpack","Compilation","PROCESS_ASSETS_STAGE_OPTIMIZE_HASH","createActionAssets","addClientEntryAndSSRModulesList","createdSSRDependenciesForEntry","addActionEntryList","actionMapsPerEntry","createdActionIds","forEachEntryModule","entryModule","internalClientComponentEntryImports","actionEntryImports","Map","clientEntriesToInject","connection","getModuleReferencesInOrder","entryRequest","dependency","request","endsWith","WEBPACK_RESOURCE_QUERIES","metadataRoute","filePath","isDynamicRouteExtension","getMetadataRouteResource","clientComponentImports","actionImports","collectComponentInfoFromServerEntryDependency","resolvedModule","forEach","dep","actions","set","isAbsoluteRequest","isAbsolute","keys","value","relativeRequest","bundlePath","appDirRelativeRequest","isMetadataEntryFile","isMetadataRouteFile","DEFAULT_METADATA_ROUTE_EXTENSIONS","assign","entryName","absolutePagePath","UNDERSCORE_NOT_FOUND_ROUTE_ENTRY","clientEntryToInject","injected","injectClientEntryAndSSRModules","clientImports","reduce","res","curr","isAppRouteRoute","APP_CLIENT_INTERNALS","size","injectActionEntry","invalidator","getInvalidator","outputPath","some","shouldInvalidate","invalidate","COMPILER_NAMES","client","Promise","all","flatMap","addClientEntryAndSSRModules","addedClientActionEntryList","actionMapsPerClientEntry","ssrEntryDependencies","collectClientActionsFromDependencies","dependencies","remainingClientImportedActions","remainingActionEntryImports","remainingActionNames","action","id","fromClient","collectedActions","visitedModule","visitedEntry","collectActions","collectActionsInDep","getModuleBuildInfo","getModuleResource","actionIds","rsc","map","exportedName","entryDependency","ssrEntryModule","getResolvedModule","depModule","visitedOfClientComponentsTraverse","CSSImports","filterClientComponents","importedIdentifiers","addClientImport","isCSSMod","sideEffectFree","factoryMeta","unused","getExportsInfo","isModuleUsed","isClientComponentEntryModule","dependencyIds","ids","Array","from","bundler","getWebpackBundler","modules","regexCSS","test","localeCompare","clientImportPath","clientBrowserLoader","stringify","sep","x","JSON","server","clientServerLoader","getEntries","pageKey","getEntryKey","PAGE_TYPES","APP","type","EntryTypes","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","SERVER_REFERENCE_MANIFEST","sources","RawSource","modRequest","isFirstVisitModule","clientEntryType","isCjsModule","assumedSourceType","getAssumedSourceType","clientImportsSet","isAutoModuleSourceType","isCjsDefaultImport","identifier","rawRequest"],"mappings":";;;;+BAsLaA;;;eAAAA;;;yBAjLW;6BACS;6DAChB;sCAOV;2BAIA;4BASA;uBAKA;wBAMA;kCAC0B;8BACK;2BACX;oCACQ;kCACE;iCACL;iCAIzB;0EAGuB;;;;;;AAS9B,MAAMC,cAAc;A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mBO,UAAU,CAACC,sCAA0B,GAAG;QAC7DF,cAAcN,IAAIE,aAAa,GAAG,MAAMI;IAC1C;IAEA,IAAIN,IAAIU,QAAQ,KAAK,CAAC,CAAC,EAAE2C,mCAAwB,CAACC,aAAa,EAAE,EAAE;QACjE,OAAOG,yBAAyBzD,IAAIiO,UAAU,EAAE1K,QAAQ;IAC1D;IAEA,OAAOjD;AACT;AAEA,SAASmD,yBAAyBN,OAAe;IAC/C,sHAAsH;IACtH,MAAM9C,QAAQ8C,QAAQ9F,KAAK,CAAC,IAAI,CAAC,EAAE,CAACA,KAAK,CAAC,8BAA8B,CAAC,EAAE;IAE3E,OAAOK,IAAAA,kBAAK,EAAC2C;AACf","ignoreList":[0]}
@@ -1675,7 +1675,7 @@ async function getBaseWebpackConfig(dir, { buildId, encryptionKey, config, compi
1675
1675
  isClient && new _copyfileplugin.CopyFilePlugin({
1676
1676
  // file path to build output of `@next/polyfill-nomodule`
1677
1677
  filePath: require.resolve('./polyfills/polyfill-nomodule'),
1678
- cacheKey: "15.4.0-canary.64",
1678
+ cacheKey: "15.4.0-canary.65",
1679
1679
  name: `static/chunks/polyfills${dev ? '' : '-[hash]'}.js`,
1680
1680
  minimize: false,
1681
1681
  info: {
@@ -1855,7 +1855,7 @@ async function getBaseWebpackConfig(dir, { buildId, encryptionKey, config, compi
1855
1855
  // - Next.js location on disk (some loaders use absolute paths and some resolve options depend on absolute paths)
1856
1856
  // - Next.js version
1857
1857
  // - next.config.js keys that affect compilation
1858
- version: `${__dirname}|${"15.4.0-canary.64"}|${configVars}`,
1858
+ version: `${__dirname}|${"15.4.0-canary.65"}|${configVars}`,
1859
1859
  cacheDirectory: _path.default.join(distDir, 'cache', 'webpack'),
1860
1860
  // For production builds, it's more efficient to compress all cache files together instead of compression each one individually.
1861
1861
  // So we disable compression here and allow the build runner to take care of compressing the cache as a whole.
@@ -13,7 +13,7 @@ Object.defineProperty(exports, "appBootstrap", {
13
13
  return appBootstrap;
14
14
  }
15
15
  });
16
- const version = "15.4.0-canary.64";
16
+ const version = "15.4.0-canary.65";
17
17
  window.next = {
18
18
  version,
19
19
  appDir: true
@@ -12,7 +12,6 @@ export declare class PagesDevOverlayErrorBoundary extends React.PureComponent<Pa
12
12
  static getDerivedStateFromError(error: Error): {
13
13
  error: Error;
14
14
  };
15
- componentDidCatch(error: Error): void;
16
15
  render(): React.ReactNode;
17
16
  }
18
17
  export {};
@@ -16,11 +16,6 @@ class PagesDevOverlayErrorBoundary extends _react.default.PureComponent {
16
16
  error
17
17
  };
18
18
  }
19
- componentDidCatch(error) {
20
- this.setState({
21
- error
22
- });
23
- }
24
19
  // Explicit type is needed to avoid the generated `.d.ts` having a wide return type that could be specific to the `@types/react` version.
25
20
  render() {
26
21
  // The component has to be unmounted or else it would continue to error
@@ -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 componentDidCatch(error: Error) {\n this.setState({ 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":["PagesDevOverlayErrorBoundary","React","PureComponent","getDerivedStateFromError","error","componentDidCatch","setState","render","state","props","children"],"mappings":";;;;+BAOaA;;;eAAAA;;;;gEAPK;AAOX,MAAMA,qCAAqCC,cAAK,CAACC,aAAa;IAMnE,OAAOC,yBAAyBC,KAAY,EAAE;QAC5C,OAAO;YAAEA;QAAM;IACjB;IAEAC,kBAAkBD,KAAY,EAAE;QAC9B,IAAI,CAACE,QAAQ,CAAC;YAAEF;QAAM;IACxB;IAEA,yIAAyI;IACzIG,SAA0B;QACxB,uEAAuE;QACvE,OAAO,IAAI,CAACC,KAAK,CAACJ,KAAK,GAAG,OAAO,IAAI,CAACK,KAAK,CAACC,QAAQ;IACtD;;QAlBK,qBAILF,QAAQ;YAAEJ,OAAO;QAAK;;AAexB","ignoreList":[0]}
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":["PagesDevOverlayErrorBoundary","React","PureComponent","getDerivedStateFromError","error","render","state","props","children"],"mappings":";;;;+BAOaA;;;eAAAA;;;;gEAPK;AAOX,MAAMA,qCAAqCC,cAAK,CAACC,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]}
@@ -20,7 +20,7 @@ function PagesDevOverlay(param) {
20
20
  return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
21
21
  children: [
22
22
  /*#__PURE__*/ (0, _jsxruntime.jsx)(_pagesdevoverlayerrorboundary.PagesDevOverlayErrorBoundary, {
23
- children: children != null ? children : null
23
+ children: children
24
24
  }),
25
25
  /*#__PURE__*/ (0, _jsxruntime.jsx)(_fontstyles.FontStyles, {}),
26
26
  /*#__PURE__*/ (0, _jsxruntime.jsx)(_devoverlay.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>\n {children ?? null}\n </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":["PagesDevOverlay","children","state","dispatch","usePagesDevOverlay","PagesDevOverlayErrorBoundary","FontStyles","DevOverlay","getSquashedHydrationErrorDetails"],"mappings":";;;;+BAcgBA;;;eAAAA;;;;8CAd6B;uBACV;4BACR;4BACA;qCACsB;AAU1C,SAASA,gBAAgB,KAAkC;IAAlC,IAAA,EAAEC,QAAQ,EAAwB,GAAlC;IAC9B,MAAM,EAAEC,KAAK,EAAEC,QAAQ,EAAE,GAAGC,IAAAA,yBAAkB;IAE9C,qBACE;;0BACE,qBAACC,0DAA4B;0BAC1BJ,mBAAAA,WAAY;;0BAIf,qBAACK,sBAAU;0BACX,qBAACC,sBAAU;gBACTL,OAAOA;gBACPC,UAAUA;gBACVK,kCAAkCA,qDAAgC;;;;AAI1E","ignoreList":[0]}
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":["PagesDevOverlay","children","state","dispatch","usePagesDevOverlay","PagesDevOverlayErrorBoundary","FontStyles","DevOverlay","getSquashedHydrationErrorDetails"],"mappings":";;;;+BAcgBA;;;eAAAA;;;;8CAd6B;uBACV;4BACR;4BACA;qCACsB;AAU1C,SAASA,gBAAgB,KAAkC;IAAlC,IAAA,EAAEC,QAAQ,EAAwB,GAAlC;IAC9B,MAAM,EAAEC,KAAK,EAAEC,QAAQ,EAAE,GAAGC,IAAAA,yBAAkB;IAE9C,qBACE;;0BACE,qBAACC,0DAA4B;0BAAEJ;;0BAG/B,qBAACK,sBAAU;0BACX,qBAACC,sBAAU;gBACTL,OAAOA;gBACPC,UAAUA;gBACVK,kCAAkCA,qDAAgC;;;;AAI1E","ignoreList":[0]}
@@ -61,7 +61,7 @@ const _hooksclientcontextsharedruntime = require("../shared/lib/hooks-client-con
61
61
  const _onrecoverableerror = require("./react-client-callbacks/on-recoverable-error");
62
62
  const _tracer = /*#__PURE__*/ _interop_require_default._(require("./tracing/tracer"));
63
63
  const _isnextroutererror = require("./components/is-next-router-error");
64
- const version = "15.4.0-canary.64";
64
+ const version = "15.4.0-canary.65";
65
65
  let router;
66
66
  const emitter = (0, _mitt.default)();
67
67
  const looseToArray = (input)=>[].slice.call(input);