Skip to content

Commit f239d24

Browse files
committed
Pages router: Enable strict Head children reconciler by default
1 parent 89d2abd commit f239d24

File tree

5 files changed

+4
-8
lines changed

5 files changed

+4
-8
lines changed

packages/next/src/build/webpack/plugins/define-env-plugin.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ export function getDefineEnv({
220220
...getImageConfig(config, dev),
221221
'process.env.__NEXT_ROUTER_BASEPATH': config.basePath,
222222
'process.env.__NEXT_STRICT_NEXT_HEAD':
223-
config.experimental.strictNextHead ?? false,
223+
config.experimental.strictNextHead ?? true,
224224
'process.env.__NEXT_HAS_REWRITES': hasRewrites,
225225
'process.env.__NEXT_CONFIG_OUTPUT': config.output,
226226
'process.env.__NEXT_I18N_SUPPORT': !!config.i18n,

packages/next/src/export/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ export async function exportAppImpl(
419419
serverActionsManifest,
420420
}
421421
: {}),
422-
strictNextHead: !!nextConfig.experimental.strictNextHead,
422+
strictNextHead: nextConfig.experimental.strictNextHead ?? true,
423423
deploymentId: nextConfig.deploymentId,
424424
experimental: {
425425
ppr: nextConfig.experimental.ppr === true,

packages/next/src/server/base-server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ export default abstract class Server<
511511
supportsDynamicHTML: true,
512512
trailingSlash: this.nextConfig.trailingSlash,
513513
deploymentId: this.nextConfig.deploymentId,
514-
strictNextHead: !!this.nextConfig.experimental.strictNextHead,
514+
strictNextHead: this.nextConfig.experimental.strictNextHead ?? true,
515515
poweredByHeader: this.nextConfig.poweredByHeader,
516516
canonicalBase: this.nextConfig.amp.canonicalBase || '',
517517
buildId: this.buildId,

packages/next/src/server/config-shared.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ export interface ExperimentalConfig {
188188
caseSensitiveRoutes?: boolean
189189
appDocumentPreloading?: boolean
190190
preloadEntriesOnStart?: boolean
191+
/** @default true */
191192
strictNextHead?: boolean
192193
clientRouterFilter?: boolean
193194
clientRouterFilterRedirects?: boolean

test/e2e/next-head/index.test.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,6 @@ describe('next/head', () => {
1414
pages: new FileRef(join(__dirname, 'app/pages')),
1515
components: new FileRef(join(__dirname, 'app/components')),
1616
},
17-
nextConfig: {
18-
experimental: {
19-
strictNextHead: true,
20-
},
21-
},
2217
})
2318
})
2419
afterAll(() => next.destroy())

0 commit comments

Comments
 (0)