Giter VIP home page Giter VIP logo

Comments (6)

ramosbugs avatar ramosbugs commented on June 2, 2024 1

For ease of use, my original goal was for the feature flags to work as follows:

  • reqwest = reqwest 0.9
  • reqwest + futures-01 = reqwest 0.9
  • reqwest + futures-03 = reqwest 0.10
  • default-features = false + futures-01 = no reqwest dependency
  • default-features = false + futures-03 = no reqwest dependency

Unfortunately, there's no way to specify that in Cargo.toml, which led to the current functionality. At the time, that seemed preferable to exposing reqwest-09 and reqwest-010 as separate feature flags.

However, I'm sympathetic to a desire to avoid code bloat and slower compilation time, so I'm thinking the best way forward is to introduce separate reqwest-09 and reqwest-010 feature flags, and to make up for the additional complexity with better docs. I'll try to get around to that in the next week or so, though I'd also welcome a PR if anyone wants it sooner.

from oauth2-rs.

ramosbugs avatar ramosbugs commented on June 2, 2024

Hi Niko,

Specifying default-features = false on the crate import should remove reqwest and its dependencies. Similarly, not specifying futures-01 or futures-03 will remove all of the async dependencies. The one combination the crate doesn't currently support is futures-03 without reqwest due to limitations in Cargo.toml's format (i.e., not supporting #[cfg(all(feature = "reqwest", feature = "futures-03"))] during dependency computation).

Does that answer your question, or are you still experiencing excessive bloat even without the default features (reqwest) enabled?

from oauth2-rs.

nhellwig avatar nhellwig commented on June 2, 2024

Hi,

thanks a lot for your answer. Yeah I'm using "futures-03" feature. Needed the async stuff because I wrote an implementation for the surf crate. Was using surf already. That's why I wanted to avoid using so many different crates. I get your point.
Do you see a way of solving this? I also get my thinking on it.

Cheers

from oauth2-rs.

vorot93 avatar vorot93 commented on June 2, 2024

I think it would be a shame if this crate bundled a full-featured HTTP client instead of a light wrapper. Reqwest is just fine.

from oauth2-rs.

ramosbugs avatar ramosbugs commented on June 2, 2024

The latest version now supports async/await without reqwest: https://crates.io/crates/oauth2/3.0.0-alpha.7. See updated docs here: https://docs.rs/oauth2/3.0.0-alpha.7/oauth2/

from oauth2-rs.

nhellwig avatar nhellwig commented on June 2, 2024

nice! thanks a lot!

from oauth2-rs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.