axum icon indicating copy to clipboard operation
axum copied to clipboard

Hyper 1.0 support

Open davidpdrsn opened this issue 1 year ago • 1 comments

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 https://github.com/tokio-rs/axum/issues/1110

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

Relevant links

davidpdrsn avatar Aug 25 '22 10:08 davidpdrsn

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.

genusistimelord avatar Sep 07 '22 18:09 genusistimelord