Skip to content

Commit

Permalink
Pages router: Enable strict Head children reconciler by default
Browse files Browse the repository at this point in the history
  • Loading branch information
eps1lon committed May 6, 2024
1 parent 89d2abd commit f239d24
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,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
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ export async function exportAppImpl(
serverActionsManifest,
}
: {}),
strictNextHead: !!nextConfig.experimental.strictNextHead,
strictNextHead: nextConfig.experimental.strictNextHead ?? true,
deploymentId: nextConfig.deploymentId,
experimental: {
ppr: nextConfig.experimental.ppr === true,
Expand Down
2 changes: 1 addition & 1 deletion packages/next/src/server/base-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,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
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,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
Original file line number Diff line number Diff line change
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 f239d24

Please sign in to comment.