Render pending async props when server rendering - #826
Open
pleek91 wants to merge 1 commit into
Open
Conversation
✅ Deploy Preview for kitbag-router ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
The wrapper a view's pending props go through was chosen by reading the instance's suspense property, which is client only and always false while server rendering. The server therefore always got the wrapper that fills a ref from a promise handler, which the server renderer never awaits, so a view with an async props getter rendered nothing. Choose the awaiting wrapper when vue's ssr context is present instead. The server renderer awaits async setup whether or not a Suspense boundary exists, so this needs nothing from the app.
pleek91
force-pushed
the
ssr-async-props
branch
from
August 29, 2026 22:15
8e9990d to
0bb89b3
Compare
This file contains hidden or 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
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.
Description
A view with an async props getter rendered nothing when server rendered. The wrapper its pending props go through was chosen by reading the component instance's
suspenseproperty, which is client only and always false during SSR, so the server always got the wrapper that fills a ref from a promise handler — and the server renderer never awaits that.It now picks the awaiting wrapper when vue's ssr context is present. The server renderer awaits async setup whether or not a
<Suspense>boundary exists, so this needs nothing from the app. Client behaviour is unchanged.import.meta.env.SSRis not usable for this — it would be replaced when this package is built rather than when an app using it is.