Skip to content

Commit

Permalink
[Turbopack] change persistent caching option to a boolean (#72458)
Browse files Browse the repository at this point in the history
### What?

Change the option to a boolean, the number version is weird and unexpected.

Closes PACK-3418
  • Loading branch information
sokra authored Nov 18, 2024
1 parent 560bb26 commit c50109b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
4 changes: 1 addition & 3 deletions packages/next/src/server/config-shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
8 changes: 1 addition & 7 deletions packages/next/src/server/dev/turbopack-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit c50109b

Please sign in to comment.