Skip to content

Commit

Permalink
dx: warn the deprecated cache configs are used (#60836)
Browse files Browse the repository at this point in the history
Follow up for #57953 for DX, give better warnings

x-ref:
#60828 (comment)

Closes NEXT-2156
  • Loading branch information
huozhi committed Jan 18, 2024
1 parent c192f4e commit b8d8e6e
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/next/src/server/config-shared.ts
Expand Up @@ -178,6 +178,15 @@ export interface ExperimentalConfig {
optimisticClientCache?: boolean
middlewarePrefetch?: 'strict' | 'flexible'
manualClientBasePath?: boolean
/**
* @deprecated use config.cacheHandler instead
*/
incrementalCacheHandlerPath?: string
/**
* @deprecated use config.cacheMaxMemorySize instead
*
*/
isrMemoryCacheSize?: number
disablePostcssPresetEnv?: boolean
swcMinify?: boolean
cpus?: number
Expand Down
20 changes: 20 additions & 0 deletions packages/next/src/server/config.ts
Expand Up @@ -456,6 +456,26 @@ function assignDefaults(
}
}

if (result.experimental?.incrementalCacheHandlerPath) {
// TODO: Remove this warning in Next.js 15
warnOptionHasBeenDeprecated(
result,
'experimental.incrementalCacheHandlerPath',
'The "experimental.incrementalCacheHandlerPath" option has been renamed to "cacheHandler". Please update your next.config.js.',
silent
)
}

if (result.experimental?.isrMemoryCacheSize) {
// TODO: Remove this warning in Next.js 15
warnOptionHasBeenDeprecated(
result,
'experimental.isrMemoryCacheSize',
'The "experimental.isrMemoryCacheSize" option has been renamed to "cacheMaxMemorySize". Please update your next.config.js.',
silent
)
}

if (typeof result.experimental?.serverActions === 'boolean') {
// TODO: Remove this warning in Next.js 15
warnOptionHasBeenDeprecated(
Expand Down

0 comments on commit b8d8e6e

Please sign in to comment.