Skip to content

Commit b8d8e6e

Browse files
authored
dx: warn the deprecated cache configs are used (#60836)
Follow up for #57953 for DX, give better warnings x-ref: #60828 (comment) Closes NEXT-2156
1 parent c192f4e commit b8d8e6e

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

packages/next/src/server/config-shared.ts

+9
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,15 @@ export interface ExperimentalConfig {
178178
optimisticClientCache?: boolean
179179
middlewarePrefetch?: 'strict' | 'flexible'
180180
manualClientBasePath?: boolean
181+
/**
182+
* @deprecated use config.cacheHandler instead
183+
*/
184+
incrementalCacheHandlerPath?: string
185+
/**
186+
* @deprecated use config.cacheMaxMemorySize instead
187+
*
188+
*/
189+
isrMemoryCacheSize?: number
181190
disablePostcssPresetEnv?: boolean
182191
swcMinify?: boolean
183192
cpus?: number

packages/next/src/server/config.ts

+20
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,26 @@ function assignDefaults(
456456
}
457457
}
458458

459+
if (result.experimental?.incrementalCacheHandlerPath) {
460+
// TODO: Remove this warning in Next.js 15
461+
warnOptionHasBeenDeprecated(
462+
result,
463+
'experimental.incrementalCacheHandlerPath',
464+
'The "experimental.incrementalCacheHandlerPath" option has been renamed to "cacheHandler". Please update your next.config.js.',
465+
silent
466+
)
467+
}
468+
469+
if (result.experimental?.isrMemoryCacheSize) {
470+
// TODO: Remove this warning in Next.js 15
471+
warnOptionHasBeenDeprecated(
472+
result,
473+
'experimental.isrMemoryCacheSize',
474+
'The "experimental.isrMemoryCacheSize" option has been renamed to "cacheMaxMemorySize". Please update your next.config.js.',
475+
silent
476+
)
477+
}
478+
459479
if (typeof result.experimental?.serverActions === 'boolean') {
460480
// TODO: Remove this warning in Next.js 15
461481
warnOptionHasBeenDeprecated(

0 commit comments

Comments
 (0)