Skip to content

Commit

Permalink
Add feature flag for new dev overlay (#73977)
Browse files Browse the repository at this point in the history
This PR enabled feature flag for the new dev overlay, no behavioral
change.

- Added `experimental.newDevOverlay` Next.js option, which handles
`__NEXT_EXPERIMENTAL_NEW_DEV_OVERLAY` env value.
- Added `__NEXT_EXPERIMENTAL_NEW_DEV_OVERLAY` env to be resolved at
build time so that it can be used to render the overlay conditionally
  • Loading branch information
devjiwonchoi authored Dec 16, 2024
1 parent e3c1de4 commit e9415fc
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions packages/next/src/build/webpack/plugins/define-env-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,8 @@ export function getDefineEnv({
needsExperimentalReact(config),
}
: undefined),
'process.env.__NEXT_EXPERIMENTAL_NEW_DEV_OVERLAY':
config.experimental.newDevOverlay ?? false,
}

const userDefines = config.compiler?.define ?? {}
Expand Down
1 change: 1 addition & 0 deletions packages/next/src/server/config-schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,7 @@ export const configSchema: zod.ZodType<NextConfig> = z.lazy(() =>
typedEnv: z.boolean().optional(),
serverComponentsHmrCache: z.boolean().optional(),
authInterrupts: z.boolean().optional(),
newDevOverlay: z.boolean().optional(),
})
.optional(),
exportPathMap: z
Expand Down
6 changes: 6 additions & 0 deletions packages/next/src/server/config-shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,11 @@ export interface ExperimentalConfig {
* This config allows you to enable the experimental navigation API `forbidden` and `unauthorized`.
*/
authInterrupts?: boolean

/**
* Enables the new dev overlay.
*/
newDevOverlay?: boolean
}

export type ExportPathMap = {
Expand Down Expand Up @@ -1163,6 +1168,7 @@ export const defaultConfig: NextConfig = {
staticGenerationMinPagesPerWorker: 25,
dynamicIO: false,
inlineCss: false,
newDevOverlay: false,
},
bundlePagesRouterDependencies: false,
}
Expand Down

0 comments on commit e9415fc

Please sign in to comment.