From b0b73f9108c159c43300e35206d709c70ef910e8 Mon Sep 17 00:00:00 2001 From: Kaur Kuut Date: Mon, 4 Nov 2024 11:39:59 +0200 Subject: [PATCH] Narrow and document the `getrandom` `js` feature usage. --- examples/scenes/Cargo.toml | 6 +++++- examples/with_winit/Cargo.toml | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/examples/scenes/Cargo.toml b/examples/scenes/Cargo.toml index 54d6cdd9f..28ca944a6 100644 --- a/examples/scenes/Cargo.toml +++ b/examples/scenes/Cargo.toml @@ -20,5 +20,9 @@ rand = "0.8.5" roxmltree = "0.20.0" [target.'cfg(target_arch = "wasm32")'.dependencies] -getrandom = { version = "0.2.15", features = ["js"] } web-time = { workspace = true } + +[target.wasm32-unknown-unknown.dependencies] +# We have a transitive dependency on getrandom and it does not automatically +# support wasm32-unknown-unknown. We need to enable the js feature. +getrandom = { version = "0.2.15", features = ["js"] } diff --git a/examples/with_winit/Cargo.toml b/examples/with_winit/Cargo.toml index a15585437..cf330c3ee 100644 --- a/examples/with_winit/Cargo.toml +++ b/examples/with_winit/Cargo.toml @@ -69,6 +69,10 @@ console_log = "1.0.0" wasm-bindgen-futures = "0.4.43" web-sys = { version = "0.3.70", features = ["HtmlCollection", "Text"] } web-time = { workspace = true } -getrandom = { version = "0.2.15", features = ["js"] } # If updating, also update in .github/workflows/web-demo.yml wasm-bindgen = "=0.2.95" + +[target.wasm32-unknown-unknown.dependencies] +# We have a transitive dependency on getrandom and it does not automatically +# support wasm32-unknown-unknown. We need to enable the js feature. +getrandom = { version = "0.2.15", features = ["js"] }