Site / With Remote and SSR
The loop, in the browser and on the server
In the browser, one loop runs everything:
link click ─▶ Site.routing ─▶ pushUrl ─▶ URL change ─▶ route field set
│
view ◀── Model ◀── Data.reduce ◀── RemoteClient ◀── active Surfaces' readsSetting 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:
URL ─▶ route ─▶ Data.satisfy (the same Surfaces, fetched until nothing is missing)
─▶ SSR.render (draws it, checks it) ─▶ HTML carrying the route and what was read
─▶ SSR.hydrate in the browser: the same Model, so nothing is fetched again