{"docs":[{"title":"Welcome","description":"A lightweight, server-first Svelte 5 framework running on Bun that ships client-side JavaScript only for interactive islands.","url":"https://mochi.fast/docs/intro/llms.txt"},{"title":"Your first Mochi app","description":"Build your first page with serverProps, selective hydration, and server islands in four steps.","url":"https://mochi.fast/docs/your-first-mochi-app/llms.txt"},{"title":"Coming from SvelteKit","description":"A mapping of SvelteKit concepts to their Mochi equivalents for developers switching frameworks.","url":"https://mochi.fast/docs/coming-from-sveltekit/llms.txt"},{"title":"Defining routes","description":"Register pages, APIs, WebSockets, SSE endpoints, and file routes using the programmatic routes record.","url":"https://mochi.fast/docs/defining-routes/llms.txt"},{"title":"Selective hydration with mochi:hydrate","description":"Mark components with mochi:hydrate to ship client-side JavaScript only where interactivity is needed.","url":"https://mochi.fast/docs/selective-hydration/llms.txt"},{"title":"Lazy hydration with mochi:hydrate:visible","description":"Defer island hydration until the component scrolls into view with mochi:hydrate:visible.","url":"https://mochi.fast/docs/lazy-hydration/llms.txt"},{"title":"Server islands with mochi:defer","description":"Render components after initial page load by fetching their HTML from the server with mochi:defer.","url":"https://mochi.fast/docs/server-islands/llms.txt"},{"title":"Passing props to islands","description":"How props are serialized and passed to hydratable islands, including supported types and auto-injected framework props.","url":"https://mochi.fast/docs/island-props/llms.txt"},{"title":"Hydratable values","description":"Serialize computed server values into the page so the client can reuse them without re-running the work.","url":"https://mochi.fast/docs/hydratable/llms.txt"},{"title":"Server-only imports","description":"Keep server-only modules like bun:sqlite out of client bundles using the .server.ts convention.","url":"https://mochi.fast/docs/server-only-imports/llms.txt"},{"title":"Progressively enhancing forms with enhance","description":"Progressively enhance HTML forms to submit via fetch when JavaScript is available.","url":"https://mochi.fast/docs/progressively-enhancing-forms-with-enhance/llms.txt"},{"title":"Why Bun?","description":"Why Mochi chose Bun as its runtime and which Bun APIs the framework relies on.","url":"https://mochi.fast/docs/why-bun/llms.txt"},{"title":"HTTP streaming","description":"Mochi renders pages to completion before sending; SSE and WebSocket are the streaming alternatives.","url":"https://mochi.fast/docs/http-streaming/llms.txt"},{"title":"Environment constants","description":"Build-time constants for branching on render target (isServer, isBrowser) and development mode (isDev).","url":"https://mochi.fast/docs/environment-constants/llms.txt"},{"title":"Request context","description":"Access the current URL, route params, cookies, and locals from any server-side code — plus the isomorphic url export that works on the client too.","url":"https://mochi.fast/docs/request-context/llms.txt"},{"title":"API routes","description":"Register JSON endpoints with Mochi.api() that receive a request event and return a Response.","url":"https://mochi.fast/docs/api-routes/llms.txt"},{"title":"WebSocket routes","description":"Register WebSocket endpoints with Mochi.ws() and handle upgrade, open, message, close, and drain events.","url":"https://mochi.fast/docs/websocket-routes/llms.txt"},{"title":"Server-Sent Events","description":"Push real-time updates to clients over a single HTTP connection with Mochi.sse().","url":"https://mochi.fast/docs/server-sent-events/llms.txt"},{"title":"Middleware (hooks)","description":"Intercept and transform requests and responses using SvelteKit-style handle functions.","url":"https://mochi.fast/docs/middleware/llms.txt"},{"title":"Trailing slash","description":"Enforce a consistent trailing-slash policy across all routes with automatic redirects.","url":"https://mochi.fast/docs/trailing-slash/llms.txt"},{"title":"Transforming HTML with transformPage","description":"Rewrite rendered HTML before it is sent to the client using the transformPage callback.","url":"https://mochi.fast/docs/transform-page/llms.txt"},{"title":"Error handling","description":"Configure a custom error page and control how uncaught errors are rendered to the client.","url":"https://mochi.fast/docs/error-handling/llms.txt"},{"title":"Error boundaries","description":"Hydratable islands are automatically wrapped in svelte:boundary so a single island failure cannot crash the page.","url":"https://mochi.fast/docs/error-boundaries/llms.txt"},{"title":"Utility helpers","description":"Small helper functions for building JSON responses, error responses, and form-action results.","url":"https://mochi.fast/docs/utility-helpers/llms.txt"},{"title":"Cache","description":"Cache server-side data with stale-while-revalidate semantics using MochiCache.","url":"https://mochi.fast/docs/cache/llms.txt"},{"title":"Logging","description":"An isomorphic, level-gated logger that works in server, SSR, and client contexts.","url":"https://mochi.fast/docs/logging/llms.txt"},{"title":"Events","description":"Subscribe to framework lifecycle events like requests, WebSocket activity, and builds via a mitt emitter.","url":"https://mochi.fast/docs/events/llms.txt"},{"title":"View Transitions","description":"Animate full-page navigations with the browser cross-document View Transitions API — zero JavaScript.","url":"https://mochi.fast/docs/view-transitions/llms.txt"},{"title":"RawScript","description":"Inline the raw contents of a file into the page at SSR time, addressed by a working-directory-relative path.","url":"https://mochi.fast/docs/raw-script/llms.txt"},{"title":"Custom HTML shell","description":"Replace the default HTML wrapper with a custom shell template containing Mochi placeholders.","url":"https://mochi.fast/docs/custom-html-shell/llms.txt"},{"title":"CSS imports","description":"Import CSS from Svelte, TypeScript, or JavaScript files and have it bundled and injected automatically.","url":"https://mochi.fast/docs/css-imports/llms.txt"},{"title":"MdSvex","description":"Enable Markdown support in Mochi pages with mdsvex and rehype/remark plugins.","url":"https://mochi.fast/docs/mdsvex/llms.txt"},{"title":"Serve options","description":"Reference for every configuration option available on Mochi.serve().","url":"https://mochi.fast/docs/serve-options/llms.txt"},{"title":"Extensions (hooks & filters)","description":"Observe or transform framework behavior at lifecycle moments using hooks and filters.","url":"https://mochi.fast/docs/extensions/llms.txt"},{"title":"Svelte config","description":"Customize the Svelte compiler via svelte.config.js with compiler options and framework defaults.","url":"https://mochi.fast/docs/svelte-config/llms.txt"},{"title":"Development mode","description":"What the development flag enables: live reload, file watcher, route handler HMR, debug bar, and error overlay.","url":"https://mochi.fast/docs/development-mode/llms.txt"},{"title":"Discord","description":"Join the Mochi community on Discord.","url":"https://mochi.fast/docs/discord/llms.txt"},{"title":"Debug bar","description":"A floating dev toolbar showing hydration metrics, request data, island breakdown, and bundle stats.","url":"https://mochi.fast/docs/debug-bar/llms.txt"},{"title":"Testing","description":"Unit-test with bun:test and run full-app tests in isolated processes with the runTests helper.","url":"https://mochi.fast/docs/testing/llms.txt"},{"title":"Tailwind","description":"Integrate Tailwind CSS v4 into a Mochi app using the setupTailwind helper.","url":"https://mochi.fast/docs/tailwind/llms.txt"},{"title":"Svelte Shaker optimization","description":"Optimize and slim down .svelte sources before compilation with the whole-program svelte-shaker optimizer.","url":"https://mochi.fast/docs/svelte-shaker/llms.txt"},{"title":"Architecture","description":"Overview of the framework directory structure and key source files.","url":"https://mochi.fast/docs/architecture/llms.txt"},{"title":"CLI reference","description":"The mochi-framework command-line tool — build, generate-key, and update-skill.","url":"https://mochi.fast/docs/cli/llms.txt"},{"title":"Deployment options","description":"Where to deploy your Mochi app — PaaS, VPS, big cloud, and self-hosted options.","url":"https://mochi.fast/docs/deployment-options/llms.txt"},{"title":"Building a Dockerfile","description":"A minimal production Dockerfile template for deploying Mochi apps with Bun.","url":"https://mochi.fast/docs/docker/llms.txt"},{"title":"Docs for LLMs","description":"A remote MCP server, an agent skill, and an llms.txt index with concatenated bundles for pasting into LLM contexts.","url":"https://mochi.fast/docs/docs-for-llms/llms.txt"},{"title":"Demos","description":"Production-style example apps demonstrating Mochi primitives like SSR, hydration, and real-time updates.","url":"https://mochi.fast/docs/demos/llms.txt"}],"demos":[{"title":"Hello World","description":"The simplest possible Mochi page — pure server-rendered Svelte.","url":"https://mochi.fast/demos/hello-world/llms.txt"},{"title":"Server Props","description":"Define serverProps on Mochi.page() to pass fresh data into a Svelte page on every request.","url":"https://mochi.fast/demos/server-props/llms.txt"},{"title":"Hydration Modes","description":"The same component rendered five ways — eager, lazy, visible, rootMargin-tuned, and deferred server island.","url":"https://mochi.fast/demos/hydration/llms.txt"},{"title":"Data Loading","description":"Server-side fetch from PokéAPI cached via MochiCache and rendered at request time.","url":"https://mochi.fast/demos/data-loading/llms.txt"},{"title":"Hydratable","description":"Compute a value once on the server with hydratable(); the hydrated island reads it from <head> instead of re-running the async work.","url":"https://mochi.fast/demos/hydratable/llms.txt"},{"title":"Cookies","description":"Read and write cookies on the server and the client through one MochiCookieJar API.","url":"https://mochi.fast/demos/cookies/llms.txt"},{"title":"Isomorphic URL","description":"One import for the current URL — reads from the request on the server, window.location on the client.","url":"https://mochi.fast/demos/url/llms.txt"},{"title":"Cache Events","description":"Subscribe to MochiCache lifecycle events through mochiEvents and log them to the server console.","url":"https://mochi.fast/demos/cache-events/llms.txt"},{"title":"Request ID","description":"Every request gets a UUID v7 — read it server-side via getRequestContext().requestId; the same id rides every lifecycle event for correlation.","url":"https://mochi.fast/demos/request-id/llms.txt"},{"title":"Cookie Vary Test","description":"A page that sets Vary: Cookie on its response — useful for testing cookie-partitioned cache keys.","url":"https://mochi.fast/cookie-vary-test/llms.txt"},{"title":"Real-time Chat","description":"A hydrated island over a Mochi.ws() route, with pub/sub broadcast and in-memory history.","url":"https://mochi.fast/demos/chat/llms.txt"},{"title":"API Endpoints","description":"JSON routes defined with Mochi.api(), tested live against the running server.","url":"https://mochi.fast/demos/api/llms.txt"},{"title":"File Routes","description":"Serve a file from disk with Mochi.file() — static path or a per-request resolver.","url":"https://mochi.fast/demos/file/llms.txt"},{"title":"Shared State","description":"Two separate islands sharing the same reactive $state.","url":"https://mochi.fast/demos/shared-state/llms.txt"},{"title":"Real-time Streams","description":"WebSocket and SSE clocks, lazily hydrated via mochi:hydrate:visible.","url":"https://mochi.fast/demos/streams/llms.txt"},{"title":"Server Islands","description":"Components marked mochi:defer render server-side on demand after the initial page is delivered.","url":"https://mochi.fast/demos/server-island/llms.txt"},{"title":"Crossing the server-client boundary with props","description":"How props travel from a server-rendered parent into a hydrated island — Date, Map, Set, BigInt, URL, typed arrays, and even cyclic refs survive devalue’s round-trip.","url":"https://mochi.fast/demos/island-props/llms.txt"},{"title":"Lazy Islands","description":"Islands marked mochi:hydrate:visible hydrate and load their CSS only when scrolled into view.","url":"https://mochi.fast/demos/lazy/llms.txt"},{"title":"Lazy Server Islands","description":"Server islands marked mochi:defer:visible only fetch when the wrapper scrolls into view.","url":"https://mochi.fast/demos/lazy-server-island/llms.txt"},{"title":"Font loading","description":"Ship fonts via @fontsource packages or standalone .woff2 files — automatically bundled and linked from the page head.","url":"https://mochi.fast/demos/font-loading/llms.txt"},{"title":"MdSvex","description":"A .md file compiled through mdsvex and rendered as a Svelte component, with an embedded <script> block.","url":"https://mochi.fast/demos/mdsvex/llms.txt"},{"title":"Nested Components","description":"A five-level recursive tree — hydrating the root carries the whole subtree in one island.","url":"https://mochi.fast/demos/nested-components/llms.txt"},{"title":"Shared Props","description":"Nine islands, three unique payloads — each set serialized once and referenced via props-ref.","url":"https://mochi.fast/demos/prop-dedup/llms.txt"},{"title":"Unique IDs","description":"Svelte's native $props.id() inside islands — SSR-consistent, unique per instance, namespaced in server islands.","url":"https://mochi.fast/demos/props-id/llms.txt"},{"title":"Form Actions","description":"A login form rendered twice — plain HTML POST and intercepted with {@attach enhance(...)}.","url":"https://mochi.fast/demos/login/llms.txt"},{"title":"Using form return data","description":"An action returns data via success({...}); {@attach enhance(...)} updates the UI in place, plain HTML re-renders the page.","url":"https://mochi.fast/demos/form-return-data/llms.txt"},{"title":"Form Errors","description":"A thrown action error shown inline via {@attach enhance(...)}, or as the Mochi error page on plain submit.","url":"https://mochi.fast/demos/form-errors/llms.txt"},{"title":"Form Redirects","description":"redirect(303, …) intercepted as a JSON envelope by {@attach enhance(...)}, or followed natively by the browser.","url":"https://mochi.fast/demos/form-redirects/llms.txt"},{"title":"File Uploads via form actions","description":"multipart/form-data submission, validated with fail() and success(), shown enhanced and plain.","url":"https://mochi.fast/demos/file-upload/llms.txt"},{"title":"Reloading associated form data","description":"After a successful submit, refetch the related list inside enhance() — or rely on the post-POST re-render.","url":"https://mochi.fast/demos/reload-form-data/llms.txt"},{"title":"Cancelling form submissions","description":"cancel() prevents the fetch from firing; controller.abort() stops one mid-flight.","url":"https://mochi.fast/demos/form-cancel/llms.txt"},{"title":"Error Handling","description":"Catch render errors and unmatched routes via Mochi.serve()’s errorPage option and the handleError hook.","url":"https://mochi.fast/demos/error/llms.txt"},{"title":"Error Boundaries","description":"Contain island failures with <svelte:boundary> so one broken component does not crash the page.","url":"https://mochi.fast/demos/error-boundaries/llms.txt"}]}