rustwasm / gloo

A modular toolkit for building fast, reliable Web applications and libraries with Rust and WASM
https://gloo-rs.web.app
Apache License 2.0
1.78k stars 146 forks source link

Update http crate to 1.0 #407

Closed dgsantana closed 10 months ago

dgsantana commented 1 year ago

This bumps http to 1.0 and also the gloo-net minor version.

dgsantana commented 1 year ago

I'm not sure this will fix the error. The CI workflow has the tests set for rust 1.64.

ranile commented 1 year ago

I would rather inline the one type that's used from http crate than bump the version and MSRV while keeping the requirement of pulling in another dependency. I would be happy to look at any PRs removing the dependency altogether.

dgsantana commented 1 year ago

Ok, changed the PR title and inlined the http method code, removing the http dependency.

dgsantana commented 1 year ago

Note: The failing and the requirement to increase MSRV is not due to http (MSRV is 1.49) but due to "toml_edit v0.19.15", which in turn is not related to the change in gloo-net. This is due to proc-macro-crate used in gloo-worker-macros.

dgsantana commented 1 year ago

I would propose a new PR to fix this, something like this:

diff --git a/crates/worker-macros/Cargo.toml b/crates/worker-macros/Cargo.toml
index 474cd46..d560678 100644
--- a/crates/worker-macros/Cargo.toml
+++ b/crates/worker-macros/Cargo.toml
@@ -19,6 +19,8 @@ proc-macro-crate = "1.2.1"
 proc-macro2 = "1.0.47"
 quote = "1.0.21"
 syn = { version = "2.0.15", features = ["full"] }
+# Required to keep msrv at 1.64
+toml_edit = "=0.19.0"

 [dev-dependencies]
 trybuild = "1"
ranile commented 1 year ago

The lockfile is present for that. It's most likely that since you updated it before, the lockfile has the previous entry. You can try reverting the change to Cargo.lock and then rebuilding. That should fix the issue

dgsantana commented 1 year ago

Done.

dgsantana commented 1 year ago

Minimum Method version to work with gloo-net.

tysen commented 11 months ago

This mergeable now?

sabify commented 11 months ago

@futursolo's comment is on point and reasonable (https://github.com/rustwasm/gloo/pull/407#discussion_r1424729847). The http crate is compatible with the current implementation of fetch. By continuing to use the http crate, gloo-net can likely avoid introducing breaking changes that would impact users who are already utilizing the http crate and its custom methods like RequestBuilder::method (https://github.com/rustwasm/gloo/blob/64d81f1b8f919a016a115484efc7963fab2fa4e9/crates/net/src/http/request.rs#L130C8-L130C8).

Perhaps we could move forward using the http crate?

dgsantana commented 11 months ago

Ok, I will change the PR to use the http 1.x again, it's simple.

Saber Haj Rabiee @.***> escreveu no dia segunda, 18/12/2023 à(s) 16:23:

@futursolo https://github.com/futursolo's comment is on point and reasonable (#407 (comment) https://github.com/rustwasm/gloo/pull/407#discussion_r1424729847). The http crate is compatible with the current implementation of fetch. By continuing to use the http crate, gloo-net can likely avoid introducing breaking changes that would impact users who are already utilizing the http crate and its custom methods like RequestBuilder::method ( https://github.com/rustwasm/gloo/blob/64d81f1b8f919a016a115484efc7963fab2fa4e9/crates/net/src/http/request.rs#L130C8-L130C8 ).

Perhaps we could move forward using the http crate?

— Reply to this email directly, view it on GitHub https://github.com/rustwasm/gloo/pull/407#issuecomment-1860956385, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAU7OBFZIZDYZX4V4FXTOGDYKBUXHAVCNFSM6AAAAAA74QBS2WVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNRQHE2TMMZYGU . You are receiving this because you authored the thread.Message ID: @.***>

tysen commented 11 months ago

Maybe update the title of the PR now that http has returned?

tysen commented 11 months ago

This all set now?

torokati44 commented 7 months ago

A new release with this (and possibly other, currently open, dependency bump PRs) in it would be greatly appreciated! ^^