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
41 lines
940 B
TypeScript
41 lines
940 B
TypeScript
import crypto from 'node:crypto'
|
|
|
|
import { SentinelValue } from '../../../getSentinelValue'
|
|
|
|
export default async function Page() {
|
|
const first = await getGeneratedKeyPair(1)
|
|
const second = await getGeneratedKeyPair(2)
|
|
return (
|
|
<div>
|
|
<dl>
|
|
<dt>
|
|
[first] require('node:crypto').generateKeyPairSync(type, options)
|
|
</dt>
|
|
<dd id="first">{first.publicKey}</dd>
|
|
<dt>
|
|
[second] require('node:crypto').generateKeyPairSync(type, options)
|
|
</dt>
|
|
<dd id="second">{second.publicKey}</dd>
|
|
</dl>
|
|
<span id="page">
|
|
<SentinelValue />
|
|
</span>
|
|
</div>
|
|
)
|
|
}
|
|
|
|
async function getGeneratedKeyPair(_nonce: number) {
|
|
'use cache'
|
|
return crypto.generateKeyPairSync('rsa', {
|
|
modulusLength: 512,
|
|
publicKeyEncoding: {
|
|
type: 'spki',
|
|
format: 'pem',
|
|
},
|
|
privateKeyEncoding: {
|
|
type: 'pkcs8',
|
|
format: 'pem',
|
|
},
|
|
})
|
|
}
|