🍡 mochi
SSR framework for Svelte 5 + Bun with islands-based selective hydration
Architecture
| File | Role |
|---|---|
src/index.ts | HTTP server entry point |
src/routes.ts | Route definitions |
src/mochi-framework/Mochi.ts | Mochi.serve(), page(), api(), ws(), sse() |
src/mochi-framework/ComponentRegistry.ts | SSR compilation, hydration preprocessing, client bundling |
src/mochi-framework/hooks.ts | Middleware system (Handle, sequence()) |
src/mochi-framework/utils.ts | json(), error(), gzip |
src/mochi-framework/HydratableIsland.ts | Client-side custom element for island hydration |
src/mochi-framework/ServerIsland.ts | Client-side custom element for server island fetching |
src/mochi-framework/serverIslandCrypto.ts | HMAC signing/verification for server island props |
src/mochi-framework/types.ts | Shared TypeScript types |