SSR framework for Svelte 5 + Bun with islands-based selective hydration
July 28, 2026
Mochi 0.9.0
Mochi 0.9.0 is out, with 30 commits since 0.8.0. It’s a smaller release, but with some breaking changes.
- Faster builds with rsvelte
- Request cache
- Relocatable builds
- Precompiled email templates
- Other improvements
- Install or upgrade
Faster builds with rsvelte
rsvelte is a Rust port of the Svelte 5 compiler built on OXC, and Mochi can now route component compilation through it. It’s opt-in — add @mochi-framework/rsvelte and pick the backend:
await Mochi.serve({
svelteCompiler: 'rsvelte',
routes,
});On the demos preset from bun create mochi@latest:
| phase | svelte | rsvelte | delta |
|---|---|---|---|
| total | 384ms | 289ms | −25% |
ssr-build | 213ms | 137ms | −36% |
client-bundle | 40ms | 26ms | −35% |
Request cache
The request cache memoizes work for the duration of a single HTTP request, so a lookup rendered by ten components runs once. Concurrent callers share one in-flight promise. The cache is reset on every new request.
import { requestCache, requestMemo } from 'mochi-framework';
const user = await requestCache(`user:${id}`, () => db.user(id));
// Or wrap once at module scope — every importer shares the memo.
export const getUser = requestMemo((id: string) => db.user(id));Relocatable builds
Build output no longer contains a single absolute path, and the same commit built on any machine produces identical island names, bundle filenames and SSR’d HTML.
Mochi.serve({ manifest: '/srv/app/build/manifest.json' });The public directory
publicDir is no longer copied into the build — the runtime scans it from disk at boot.
Precompiled email templates
mochi-framework build now compiles every template in src/emails/ into the manifest, so sending no longer waits on a cold compile.
await Mochi.email({ to, subject: 'Welcome', component: './src/emails/Welcome.svelte', props });Other improvements
- Captcha —
<MochiCaptcha />no longer hangs on slow mobile browsers, and its proof-of-work difficulty and solve budget are now configurable. - Extensions — pulling a server-only module into a client bundle now fails the build.
- Svelte Shaker —
optimizerequiressvelte-shaker0.18.1 or newer, which fixes a bug that strippedmochi:directives so islands never hydrated.
Install or upgrade
New project:
bun create mochi@latest my-appExisting project — bump the dependency and restart the dev server:
bun add mochi-framework@latest # or @0.9.0 to pin
bun run devThe full changelog has everything else. Mochi is still early and in alpha — if something breaks, Discord or a GitHub issue both work.