tokio-rs / axum

Ergonomic and modular web framework built with Tokio, Tower, and Hyper
18.51k stars 1.04k forks source link

Hyper 1.0 support #1325

Closed davidpdrsn closed 10 months ago

davidpdrsn commented 2 years ago

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

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

Relevant links

genusistimelord commented 2 years ago

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 commented 1 year ago

I've started the work in https://github.com/tokio-rs/axum/pull/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 commented 10 months ago

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

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 (https://github.com/hyperium/hyper-util/pull/46).

davidpdrsn commented 10 months ago

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