cferdinandi / cferdinandi/kelp
A component for handling Server-Sent Events
- Dominant language
- JavaScript
- Stars
- 645
- Forks
- 19
- PR merge metrics
- No merged PRs in 30d
Description
**Is your feature request related to a problem? Please describe.**
It would be useful to have a web component that listen to [server-sent events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events) (SSE). SSE are a way to establish a uni-directional communication between a backend and a JS client. Possible use cases are notifications, realtime charts, etc.
**Describe the solution you'd like**
Once instantiated on the DOM, the web component will listen to SSE from the server. When the component receives data from the server an event is triggered. The event could then be consumed by other components. Authentication/authorization on the endpoint should also be handled.
**Describe alternatives you've considered**
In a former implementation of mine I handled the communication with the backend directly within the component that was consuming the data from the server. Now I think that a separated component will represent a cleaner solution.
**Additional context**
Useful links:
* https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events
* https://rxdb.info/articles/websockets-sse-polling-webrtc-webtransport.html
Contributor guide
Research direction
The issue names no repository files, tests, or entry points to inspect. Start with the linked MDN Server-Sent Events documentation, then define the component’s event API and authentication behavior; done means the component can receive server events and expose them to other components.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend, web-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100