Skip to content

Commit

Permalink
[dev-overlay] add false option to disable dev indicator
Browse files Browse the repository at this point in the history
  • Loading branch information
devjiwonchoi committed Feb 17, 2025
1 parent fe4f0f0 commit 9962304
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 29 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ export function getDefineEnv({
'process.env.__NEXT_TRAILING_SLASH': config.trailingSlash,
'process.env.__NEXT_BUILD_INDICATOR':
config.devIndicators.buildActivity ?? true,
'process.env.__NEXT_DEV_INDICATOR': config.devIndicators !== false,
'process.env.__NEXT_DEV_INDICATOR_POSITION':
config.devIndicators.position ?? 'bottom-left',
'process.env.__NEXT_STRICT_MODE':
Expand Down
61 changes: 32 additions & 29 deletions packages/next/src/server/config-shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,36 @@ export interface LoggingConfig {
incomingRequests?: boolean | IncomingRequestLoggingConfig
}

export interface DevIndicatorsConfig {
/**
* @deprecated The dev tools indicator has it enabled by default.
* */
appIsrStatus?: boolean

/**
* Show "building..." indicator in development
* @deprecated The dev tools indicator has it enabled by default.
*/
buildActivity?: boolean

/**
* Position of "building..." indicator in browser
* @default "bottom-right"
* @deprecated Renamed as `position`.
*/
buildActivityPosition?:
| 'top-left'
| 'top-right'
| 'bottom-left'
| 'bottom-right'

/**
* Position of the development tools indicator in the browser window.
* @default "bottom-left"
* */
position?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'
}

export interface ExperimentalConfig {
nodeMiddleware?: boolean
cacheHandlers?: {
Expand Down Expand Up @@ -836,35 +866,8 @@ export interface NextConfig extends Record<string, any> {
images?: ImageConfig

/** Configure indicators in development environment */
devIndicators?: {
/**
* @deprecated The dev tools indicator has it enabled by default.
* */
appIsrStatus?: boolean

/**
* Show "building..." indicator in development
* @deprecated The dev tools indicator has it enabled by default.
*/
buildActivity?: boolean

/**
* Position of "building..." indicator in browser
* @default "bottom-right"
* @deprecated Renamed as `position`.
*/
buildActivityPosition?:
| 'top-left'
| 'top-right'
| 'bottom-left'
| 'bottom-right'

/**
* Position of the development tools indicator in the browser window.
* @default "bottom-left"
* */
position?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'
}
// Quite a large discriminant union, but is to skip boolean type check.
devIndicators?: DevIndicatorsConfig | (DevIndicatorsConfig & false)

/**
* Next.js exposes some options that give you some control over how the server will dispose or keep in memory built pages in development.
Expand Down

0 comments on commit 9962304

Please # to comment.