Repository navigation
Dendra 0.11.0 — SSE streams and job status on the client
- Server-Sent Events.
createClient(url, { streamFormat: "sse" })streams
.stream()procedures as SSE instead of NDJSON, for proxies and CDNs that
buffer NDJSON. The server picks the format fromAccept, so no server change
is needed. Errors still arrive as a typedDendraClientError, and stopping
the loop still aborts the handler'ssignal. Idle streams send a: ping
every 15 s (server optionheartbeatMs). A.get()stream also works with a
plain browserEventSource; close it on thedoneevent. - Following a job in the browser.
useJob(jobId, open)indendra/react,
andfollowJob(open)in core, follow a background job until it succeeds or
fails, with no polling. A dropped connection reopens after a backoff and picks
up the current state;NOT_FOUND,UNAUTHORIZEDand other coded errors stop
it and seterror. - Streams through proxies. Stream responses send
Cache-Control: no-cache
andX-Accel-Buffering: no, andtoNodeHandlerflushes after each chunk so
Express'scompression()doesn't hold them back. The README's new "Deploying
streams" section covers nginx, Caddy, compression, idle timeouts and
WebSockets behind a proxy.
Behaviour change: if a stream fails before it starts (for example,
createContext throws), the client now throws the error. Before, the loop
received the error object as an ordinary value.
No upgrade steps are needed.