fix: update BattleGrid rand migration#34
Conversation
28f3ade to
527e98d
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 28f3adea01
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| thiserror = "=2.0.18" | ||
| anyhow = "=1.0.102" | ||
| rand = "=0.8.5" | ||
| rand = "=0.9.2" |
There was a problem hiding this comment.
Enable wasm RNG support for rand 0.9
When building the browser/WASM package, this version bump makes battleground-core pull rand_core 0.9 and getrandom 0.3, but crates/battleground-wasm only enables the old getrandom 0.2 js feature. The Docker build runs wasm-pack build crates/battleground-wasm --target web, and getrandom 0.3 does not support wasm32-unknown-unknown by default without its wasm_js backend/feature, so the WASM/client build regresses even though native Rust checks can still pass.
Useful? React with 👍 / 👎.
527e98d to
7653fa9
Compare
- Move workspace rand to 0.9.2 and update renamed API calls. - Enable getrandom 0.3 support for the WebAssembly build. - Add seeded map-generation coverage and dependency notes. Tests: ./scripts/cargo-safe.sh fmt --check Tests: ./scripts/cargo-safe.sh clippy --workspace -- -D warnings Tests: ./scripts/cargo-safe.sh test --workspace Tests: wasm-pack build crates/battleground-wasm --target web Tests: node scripts/ci/require-tests-and-docs.mjs
786c284 to
7c936ae
Compare
What
randdependency from 0.8.5 to 0.9.2.Cargo.lockto remove the old rand 0.8 line.Why
How
random,random_range, andrngin place of the deprecatedgen,gen_range, andthread_rngAPIs.Cargo.lockchanged only because the workspace rand pin moved to 0.9.2 and the old rand 0.8 transitive entries were removed.Testing
CARGO_TARGET_DIR=/tmp/battlegrid-rand-target ./scripts/cargo-safe.sh fmt --checkCARGO_TARGET_DIR=/tmp/battlegrid-rand-target ./scripts/cargo-safe.sh clippy --workspace -- -D warningsCARGO_TARGET_DIR=/tmp/battlegrid-rand-target ./scripts/cargo-safe.sh test --workspace./scripts/client-safe.sh tsc -b./scripts/client-safe.sh eslint ../scripts/client-safe.sh vitest run./scripts/client-safe.sh vite build./scripts/client-safe.sh playwright test --config=playwright.config.tsdid not run locally because this Homebrew Rust install is missing thewasm32-unknown-unknowntarget required by the Playwright web server build.Performance Impact
Risk / Notes