Git Product home page Git Product logo

Comments (7)

newpavlov avatar newpavlov commented on June 2, 2024

Optional dependencies by default do not get vendored-in. In a new crate dependent only on getrandom I get 4 crates in the vendor folder: cfg-if, getrandom, libc, and wasi.

from getrandom.

RazrFalcon avatar RazrFalcon commented on June 2, 2024

Ok. My mistake. Then we left with wasm-bindgen which has like 10 dependencies.

from getrandom.

RazrFalcon avatar RazrFalcon commented on June 2, 2024

Wait, so is there a way to remove wasm-bindgen?

from getrandom.

newpavlov avatar newpavlov commented on June 2, 2024

Yes, if the crate feature which does not enable wasm-bindgen is not enabled, then it and all its dependencies should not get vendored (I assume you use cargo vendor). Probably one of your dependencies unconditionally enables this feature (e.g. via rand which in v0.7 forwards the wasm-bindgen feature), so you need to find it and ask for a fix.

from getrandom.

RazrFalcon avatar RazrFalcon commented on June 2, 2024

To be more precise, I'm building the uuid crate with wasm-bindgen feature, to make it work in web. Which pulls wasm-bindgen. Maybe there is a way to avoid it altogether?

from getrandom.

newpavlov avatar newpavlov commented on June 2, 2024

If you don't need UUIDv4 (random UUIDS), simply do not enable wasm-bindgen and v4 features. If you need randomness from browser, then wasm-bindgen is a required dependency. Without it you will not be able to talk with browser environment while using the wasm32-unknown-unknown target.

from getrandom.

RazrFalcon avatar RazrFalcon commented on June 2, 2024

then wasm-bindgen is a required dependency.

I see. This is what I wanted to hear. Thanks.

from getrandom.

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.