0eb9f7e76d
Part of #31506 and https://github.com/vercel/next.js/discussions/34179. This PR ensures that in the `nodejs` runtime, the flight data is statically stored as a JSON file if possible. Most of the touched code is related to conditions of static/SSG/SSR when runtime and/or RSC is involved. ## Bug - [ ] Related issues linked using `fixes #number` - [x] Integration tests added - [ ] Errors have helpful link attached, see `contributing.md` ## Feature - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have helpful link attached, see `contributing.md` ## Documentation / Examples - [ ] Make sure the linting passes by running `yarn lint`
27 lines
403 B
JavaScript
27 lines
403 B
JavaScript
import Runtime from '../utils/runtime'
|
|
import Time from '../utils/time'
|
|
|
|
export default function Page({ type }) {
|
|
return (
|
|
<div>
|
|
This is a {type} RSC page.
|
|
<br />
|
|
<Runtime />
|
|
<br />
|
|
<Time />
|
|
</div>
|
|
)
|
|
}
|
|
|
|
export function getStaticProps() {
|
|
return {
|
|
props: {
|
|
type: 'ISR',
|
|
},
|
|
revalidate: 3,
|
|
}
|
|
}
|
|
|
|
export const config = {
|
|
runtime: 'nodejs',
|
|
}
|