SSR examples¶
Worked SSR apps in the repo's example tree — each runs end-to-end, not as a sketch.
- ssr — the base example, and the source the tutorial is adapted from: one
.cljcfile where the server hand-rolls the whole request lifecycle (per-request frame,:rf/server-initboot,render-to-string, the escaped__rf_payloadscript, teardown in afinally) and the client hydrates and verifies throughssr/hydrate!. Includes a:platforms #{:client}effect the server render skips, and ships a hand-authoredindex.html— a frozen snapshot of the server's output — so you can watch hydration happen without standing up a JVM. Start here. → - resources_ssr — server-side preloads a re-frame2 resource (an article list) into a request-local frame, drains the blocking fetch before rendering, ships only the allowed resource projection in the hydration payload, and hydrates the client cache so a fresh entry renders immediately with no double-fetch. →
- ssr_streaming — the streaming shape: a shell that flushes on the first byte with
:rf/suspense-boundaryfallbacks in place, slow regions streaming in as their data resolves, and the canonical final payload as the correctness lock. →
See Concepts for the SSR and hydration model these examples exercise.