Real-time Streams
You can build a WebSocket clock and a Server-Sent Events clock side by side, ticking every second. The component hydrates only when scrolled into view via mochi:hydrate:visible with a 100px rootMargin.
WebSocket connecting
--:--:-- /ws/timeSSE connecting
--:--:-- /sse/time$props.id(): s1
<script>
import RealtimeClocks from './RealtimeClocks.svelte';
</script>
<RealtimeClocks mochi:hydrate />
More demos
Static Directories How staticDirs works — mount a whole directory tree under a URL prefix as one Bun route, with Content-Type / ETag / Range / index.html from Bun and no per-file registration. Server Props How server props work — pass fresh per-request data into a page via serverProps on Mochi.page(). Form Redirects How form action redirects work — redirect(303, …) is intercepted as a JSON envelope by {@attach enhance(...)} or followed natively by the browser.