Site / With Remote and SSR
Site, Remote and SSR together
Three packages, three questions about the same page:
foldkit-site Where is the reader, and what is around them?
foldkit-remote What does that page read from the server, and what does the Model already know?
foldkit-ssr How does a page the server drew become the browser's, without doing it all again?None of them reaches into another. They meet in two places only: the application's Model, which holds the route and Remote's store side by side, and one record of Surfaces, which says what each page reads. Site makes that record from the tree, Remote fetches what it asks for, and SSR checks that the page it hands over carries all of it.
This guide builds one small application with all three: each owner's projects
at /owners/<id>, rendered on the server with its data, taken over without
fetching again, built statically, and read ahead on hover. Every snippet is
code from
packages/site/test/together.test.ts,
which compiles and runs it. The CMS example's public site is the same design
at full size (examples/cms/src/apps/siteApp.ts).