Unverified Commit 87763d73 authored by Wyatt Johnson's avatar Wyatt Johnson Committed by GitHub

Rename Webpack Layers (#52605)

Renames the webpack layers to be more semantical:

```
server compiler:
server layer → RSC layer
client layer → SSR layer
shared layer → shared layer

client compiler:
appClient layer → app browser layer
```
parent fc86c412
...@@ -314,7 +314,7 @@ export function getEdgeServerEntry(opts: { ...@@ -314,7 +314,7 @@ export function getEdgeServerEntry(opts: {
return { return {
import: `next-edge-app-route-loader?${stringify(loaderParams)}!`, import: `next-edge-app-route-loader?${stringify(loaderParams)}!`,
layer: WEBPACK_LAYERS.server, layer: WEBPACK_LAYERS.reactServerComponents,
} }
} }
if (isMiddlewareFile(opts.page)) { if (isMiddlewareFile(opts.page)) {
...@@ -386,14 +386,14 @@ export function getEdgeServerEntry(opts: { ...@@ -386,14 +386,14 @@ export function getEdgeServerEntry(opts: {
// The Edge bundle includes the server in its entrypoint, so it has to // The Edge bundle includes the server in its entrypoint, so it has to
// be in the SSR layer — we later convert the page request to the RSC layer // be in the SSR layer — we later convert the page request to the RSC layer
// via a webpack rule. // via a webpack rule.
layer: opts.appDirLoader ? WEBPACK_LAYERS.client : undefined, layer: opts.appDirLoader ? WEBPACK_LAYERS.serverSideRendering : undefined,
} }
} }
export function getAppEntry(opts: Readonly<AppLoaderOptions>) { export function getAppEntry(opts: Readonly<AppLoaderOptions>) {
return { return {
import: `next-app-loader?${stringify(opts)}!`, import: `next-app-loader?${stringify(opts)}!`,
layer: WEBPACK_LAYERS.server, layer: WEBPACK_LAYERS.reactServerComponents,
} }
} }
...@@ -716,7 +716,7 @@ export function finalizeEntrypoint({ ...@@ -716,7 +716,7 @@ export function finalizeEntrypoint({
layer: isApi layer: isApi
? WEBPACK_LAYERS.api ? WEBPACK_LAYERS.api
: isServerComponent : isServerComponent
? WEBPACK_LAYERS.server ? WEBPACK_LAYERS.reactServerComponents
: undefined, : undefined,
...entry, ...entry,
} }
...@@ -751,7 +751,7 @@ export function finalizeEntrypoint({ ...@@ -751,7 +751,7 @@ export function finalizeEntrypoint({
if (isAppLayer) { if (isAppLayer) {
return { return {
dependOn: CLIENT_STATIC_FILES_RUNTIME_MAIN_APP, dependOn: CLIENT_STATIC_FILES_RUNTIME_MAIN_APP,
layer: WEBPACK_LAYERS.appClient, layer: WEBPACK_LAYERS.appPagesBrowser,
...entry, ...entry,
} }
} }
...@@ -767,7 +767,7 @@ export function finalizeEntrypoint({ ...@@ -767,7 +767,7 @@ export function finalizeEntrypoint({
if (isAppLayer) { if (isAppLayer) {
return { return {
layer: WEBPACK_LAYERS.appClient, layer: WEBPACK_LAYERS.appPagesBrowser,
...entry, ...entry,
} }
} }
......
...@@ -211,13 +211,13 @@ export async function webpackBuildImpl( ...@@ -211,13 +211,13 @@ export async function webpackBuildImpl(
...clientEntry[CLIENT_STATIC_FILES_RUNTIME_MAIN_APP].import, ...clientEntry[CLIENT_STATIC_FILES_RUNTIME_MAIN_APP].import,
value, value,
], ],
layer: WEBPACK_LAYERS.appClient, layer: WEBPACK_LAYERS.appPagesBrowser,
} }
} else { } else {
clientEntry[key] = { clientEntry[key] = {
dependOn: [CLIENT_STATIC_FILES_RUNTIME_MAIN_APP], dependOn: [CLIENT_STATIC_FILES_RUNTIME_MAIN_APP],
import: value, import: value,
layer: WEBPACK_LAYERS.appClient, layer: WEBPACK_LAYERS.appPagesBrowser,
} }
} }
} }
......
...@@ -1320,10 +1320,10 @@ export default async function getBaseWebpackConfig( ...@@ -1320,10 +1320,10 @@ export default async function getBaseWebpackConfig(
} }
const isAppLayer = [ const isAppLayer = [
WEBPACK_LAYERS.server, WEBPACK_LAYERS.reactServerComponents,
WEBPACK_LAYERS.client, WEBPACK_LAYERS.serverSideRendering,
WEBPACK_LAYERS.appClient, WEBPACK_LAYERS.appPagesBrowser,
WEBPACK_LAYERS.action, WEBPACK_LAYERS.actionBrowser,
].includes(layer!) ].includes(layer!)
if ( if (
...@@ -1340,7 +1340,7 @@ export default async function getBaseWebpackConfig( ...@@ -1340,7 +1340,7 @@ export default async function getBaseWebpackConfig(
} }
// Special internal modules that must be bundled for Server Components. // Special internal modules that must be bundled for Server Components.
if (layer === WEBPACK_LAYERS.server) { if (layer === WEBPACK_LAYERS.reactServerComponents) {
// React needs to be bundled for Server Components so the special // React needs to be bundled for Server Components so the special
// `react-server` export condition can be used. // `react-server` export condition can be used.
if (reactPackagesRegex.test(request)) { if (reactPackagesRegex.test(request)) {
...@@ -1361,9 +1361,9 @@ export default async function getBaseWebpackConfig( ...@@ -1361,9 +1361,9 @@ export default async function getBaseWebpackConfig(
// override react-dom to server-rendering-stub for server // override react-dom to server-rendering-stub for server
if ( if (
request === 'react-dom' && request === 'react-dom' &&
(layer === WEBPACK_LAYERS.client || (layer === WEBPACK_LAYERS.serverSideRendering ||
layer === WEBPACK_LAYERS.server || layer === WEBPACK_LAYERS.reactServerComponents ||
layer === WEBPACK_LAYERS.action) layer === WEBPACK_LAYERS.actionBrowser)
) { ) {
request = `next/dist/compiled/react-dom${bundledReactChannel}/server-rendering-stub` request = `next/dist/compiled/react-dom${bundledReactChannel}/server-rendering-stub`
} else if (isAppLayer) { } else if (isAppLayer) {
...@@ -1468,7 +1468,7 @@ export default async function getBaseWebpackConfig( ...@@ -1468,7 +1468,7 @@ export default async function getBaseWebpackConfig(
// Early return if the request needs to be bundled, such as in the client layer. // Early return if the request needs to be bundled, such as in the client layer.
// Treat react packages and next internals as external for SSR layer, // Treat react packages and next internals as external for SSR layer,
// also map react to builtin ones with require-hook. // also map react to builtin ones with require-hook.
if (layer === WEBPACK_LAYERS.client) { if (layer === WEBPACK_LAYERS.serverSideRendering) {
if (reactPackagesRegex.test(request)) { if (reactPackagesRegex.test(request)) {
return `commonjs next/dist/compiled/${request.replace( return `commonjs next/dist/compiled/${request.replace(
/^(react-server-dom-webpack|react-dom|react)/, /^(react-server-dom-webpack|react-dom|react)/,
...@@ -1952,22 +1952,22 @@ export default async function getBaseWebpackConfig( ...@@ -1952,22 +1952,22 @@ export default async function getBaseWebpackConfig(
resourceQuery: new RegExp( resourceQuery: new RegExp(
WEBPACK_RESOURCE_QUERIES.metadataRoute WEBPACK_RESOURCE_QUERIES.metadataRoute
), ),
layer: WEBPACK_LAYERS.metadataRoute, layer: WEBPACK_LAYERS.appMetadataRoute,
}, },
{ {
// Ensure that the app page module is in the client layers, this // Ensure that the app page module is in the client layers, this
// enables React to work correctly for RSC. // enables React to work correctly for RSC.
layer: WEBPACK_LAYERS.client, layer: WEBPACK_LAYERS.serverSideRendering,
test: /next[\\/]dist[\\/](esm[\\/])?server[\\/]future[\\/]route-modules[\\/]app-page[\\/]module/, test: /next[\\/]dist[\\/](esm[\\/])?server[\\/]future[\\/]route-modules[\\/]app-page[\\/]module/,
}, },
{ {
// All app dir layers need to use this configured resolution logic // All app dir layers need to use this configured resolution logic
issuerLayer: { issuerLayer: {
or: [ or: [
WEBPACK_LAYERS.server, WEBPACK_LAYERS.reactServerComponents,
WEBPACK_LAYERS.client, WEBPACK_LAYERS.serverSideRendering,
WEBPACK_LAYERS.appClient, WEBPACK_LAYERS.appPagesBrowser,
WEBPACK_LAYERS.action, WEBPACK_LAYERS.actionBrowser,
WEBPACK_LAYERS.shared, WEBPACK_LAYERS.shared,
], ],
}, },
...@@ -2047,7 +2047,7 @@ export default async function getBaseWebpackConfig( ...@@ -2047,7 +2047,7 @@ export default async function getBaseWebpackConfig(
resourceQuery: new RegExp( resourceQuery: new RegExp(
WEBPACK_RESOURCE_QUERIES.edgeSSREntry WEBPACK_RESOURCE_QUERIES.edgeSSREntry
), ),
layer: WEBPACK_LAYERS.server, layer: WEBPACK_LAYERS.reactServerComponents,
}, },
] ]
: []), : []),
...@@ -2085,7 +2085,7 @@ export default async function getBaseWebpackConfig( ...@@ -2085,7 +2085,7 @@ export default async function getBaseWebpackConfig(
}, },
{ {
test: codeCondition.test, test: codeCondition.test,
issuerLayer: WEBPACK_LAYERS.client, issuerLayer: WEBPACK_LAYERS.serverSideRendering,
resolve: { resolve: {
alias: createRSCAliases(bundledReactChannel, { alias: createRSCAliases(bundledReactChannel, {
reactSharedSubset: false, reactSharedSubset: false,
...@@ -2099,7 +2099,7 @@ export default async function getBaseWebpackConfig( ...@@ -2099,7 +2099,7 @@ export default async function getBaseWebpackConfig(
}, },
{ {
test: codeCondition.test, test: codeCondition.test,
issuerLayer: WEBPACK_LAYERS.appClient, issuerLayer: WEBPACK_LAYERS.appPagesBrowser,
resolve: { resolve: {
alias: createRSCAliases(bundledReactChannel, { alias: createRSCAliases(bundledReactChannel, {
// Only alias server rendering stub in client SSR layer. // Only alias server rendering stub in client SSR layer.
...@@ -2148,7 +2148,10 @@ export default async function getBaseWebpackConfig( ...@@ -2148,7 +2148,10 @@ export default async function getBaseWebpackConfig(
{ {
...codeCondition, ...codeCondition,
issuerLayer: { issuerLayer: {
or: [WEBPACK_LAYERS.client, WEBPACK_LAYERS.appClient], or: [
WEBPACK_LAYERS.serverSideRendering,
WEBPACK_LAYERS.appPagesBrowser,
],
}, },
exclude: [asyncStoragesRegex, codeCondition.exclude], exclude: [asyncStoragesRegex, codeCondition.exclude],
use: [ use: [
...@@ -2323,7 +2326,7 @@ export default async function getBaseWebpackConfig( ...@@ -2323,7 +2326,7 @@ export default async function getBaseWebpackConfig(
{ {
test: /(node_modules|next[/\\]dist[/\\]compiled)[/\\]server-only[/\\]index.js/, test: /(node_modules|next[/\\]dist[/\\]compiled)[/\\]server-only[/\\]index.js/,
loader: 'next-invalid-import-error-loader', loader: 'next-invalid-import-error-loader',
issuerLayer: WEBPACK_LAYERS.client, issuerLayer: WEBPACK_LAYERS.serverSideRendering,
options: { options: {
message: message:
"'server-only' cannot be imported from a Client Component module. It should only be used from a Server Component.", "'server-only' cannot be imported from a Client Component module. It should only be used from a Server Component.",
......
...@@ -26,11 +26,19 @@ const regexSassGlobal = /(?<!\.module)\.(scss|sass)$/ ...@@ -26,11 +26,19 @@ const regexSassGlobal = /(?<!\.module)\.(scss|sass)$/
const regexSassModules = /\.module\.(scss|sass)$/ const regexSassModules = /\.module\.(scss|sass)$/
const APP_LAYER_RULE = { const APP_LAYER_RULE = {
or: [WEBPACK_LAYERS.server, WEBPACK_LAYERS.client, WEBPACK_LAYERS.appClient], or: [
WEBPACK_LAYERS.reactServerComponents,
WEBPACK_LAYERS.serverSideRendering,
WEBPACK_LAYERS.appPagesBrowser,
],
} }
const PAGES_LAYER_RULE = { const PAGES_LAYER_RULE = {
not: [WEBPACK_LAYERS.server, WEBPACK_LAYERS.client, WEBPACK_LAYERS.appClient], not: [
WEBPACK_LAYERS.reactServerComponents,
WEBPACK_LAYERS.serverSideRendering,
WEBPACK_LAYERS.appPagesBrowser,
],
} }
/** /**
......
...@@ -48,7 +48,7 @@ export type ActionManifest = { ...@@ -48,7 +48,7 @@ export type ActionManifest = {
workers: { workers: {
[name: string]: string | number [name: string]: string | number
} }
// Record which layer the action is in (sc_server or sc_action), in the specific entry. // Record which layer the action is in (rsc or sc_action), in the specific entry.
layer: { layer: {
[name: string]: string [name: string]: string
} }
...@@ -188,7 +188,7 @@ export class FlightClientEntryPlugin { ...@@ -188,7 +188,7 @@ export class FlightClientEntryPlugin {
const recordModule = (modId: string, mod: any) => { const recordModule = (modId: string, mod: any) => {
const modResource = mod.resourceResolveData?.path || mod.resource const modResource = mod.resourceResolveData?.path || mod.resource
if (mod.layer !== WEBPACK_LAYERS.client) { if (mod.layer !== WEBPACK_LAYERS.serverSideRendering) {
return return
} }
...@@ -720,7 +720,7 @@ export class FlightClientEntryPlugin { ...@@ -720,7 +720,7 @@ export class FlightClientEntryPlugin {
pluginState.injectedClientEntries[bundlePath] = clientLoader pluginState.injectedClientEntries[bundlePath] = clientLoader
} }
// Inject the entry to the server compiler (__sc_client__). // Inject the entry to the server compiler (__ssr__).
const clientComponentEntryDep = webpack.EntryPlugin.createDependency( const clientComponentEntryDep = webpack.EntryPlugin.createDependency(
clientSSRLoader, clientSSRLoader,
{ {
...@@ -743,7 +743,7 @@ export class FlightClientEntryPlugin { ...@@ -743,7 +743,7 @@ export class FlightClientEntryPlugin {
name: entryName, name: entryName,
// Layer should be client for the SSR modules // Layer should be client for the SSR modules
// This ensures the client components are bundled on client layer // This ensures the client components are bundled on client layer
layer: WEBPACK_LAYERS.client, layer: WEBPACK_LAYERS.serverSideRendering,
} }
), ),
clientComponentEntryDep, clientComponentEntryDep,
...@@ -785,8 +785,8 @@ export class FlightClientEntryPlugin { ...@@ -785,8 +785,8 @@ export class FlightClientEntryPlugin {
} }
currentCompilerServerActions[id].workers[bundlePath] = '' currentCompilerServerActions[id].workers[bundlePath] = ''
currentCompilerServerActions[id].layer[bundlePath] = fromClient currentCompilerServerActions[id].layer[bundlePath] = fromClient
? WEBPACK_LAYERS.action ? WEBPACK_LAYERS.actionBrowser
: WEBPACK_LAYERS.server : WEBPACK_LAYERS.reactServerComponents
} }
} }
...@@ -802,7 +802,9 @@ export class FlightClientEntryPlugin { ...@@ -802,7 +802,9 @@ export class FlightClientEntryPlugin {
actionEntryDep, actionEntryDep,
{ {
name: entryName, name: entryName,
layer: fromClient ? WEBPACK_LAYERS.action : WEBPACK_LAYERS.server, layer: fromClient
? WEBPACK_LAYERS.actionBrowser
: WEBPACK_LAYERS.reactServerComponents,
} }
) )
} }
...@@ -869,7 +871,9 @@ export class FlightClientEntryPlugin { ...@@ -869,7 +871,9 @@ export class FlightClientEntryPlugin {
for (let name in action.workers) { for (let name in action.workers) {
const modId = const modId =
pluginState.actionModServerId[name][ pluginState.actionModServerId[name][
action.layer[name] === WEBPACK_LAYERS.action ? 'client' : 'server' action.layer[name] === WEBPACK_LAYERS.actionBrowser
? 'client'
: 'server'
] ]
action.workers[name] = modId! action.workers[name] = modId!
} }
...@@ -881,7 +885,9 @@ export class FlightClientEntryPlugin { ...@@ -881,7 +885,9 @@ export class FlightClientEntryPlugin {
for (let name in action.workers) { for (let name in action.workers) {
const modId = const modId =
pluginState.actionModEdgeServerId[name][ pluginState.actionModEdgeServerId[name][
action.layer[name] === WEBPACK_LAYERS.action ? 'client' : 'server' action.layer[name] === WEBPACK_LAYERS.actionBrowser
? 'client'
: 'server'
] ]
action.workers[name] = modId! action.workers[name] = modId!
} }
......
...@@ -185,7 +185,7 @@ export class ClientReferenceManifestPlugin { ...@@ -185,7 +185,7 @@ export class ClientReferenceManifestPlugin {
const requiredChunks = getAppPathRequiredChunks(chunkGroup) const requiredChunks = getAppPathRequiredChunks(chunkGroup)
const recordModule = (id: ModuleId, mod: webpack.NormalModule) => { const recordModule = (id: ModuleId, mod: webpack.NormalModule) => {
// Skip all modules from the pages folder. // Skip all modules from the pages folder.
if (mod.layer !== WEBPACK_LAYERS.appClient) { if (mod.layer !== WEBPACK_LAYERS.appPagesBrowser) {
return return
} }
...@@ -289,7 +289,7 @@ export class ClientReferenceManifestPlugin { ...@@ -289,7 +289,7 @@ export class ClientReferenceManifestPlugin {
const entryMods = const entryMods =
compilation.chunkGraph.getChunkEntryModulesIterable(chunk) compilation.chunkGraph.getChunkEntryModulesIterable(chunk)
for (const mod of entryMods) { for (const mod of entryMods) {
if (mod.layer !== WEBPACK_LAYERS.appClient) continue if (mod.layer !== WEBPACK_LAYERS.appPagesBrowser) continue
const request = (mod as webpack.NormalModule).request const request = (mod as webpack.NormalModule).request
......
...@@ -576,7 +576,7 @@ export class NextTypesPlugin { ...@@ -576,7 +576,7 @@ export class NextTypesPlugin {
return return
} }
if (mod.layer !== WEBPACK_LAYERS.server) return if (mod.layer !== WEBPACK_LAYERS.reactServerComponents) return
const IS_LAYOUT = /[/\\]layout\.[^./\\]+$/.test(mod.resource) const IS_LAYOUT = /[/\\]layout\.[^./\\]+$/.test(mod.resource)
const IS_PAGE = !IS_LAYOUT && /[/\\]page\.[^.]+$/.test(mod.resource) const IS_PAGE = !IS_LAYOUT && /[/\\]page\.[^.]+$/.test(mod.resource)
......
...@@ -24,7 +24,7 @@ export function deleteAppClientCache() { ...@@ -24,7 +24,7 @@ export function deleteAppClientCache() {
if ((global as any)._nextDeleteAppClientCache) { if ((global as any)._nextDeleteAppClientCache) {
;(global as any)._nextDeleteAppClientCache() ;(global as any)._nextDeleteAppClientCache()
} }
// ensure we reset the cache for sc_server components // ensure we reset the cache for rsc components
// loaded via react-server-dom-webpack // loaded via react-server-dom-webpack
const reactServerDomModId = require.resolve( const reactServerDomModId = require.resolve(
'react-server-dom-webpack/client.edge' 'react-server-dom-webpack/client.edge'
......
...@@ -86,25 +86,56 @@ export const SERVER_RUNTIME: Record<string, ServerRuntime> = { ...@@ -86,25 +86,56 @@ export const SERVER_RUNTIME: Record<string, ServerRuntime> = {
nodejs: 'nodejs', nodejs: 'nodejs',
} }
/**
* The names of the webpack layers. These layers are the primitives for the
* webpack chunks.
*/
const WEBPACK_LAYERS_NAMES = { const WEBPACK_LAYERS_NAMES = {
shared: 'sc_shared', /**
server: 'sc_server', * The layer for the shared code between the client and server bundles.
client: 'sc_client', */
action: 'sc_action', shared: 'shared',
/**
* React Server Components layer (rsc).
*/
reactServerComponents: 'rsc',
/**
* Server Side Rendering layer (ssr).
*/
serverSideRendering: 'ssr',
/**
* The browser client bundle layer for actions.
*/
actionBrowser: 'actionBrowser',
/**
* The layer for the API routes.
*/
api: 'api', api: 'api',
/**
* The layer for the middleware code.
*/
middleware: 'middleware', middleware: 'middleware',
/**
* The layer for assets on the edge.
*/
edgeAsset: 'edge-asset', edgeAsset: 'edge-asset',
appClient: 'app-client', /**
metadataRoute: 'app-metadata-route', * The browser client bundle layer for App directory.
*/
appPagesBrowser: 'app-pages-browser',
/**
* The server bundle layer for metadata routes.
*/
appMetadataRoute: 'app-metadata-route',
} }
export const WEBPACK_LAYERS = { export const WEBPACK_LAYERS = {
...WEBPACK_LAYERS_NAMES, ...WEBPACK_LAYERS_NAMES,
GROUP: { GROUP: {
server: [ server: [
WEBPACK_LAYERS_NAMES.server, WEBPACK_LAYERS_NAMES.reactServerComponents,
WEBPACK_LAYERS_NAMES.action, WEBPACK_LAYERS_NAMES.actionBrowser,
WEBPACK_LAYERS_NAMES.metadataRoute, WEBPACK_LAYERS_NAMES.appMetadataRoute,
], ],
}, },
} }
......
...@@ -427,8 +427,10 @@ export default class HotReloader { ...@@ -427,8 +427,10 @@ export default class HotReloader {
)?.[1] )?.[1]
if (file) { if (file) {
// `file` is filepath in `pages/` but it can be weird long webpack url in `app/`. // `file` is filepath in `pages/` but it can be weird long webpack url in `app/`.
// If it's a webpack loader URL, it will start with '(app-client)/./' // If it's a webpack loader URL, it will start with '(app-pages)/./'
if (file.startsWith('(app-client)/./')) { if (
file.startsWith(`(${WEBPACK_LAYERS.appPagesBrowser})/./`)
) {
const fileUrl = new URL(file, 'file://') const fileUrl = new URL(file, 'file://')
const cwd = process.cwd() const cwd = process.cwd()
const modules = fileUrl.searchParams const modules = fileUrl.searchParams
...@@ -1044,7 +1046,7 @@ export default class HotReloader { ...@@ -1044,7 +1046,7 @@ export default class HotReloader {
.toString('hex') .toString('hex')
if ( if (
mod.layer === WEBPACK_LAYERS.server && mod.layer === WEBPACK_LAYERS.reactServerComponents &&
mod?.buildInfo?.rsc?.type !== 'client' mod?.buildInfo?.rsc?.type !== 'client'
) { ) {
chunksHashServerLayer.add(hash) chunksHashServerLayer.add(hash)
...@@ -1059,7 +1061,7 @@ export default class HotReloader { ...@@ -1059,7 +1061,7 @@ export default class HotReloader {
) )
if ( if (
mod.layer === WEBPACK_LAYERS.server && mod.layer === WEBPACK_LAYERS.reactServerComponents &&
mod?.buildInfo?.rsc?.type !== 'client' mod?.buildInfo?.rsc?.type !== 'client'
) { ) {
chunksHashServerLayer.add(hash) chunksHashServerLayer.add(hash)
...@@ -1092,7 +1094,8 @@ export default class HotReloader { ...@@ -1092,7 +1094,8 @@ export default class HotReloader {
pageHashMap.set(key, curHash) pageHashMap.set(key, curHash)
if (serverComponentChangedItems) { if (serverComponentChangedItems) {
const serverKey = WEBPACK_LAYERS.server + ':' + key const serverKey =
WEBPACK_LAYERS.reactServerComponents + ':' + key
const prevServerHash = pageHashMap.get(serverKey) const prevServerHash = pageHashMap.get(serverKey)
const curServerHash = chunksHashServerLayer.toString() const curServerHash = chunksHashServerLayer.toString()
if (prevServerHash && prevServerHash !== curServerHash) { if (prevServerHash && prevServerHash !== curServerHash) {
......
...@@ -54,7 +54,7 @@ export const CLIENT_STATIC_FILES_PATH = 'static' ...@@ -54,7 +54,7 @@ export const CLIENT_STATIC_FILES_PATH = 'static'
export const CLIENT_STATIC_FILES_RUNTIME = 'runtime' export const CLIENT_STATIC_FILES_RUNTIME = 'runtime'
export const STRING_LITERAL_DROP_BUNDLE = '__NEXT_DROP_CLIENT_FILE__' export const STRING_LITERAL_DROP_BUNDLE = '__NEXT_DROP_CLIENT_FILE__'
export const NEXT_BUILTIN_DOCUMENT = '__NEXT_BUILTIN_DOCUMENT__' export const NEXT_BUILTIN_DOCUMENT = '__NEXT_BUILTIN_DOCUMENT__'
export const NEXT_CLIENT_SSR_ENTRY_SUFFIX = '.__sc_client__' export const NEXT_CLIENT_SSR_ENTRY_SUFFIX = '.__ssr__'
// server/[entry]/page_client-reference-manifest.js // server/[entry]/page_client-reference-manifest.js
export const CLIENT_REFERENCE_MANIFEST = 'client-reference-manifest' export const CLIENT_REFERENCE_MANIFEST = 'client-reference-manifest'
...@@ -70,7 +70,7 @@ export const MIDDLEWARE_REACT_LOADABLE_MANIFEST = ...@@ -70,7 +70,7 @@ export const MIDDLEWARE_REACT_LOADABLE_MANIFEST =
export const CLIENT_STATIC_FILES_RUNTIME_MAIN = `main` export const CLIENT_STATIC_FILES_RUNTIME_MAIN = `main`
export const CLIENT_STATIC_FILES_RUNTIME_MAIN_APP = `${CLIENT_STATIC_FILES_RUNTIME_MAIN}-app` export const CLIENT_STATIC_FILES_RUNTIME_MAIN_APP = `${CLIENT_STATIC_FILES_RUNTIME_MAIN}-app`
// next internal client components chunk for layouts // next internal client components chunk for layouts
export const APP_CLIENT_INTERNALS = 'app-client-internals' export const APP_CLIENT_INTERNALS = 'app-pages-internals'
// static/runtime/react-refresh.js // static/runtime/react-refresh.js
export const CLIENT_STATIC_FILES_RUNTIME_REACT_REFRESH = `react-refresh` export const CLIENT_STATIC_FILES_RUNTIME_REACT_REFRESH = `react-refresh`
// static/runtime/amp.js // static/runtime/amp.js
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment