fix(solid-query): render resolved SSR value for deferred queries#10957
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>
|
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 |
|
View your CI Pipeline Execution ↗ for commit a42e54f
☁️ Nx Cloud last updated this comment at |
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