dx: warn the deprecated cache configs are used (#60836)

Follow up for #57953 for DX, give better warnings

x-ref:
https://github.com/vercel/next.js/pull/60828#discussion_r1457736645

Closes NEXT-2156
This commit is contained in:
Jiachi Liu 2024-01-18 18:38:29 +01:00 committed by GitHub
parent c192f4ec2f
commit b8d8e6e7cc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 29 additions and 0 deletions

View file

@ -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

View file

@ -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(