docs: rand 0.9 RUSTFLAGS instruction

This commit is contained in:
Matt Yan 2025-03-03 04:51:04 +09:00 committed by Siyuan Yan
parent 1555e5b4c6
commit 550b2ccf25
5 changed files with 15 additions and 9 deletions

View File

@ -15,6 +15,12 @@ cd examples/todomvc
trunk serve --open
```
Some examples using the `rand` crate require a special rust flag to be enabled:
```bash
RUSTFLAGS='--cfg getrandom_backend="wasm_js"' trunk serve --open
```
Some examples may perform better using the `release` profile. If something is slow, you can try running it with the `--release` argument.
We're also publicly hosting the examples at `https://examples.yew.rs/<EXAMPLE>`.

View File

@ -27,5 +27,5 @@ The example uses [`gloo::timers`](https://docs.rs/gloo-timers/latest/gloo_timers
Run this application with the trunk development server:
```bash
trunk serve --open
```
RUSTFLAGS='--cfg getrandom_backend="wasm_js"' trunk serve --open
```

View File

@ -19,5 +19,5 @@ Images are authorized by [@bradlygreen](https://github.com/bradlygreen), see [au
Run this application with the trunk development server:
```bash
trunk serve --open
```
RUSTFLAGS='--cfg getrandom_backend="wasm_js"' trunk serve --open
```

View File

@ -10,7 +10,7 @@ You can manually toggle cells by clicking on them or create a random layout by p
This example is quite resource intensive; it's recommended that you only use it with the `--release` flag:
```bash
trunk serve --release
RUSTFLAGS='--cfg getrandom_backend="wasm_js"' trunk serve --release
```
## Concepts
@ -23,5 +23,5 @@ trunk serve --release
Run this application with the trunk development server:
```bash
trunk serve --open
```
RUSTFLAGS='--cfg getrandom_backend="wasm_js"' trunk serve --open
```

View File

@ -23,5 +23,5 @@ Demonstrates how using keyed elements improves the performance of comparing chan
Run this application with the trunk development server:
```bash
trunk serve --open
```
RUSTFLAGS='--cfg getrandom_backend="wasm_js"' trunk serve --open
```