🍡 mochi

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

On this page

mochi

Mochi is a lightweight, server-first framework for Svelte 5 on Bun — it renders everything as plain HTML and ships JavaScript only for the components you mark as islands.

Server-rendered, with island interactivity

The websites we visit on the web are mostly static — text, images and links. Only a handful of elements on any given page actually need to be interactive: a search box, a logged-in badge, a comments widget. Mochi reflects this at the core of its design. Mochi sites renders server-side as plain HTML; the interactive pieces are marked with a mochi:* directive — each one an island — and ship JS embedded in that HTML.

Go ahead, try hydrating the page below and see which components will load JavaScript.

header
user
profile
sidebar
main
  • ssr
  • island

The header text, the main column, and the footer ship as HTML and stay that way. The badge and the sidebar nav are wrapped as islands — same SSR HTML on first paint, with JS attached on top. Everything else is zero-JS forever.

Why would I consider Mochi over SvelteKit?

  • Faster sites. Mochi ships zero client JavaScript by default. SvelteKit code-splits per route but still hydrates the entire page — even purely static content. Mochi only hydrates the components you explicitly mark as islands, which means less JS on first load, better bfcache behavior, and a natural fit for any site.
  • Performant hydration. Avoid hydrating islands until the users scrolls into them with mochi:hydrate:visible. Or avoid hydrating at all if the user never scrolls down to that component. Your users will thank you for the faster experience.
  • Uses the platform. Mochi ships with first-class support for View Transitions. No client side router, no state to keep track of between requests.
  • No heavy bundler (no Vite). Uses the lighting-fast Bun bundler, which builds sites with hundreds of routes in seconds.
  • Real-time built in. WebSockets and Server Sent Events are first-class route types — no extra packages or services required.

Want to know more? to see a full feature comparison.

Community

Questions, bug reports, ideas, or just want to see what others are building? Join the Mochi Discord.