Repository navigation
fix(dependencies): make legacy client build on wasm/fuchsia - #357
seanmonstar wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
thank you for doing this! i have one note, and then one question about potential tradeoffs.
This reworks what it tried to do, such that instead of completely putting it behind a new off-by-default feature, we make use of target-dependency conditionals
first, and this is a more superficial concern: the title of this pull request, in tandem with the way that this is phrased feels a little bad, if i can be forthcoming. #341 did make the legacy client build on wasm, i don't believe it "tried to" do that. as currently written, and i don't think it was intentional, the title of this pull request effectively takes credit for the work already done in #341.
to be clear, i don't consider changing that phrasing a blocking concern with respect to landing this particular change. i note it because this sort of experience might make other future contributors feel bad, which is the part i really care about.
refactor(deps): replace client-legacy-http-connector feature might be an alternate phrasing that focuses more tightly on the mechanical change being made here.
The
HttpConnectorand correspondingtokio/netwill not be enabled on wasm/fuchsia targets. That should be fine because even before, they couldn't be compiled.
i think this is a fine change to make. i think it might be helpful to say aloud the tradeoffs we are making here, since #341 and #357 each provide wasm support in different ways, each with their own benefits and drawbacks.
doing things this way avoids the imposition of any additional legacy client feature flags. hyper-util exists to house interfaces that are considered less stable than those in hyper, which provides us better semver stability. the legacy client comes from hyper 0.14 however, and is provided by hyper-util to help users upgrade to newer client interfaces at their own pace. so while we may have a comparatively higher (i.e. any) appetite for breaking changes in this library, avoiding changes to the legacy client's feature flags seems like a nice benefit!
the drawback here is that a feature flag (client-legacy) now has different behavior depending on the platform it is compiled on. this isn't typically the case, as feature flags are often exposed by libraries for the very purpose of avoiding compilation errors caused by these sorts of platform- or architecture-specific concerns. but again, this is for a single type in a "legacy" subsystem, so we have different criteria here! so, conservatively preserving the existing legacy client feature flags strikes me as a nice alternative approach.
i confirmed that the newer feature resolver is supported across our MSRV range, so requiring resolver = "2" seems fine. i am not immediately aware of any use-cases in which someone would need to use the previous feature resolver, so i don't expect this to pose any problems.
thanks for taking the time to write this!
| //! [`Client`][crate::client::legacy::Client] implementation. The built-in | ||
| //! `HttpConnector` is available with the `tokio` feature on targets other | ||
| //! than Wasm and Fuchsia. |
There was a problem hiding this comment.
nit tioli: it may be easier to phrase this in opposite terms?
| //! [`Client`][crate::client::legacy::Client] implementation. The built-in | |
| //! `HttpConnector` is available with the `tokio` feature on targets other | |
| //! than Wasm and Fuchsia. | |
| //! [`Client`][crate::client::legacy::Client] implementation. The built-in | |
| //! `HttpConnector` is not available on Wasm and Fuchsia. |
it's fine either way though! 🤷♀️
I was prepping a release and noticed that the previous #341 could be a breaking change to anyone upgrading and suddenly the
HttpConnectoris no longer compiled in.This reworks what it tried to do, such that instead of completely putting it behind a new off-by-default feature, we make use of target-dependency conditionals. The
HttpConnectorand correspondingtokio/netwill not be enabled on wasm/fuchsia targets. That should be fine because even before, they couldn't be compiled.cc @cratelyn