Skip to content

Commit

Permalink
[dynamicIO] complete refactor to prerender (#71687)
Browse files Browse the repository at this point in the history
In the initial change to adopt prerender for SSR for dynamicIO I missed
an instance of renderToReadableStream. This completes the work
  • Loading branch information
gnoff authored Oct 23, 2024
1 parent 4292752 commit d61d631
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions packages/next/src/server/app-render/app-render.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3156,7 +3156,7 @@ async function prerenderToStream(

try {
htmlStream = await prerenderAndAbortInSequentialTasks(
() => {
async () => {
const teedStream = (
workUnitAsyncStorage.run(
// The store to scope
Expand All @@ -3176,11 +3176,11 @@ async function prerenderToStream(
reactServerStream = teedStream[0]
const rscForSSRStream = teedStream[1]

const renderToReadableStream = require('react-dom/server.edge')
.renderToReadableStream as (typeof import('react-dom/server.edge'))['renderToReadableStream']
const pendingHTMLStream = workUnitAsyncStorage.run(
const prerender = require('react-dom/static.edge')
.prerender as (typeof import('react-dom/static.edge'))['prerender']
const { prelude } = await workUnitAsyncStorage.run(
finalSSRPrerenderStore,
renderToReadableStream,
prerender,
<App
reactServerStream={rscForSSRStream}
preinitScripts={preinitScripts}
Expand All @@ -3198,8 +3198,7 @@ async function prerenderToStream(
: [bootstrapScript],
}
)
pendingHTMLStream.catch(() => {})
return pendingHTMLStream
return prelude
},
() => {
finalSSRController.abort(abortReason)
Expand Down

0 comments on commit d61d631

Please sign in to comment.