🍡 mochi

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

Mochi on This Week in Svelte

I joined Paolo Ricciuti on This Week in Svelte to demo Mochi and talk through the thinking behind it. The Mochi segment starts at 40:16.

We spent a while on SvelteKit, and where Mochi goes a different way. SvelteKit has to run everywhere — static hosts, serverless, the edge — and that generality shapes what its API can offer. Mochi only targets a stateful server, so it can lean on things SvelteKit can’t assume you have — real-time, caching, queues and image resizing are all in the box.

The rest of the segment was live coding:

  • A brand new app from bun create mochi@latest.
  • A click counter that stubbornly did nothing, because the page shipped zero JavaScript, until mochi:hydrate turned it into an island and the first script tag showed up in the network tab.
  • The same counter as a server island with mochi:defer, fetched in its own request so it can be cached separately from the page around it.
  • A Pokémon page pulling live data from an API, first through serverProps on the route, then with a plain await at the top of the component.
  • That page nearly shipping its entire 183 KB API response to the browser as island props — spotted in the debug bar, and cut down to 22 bytes by passing only the field the island actually reads.

We also talked about what isn’t there yet. File-based routing came up from Paolo and from the chat, and it’s on my list to revisit before 1.0 — likely through an extensions API rather than baked into the core. I’m also not happy with hot module reloading — it works, but SvelteKit’s is nicer.

Mochi is early and in alpha. The docs and demos are the fastest way in, and I’d genuinely like to hear what breaks — Discord or a GitHub issue, either works.

Stanislav

← All posts