Pages router: Enable strict next/head children reconciler by default (#65418)

Closes NEXT-3330
This commit is contained in:
Sebastian Silbermann 2024-05-11 12:50:05 +02:00 committed by GitHub
parent b0ab0fe85f
commit 9084a09741
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 4 additions and 8 deletions

View file

@ -224,7 +224,7 @@ export function getDefineEnv({
...getImageConfig(config, dev),
'process.env.__NEXT_ROUTER_BASEPATH': config.basePath,
'process.env.__NEXT_STRICT_NEXT_HEAD':
config.experimental.strictNextHead ?? false,
config.experimental.strictNextHead ?? true,
'process.env.__NEXT_HAS_REWRITES': hasRewrites,
'process.env.__NEXT_CONFIG_OUTPUT': config.output,
'process.env.__NEXT_I18N_SUPPORT': !!config.i18n,

View file

@ -416,7 +416,7 @@ export async function exportAppImpl(
serverActionsManifest,
}
: {}),
strictNextHead: !!nextConfig.experimental.strictNextHead,
strictNextHead: nextConfig.experimental.strictNextHead ?? true,
deploymentId: nextConfig.deploymentId,
experimental: {
isAppPPREnabled: checkIsAppPPREnabled(nextConfig.experimental.ppr),

View file

@ -516,7 +516,7 @@ export default abstract class Server<
supportsDynamicHTML: true,
trailingSlash: this.nextConfig.trailingSlash,
deploymentId: this.nextConfig.deploymentId,
strictNextHead: !!this.nextConfig.experimental.strictNextHead,
strictNextHead: this.nextConfig.experimental.strictNextHead ?? true,
poweredByHeader: this.nextConfig.poweredByHeader,
canonicalBase: this.nextConfig.amp.canonicalBase || '',
buildId: this.buildId,

View file

@ -189,6 +189,7 @@ export interface ExperimentalConfig {
caseSensitiveRoutes?: boolean
appDocumentPreloading?: boolean
preloadEntriesOnStart?: boolean
/** @default true */
strictNextHead?: boolean
clientRouterFilter?: boolean
clientRouterFilterRedirects?: boolean

View file

@ -14,11 +14,6 @@ describe('next/head', () => {
pages: new FileRef(join(__dirname, 'app/pages')),
components: new FileRef(join(__dirname, 'app/components')),
},
nextConfig: {
experimental: {
strictNextHead: true,
},
},
})
})
afterAll(() => next.destroy())