Skip to content

feat(client/legacy): HttpConnector is feature flagged - #341

Open
cratelyn wants to merge 1 commit into
masterfrom
kate/wasm-compatible-legacy-client
Open

cratelyn wants to merge 1 commit into
masterfrom
kate/wasm-compatible-legacy-client

Conversation

@cratelyn

@cratelyn cratelyn commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

in #340 (7539356), we addressed warnings in all of the feature combinations. this commit includes further changes building upon that work, to provide a fix for hyperium/hyper#3842.

users building hyper-util for certain platforms were finding that the legacy client was no longer compatible after #218 and #276, which moved the tokio/net feature behind the client-legacy flag. this led to the introduction of a dependency on mio via tokio where there was previously none, breaking builds for Fuschia and Wasm.

this commit introduces a feature flag, client-legacy-http-connector. this commit gates the use of types like tokio::net::TcpStream behind this flag, which end up only being used by the legacy HttpConnector.

this permits use of the legacy client and the connector types for alternative target platforms, while providing a way for typical users to continue to opt into this ergonomic, default connector.

crate-level documentation outlining the list of features is updated to include this feature, and the check-client-features recipe used in CI is updated to include this feature in its exploration space.

to confirm that this works for a platform like wasm, this cargo-hack command can be used:

; cargo hack check --include-features client,client-legacy,http1,http2,client-pool --target=wasm32-wasip2 --feature-powerset

to confirm that other native platforms work, try this:

cargo hack check --include-features client,client-legacy,client-legacy-http-connector,http1,http2,client-pool,tokio --feature-powerset

@cratelyn cratelyn self-assigned this Oct 9, 2026
@cratelyn cratelyn added C-feature Category: feature. This is adding a new feature. A-legacy-client Area: legacy client. labels Oct 9, 2026
in #340 (7539356), we addressed warnings in all of
the feature combinations. this commit includes further changes building
upon that work, to provide a fix for hyperium/hyper#3842.

users building hyper-util for certain platforms were finding that the
legacy client was no longer compatible after #218 and #276, which moved
the `tokio/net` feature behind the `client-legacy` flag. this led to the
introduction of a dependency on `mio` via `tokio` where there was
previously none, breaking builds for Fuschia and Wasm.

this commit introduces a feature flag, `client-legacy-http-connector`.
this commit gates the use of types like `tokio::net::TcpStream` behind
this flag, which end up only being used by the legacy `HttpConnector`.

this permits use of the legacy client and the connector types for
alternative target platforms, while providing a way for typical users to
continue to opt into this ergonomic, default connector.

crate-level documentation outlining the list of features is updated to
include this feature, and the `check-client-features` recipe used in CI
is updated to include this feature in its exploration space.

to confirm that this works for a platform like wasm, this `cargo-hack`
command can be used:

```
; cargo hack check --include-features client,client-legacy,http1,http2,client-pool --target=wasm32-wasip2 --feature-powerset
```

to confirm that other native platforms work, try this:

```
cargo hack check --include-features client,client-legacy,http1,http2,client-pool,tokio --feature-powerset
```

Signed-off-by: katelyn martin <git@katelyn.world>
@cratelyn
cratelyn force-pushed the kate/wasm-compatible-legacy-client branch from 60df174 to 0dbb8bb Compare October 9, 2026 22:26
@cratelyn
cratelyn marked this pull request as ready for review October 9, 2026 22:29

@dswij dswij 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.

Looks great, thanks!

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

A-legacy-client Area: legacy client. C-feature Category: feature. This is adding a new feature.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants