-
Notifications
You must be signed in to change notification settings - Fork 47.1k
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
Expose prerender() for SSG in stable #31298
Merged
Merged
+49
−39
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
facebook-github-bot
added
CLA Signed
React Core Team
Opened by a member of the React Core Team
labels
Oct 19, 2024
Comparing: 1839e14...c4c40ea Critical size changesIncludes critical production bundles, as well as any change greater than 2%:
Significant size changesIncludes any change greater than 0.2%: Expand to show |
sebmarkbage
force-pushed
the
prerender
branch
from
October 19, 2024 17:41
6efdecf
to
6e896dc
Compare
sebmarkbage
force-pushed
the
prerender
branch
from
October 19, 2024 17:45
6e896dc
to
e19ff00
Compare
gnoff
approved these changes
Oct 19, 2024
sebmarkbage
force-pushed
the
prerender
branch
from
October 19, 2024 17:56
e19ff00
to
1272882
Compare
sebmarkbage
force-pushed
the
prerender
branch
from
October 19, 2024 18:22
1272882
to
f4f987b
Compare
sebmarkbage
force-pushed
the
prerender
branch
from
October 19, 2024 18:28
f4f987b
to
9b2632c
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When we added
renderToReadableStream
we added theallReady
helper to make it easier to do SSG rendering but it's kind of awkward to wire up that way. Since we're also discouragingrenderToString
in React 19 the cliff is kind of awkward. (As noted by Docusaurus.)The idea of the
react-dom/static
prerender
API was that this would be the replacement for SSG rendering. Awkwardly this entry point actually already exists in stable but it has onlyundefined
exports.Since then we've also added other useful heuristics into the
prerender
branch that makes this really the favored and easiest to use API for the prerender (SSG/ISR) use case.prerender
is also used for Partial Prerendering but that part is still experimental.However, we can expose only the
prerender
API onreact-dom/static
without it returning thepostponeState
. Instead the stream is onprelude
. The naming is a bit awkward if you don't consider resuming but it's the same thing.It's really just
renderToReadable
stream with automaticallReady
and better heuristics for prerendering.