SvelteKit Live Query Stream
Server-push status streaming with SvelteKit's experimental query.live remote function, pinned to @sveltejs/kit 2.70.1. A *.remote.ts module exposes a live query backed by a plain async generator that SvelteKit drives as an SSE stream, with a per-process pub/sub hub, first-yield SSR seeding, and a finally block that unregisters listeners when a subscriber disconnects. A paired command records a phase transition and, in the same response, walks requested(fn, limit) to reconnect only the live subscriptions whose argument actually changed, using the { arg, query } entry shape introduced in 2.58.0. Includes locals-based auth, hand validation of the 'unchecked' argument, and comments pinning the 2.59.0, 2.63.1 and 2.66.0 behaviour changes.
npx shadcn@latest add @compronents/sveltekit-live-query-streamInstalls from ui.aryank.space. Needs a registry token and a one-time @compronents entry in components.json. The docs walk through both.
query.live drives an async generator as an SSE stream with a per-process pub/sub hub; the finally block unregisters the listener on disconnect so a dropped client stops the pushes.
@sveltejs/[email protected]