From 495b1ac9d042759a0ab5aecc98f67b010f73c076 Mon Sep 17 00:00:00 2001 From: Tobias Koppers Date: Thu, 7 Nov 2024 12:24:33 +0100 Subject: [PATCH] change option to a boolean --- packages/next/src/server/config-shared.ts | 4 +--- packages/next/src/server/dev/turbopack-utils.ts | 8 +------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/packages/next/src/server/config-shared.ts b/packages/next/src/server/config-shared.ts index 76217dc7d2a71..49fece7e9c7c1 100644 --- a/packages/next/src/server/config-shared.ts +++ b/packages/next/src/server/config-shared.ts @@ -152,10 +152,8 @@ export interface ExperimentalTurboOptions { /** * Enable persistent caching for the turbopack dev server and build. - * Need to provide the expected level of stability, otherwise it will fail. - * Currently stability level: 1 */ - unstablePersistentCaching?: number | false + unstablePersistentCaching?: boolean /** * Enable tree shaking for the turbopack dev server and build. diff --git a/packages/next/src/server/dev/turbopack-utils.ts b/packages/next/src/server/dev/turbopack-utils.ts index f5eb125ec23b2..06b6f79c13122 100644 --- a/packages/next/src/server/dev/turbopack-utils.ts +++ b/packages/next/src/server/dev/turbopack-utils.ts @@ -1205,11 +1205,5 @@ export function normalizedPageToTurbopackStructureRoute( export function isPersistentCachingEnabled( config: NextConfigComplete ): boolean { - const unstableValue = config.experimental.turbo?.unstablePersistentCaching - if (typeof unstableValue === 'number' && unstableValue > 1) { - throw new Error( - 'Persistent caching in this version of Turbopack is not as stable as expected. Upgrade to a newer version of Turbopack to use this feature with the expected stability.' - ) - } - return !!unstableValue + return config.experimental.turbo?.unstablePersistentCaching || false }