Initiates
Navigates, submits intent, receives HTML, then runs the hydration bundle.
Owner: user agentThis map describes checked-in architecture, not runtime telemetry.
Rendering decision
Choose where the first useful UI is rendered, then decide whether browser WASM should resume it. This template ships the balanced default: SSR + hydration.
| Mode | First document | After load | Choose it when | Template status |
|---|---|---|---|---|
| SSR + hydration | The Worker streams useful route HTML. | Browser WASM hydrates that DOM. Router navigation avoids a new document request; route data may still call server functions. | You need fast first paint, indexable content, and app-like interaction. | Current template |
| SSR only | The Worker returns useful HTML for every page request. | Links and forms rely on document requests unless small client enhancements are added. | The product is content-led and does not need a persistent reactive client. | Supported direction; not a packaged lane |
| Pure CSR | The platform serves an HTML shell; browser WASM creates the useful UI. | The browser owns rendering and calls APIs for server data. | A named, isolated surface values static hosting or offline behavior more than first-response HTML. | Deferred until a consumer needs it |
What this means now:keep SSR + hydration as the core. If pure CSR earns a real use case, add it as an isolated Workers Static Assets pattern with its own entrypoint and proof—do not turn the whole template into an SPA.
Platform decision
Workers and Pages can both reach the Workers runtime, but they create different project, routing, deployment, and proof boundaries.
| Question | Workers Static Assets | Cloudflare Pages | Decision |
|---|---|---|---|
| What deploys? | The Worker and `target/site` assets deploy as one unit. | The Pages package targets the same handler and assets in advanced mode. | Choose one |
| Who owns routing? | The platform asset router serves exact files; non-assets reach the generated Worker entrypoint. | The advanced-mode handler receives every request and forwards assets. | Separate routing contracts |
| When is it justified? | The current SSR, server-function, D1, Assets, and realtime boundaries need one runtime. | Choose Pages for a Pages project and its deployment workflow. | Pages source-qualified |
Checked in now:The Pages runtime and production preparation path are locally qualified; live deployment is a separate proof stage. Workers remains the default. An authorized deployment must earn provider readback and live evidence.
Platform asset router
The `[assets]` binding gives Cloudflare the static directory and keeps non-asset requests on the SSR path.
A document, identity file, hashed `/pkg/` artifact, API call, or realtime upgrade reaches Cloudflare.
Yes: Workers Static Assets responds without invoking user Worker code. No: the request continues to the Worker entrypoint.
The Rust entry owns `/realtime/socket`; its explicit asset delegation is a safe fallback if it receives an asset path.
Every remaining route reaches Axum + Leptos for pages, typed server functions, status handling, and security headers.
The returned HTML loads hashed client assets, then browser WASM resumes the server-rendered DOM.
Navigates, submits intent, receives HTML, then runs the hydration bundle.
Owner: user agentServes exact static matches before user code and sends non-assets to the Worker.
Owner: Workers Static AssetsHandles the WebSocket lane, preserves explicit asset delegation, then falls through to SSR.
Owner: workers-rs fetch handlerMatches routes, supplies app context, runs server functions, and streams useful HTML.
Owner: Rust SSR bundleD1 owns session-scoped records and is available only through the Worker binding.
Owner: Cloudflare bindingThe client WASM binds events to server-rendered markup without replacing the application model.
Owner: browser bundleOnly `/realtime/socket` upgrades in the template. Shared rooms and presence require Durable Objects.
Owner: Worker, then adopted patternDelivery contract
A route closes only when source, server mount, navigation, host fallback, assets, hydration, and rendered behavior agree.
`AppLayout` stays inside `Router`; the wildcard remains last.
Workers Assets serves named identity files and immutable `/pkg/` artifacts.
Non-asset requests fall through to Leptos SSR and typed server functions.
Next plate