Skip to content

Commit

Permalink
Narrow and document the getrandom js feature usage. (#731)
Browse files Browse the repository at this point in the history
As was pointed out in
[velato#39](linebender/velato#39) this `js`
feature specification can be more narrow than all of `wasm32` and should
also be documented.
  • Loading branch information
xStrom authored Nov 4, 2024
1 parent f24c57e commit 579c84d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion examples/scenes/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }
6 changes: 5 additions & 1 deletion examples/with_winit/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }

0 comments on commit 579c84d

Please sign in to comment.