-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(gatsby): enable async rendering with react 18 #32188
feat(gatsby): enable async rendering with react 18 #32188
Conversation
d7cb34c
to
e744840
Compare
@@ -234,7 +234,7 @@ const renderHTMLQueue = async ( | |||
payload: pageSegment, | |||
}) | |||
|
|||
for (const [_pagePath, arrayOfUsages] of Object.entries( | |||
for (const [, arrayOfUsages] of Object.entries( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix eslint warning
8faee2f
to
7f84656
Compare
7e277cd
to
ff585df
Compare
9cf528f
to
5211f56
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to clarify - this doesn't use streaming per se for SSR, right? We aggregate changes and resolve full HTML as before. So is it just about working around the deprecation of renderToString
?
onCompleteAll() { | ||
startWriting() | ||
}, | ||
onError() {}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to ignore errors here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we won't do streaming yet until libs have adopted and maybe we never do.
React still throws the error so this is just to don't show the warning.
5211f56
to
8b8623e
Compare
8b8623e
to
b8f9937
Compare
b8f9937
to
cc09599
Compare
* feat(gatsby): enable replaceRenderer to be async * update tests * duplicated apiRunner for better results * enable async in everything * SAVEPOINT * fix error parsgin * remove console.log * fix tests * add sync test * enable async rendering * remove debug info * fix async * remove debug (cherry picked from commit 32e9b4a)
* feat(gatsby): enable replaceRenderer to be async * update tests * duplicated apiRunner for better results * enable async in everything * SAVEPOINT * fix error parsgin * remove console.log * fix tests * add sync test * enable async rendering * remove debug info * fix async * remove debug (cherry picked from commit 32e9b4a) Co-authored-by: Ward Peeters <[email protected]> Co-authored-by: Vladimir Razuvaev <[email protected]>
Description
Enable Async rendering like Suspense during SSR.
pipeToNodeWritable
is a stream rendering that support Suspense boundaries and works with the new createRoot/hydrateRoot APIs.reactwg/react-18#22
After ssr:
During client side navigation: