mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
### What `export const runtime = 'experimental-edge'` also work for pages. This PR add tests for that. Closes NEXT-426 Follow up for #46631 that to fully remove all related code of the `experimental.runtime`
29 lines
485 B
JavaScript
29 lines
485 B
JavaScript
import { Suspense } from 'react'
|
|
|
|
let result
|
|
let promise
|
|
function Data() {
|
|
if (result) return result
|
|
if (!promise)
|
|
promise = new Promise((res) => {
|
|
setTimeout(() => {
|
|
result = 'next_streaming_data'
|
|
res()
|
|
}, 500)
|
|
})
|
|
throw promise
|
|
}
|
|
|
|
export default function Page() {
|
|
return (
|
|
<Suspense fallback="next_streaming_fallback">
|
|
<Data />
|
|
</Suspense>
|
|
)
|
|
}
|
|
|
|
// Use config export
|
|
export const config = {
|
|
runtime: 'experimental-edge',
|
|
}
|