Skip to content

Conversation

@newpavlov
Copy link
Member

Enabling the wasm_js crate feature is sufficient.

@newpavlov newpavlov requested a review from dhardy December 27, 2025 17:55
Copy link
Member

@dhardy dhardy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removal of getrandom_backend="wasm_js" is a breaking change; it makes sense to merge this before 0.4 (I assume this is your intention).

- {
description: Web,
version: stable,
flags: '-Dwarnings --cfg getrandom_backend="wasm_js"',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We still want -Dwarnings (unless substituted below)

# i.e. avoid unconditionally enabling it in library crates.
#
# WARNING: This feature SHOULD be enabled ONLY for binary crates and tests. In other words,
# avoid enabling it in library crates whether unconditionally or gated on a crate feature.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or gated on a crate feature

I see no hard reason not to have a "forwarding" feature flag (e.g. wasm_js = ["getrandom/wasm_js"]).

I know you don't like this pattern, but I don't think directing users like this will work particularly well.

I suggest we keep our advice direct and minimally opinionated:

We recommend against enabling this feature in libraries (except for tests) since it is known to break some non-Web WASM builds and further since the usage of wasm-bindgen causes significant bloat to Cargo.lock (on all targets).

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants