From d61d6314f2551d6685d92b3638d50272a9320e8e Mon Sep 17 00:00:00 2001 From: Josh Story Date: Tue, 22 Oct 2024 21:32:04 -0700 Subject: [PATCH] [dynamicIO] complete refactor to prerender (#71687) In the initial change to adopt prerender for SSR for dynamicIO I missed an instance of renderToReadableStream. This completes the work --- packages/next/src/server/app-render/app-render.tsx | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/packages/next/src/server/app-render/app-render.tsx b/packages/next/src/server/app-render/app-render.tsx index 04c5260d2577d..766c4d487da81 100644 --- a/packages/next/src/server/app-render/app-render.tsx +++ b/packages/next/src/server/app-render/app-render.tsx @@ -3156,7 +3156,7 @@ async function prerenderToStream( try { htmlStream = await prerenderAndAbortInSequentialTasks( - () => { + async () => { const teedStream = ( workUnitAsyncStorage.run( // The store to scope @@ -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, {}) - return pendingHTMLStream + return prelude }, () => { finalSSRController.abort(abortReason)