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

Hyper 1.0 support #1325

Closed
davidpdrsn opened this issue Aug 25, 2022 · 4 comments
Closed

Hyper 1.0 support #1325

davidpdrsn opened this issue Aug 25, 2022 · 4 comments
Labels
A-axum A-axum-core E-hard Call for participation: Experience needed to fix: Hard / a lot S-blocked Status: marked as blocked ❌ on something else such as a PR or other implementation work.
Milestone

Comments

@davidpdrsn
Copy link
Member

davidpdrsn commented Aug 25, 2022

Hyper is aiming to ship 1.0 this year and in the process making a lot of changes to the public API which will impact axum. We can discuss the changes here.

Off the top of my head the biggest changes will probably be

  • Hyper dropping tower::Service support since tower-service wont be 1.0 in time.
  • Moving hyper::Server into hyper-util. I don't think we should have a public dependency on hyper-util since breaking releases would cascade into axum.
  • Removing hyper::Body (or possibly moving it into hyper-util). I think we should consider giving axum-core its own body type. Relevant to Middleware that change the request body have poor usability #1110

I haven't thought much about this yet but once 0.6.0 is out we start that work.

Relevant links

@davidpdrsn davidpdrsn added this to the 0.7 milestone Aug 25, 2022
@genusistimelord
Copy link
Contributor

genusistimelord commented Sep 7, 2022

I guess the newer FromRequestParts and IntoResponseParts functions and State help Cover the loss of tower::Service. But this will heavily affect every single layer-based library when and if you do update to the newest Hyper. So maybe we can improve and prepare all the Parts changes to make migration easier later. I am willing to switch my libraries over to using them so they can be used as Examples for other library makers to change theirs over too.

I'm guess hyper-util will be a faster change with more API breaking branch?

I think Axum should also have its own Body type. This would make it easier to Abstract the Body from different source's and allow you more flexibility over them.

@davidpdrsn davidpdrsn added E-hard Call for participation: Experience needed to fix: Hard / a lot A-axum A-axum-core labels Nov 19, 2022
@davidpdrsn davidpdrsn mentioned this issue Nov 27, 2022
11 tasks
@davidpdrsn davidpdrsn added the S-blocked Status: marked as blocked ❌ on something else such as a PR or other implementation work. label Apr 21, 2023
@davidpdrsn
Copy link
Member Author

I've started the work in #1882 but it's currently blocked by tower-http getting updated. That is blocked by figuring out how to implement the (de?)compression middleware.

@davidpdrsn
Copy link
Member Author

An update on where we're at with regards to hyper 1.0 support:

  • Sean is planning to ship hyper 1.0 on November 15th 2023. This is super exciting! I can't guarantee that axum will be ready on the same day but that's my goal.
  • The majority of the work to port axum is done. See Update to latest versions of hyper and http-body #1882
  • I've moved all issues, except this one, that were on the 0.7 milestone to a new 0.8 milestone. The focus for 0.7 is hyper 1.0 support. Other API changes will have to wait for the next major version.
  • tower-http also needs to be updated. Most of that work is also done. See Upgrade to http-body 1.0 tower-rs/tower-http#348. The only thing missing is compression and decompression middleware.

Finally most of the high level utilities that were previously in hyper (such as hyper::Server) are being moved to hyper-util. hyper-util is still early in development and thus pretty lean in terms of the conveniences it offers. That probably will hurt axum's usability at bit at first. I wanna encourage people to submit patches to hyper-util. I have started contributing myself (hyperium/hyper-util#46).

@davidpdrsn
Copy link
Member Author

This was fixed in #1882. See https://github.com/tokio-rs/axum/milestone/6 for things left to do before axum 0.7 can be shipped.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-axum A-axum-core E-hard Call for participation: Experience needed to fix: Hard / a lot S-blocked Status: marked as blocked ❌ on something else such as a PR or other implementation work.
Projects
None yet
Development

No branches or pull requests

2 participants