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';
import { files } from './files.ts';
const sources = await loadSources(files);
</script>
<RealtimeClocks mochi:hydrate />
More demos
Cookie Vary Test A page that sets Vary: Cookie on its response — useful for testing cookie-partitioned cache keys. Cache Events Subscribe to MochiCache lifecycle events through mochiEvents and log them to the server console. Font loading Ship fonts via @fontsource packages or standalone .woff2 files — automatically bundled and linked from the page head.