tower-rs / tower-http

HTTP specific Tower utilities.
675 stars 156 forks source link

Minimize futures crates dependency #436

Closed tottoto closed 9 months ago

tottoto commented 9 months ago

Feature Request

Motivation

Allows users to depend on the minimum dependencies which are actually used.

Proposal

Changes tower-http to depends on futures-core and futures-util when they are actually needed, especially about the latter. This includes porting BoxFuture to tower-http's code. This proposal's drawback is increasing the maintenance cost to control the crates condition, and the profit can be affected by the other dependencies.

Alternatives

Keeps depending on futures-util.

jplatte commented 9 months ago

Can we close this as done in #434? All remaining uses of the futures crate are in examples, which only matters for users that copy-paste those examples, and we have #435 for it.

tottoto commented 9 months ago

What I tried to discuss the future crates is that futures-* crates family. For examples, regarding compression feature, tower-http seems not to need to use futures-util and can use futures-core directly instead.

jplatte commented 9 months ago

Oh, okay! In that case, disregard my comment. I'd be happy to merge a PR that implements that change and similar ones.