Unverified Commit e9415fc7 authored by Jiwon Choi's avatar Jiwon Choi Committed by GitHub

Add feature flag for new dev overlay (#73977)

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
parent e3c1de4d
...@@ -288,6 +288,8 @@ export function getDefineEnv({ ...@@ -288,6 +288,8 @@ export function getDefineEnv({
needsExperimentalReact(config), needsExperimentalReact(config),
} }
: undefined), : undefined),
'process.env.__NEXT_EXPERIMENTAL_NEW_DEV_OVERLAY':
config.experimental.newDevOverlay ?? false,
} }
const userDefines = config.compiler?.define ?? {} const userDefines = config.compiler?.define ?? {}
......
...@@ -439,6 +439,7 @@ export const configSchema: zod.ZodType<NextConfig> = z.lazy(() => ...@@ -439,6 +439,7 @@ export const configSchema: zod.ZodType<NextConfig> = z.lazy(() =>
typedEnv: z.boolean().optional(), typedEnv: z.boolean().optional(),
serverComponentsHmrCache: z.boolean().optional(), serverComponentsHmrCache: z.boolean().optional(),
authInterrupts: z.boolean().optional(), authInterrupts: z.boolean().optional(),
newDevOverlay: z.boolean().optional(),
}) })
.optional(), .optional(),
exportPathMap: z exportPathMap: z
......
...@@ -562,6 +562,11 @@ export interface ExperimentalConfig { ...@@ -562,6 +562,11 @@ export interface ExperimentalConfig {
* This config allows you to enable the experimental navigation API `forbidden` and `unauthorized`. * This config allows you to enable the experimental navigation API `forbidden` and `unauthorized`.
*/ */
authInterrupts?: boolean authInterrupts?: boolean
/**
* Enables the new dev overlay.
*/
newDevOverlay?: boolean
} }
export type ExportPathMap = { export type ExportPathMap = {
...@@ -1163,6 +1168,7 @@ export const defaultConfig: NextConfig = { ...@@ -1163,6 +1168,7 @@ export const defaultConfig: NextConfig = {
staticGenerationMinPagesPerWorker: 25, staticGenerationMinPagesPerWorker: 25,
dynamicIO: false, dynamicIO: false,
inlineCss: false, inlineCss: false,
newDevOverlay: false,
}, },
bundlePagesRouterDependencies: false, bundlePagesRouterDependencies: false,
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment