#3244·vinext

Typegen: merge configured cacheLife profiles into next/cache types

Author: ask-bonk[bot]Created Sep 12, 2026Updated Sep 12, 2026
Labelsnextjs-tracking

Next.js Change

Commit: f464e32 (#98252)

What changed

Next.js moved configured cacheLife profile declarations to an augmentation of next/cache rather than a standalone ambient module that shadows the package types. It adds a CacheLifeProfiles interface to next/cache and constrains string profile names when that interface is augmented, while retaining the object-form cacheLife() overload.

Impact on vinext

vinext implements the next/cache API and Cache Components configuration. Its generated or declared types should preserve all existing next/cache exports while providing typed custom cacheLife profile names from project configuration.

Acceptance criteria

  • Declare an augmentable CacheLifeProfiles interface in vinext's next/cache types.
  • Restrict string cacheLife() and unstable_cacheLife() profile arguments to configured profiles when present, while allowing arbitrary strings when none are configured.
  • Keep the object-form cacheLife() overload available.
  • Generate a module augmentation, not a standalone declaration that shadows other next/cache exports.
  • Add type-level coverage for valid configured profiles, rejected unknown profiles, and existing next/cache exports.

References