mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
## What? Rename `experimental.dynamicIO` to `experimental.cacheComponents` across the Next.js codebase. ## Why? We're going to be merging the functionality of the `ppr`, `dynamicIO` and `useCache` experimental flags into the singular `cacheComponents` flag to reduce complexity of the codebase and simplify adoption for users wanting to experiment with experimental features. ## How? - Renamed the configuration option from `experimental.dynamicIO` to `experimental.cacheComponents` - Added deprecation handling with automatic migration for the old option name - Updated all documentation, tests, and internal references - Updated Rust code in SWC transforms and Turbopack - Maintained backward compatibility with deprecation warnings NAR-158
30 lines
730 B
TypeScript
30 lines
730 B
TypeScript
import { draftMode } from 'next/headers'
|
|
|
|
import { getSentinelValue } from '../getSentinelValue'
|
|
|
|
import ToggleButton from './ToggleButton'
|
|
|
|
export default async function Page() {
|
|
return (
|
|
<>
|
|
<p>
|
|
This page uses `(await draftMode()).isEnabled`. This is now a promise
|
|
however reading it during prerender is fine because it is always false
|
|
during prerender so we don't expect it to trigger any dynamic behavior
|
|
</p>
|
|
<Component />
|
|
<ToggleButton />
|
|
<div id="page">{getSentinelValue()}</div>
|
|
</>
|
|
)
|
|
}
|
|
|
|
async function Component() {
|
|
return (
|
|
<div>
|
|
draftMode enabled?{' '}
|
|
<span id="draft-mode">{'' + (await draftMode()).isEnabled}</span>
|
|
</div>
|
|
)
|
|
}
|