mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
Follow up for #54202, use swc AST to determine the directives. Also add server actions directives for extendibility here in case we might need it in the future Closes NEXT-1538
28 lines
618 B
JavaScript
28 lines
618 B
JavaScript
import { Suspense } from 'react'
|
|
import Counter from '../../components/partial-hydration-counter'
|
|
import { createDataFetcher } from '../../lib/data'
|
|
|
|
const Data = createDataFetcher('next_streaming_data', {
|
|
timeout: 1000,
|
|
})
|
|
|
|
export default function () {
|
|
return (
|
|
<>
|
|
{process.env.NEXT_RUNTIME === 'edge'
|
|
? `Runtime: Node.js`
|
|
: 'Runtime: Edge/Browser'}
|
|
<br />
|
|
<div className="suspense">
|
|
<Suspense fallback="next_streaming_fallback">
|
|
<Data />
|
|
</Suspense>
|
|
</div>
|
|
<br />
|
|
<Counter />
|
|
</>
|
|
)
|
|
}
|
|
|
|
export const dynamic = 'force-dynamic'
|