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:

  1. The URL becomes a route.
  2. Data.satisfy fetches for the same Surfaces until nothing is missing.
  3. SSR.render draws the page, checks it, and writes HTML carrying the route and what was read.
  4. SSR.hydrate in the browser rebuilds the same Model, so nothing is fetched again.