Skip to content

Commit 550b2cc

Browse files
committed
docs: rand 0.9 RUSTFLAGS instruction
1 parent 1555e5b commit 550b2cc

File tree

5 files changed

+15
-9
lines changed

5 files changed

+15
-9
lines changed

examples/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ cd examples/todomvc
1515
trunk serve --open
1616
```
1717

18+
Some examples using the `rand` crate require a special rust flag to be enabled:
19+
20+
```bash
21+
RUSTFLAGS='--cfg getrandom_backend="wasm_js"' trunk serve --open
22+
```
23+
1824
Some examples may perform better using the `release` profile. If something is slow, you can try running it with the `--release` argument.
1925

2026
We're also publicly hosting the examples at `https://examples.yew.rs/<EXAMPLE>`.

examples/boids/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,5 @@ The example uses [`gloo::timers`](https://docs.rs/gloo-timers/latest/gloo_timers
2727
Run this application with the trunk development server:
2828

2929
```bash
30-
trunk serve --open
31-
```
30+
RUSTFLAGS='--cfg getrandom_backend="wasm_js"' trunk serve --open
31+
```

examples/function_memory_game/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@ Images are authorized by [@bradlygreen](https://github.com/bradlygreen), see [au
1919
Run this application with the trunk development server:
2020

2121
```bash
22-
trunk serve --open
23-
```
22+
RUSTFLAGS='--cfg getrandom_backend="wasm_js"' trunk serve --open
23+
```

examples/game_of_life/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ You can manually toggle cells by clicking on them or create a random layout by p
1010
This example is quite resource intensive; it's recommended that you only use it with the `--release` flag:
1111

1212
```bash
13-
trunk serve --release
13+
RUSTFLAGS='--cfg getrandom_backend="wasm_js"' trunk serve --release
1414
```
1515

1616
## Concepts
@@ -23,5 +23,5 @@ trunk serve --release
2323
Run this application with the trunk development server:
2424

2525
```bash
26-
trunk serve --open
27-
```
26+
RUSTFLAGS='--cfg getrandom_backend="wasm_js"' trunk serve --open
27+
```

examples/keyed_list/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@ Demonstrates how using keyed elements improves the performance of comparing chan
2323
Run this application with the trunk development server:
2424

2525
```bash
26-
trunk serve --open
27-
```
26+
RUSTFLAGS='--cfg getrandom_backend="wasm_js"' trunk serve --open
27+
```

0 commit comments

Comments
 (0)