Site / With Remote and SSR
The loop, in the browser and on the server
In the browser, one loop runs everything. A link click reaches
Site.routing, which calls pushUrl; the URL change sets the route field.
The route decides which Surfaces are active, RemoteClient fetches what they
read and the Model lacks, Data.reduce folds the answers into the Model, and
the view draws it.
Setting the route is synchronous. The active pages follow from the route, and what is missing from what they read; Remote fetches that and reduces the answers into the Model. Navigation never waits for data.
The server runs the same steps once, ahead of time, and hands over the result:
- The URL becomes a route.
Data.satisfyfetches for the same Surfaces until nothing is missing.SSR.renderdraws the page, checks it, and writes HTML carrying the route and what was read.SSR.hydratein the browser rebuilds the same Model, so nothing is fetched again.