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

33 lines
983 B
TypeScript

import { headers } from 'next/headers'
import { getSentinelValue } from '../../getSentinelValue'
import { AllComponents } from './components'
export default async function Page() {
const allHeaders = await headers()
const xSentinelValues = new Set<string>()
for (let [headerName, headerValue] of allHeaders.entries()) {
if (headerName.startsWith('x-sentinel')) {
xSentinelValues.add(headerValue)
}
}
return (
<>
<p>
This page will exercise a number of APIs on the headers() instance by
first awaiting it. This is the correct way to consume headers() and this
test partially exists to ensure the behavior between sync and async
access is consistent for the time where you are permitted to do either
</p>
<AllComponents
headers={allHeaders}
xSentinelValues={xSentinelValues}
expression={'(await headers())'}
/>
<div id="page">{getSentinelValue()}</div>
</>
)
}