fix(solid-query): render resolved SSR value for deferred queries#10957
Open
brenelz wants to merge 1 commit into
Open
fix(solid-query): render resolved SSR value for deferred queries#10957brenelz wants to merge 1 commit into
brenelz wants to merge 1 commit into
Conversation
When a deferred query (prefetched but not awaited) is read inside a
Loading/Suspense boundary, SSR rendered the stale loading state and the
client hydrated into a frozen subtree ("unclaimed server-rendered node").
On the server the result proxy forced a `queryResource()` read to create
the Suspense dependency, but returned property values from the `state`
store. When the boundary suspends and re-renders after the query settles,
`state` is never synced (the server subscriber resolves the resource
Promise but does not write the store), so the retry render read stale
loading values. The serialized resource, however, held the resolved
result — so server DOM (loading) and the hydrated resource (success)
disagreed, breaking hydration.
Read property values from the resolved resource instead of `state`, so
the streamed SSR HTML matches the serialized resource the client
hydrates against.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
When a deferred query (prefetched but not awaited) is read inside a Loading/Suspense boundary, SSR rendered the stale loading state and the client hydrated into a frozen subtree ("unclaimed server-rendered node").
On the server the result proxy forced a
queryResource()read to create the Suspense dependency, but returned property values from thestatestore. When the boundary suspends and re-renders after the query settles,stateis never synced (the server subscriber resolves the resource Promise but does not write the store), so the retry render read stale loading values. The serialized resource, however, held the resolved result — so server DOM (loading) and the hydrated resource (success) disagreed, breaking hydration.Read property values from the resolved resource instead of
state, so the streamed SSR HTML matches the serialized resource the client hydrates against.🎯 Changes
✅ Checklist
pnpm run test:pr.🚀 Release Impact