next 15.2.0-canary.72 → 15.2.0-canary.74
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.
Potentially problematic release.
This version of next might be problematic. Click here for more details.
- package/dist/bin/next +1 -1
- package/dist/build/index.js +5 -2
- package/dist/build/index.js.map +1 -1
- package/dist/build/swc/index.js +1 -1
- package/dist/build/webpack-config.js +2 -2
- package/dist/client/app-bootstrap.js +1 -1
- package/dist/client/index.js +1 -1
- package/dist/esm/build/index.js +6 -3
- package/dist/esm/build/index.js.map +1 -1
- package/dist/esm/build/swc/index.js +1 -1
- package/dist/esm/build/webpack-config.js +2 -2
- package/dist/esm/client/app-bootstrap.js +1 -1
- package/dist/esm/client/index.js +1 -1
- package/dist/esm/server/config.js +1 -1
- package/dist/esm/server/dev/hot-reloader-turbopack.js +1 -1
- package/dist/esm/server/dev/hot-reloader-webpack.js +1 -1
- package/dist/esm/server/dev/turbopack-utils.js +4 -3
- package/dist/esm/server/dev/turbopack-utils.js.map +1 -1
- package/dist/esm/server/lib/app-info-log.js +1 -1
- package/dist/esm/server/lib/router-utils/setup-dev-bundler.js +5 -3
- package/dist/esm/server/lib/router-utils/setup-dev-bundler.js.map +1 -1
- package/dist/esm/server/lib/start-server.js +1 -1
- package/dist/experimental/testing/server/config-testing-utils.js +3 -1
- package/dist/experimental/testing/server/config-testing-utils.js.map +1 -1
- package/dist/server/config.js +1 -1
- package/dist/server/dev/hot-reloader-turbopack.js +1 -1
- package/dist/server/dev/hot-reloader-webpack.js +1 -1
- package/dist/server/dev/turbopack-utils.js +4 -3
- package/dist/server/dev/turbopack-utils.js.map +1 -1
- package/dist/server/lib/app-info-log.js +1 -1
- package/dist/server/lib/router-utils/setup-dev-bundler.js +4 -2
- package/dist/server/lib/router-utils/setup-dev-bundler.js.map +1 -1
- package/dist/server/lib/start-server.js +1 -1
- package/dist/telemetry/anonymous-meta.js +1 -1
- package/dist/telemetry/events/session-stopped.js +2 -2
- package/dist/telemetry/events/version.js +2 -2
- package/package.json +15 -15
@@ -11,7 +11,7 @@ import { isDeepStrictEqual } from 'util';
|
|
11
11
|
import { getDefineEnv } from '../webpack/plugins/define-env-plugin';
|
12
12
|
import { getReactCompilerLoader } from '../get-babel-loader-config';
|
13
13
|
import { TurbopackInternalError } from '../../shared/lib/turbopack/utils';
|
14
|
-
const nextVersion = "15.2.0-canary.
|
14
|
+
const nextVersion = "15.2.0-canary.74";
|
15
15
|
const ArchName = arch();
|
16
16
|
const PlatformName = platform();
|
17
17
|
function infoLog(...args) {
|
@@ -1469,7 +1469,7 @@ export default async function getBaseWebpackConfig(dir, { buildId, encryptionKey
|
|
1469
1469
|
isClient && new CopyFilePlugin({
|
1470
1470
|
// file path to build output of `@next/polyfill-nomodule`
|
1471
1471
|
filePath: require.resolve('./polyfills/polyfill-nomodule'),
|
1472
|
-
cacheKey: "15.2.0-canary.
|
1472
|
+
cacheKey: "15.2.0-canary.74",
|
1473
1473
|
name: `static/chunks/polyfills${dev ? '' : '-[hash]'}.js`,
|
1474
1474
|
minimize: false,
|
1475
1475
|
info: {
|
@@ -1701,7 +1701,7 @@ export default async function getBaseWebpackConfig(dir, { buildId, encryptionKey
|
|
1701
1701
|
// - Next.js location on disk (some loaders use absolute paths and some resolve options depend on absolute paths)
|
1702
1702
|
// - Next.js version
|
1703
1703
|
// - next.config.js keys that affect compilation
|
1704
|
-
version: `${__dirname}|${"15.2.0-canary.
|
1704
|
+
version: `${__dirname}|${"15.2.0-canary.74"}|${configVars}`,
|
1705
1705
|
cacheDirectory: path.join(distDir, 'cache', 'webpack'),
|
1706
1706
|
// For production builds, it's more efficient to compress all cache files together instead of compression each one individually.
|
1707
1707
|
// So we disable compression here and allow the build runner to take care of compressing the cache as a whole.
|
package/dist/esm/client/index.js
CHANGED
@@ -26,7 +26,7 @@ import { SearchParamsContext, PathParamsContext } from '../shared/lib/hooks-clie
|
|
26
26
|
import { onRecoverableError } from './react-client-callbacks/on-recoverable-error';
|
27
27
|
import tracer from './tracing/tracer';
|
28
28
|
import { isNextRouterError } from './components/is-next-router-error';
|
29
|
-
export const version = "15.2.0-canary.
|
29
|
+
export const version = "15.2.0-canary.74";
|
30
30
|
export let router;
|
31
31
|
export const emitter = mitt();
|
32
32
|
const looseToArray = (input)=>[].slice.call(input);
|
@@ -187,7 +187,7 @@ function assignDefaults(dir, userConfig, silent) {
|
|
187
187
|
configurable: true
|
188
188
|
});
|
189
189
|
}
|
190
|
-
if (!((_process_env___NEXT_VERSION = "15.2.0-canary.
|
190
|
+
if (!((_process_env___NEXT_VERSION = "15.2.0-canary.74") == null ? void 0 : _process_env___NEXT_VERSION.includes('canary')) && !process.env.__NEXT_TEST_MODE && !process.env.NEXT_PRIVATE_LOCAL_DEV) {
|
191
191
|
var _result_experimental7, _result_experimental8, _result_experimental_turbo3, _result_experimental9, _result_experimental10;
|
192
192
|
// Prevents usage of certain experimental features outside of canary
|
193
193
|
if ((_result_experimental7 = result.experimental) == null ? void 0 : _result_experimental7.ppr) {
|
@@ -81,7 +81,7 @@ export async function createHotReloaderTurbopack(opts, serverFields, distDir, re
|
|
81
81
|
}
|
82
82
|
const hasRewrites = opts.fsChecker.rewrites.afterFiles.length > 0 || opts.fsChecker.rewrites.beforeFiles.length > 0 || opts.fsChecker.rewrites.fallback.length > 0;
|
83
83
|
const hotReloaderSpan = trace('hot-reloader', undefined, {
|
84
|
-
version: "15.2.0-canary.
|
84
|
+
version: "15.2.0-canary.74"
|
85
85
|
});
|
86
86
|
// Ensure the hotReloaderSpan is flushed immediately as it's the parentSpan for all processing
|
87
87
|
// of the current `next dev` invocation.
|
@@ -179,7 +179,7 @@ export default class HotReloaderWebpack {
|
|
179
179
|
this.previewProps = previewProps;
|
180
180
|
this.rewrites = rewrites;
|
181
181
|
this.hotReloaderSpan = trace('hot-reloader', undefined, {
|
182
|
-
version: "15.2.0-canary.
|
182
|
+
version: "15.2.0-canary.74"
|
183
183
|
});
|
184
184
|
// Ensure the hotReloaderSpan is flushed immediately as it's the parentSpan for all processing
|
185
185
|
// of the current `next dev` invocation.
|
@@ -404,16 +404,17 @@ export async function handleEntrypoints({ entrypoints, currentEntrypoints, curre
|
|
404
404
|
const key = getEntryKey('root', 'server', 'middleware');
|
405
405
|
const endpoint = middleware.endpoint;
|
406
406
|
async function processMiddleware() {
|
407
|
+
var _manifestLoader_getMiddlewareManifest;
|
407
408
|
const writtenEndpoint = await endpoint.writeToDisk();
|
408
409
|
dev.hooks.handleWrittenEndpoint(key, writtenEndpoint);
|
409
410
|
processIssues(currentEntryIssues, key, writtenEndpoint, false, logErrors);
|
410
411
|
await manifestLoader.loadMiddlewareManifest('middleware', 'middleware');
|
411
|
-
|
412
|
-
|
412
|
+
const middlewareConfig = (_manifestLoader_getMiddlewareManifest = manifestLoader.getMiddlewareManifest(key)) == null ? void 0 : _manifestLoader_getMiddlewareManifest.middleware['/'];
|
413
|
+
if (dev && middlewareConfig) {
|
413
414
|
dev.serverFields.middleware = {
|
414
415
|
match: null,
|
415
416
|
page: '/',
|
416
|
-
matchers:
|
417
|
+
matchers: middlewareConfig.matchers
|
417
418
|
};
|
418
419
|
}
|
419
420
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/server/dev/turbopack-utils.ts"],"sourcesContent":["import type {\n ServerFields,\n SetupOpts,\n} from '../lib/router-utils/setup-dev-bundler'\nimport type {\n Issue,\n TurbopackResult,\n Endpoint,\n RawEntrypoints,\n Update as TurbopackUpdate,\n WrittenEndpoint,\n} from '../../build/swc/types'\nimport {\n type HMR_ACTION_TYPES,\n HMR_ACTIONS_SENT_TO_BROWSER,\n} from './hot-reloader-types'\nimport * as Log from '../../build/output/log'\nimport type { PropagateToWorkersField } from '../lib/router-utils/types'\nimport type { TurbopackManifestLoader } from '../../shared/lib/turbopack/manifest-loader'\nimport type { AppRoute, Entrypoints, PageRoute } from '../../build/swc/types'\nimport {\n type EntryKey,\n getEntryKey,\n splitEntryKey,\n} from '../../shared/lib/turbopack/entry-key'\nimport type ws from 'next/dist/compiled/ws'\nimport { isMetadataRoute } from '../../lib/metadata/is-metadata-route'\nimport type { CustomRoutes } from '../../lib/load-custom-routes'\nimport {\n formatIssue,\n getIssueKey,\n isRelevantWarning,\n processIssues,\n renderStyledStringToErrorAnsi,\n type EntryIssuesMap,\n type TopLevelIssuesMap,\n} from '../../shared/lib/turbopack/utils'\n\nconst onceErrorSet = new Set()\n/**\n * Check if given issue is a warning to be display only once.\n * This mimics behavior of get-page-static-info's warnOnce.\n * @param issue\n * @returns\n */\nfunction shouldEmitOnceWarning(issue: Issue): boolean {\n const { severity, title, stage } = issue\n if (severity === 'warning' && title.value === 'Invalid page configuration') {\n if (onceErrorSet.has(issue)) {\n return false\n }\n onceErrorSet.add(issue)\n }\n if (\n severity === 'warning' &&\n stage === 'config' &&\n renderStyledStringToErrorAnsi(issue.title).includes(\"can't be external\")\n ) {\n if (onceErrorSet.has(issue)) {\n return false\n }\n onceErrorSet.add(issue)\n }\n\n return true\n}\n\n/// Print out an issue to the console which should not block\n/// the build by throwing out or blocking error overlay.\nexport function printNonFatalIssue(issue: Issue) {\n if (isRelevantWarning(issue) && shouldEmitOnceWarning(issue)) {\n Log.warn(formatIssue(issue))\n }\n}\n\nexport function processTopLevelIssues(\n currentTopLevelIssues: TopLevelIssuesMap,\n result: TurbopackResult\n) {\n currentTopLevelIssues.clear()\n\n for (const issue of result.issues) {\n const issueKey = getIssueKey(issue)\n currentTopLevelIssues.set(issueKey, issue)\n }\n}\n\nconst MILLISECONDS_IN_NANOSECOND = BigInt(1_000_000)\n\nexport function msToNs(ms: number): bigint {\n return BigInt(Math.floor(ms)) * MILLISECONDS_IN_NANOSECOND\n}\n\nexport type ChangeSubscriptions = Map<\n EntryKey,\n Promise<AsyncIterableIterator<TurbopackResult>>\n>\n\nexport type HandleWrittenEndpoint = (\n key: EntryKey,\n result: TurbopackResult<WrittenEndpoint>\n) => void\n\nexport type StartChangeSubscription = (\n key: EntryKey,\n includeIssues: boolean,\n endpoint: Endpoint,\n makePayload: (\n change: TurbopackResult,\n hash: string\n ) => Promise<HMR_ACTION_TYPES> | HMR_ACTION_TYPES | void,\n onError?: (e: Error) => Promise<HMR_ACTION_TYPES> | HMR_ACTION_TYPES | void\n) => Promise<void>\n\nexport type StopChangeSubscription = (key: EntryKey) => Promise<void>\n\nexport type SendHmr = (id: string, payload: HMR_ACTION_TYPES) => void\n\nexport type StartBuilding = (\n id: string,\n requestUrl: string | undefined,\n forceRebuild: boolean\n) => () => void\n\nexport type ReadyIds = Set<string>\n\nexport type ClientState = {\n clientIssues: EntryIssuesMap\n hmrPayloads: Map<string, HMR_ACTION_TYPES>\n turbopackUpdates: TurbopackUpdate[]\n subscriptions: Map<string, AsyncIterator<any>>\n}\n\nexport type ClientStateMap = WeakMap<ws, ClientState>\n\n// hooks only used by the dev server.\ntype HandleRouteTypeHooks = {\n handleWrittenEndpoint: HandleWrittenEndpoint\n subscribeToChanges: StartChangeSubscription\n}\n\nexport async function handleRouteType({\n dev,\n page,\n pathname,\n route,\n currentEntryIssues,\n entrypoints,\n manifestLoader,\n readyIds,\n devRewrites,\n productionRewrites,\n hooks,\n logErrors,\n}: {\n dev: boolean\n page: string\n pathname: string\n route: PageRoute | AppRoute\n\n currentEntryIssues: EntryIssuesMap\n entrypoints: Entrypoints\n manifestLoader: TurbopackManifestLoader\n devRewrites: SetupOpts['fsChecker']['rewrites'] | undefined\n productionRewrites: CustomRoutes['rewrites'] | undefined\n logErrors: boolean\n\n readyIds?: ReadyIds // dev\n\n hooks?: HandleRouteTypeHooks // dev\n}) {\n const shouldCreateWebpackStats = process.env.TURBOPACK_STATS != null\n\n switch (route.type) {\n case 'page': {\n const clientKey = getEntryKey('pages', 'client', page)\n const serverKey = getEntryKey('pages', 'server', page)\n\n try {\n if (entrypoints.global.app) {\n const key = getEntryKey('pages', 'server', '_app')\n\n const writtenEndpoint = await entrypoints.global.app.writeToDisk()\n hooks?.handleWrittenEndpoint(key, writtenEndpoint)\n processIssues(\n currentEntryIssues,\n key,\n writtenEndpoint,\n false,\n logErrors\n )\n }\n await manifestLoader.loadBuildManifest('_app')\n await manifestLoader.loadPagesManifest('_app')\n\n if (entrypoints.global.document) {\n const key = getEntryKey('pages', 'server', '_document')\n\n const writtenEndpoint =\n await entrypoints.global.document.writeToDisk()\n hooks?.handleWrittenEndpoint(key, writtenEndpoint)\n processIssues(\n currentEntryIssues,\n key,\n writtenEndpoint,\n false,\n logErrors\n )\n }\n await manifestLoader.loadPagesManifest('_document')\n\n const writtenEndpoint = await route.htmlEndpoint.writeToDisk()\n hooks?.handleWrittenEndpoint(serverKey, writtenEndpoint)\n\n const type = writtenEndpoint?.type\n\n await manifestLoader.loadBuildManifest(page)\n await manifestLoader.loadPagesManifest(page)\n if (type === 'edge') {\n await manifestLoader.loadMiddlewareManifest(page, 'pages')\n } else {\n manifestLoader.deleteMiddlewareManifest(serverKey)\n }\n await manifestLoader.loadFontManifest('/_app', 'pages')\n await manifestLoader.loadFontManifest(page, 'pages')\n\n if (shouldCreateWebpackStats) {\n await manifestLoader.loadWebpackStats(page, 'pages')\n }\n\n await manifestLoader.writeManifests({\n devRewrites,\n productionRewrites,\n entrypoints,\n })\n\n processIssues(\n currentEntryIssues,\n serverKey,\n writtenEndpoint,\n false,\n logErrors\n )\n } finally {\n if (dev) {\n // TODO subscriptions should only be caused by the WebSocket connections\n // otherwise we don't known when to unsubscribe and this leaking\n hooks?.subscribeToChanges(\n serverKey,\n false,\n route.dataEndpoint,\n () => {\n // Report the next compilation again\n readyIds?.delete(pathname)\n return {\n event: HMR_ACTIONS_SENT_TO_BROWSER.SERVER_ONLY_CHANGES,\n pages: [page],\n }\n },\n (e) => {\n return {\n action: HMR_ACTIONS_SENT_TO_BROWSER.RELOAD_PAGE,\n data: `error in ${page} data subscription: ${e}`,\n }\n }\n )\n hooks?.subscribeToChanges(\n clientKey,\n false,\n route.htmlEndpoint,\n () => {\n return {\n event: HMR_ACTIONS_SENT_TO_BROWSER.CLIENT_CHANGES,\n }\n },\n (e) => {\n return {\n action: HMR_ACTIONS_SENT_TO_BROWSER.RELOAD_PAGE,\n data: `error in ${page} html subscription: ${e}`,\n }\n }\n )\n if (entrypoints.global.document) {\n hooks?.subscribeToChanges(\n getEntryKey('pages', 'server', '_document'),\n false,\n entrypoints.global.document,\n () => {\n return {\n action: HMR_ACTIONS_SENT_TO_BROWSER.RELOAD_PAGE,\n data: '_document has changed (page route)',\n }\n },\n (e) => {\n return {\n action: HMR_ACTIONS_SENT_TO_BROWSER.RELOAD_PAGE,\n data: `error in _document subscription (page route): ${e}`,\n }\n }\n )\n }\n }\n }\n\n break\n }\n case 'page-api': {\n const key = getEntryKey('pages', 'server', page)\n\n const writtenEndpoint = await route.endpoint.writeToDisk()\n hooks?.handleWrittenEndpoint(key, writtenEndpoint)\n\n const type = writtenEndpoint.type\n\n await manifestLoader.loadPagesManifest(page)\n if (type === 'edge') {\n await manifestLoader.loadMiddlewareManifest(page, 'pages')\n } else {\n manifestLoader.deleteMiddlewareManifest(key)\n }\n\n await manifestLoader.writeManifests({\n devRewrites,\n productionRewrites,\n entrypoints,\n })\n\n processIssues(currentEntryIssues, key, writtenEndpoint, true, logErrors)\n\n break\n }\n case 'app-page': {\n const key = getEntryKey('app', 'server', page)\n\n const writtenEndpoint = await route.htmlEndpoint.writeToDisk()\n hooks?.handleWrittenEndpoint(key, writtenEndpoint)\n\n if (dev) {\n // TODO subscriptions should only be caused by the WebSocket connections\n // otherwise we don't known when to unsubscribe and this leaking\n hooks?.subscribeToChanges(\n key,\n true,\n route.rscEndpoint,\n (change, hash) => {\n if (change.issues.some((issue) => issue.severity === 'error')) {\n // Ignore any updates that has errors\n // There will be another update without errors eventually\n return\n }\n // Report the next compilation again\n readyIds?.delete(pathname)\n return {\n action: HMR_ACTIONS_SENT_TO_BROWSER.SERVER_COMPONENT_CHANGES,\n hash,\n }\n },\n (e) => {\n return {\n action: HMR_ACTIONS_SENT_TO_BROWSER.RELOAD_PAGE,\n data: `error in ${page} app-page subscription: ${e}`,\n }\n }\n )\n }\n\n const type = writtenEndpoint.type\n\n if (type === 'edge') {\n await manifestLoader.loadMiddlewareManifest(page, 'app')\n } else {\n manifestLoader.deleteMiddlewareManifest(key)\n }\n\n await manifestLoader.loadAppBuildManifest(page)\n await manifestLoader.loadBuildManifest(page, 'app')\n await manifestLoader.loadAppPathsManifest(page)\n await manifestLoader.loadActionManifest(page)\n await manifestLoader.loadFontManifest(page, 'app')\n\n if (shouldCreateWebpackStats) {\n await manifestLoader.loadWebpackStats(page, 'app')\n }\n\n await manifestLoader.writeManifests({\n devRewrites,\n productionRewrites,\n entrypoints,\n })\n\n processIssues(currentEntryIssues, key, writtenEndpoint, dev, logErrors)\n\n break\n }\n case 'app-route': {\n const key = getEntryKey('app', 'server', page)\n\n const writtenEndpoint = await route.endpoint.writeToDisk()\n hooks?.handleWrittenEndpoint(key, writtenEndpoint)\n\n const type = writtenEndpoint.type\n\n await manifestLoader.loadAppPathsManifest(page)\n\n if (type === 'edge') {\n await manifestLoader.loadMiddlewareManifest(page, 'app')\n } else {\n manifestLoader.deleteMiddlewareManifest(key)\n }\n\n await manifestLoader.writeManifests({\n devRewrites,\n productionRewrites,\n entrypoints,\n })\n processIssues(currentEntryIssues, key, writtenEndpoint, true, logErrors)\n\n break\n }\n default: {\n throw new Error(`unknown route type ${(route as any).type} for ${page}`)\n }\n }\n}\n\n/**\n * Maintains a mapping between entrypoins and the corresponding client asset paths.\n */\nexport class AssetMapper {\n private entryMap: Map<EntryKey, Set<string>> = new Map()\n private assetMap: Map<string, Set<EntryKey>> = new Map()\n\n /**\n * Overrides asset paths for a key and updates the mapping from path to key.\n *\n * @param key\n * @param assetPaths asset paths relative to the .next directory\n */\n setPathsForKey(key: EntryKey, assetPaths: string[]): void {\n this.delete(key)\n\n const newAssetPaths = new Set(assetPaths)\n this.entryMap.set(key, newAssetPaths)\n\n for (const assetPath of newAssetPaths) {\n let assetPathKeys = this.assetMap.get(assetPath)\n if (!assetPathKeys) {\n assetPathKeys = new Set()\n this.assetMap.set(assetPath, assetPathKeys)\n }\n\n assetPathKeys!.add(key)\n }\n }\n\n /**\n * Deletes the key and any asset only referenced by this key.\n *\n * @param key\n */\n delete(key: EntryKey) {\n for (const assetPath of this.getAssetPathsByKey(key)) {\n const assetPathKeys = this.assetMap.get(assetPath)\n\n assetPathKeys?.delete(key)\n\n if (!assetPathKeys?.size) {\n this.assetMap.delete(assetPath)\n }\n }\n\n this.entryMap.delete(key)\n }\n\n getAssetPathsByKey(key: EntryKey): string[] {\n return Array.from(this.entryMap.get(key) ?? [])\n }\n\n getKeysByAsset(path: string): EntryKey[] {\n return Array.from(this.assetMap.get(path) ?? [])\n }\n\n keys(): IterableIterator<EntryKey> {\n return this.entryMap.keys()\n }\n}\n\nexport function hasEntrypointForKey(\n entrypoints: Entrypoints,\n key: EntryKey,\n assetMapper: AssetMapper | undefined\n): boolean {\n const { type, page } = splitEntryKey(key)\n\n switch (type) {\n case 'app':\n return entrypoints.app.has(page)\n case 'pages':\n switch (page) {\n case '_app':\n return entrypoints.global.app != null\n case '_document':\n return entrypoints.global.document != null\n case '_error':\n return entrypoints.global.error != null\n default:\n return entrypoints.page.has(page)\n }\n case 'root':\n switch (page) {\n case 'middleware':\n return entrypoints.global.middleware != null\n case 'instrumentation':\n return entrypoints.global.instrumentation != null\n default:\n return false\n }\n case 'assets':\n if (!assetMapper) {\n return false\n }\n\n return assetMapper\n .getKeysByAsset(page)\n .some((pageKey) =>\n hasEntrypointForKey(entrypoints, pageKey, assetMapper)\n )\n default: {\n // validation that we covered all cases, this should never run.\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const _: never = type\n return false\n }\n }\n}\n\n// hooks only used by the dev server.\ntype HandleEntrypointsHooks = {\n handleWrittenEndpoint: HandleWrittenEndpoint\n propagateServerField: (\n field: PropagateToWorkersField,\n args: any\n ) => Promise<void>\n sendHmr: SendHmr\n startBuilding: StartBuilding\n subscribeToChanges: StartChangeSubscription\n unsubscribeFromChanges: StopChangeSubscription\n unsubscribeFromHmrEvents: (client: ws, id: string) => void\n}\n\ntype HandleEntrypointsDevOpts = {\n assetMapper: AssetMapper\n changeSubscriptions: ChangeSubscriptions\n clients: Set<ws>\n clientStates: ClientStateMap\n serverFields: ServerFields\n\n hooks: HandleEntrypointsHooks\n}\n\nexport async function handleEntrypoints({\n entrypoints,\n\n currentEntrypoints,\n\n currentEntryIssues,\n manifestLoader,\n devRewrites,\n logErrors,\n dev,\n}: {\n entrypoints: TurbopackResult<RawEntrypoints>\n\n currentEntrypoints: Entrypoints\n\n currentEntryIssues: EntryIssuesMap\n manifestLoader: TurbopackManifestLoader\n devRewrites: SetupOpts['fsChecker']['rewrites'] | undefined\n productionRewrites: CustomRoutes['rewrites'] | undefined\n logErrors: boolean\n\n dev: HandleEntrypointsDevOpts\n}) {\n currentEntrypoints.global.app = entrypoints.pagesAppEndpoint\n currentEntrypoints.global.document = entrypoints.pagesDocumentEndpoint\n currentEntrypoints.global.error = entrypoints.pagesErrorEndpoint\n\n currentEntrypoints.global.instrumentation = entrypoints.instrumentation\n\n currentEntrypoints.page.clear()\n currentEntrypoints.app.clear()\n\n for (const [pathname, route] of entrypoints.routes) {\n switch (route.type) {\n case 'page':\n case 'page-api':\n currentEntrypoints.page.set(pathname, route)\n break\n case 'app-page': {\n route.pages.forEach((page) => {\n currentEntrypoints.app.set(page.originalName, {\n type: 'app-page',\n ...page,\n })\n })\n break\n }\n case 'app-route': {\n currentEntrypoints.app.set(route.originalName, route)\n break\n }\n default:\n Log.info(`skipping ${pathname} (${route.type})`)\n break\n }\n }\n\n if (dev) {\n await handleEntrypointsDevCleanup({\n currentEntryIssues,\n currentEntrypoints,\n\n ...dev,\n })\n }\n\n const { middleware, instrumentation } = entrypoints\n\n // We check for explicit true/false, since it's initialized to\n // undefined during the first loop (middlewareChanges event is\n // unnecessary during the first serve)\n if (currentEntrypoints.global.middleware && !middleware) {\n const key = getEntryKey('root', 'server', 'middleware')\n // Went from middleware to no middleware\n await dev?.hooks.unsubscribeFromChanges(key)\n currentEntryIssues.delete(key)\n dev.hooks.sendHmr('middleware', {\n event: HMR_ACTIONS_SENT_TO_BROWSER.MIDDLEWARE_CHANGES,\n })\n } else if (!currentEntrypoints.global.middleware && middleware) {\n // Went from no middleware to middleware\n dev.hooks.sendHmr('middleware', {\n event: HMR_ACTIONS_SENT_TO_BROWSER.MIDDLEWARE_CHANGES,\n })\n }\n\n currentEntrypoints.global.middleware = middleware\n\n if (instrumentation) {\n const processInstrumentation = async (\n name: string,\n prop: 'nodeJs' | 'edge'\n ) => {\n const key = getEntryKey('root', 'server', name)\n\n const writtenEndpoint = await instrumentation[prop].writeToDisk()\n dev.hooks.handleWrittenEndpoint(key, writtenEndpoint)\n processIssues(currentEntryIssues, key, writtenEndpoint, false, logErrors)\n }\n await processInstrumentation('instrumentation.nodeJs', 'nodeJs')\n await processInstrumentation('instrumentation.edge', 'edge')\n await manifestLoader.loadMiddlewareManifest(\n 'instrumentation',\n 'instrumentation'\n )\n await manifestLoader.writeManifests({\n devRewrites,\n productionRewrites: undefined,\n entrypoints: currentEntrypoints,\n })\n\n dev.serverFields.actualInstrumentationHookFile = '/instrumentation'\n await dev.hooks.propagateServerField(\n 'actualInstrumentationHookFile',\n dev.serverFields.actualInstrumentationHookFile\n )\n } else {\n dev.serverFields.actualInstrumentationHookFile = undefined\n await dev.hooks.propagateServerField(\n 'actualInstrumentationHookFile',\n dev.serverFields.actualInstrumentationHookFile\n )\n }\n\n if (middleware) {\n const key = getEntryKey('root', 'server', 'middleware')\n\n const endpoint = middleware.endpoint\n\n async function processMiddleware() {\n const writtenEndpoint = await endpoint.writeToDisk()\n dev.hooks.handleWrittenEndpoint(key, writtenEndpoint)\n processIssues(currentEntryIssues, key, writtenEndpoint, false, logErrors)\n await manifestLoader.loadMiddlewareManifest('middleware', 'middleware')\n if (dev) {\n dev.serverFields.middleware = {\n match: null as any,\n page: '/',\n matchers:\n manifestLoader.getMiddlewareManifest(key)?.middleware['/'].matchers,\n }\n }\n }\n await processMiddleware()\n\n if (dev) {\n dev?.hooks.subscribeToChanges(\n key,\n false,\n endpoint,\n async () => {\n const finishBuilding = dev.hooks.startBuilding(\n 'middleware',\n undefined,\n true\n )\n await processMiddleware()\n await dev.hooks.propagateServerField(\n 'actualMiddlewareFile',\n dev.serverFields.actualMiddlewareFile\n )\n await dev.hooks.propagateServerField(\n 'middleware',\n dev.serverFields.middleware\n )\n await manifestLoader.writeManifests({\n devRewrites,\n productionRewrites: undefined,\n entrypoints: currentEntrypoints,\n })\n\n finishBuilding?.()\n return { event: HMR_ACTIONS_SENT_TO_BROWSER.MIDDLEWARE_CHANGES }\n },\n () => {\n return {\n event: HMR_ACTIONS_SENT_TO_BROWSER.MIDDLEWARE_CHANGES,\n }\n }\n )\n }\n } else {\n manifestLoader.deleteMiddlewareManifest(\n getEntryKey('root', 'server', 'middleware')\n )\n dev.serverFields.actualMiddlewareFile = undefined\n dev.serverFields.middleware = undefined\n }\n\n await dev.hooks.propagateServerField(\n 'actualMiddlewareFile',\n dev.serverFields.actualMiddlewareFile\n )\n await dev.hooks.propagateServerField(\n 'middleware',\n dev.serverFields.middleware\n )\n}\n\nasync function handleEntrypointsDevCleanup({\n currentEntryIssues,\n currentEntrypoints,\n\n assetMapper,\n changeSubscriptions,\n clients,\n clientStates,\n\n hooks,\n}: {\n currentEntrypoints: Entrypoints\n currentEntryIssues: EntryIssuesMap\n} & HandleEntrypointsDevOpts) {\n // this needs to be first as `hasEntrypointForKey` uses the `assetMapper`\n for (const key of assetMapper.keys()) {\n if (!hasEntrypointForKey(currentEntrypoints, key, assetMapper)) {\n assetMapper.delete(key)\n }\n }\n\n for (const key of changeSubscriptions.keys()) {\n // middleware is handled separately\n if (!hasEntrypointForKey(currentEntrypoints, key, assetMapper)) {\n await hooks.unsubscribeFromChanges(key)\n }\n }\n\n for (const [key] of currentEntryIssues) {\n if (!hasEntrypointForKey(currentEntrypoints, key, assetMapper)) {\n currentEntryIssues.delete(key)\n }\n }\n\n for (const client of clients) {\n const state = clientStates.get(client)\n if (!state) {\n continue\n }\n\n for (const key of state.clientIssues.keys()) {\n if (!hasEntrypointForKey(currentEntrypoints, key, assetMapper)) {\n state.clientIssues.delete(key)\n }\n }\n\n for (const id of state.subscriptions.keys()) {\n if (\n !hasEntrypointForKey(\n currentEntrypoints,\n getEntryKey('assets', 'client', id),\n assetMapper\n )\n ) {\n hooks.unsubscribeFromHmrEvents(client, id)\n }\n }\n }\n}\n\nexport async function handlePagesErrorRoute({\n currentEntryIssues,\n entrypoints,\n manifestLoader,\n devRewrites,\n productionRewrites,\n logErrors,\n hooks,\n}: {\n currentEntryIssues: EntryIssuesMap\n entrypoints: Entrypoints\n manifestLoader: TurbopackManifestLoader\n devRewrites: SetupOpts['fsChecker']['rewrites'] | undefined\n productionRewrites: CustomRoutes['rewrites'] | undefined\n logErrors: boolean\n hooks: HandleRouteTypeHooks\n}) {\n if (entrypoints.global.app) {\n const key = getEntryKey('pages', 'server', '_app')\n\n const writtenEndpoint = await entrypoints.global.app.writeToDisk()\n hooks.handleWrittenEndpoint(key, writtenEndpoint)\n hooks.subscribeToChanges(\n key,\n false,\n entrypoints.global.app,\n () => {\n // There's a special case for this in `../client/page-bootstrap.ts`.\n // https://github.com/vercel/next.js/blob/08d7a7e5189a835f5dcb82af026174e587575c0e/packages/next/src/client/page-bootstrap.ts#L69-L71\n return { event: HMR_ACTIONS_SENT_TO_BROWSER.CLIENT_CHANGES }\n },\n () => {\n return {\n action: HMR_ACTIONS_SENT_TO_BROWSER.RELOAD_PAGE,\n data: '_app has changed (error route)',\n }\n }\n )\n processIssues(currentEntryIssues, key, writtenEndpoint, false, logErrors)\n }\n await manifestLoader.loadBuildManifest('_app')\n await manifestLoader.loadPagesManifest('_app')\n await manifestLoader.loadFontManifest('_app')\n\n if (entrypoints.global.document) {\n const key = getEntryKey('pages', 'server', '_document')\n\n const writtenEndpoint = await entrypoints.global.document.writeToDisk()\n hooks.handleWrittenEndpoint(key, writtenEndpoint)\n hooks.subscribeToChanges(\n key,\n false,\n entrypoints.global.document,\n () => {\n return {\n action: HMR_ACTIONS_SENT_TO_BROWSER.RELOAD_PAGE,\n data: '_document has changed (error route)',\n }\n },\n (e) => {\n return {\n action: HMR_ACTIONS_SENT_TO_BROWSER.RELOAD_PAGE,\n data: `error in _document subscription (error route): ${e}`,\n }\n }\n )\n processIssues(currentEntryIssues, key, writtenEndpoint, false, logErrors)\n }\n await manifestLoader.loadPagesManifest('_document')\n\n if (entrypoints.global.error) {\n const key = getEntryKey('pages', 'server', '_error')\n\n const writtenEndpoint = await entrypoints.global.error.writeToDisk()\n hooks.handleWrittenEndpoint(key, writtenEndpoint)\n hooks.subscribeToChanges(\n key,\n false,\n entrypoints.global.error,\n () => {\n // There's a special case for this in `../client/page-bootstrap.ts`.\n // https://github.com/vercel/next.js/blob/08d7a7e5189a835f5dcb82af026174e587575c0e/packages/next/src/client/page-bootstrap.ts#L69-L71\n return { event: HMR_ACTIONS_SENT_TO_BROWSER.CLIENT_CHANGES }\n },\n (e) => {\n return {\n action: HMR_ACTIONS_SENT_TO_BROWSER.RELOAD_PAGE,\n data: `error in _error subscription: ${e}`,\n }\n }\n )\n processIssues(currentEntryIssues, key, writtenEndpoint, false, logErrors)\n }\n await manifestLoader.loadBuildManifest('_error')\n await manifestLoader.loadPagesManifest('_error')\n await manifestLoader.loadFontManifest('_error')\n\n await manifestLoader.writeManifests({\n devRewrites,\n productionRewrites,\n entrypoints,\n })\n}\n\nexport function removeRouteSuffix(route: string): string {\n return route.replace(/\\/route$/, '')\n}\n\nexport function addRouteSuffix(route: string): string {\n return route + '/route'\n}\n\nexport function addMetadataIdToRoute(route: string): string {\n return route + '/[__metadata_id__]'\n}\n\n// Since turbopack will create app pages/route entries based on the structure,\n// which means the entry keys are based on file names.\n// But for special metadata conventions we'll change the page/pathname to a different path.\n// So we need this helper to map the new path back to original turbopack entry key.\nexport function normalizedPageToTurbopackStructureRoute(\n route: string,\n ext: string | false\n): string {\n let entrypointKey = route\n if (isMetadataRoute(entrypointKey)) {\n entrypointKey = entrypointKey.endsWith('/route')\n ? entrypointKey.slice(0, -'/route'.length)\n : entrypointKey\n\n if (ext) {\n if (entrypointKey.endsWith('/[__metadata_id__]')) {\n entrypointKey = entrypointKey.slice(0, -'/[__metadata_id__]'.length)\n }\n if (entrypointKey.endsWith('/sitemap.xml') && ext !== '.xml') {\n // For dynamic sitemap route, remove the extension\n entrypointKey = entrypointKey.slice(0, -'.xml'.length)\n }\n }\n entrypointKey = entrypointKey + '/route'\n }\n return entrypointKey\n}\n"],"names":["HMR_ACTIONS_SENT_TO_BROWSER","Log","getEntryKey","splitEntryKey","isMetadataRoute","formatIssue","getIssueKey","isRelevantWarning","processIssues","renderStyledStringToErrorAnsi","onceErrorSet","Set","shouldEmitOnceWarning","issue","severity","title","stage","value","has","add","includes","printNonFatalIssue","warn","processTopLevelIssues","currentTopLevelIssues","result","clear","issues","issueKey","set","MILLISECONDS_IN_NANOSECOND","BigInt","msToNs","ms","Math","floor","handleRouteType","dev","page","pathname","route","currentEntryIssues","entrypoints","manifestLoader","readyIds","devRewrites","productionRewrites","hooks","logErrors","shouldCreateWebpackStats","process","env","TURBOPACK_STATS","type","clientKey","serverKey","global","app","key","writtenEndpoint","writeToDisk","handleWrittenEndpoint","loadBuildManifest","loadPagesManifest","document","htmlEndpoint","loadMiddlewareManifest","deleteMiddlewareManifest","loadFontManifest","loadWebpackStats","writeManifests","subscribeToChanges","dataEndpoint","delete","event","SERVER_ONLY_CHANGES","pages","e","action","RELOAD_PAGE","data","CLIENT_CHANGES","endpoint","rscEndpoint","change","hash","some","SERVER_COMPONENT_CHANGES","loadAppBuildManifest","loadAppPathsManifest","loadActionManifest","Error","AssetMapper","setPathsForKey","assetPaths","newAssetPaths","entryMap","assetPath","assetPathKeys","assetMap","get","getAssetPathsByKey","size","Array","from","getKeysByAsset","path","keys","Map","hasEntrypointForKey","assetMapper","error","middleware","instrumentation","pageKey","_","handleEntrypoints","currentEntrypoints","pagesAppEndpoint","pagesDocumentEndpoint","pagesErrorEndpoint","routes","forEach","originalName","info","handleEntrypointsDevCleanup","unsubscribeFromChanges","sendHmr","MIDDLEWARE_CHANGES","processInstrumentation","name","prop","undefined","serverFields","actualInstrumentationHookFile","propagateServerField","processMiddleware","match","matchers","getMiddlewareManifest","finishBuilding","startBuilding","actualMiddlewareFile","changeSubscriptions","clients","clientStates","client","state","clientIssues","id","subscriptions","unsubscribeFromHmrEvents","handlePagesErrorRoute","removeRouteSuffix","replace","addRouteSuffix","addMetadataIdToRoute","normalizedPageToTurbopackStructureRoute","ext","entrypointKey","endsWith","slice","length"],"mappings":"AAYA,SAEEA,2BAA2B,QACtB,uBAAsB;AAC7B,YAAYC,SAAS,yBAAwB;AAI7C,SAEEC,WAAW,EACXC,aAAa,QACR,uCAAsC;AAE7C,SAASC,eAAe,QAAQ,uCAAsC;AAEtE,SACEC,WAAW,EACXC,WAAW,EACXC,iBAAiB,EACjBC,aAAa,EACbC,6BAA6B,QAGxB,mCAAkC;AAEzC,MAAMC,eAAe,IAAIC;AACzB;;;;;CAKC,GACD,SAASC,sBAAsBC,KAAY;IACzC,MAAM,EAAEC,QAAQ,EAAEC,KAAK,EAAEC,KAAK,EAAE,GAAGH;IACnC,IAAIC,aAAa,aAAaC,MAAME,KAAK,KAAK,8BAA8B;QAC1E,IAAIP,aAAaQ,GAAG,CAACL,QAAQ;YAC3B,OAAO;QACT;QACAH,aAAaS,GAAG,CAACN;IACnB;IACA,IACEC,aAAa,aACbE,UAAU,YACVP,8BAA8BI,MAAME,KAAK,EAAEK,QAAQ,CAAC,sBACpD;QACA,IAAIV,aAAaQ,GAAG,CAACL,QAAQ;YAC3B,OAAO;QACT;QACAH,aAAaS,GAAG,CAACN;IACnB;IAEA,OAAO;AACT;AAEA,4DAA4D;AAC5D,wDAAwD;AACxD,OAAO,SAASQ,mBAAmBR,KAAY;IAC7C,IAAIN,kBAAkBM,UAAUD,sBAAsBC,QAAQ;QAC5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H,KAAa;IAChD,OAAOA,QAAQ;AACjB;AAEA,8EAA8E;AAC9E,sDAAsD;AACtD,2FAA2F;AAC3F,mFAAmF;AACnF,OAAO,SAASqH,wCACdrH,KAAa,EACbsH,GAAmB;IAEnB,IAAIC,gBAAgBvH;IACpB,IAAIpC,gBAAgB2J,gBAAgB;QAClCA,gBAAgBA,cAAcC,QAAQ,CAAC,YACnCD,cAAcE,KAAK,CAAC,GAAG,CAAC,SAASC,MAAM,IACvCH;QAEJ,IAAID,KAAK;YACP,IAAIC,cAAcC,QAAQ,CAAC,uBAAuB;gBAChDD,gBAAgBA,cAAcE,KAAK,CAAC,GAAG,CAAC,qBAAqBC,MAAM;YACrE;YACA,IAAIH,cAAcC,QAAQ,CAAC,mBAAmBF,QAAQ,QAAQ;gBAC5D,kDAAkD;gBAClDC,gBAAgBA,cAAcE,KAAK,CAAC,GAAG,CAAC,OAAOC,MAAM;YACvD;QACF;QACAH,gBAAgBA,gBAAgB;IAClC;IACA,OAAOA;AACT"}
|
1
|
+
{"version":3,"sources":["../../../src/server/dev/turbopack-utils.ts"],"sourcesContent":["import type {\n ServerFields,\n SetupOpts,\n} from '../lib/router-utils/setup-dev-bundler'\nimport type {\n Issue,\n TurbopackResult,\n Endpoint,\n RawEntrypoints,\n Update as TurbopackUpdate,\n WrittenEndpoint,\n} from '../../build/swc/types'\nimport {\n type HMR_ACTION_TYPES,\n HMR_ACTIONS_SENT_TO_BROWSER,\n} from './hot-reloader-types'\nimport * as Log from '../../build/output/log'\nimport type { PropagateToWorkersField } from '../lib/router-utils/types'\nimport type { TurbopackManifestLoader } from '../../shared/lib/turbopack/manifest-loader'\nimport type { AppRoute, Entrypoints, PageRoute } from '../../build/swc/types'\nimport {\n type EntryKey,\n getEntryKey,\n splitEntryKey,\n} from '../../shared/lib/turbopack/entry-key'\nimport type ws from 'next/dist/compiled/ws'\nimport { isMetadataRoute } from '../../lib/metadata/is-metadata-route'\nimport type { CustomRoutes } from '../../lib/load-custom-routes'\nimport {\n formatIssue,\n getIssueKey,\n isRelevantWarning,\n processIssues,\n renderStyledStringToErrorAnsi,\n type EntryIssuesMap,\n type TopLevelIssuesMap,\n} from '../../shared/lib/turbopack/utils'\n\nconst onceErrorSet = new Set()\n/**\n * Check if given issue is a warning to be display only once.\n * This mimics behavior of get-page-static-info's warnOnce.\n * @param issue\n * @returns\n */\nfunction shouldEmitOnceWarning(issue: Issue): boolean {\n const { severity, title, stage } = issue\n if (severity === 'warning' && title.value === 'Invalid page configuration') {\n if (onceErrorSet.has(issue)) {\n return false\n }\n onceErrorSet.add(issue)\n }\n if (\n severity === 'warning' &&\n stage === 'config' &&\n renderStyledStringToErrorAnsi(issue.title).includes(\"can't be external\")\n ) {\n if (onceErrorSet.has(issue)) {\n return false\n }\n onceErrorSet.add(issue)\n }\n\n return true\n}\n\n/// Print out an issue to the console which should not block\n/// the build by throwing out or blocking error overlay.\nexport function printNonFatalIssue(issue: Issue) {\n if (isRelevantWarning(issue) && shouldEmitOnceWarning(issue)) {\n Log.warn(formatIssue(issue))\n }\n}\n\nexport function processTopLevelIssues(\n currentTopLevelIssues: TopLevelIssuesMap,\n result: TurbopackResult\n) {\n currentTopLevelIssues.clear()\n\n for (const issue of result.issues) {\n const issueKey = getIssueKey(issue)\n currentTopLevelIssues.set(issueKey, issue)\n }\n}\n\nconst MILLISECONDS_IN_NANOSECOND = BigInt(1_000_000)\n\nexport function msToNs(ms: number): bigint {\n return BigInt(Math.floor(ms)) * MILLISECONDS_IN_NANOSECOND\n}\n\nexport type ChangeSubscriptions = Map<\n EntryKey,\n Promise<AsyncIterableIterator<TurbopackResult>>\n>\n\nexport type HandleWrittenEndpoint = (\n key: EntryKey,\n result: TurbopackResult<WrittenEndpoint>\n) => void\n\nexport type StartChangeSubscription = (\n key: EntryKey,\n includeIssues: boolean,\n endpoint: Endpoint,\n makePayload: (\n change: TurbopackResult,\n hash: string\n ) => Promise<HMR_ACTION_TYPES> | HMR_ACTION_TYPES | void,\n onError?: (e: Error) => Promise<HMR_ACTION_TYPES> | HMR_ACTION_TYPES | void\n) => Promise<void>\n\nexport type StopChangeSubscription = (key: EntryKey) => Promise<void>\n\nexport type SendHmr = (id: string, payload: HMR_ACTION_TYPES) => void\n\nexport type StartBuilding = (\n id: string,\n requestUrl: string | undefined,\n forceRebuild: boolean\n) => () => void\n\nexport type ReadyIds = Set<string>\n\nexport type ClientState = {\n clientIssues: EntryIssuesMap\n hmrPayloads: Map<string, HMR_ACTION_TYPES>\n turbopackUpdates: TurbopackUpdate[]\n subscriptions: Map<string, AsyncIterator<any>>\n}\n\nexport type ClientStateMap = WeakMap<ws, ClientState>\n\n// hooks only used by the dev server.\ntype HandleRouteTypeHooks = {\n handleWrittenEndpoint: HandleWrittenEndpoint\n subscribeToChanges: StartChangeSubscription\n}\n\nexport async function handleRouteType({\n dev,\n page,\n pathname,\n route,\n currentEntryIssues,\n entrypoints,\n manifestLoader,\n readyIds,\n devRewrites,\n productionRewrites,\n hooks,\n logErrors,\n}: {\n dev: boolean\n page: string\n pathname: string\n route: PageRoute | AppRoute\n\n currentEntryIssues: EntryIssuesMap\n entrypoints: Entrypoints\n manifestLoader: TurbopackManifestLoader\n devRewrites: SetupOpts['fsChecker']['rewrites'] | undefined\n productionRewrites: CustomRoutes['rewrites'] | undefined\n logErrors: boolean\n\n readyIds?: ReadyIds // dev\n\n hooks?: HandleRouteTypeHooks // dev\n}) {\n const shouldCreateWebpackStats = process.env.TURBOPACK_STATS != null\n\n switch (route.type) {\n case 'page': {\n const clientKey = getEntryKey('pages', 'client', page)\n const serverKey = getEntryKey('pages', 'server', page)\n\n try {\n if (entrypoints.global.app) {\n const key = getEntryKey('pages', 'server', '_app')\n\n const writtenEndpoint = await entrypoints.global.app.writeToDisk()\n hooks?.handleWrittenEndpoint(key, writtenEndpoint)\n processIssues(\n currentEntryIssues,\n key,\n writtenEndpoint,\n false,\n logErrors\n )\n }\n await manifestLoader.loadBuildManifest('_app')\n await manifestLoader.loadPagesManifest('_app')\n\n if (entrypoints.global.document) {\n const key = getEntryKey('pages', 'server', '_document')\n\n const writtenEndpoint =\n await entrypoints.global.document.writeToDisk()\n hooks?.handleWrittenEndpoint(key, writtenEndpoint)\n processIssues(\n currentEntryIssues,\n key,\n writtenEndpoint,\n false,\n logErrors\n )\n }\n await manifestLoader.loadPagesManifest('_document')\n\n const writtenEndpoint = await route.htmlEndpoint.writeToDisk()\n hooks?.handleWrittenEndpoint(serverKey, writtenEndpoint)\n\n const type = writtenEndpoint?.type\n\n await manifestLoader.loadBuildManifest(page)\n await manifestLoader.loadPagesManifest(page)\n if (type === 'edge') {\n await manifestLoader.loadMiddlewareManifest(page, 'pages')\n } else {\n manifestLoader.deleteMiddlewareManifest(serverKey)\n }\n await manifestLoader.loadFontManifest('/_app', 'pages')\n await manifestLoader.loadFontManifest(page, 'pages')\n\n if (shouldCreateWebpackStats) {\n await manifestLoader.loadWebpackStats(page, 'pages')\n }\n\n await manifestLoader.writeManifests({\n devRewrites,\n productionRewrites,\n entrypoints,\n })\n\n processIssues(\n currentEntryIssues,\n serverKey,\n writtenEndpoint,\n false,\n logErrors\n )\n } finally {\n if (dev) {\n // TODO subscriptions should only be caused by the WebSocket connections\n // otherwise we don't known when to unsubscribe and this leaking\n hooks?.subscribeToChanges(\n serverKey,\n false,\n route.dataEndpoint,\n () => {\n // Report the next compilation again\n readyIds?.delete(pathname)\n return {\n event: HMR_ACTIONS_SENT_TO_BROWSER.SERVER_ONLY_CHANGES,\n pages: [page],\n }\n },\n (e) => {\n return {\n action: HMR_ACTIONS_SENT_TO_BROWSER.RELOAD_PAGE,\n data: `error in ${page} data subscription: ${e}`,\n }\n }\n )\n hooks?.subscribeToChanges(\n clientKey,\n false,\n route.htmlEndpoint,\n () => {\n return {\n event: HMR_ACTIONS_SENT_TO_BROWSER.CLIENT_CHANGES,\n }\n },\n (e) => {\n return {\n action: HMR_ACTIONS_SENT_TO_BROWSER.RELOAD_PAGE,\n data: `error in ${page} html subscription: ${e}`,\n }\n }\n )\n if (entrypoints.global.document) {\n hooks?.subscribeToChanges(\n getEntryKey('pages', 'server', '_document'),\n false,\n entrypoints.global.document,\n () => {\n return {\n action: HMR_ACTIONS_SENT_TO_BROWSER.RELOAD_PAGE,\n data: '_document has changed (page route)',\n }\n },\n (e) => {\n return {\n action: HMR_ACTIONS_SENT_TO_BROWSER.RELOAD_PAGE,\n data: `error in _document subscription (page route): ${e}`,\n }\n }\n )\n }\n }\n }\n\n break\n }\n case 'page-api': {\n const key = getEntryKey('pages', 'server', page)\n\n const writtenEndpoint = await route.endpoint.writeToDisk()\n hooks?.handleWrittenEndpoint(key, writtenEndpoint)\n\n const type = writtenEndpoint.type\n\n await manifestLoader.loadPagesManifest(page)\n if (type === 'edge') {\n await manifestLoader.loadMiddlewareManifest(page, 'pages')\n } else {\n manifestLoader.deleteMiddlewareManifest(key)\n }\n\n await manifestLoader.writeManifests({\n devRewrites,\n productionRewrites,\n entrypoints,\n })\n\n processIssues(currentEntryIssues, key, writtenEndpoint, true, logErrors)\n\n break\n }\n case 'app-page': {\n const key = getEntryKey('app', 'server', page)\n\n const writtenEndpoint = await route.htmlEndpoint.writeToDisk()\n hooks?.handleWrittenEndpoint(key, writtenEndpoint)\n\n if (dev) {\n // TODO subscriptions should only be caused by the WebSocket connections\n // otherwise we don't known when to unsubscribe and this leaking\n hooks?.subscribeToChanges(\n key,\n true,\n route.rscEndpoint,\n (change, hash) => {\n if (change.issues.some((issue) => issue.severity === 'error')) {\n // Ignore any updates that has errors\n // There will be another update without errors eventually\n return\n }\n // Report the next compilation again\n readyIds?.delete(pathname)\n return {\n action: HMR_ACTIONS_SENT_TO_BROWSER.SERVER_COMPONENT_CHANGES,\n hash,\n }\n },\n (e) => {\n return {\n action: HMR_ACTIONS_SENT_TO_BROWSER.RELOAD_PAGE,\n data: `error in ${page} app-page subscription: ${e}`,\n }\n }\n )\n }\n\n const type = writtenEndpoint.type\n\n if (type === 'edge') {\n await manifestLoader.loadMiddlewareManifest(page, 'app')\n } else {\n manifestLoader.deleteMiddlewareManifest(key)\n }\n\n await manifestLoader.loadAppBuildManifest(page)\n await manifestLoader.loadBuildManifest(page, 'app')\n await manifestLoader.loadAppPathsManifest(page)\n await manifestLoader.loadActionManifest(page)\n await manifestLoader.loadFontManifest(page, 'app')\n\n if (shouldCreateWebpackStats) {\n await manifestLoader.loadWebpackStats(page, 'app')\n }\n\n await manifestLoader.writeManifests({\n devRewrites,\n productionRewrites,\n entrypoints,\n })\n\n processIssues(currentEntryIssues, key, writtenEndpoint, dev, logErrors)\n\n break\n }\n case 'app-route': {\n const key = getEntryKey('app', 'server', page)\n\n const writtenEndpoint = await route.endpoint.writeToDisk()\n hooks?.handleWrittenEndpoint(key, writtenEndpoint)\n\n const type = writtenEndpoint.type\n\n await manifestLoader.loadAppPathsManifest(page)\n\n if (type === 'edge') {\n await manifestLoader.loadMiddlewareManifest(page, 'app')\n } else {\n manifestLoader.deleteMiddlewareManifest(key)\n }\n\n await manifestLoader.writeManifests({\n devRewrites,\n productionRewrites,\n entrypoints,\n })\n processIssues(currentEntryIssues, key, writtenEndpoint, true, logErrors)\n\n break\n }\n default: {\n throw new Error(`unknown route type ${(route as any).type} for ${page}`)\n }\n }\n}\n\n/**\n * Maintains a mapping between entrypoins and the corresponding client asset paths.\n */\nexport class AssetMapper {\n private entryMap: Map<EntryKey, Set<string>> = new Map()\n private assetMap: Map<string, Set<EntryKey>> = new Map()\n\n /**\n * Overrides asset paths for a key and updates the mapping from path to key.\n *\n * @param key\n * @param assetPaths asset paths relative to the .next directory\n */\n setPathsForKey(key: EntryKey, assetPaths: string[]): void {\n this.delete(key)\n\n const newAssetPaths = new Set(assetPaths)\n this.entryMap.set(key, newAssetPaths)\n\n for (const assetPath of newAssetPaths) {\n let assetPathKeys = this.assetMap.get(assetPath)\n if (!assetPathKeys) {\n assetPathKeys = new Set()\n this.assetMap.set(assetPath, assetPathKeys)\n }\n\n assetPathKeys!.add(key)\n }\n }\n\n /**\n * Deletes the key and any asset only referenced by this key.\n *\n * @param key\n */\n delete(key: EntryKey) {\n for (const assetPath of this.getAssetPathsByKey(key)) {\n const assetPathKeys = this.assetMap.get(assetPath)\n\n assetPathKeys?.delete(key)\n\n if (!assetPathKeys?.size) {\n this.assetMap.delete(assetPath)\n }\n }\n\n this.entryMap.delete(key)\n }\n\n getAssetPathsByKey(key: EntryKey): string[] {\n return Array.from(this.entryMap.get(key) ?? [])\n }\n\n getKeysByAsset(path: string): EntryKey[] {\n return Array.from(this.assetMap.get(path) ?? [])\n }\n\n keys(): IterableIterator<EntryKey> {\n return this.entryMap.keys()\n }\n}\n\nexport function hasEntrypointForKey(\n entrypoints: Entrypoints,\n key: EntryKey,\n assetMapper: AssetMapper | undefined\n): boolean {\n const { type, page } = splitEntryKey(key)\n\n switch (type) {\n case 'app':\n return entrypoints.app.has(page)\n case 'pages':\n switch (page) {\n case '_app':\n return entrypoints.global.app != null\n case '_document':\n return entrypoints.global.document != null\n case '_error':\n return entrypoints.global.error != null\n default:\n return entrypoints.page.has(page)\n }\n case 'root':\n switch (page) {\n case 'middleware':\n return entrypoints.global.middleware != null\n case 'instrumentation':\n return entrypoints.global.instrumentation != null\n default:\n return false\n }\n case 'assets':\n if (!assetMapper) {\n return false\n }\n\n return assetMapper\n .getKeysByAsset(page)\n .some((pageKey) =>\n hasEntrypointForKey(entrypoints, pageKey, assetMapper)\n )\n default: {\n // validation that we covered all cases, this should never run.\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const _: never = type\n return false\n }\n }\n}\n\n// hooks only used by the dev server.\ntype HandleEntrypointsHooks = {\n handleWrittenEndpoint: HandleWrittenEndpoint\n propagateServerField: (\n field: PropagateToWorkersField,\n args: any\n ) => Promise<void>\n sendHmr: SendHmr\n startBuilding: StartBuilding\n subscribeToChanges: StartChangeSubscription\n unsubscribeFromChanges: StopChangeSubscription\n unsubscribeFromHmrEvents: (client: ws, id: string) => void\n}\n\ntype HandleEntrypointsDevOpts = {\n assetMapper: AssetMapper\n changeSubscriptions: ChangeSubscriptions\n clients: Set<ws>\n clientStates: ClientStateMap\n serverFields: ServerFields\n\n hooks: HandleEntrypointsHooks\n}\n\nexport async function handleEntrypoints({\n entrypoints,\n\n currentEntrypoints,\n\n currentEntryIssues,\n manifestLoader,\n devRewrites,\n logErrors,\n dev,\n}: {\n entrypoints: TurbopackResult<RawEntrypoints>\n\n currentEntrypoints: Entrypoints\n\n currentEntryIssues: EntryIssuesMap\n manifestLoader: TurbopackManifestLoader\n devRewrites: SetupOpts['fsChecker']['rewrites'] | undefined\n productionRewrites: CustomRoutes['rewrites'] | undefined\n logErrors: boolean\n\n dev: HandleEntrypointsDevOpts\n}) {\n currentEntrypoints.global.app = entrypoints.pagesAppEndpoint\n currentEntrypoints.global.document = entrypoints.pagesDocumentEndpoint\n currentEntrypoints.global.error = entrypoints.pagesErrorEndpoint\n\n currentEntrypoints.global.instrumentation = entrypoints.instrumentation\n\n currentEntrypoints.page.clear()\n currentEntrypoints.app.clear()\n\n for (const [pathname, route] of entrypoints.routes) {\n switch (route.type) {\n case 'page':\n case 'page-api':\n currentEntrypoints.page.set(pathname, route)\n break\n case 'app-page': {\n route.pages.forEach((page) => {\n currentEntrypoints.app.set(page.originalName, {\n type: 'app-page',\n ...page,\n })\n })\n break\n }\n case 'app-route': {\n currentEntrypoints.app.set(route.originalName, route)\n break\n }\n default:\n Log.info(`skipping ${pathname} (${route.type})`)\n break\n }\n }\n\n if (dev) {\n await handleEntrypointsDevCleanup({\n currentEntryIssues,\n currentEntrypoints,\n\n ...dev,\n })\n }\n\n const { middleware, instrumentation } = entrypoints\n\n // We check for explicit true/false, since it's initialized to\n // undefined during the first loop (middlewareChanges event is\n // unnecessary during the first serve)\n if (currentEntrypoints.global.middleware && !middleware) {\n const key = getEntryKey('root', 'server', 'middleware')\n // Went from middleware to no middleware\n await dev?.hooks.unsubscribeFromChanges(key)\n currentEntryIssues.delete(key)\n dev.hooks.sendHmr('middleware', {\n event: HMR_ACTIONS_SENT_TO_BROWSER.MIDDLEWARE_CHANGES,\n })\n } else if (!currentEntrypoints.global.middleware && middleware) {\n // Went from no middleware to middleware\n dev.hooks.sendHmr('middleware', {\n event: HMR_ACTIONS_SENT_TO_BROWSER.MIDDLEWARE_CHANGES,\n })\n }\n\n currentEntrypoints.global.middleware = middleware\n\n if (instrumentation) {\n const processInstrumentation = async (\n name: string,\n prop: 'nodeJs' | 'edge'\n ) => {\n const key = getEntryKey('root', 'server', name)\n\n const writtenEndpoint = await instrumentation[prop].writeToDisk()\n dev.hooks.handleWrittenEndpoint(key, writtenEndpoint)\n processIssues(currentEntryIssues, key, writtenEndpoint, false, logErrors)\n }\n await processInstrumentation('instrumentation.nodeJs', 'nodeJs')\n await processInstrumentation('instrumentation.edge', 'edge')\n await manifestLoader.loadMiddlewareManifest(\n 'instrumentation',\n 'instrumentation'\n )\n await manifestLoader.writeManifests({\n devRewrites,\n productionRewrites: undefined,\n entrypoints: currentEntrypoints,\n })\n\n dev.serverFields.actualInstrumentationHookFile = '/instrumentation'\n await dev.hooks.propagateServerField(\n 'actualInstrumentationHookFile',\n dev.serverFields.actualInstrumentationHookFile\n )\n } else {\n dev.serverFields.actualInstrumentationHookFile = undefined\n await dev.hooks.propagateServerField(\n 'actualInstrumentationHookFile',\n dev.serverFields.actualInstrumentationHookFile\n )\n }\n\n if (middleware) {\n const key = getEntryKey('root', 'server', 'middleware')\n\n const endpoint = middleware.endpoint\n\n async function processMiddleware() {\n const writtenEndpoint = await endpoint.writeToDisk()\n dev.hooks.handleWrittenEndpoint(key, writtenEndpoint)\n processIssues(currentEntryIssues, key, writtenEndpoint, false, logErrors)\n await manifestLoader.loadMiddlewareManifest('middleware', 'middleware')\n const middlewareConfig =\n manifestLoader.getMiddlewareManifest(key)?.middleware['/']\n\n if (dev && middlewareConfig) {\n dev.serverFields.middleware = {\n match: null as any,\n page: '/',\n matchers: middlewareConfig.matchers,\n }\n }\n }\n await processMiddleware()\n\n if (dev) {\n dev?.hooks.subscribeToChanges(\n key,\n false,\n endpoint,\n async () => {\n const finishBuilding = dev.hooks.startBuilding(\n 'middleware',\n undefined,\n true\n )\n await processMiddleware()\n await dev.hooks.propagateServerField(\n 'actualMiddlewareFile',\n dev.serverFields.actualMiddlewareFile\n )\n await dev.hooks.propagateServerField(\n 'middleware',\n dev.serverFields.middleware\n )\n await manifestLoader.writeManifests({\n devRewrites,\n productionRewrites: undefined,\n entrypoints: currentEntrypoints,\n })\n\n finishBuilding?.()\n return { event: HMR_ACTIONS_SENT_TO_BROWSER.MIDDLEWARE_CHANGES }\n },\n () => {\n return {\n event: HMR_ACTIONS_SENT_TO_BROWSER.MIDDLEWARE_CHANGES,\n }\n }\n )\n }\n } else {\n manifestLoader.deleteMiddlewareManifest(\n getEntryKey('root', 'server', 'middleware')\n )\n dev.serverFields.actualMiddlewareFile = undefined\n dev.serverFields.middleware = undefined\n }\n\n await dev.hooks.propagateServerField(\n 'actualMiddlewareFile',\n dev.serverFields.actualMiddlewareFile\n )\n await dev.hooks.propagateServerField(\n 'middleware',\n dev.serverFields.middleware\n )\n}\n\nasync function handleEntrypointsDevCleanup({\n currentEntryIssues,\n currentEntrypoints,\n\n assetMapper,\n changeSubscriptions,\n clients,\n clientStates,\n\n hooks,\n}: {\n currentEntrypoints: Entrypoints\n currentEntryIssues: EntryIssuesMap\n} & HandleEntrypointsDevOpts) {\n // this needs to be first as `hasEntrypointForKey` uses the `assetMapper`\n for (const key of assetMapper.keys()) {\n if (!hasEntrypointForKey(currentEntrypoints, key, assetMapper)) {\n assetMapper.delete(key)\n }\n }\n\n for (const key of changeSubscriptions.keys()) {\n // middleware is handled separately\n if (!hasEntrypointForKey(currentEntrypoints, key, assetMapper)) {\n await hooks.unsubscribeFromChanges(key)\n }\n }\n\n for (const [key] of currentEntryIssues) {\n if (!hasEntrypointForKey(currentEntrypoints, key, assetMapper)) {\n currentEntryIssues.delete(key)\n }\n }\n\n for (const client of clients) {\n const state = clientStates.get(client)\n if (!state) {\n continue\n }\n\n for (const key of state.clientIssues.keys()) {\n if (!hasEntrypointForKey(currentEntrypoints, key, assetMapper)) {\n state.clientIssues.delete(key)\n }\n }\n\n for (const id of state.subscriptions.keys()) {\n if (\n !hasEntrypointForKey(\n currentEntrypoints,\n getEntryKey('assets', 'client', id),\n assetMapper\n )\n ) {\n hooks.unsubscribeFromHmrEvents(client, id)\n }\n }\n }\n}\n\nexport async function handlePagesErrorRoute({\n currentEntryIssues,\n entrypoints,\n manifestLoader,\n devRewrites,\n productionRewrites,\n logErrors,\n hooks,\n}: {\n currentEntryIssues: EntryIssuesMap\n entrypoints: Entrypoints\n manifestLoader: TurbopackManifestLoader\n devRewrites: SetupOpts['fsChecker']['rewrites'] | undefined\n productionRewrites: CustomRoutes['rewrites'] | undefined\n logErrors: boolean\n hooks: HandleRouteTypeHooks\n}) {\n if (entrypoints.global.app) {\n const key = getEntryKey('pages', 'server', '_app')\n\n const writtenEndpoint = await entrypoints.global.app.writeToDisk()\n hooks.handleWrittenEndpoint(key, writtenEndpoint)\n hooks.subscribeToChanges(\n key,\n false,\n entrypoints.global.app,\n () => {\n // There's a special case for this in `../client/page-bootstrap.ts`.\n // https://github.com/vercel/next.js/blob/08d7a7e5189a835f5dcb82af026174e587575c0e/packages/next/src/client/page-bootstrap.ts#L69-L71\n return { event: HMR_ACTIONS_SENT_TO_BROWSER.CLIENT_CHANGES }\n },\n () => {\n return {\n action: HMR_ACTIONS_SENT_TO_BROWSER.RELOAD_PAGE,\n data: '_app has changed (error route)',\n }\n }\n )\n processIssues(currentEntryIssues, key, writtenEndpoint, false, logErrors)\n }\n await manifestLoader.loadBuildManifest('_app')\n await manifestLoader.loadPagesManifest('_app')\n await manifestLoader.loadFontManifest('_app')\n\n if (entrypoints.global.document) {\n const key = getEntryKey('pages', 'server', '_document')\n\n const writtenEndpoint = await entrypoints.global.document.writeToDisk()\n hooks.handleWrittenEndpoint(key, writtenEndpoint)\n hooks.subscribeToChanges(\n key,\n false,\n entrypoints.global.document,\n () => {\n return {\n action: HMR_ACTIONS_SENT_TO_BROWSER.RELOAD_PAGE,\n data: '_document has changed (error route)',\n }\n },\n (e) => {\n return {\n action: HMR_ACTIONS_SENT_TO_BROWSER.RELOAD_PAGE,\n data: `error in _document subscription (error route): ${e}`,\n }\n }\n )\n processIssues(currentEntryIssues, key, writtenEndpoint, false, logErrors)\n }\n await manifestLoader.loadPagesManifest('_document')\n\n if (entrypoints.global.error) {\n const key = getEntryKey('pages', 'server', '_error')\n\n const writtenEndpoint = await entrypoints.global.error.writeToDisk()\n hooks.handleWrittenEndpoint(key, writtenEndpoint)\n hooks.subscribeToChanges(\n key,\n false,\n entrypoints.global.error,\n () => {\n // There's a special case for this in `../client/page-bootstrap.ts`.\n // https://github.com/vercel/next.js/blob/08d7a7e5189a835f5dcb82af026174e587575c0e/packages/next/src/client/page-bootstrap.ts#L69-L71\n return { event: HMR_ACTIONS_SENT_TO_BROWSER.CLIENT_CHANGES }\n },\n (e) => {\n return {\n action: HMR_ACTIONS_SENT_TO_BROWSER.RELOAD_PAGE,\n data: `error in _error subscription: ${e}`,\n }\n }\n )\n processIssues(currentEntryIssues, key, writtenEndpoint, false, logErrors)\n }\n await manifestLoader.loadBuildManifest('_error')\n await manifestLoader.loadPagesManifest('_error')\n await manifestLoader.loadFontManifest('_error')\n\n await manifestLoader.writeManifests({\n devRewrites,\n productionRewrites,\n entrypoints,\n })\n}\n\nexport function removeRouteSuffix(route: string): string {\n return route.replace(/\\/route$/, '')\n}\n\nexport function addRouteSuffix(route: string): string {\n return route + '/route'\n}\n\nexport function addMetadataIdToRoute(route: string): string {\n return route + '/[__metadata_id__]'\n}\n\n// Since turbopack will create app pages/route entries based on the structure,\n// which means the entry keys are based on file names.\n// But for special metadata conventions we'll change the page/pathname to a different path.\n// So we need this helper to map the new path back to original turbopack entry key.\nexport function normalizedPageToTurbopackStructureRoute(\n route: string,\n ext: string | false\n): string {\n let entrypointKey = route\n if (isMetadataRoute(entrypointKey)) {\n entrypointKey = entrypointKey.endsWith('/route')\n ? entrypointKey.slice(0, -'/route'.length)\n : entrypointKey\n\n if (ext) {\n if (entrypointKey.endsWith('/[__metadata_id__]')) {\n entrypointKey = entrypointKey.slice(0, -'/[__metadata_id__]'.length)\n }\n if (entrypointKey.endsWith('/sitemap.xml') && ext !== '.xml') {\n // For dynamic sitemap route, remove the extension\n entrypointKey = entrypointKey.slice(0, -'.xml'.length)\n }\n }\n entrypointKey = entrypointKey + '/route'\n }\n return entrypointKey\n}\n"],"names":["HMR_ACTIONS_SENT_TO_BROWSER","Log","getEntryKey","splitEntryKey","isMetadataRoute","formatIssue","getIssueKey","isRelevantWarning","processIssues","renderStyledStringToErrorAnsi","onceErrorSet","Set","shouldEmitOnceWarning","issue","severity","title","stage","value","has","add","includes","printNonFatalIssue","warn","processTopLevelIssues","currentTopLevelIssues","result","clear","issues","issueKey","set","MILLISECONDS_IN_NANOSECOND","BigInt","msToNs","ms","Math","floor","handleRouteType","dev","page","pathname","route","currentEntryIssues","entrypoints","manifestLoader","readyIds","devRewrites","productionRewrites","hooks","logErrors","shouldCreateWebpackStats","process","env","TURBOPACK_STATS","type","clientKey","serverKey","global","app","key","writtenEndpoint","writeToDisk","handleWrittenEndpoint","loadBuildManifest","loadPagesManifest","document","htmlEndpoint","loadMiddlewareManifest","deleteMiddlewareManifest","loadFontManifest","loadWebpackStats","writeManifests","subscribeToChanges","dataEndpoint","delete","event","SERVER_ONLY_CHANGES","pages","e","action","RELOAD_PAGE","data","CLIENT_CHANGES","endpoint","rscEndpoint","change","hash","some","SERVER_COMPONENT_CHANGES","loadAppBuildManifest","loadAppPathsManifest","loadActionManifest","Error","AssetMapper","setPathsForKey","assetPaths","newAssetPaths","entryMap","assetPath","assetPathKeys","assetMap","get","getAssetPathsByKey","size","Array","from","getKeysByAsset","path","keys","Map","hasEntrypointForKey","assetMapper","error","middleware","instrumentation","pageKey","_","handleEntrypoints","currentEntrypoints","pagesAppEndpoint","pagesDocumentEndpoint","pagesErrorEndpoint","routes","forEach","originalName","info","handleEntrypointsDevCleanup","unsubscribeFromChanges","sendHmr","MIDDLEWARE_CHANGES","processInstrumentation","name","prop","undefined","serverFields","actualInstrumentationHookFile","propagateServerField","processMiddleware","middlewareConfig","getMiddlewareManifest","match","matchers","finishBuilding","startBuilding","actualMiddlewareFile","changeSubscriptions","clients","clientStates","client","state","clientIssues","id","subscriptions","unsubscribeFromHmrEvents","handlePagesErrorRoute","removeRouteSuffix","replace","addRouteSuffix","addMetadataIdToRoute","normalizedPageToTurbopackStructureRoute","ext","entrypointKey","endsWith","slice","length"],"mappings":"AAYA,SAEEA,2BAA2B,QACtB,uBAAsB;AAC7B,YAAYC,SAAS,yBAAwB;AAI7C,SAEEC,WAAW,EACXC,aAAa,QACR,uCAAsC;AAE7C,SAASC,eAAe,QAAQ,uCAAsC;AAEtE,SACEC,WAAW,EACXC,WAAW,EACXC,iBAAiB,EACjBC,aAAa,EACbC,6BAA6B,QAGxB,mCAAkC;AAEzC,MAAMC,eAAe,IAAIC;AACzB;;;;;CAKC,GACD,SAASC,sBAAsBC,KAAY;IACzC,MAAM,EAAEC,QAAQ,EAAEC,KAAK,EAAEC,KAAK,EAAE,GAAGH;IACnC,IAAIC,aAAa,aAAaC,MAAME,KAAK,KAAK,8BAA8B;QAC1E,IAAIP,aAAaQ,GAAG,CAACL,QAAQ;YAC3B,OAAO;QACT;QACAH,aAAaS,GAAG,CAACN;IACnB;IACA,IACEC,aAAa,aACbE,UAAU,YACVP,8BAA8BI,MAAME,KAAK,EAAEK,QAAQ,CAAC,sBACpD;QACA,IAAIV,aAAaQ,GAAG,CAACL,QAAQ;YAC3B,OAAO;QACT;QACAH,aAAaS,GAAG,CAACN;IACnB;IAEA,OAAO;AACT;AAEA,4DAA4D;AAC5D,wDAAwD;AACxD,OAAO,SAASQ,mBAAmBR,KAAY;IAC7C,IAAIN,kBAAkBM,UAAUD,sBAAsBC,QAAQ;QAC5DZ,IAAIqB,IAAI,CAACjB,YAAYQ;IACvB;AACF;AAEA,OAAO,SAASU,s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;AACjB;AAEA,8EAA8E;AAC9E,sDAAsD;AACtD,2FAA2F;AAC3F,mFAAmF;AACnF,OAAO,SAASsH,wCACdtH,KAAa,EACbuH,GAAmB;IAEnB,IAAIC,gBAAgBxH;IACpB,IAAIpC,gBAAgB4J,gBAAgB;QAClCA,gBAAgBA,cAAcC,QAAQ,CAAC,YACnCD,cAAcE,KAAK,CAAC,GAAG,CAAC,SAASC,MAAM,IACvCH;QAEJ,IAAID,KAAK;YACP,IAAIC,cAAcC,QAAQ,CAAC,uBAAuB;gBAChDD,gBAAgBA,cAAcE,KAAK,CAAC,GAAG,CAAC,qBAAqBC,MAAM;YACrE;YACA,IAAIH,cAAcC,QAAQ,CAAC,mBAAmBF,QAAQ,QAAQ;gBAC5D,kDAAkD;gBAClDC,gBAAgBA,cAAcE,KAAK,CAAC,GAAG,CAAC,OAAOC,MAAM;YACvD;QACF;QACAH,gBAAgBA,gBAAgB;IAClC;IACA,OAAOA;AACT"}
|
@@ -4,7 +4,7 @@ import { bold, purple } from '../../lib/picocolors';
|
|
4
4
|
import { PHASE_DEVELOPMENT_SERVER, PHASE_PRODUCTION_BUILD } from '../../shared/lib/constants';
|
5
5
|
import loadConfig, { getConfiguredExperimentalFeatures } from '../config';
|
6
6
|
export function logStartInfo({ networkUrl, appUrl, envInfo, experimentalFeatures, maxExperimentalFeatures = Infinity }) {
|
7
|
-
Log.bootstrap(`${bold(purple(`${Log.prefixes.ready} Next.js ${"15.2.0-canary.
|
7
|
+
Log.bootstrap(`${bold(purple(`${Log.prefixes.ready} Next.js ${"15.2.0-canary.74"}`))}${process.env.TURBOPACK ? ' (Turbopack)' : ''}`);
|
8
8
|
if (appUrl) {
|
9
9
|
Log.bootstrap(`- Local: ${appUrl}`);
|
10
10
|
}
|
@@ -28,7 +28,7 @@ import { normalizePathSep } from '../../../shared/lib/page-path/normalize-path-s
|
|
28
28
|
import { createClientRouterFilter } from '../../../lib/create-client-router-filter';
|
29
29
|
import { absolutePathToPage } from '../../../shared/lib/page-path/absolute-path-to-page';
|
30
30
|
import { generateInterceptionRoutesRewrites } from '../../../lib/generate-interception-routes-rewrites';
|
31
|
-
import { CLIENT_STATIC_FILES_PATH, DEV_CLIENT_PAGES_MANIFEST, DEV_CLIENT_MIDDLEWARE_MANIFEST, PHASE_DEVELOPMENT_SERVER } from '../../../shared/lib/constants';
|
31
|
+
import { CLIENT_STATIC_FILES_PATH, DEV_CLIENT_PAGES_MANIFEST, DEV_CLIENT_MIDDLEWARE_MANIFEST, PHASE_DEVELOPMENT_SERVER, TURBOPACK_CLIENT_MIDDLEWARE_MANIFEST } from '../../../shared/lib/constants';
|
32
32
|
import { getMiddlewareRouteMatcher } from '../../../shared/lib/router/utils/middleware-route-matcher';
|
33
33
|
import { isMiddlewareFile, NestedMiddlewareError, isInstrumentationHookFile, getPossibleMiddlewareFilenames, getPossibleInstrumentationHookFilenames } from '../../../build/utils';
|
34
34
|
import { devPageFiles } from '../../../build/webpack/plugins/next-types-plugin/shared';
|
@@ -621,8 +621,10 @@ async function startWatcher(opts) {
|
|
621
621
|
opts.fsChecker.devVirtualFsItems.add(clientPagesManifestPath);
|
622
622
|
const devMiddlewareManifestPath = `/_next/${CLIENT_STATIC_FILES_PATH}/development/${DEV_CLIENT_MIDDLEWARE_MANIFEST}`;
|
623
623
|
opts.fsChecker.devVirtualFsItems.add(devMiddlewareManifestPath);
|
624
|
+
const devTurbopackMiddlewareManifestPath = `/_next/${CLIENT_STATIC_FILES_PATH}/development/${TURBOPACK_CLIENT_MIDDLEWARE_MANIFEST}`;
|
625
|
+
opts.fsChecker.devVirtualFsItems.add(devTurbopackMiddlewareManifestPath);
|
624
626
|
async function requestHandler(req, res) {
|
625
|
-
var _parsedUrl_pathname, _parsedUrl_pathname1;
|
627
|
+
var _parsedUrl_pathname, _parsedUrl_pathname1, _parsedUrl_pathname2;
|
626
628
|
const parsedUrl = url.parse(req.url || '/');
|
627
629
|
if ((_parsedUrl_pathname = parsedUrl.pathname) == null ? void 0 : _parsedUrl_pathname.includes(clientPagesManifestPath)) {
|
628
630
|
res.statusCode = 200;
|
@@ -634,7 +636,7 @@ async function startWatcher(opts) {
|
|
634
636
|
finished: true
|
635
637
|
};
|
636
638
|
}
|
637
|
-
if ((_parsedUrl_pathname1 = parsedUrl.pathname) == null ? void 0 : _parsedUrl_pathname1.includes(devMiddlewareManifestPath)) {
|
639
|
+
if (((_parsedUrl_pathname1 = parsedUrl.pathname) == null ? void 0 : _parsedUrl_pathname1.includes(devMiddlewareManifestPath)) || ((_parsedUrl_pathname2 = parsedUrl.pathname) == null ? void 0 : _parsedUrl_pathname2.includes(devTurbopackMiddlewareManifestPath))) {
|
638
640
|
var _serverFields_middleware;
|
639
641
|
res.statusCode = 200;
|
640
642
|
res.setHeader('Content-Type', 'application/json; charset=utf-8');
|