-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
documentationImprovements or additions to documentationImprovements or additions to documentationenhancementNew feature or requestNew feature or request
Description
Objective
Add a working SSE example to the product-catalog demo and document the pattern in the developer guide. This implements the documentation track defined in #6.
Prerequisite
-
HtmlResponseInterceptorbypassesAccept: text/event-streamrequests (Core hardening: bypass HTML interceptor for SSE event-stream requests #8 ✅)
Developer guide
Add a dedicated SSE section to docs/DEVELOPERS_GUIDE.md. Content defined in #6:
EventSourceAPI basics (connect, listen, close, auto-reconnect)- RESTHeart SSE endpoint format (
/_streams/<name>) - Full working example using
EventSource+htmx.ajax()for re-rendering - When to use SSE vs polling
- Auth considerations
- Guidance on high-frequency flows (client-side rendering, not SSR)
Product-catalog example
Wire one live update scenario in examples/product-catalog:
- Product list (
/shop/products) auto-refreshes when a product is inserted or deleted - Uses native
EventSourceconnected to the RESTHeart change stream for the products collection - On event: calls
htmx.ajax()to re-fetch and re-render the product list fragment - Demonstrates at least one visible live DOM update without a page reload
Update examples/product-catalog/README.md with:
- Prerequisites (MongoDB replica set required for change streams)
- How to trigger a visible update (e.g. insert a document via curl or the admin UI)
Acceptance criteria
- SSE section added to developer guide
-
EventSourcepattern documented with a complete working example - Auth and reconnect behaviour documented
- High-frequency flows guidance included
- Product-catalog example shows a live update
- README run instructions are reproducible
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
documentationImprovements or additions to documentationImprovements or additions to documentationenhancementNew feature or requestNew feature or request