Skip to content

fix(dependencies): make legacy client build on wasm/fuchsia - #357

Open
seanmonstar wants to merge 1 commit into
masterfrom
sean/ltyqyopsvwpv
Open

seanmonstar wants to merge 1 commit into
masterfrom
sean/ltyqyopsvwpv

Conversation

@seanmonstar

@seanmonstar seanmonstar commented Nov 30, 2026 •

Copy link
Copy Markdown
Member

I was prepping a release and noticed that the previous #341 could be a breaking change to anyone upgrading and suddenly the HttpConnector is 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 HttpConnector and corresponding tokio/net will not be enabled on wasm/fuchsia targets. That should be fine because even before, they couldn't be compiled.

cc @cratelyn

@cratelyn cratelyn left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 HttpConnector and corresponding tokio/net will 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!

Comment thread src/lib.rs
Comment on lines +25 to +27
//! [`Client`][crate::client::legacy::Client] implementation. The built-in
//! `HttpConnector` is available with the `tokio` feature on targets other
//! than Wasm and Fuchsia.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit tioli: it may be easier to phrase this in opposite terms?

Suggested change
//! [`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! 🤷‍♀️

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants