sseserver icon indicating copy to clipboard operation
sseserver copied to clipboard

Scratchpad for a v2 cleanup

Open mroth opened this issue 2 years ago • 0 comments

The original version of this module was a lift-and-shift of an internal library from Emojitracker's Go streamer, moving it into a reusable module. It has a number of understandable issues as such when I look at it today:

  1. A number of the abstractions and specific feature needs from Emojitracker (for example, middleware to extract the real IP address for a proxied connection) slipped into this library that are not necessarily part of the core SSE Pubsub functionality. Looking back at the code, I think I intended for it to be an easy "batteries included" one stop shop for someone to run a similar application in production (I think I was perhaps imagining someone with literally zero Go experience using this as a generic infrastructure piece for pubsub streaming), but as the ecosystem has evolved these conveniences now seem extraneous.
  2. It was literally the first Go program I ever wrote. :see_no_evil:
  3. Since then there have been over 10 years(!) of evolution in the Go ecosystem, tooling, and best practices, not to mention a decade of my maturation as a software engineer.

I no longer use this library myself (and it's been years since I sold Emojitracker), but since it has over a hundred stars on GitHub, while it's not amongst my most popular code, that's enough that I don't want to necessarily abandon it.

My plan for a v2 here is not to make significant improvements, but rather use the oppurtunity for breaking API changes to remove some extraneous features and clean up the API.

From that point forward, there is an easier path towards future maintainability and usage (perhaps by others). I suspect there is quite a bit of improved performance I could easily get into this with my current knowledge, but uncertain whether I will bother to get to that stuff for now, as I don't have a personal use case for this module at present, so my goal is more just to get it in a usable state so I can go back to ignoring it again for another decade.


This is a "deep background" cleanup for me at very low priority compared to my other OSS maintenance (as likely evidenced by the fact the first commit in this cleanup is already almost 2 years old). Some things I would want to do:

  • [ ] Remove all unnecessary core features
  • [ ] Clean up and rationalize API to a reasonable state
  • [ ] Update documentation
  • [ ] Finally, do the typical v2 module release dance
  • [ ] ...more

mroth avatar Aug 20 '23 14:08 mroth