Summary (enhancement)
HTeaLeaf has no server→client push: the ASGI adapter always sends a single http.response.body with more_body=False, and there's no websocket scope handling. Reactivity is request/response + Store re-fetch, never streaming. This blocks an important class of apps — anything that streams data incrementally.
Use case
We want to host a chat UI that streams LLM tokens as they're generated (today done over a WebSocket, token-by-token into the DOM). With HTeaLeaf as-is, every token would need a separate round-trip. This is the single feature keeping us on FastAPI for the real-time parts while we use HTeaLeaf for static SSR views.
What would unlock it (any one is a good start)
- Chunked/streaming HTTP responses — let a handler return an async iterator / generator, and have the ASGI adapter emit multiple
http.response.body events with more_body=True. Enables SSE (text/event-stream) for one-way server→client streams.
- WebSocket scope support in the ASGI adapter (
scope["type"] == "websocket"), with a route/handler API for bidirectional messages.
- A
Store/reconciliation hook so a server-side state change can push a DOM patch to connected clients (vs. the current client-initiated re-fetch).
SSE (option 1) alone would cover most streaming dashboards and token streaming.
Context
Raised while evaluating HTeaLeaf to eventually replace a Vue + FastAPI stack with pure Python. SSR + mounting already work well for static views; server push is the remaining architectural gap for the dynamic ones.
Summary (enhancement)
HTeaLeaf has no server→client push: the ASGI adapter always sends a single
http.response.bodywithmore_body=False, and there's nowebsocketscope handling. Reactivity is request/response +Storere-fetch, never streaming. This blocks an important class of apps — anything that streams data incrementally.Use case
We want to host a chat UI that streams LLM tokens as they're generated (today done over a WebSocket, token-by-token into the DOM). With HTeaLeaf as-is, every token would need a separate round-trip. This is the single feature keeping us on FastAPI for the real-time parts while we use HTeaLeaf for static SSR views.
What would unlock it (any one is a good start)
http.response.bodyevents withmore_body=True. Enables SSE (text/event-stream) for one-way server→client streams.scope["type"] == "websocket"), with a route/handler API for bidirectional messages.Store/reconciliation hook so a server-side state change can push a DOM patch to connected clients (vs. the current client-initiated re-fetch).SSE (option 1) alone would cover most streaming dashboards and token streaming.
Context
Raised while evaluating HTeaLeaf to eventually replace a Vue + FastAPI stack with pure Python. SSR + mounting already work well for static views; server push is the remaining architectural gap for the dynamic ones.