Skip to content
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

Major Breaking Change: Simplify Codebase using Http-Primitives Lib and Remove Streams #36

Closed
wants to merge 3 commits into from

Conversation

andrewlalis
Copy link
Owner

This will be a major version increment, which will break pretty much all tests, unit and integration, and will break pretty much all current usages of handy-http. I'm doing it though, because I think that it'll be better in the long run for handy-http to be more cohesive and less tightly coupled.

Essentially, the high-level description of the changes is this:

  • I'm introducing a new library, http-primitives that defines primitive HTTP types like HttpRequest, HttpResponse, HttpRequestHandler, etc. in a generic way using only plain D and the standard library.
  • I'm refactoring handy-http to remove its own implementations of the types that http-primitives provides. (In actuality, I cut and pasted modules from handy-http to http-primitives with minor tweaks here and there.)
  • As a result of the refactoring, handy-http's role will be reduced to being an HttpServer compatible with any request handler defined using http-primitives. Think of it as being inspired by Java's servlets, where you can write a servlet using the Servlets API, and then pop it into any servlet container implementation you want (tomcat, jetty, undertow, ...). http-primitives serves as the cross-project API, and handy-http becomes a (default) server implementation for that API.

What this means:

  • The signatures for many functions will change.
  • Most all documentation will need to be updated. I'll see about finding a more modern documentation generator thing while I'm at it.
  • I'm removing usage of my streams library, and going back to using plain D ranges, to improve compatibility with everything else.

@andrewlalis
Copy link
Owner Author

Closing this for now, since reducing to ranges seems to have some pretty dire consequences for how to handle low-level IO for both HTTP and websockets. May revisit in a completely refactored handy-http project in the future...

@andrewlalis andrewlalis deleted the use-http-primitives branch December 12, 2024 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant