COMPONENTS FEATURE
Live grid: push over SSE
The contract-driven grid fed by an SSE stream: emit an event and a new row appears in every open tab, no reload. Paging, sort and filters still apply.
Open this page in two tabs. Click Emit event (top-right of the grid) — a new row appears live in both tabs with no reload. The grid is an SSE feed; the button publishes the feed's watch scope and the server pushes the fresh page to every connected grid.
A grid identical to the static registry — it builds itself from the OPTIONS contract — except the feed declares transport: Sse and a watch scope. The runtime opens a held-open EventSource instead of a one-shot pull. Click the grid's "Emit event" action and a row appears at the top of THIS grid and any other tab on this page, with no reload and no polling.
How it works
The feed payload adds `transport: TransportType::Sse`, the guest-safe `SseGateModel::BearerSession`, and `#[WatchScopes('platform_live_events')]`. The runtime sees `modes: [sse]` in the contract and opens an EventSource; the server holds it open and re-runs the feed whenever an invalidation fires on that scope, framing each result as a `ui.collection.data` event. The "Emit event" grid action POSTs to a tiny endpoint that appends a row to the shared (Redis-backed, cross-worker) store and calls `ScopeInvalidatorInterface::touch('platform_live_events')` — which publishes `ui.invalidate.{tenant}.platform_live_events`, the exact scope the held-open grids subscribe to. View changes (sort/filter/page) ride the same open stream as re-hydrate commands.
Why it matters
Live is usually a second system — a websocket server, a client store, a reconciliation layer. Here it is a property of the SAME contract-driven feed: one `transport: Sse` + one `#[WatchScopes]` declaration turns the pull grid into a pushed one, and any domain write (or, here, a demo emit) that touches the scope updates every connected grid for free. The page never learns it is live; the contract does. (ORM-backed feeds get the publish automatically on write — zero emit code.)