Data & remote functions
Server data reaches the shell as props; interactivity talks back through Kit's remote functions. Each primitive below runs inside its own island.
query — seeded from SSR
Awaited outside a pending boundary, so it resolves during SSR. In a production build
the result is seeded into the client cache and hydration adopts the on-screen HTML with
no re-fetch. (Under vite dev the seed can't cross module isolation, so dev
re-fetches — cosmetic, documented.)
command + query.refresh()
The counter reads a server value with query. Bump runs a command to mutate server state, then .refresh() re-reads it —
all from inside the island.
query.live — SSE stream
A streaming server clock over Server-Sent Events. The reactive .current updates each tick after hydration. This one keeps a connection
open on purpose.
query.batch
Three getSquare() calls fired in the same tick collapse into one request.
A shared batchAt across all three results proves a single server run.
form() — remote guestbook
A remote form() inside an island: enhanced submit with no reload, per-field
validation issues, and pending state — all from Kit's own form runtime. With JavaScript
off it posts natively to the remote endpoint and post-redirect-gets back. The store is
in-memory, so it resets when the server restarts.