🍡 mochi

SSR framework for Svelte 5 + Bun with islands-based selective hydration

HTTP streaming

Mochi does not currently stream HTML responses. Every page is rendered to completion on the server and returned as a single response. This applies only to page rendering — Mochi.sse() and Mochi.ws() are streaming primitives in their own right and can be used for realtime interactions on the page with the client side powered by Svelte.

Why we’re comfortable with this (for now)

Streamed SSR is mostly a latency mitigation — a way to start sending bytes before the slowest data dependency on the page resolves. Mochi pushes you toward solutions that make that mitigation unnecessary in the first place:

  • Server islands let slow, personalized, or expensive fragments load out-of-band after the rest of the page ships.
  • Lazy and visible hydration keep the initial payload small and fast without needing progressive HTML.
  • For pages that don’t need per-request personalized, the right answer is usually a shared HTTP cache in front of the app — Cloudflare, CloudFront, Fastly, Varnish, or Nginx — so origin render time stops mattering for the common case. Remember that you can also cache the main page but leave certain or all server islands uncached.

Before 1.0

Streaming is on the list of things to revisit before the 1.0 release. If an important use case forces it, the stance above may change.