next 15.4.0-canary.127 → 15.4.0-canary.129
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/next +1 -1
- package/dist/build/define-env.js +2 -1
- package/dist/build/define-env.js.map +1 -1
- package/dist/build/index.js +2 -2
- 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/components/layout-router.js +3 -3
- package/dist/client/components/layout-router.js.map +1 -1
- package/dist/client/index.js +3 -3
- package/dist/client/index.js.map +1 -1
- package/dist/compiled/next-devtools/index.js +2 -2
- package/dist/compiled/next-devtools/index.js.map +1 -1
- package/dist/compiled/next-server/pages-api.runtime.dev.js +1 -1
- package/dist/compiled/next-server/pages-api.runtime.dev.js.map +1 -1
- package/dist/compiled/next-server/pages-api.runtime.prod.js +1 -1
- package/dist/compiled/next-server/pages-api.runtime.prod.js.map +1 -1
- package/dist/compiled/next-server/pages.runtime.dev.js +1 -1
- package/dist/compiled/next-server/pages.runtime.dev.js.map +1 -1
- package/dist/compiled/next-server/pages.runtime.prod.js +1 -1
- package/dist/compiled/next-server/pages.runtime.prod.js.map +1 -1
- package/dist/esm/build/define-env.js +2 -1
- package/dist/esm/build/define-env.js.map +1 -1
- package/dist/esm/build/index.js +2 -2
- package/dist/esm/build/swc/index.js +1 -1
- package/dist/esm/build/webpack-config.js +2 -2
- package/dist/esm/client/app-bootstrap.js +1 -1
- package/dist/esm/client/components/layout-router.js +3 -3
- package/dist/esm/client/components/layout-router.js.map +1 -1
- package/dist/esm/client/index.js +3 -3
- package/dist/esm/client/index.js.map +1 -1
- package/dist/esm/server/config-schema.js +2 -1
- package/dist/esm/server/config-schema.js.map +1 -1
- package/dist/esm/server/config-shared.js +2 -1
- package/dist/esm/server/config-shared.js.map +1 -1
- package/dist/esm/server/dev/hot-reloader-turbopack.js +1 -1
- package/dist/esm/server/dev/hot-reloader-webpack.js +1 -1
- package/dist/esm/server/lib/app-info-log.js +1 -1
- package/dist/esm/server/lib/start-server.js +1 -1
- package/dist/esm/shared/lib/canary-only.js +1 -1
- package/dist/esm/shared/lib/router/router.js +2 -2
- package/dist/esm/shared/lib/router/router.js.map +1 -1
- package/dist/esm/shared/lib/router/utils/disable-smooth-scroll.js +44 -0
- package/dist/esm/shared/lib/router/utils/disable-smooth-scroll.js.map +1 -0
- package/dist/server/config-schema.js +2 -1
- package/dist/server/config-schema.js.map +1 -1
- package/dist/server/config-shared.d.ts +9 -0
- package/dist/server/config-shared.js +2 -1
- package/dist/server/config-shared.js.map +1 -1
- package/dist/server/dev/hot-reloader-turbopack.js +1 -1
- package/dist/server/dev/hot-reloader-webpack.js +1 -1
- package/dist/server/lib/app-info-log.js +1 -1
- package/dist/server/lib/start-server.js +1 -1
- package/dist/shared/lib/canary-only.js +1 -1
- package/dist/shared/lib/router/router.js +2 -2
- package/dist/shared/lib/router/router.js.map +1 -1
- package/dist/shared/lib/router/utils/{handle-smooth-scroll.d.ts → disable-smooth-scroll.d.ts} +1 -1
- package/dist/shared/lib/router/utils/disable-smooth-scroll.js +51 -0
- package/dist/shared/lib/router/utils/disable-smooth-scroll.js.map +1 -0
- package/dist/telemetry/anonymous-meta.js +1 -1
- package/dist/telemetry/events/session-stopped.js +2 -2
- package/dist/telemetry/events/version.js +2 -2
- package/package.json +15 -15
- package/dist/esm/shared/lib/router/utils/handle-smooth-scroll.js +0 -25
- package/dist/esm/shared/lib/router/utils/handle-smooth-scroll.js.map +0 -1
- package/dist/shared/lib/router/utils/handle-smooth-scroll.js +0 -35
- package/dist/shared/lib/router/utils/handle-smooth-scroll.js.map +0 -1
@@ -162,7 +162,8 @@ export function getDefineEnv({ isTurbopack, clientRouterFilters, config, dev, di
|
|
162
162
|
//
|
163
163
|
// In the worst case we'll show an option to clear the cache, but it'll be a
|
164
164
|
// no-op that just restarts the development server.
|
165
|
-
'process.env.__NEXT_BUNDLER_HAS_PERSISTENT_CACHE': !isTurbopack || (config.experimental.turbopackPersistentCaching ?? false)
|
165
|
+
'process.env.__NEXT_BUNDLER_HAS_PERSISTENT_CACHE': !isTurbopack || (config.experimental.turbopackPersistentCaching ?? false),
|
166
|
+
'process.env.__NEXT_OPTIMIZE_ROUTER_SCROLL': config.experimental.optimizeRouterScrolling ?? false
|
166
167
|
};
|
167
168
|
const userDefines = ((_config_compiler = config.compiler) == null ? void 0 : _config_compiler.define) ?? {};
|
168
169
|
for(const key in userDefines){
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../src/build/define-env.ts"],"sourcesContent":["import type {\n I18NConfig,\n I18NDomains,\n NextConfigComplete,\n} from '../server/config-shared'\nimport type { MiddlewareMatcher } from './analysis/get-page-static-info'\nimport type { Rewrite } from '../lib/load-custom-routes'\nimport path from 'node:path'\nimport { needsExperimentalReact } from '../lib/needs-experimental-react'\nimport { checkIsAppPPREnabled } from '../server/lib/experimental/ppr'\nimport {\n getNextConfigEnv,\n getNextPublicEnvironmentVariables,\n} from '../lib/static-env'\n\ntype BloomFilter = ReturnType<\n import('../shared/lib/bloom-filter').BloomFilter['export']\n>\n\nexport interface DefineEnvOptions {\n isTurbopack: boolean\n clientRouterFilters?: {\n staticFilter: BloomFilter\n dynamicFilter: BloomFilter\n }\n config: NextConfigComplete\n dev: boolean\n distDir: string\n projectPath: string\n fetchCacheKeyPrefix: string | undefined\n hasRewrites: boolean\n isClient: boolean\n isEdgeServer: boolean\n isNodeServer: boolean\n middlewareMatchers: MiddlewareMatcher[] | undefined\n omitNonDeterministic?: boolean\n rewrites: {\n beforeFiles: Rewrite[]\n afterFiles: Rewrite[]\n fallback: Rewrite[]\n }\n}\n\ninterface DefineEnv {\n [key: string]:\n | string\n | string[]\n | boolean\n | MiddlewareMatcher[]\n | BloomFilter\n | Partial<NextConfigComplete['images']>\n | I18NDomains\n | I18NConfig\n}\n\ninterface SerializedDefineEnv {\n [key: string]: string\n}\n\n/**\n * Serializes the DefineEnv config so that it can be inserted into the code by Webpack/Turbopack, JSON stringifies each value.\n */\nfunction serializeDefineEnv(defineEnv: DefineEnv): SerializedDefineEnv {\n const defineEnvStringified: SerializedDefineEnv = {}\n for (const key in defineEnv) {\n const value = defineEnv[key]\n defineEnvStringified[key] = JSON.stringify(value)\n }\n\n return defineEnvStringified\n}\n\nfunction getImageConfig(\n config: NextConfigComplete,\n dev: boolean\n): { 'process.env.__NEXT_IMAGE_OPTS': Partial<NextConfigComplete['images']> } {\n return {\n 'process.env.__NEXT_IMAGE_OPTS': {\n deviceSizes: config.images.deviceSizes,\n imageSizes: config.images.imageSizes,\n qualities: config.images.qualities,\n path: config.images.path,\n loader: config.images.loader,\n dangerouslyAllowSVG: config.images.dangerouslyAllowSVG,\n unoptimized: config?.images?.unoptimized,\n ...(dev\n ? {\n // additional config in dev to allow validating on the client\n domains: config.images.domains,\n remotePatterns: config.images?.remotePatterns,\n localPatterns: config.images?.localPatterns,\n output: config.output,\n }\n : {}),\n },\n }\n}\n\nexport function getDefineEnv({\n isTurbopack,\n clientRouterFilters,\n config,\n dev,\n distDir,\n projectPath,\n fetchCacheKeyPrefix,\n hasRewrites,\n isClient,\n isEdgeServer,\n isNodeServer,\n middlewareMatchers,\n omitNonDeterministic,\n rewrites,\n}: DefineEnvOptions): SerializedDefineEnv {\n const nextPublicEnv = getNextPublicEnvironmentVariables()\n const nextConfigEnv = getNextConfigEnv(config)\n\n const isPPREnabled = checkIsAppPPREnabled(config.experimental.ppr)\n const isDynamicIOEnabled = !!config.experimental.dynamicIO\n const isUseCacheEnabled = !!config.experimental.useCache\n\n const isDevToolPanelUIEnabled = Boolean(config.experimental.devtoolNewPanelUI)\n\n const defineEnv: DefineEnv = {\n // internal field to identify the plugin config\n __NEXT_DEFINE_ENV: true,\n\n ...nextPublicEnv,\n ...nextConfigEnv,\n ...(!isEdgeServer\n ? {}\n : {\n EdgeRuntime:\n /**\n * Cloud providers can set this environment variable to allow users\n * and library authors to have different implementations based on\n * the runtime they are running with, if it's not using `edge-runtime`\n */\n process.env.NEXT_EDGE_RUNTIME_PROVIDER ?? 'edge-runtime',\n\n // process should be only { env: {...} } for edge runtime.\n // For ignore avoid warn on `process.emit` usage but directly omit it.\n 'process.emit': false,\n }),\n 'process.turbopack': isTurbopack,\n 'process.env.TURBOPACK': isTurbopack,\n 'process.env.__NEXT_BUNDLER': isTurbopack\n ? 'Turbopack'\n : process.env.NEXT_RSPACK\n ? 'Rspack'\n : 'Webpack',\n // TODO: enforce `NODE_ENV` on `process.env`, and add a test:\n 'process.env.NODE_ENV':\n dev || config.experimental.allowDevelopmentBuild\n ? 'development'\n : 'production',\n 'process.env.NEXT_RUNTIME': isEdgeServer\n ? 'edge'\n : isNodeServer\n ? 'nodejs'\n : '',\n 'process.env.NEXT_MINIMAL': '',\n 'process.env.__NEXT_APP_NAV_FAIL_HANDLING': Boolean(\n config.experimental.appNavFailHandling\n ),\n 'process.env.__NEXT_PPR': isPPREnabled,\n 'process.env.__NEXT_DYNAMIC_IO': isDynamicIOEnabled,\n 'process.env.__NEXT_USE_CACHE': isUseCacheEnabled,\n\n 'process.env.NEXT_DEPLOYMENT_ID': config.experimental?.useSkewCookie\n ? false\n : config.deploymentId || false,\n // Propagates the `__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING` environment\n // variable to the client.\n 'process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING':\n process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING || false,\n 'process.env.__NEXT_FETCH_CACHE_KEY_PREFIX': fetchCacheKeyPrefix ?? '',\n ...(isTurbopack\n ? {}\n : {\n 'process.env.__NEXT_MIDDLEWARE_MATCHERS': middlewareMatchers ?? [],\n }),\n 'process.env.__NEXT_MANUAL_CLIENT_BASE_PATH':\n config.experimental.manualClientBasePath ?? false,\n 'process.env.__NEXT_CLIENT_ROUTER_DYNAMIC_STALETIME': JSON.stringify(\n isNaN(Number(config.experimental.staleTimes?.dynamic))\n ? 0\n : config.experimental.staleTimes?.dynamic\n ),\n 'process.env.__NEXT_CLIENT_ROUTER_STATIC_STALETIME': JSON.stringify(\n isNaN(Number(config.experimental.staleTimes?.static))\n ? 5 * 60 // 5 minutes\n : config.experimental.staleTimes?.static\n ),\n 'process.env.__NEXT_CLIENT_ROUTER_FILTER_ENABLED':\n config.experimental.clientRouterFilter ?? true,\n 'process.env.__NEXT_CLIENT_ROUTER_S_FILTER':\n clientRouterFilters?.staticFilter ?? false,\n 'process.env.__NEXT_CLIENT_ROUTER_D_FILTER':\n clientRouterFilters?.dynamicFilter ?? false,\n 'process.env.__NEXT_CLIENT_SEGMENT_CACHE': Boolean(\n config.experimental.clientSegmentCache\n ),\n 'process.env.__NEXT_CLIENT_VALIDATE_RSC_REQUEST_HEADERS': Boolean(\n config.experimental.validateRSCRequestHeaders\n ),\n 'process.env.__NEXT_DYNAMIC_ON_HOVER': Boolean(\n config.experimental.dynamicOnHover\n ),\n 'process.env.__NEXT_ROUTER_BF_CACHE': Boolean(\n config.experimental.routerBFCache\n ),\n 'process.env.__NEXT_OPTIMISTIC_CLIENT_CACHE':\n config.experimental.optimisticClientCache ?? true,\n 'process.env.__NEXT_MIDDLEWARE_PREFETCH':\n config.experimental.middlewarePrefetch ?? 'flexible',\n 'process.env.__NEXT_CROSS_ORIGIN': config.crossOrigin,\n 'process.browser': isClient,\n 'process.env.__NEXT_TEST_MODE': process.env.__NEXT_TEST_MODE ?? false,\n // This is used in client/dev-error-overlay/hot-dev-client.js to replace the dist directory\n ...(dev && (isClient ?? isEdgeServer)\n ? {\n 'process.env.__NEXT_DIST_DIR': distDir,\n }\n : {}),\n // This is used in devtools to strip the project path in edge runtime,\n // as there's only a dummy `dir` value (`.`) as edge runtime doesn't have concept of file system.\n ...(dev && isEdgeServer\n ? {\n 'process.env.__NEXT_EDGE_PROJECT_DIR': isTurbopack\n ? path.relative(process.cwd(), projectPath)\n : projectPath,\n }\n : {}),\n 'process.env.__NEXT_BASE_PATH': config.basePath,\n 'process.env.__NEXT_CASE_SENSITIVE_ROUTES': Boolean(\n config.experimental.caseSensitiveRoutes\n ),\n 'process.env.__NEXT_REWRITES': rewrites as any,\n 'process.env.__NEXT_TRAILING_SLASH': config.trailingSlash,\n 'process.env.__NEXT_DEV_INDICATOR': config.devIndicators !== false,\n 'process.env.__NEXT_DEV_INDICATOR_POSITION':\n config.devIndicators === false\n ? 'bottom-left' // This will not be used as the indicator is disabled.\n : config.devIndicators.position ?? 'bottom-left',\n 'process.env.__NEXT_STRICT_MODE':\n config.reactStrictMode === null ? false : config.reactStrictMode,\n 'process.env.__NEXT_STRICT_MODE_APP':\n // When next.config.js does not have reactStrictMode it's enabled by default.\n config.reactStrictMode === null ? true : config.reactStrictMode,\n 'process.env.__NEXT_OPTIMIZE_CSS':\n (config.experimental.optimizeCss && !dev) ?? false,\n 'process.env.__NEXT_SCRIPT_WORKERS':\n (config.experimental.nextScriptWorkers && !dev) ?? false,\n 'process.env.__NEXT_SCROLL_RESTORATION':\n config.experimental.scrollRestoration ?? false,\n ...getImageConfig(config, dev),\n 'process.env.__NEXT_ROUTER_BASEPATH': config.basePath,\n 'process.env.__NEXT_STRICT_NEXT_HEAD':\n config.experimental.strictNextHead ?? true,\n 'process.env.__NEXT_HAS_REWRITES': hasRewrites,\n 'process.env.__NEXT_CONFIG_OUTPUT': config.output,\n 'process.env.__NEXT_I18N_SUPPORT': !!config.i18n,\n 'process.env.__NEXT_I18N_DOMAINS': config.i18n?.domains ?? false,\n 'process.env.__NEXT_I18N_CONFIG': config.i18n || '',\n 'process.env.__NEXT_NO_MIDDLEWARE_URL_NORMALIZE':\n config.skipMiddlewareUrlNormalize,\n 'process.env.__NEXT_EXTERNAL_MIDDLEWARE_REWRITE_RESOLVE':\n config.experimental.externalMiddlewareRewritesResolve ?? false,\n 'process.env.__NEXT_MANUAL_TRAILING_SLASH':\n config.skipTrailingSlashRedirect,\n 'process.env.__NEXT_HAS_WEB_VITALS_ATTRIBUTION':\n (config.experimental.webVitalsAttribution &&\n config.experimental.webVitalsAttribution.length > 0) ??\n false,\n 'process.env.__NEXT_WEB_VITALS_ATTRIBUTION':\n config.experimental.webVitalsAttribution ?? false,\n 'process.env.__NEXT_LINK_NO_TOUCH_START':\n config.experimental.linkNoTouchStart ?? false,\n 'process.env.__NEXT_ASSET_PREFIX': config.assetPrefix,\n 'process.env.__NEXT_EXPERIMENTAL_AUTH_INTERRUPTS':\n !!config.experimental.authInterrupts,\n 'process.env.__NEXT_TELEMETRY_DISABLED': Boolean(\n process.env.NEXT_TELEMETRY_DISABLED\n ),\n ...(isNodeServer || isEdgeServer\n ? {\n // Fix bad-actors in the npm ecosystem (e.g. `node-formidable`)\n // This is typically found in unmaintained modules from the\n // pre-webpack era (common in server-side code)\n 'global.GENTLY': false,\n }\n : undefined),\n ...(isNodeServer || isEdgeServer\n ? {\n 'process.env.__NEXT_EXPERIMENTAL_REACT':\n needsExperimentalReact(config),\n }\n : undefined),\n\n 'process.env.__NEXT_MULTI_ZONE_DRAFT_MODE': JSON.stringify(\n config.experimental.multiZoneDraftMode\n ),\n 'process.env.__NEXT_TRUST_HOST_HEADER': JSON.stringify(\n config.experimental.trustHostHeader\n ),\n 'process.env.__NEXT_ALLOWED_REVALIDATE_HEADERS': JSON.stringify(\n config.experimental.allowedRevalidateHeaderKeys\n ),\n ...(isNodeServer\n ? {\n 'process.env.__NEXT_RELATIVE_DIST_DIR': config.distDir,\n 'process.env.__NEXT_RELATIVE_PROJECT_DIR': path.relative(\n process.cwd(),\n projectPath\n ),\n }\n : {}),\n 'process.env.__NEXT_DEVTOOL_SEGMENT_EXPLORER':\n // Enable segment explorer in devtools\n isDevToolPanelUIEnabled || !!config.experimental.devtoolSegmentExplorer,\n 'process.env.__NEXT_DEVTOOL_NEW_PANEL_UI': isDevToolPanelUIEnabled,\n\n 'process.env.__NEXT_BROWSER_DEBUG_INFO_IN_TERMINAL': JSON.stringify(\n config.experimental.browserDebugInfoInTerminal || false\n ),\n\n // The devtools need to know whether or not to show an option to clear the\n // bundler cache. This option may be removed later once Turbopack's\n // persistent cache feature is more stable.\n //\n // This environment value is currently best-effort:\n // - It's possible to disable the webpack filesystem cache, but it's\n // unlikely for a user to do that.\n // - Rspack's persistent cache is unstable and requires a different\n // configuration than webpack to enable (which we don't do).\n //\n // In the worst case we'll show an option to clear the cache, but it'll be a\n // no-op that just restarts the development server.\n 'process.env.__NEXT_BUNDLER_HAS_PERSISTENT_CACHE':\n !isTurbopack || (config.experimental.turbopackPersistentCaching ?? false),\n }\n\n const userDefines = config.compiler?.define ?? {}\n for (const key in userDefines) {\n if (defineEnv.hasOwnProperty(key)) {\n throw new Error(\n `The \\`compiler.define\\` option is configured to replace the \\`${key}\\` variable. This variable is either part of a Next.js built-in or is already configured.`\n )\n }\n defineEnv[key] = userDefines[key]\n }\n\n if (isNodeServer || isEdgeServer) {\n const userDefinesServer = config.compiler?.defineServer ?? {}\n for (const key in userDefinesServer) {\n if (defineEnv.hasOwnProperty(key)) {\n throw new Error(\n `The \\`compiler.defineServer\\` option is configured to replace the \\`${key}\\` variable. This variable is either part of a Next.js built-in or is already configured.`\n )\n }\n defineEnv[key] = userDefinesServer[key]\n }\n }\n\n const serializedDefineEnv = serializeDefineEnv(defineEnv)\n\n // we delay inlining these values until after the build\n // with flying shuttle enabled so we can update them\n // without invalidating entries\n if (!dev && omitNonDeterministic) {\n // client uses window. instead of leaving process.env\n // in case process isn't polyfilled on client already\n // since by this point it won't be added by webpack\n const safeKey = (key: string) =>\n isClient ? `window.${key.split('.').pop()}` : key\n\n for (const key in nextPublicEnv) {\n serializedDefineEnv[key] = safeKey(key)\n }\n for (const key in nextConfigEnv) {\n serializedDefineEnv[key] = safeKey(key)\n }\n for (const key of ['process.env.NEXT_DEPLOYMENT_ID']) {\n serializedDefineEnv[key] = safeKey(key)\n }\n }\n\n return serializedDefineEnv\n}\n"],"names":["path","needsExperimentalReact","checkIsAppPPREnabled","getNextConfigEnv","getNextPublicEnvironmentVariables","serializeDefineEnv","defineEnv","defineEnvStringified","key","value","JSON","stringify","getImageConfig","config","dev","deviceSizes","images","imageSizes","qualities","loader","dangerouslyAllowSVG","unoptimized","domains","remotePatterns","localPatterns","output","getDefineEnv","isTurbopack","clientRouterFilters","distDir","projectPath","fetchCacheKeyPrefix","hasRewrites","isClient","isEdgeServer","isNodeServer","middlewareMatchers","omitNonDeterministic","rewrites","nextPublicEnv","nextConfigEnv","isPPREnabled","experimental","ppr","isDynamicIOEnabled","dynamicIO","isUseCacheEnabled","useCache","isDevToolPanelUIEnabled","Boolean","devtoolNewPanelUI","__NEXT_DEFINE_ENV","EdgeRuntime","process","env","NEXT_EDGE_RUNTIME_PROVIDER","NEXT_RSPACK","allowDevelopmentBuild","appNavFailHandling","useSkewCookie","deploymentId","__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING","manualClientBasePath","isNaN","Number","staleTimes","dynamic","static","clientRouterFilter","staticFilter","dynamicFilter","clientSegmentCache","validateRSCRequestHeaders","dynamicOnHover","routerBFCache","optimisticClientCache","middlewarePrefetch","crossOrigin","__NEXT_TEST_MODE","relative","cwd","basePath","caseSensitiveRoutes","trailingSlash","devIndicators","position","reactStrictMode","optimizeCss","nextScriptWorkers","scrollRestoration","strictNextHead","i18n","skipMiddlewareUrlNormalize","externalMiddlewareRewritesResolve","skipTrailingSlashRedirect","webVitalsAttribution","length","linkNoTouchStart","assetPrefix","authInterrupts","NEXT_TELEMETRY_DISABLED","undefined","multiZoneDraftMode","trustHostHeader","allowedRevalidateHeaderKeys","devtoolSegmentExplorer","browserDebugInfoInTerminal","turbopackPersistentCaching","userDefines","compiler","define","hasOwnProperty","Error","userDefinesServer","defineServer","serializedDefineEnv","safeKey","split","pop"],"mappings":"AAOA,OAAOA,UAAU,YAAW;AAC5B,SAASC,sBAAsB,QAAQ,kCAAiC;AACxE,SAASC,oBAAoB,QAAQ,iCAAgC;AACrE,SACEC,gBAAgB,EAChBC,iCAAiC,QAC5B,oBAAmB;AA8C1B;;CAEC,GACD,SAASC,mBAAmBC,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["../../src/build/define-env.ts"],"sourcesContent":["import type {\n I18NConfig,\n I18NDomains,\n NextConfigComplete,\n} from '../server/config-shared'\nimport type { MiddlewareMatcher } from './analysis/get-page-static-info'\nimport type { Rewrite } from '../lib/load-custom-routes'\nimport path from 'node:path'\nimport { needsExperimentalReact } from '../lib/needs-experimental-react'\nimport { checkIsAppPPREnabled } from '../server/lib/experimental/ppr'\nimport {\n getNextConfigEnv,\n getNextPublicEnvironmentVariables,\n} from '../lib/static-env'\n\ntype BloomFilter = ReturnType<\n import('../shared/lib/bloom-filter').BloomFilter['export']\n>\n\nexport interface DefineEnvOptions {\n isTurbopack: boolean\n clientRouterFilters?: {\n staticFilter: BloomFilter\n dynamicFilter: BloomFilter\n }\n config: NextConfigComplete\n dev: boolean\n distDir: string\n projectPath: string\n fetchCacheKeyPrefix: string | undefined\n hasRewrites: boolean\n isClient: boolean\n isEdgeServer: boolean\n isNodeServer: boolean\n middlewareMatchers: MiddlewareMatcher[] | undefined\n omitNonDeterministic?: boolean\n rewrites: {\n beforeFiles: Rewrite[]\n afterFiles: Rewrite[]\n fallback: Rewrite[]\n }\n}\n\ninterface DefineEnv {\n [key: string]:\n | string\n | string[]\n | boolean\n | MiddlewareMatcher[]\n | BloomFilter\n | Partial<NextConfigComplete['images']>\n | I18NDomains\n | I18NConfig\n}\n\ninterface SerializedDefineEnv {\n [key: string]: string\n}\n\n/**\n * Serializes the DefineEnv config so that it can be inserted into the code by Webpack/Turbopack, JSON stringifies each value.\n */\nfunction serializeDefineEnv(defineEnv: DefineEnv): SerializedDefineEnv {\n const defineEnvStringified: SerializedDefineEnv = {}\n for (const key in defineEnv) {\n const value = defineEnv[key]\n defineEnvStringified[key] = JSON.stringify(value)\n }\n\n return defineEnvStringified\n}\n\nfunction getImageConfig(\n config: NextConfigComplete,\n dev: boolean\n): { 'process.env.__NEXT_IMAGE_OPTS': Partial<NextConfigComplete['images']> } {\n return {\n 'process.env.__NEXT_IMAGE_OPTS': {\n deviceSizes: config.images.deviceSizes,\n imageSizes: config.images.imageSizes,\n qualities: config.images.qualities,\n path: config.images.path,\n loader: config.images.loader,\n dangerouslyAllowSVG: config.images.dangerouslyAllowSVG,\n unoptimized: config?.images?.unoptimized,\n ...(dev\n ? {\n // additional config in dev to allow validating on the client\n domains: config.images.domains,\n remotePatterns: config.images?.remotePatterns,\n localPatterns: config.images?.localPatterns,\n output: config.output,\n }\n : {}),\n },\n }\n}\n\nexport function getDefineEnv({\n isTurbopack,\n clientRouterFilters,\n config,\n dev,\n distDir,\n projectPath,\n fetchCacheKeyPrefix,\n hasRewrites,\n isClient,\n isEdgeServer,\n isNodeServer,\n middlewareMatchers,\n omitNonDeterministic,\n rewrites,\n}: DefineEnvOptions): SerializedDefineEnv {\n const nextPublicEnv = getNextPublicEnvironmentVariables()\n const nextConfigEnv = getNextConfigEnv(config)\n\n const isPPREnabled = checkIsAppPPREnabled(config.experimental.ppr)\n const isDynamicIOEnabled = !!config.experimental.dynamicIO\n const isUseCacheEnabled = !!config.experimental.useCache\n\n const isDevToolPanelUIEnabled = Boolean(config.experimental.devtoolNewPanelUI)\n\n const defineEnv: DefineEnv = {\n // internal field to identify the plugin config\n __NEXT_DEFINE_ENV: true,\n\n ...nextPublicEnv,\n ...nextConfigEnv,\n ...(!isEdgeServer\n ? {}\n : {\n EdgeRuntime:\n /**\n * Cloud providers can set this environment variable to allow users\n * and library authors to have different implementations based on\n * the runtime they are running with, if it's not using `edge-runtime`\n */\n process.env.NEXT_EDGE_RUNTIME_PROVIDER ?? 'edge-runtime',\n\n // process should be only { env: {...} } for edge runtime.\n // For ignore avoid warn on `process.emit` usage but directly omit it.\n 'process.emit': false,\n }),\n 'process.turbopack': isTurbopack,\n 'process.env.TURBOPACK': isTurbopack,\n 'process.env.__NEXT_BUNDLER': isTurbopack\n ? 'Turbopack'\n : process.env.NEXT_RSPACK\n ? 'Rspack'\n : 'Webpack',\n // TODO: enforce `NODE_ENV` on `process.env`, and add a test:\n 'process.env.NODE_ENV':\n dev || config.experimental.allowDevelopmentBuild\n ? 'development'\n : 'production',\n 'process.env.NEXT_RUNTIME': isEdgeServer\n ? 'edge'\n : isNodeServer\n ? 'nodejs'\n : '',\n 'process.env.NEXT_MINIMAL': '',\n 'process.env.__NEXT_APP_NAV_FAIL_HANDLING': Boolean(\n config.experimental.appNavFailHandling\n ),\n 'process.env.__NEXT_PPR': isPPREnabled,\n 'process.env.__NEXT_DYNAMIC_IO': isDynamicIOEnabled,\n 'process.env.__NEXT_USE_CACHE': isUseCacheEnabled,\n\n 'process.env.NEXT_DEPLOYMENT_ID': config.experimental?.useSkewCookie\n ? false\n : config.deploymentId || false,\n // Propagates the `__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING` environment\n // variable to the client.\n 'process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING':\n process.env.__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING || false,\n 'process.env.__NEXT_FETCH_CACHE_KEY_PREFIX': fetchCacheKeyPrefix ?? '',\n ...(isTurbopack\n ? {}\n : {\n 'process.env.__NEXT_MIDDLEWARE_MATCHERS': middlewareMatchers ?? [],\n }),\n 'process.env.__NEXT_MANUAL_CLIENT_BASE_PATH':\n config.experimental.manualClientBasePath ?? false,\n 'process.env.__NEXT_CLIENT_ROUTER_DYNAMIC_STALETIME': JSON.stringify(\n isNaN(Number(config.experimental.staleTimes?.dynamic))\n ? 0\n : config.experimental.staleTimes?.dynamic\n ),\n 'process.env.__NEXT_CLIENT_ROUTER_STATIC_STALETIME': JSON.stringify(\n isNaN(Number(config.experimental.staleTimes?.static))\n ? 5 * 60 // 5 minutes\n : config.experimental.staleTimes?.static\n ),\n 'process.env.__NEXT_CLIENT_ROUTER_FILTER_ENABLED':\n config.experimental.clientRouterFilter ?? true,\n 'process.env.__NEXT_CLIENT_ROUTER_S_FILTER':\n clientRouterFilters?.staticFilter ?? false,\n 'process.env.__NEXT_CLIENT_ROUTER_D_FILTER':\n clientRouterFilters?.dynamicFilter ?? false,\n 'process.env.__NEXT_CLIENT_SEGMENT_CACHE': Boolean(\n config.experimental.clientSegmentCache\n ),\n 'process.env.__NEXT_CLIENT_VALIDATE_RSC_REQUEST_HEADERS': Boolean(\n config.experimental.validateRSCRequestHeaders\n ),\n 'process.env.__NEXT_DYNAMIC_ON_HOVER': Boolean(\n config.experimental.dynamicOnHover\n ),\n 'process.env.__NEXT_ROUTER_BF_CACHE': Boolean(\n config.experimental.routerBFCache\n ),\n 'process.env.__NEXT_OPTIMISTIC_CLIENT_CACHE':\n config.experimental.optimisticClientCache ?? true,\n 'process.env.__NEXT_MIDDLEWARE_PREFETCH':\n config.experimental.middlewarePrefetch ?? 'flexible',\n 'process.env.__NEXT_CROSS_ORIGIN': config.crossOrigin,\n 'process.browser': isClient,\n 'process.env.__NEXT_TEST_MODE': process.env.__NEXT_TEST_MODE ?? false,\n // This is used in client/dev-error-overlay/hot-dev-client.js to replace the dist directory\n ...(dev && (isClient ?? isEdgeServer)\n ? {\n 'process.env.__NEXT_DIST_DIR': distDir,\n }\n : {}),\n // This is used in devtools to strip the project path in edge runtime,\n // as there's only a dummy `dir` value (`.`) as edge runtime doesn't have concept of file system.\n ...(dev && isEdgeServer\n ? {\n 'process.env.__NEXT_EDGE_PROJECT_DIR': isTurbopack\n ? path.relative(process.cwd(), projectPath)\n : projectPath,\n }\n : {}),\n 'process.env.__NEXT_BASE_PATH': config.basePath,\n 'process.env.__NEXT_CASE_SENSITIVE_ROUTES': Boolean(\n config.experimental.caseSensitiveRoutes\n ),\n 'process.env.__NEXT_REWRITES': rewrites as any,\n 'process.env.__NEXT_TRAILING_SLASH': config.trailingSlash,\n 'process.env.__NEXT_DEV_INDICATOR': config.devIndicators !== false,\n 'process.env.__NEXT_DEV_INDICATOR_POSITION':\n config.devIndicators === false\n ? 'bottom-left' // This will not be used as the indicator is disabled.\n : config.devIndicators.position ?? 'bottom-left',\n 'process.env.__NEXT_STRICT_MODE':\n config.reactStrictMode === null ? false : config.reactStrictMode,\n 'process.env.__NEXT_STRICT_MODE_APP':\n // When next.config.js does not have reactStrictMode it's enabled by default.\n config.reactStrictMode === null ? true : config.reactStrictMode,\n 'process.env.__NEXT_OPTIMIZE_CSS':\n (config.experimental.optimizeCss && !dev) ?? false,\n 'process.env.__NEXT_SCRIPT_WORKERS':\n (config.experimental.nextScriptWorkers && !dev) ?? false,\n 'process.env.__NEXT_SCROLL_RESTORATION':\n config.experimental.scrollRestoration ?? false,\n ...getImageConfig(config, dev),\n 'process.env.__NEXT_ROUTER_BASEPATH': config.basePath,\n 'process.env.__NEXT_STRICT_NEXT_HEAD':\n config.experimental.strictNextHead ?? true,\n 'process.env.__NEXT_HAS_REWRITES': hasRewrites,\n 'process.env.__NEXT_CONFIG_OUTPUT': config.output,\n 'process.env.__NEXT_I18N_SUPPORT': !!config.i18n,\n 'process.env.__NEXT_I18N_DOMAINS': config.i18n?.domains ?? false,\n 'process.env.__NEXT_I18N_CONFIG': config.i18n || '',\n 'process.env.__NEXT_NO_MIDDLEWARE_URL_NORMALIZE':\n config.skipMiddlewareUrlNormalize,\n 'process.env.__NEXT_EXTERNAL_MIDDLEWARE_REWRITE_RESOLVE':\n config.experimental.externalMiddlewareRewritesResolve ?? false,\n 'process.env.__NEXT_MANUAL_TRAILING_SLASH':\n config.skipTrailingSlashRedirect,\n 'process.env.__NEXT_HAS_WEB_VITALS_ATTRIBUTION':\n (config.experimental.webVitalsAttribution &&\n config.experimental.webVitalsAttribution.length > 0) ??\n false,\n 'process.env.__NEXT_WEB_VITALS_ATTRIBUTION':\n config.experimental.webVitalsAttribution ?? false,\n 'process.env.__NEXT_LINK_NO_TOUCH_START':\n config.experimental.linkNoTouchStart ?? false,\n 'process.env.__NEXT_ASSET_PREFIX': config.assetPrefix,\n 'process.env.__NEXT_EXPERIMENTAL_AUTH_INTERRUPTS':\n !!config.experimental.authInterrupts,\n 'process.env.__NEXT_TELEMETRY_DISABLED': Boolean(\n process.env.NEXT_TELEMETRY_DISABLED\n ),\n ...(isNodeServer || isEdgeServer\n ? {\n // Fix bad-actors in the npm ecosystem (e.g. `node-formidable`)\n // This is typically found in unmaintained modules from the\n // pre-webpack era (common in server-side code)\n 'global.GENTLY': false,\n }\n : undefined),\n ...(isNodeServer || isEdgeServer\n ? {\n 'process.env.__NEXT_EXPERIMENTAL_REACT':\n needsExperimentalReact(config),\n }\n : undefined),\n\n 'process.env.__NEXT_MULTI_ZONE_DRAFT_MODE': JSON.stringify(\n config.experimental.multiZoneDraftMode\n ),\n 'process.env.__NEXT_TRUST_HOST_HEADER': JSON.stringify(\n config.experimental.trustHostHeader\n ),\n 'process.env.__NEXT_ALLOWED_REVALIDATE_HEADERS': JSON.stringify(\n config.experimental.allowedRevalidateHeaderKeys\n ),\n ...(isNodeServer\n ? {\n 'process.env.__NEXT_RELATIVE_DIST_DIR': config.distDir,\n 'process.env.__NEXT_RELATIVE_PROJECT_DIR': path.relative(\n process.cwd(),\n projectPath\n ),\n }\n : {}),\n 'process.env.__NEXT_DEVTOOL_SEGMENT_EXPLORER':\n // Enable segment explorer in devtools\n isDevToolPanelUIEnabled || !!config.experimental.devtoolSegmentExplorer,\n 'process.env.__NEXT_DEVTOOL_NEW_PANEL_UI': isDevToolPanelUIEnabled,\n\n 'process.env.__NEXT_BROWSER_DEBUG_INFO_IN_TERMINAL': JSON.stringify(\n config.experimental.browserDebugInfoInTerminal || false\n ),\n\n // The devtools need to know whether or not to show an option to clear the\n // bundler cache. This option may be removed later once Turbopack's\n // persistent cache feature is more stable.\n //\n // This environment value is currently best-effort:\n // - It's possible to disable the webpack filesystem cache, but it's\n // unlikely for a user to do that.\n // - Rspack's persistent cache is unstable and requires a different\n // configuration than webpack to enable (which we don't do).\n //\n // In the worst case we'll show an option to clear the cache, but it'll be a\n // no-op that just restarts the development server.\n 'process.env.__NEXT_BUNDLER_HAS_PERSISTENT_CACHE':\n !isTurbopack || (config.experimental.turbopackPersistentCaching ?? false),\n 'process.env.__NEXT_OPTIMIZE_ROUTER_SCROLL':\n config.experimental.optimizeRouterScrolling ?? false,\n }\n\n const userDefines = config.compiler?.define ?? {}\n for (const key in userDefines) {\n if (defineEnv.hasOwnProperty(key)) {\n throw new Error(\n `The \\`compiler.define\\` option is configured to replace the \\`${key}\\` variable. This variable is either part of a Next.js built-in or is already configured.`\n )\n }\n defineEnv[key] = userDefines[key]\n }\n\n if (isNodeServer || isEdgeServer) {\n const userDefinesServer = config.compiler?.defineServer ?? {}\n for (const key in userDefinesServer) {\n if (defineEnv.hasOwnProperty(key)) {\n throw new Error(\n `The \\`compiler.defineServer\\` option is configured to replace the \\`${key}\\` variable. This variable is either part of a Next.js built-in or is already configured.`\n )\n }\n defineEnv[key] = userDefinesServer[key]\n }\n }\n\n const serializedDefineEnv = serializeDefineEnv(defineEnv)\n\n // we delay inlining these values until after the build\n // with flying shuttle enabled so we can update them\n // without invalidating entries\n if (!dev && omitNonDeterministic) {\n // client uses window. instead of leaving process.env\n // in case process isn't polyfilled on client already\n // since by this point it won't be added by webpack\n const safeKey = (key: string) =>\n isClient ? `window.${key.split('.').pop()}` : key\n\n for (const key in nextPublicEnv) {\n serializedDefineEnv[key] = safeKey(key)\n }\n for (const key in nextConfigEnv) {\n serializedDefineEnv[key] = safeKey(key)\n }\n for (const key of ['process.env.NEXT_DEPLOYMENT_ID']) {\n serializedDefineEnv[key] = safeKey(key)\n }\n }\n\n return serializedDefineEnv\n}\n"],"names":["path","needsExperimentalReact","checkIsAppPPREnabled","getNextConfigEnv","getNextPublicEnvironmentVariables","serializeDefineEnv","defineEnv","defineEnvStringified","key","value","JSON","stringify","getImageConfig","config","dev","deviceSizes","images","imageSizes","qualities","loader","dangerouslyAllowSVG","unoptimized","domains","remotePatterns","localPatterns","output","getDefineEnv","isTurbopack","clientRouterFilters","distDir","projectPath","fetchCacheKeyPrefix","hasRewrites","isClient","isEdgeServer","isNodeServer","middlewareMatchers","omitNonDeterministic","rewrites","nextPublicEnv","nextConfigEnv","isPPREnabled","experimental","ppr","isDynamicIOEnabled","dynamicIO","isUseCacheEnabled","useCache","isDevToolPanelUIEnabled","Boolean","devtoolNewPanelUI","__NEXT_DEFINE_ENV","EdgeRuntime","process","env","NEXT_EDGE_RUNTIME_PROVIDER","NEXT_RSPACK","allowDevelopmentBuild","appNavFailHandling","useSkewCookie","deploymentId","__NEXT_EXPERIMENTAL_STATIC_SHELL_DEBUGGING","manualClientBasePath","isNaN","Number","staleTimes","dynamic","static","clientRouterFilter","staticFilter","dynamicFilter","clientSegmentCache","validateRSCRequestHeaders","dynamicOnHover","routerBFCache","optimisticClientCache","middlewarePrefetch","crossOrigin","__NEXT_TEST_MODE","relative","cwd","basePath","caseSensitiveRoutes","trailingSlash","devIndicators","position","reactStrictMode","optimizeCss","nextScriptWorkers","scrollRestoration","strictNextHead","i18n","skipMiddlewareUrlNormalize","externalMiddlewareRewritesResolve","skipTrailingSlashRedirect","webVitalsAttribution","length","linkNoTouchStart","assetPrefix","authInterrupts","NEXT_TELEMETRY_DISABLED","undefined","multiZoneDraftMode","trustHostHeader","allowedRevalidateHeaderKeys","devtoolSegmentExplorer","browserDebugInfoInTerminal","turbopackPersistentCaching","optimizeRouterScrolling","userDefines","compiler","define","hasOwnProperty","Error","userDefinesServer","defineServer","serializedDefineEnv","safeKey","split","pop"],"mappings":"AAOA,OAAOA,UAAU,YAAW;AAC5B,SAASC,sBAAsB,QAAQ,kCAAiC;AACxE,SAASC,oBAAoB,QAAQ,iCAAgC;AACrE,SACEC,gBAAgB,EAChBC,iCAAiC,QAC5B,oBAAmB;AA8C1B;;CAEC,GACD,SAASC,mBAAmBC,SAAoB;IAC9C,MAAMC,uBAA4C,CAAC;IACnD,IAAK,MAAMC,OAAOF,UAAW;QAC3B,MAAMG,QAAQH,SAAS,CAACE,IAAI;QAC5BD,oBAAoB,CAACC,IAAI,GAAGE,KAAKC,SAAS,CAACF;IAC7C;IAEA,OAAOF;AACT;AAEA,SAASK,eACPC,MAA0B,EAC1BC,GAAY;QAUKD,gBAKSA,iBACDA;I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G,IAAI;IACnC;IAEA,IAAI2B,gBAAgBD,cAAc;YACNrB;QAA1B,MAAMqG,oBAAoBrG,EAAAA,oBAAAA,OAAOiG,QAAQ,qBAAfjG,kBAAiBsG,YAAY,KAAI,CAAC;QAC5D,IAAK,MAAM3G,OAAO0G,kBAAmB;YACnC,IAAI5G,UAAU0G,cAAc,CAACxG,MAAM;gBACjC,MAAM,qBAEL,CAFK,IAAIyG,MACR,CAAC,oEAAoE,EAAEzG,IAAI,yFAAyF,CAAC,GADjK,qBAAA;2BAAA;gCAAA;kCAAA;gBAEN;YACF;YACAF,SAAS,CAACE,IAAI,GAAG0G,iBAAiB,CAAC1G,IAAI;QACzC;IACF;IAEA,MAAM4G,sBAAsB/G,mBAAmBC;IAE/C,uDAAuD;IACvD,oDAAoD;IACpD,+BAA+B;IAC/B,IAAI,CAACQ,OAAOuB,sBAAsB;QAChC,qDAAqD;QACrD,qDAAqD;QACrD,mDAAmD;QACnD,MAAMgF,UAAU,CAAC7G,MACfyB,WAAW,CAAC,OAAO,EAAEzB,IAAI8G,KAAK,CAAC,KAAKC,GAAG,IAAI,GAAG/G;QAEhD,IAAK,MAAMA,OAAO+B,cAAe;YAC/B6E,mBAAmB,CAAC5G,IAAI,GAAG6G,QAAQ7G;QACrC;QACA,IAAK,MAAMA,OAAOgC,cAAe;YAC/B4E,mBAAmB,CAAC5G,IAAI,GAAG6G,QAAQ7G;QACrC;QACA,KAAK,MAAMA,OAAO;YAAC;SAAiC,CAAE;YACpD4G,mBAAmB,CAAC5G,IAAI,GAAG6G,QAAQ7G;QACrC;IACF;IAEA,OAAO4G;AACT","ignoreList":[0]}
|
package/dist/esm/build/index.js
CHANGED
@@ -320,7 +320,7 @@ export default async function build(dir, reactProductionProfiling = false, debug
|
|
320
320
|
const nextBuildSpan = trace('next-build', undefined, {
|
321
321
|
buildMode: experimentalBuildMode,
|
322
322
|
isTurboBuild: String(isTurbopack),
|
323
|
-
version: "15.4.0-canary.
|
323
|
+
version: "15.4.0-canary.129"
|
324
324
|
});
|
325
325
|
NextBuildContext.nextBuildSpan = nextBuildSpan;
|
326
326
|
NextBuildContext.dir = dir;
|
@@ -707,7 +707,7 @@ export default async function build(dir, reactProductionProfiling = false, debug
|
|
707
707
|
// Files outside of the distDir can be "type": "module"
|
708
708
|
await writeFileUtf8(path.join(distDir, 'package.json'), '{"type": "commonjs"}');
|
709
709
|
// These are written to distDir, so they need to come after creating and cleaning distDr.
|
710
|
-
await recordFrameworkVersion("15.4.0-canary.
|
710
|
+
await recordFrameworkVersion("15.4.0-canary.129");
|
711
711
|
await updateBuildDiagnostics({
|
712
712
|
buildStage: 'start'
|
713
713
|
});
|
@@ -11,7 +11,7 @@ import { isDeepStrictEqual } from 'util';
|
|
11
11
|
import { getDefineEnv } from '../define-env';
|
12
12
|
import { getReactCompilerLoader } from '../get-babel-loader-config';
|
13
13
|
import { TurbopackInternalError } from '../../shared/lib/turbopack/utils';
|
14
|
-
const nextVersion = "15.4.0-canary.
|
14
|
+
const nextVersion = "15.4.0-canary.129";
|
15
15
|
const ArchName = arch();
|
16
16
|
const PlatformName = platform();
|
17
17
|
function infoLog(...args) {
|
@@ -1588,7 +1588,7 @@ export default async function getBaseWebpackConfig(dir, { buildId, encryptionKey
|
|
1588
1588
|
isClient && new CopyFilePlugin({
|
1589
1589
|
// file path to build output of `@next/polyfill-nomodule`
|
1590
1590
|
filePath: require.resolve('./polyfills/polyfill-nomodule'),
|
1591
|
-
cacheKey: "15.4.0-canary.
|
1591
|
+
cacheKey: "15.4.0-canary.129",
|
1592
1592
|
name: `static/chunks/polyfills${dev ? '' : '-[hash]'}.js`,
|
1593
1593
|
minimize: false,
|
1594
1594
|
info: {
|
@@ -1768,7 +1768,7 @@ export default async function getBaseWebpackConfig(dir, { buildId, encryptionKey
|
|
1768
1768
|
// - Next.js location on disk (some loaders use absolute paths and some resolve options depend on absolute paths)
|
1769
1769
|
// - Next.js version
|
1770
1770
|
// - next.config.js keys that affect compilation
|
1771
|
-
version: `${__dirname}|${"15.4.0-canary.
|
1771
|
+
version: `${__dirname}|${"15.4.0-canary.129"}|${configVars}`,
|
1772
1772
|
cacheDirectory: path.join(distDir, 'cache', 'webpack'),
|
1773
1773
|
// For production builds, it's more efficient to compress all cache files together instead of compression each one individually.
|
1774
1774
|
// So we disable compression here and allow the build runner to take care of compressing the cache as a whole.
|
@@ -8,7 +8,7 @@ import { fetchServerResponse } from './router-reducer/fetch-server-response';
|
|
8
8
|
import { unresolvedThenable } from './unresolved-thenable';
|
9
9
|
import { ErrorBoundary } from './error-boundary';
|
10
10
|
import { matchSegment } from './match-segments';
|
11
|
-
import {
|
11
|
+
import { disableSmoothScrollDuringRouteTransition } from '../../shared/lib/router/utils/disable-smooth-scroll';
|
12
12
|
import { RedirectBoundary } from './redirect-boundary';
|
13
13
|
import { HTTPAccessFallbackBoundary } from './http-access-fallback/error-boundary';
|
14
14
|
import { createRouterCacheKey } from './router-reducer/create-router-cache-key';
|
@@ -174,7 +174,7 @@ class InnerScrollAndFocusHandler extends React.Component {
|
|
174
174
|
focusAndScrollRef.apply = false;
|
175
175
|
focusAndScrollRef.hashFragment = null;
|
176
176
|
focusAndScrollRef.segmentPaths = [];
|
177
|
-
|
177
|
+
disableSmoothScrollDuringRouteTransition(()=>{
|
178
178
|
// In case of hash scroll, we only need to scroll the element into view
|
179
179
|
if (hashFragment) {
|
180
180
|
;
|
@@ -205,7 +205,7 @@ class InnerScrollAndFocusHandler extends React.Component {
|
|
205
205
|
dontForceLayout: true,
|
206
206
|
onlyHashChange: focusAndScrollRef.onlyHashChange
|
207
207
|
});
|
208
|
-
// Mutate after scrolling so that it can be read by `
|
208
|
+
// Mutate after scrolling so that it can be read by `disableSmoothScrollDuringRouteTransition`
|
209
209
|
focusAndScrollRef.onlyHashChange = false;
|
210
210
|
// Set focus on the element
|
211
211
|
domNode.focus();
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"sources":["../../../src/client/components/layout-router.tsx"],"sourcesContent":["'use client'\n\nimport type {\n CacheNode,\n LazyCacheNode,\n LoadingModuleData,\n} from '../../shared/lib/app-router-context.shared-runtime'\nimport type {\n FlightRouterState,\n FlightSegmentPath,\n} from '../../server/app-render/types'\nimport type { ErrorComponent } from './error-boundary'\nimport {\n ACTION_SERVER_PATCH,\n type FocusAndScrollRef,\n} from './router-reducer/router-reducer-types'\n\nimport React, {\n useContext,\n use,\n startTransition,\n Suspense,\n useDeferredValue,\n type JSX,\n} from 'react'\nimport ReactDOM from 'react-dom'\nimport {\n LayoutRouterContext,\n GlobalLayoutRouterContext,\n TemplateContext,\n} from '../../shared/lib/app-router-context.shared-runtime'\nimport { fetchServerResponse } from './router-reducer/fetch-server-response'\nimport { unresolvedThenable } from './unresolved-thenable'\nimport { ErrorBoundary } from './error-boundary'\nimport { matchSegment } from './match-segments'\nimport { handleSmoothScroll } from '../../shared/lib/router/utils/handle-smooth-scroll'\nimport { RedirectBoundary } from './redirect-boundary'\nimport { HTTPAccessFallbackBoundary } from './http-access-fallback/error-boundary'\nimport { createRouterCacheKey } from './router-reducer/create-router-cache-key'\nimport { hasInterceptionRouteInCurrentTree } from './router-reducer/reducers/has-interception-route-in-current-tree'\nimport { dispatchAppRouterAction } from './use-action-queue'\nimport { useRouterBFCache, type RouterBFCacheEntry } from './bfcache'\n\nconst Activity = process.env.__NEXT_ROUTER_BF_CACHE\n ? (require('react') as typeof import('react')).unstable_Activity\n : null!\n\n/**\n * Add refetch marker to router state at the point of the current layout segment.\n * This ensures the response returned is not further down than the current layout segment.\n */\nfunction walkAddRefetch(\n segmentPathToWalk: FlightSegmentPath | undefined,\n treeToRecreate: FlightRouterState\n): FlightRouterState {\n if (segmentPathToWalk) {\n const [segment, parallelRouteKey] = segmentPathToWalk\n const isLast = segmentPathToWalk.length === 2\n\n if (matchSegment(treeToRecreate[0], segment)) {\n if (treeToRecreate[1].hasOwnProperty(parallelRouteKey)) {\n if (isLast) {\n const subTree = walkAddRefetch(\n undefined,\n treeToRecreate[1][parallelRouteKey]\n )\n return [\n treeToRecreate[0],\n {\n ...treeToRecreate[1],\n [parallelRouteKey]: [\n subTree[0],\n subTree[1],\n subTree[2],\n 'refetch',\n ],\n },\n ]\n }\n\n return [\n treeToRecreate[0],\n {\n ...treeToRecreate[1],\n [parallelRouteKey]: walkAddRefetch(\n segmentPathToWalk.slice(2),\n treeToRecreate[1][parallelRouteKey]\n ),\n },\n ]\n }\n }\n }\n\n return treeToRecreate\n}\n\nconst __DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = (\n ReactDOM as any\n).__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE\n\n// TODO-APP: Replace with new React API for finding dom nodes without a `ref` when available\n/**\n * Wraps ReactDOM.findDOMNode with additional logic to hide React Strict Mode warning\n */\nfunction findDOMNode(\n instance: React.ReactInstance | null | undefined\n): Element | Text | null {\n // Tree-shake for server bundle\n if (typeof window === 'undefined') return null\n\n // __DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE.findDOMNode is null during module init.\n // We need to lazily reference it.\n const internal_reactDOMfindDOMNode =\n __DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE.findDOMNode\n return internal_reactDOMfindDOMNode(instance)\n}\n\nconst rectProperties = [\n 'bottom',\n 'height',\n 'left',\n 'right',\n 'top',\n 'width',\n 'x',\n 'y',\n] as const\n/**\n * Check if a HTMLElement is hidden or fixed/sticky position\n */\nfunction shouldSkipElement(element: HTMLElement) {\n // we ignore fixed or sticky positioned elements since they'll likely pass the \"in-viewport\" check\n // and will result in a situation we bail on scroll because of something like a fixed nav,\n // even though the actual page content is offscreen\n if (['sticky', 'fixed'].includes(getComputedStyle(element).position)) {\n if (process.env.NODE_ENV === 'development') {\n console.warn(\n 'Skipping auto-scroll behavior due to `position: sticky` or `position: fixed` on element:',\n element\n )\n }\n return true\n }\n\n // Uses `getBoundingClientRect` to check if the element is hidden instead of `offsetParent`\n // because `offsetParent` doesn't consider document/body\n const rect = element.getBoundingClientRect()\n return rectProperties.every((item) => rect[item] === 0)\n}\n\n/**\n * Check if the top corner of the HTMLElement is in the viewport.\n */\nfunction topOfElementInViewport(element: HTMLElement, viewportHeight: number) {\n const rect = element.getBoundingClientRect()\n return rect.top >= 0 && rect.top <= viewportHeight\n}\n\n/**\n * Find the DOM node for a hash fragment.\n * If `top` the page has to scroll to the top of the page. This mirrors the browser's behavior.\n * If the hash fragment is an id, the page has to scroll to the element with that id.\n * If the hash fragment is a name, the page has to scroll to the first element with that name.\n */\nfunction getHashFragmentDomNode(hashFragment: string) {\n // If the hash fragment is `top` the page has to scroll to the top of the page.\n if (hashFragment === 'top') {\n return document.body\n }\n\n // If the hash fragment is an id, the page has to scroll to the element with that id.\n return (\n document.getElementById(hashFragment) ??\n // If the hash fragment is a name, the page has to scroll to the first element with that name.\n document.getElementsByName(hashFragment)[0]\n )\n}\ninterface ScrollAndFocusHandlerProps {\n focusAndScrollRef: FocusAndScrollRef\n children: React.ReactNode\n segmentPath: FlightSegmentPath\n}\nclass InnerScrollAndFocusHandler extends React.Component<ScrollAndFocusHandlerProps> {\n handlePotentialScroll = () => {\n // Handle scroll and focus, it's only applied once in the first useEffect that triggers that changed.\n const { focusAndScrollRef, segmentPath } = this.props\n\n if (focusAndScrollRef.apply) {\n // segmentPaths is an array of segment paths that should be scrolled to\n // if the current segment path is not in the array, the scroll is not applied\n // unless the array is empty, in which case the scroll is always applied\n if (\n focusAndScrollRef.segmentPaths.length !== 0 &&\n !focusAndScrollRef.segmentPaths.some((scrollRefSegmentPath) =>\n segmentPath.every((segment, index) =>\n matchSegment(segment, scrollRefSegmentPath[index])\n )\n )\n ) {\n return\n }\n\n let domNode:\n | ReturnType<typeof getHashFragmentDomNode>\n | ReturnType<typeof findDOMNode> = null\n const hashFragment = focusAndScrollRef.hashFragment\n\n if (hashFragment) {\n domNode = getHashFragmentDomNode(hashFragment)\n }\n\n // `findDOMNode` is tricky because it returns just the first child if the component is a fragment.\n // This already caused a bug where the first child was a <link/> in head.\n if (!domNode) {\n domNode = findDOMNode(this)\n }\n\n // If there is no DOM node this layout-router level is skipped. It'll be handled higher-up in the tree.\n if (!(domNode instanceof Element)) {\n return\n }\n\n // Verify if the element is a HTMLElement and if we want to consider it for scroll behavior.\n // If the element is skipped, try to select the next sibling and try again.\n while (!(domNode instanceof HTMLElement) || shouldSkipElement(domNode)) {\n if (process.env.NODE_ENV !== 'production') {\n if (domNode.parentElement?.localName === 'head') {\n // TODO: We enter this state when metadata was rendered as part of the page or via Next.js.\n // This is always a bug in Next.js and caused by React hoisting metadata.\n // We need to replace `findDOMNode` in favor of Fragment Refs (when available) so that we can skip over metadata.\n }\n }\n\n // No siblings found that match the criteria are found, so handle scroll higher up in the tree instead.\n if (domNode.nextElementSibling === null) {\n return\n }\n domNode = domNode.nextElementSibling\n }\n\n // State is mutated to ensure that the focus and scroll is applied only once.\n focusAndScrollRef.apply = false\n focusAndScrollRef.hashFragment = null\n focusAndScrollRef.segmentPaths = []\n\n handleSmoothScroll(\n () => {\n // In case of hash scroll, we only need to scroll the element into view\n if (hashFragment) {\n ;(domNode as HTMLElement).scrollIntoView()\n\n return\n }\n // Store the current viewport height because reading `clientHeight` causes a reflow,\n // and it won't change during this function.\n const htmlElement = document.documentElement\n const viewportHeight = htmlElement.clientHeight\n\n // If the element's top edge is already in the viewport, exit early.\n if (topOfElementInViewport(domNode as HTMLElement, viewportHeight)) {\n return\n }\n\n // Otherwise, try scrolling go the top of the document to be backward compatible with pages\n // scrollIntoView() called on `<html/>` element scrolls horizontally on chrome and firefox (that shouldn't happen)\n // We could use it to scroll horizontally following RTL but that also seems to be broken - it will always scroll left\n // scrollLeft = 0 also seems to ignore RTL and manually checking for RTL is too much hassle so we will scroll just vertically\n htmlElement.scrollTop = 0\n\n // Scroll to domNode if domNode is not in viewport when scrolled to top of document\n if (!topOfElementInViewport(domNode as HTMLElement, viewportHeight)) {\n // Scroll into view doesn't scroll horizontally by default when not needed\n ;(domNode as HTMLElement).scrollIntoView()\n }\n },\n {\n // We will force layout by querying domNode position\n dontForceLayout: true,\n onlyHashChange: focusAndScrollRef.onlyHashChange,\n }\n )\n\n // Mutate after scrolling so that it can be read by `handleSmoothScroll`\n focusAndScrollRef.onlyHashChange = false\n\n // Set focus on the element\n domNode.focus()\n }\n }\n\n componentDidMount() {\n this.handlePotentialScroll()\n }\n\n componentDidUpdate() {\n // Because this property is overwritten in handlePotentialScroll it's fine to always run it when true as it'll be set to false for subsequent renders.\n if (this.props.focusAndScrollRef.apply) {\n this.handlePotentialScroll()\n }\n }\n\n render() {\n return this.props.children\n }\n}\n\nfunction ScrollAndFocusHandler({\n segmentPath,\n children,\n}: {\n segmentPath: FlightSegmentPath\n children: React.ReactNode\n}) {\n const context = useContext(GlobalLayoutRouterContext)\n if (!context) {\n throw new Error('invariant global layout router not mounted')\n }\n\n return (\n <InnerScrollAndFocusHandler\n segmentPath={segmentPath}\n focusAndScrollRef={context.focusAndScrollRef}\n >\n {children}\n </InnerScrollAndFocusHandler>\n )\n}\n\n/**\n * InnerLayoutRouter handles rendering the provided segment based on the cache.\n */\nfunction InnerLayoutRouter({\n tree,\n segmentPath,\n cacheNode,\n url,\n}: {\n tree: FlightRouterState\n segmentPath: FlightSegmentPath\n cacheNode: CacheNode\n url: string\n}) {\n const context = useContext(GlobalLayoutRouterContext)\n if (!context) {\n throw new Error('invariant global layout router not mounted')\n }\n\n const { tree: fullTree } = context\n\n // `rsc` represents the renderable node for this segment.\n\n // If this segment has a `prefetchRsc`, it's the statically prefetched data.\n // We should use that on initial render instead of `rsc`. Then we'll switch\n // to `rsc` when the dynamic response streams in.\n //\n // If no prefetch data is available, then we go straight to rendering `rsc`.\n const resolvedPrefetchRsc =\n cacheNode.prefetchRsc !== null ? cacheNode.prefetchRsc : cacheNode.rsc\n\n // We use `useDeferredValue` to handle switching between the prefetched and\n // final values. The second argument is returned on initial render, then it\n // re-renders with the first argument.\n const rsc: any = useDeferredValue(cacheNode.rsc, resolvedPrefetchRsc)\n\n // `rsc` is either a React node or a promise for a React node, except we\n // special case `null` to represent that this segment's data is missing. If\n // it's a promise, we need to unwrap it so we can determine whether or not the\n // data is missing.\n const resolvedRsc: React.ReactNode =\n typeof rsc === 'object' && rsc !== null && typeof rsc.then === 'function'\n ? use(rsc)\n : rsc\n\n if (!resolvedRsc) {\n // The data for this segment is not available, and there's no pending\n // navigation that will be able to fulfill it. We need to fetch more from\n // the server and patch the cache.\n\n // Check if there's already a pending request.\n let lazyData = cacheNode.lazyData\n if (lazyData === null) {\n /**\n * Router state with refetch marker added\n */\n // TODO-APP: remove ''\n const refetchTree = walkAddRefetch(['', ...segmentPath], fullTree)\n const includeNextUrl = hasInterceptionRouteInCurrentTree(fullTree)\n const navigatedAt = Date.now()\n cacheNode.lazyData = lazyData = fetchServerResponse(\n new URL(url, location.origin),\n {\n flightRouterState: refetchTree,\n nextUrl: includeNextUrl ? context.nextUrl : null,\n }\n ).then((serverResponse) => {\n startTransition(() => {\n dispatchAppRouterAction({\n type: ACTION_SERVER_PATCH,\n previousTree: fullTree,\n serverResponse,\n navigatedAt,\n })\n })\n\n return serverResponse\n })\n\n // Suspend while waiting for lazyData to resolve\n use(lazyData)\n }\n // Suspend infinitely as `changeByServerResponse` will cause a different part of the tree to be rendered.\n // A falsey `resolvedRsc` indicates missing data -- we should not commit that branch, and we need to wait for the data to arrive.\n use(unresolvedThenable) as never\n }\n\n // If we get to this point, then we know we have something we can render.\n const subtree = (\n // The layout router context narrows down tree and childNodes at each level.\n <LayoutRouterContext.Provider\n value={{\n parentTree: tree,\n parentCacheNode: cacheNode,\n parentSegmentPath: segmentPath,\n\n // TODO-APP: overriding of url for parallel routes\n url: url,\n }}\n >\n {resolvedRsc}\n </LayoutRouterContext.Provider>\n )\n // Ensure root layout is not wrapped in a div as the root layout renders `<html>`\n return subtree\n}\n\n/**\n * Renders suspense boundary with the provided \"loading\" property as the fallback.\n * If no loading property is provided it renders the children without a suspense boundary.\n */\nfunction LoadingBoundary({\n loading,\n children,\n}: {\n loading: LoadingModuleData | Promise<LoadingModuleData>\n children: React.ReactNode\n}): JSX.Element {\n // If loading is a promise, unwrap it. This happens in cases where we haven't\n // yet received the loading data from the server — which includes whether or\n // not this layout has a loading component at all.\n //\n // It's OK to suspend here instead of inside the fallback because this\n // promise will resolve simultaneously with the data for the segment itself.\n // So it will never suspend for longer than it would have if we didn't use\n // a Suspense fallback at all.\n let loadingModuleData\n if (\n typeof loading === 'object' &&\n loading !== null &&\n typeof (loading as any).then === 'function'\n ) {\n const promiseForLoading = loading as Promise<LoadingModuleData>\n loadingModuleData = use(promiseForLoading)\n } else {\n loadingModuleData = loading as LoadingModuleData\n }\n\n if (loadingModuleData) {\n const loadingRsc = loadingModuleData[0]\n const loadingStyles = loadingModuleData[1]\n const loadingScripts = loadingModuleData[2]\n return (\n <Suspense\n fallback={\n <>\n {loadingStyles}\n {loadingScripts}\n {loadingRsc}\n </>\n }\n >\n {children}\n </Suspense>\n )\n }\n\n return <>{children}</>\n}\n\nfunction RenderChildren({ children }: { children: React.ReactNode }) {\n return <>{children}</>\n}\n\n/**\n * OuterLayoutRouter handles the current segment as well as <Offscreen> rendering of other segments.\n * It can be rendered next to each other with a different `parallelRouterKey`, allowing for Parallel routes.\n */\nexport default function OuterLayoutRouter({\n parallelRouterKey,\n error,\n errorStyles,\n errorScripts,\n templateStyles,\n templateScripts,\n template,\n notFound,\n forbidden,\n unauthorized,\n gracefullyDegrade,\n segmentViewBoundaries,\n}: {\n parallelRouterKey: string\n error: ErrorComponent | undefined\n errorStyles: React.ReactNode | undefined\n errorScripts: React.ReactNode | undefined\n templateStyles: React.ReactNode | undefined\n templateScripts: React.ReactNode | undefined\n template: React.ReactNode\n notFound: React.ReactNode | undefined\n forbidden: React.ReactNode | undefined\n unauthorized: React.ReactNode | undefined\n gracefullyDegrade?: boolean\n segmentViewBoundaries?: React.ReactNode\n}) {\n const context = useContext(LayoutRouterContext)\n if (!context) {\n throw new Error('invariant expected layout router to be mounted')\n }\n\n const { parentTree, parentCacheNode, parentSegmentPath, url } = context\n\n // Get the CacheNode for this segment by reading it from the parent segment's\n // child map.\n const parentParallelRoutes = parentCacheNode.parallelRoutes\n let segmentMap = parentParallelRoutes.get(parallelRouterKey)\n // If the parallel router cache node does not exist yet, create it.\n // This writes to the cache when there is no item in the cache yet. It never *overwrites* existing cache items which is why it's safe in concurrent mode.\n if (!segmentMap) {\n segmentMap = new Map()\n parentParallelRoutes.set(parallelRouterKey, segmentMap)\n }\n const parentTreeSegment = parentTree[0]\n const segmentPath =\n parentSegmentPath === null\n ? // TODO: The root segment value is currently omitted from the segment\n // path. This has led to a bunch of special cases scattered throughout\n // the code. We should clean this up.\n [parallelRouterKey]\n : parentSegmentPath.concat([parentTreeSegment, parallelRouterKey])\n\n // The \"state\" key of a segment is the one passed to React — it represents the\n // identity of the UI tree. Whenever the state key changes, the tree is\n // recreated and the state is reset. In the App Router model, search params do\n // not cause state to be lost, so two segments with the same segment path but\n // different search params should have the same state key.\n //\n // The \"cache\" key of a segment, however, *does* include the search params, if\n // it's possible that the segment accessed the search params on the server.\n // (This only applies to page segments; layout segments cannot access search\n // params on the server.)\n const activeTree = parentTree[1][parallelRouterKey]\n const activeSegment = activeTree[0]\n const activeStateKey = createRouterCacheKey(activeSegment, true) // no search params\n\n // At each level of the route tree, not only do we render the currently\n // active segment — we also render the last N segments that were active at\n // this level inside a hidden <Activity> boundary, to preserve their state\n // if or when the user navigates to them again.\n //\n // bfcacheEntry is a linked list of FlightRouterStates.\n let bfcacheEntry: RouterBFCacheEntry | null = useRouterBFCache(\n activeTree,\n activeStateKey\n )\n let children: Array<React.ReactNode> = []\n do {\n const tree = bfcacheEntry.tree\n const stateKey = bfcacheEntry.stateKey\n const segment = tree[0]\n const cacheKey = createRouterCacheKey(segment)\n\n // Read segment path from the parallel router cache node.\n let cacheNode = segmentMap.get(cacheKey)\n if (cacheNode === undefined) {\n // When data is not available during rendering client-side we need to fetch\n // it from the server.\n const newLazyCacheNode: LazyCacheNode = {\n lazyData: null,\n rsc: null,\n prefetchRsc: null,\n head: null,\n prefetchHead: null,\n parallelRoutes: new Map(),\n loading: null,\n navigatedAt: -1,\n }\n\n // Flight data fetch kicked off during render and put into the cache.\n cacheNode = newLazyCacheNode\n segmentMap.set(cacheKey, newLazyCacheNode)\n }\n\n /*\n - Error boundary\n - Only renders error boundary if error component is provided.\n - Rendered for each segment to ensure they have their own error state.\n - When gracefully degrade for bots, skip rendering error boundary.\n - Loading boundary\n - Only renders suspense boundary if loading components is provided.\n - Rendered for each segment to ensure they have their own loading state.\n - Passed to the router during rendering to ensure it can be immediately rendered when suspending on a Flight fetch.\n */\n\n const ErrorBoundaryComponent = gracefullyDegrade\n ? RenderChildren\n : ErrorBoundary\n\n let segmentBoundaryTriggerNode: React.ReactNode = null\n if (\n process.env.NODE_ENV !== 'production' &&\n process.env.__NEXT_DEVTOOL_SEGMENT_EXPLORER\n ) {\n const { SegmentBoundaryTriggerNode } =\n require('../../next-devtools/userspace/app/segment-explorer-node') as typeof import('../../next-devtools/userspace/app/segment-explorer-node')\n\n segmentBoundaryTriggerNode = (\n <>\n <SegmentBoundaryTriggerNode />\n </>\n )\n }\n\n // TODO: The loading module data for a segment is stored on the parent, then\n // applied to each of that parent segment's parallel route slots. In the\n // simple case where there's only one parallel route (the `children` slot),\n // this is no different from if the loading module data where stored on the\n // child directly. But I'm not sure this actually makes sense when there are\n // multiple parallel routes. It's not a huge issue because you always have\n // the option to define a narrower loading boundary for a particular slot. But\n // this sort of smells like an implementation accident to me.\n const loadingModuleData = parentCacheNode.loading\n let child = (\n <TemplateContext.Provider\n key={stateKey}\n value={\n <ScrollAndFocusHandler segmentPath={segmentPath}>\n <ErrorBoundaryComponent\n errorComponent={error}\n errorStyles={errorStyles}\n errorScripts={errorScripts}\n >\n <LoadingBoundary loading={loadingModuleData}>\n <HTTPAccessFallbackBoundary\n notFound={notFound}\n forbidden={forbidden}\n unauthorized={unauthorized}\n >\n <RedirectBoundary>\n <InnerLayoutRouter\n url={url}\n tree={tree}\n cacheNode={cacheNode}\n segmentPath={segmentPath}\n />\n {segmentBoundaryTriggerNode}\n </RedirectBoundary>\n </HTTPAccessFallbackBoundary>\n </LoadingBoundary>\n </ErrorBoundaryComponent>\n </ScrollAndFocusHandler>\n }\n >\n {templateStyles}\n {templateScripts}\n {template}\n </TemplateContext.Provider>\n )\n\n if (process.env.NODE_ENV !== 'production') {\n const { SegmentStateProvider } =\n require('../../next-devtools/userspace/app/segment-explorer-node') as typeof import('../../next-devtools/userspace/app/segment-explorer-node')\n\n child = (\n <SegmentStateProvider key={stateKey}>\n {child}\n {segmentViewBoundaries}\n </SegmentStateProvider>\n )\n }\n\n if (process.env.__NEXT_ROUTER_BF_CACHE) {\n child = (\n <Activity\n key={stateKey}\n mode={stateKey === activeStateKey ? 'visible' : 'hidden'}\n >\n {child}\n </Activity>\n )\n }\n\n children.push(child)\n\n bfcacheEntry = bfcacheEntry.next\n } while (bfcacheEntry !== null)\n\n return children\n}\n"],"names":["ACTION_SERVER_PATCH","React","useContext","use","startTransition","Suspense","useDeferredValue","ReactDOM","LayoutRouterContext","GlobalLayoutRouterContext","TemplateContext","fetchServerResponse","unresolvedThenable","ErrorBoundary","matchSegment","handleSmoothScroll","RedirectBoundary","HTTPAccessFallbackBoundary","createRouterCacheKey","hasInterceptionRouteInCurrentTree","dispatchAppRouterAction","useRouterBFCache","Activity","process","env","__NEXT_ROUTER_BF_CACHE","require","unstable_Activity","walkAddRefetch","segmentPathToWalk","treeToRecreate","segment","parallelRouteKey","isLast","length","hasOwnProperty","subTree","undefined","slice","__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE","findDOMNode","instance","window","internal_reactDOMfindDOMNode","rectProperties","shouldSkipElement","element","includes","getComputedStyle","position","NODE_ENV","console","warn","rect","getBoundingClientRect","every","item","topOfElementInViewport","viewportHeight","top","getHashFragmentDomNode","hashFragment","document","body","getElementById","getElementsByName","InnerScrollAndFocusHandler","Component","componentDidMount","handlePotentialScroll","componentDidUpdate","props","focusAndScrollRef","apply","render","children","segmentPath","segmentPaths","some","scrollRefSegmentPath","index","domNode","Element","HTMLElement","parentElement","localName","nextElementSibling","scrollIntoView","htmlElement","documentElement","clientHeight","scrollTop","dontForceLayout","onlyHashChange","focus","ScrollAndFocusHandler","context","Error","InnerLayoutRouter","tree","cacheNode","url","fullTree","resolvedPrefetchRsc","prefetchRsc","rsc","resolvedRsc","then","lazyData","refetchTree","includeNextUrl","navigatedAt","Date","now","URL","location","origin","flightRouterState","nextUrl","serverResponse","type","previousTree","subtree","Provider","value","parentTree","parentCacheNode","parentSegmentPath","LoadingBoundary","loading","loadingModuleData","promiseForLoading","loadingRsc","loadingStyles","loadingScripts","fallback","RenderChildren","OuterLayoutRouter","parallelRouterKey","error","errorStyles","errorScripts","templateStyles","templateScripts","template","notFound","forbidden","unauthorized","gracefullyDegrade","segmentViewBoundaries","parentParallelRoutes","parallelRoutes","segmentMap","get","Map","set","parentTreeSegment","concat","activeTree","activeSegment","activeStateKey","bfcacheEntry","stateKey","cacheKey","newLazyCacheNode","head","prefetchHead","ErrorBoundaryComponent","segmentBoundaryTriggerNode","__NEXT_DEVTOOL_SEGMENT_EXPLORER","SegmentBoundaryTriggerNode","child","errorComponent","SegmentStateProvider","mode","push","next"],"mappings":"AAAA;;AAYA,SACEA,mBAAmB,QAEd,wCAAuC;AAE9C,OAAOC,SACLC,UAAU,EACVC,GAAG,EACHC,eAAe,EACfC,QAAQ,EACRC,gBAAgB,QAEX,QAAO;AACd,OAAOC,cAAc,YAAW;AAChC,SACEC,mBAAmB,EACnBC,yBAAyB,EACzBC,eAAe,QACV,qDAAoD;AAC3D,SAASC,mBAAmB,QAAQ,yCAAwC;AAC5E,SAASC,kBAAkB,QAAQ,wBAAuB;AAC1D,SAASC,aAAa,QAAQ,mBAAkB;AAChD,SAASC,YAAY,QAAQ,mBAAkB;AAC/C,S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;;gBAQZ1B;gBACAC;gBACAC;;WA/BIkB;QAmCT,IAAI3I,QAAQC,GAAG,CAAC0B,QAAQ,KAAK,cAAc;YACzC,MAAM,EAAE2H,oBAAoB,EAAE,GAC5BnJ,QAAQ;YAEViJ,sBACE,MAACE;;oBACEF;oBACAtB;;eAFwBa;QAK/B;QAEA,IAAI3I,QAAQC,GAAG,CAACC,sBAAsB,EAAE;YACtCkJ,sBACE,KAACrJ;gBAECwJ,MAAMZ,aAAaF,iBAAiB,YAAY;0BAE/CW;eAHIT;QAMX;QAEAvF,SAASoG,IAAI,CAACJ;QAEdV,eAAeA,aAAae,IAAI;IAClC,QAASf,iBAAiB,MAAK;IAE/B,OAAOtF;AACT","ignoreList":[0]}
|
1
|
+
{"version":3,"sources":["../../../src/client/components/layout-router.tsx"],"sourcesContent":["'use client'\n\nimport type {\n CacheNode,\n LazyCacheNode,\n LoadingModuleData,\n} from '../../shared/lib/app-router-context.shared-runtime'\nimport type {\n FlightRouterState,\n FlightSegmentPath,\n} from '../../server/app-render/types'\nimport type { ErrorComponent } from './error-boundary'\nimport {\n ACTION_SERVER_PATCH,\n type FocusAndScrollRef,\n} from './router-reducer/router-reducer-types'\n\nimport React, {\n useContext,\n use,\n startTransition,\n Suspense,\n useDeferredValue,\n type JSX,\n} from 'react'\nimport ReactDOM from 'react-dom'\nimport {\n LayoutRouterContext,\n GlobalLayoutRouterContext,\n TemplateContext,\n} from '../../shared/lib/app-router-context.shared-runtime'\nimport { fetchServerResponse } from './router-reducer/fetch-server-response'\nimport { unresolvedThenable } from './unresolved-thenable'\nimport { ErrorBoundary } from './error-boundary'\nimport { matchSegment } from './match-segments'\nimport { disableSmoothScrollDuringRouteTransition } from '../../shared/lib/router/utils/disable-smooth-scroll'\nimport { RedirectBoundary } from './redirect-boundary'\nimport { HTTPAccessFallbackBoundary } from './http-access-fallback/error-boundary'\nimport { createRouterCacheKey } from './router-reducer/create-router-cache-key'\nimport { hasInterceptionRouteInCurrentTree } from './router-reducer/reducers/has-interception-route-in-current-tree'\nimport { dispatchAppRouterAction } from './use-action-queue'\nimport { useRouterBFCache, type RouterBFCacheEntry } from './bfcache'\n\nconst Activity = process.env.__NEXT_ROUTER_BF_CACHE\n ? (require('react') as typeof import('react')).unstable_Activity\n : null!\n\n/**\n * Add refetch marker to router state at the point of the current layout segment.\n * This ensures the response returned is not further down than the current layout segment.\n */\nfunction walkAddRefetch(\n segmentPathToWalk: FlightSegmentPath | undefined,\n treeToRecreate: FlightRouterState\n): FlightRouterState {\n if (segmentPathToWalk) {\n const [segment, parallelRouteKey] = segmentPathToWalk\n const isLast = segmentPathToWalk.length === 2\n\n if (matchSegment(treeToRecreate[0], segment)) {\n if (treeToRecreate[1].hasOwnProperty(parallelRouteKey)) {\n if (isLast) {\n const subTree = walkAddRefetch(\n undefined,\n treeToRecreate[1][parallelRouteKey]\n )\n return [\n treeToRecreate[0],\n {\n ...treeToRecreate[1],\n [parallelRouteKey]: [\n subTree[0],\n subTree[1],\n subTree[2],\n 'refetch',\n ],\n },\n ]\n }\n\n return [\n treeToRecreate[0],\n {\n ...treeToRecreate[1],\n [parallelRouteKey]: walkAddRefetch(\n segmentPathToWalk.slice(2),\n treeToRecreate[1][parallelRouteKey]\n ),\n },\n ]\n }\n }\n }\n\n return treeToRecreate\n}\n\nconst __DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = (\n ReactDOM as any\n).__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE\n\n// TODO-APP: Replace with new React API for finding dom nodes without a `ref` when available\n/**\n * Wraps ReactDOM.findDOMNode with additional logic to hide React Strict Mode warning\n */\nfunction findDOMNode(\n instance: React.ReactInstance | null | undefined\n): Element | Text | null {\n // Tree-shake for server bundle\n if (typeof window === 'undefined') return null\n\n // __DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE.findDOMNode is null during module init.\n // We need to lazily reference it.\n const internal_reactDOMfindDOMNode =\n __DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE.findDOMNode\n return internal_reactDOMfindDOMNode(instance)\n}\n\nconst rectProperties = [\n 'bottom',\n 'height',\n 'left',\n 'right',\n 'top',\n 'width',\n 'x',\n 'y',\n] as const\n/**\n * Check if a HTMLElement is hidden or fixed/sticky position\n */\nfunction shouldSkipElement(element: HTMLElement) {\n // we ignore fixed or sticky positioned elements since they'll likely pass the \"in-viewport\" check\n // and will result in a situation we bail on scroll because of something like a fixed nav,\n // even though the actual page content is offscreen\n if (['sticky', 'fixed'].includes(getComputedStyle(element).position)) {\n if (process.env.NODE_ENV === 'development') {\n console.warn(\n 'Skipping auto-scroll behavior due to `position: sticky` or `position: fixed` on element:',\n element\n )\n }\n return true\n }\n\n // Uses `getBoundingClientRect` to check if the element is hidden instead of `offsetParent`\n // because `offsetParent` doesn't consider document/body\n const rect = element.getBoundingClientRect()\n return rectProperties.every((item) => rect[item] === 0)\n}\n\n/**\n * Check if the top corner of the HTMLElement is in the viewport.\n */\nfunction topOfElementInViewport(element: HTMLElement, viewportHeight: number) {\n const rect = element.getBoundingClientRect()\n return rect.top >= 0 && rect.top <= viewportHeight\n}\n\n/**\n * Find the DOM node for a hash fragment.\n * If `top` the page has to scroll to the top of the page. This mirrors the browser's behavior.\n * If the hash fragment is an id, the page has to scroll to the element with that id.\n * If the hash fragment is a name, the page has to scroll to the first element with that name.\n */\nfunction getHashFragmentDomNode(hashFragment: string) {\n // If the hash fragment is `top` the page has to scroll to the top of the page.\n if (hashFragment === 'top') {\n return document.body\n }\n\n // If the hash fragment is an id, the page has to scroll to the element with that id.\n return (\n document.getElementById(hashFragment) ??\n // If the hash fragment is a name, the page has to scroll to the first element with that name.\n document.getElementsByName(hashFragment)[0]\n )\n}\ninterface ScrollAndFocusHandlerProps {\n focusAndScrollRef: FocusAndScrollRef\n children: React.ReactNode\n segmentPath: FlightSegmentPath\n}\nclass InnerScrollAndFocusHandler extends React.Component<ScrollAndFocusHandlerProps> {\n handlePotentialScroll = () => {\n // Handle scroll and focus, it's only applied once in the first useEffect that triggers that changed.\n const { focusAndScrollRef, segmentPath } = this.props\n\n if (focusAndScrollRef.apply) {\n // segmentPaths is an array of segment paths that should be scrolled to\n // if the current segment path is not in the array, the scroll is not applied\n // unless the array is empty, in which case the scroll is always applied\n if (\n focusAndScrollRef.segmentPaths.length !== 0 &&\n !focusAndScrollRef.segmentPaths.some((scrollRefSegmentPath) =>\n segmentPath.every((segment, index) =>\n matchSegment(segment, scrollRefSegmentPath[index])\n )\n )\n ) {\n return\n }\n\n let domNode:\n | ReturnType<typeof getHashFragmentDomNode>\n | ReturnType<typeof findDOMNode> = null\n const hashFragment = focusAndScrollRef.hashFragment\n\n if (hashFragment) {\n domNode = getHashFragmentDomNode(hashFragment)\n }\n\n // `findDOMNode` is tricky because it returns just the first child if the component is a fragment.\n // This already caused a bug where the first child was a <link/> in head.\n if (!domNode) {\n domNode = findDOMNode(this)\n }\n\n // If there is no DOM node this layout-router level is skipped. It'll be handled higher-up in the tree.\n if (!(domNode instanceof Element)) {\n return\n }\n\n // Verify if the element is a HTMLElement and if we want to consider it for scroll behavior.\n // If the element is skipped, try to select the next sibling and try again.\n while (!(domNode instanceof HTMLElement) || shouldSkipElement(domNode)) {\n if (process.env.NODE_ENV !== 'production') {\n if (domNode.parentElement?.localName === 'head') {\n // TODO: We enter this state when metadata was rendered as part of the page or via Next.js.\n // This is always a bug in Next.js and caused by React hoisting metadata.\n // We need to replace `findDOMNode` in favor of Fragment Refs (when available) so that we can skip over metadata.\n }\n }\n\n // No siblings found that match the criteria are found, so handle scroll higher up in the tree instead.\n if (domNode.nextElementSibling === null) {\n return\n }\n domNode = domNode.nextElementSibling\n }\n\n // State is mutated to ensure that the focus and scroll is applied only once.\n focusAndScrollRef.apply = false\n focusAndScrollRef.hashFragment = null\n focusAndScrollRef.segmentPaths = []\n\n disableSmoothScrollDuringRouteTransition(\n () => {\n // In case of hash scroll, we only need to scroll the element into view\n if (hashFragment) {\n ;(domNode as HTMLElement).scrollIntoView()\n\n return\n }\n // Store the current viewport height because reading `clientHeight` causes a reflow,\n // and it won't change during this function.\n const htmlElement = document.documentElement\n const viewportHeight = htmlElement.clientHeight\n\n // If the element's top edge is already in the viewport, exit early.\n if (topOfElementInViewport(domNode as HTMLElement, viewportHeight)) {\n return\n }\n\n // Otherwise, try scrolling go the top of the document to be backward compatible with pages\n // scrollIntoView() called on `<html/>` element scrolls horizontally on chrome and firefox (that shouldn't happen)\n // We could use it to scroll horizontally following RTL but that also seems to be broken - it will always scroll left\n // scrollLeft = 0 also seems to ignore RTL and manually checking for RTL is too much hassle so we will scroll just vertically\n htmlElement.scrollTop = 0\n\n // Scroll to domNode if domNode is not in viewport when scrolled to top of document\n if (!topOfElementInViewport(domNode as HTMLElement, viewportHeight)) {\n // Scroll into view doesn't scroll horizontally by default when not needed\n ;(domNode as HTMLElement).scrollIntoView()\n }\n },\n {\n // We will force layout by querying domNode position\n dontForceLayout: true,\n onlyHashChange: focusAndScrollRef.onlyHashChange,\n }\n )\n\n // Mutate after scrolling so that it can be read by `disableSmoothScrollDuringRouteTransition`\n focusAndScrollRef.onlyHashChange = false\n\n // Set focus on the element\n domNode.focus()\n }\n }\n\n componentDidMount() {\n this.handlePotentialScroll()\n }\n\n componentDidUpdate() {\n // Because this property is overwritten in handlePotentialScroll it's fine to always run it when true as it'll be set to false for subsequent renders.\n if (this.props.focusAndScrollRef.apply) {\n this.handlePotentialScroll()\n }\n }\n\n render() {\n return this.props.children\n }\n}\n\nfunction ScrollAndFocusHandler({\n segmentPath,\n children,\n}: {\n segmentPath: FlightSegmentPath\n children: React.ReactNode\n}) {\n const context = useContext(GlobalLayoutRouterContext)\n if (!context) {\n throw new Error('invariant global layout router not mounted')\n }\n\n return (\n <InnerScrollAndFocusHandler\n segmentPath={segmentPath}\n focusAndScrollRef={context.focusAndScrollRef}\n >\n {children}\n </InnerScrollAndFocusHandler>\n )\n}\n\n/**\n * InnerLayoutRouter handles rendering the provided segment based on the cache.\n */\nfunction InnerLayoutRouter({\n tree,\n segmentPath,\n cacheNode,\n url,\n}: {\n tree: FlightRouterState\n segmentPath: FlightSegmentPath\n cacheNode: CacheNode\n url: string\n}) {\n const context = useContext(GlobalLayoutRouterContext)\n if (!context) {\n throw new Error('invariant global layout router not mounted')\n }\n\n const { tree: fullTree } = context\n\n // `rsc` represents the renderable node for this segment.\n\n // If this segment has a `prefetchRsc`, it's the statically prefetched data.\n // We should use that on initial render instead of `rsc`. Then we'll switch\n // to `rsc` when the dynamic response streams in.\n //\n // If no prefetch data is available, then we go straight to rendering `rsc`.\n const resolvedPrefetchRsc =\n cacheNode.prefetchRsc !== null ? cacheNode.prefetchRsc : cacheNode.rsc\n\n // We use `useDeferredValue` to handle switching between the prefetched and\n // final values. The second argument is returned on initial render, then it\n // re-renders with the first argument.\n const rsc: any = useDeferredValue(cacheNode.rsc, resolvedPrefetchRsc)\n\n // `rsc` is either a React node or a promise for a React node, except we\n // special case `null` to represent that this segment's data is missing. If\n // it's a promise, we need to unwrap it so we can determine whether or not the\n // data is missing.\n const resolvedRsc: React.ReactNode =\n typeof rsc === 'object' && rsc !== null && typeof rsc.then === 'function'\n ? use(rsc)\n : rsc\n\n if (!resolvedRsc) {\n // The data for this segment is not available, and there's no pending\n // navigation that will be able to fulfill it. We need to fetch more from\n // the server and patch the cache.\n\n // Check if there's already a pending request.\n let lazyData = cacheNode.lazyData\n if (lazyData === null) {\n /**\n * Router state with refetch marker added\n */\n // TODO-APP: remove ''\n const refetchTree = walkAddRefetch(['', ...segmentPath], fullTree)\n const includeNextUrl = hasInterceptionRouteInCurrentTree(fullTree)\n const navigatedAt = Date.now()\n cacheNode.lazyData = lazyData = fetchServerResponse(\n new URL(url, location.origin),\n {\n flightRouterState: refetchTree,\n nextUrl: includeNextUrl ? context.nextUrl : null,\n }\n ).then((serverResponse) => {\n startTransition(() => {\n dispatchAppRouterAction({\n type: ACTION_SERVER_PATCH,\n previousTree: fullTree,\n serverResponse,\n navigatedAt,\n })\n })\n\n return serverResponse\n })\n\n // Suspend while waiting for lazyData to resolve\n use(lazyData)\n }\n // Suspend infinitely as `changeByServerResponse` will cause a different part of the tree to be rendered.\n // A falsey `resolvedRsc` indicates missing data -- we should not commit that branch, and we need to wait for the data to arrive.\n use(unresolvedThenable) as never\n }\n\n // If we get to this point, then we know we have something we can render.\n const subtree = (\n // The layout router context narrows down tree and childNodes at each level.\n <LayoutRouterContext.Provider\n value={{\n parentTree: tree,\n parentCacheNode: cacheNode,\n parentSegmentPath: segmentPath,\n\n // TODO-APP: overriding of url for parallel routes\n url: url,\n }}\n >\n {resolvedRsc}\n </LayoutRouterContext.Provider>\n )\n // Ensure root layout is not wrapped in a div as the root layout renders `<html>`\n return subtree\n}\n\n/**\n * Renders suspense boundary with the provided \"loading\" property as the fallback.\n * If no loading property is provided it renders the children without a suspense boundary.\n */\nfunction LoadingBoundary({\n loading,\n children,\n}: {\n loading: LoadingModuleData | Promise<LoadingModuleData>\n children: React.ReactNode\n}): JSX.Element {\n // If loading is a promise, unwrap it. This happens in cases where we haven't\n // yet received the loading data from the server — which includes whether or\n // not this layout has a loading component at all.\n //\n // It's OK to suspend here instead of inside the fallback because this\n // promise will resolve simultaneously with the data for the segment itself.\n // So it will never suspend for longer than it would have if we didn't use\n // a Suspense fallback at all.\n let loadingModuleData\n if (\n typeof loading === 'object' &&\n loading !== null &&\n typeof (loading as any).then === 'function'\n ) {\n const promiseForLoading = loading as Promise<LoadingModuleData>\n loadingModuleData = use(promiseForLoading)\n } else {\n loadingModuleData = loading as LoadingModuleData\n }\n\n if (loadingModuleData) {\n const loadingRsc = loadingModuleData[0]\n const loadingStyles = loadingModuleData[1]\n const loadingScripts = loadingModuleData[2]\n return (\n <Suspense\n fallback={\n <>\n {loadingStyles}\n {loadingScripts}\n {loadingRsc}\n </>\n }\n >\n {children}\n </Suspense>\n )\n }\n\n return <>{children}</>\n}\n\nfunction RenderChildren({ children }: { children: React.ReactNode }) {\n return <>{children}</>\n}\n\n/**\n * OuterLayoutRouter handles the current segment as well as <Offscreen> rendering of other segments.\n * It can be rendered next to each other with a different `parallelRouterKey`, allowing for Parallel routes.\n */\nexport default function OuterLayoutRouter({\n parallelRouterKey,\n error,\n errorStyles,\n errorScripts,\n templateStyles,\n templateScripts,\n template,\n notFound,\n forbidden,\n unauthorized,\n gracefullyDegrade,\n segmentViewBoundaries,\n}: {\n parallelRouterKey: string\n error: ErrorComponent | undefined\n errorStyles: React.ReactNode | undefined\n errorScripts: React.ReactNode | undefined\n templateStyles: React.ReactNode | undefined\n templateScripts: React.ReactNode | undefined\n template: React.ReactNode\n notFound: React.ReactNode | undefined\n forbidden: React.ReactNode | undefined\n unauthorized: React.ReactNode | undefined\n gracefullyDegrade?: boolean\n segmentViewBoundaries?: React.ReactNode\n}) {\n const context = useContext(LayoutRouterContext)\n if (!context) {\n throw new Error('invariant expected layout router to be mounted')\n }\n\n const { parentTree, parentCacheNode, parentSegmentPath, url } = context\n\n // Get the CacheNode for this segment by reading it from the parent segment's\n // child map.\n const parentParallelRoutes = parentCacheNode.parallelRoutes\n let segmentMap = parentParallelRoutes.get(parallelRouterKey)\n // If the parallel router cache node does not exist yet, create it.\n // This writes to the cache when there is no item in the cache yet. It never *overwrites* existing cache items which is why it's safe in concurrent mode.\n if (!segmentMap) {\n segmentMap = new Map()\n parentParallelRoutes.set(parallelRouterKey, segmentMap)\n }\n const parentTreeSegment = parentTree[0]\n const segmentPath =\n parentSegmentPath === null\n ? // TODO: The root segment value is currently omitted from the segment\n // path. This has led to a bunch of special cases scattered throughout\n // the code. We should clean this up.\n [parallelRouterKey]\n : parentSegmentPath.concat([parentTreeSegment, parallelRouterKey])\n\n // The \"state\" key of a segment is the one passed to React — it represents the\n // identity of the UI tree. Whenever the state key changes, the tree is\n // recreated and the state is reset. In the App Router model, search params do\n // not cause state to be lost, so two segments with the same segment path but\n // different search params should have the same state key.\n //\n // The \"cache\" key of a segment, however, *does* include the search params, if\n // it's possible that the segment accessed the search params on the server.\n // (This only applies to page segments; layout segments cannot access search\n // params on the server.)\n const activeTree = parentTree[1][parallelRouterKey]\n const activeSegment = activeTree[0]\n const activeStateKey = createRouterCacheKey(activeSegment, true) // no search params\n\n // At each level of the route tree, not only do we render the currently\n // active segment — we also render the last N segments that were active at\n // this level inside a hidden <Activity> boundary, to preserve their state\n // if or when the user navigates to them again.\n //\n // bfcacheEntry is a linked list of FlightRouterStates.\n let bfcacheEntry: RouterBFCacheEntry | null = useRouterBFCache(\n activeTree,\n activeStateKey\n )\n let children: Array<React.ReactNode> = []\n do {\n const tree = bfcacheEntry.tree\n const stateKey = bfcacheEntry.stateKey\n const segment = tree[0]\n const cacheKey = createRouterCacheKey(segment)\n\n // Read segment path from the parallel router cache node.\n let cacheNode = segmentMap.get(cacheKey)\n if (cacheNode === undefined) {\n // When data is not available during rendering client-side we need to fetch\n // it from the server.\n const newLazyCacheNode: LazyCacheNode = {\n lazyData: null,\n rsc: null,\n prefetchRsc: null,\n head: null,\n prefetchHead: null,\n parallelRoutes: new Map(),\n loading: null,\n navigatedAt: -1,\n }\n\n // Flight data fetch kicked off during render and put into the cache.\n cacheNode = newLazyCacheNode\n segmentMap.set(cacheKey, newLazyCacheNode)\n }\n\n /*\n - Error boundary\n - Only renders error boundary if error component is provided.\n - Rendered for each segment to ensure they have their own error state.\n - When gracefully degrade for bots, skip rendering error boundary.\n - Loading boundary\n - Only renders suspense boundary if loading components is provided.\n - Rendered for each segment to ensure they have their own loading state.\n - Passed to the router during rendering to ensure it can be immediately rendered when suspending on a Flight fetch.\n */\n\n const ErrorBoundaryComponent = gracefullyDegrade\n ? RenderChildren\n : ErrorBoundary\n\n let segmentBoundaryTriggerNode: React.ReactNode = null\n if (\n process.env.NODE_ENV !== 'production' &&\n process.env.__NEXT_DEVTOOL_SEGMENT_EXPLORER\n ) {\n const { SegmentBoundaryTriggerNode } =\n require('../../next-devtools/userspace/app/segment-explorer-node') as typeof import('../../next-devtools/userspace/app/segment-explorer-node')\n\n segmentBoundaryTriggerNode = (\n <>\n <SegmentBoundaryTriggerNode />\n </>\n )\n }\n\n // TODO: The loading module data for a segment is stored on the parent, then\n // applied to each of that parent segment's parallel route slots. In the\n // simple case where there's only one parallel route (the `children` slot),\n // this is no different from if the loading module data where stored on the\n // child directly. But I'm not sure this actually makes sense when there are\n // multiple parallel routes. It's not a huge issue because you always have\n // the option to define a narrower loading boundary for a particular slot. But\n // this sort of smells like an implementation accident to me.\n const loadingModuleData = parentCacheNode.loading\n let child = (\n <TemplateContext.Provider\n key={stateKey}\n value={\n <ScrollAndFocusHandler segmentPath={segmentPath}>\n <ErrorBoundaryComponent\n errorComponent={error}\n errorStyles={errorStyles}\n errorScripts={errorScripts}\n >\n <LoadingBoundary loading={loadingModuleData}>\n <HTTPAccessFallbackBoundary\n notFound={notFound}\n forbidden={forbidden}\n unauthorized={unauthorized}\n >\n <RedirectBoundary>\n <InnerLayoutRouter\n url={url}\n tree={tree}\n cacheNode={cacheNode}\n segmentPath={segmentPath}\n />\n {segmentBoundaryTriggerNode}\n </RedirectBoundary>\n </HTTPAccessFallbackBoundary>\n </LoadingBoundary>\n </ErrorBoundaryComponent>\n </ScrollAndFocusHandler>\n }\n >\n {templateStyles}\n {templateScripts}\n {template}\n </TemplateContext.Provider>\n )\n\n if (process.env.NODE_ENV !== 'production') {\n const { SegmentStateProvider } =\n require('../../next-devtools/userspace/app/segment-explorer-node') as typeof import('../../next-devtools/userspace/app/segment-explorer-node')\n\n child = (\n <SegmentStateProvider key={stateKey}>\n {child}\n {segmentViewBoundaries}\n </SegmentStateProvider>\n )\n }\n\n if (process.env.__NEXT_ROUTER_BF_CACHE) {\n child = (\n <Activity\n key={stateKey}\n mode={stateKey === activeStateKey ? 'visible' : 'hidden'}\n >\n {child}\n </Activity>\n )\n }\n\n children.push(child)\n\n bfcacheEntry = bfcacheEntry.next\n } while (bfcacheEntry !== null)\n\n return children\n}\n"],"names":["ACTION_SERVER_PATCH","React","useContext","use","startTransition","Suspense","useDeferredValue","ReactDOM","LayoutRouterContext","GlobalLayoutRouterContext","TemplateContext","fetchServerResponse","unresolvedThenable","ErrorBoundary","matchSegment","disableSmoothScrollDuringRouteTransition","RedirectBoundary","HTTPAccessFallbackBoundary","createRouterCacheKey","hasInterceptionRouteInCurrentTree","dispatchAppRouterAction","useRouterBFCache","Activity","process","env","__NEXT_ROUTER_BF_CACHE","require","unstable_Activity","walkAddRefetch","segmentPathToWalk","treeToRecreate","segment","parallelRouteKey","isLast","length","hasOwnProperty","subTree","undefined","slice","__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE","findDOMNode","instance","window","internal_reactDOMfindDOMNode","rectProperties","shouldSkipElement","element","includes","getComputedStyle","position","NODE_ENV","console","warn","rect","getBoundingClientRect","every","item","topOfElementInViewport","viewportHeight","top","getHashFragmentDomNode","hashFragment","document","body","getElementById","getElementsByName","InnerScrollAndFocusHandler","Component","componentDidMount","handlePotentialScroll","componentDidUpdate","props","focusAndScrollRef","apply","render","children","segmentPath","segmentPaths","some","scrollRefSegmentPath","index","domNode","Element","HTMLElement","parentElement","localName","nextElementSibling","scrollIntoView","htmlElement","documentElement","clientHeight","scrollTop","dontForceLayout","onlyHashChange","focus","ScrollAndFocusHandler","context","Error","InnerLayoutRouter","tree","cacheNode","url","fullTree","resolvedPrefetchRsc","prefetchRsc","rsc","resolvedRsc","then","lazyData","refetchTree","includeNextUrl","navigatedAt","Date","now","URL","location","origin","flightRouterState","nextUrl","serverResponse","type","previousTree","subtree","Provider","value","parentTree","parentCacheNode","parentSegmentPath","LoadingBoundary","loading","loadingModuleData","promiseForLoading","loadingRsc","loadingStyles","loadingScripts","fallback","RenderChildren","OuterLayoutRouter","parallelRouterKey","error","errorStyles","errorScripts","templateStyles","templateScripts","template","notFound","forbidden","unauthorized","gracefullyDegrade","segmentViewBoundaries","parentParallelRoutes","parallelRoutes","segmentMap","get","Map","set","parentTreeSegment","concat","activeTree","activeSegment","activeStateKey","bfcacheEntry","stateKey","cacheKey","newLazyCacheNode","head","prefetchHead","ErrorBoundaryComponent","segmentBoundaryTriggerNode","__NEXT_DEVTOOL_SEGMENT_EXPLORER","SegmentBoundaryTriggerNode","child","errorComponent","SegmentStateProvider","mode","push","next"],"mappings":"AAAA;;AAYA,SACEA,mBAAmB,QAEd,wCAAuC;AAE9C,OAAOC,SACLC,UAAU,EACVC,GAAG,EACHC,eAAe,EACfC,QAAQ,EACRC,gBAAgB,QAEX,QAAO;AACd,OAAOC,cAAc,YAAW;AAChC,SACEC,mBAAmB,EACnBC,yBAAyB,EACzBC,eAAe,QACV,qDAAoD;AAC3D,SAASC,mBAAmB,QAAQ,yCAAwC;AAC5E,SAASC,kBAAkB,QAAQ,wBAAuB;AAC1D,SAASC,aAAa,QAAQ,mBAAkB;AAChD,SAASC,YAAY,QAAQ,mBAAkB;AAC/C,SAASC,wCAAwC,QAAQ,sDAAqD;AAC9G,SAASC,gBAAgB,QAAQ,sBAAqB;AACtD,SAASC,0BAA0B,QAAQ,wCAAuC;AAClF,SAASC,oBAAoB,QAAQ,2CAA0C;AAC/E,SAASC,iCAAiC,QAAQ,mEAAkE;AACpH,SAASC,uBAAuB,QAAQ,qBAAoB;AAC5D,SAASC,gBAAgB,QAAiC,YAAW;AAErE,MAAMC,WAAWC,QAAQC,GAAG,CAACC,sBAAsB,GAC/C,AAACC,QAAQ,SAAoCC,iBAAiB,GAC9D;AAEJ;;;CAGC,GACD,SAASC,eACPC,iBAAgD,EAChDC,cAAiC;IAEjC,IAAID,mBAAmB;QACrB,MAAM,CAACE,SAASC,iBAAiB,GAAGH;QACpC,MAAMI,SAASJ,kBAAkBK,MAAM,KAAK;QAE5C,IAAIpB,aAAagB,cAAc,CAAC,EAAE,EAAEC,UAAU;YAC5C,IAAID,cAAc,CAAC,EAAE,CAACK,cAAc,CAACH,mBAAmB;gBACtD,IAAIC,QAAQ;oBACV,MAAMG,UAAUR,eACdS,WACAP,cA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EV8I,2CACE;0BACE,cAAA,KAACE;;QAGP;QAEA,4EAA4E;QAC5E,wEAAwE;QACxE,2EAA2E;QAC3E,2EAA2E;QAC3E,4EAA4E;QAC5E,0EAA0E;QAC1E,8EAA8E;QAC9E,6DAA6D;QAC7D,MAAMxC,oBAAoBJ,gBAAgBG,OAAO;QACjD,IAAI0C,sBACF,MAACjK,gBAAgBiH,QAAQ;YAEvBC,qBACE,KAAC7B;gBAAsBnB,aAAaA;0BAClC,cAAA,KAAC2F;oBACCK,gBAAgBjC;oBAChBC,aAAaA;oBACbC,cAAcA;8BAEd,cAAA,KAACb;wBAAgBC,SAASC;kCACxB,cAAA,KAACjH;4BACCgI,UAAUA;4BACVC,WAAWA;4BACXC,cAAcA;sCAEd,cAAA,MAACnI;;kDACC,KAACkF;wCACCG,KAAKA;wCACLF,MAAMA;wCACNC,WAAWA;wCACXxB,aAAaA;;oCAEd4F;;;;;;;;gBAQZ1B;gBACAC;gBACAC;;WA/BIkB;QAmCT,IAAI3I,QAAQC,GAAG,CAAC0B,QAAQ,KAAK,cAAc;YACzC,MAAM,EAAE2H,oBAAoB,EAAE,GAC5BnJ,QAAQ;YAEViJ,sBACE,MAACE;;oBACEF;oBACAtB;;eAFwBa;QAK/B;QAEA,IAAI3I,QAAQC,GAAG,CAACC,sBAAsB,EAAE;YACtCkJ,sBACE,KAACrJ;gBAECwJ,MAAMZ,aAAaF,iBAAiB,YAAY;0BAE/CW;eAHIT;QAMX;QAEAvF,SAASoG,IAAI,CAACJ;QAEdV,eAAeA,aAAae,IAAI;IAClC,QAASf,iBAAiB,MAAK;IAE/B,OAAOtF;AACT","ignoreList":[0]}
|
package/dist/esm/client/index.js
CHANGED
@@ -6,7 +6,7 @@ import ReactDOM from 'react-dom/client';
|
|
6
6
|
import { HeadManagerContext } from '../shared/lib/head-manager-context.shared-runtime';
|
7
7
|
import mitt from '../shared/lib/mitt';
|
8
8
|
import { RouterContext } from '../shared/lib/router-context.shared-runtime';
|
9
|
-
import {
|
9
|
+
import { disableSmoothScrollDuringRouteTransition } from '../shared/lib/router/utils/disable-smooth-scroll';
|
10
10
|
import { isDynamicRoute } from '../shared/lib/router/utils/is-dynamic';
|
11
11
|
import { urlQueryToSearchParams, assign } from '../shared/lib/router/utils/querystring';
|
12
12
|
import { setConfig } from '../shared/lib/runtime-config.external';
|
@@ -26,7 +26,7 @@ import { SearchParamsContext, PathParamsContext } from '../shared/lib/hooks-clie
|
|
26
26
|
import { onRecoverableError } from './react-client-callbacks/on-recoverable-error';
|
27
27
|
import tracer from './tracing/tracer';
|
28
28
|
import { isNextRouterError } from './components/is-next-router-error';
|
29
|
-
export const version = "15.4.0-canary.
|
29
|
+
export const version = "15.4.0-canary.129";
|
30
30
|
export let router;
|
31
31
|
export const emitter = mitt();
|
32
32
|
const looseToArray = (input)=>[].slice.call(input);
|
@@ -517,7 +517,7 @@ function doRender(input) {
|
|
517
517
|
}
|
518
518
|
if (input.scroll) {
|
519
519
|
const { x, y } = input.scroll;
|
520
|
-
|
520
|
+
disableSmoothScrollDuringRouteTransition(()=>{
|
521
521
|
window.scrollTo(x, y);
|
522
522
|
});
|
523
523
|
}
|