Skip to content

getrandom_backend="wasm_js" without wasm_js feature #877

Closed as not planned
Closed as not planned

Description

@tarcieri

Currently if you want to use getrandom_backend="wasm_js" you also have to enable the wasm_js crate feature.

It seems there is a general desire to phase out the wasm_js feature. I was wondering if it would be possible for getrandom_backend="wasm_js" to be used without enabling the crate feature, just gating things as e.g. any(feature = "wasm_js", cfg(getrandom_backend="wasm_js")).

Activity

  1. newpavlov commented on Nov 6, 2026

    @newpavlov
    Member

    getrandom_backend="wasm_js" has no effect since v0.3.4 and it's no longer listed as an opt-in backend. In a future release I personally would love to move Web WASM backend out of getrandom proper using EII (ideally, into wasm-bindgen/js-sys), but I can't say that we have a consensus here.

    I was wondering if it would be possible for getrandom_backend="wasm_js" to be used without enabling the crate feature

    The problem is that we have to add the necessary dependencies. Adding flag-based cfgs to getrandom's Cargo.toml would unconditionally bloat Cargo.lock for all downstream users.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions