Files
Wyatt JohnsonandGitHub 8abbb3dc2e refactor: rename experimental.dynamicIO to experimental.cacheComponents (#81562)
## 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
2025-07-17 19:30:28 -06:00

35 lines
937 B
TypeScript

import { Suspense } from 'react'
import { getSentinelValue } from '../../getSentinelValue'
export default async function Page() {
await 1
return (
<>
<p>
This page renders a component that requires async IO. It is simulated
using setTimeout(f, 1000).
</p>
<p>
This component simulated IO component is rendered inside a Suspense
boundary
</p>
<p>
With PPR this page should be partially static, showing the fallback of
the Suspense boundary surrounding our simulated IO.
</p>
<p>Without PPR this page should be dynamic.</p>
<Suspense fallback="loading...">
<ComponentWithIO />
<div id="inner">{getSentinelValue()}</div>
</Suspense>
<div id="page">{getSentinelValue()}</div>
</>
)
}
async function ComponentWithIO() {
await new Promise<void>((r) => setTimeout(r, 1000))
return <p>hello IO</p>
}