New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature: Implement SSE #52
Comments
@1cg -- This SSE code works but it's not ready to submit, yet. I found an error reconnecting after I restart my SSE server (which is supposed to happen automatically). I'm working through a manual reconnect now, and will include that as an update to htmx, too, if necessary. |
I've made some updates to this that are (nearly) ready for testing. I want to add public @1cg -- There's one experimental change that I wanted to get your eyes on before I move forward: I'm using JSDoc-formatted comments in most of the new EventSource code. JSDoc works with the Typescript validator to provide fantastic insights and code validation if your set up your dev environment to use it. Otherwise, they're just specially formatted comments, so they are non-intrusive and don't require a build step or a compiler. You can run the raw code without any modifications. What do you think? If this works for you, I'll take a pass at adding JSDoc comments in a separate PR. Like unit tests, the benefits grow exponentially as more code is covered :) |
Another issue I'm having trouble with is parsing event names correctly. A regular, mixed case string seems to work fine. But if I include a number, or a dash |
parser.requireElement("stringLike") is more flexible, it will allow you to take either a string or a naked string, which is white space terminated. |
From discord:
The text was updated successfully, but these errors were encountered: