tonic
tonic copied to clipboard
Upgrade to http 1.0 and axum 0.7
Hi, I'm working on a PR to upgrade http, http-body, axum, etc.
This affects https://github.com/tokio-rs/axum/issues/2356.
Scoping out upgrading tonic, it appears that this crate is far too large to handle in a single pr. Is it possible to set up a branch on tonic to tackle each of the workspace members?
i.e. I attempted to upgrade tonic-web
to http 1.0.1
, but because hyper::body::Body
is now a trait, not a struct, there are new trait bounds on most of this crates' members. I haven't checked the other members, but I'm guessing the same breaking changes will arise. The docs will also require their respective adjustments,,,unless my assumptions are wrong, here's the enable
function signature in tonic-web
From
pub fn enable<S>(service: S) -> CorsGrpcWeb<S>
where
S: Service<http::Request<hyper::Body>, Response = http::Response<BoxBody>>,
S: Clone + Send + 'static,
S::Future: Send + 'static,
S::Error: Into<BoxError> + Send,
To
pub fn enable<S, B>(service: S) -> CorsGrpcWeb<S, B>
where
S: Service<http::Request<B>, Response = http::Response<BoxBody>>,
B: hyper::body::Body,
S: Clone + Send + 'static,
S::Future: Send + 'static,
S::Error: Into<BoxError> + Send,
Can someone more knowledgeable tell me if my assumption is correct here?
@dsgallups Body struct was renamed to Incoming but I am not sure if it can act as drop-in replacement
Is it possible to set up a branch on tonic to tackle each of the workspace members?
Yes, in fact I will just branch off tonic now and we can work off of main.
Ok I created a https://github.com/hyperium/tonic/tree/next branch, @allan2 if you want to target this branch with this work that would be great. I am happier to do smaller PRs. That said as well my gh notificiations are out of control rn so if you need a review from me pls ping me on discord and I will take a look.
+1 for this PR
@dsgallups the replacement(s) for the body struct is now in https://docs.rs/http-body-util/0.1.0/http_body_util/
Thanks, I'll see about making a contribution this weekend!
Edit: Are we positive that we should be using the replacement body struct over using anything that implements hyper::body::Body
? It just feels like being generic over the body is preferred, unless tonic/grpc is actually constrained to a single option of this type. I'm not knowledgeable enough about tonic to know the answer for this situation. @LucioFranco , could you provide me some pointers so I can make a productive contribution?
Edit: Are we positive that we should be using the replacement body struct over using anything that implements hyper::body::Body? It just feels like being generic over the body is preferred, unless tonic/grpc is actually constrained to a single option of this type. I'm not knowledgeable enough about tonic to know the answer for this situation. @LucioFranco , could you provide me some pointers so I can make a productive contribution?
most of the stuff we used is also in the util crate which is fine to use a replacement for now.
Any updates on this?
Cc @allan2
You can follow the latest work in #1595
I would like to drop a quick update from my part, obviously this upgrade is quite complicated due to how dependent tonic is on hyper for good and bad reasons. As well as historical ones. I don't have a clear plan yet going forward of how I want to solve this that will work for everyone, but I have been spending time thinking about how to do this. So what that means is that people will need to be a bit patient while I find what makes most sense. In the meantime, hyper 0.14 is quite stable and I would recommend any production users to keep using that.
Trying to catch up here.
#1583 was the draft and is still open, but it was superceded by #1595.
@allan2 links to #1595 above. @ikrivosheev closed that about a month ago, and nothing was merged.
@alexrudy's #1670 supercedes #1595, and seems to be the new latest and ready-to-go version.
@aran , hello! Here is finished PR: https://github.com/hyperium/tonic/pull/1670
Hello, should this issue be closed after #1670 merge?