You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just re-read the Library Upgrade Guide: <script> (e.g. SSR frameworks) over in the React 18 WG and wasn't sure if I should post questions here or over there, but since it's related to RSCs and this WG exists now, I thought I'd just put it here.
From that post:
The real trick is when you use Suspense to do you data fetching during the stream. In that case you might discover new data as you go. This isn't quite supported in the React 18 MVP. When it's fully supported this will be built-in so that the serialization is automatic.
The next step will be to have data serialization with React Server Components work out of the box. That way if you load your data with Server Components, you don't have to manually wire up that data for hydration purposes. We might also add more options for other React I/O providers.
I'm thinking about streaming data hydration for libraries like React Query, do you have any more insight into how these parts will work now? I've understood Promise de/rehydration will be a mechanism which seems great and I get how that will work RSC -> Client Components (on the server), but I'm specifically wondering two things:
Will React also automatically hydrate these Promises RSC -> Client Component (on the client)? (Guessing yes, and that React will take care of the ordering issues of what to resolve first etc?)
Will there be a way to leverage this without RSCs? That is, if you wanted to also support "just" streaming SSR with incremental/selective React hydration, or discovering and fetching extra queries during the SSR pass, would there be a built in way for that as well? If so, are there any thoughts to what that would look like, would it also be Promise based for example or something else?
Without the second, it would be hard to support SSR for the case useQuery(..., { suspense: true }) without first preloading in an RSC?
In no rush for answers, I get if this isn't fleshed out yet, just thinking through the various cases we'd want to support. 😃
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I just re-read the Library Upgrade Guide: <script> (e.g. SSR frameworks) over in the React 18 WG and wasn't sure if I should post questions here or over there, but since it's related to RSCs and this WG exists now, I thought I'd just put it here.
From that post:
I'm thinking about streaming data hydration for libraries like React Query, do you have any more insight into how these parts will work now? I've understood Promise de/rehydration will be a mechanism which seems great and I get how that will work RSC -> Client Components (on the server), but I'm specifically wondering two things:
Will React also automatically hydrate these Promises RSC -> Client Component (on the client)? (Guessing yes, and that React will take care of the ordering issues of what to resolve first etc?)Without the second, it would be hard to support SSR for the case
useQuery(..., { suspense: true })
without first preloading in an RSC?In no rush for answers, I get if this isn't fleshed out yet, just thinking through the various cases we'd want to support. 😃
Beta Was this translation helpful? Give feedback.
All reactions