Skip to content

Commit

Permalink
Pages router: Enable strict next/head children reconciler by default (
Browse files Browse the repository at this point in the history
  • Loading branch information
eps1lon committed May 11, 2024
1 parent b0ab0fe commit 9084a09
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 8 deletions.
Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion packages/next/src/export/index.ts
Expand Up @@ -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),
Expand Down
2 changes: 1 addition & 1 deletion packages/next/src/server/base-server.ts
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions packages/next/src/server/config-shared.ts
Expand Up @@ -189,6 +189,7 @@ export interface ExperimentalConfig {
caseSensitiveRoutes?: boolean
appDocumentPreloading?: boolean
preloadEntriesOnStart?: boolean
/** @default true */
strictNextHead?: boolean
clientRouterFilter?: boolean
clientRouterFilterRedirects?: boolean
Expand Down
5 changes: 0 additions & 5 deletions test/e2e/next-head/index.test.ts
Expand Up @@ -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())
Expand Down

0 comments on commit 9084a09

Please sign in to comment.