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
Spin-off of #1271. It is unclear how SSR streaming, Suspense, partial hydration and stores (e.g. Redux, Pinia) should play together. Problematic scenario:
A page using a store containing a Suspense with a fallback/loader is to be rendered and streamed by the server.
The server initializes the store with initial values.
The server renders the page with the Suspense's fallback, sends that HTML to the client, also sends the initial store values to the client as a PageContext JSON script and also sends the store and hydration javascript logic to the client.
The client renders the HTML and runs the store and hydration logic. At this point the page is interactive and both the client and the server have the same state in their respective stores ✅
The user starts interacting with the page and the client store state starts changing
The Suspense data fetching resolves and the server store state changes in a different way than the client. Both stores have diverged ⚠️
The server streams the new Suspense content as <script>s that update the existing DOM ✅
The latest modifications to the server store need to be merged into the client store. How? ⚠️
Note: in the Vue world this is also related to onServerPrefetch(). See #1271 (comment)
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
-
Spin-off of #1271. It is unclear how SSR streaming, Suspense, partial hydration and stores (e.g. Redux, Pinia) should play together. Problematic scenario:
<script>
s that update the existing DOM ✅Beta Was this translation helpful? Give feedback.
All reactions