Skip to content

Commit 671e44e

Browse files
committed
chore: upgrade to new version of getrandom
1 parent df7ee20 commit 671e44e

File tree

4 files changed

+13
-1
lines changed

4 files changed

+13
-1
lines changed

Cargo.lock

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@ tokio = { version = "1", default-features = false, optional = true }
3333

3434
# For compiling to wasm:
3535
[target.'cfg(target_arch = "wasm32")'.dependencies]
36-
wasm-bindgen-futures = "0.4.34"
36+
getrandom = { version = "0.3.1", features = ["wasm_js"] }
3737
js-sys = { version = "0.3.69", optional = true }
38+
wasm-bindgen-futures = "0.4.34"
3839
web-sys = { version = "0.3.69", optional = true }
3940

4041
[dev-dependencies]

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
Wrapper around [reqwest][reqwest-url] for ease of use in applications that target BOTH native and wasm but do not want to block in the calling task (eg. A UI thread). Inspired by [ehttp](https://docs.rs/ehttp/0.2.0/ehttp/) but uses [reqwest][reqwest-url] instead. Doesn't provide much value if you're only targeting one or the other because request does that pretty well, see their [wasm example](https://github.com/seanmonstar/reqwest/tree/master/examples/wasm_github_fetch).
44

5+
# WASM Support
6+
7+
When compiling WASM see [getrandom's](https://docs.rs/getrandom/latest/getrandom/#webassembly-support) docs for `RUSTFLAGS` needed
8+
59
## License
610

711
All code in this repository is dual-licensed under either:

bacon.toml

+4
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,9 @@ command = ["cargo", "clippy", "--features=yield_now,egui"]
77
[jobs.test_examples]
88
command = ["cargo", "test", "--features=yield_now,egui", "--examples"]
99

10+
[jobs.wasm]
11+
command = ["cargo", "check", "--target", "wasm32-unknown-unknown"]
12+
env.RUSTFLAGS = '--cfg getrandom_backend="wasm_js"'
13+
1014
[keybindings]
1115
e = "job:test_examples"

0 commit comments

Comments
 (0)