Skip to content

fix: restore browser wasm build without sqlite persistence#9

Merged
manuelmauro merged 1 commit into
mainfrom
fix/wasm-no-persistence
May 6, 2026
Merged

fix: restore browser wasm build without sqlite persistence#9
manuelmauro merged 1 commit into
mainfrom
fix/wasm-no-persistence

Conversation

@manuelmauro
Copy link
Copy Markdown
Owner

Summary

  • restore wasm32-unknown-unknown builds by removing SQLite and filesystem deps from the browser target
  • use an in-memory persistence fallback on wasm while keeping native SQLite persistence unchanged
  • add wasm packaging coverage to CI and pin wasm-bindgen-cli in release builds

Changes

  • move dirs and rusqlite behind cfg(not(target_arch = "wasm32"))
  • enable browser RNG support for wasm via getrandom's wasm_js feature
  • add a wasm Database implementation backed by in-memory settings/score history
  • make GameSettings, ScoreRecord, and ScoreHistory clonable for the wasm fallback
  • add a CI job that builds release wasm, runs wasm-bindgen, and smoke-tests the packaged web bundle
  • pin wasm-bindgen-cli in release workflow to match the project's wasm-bindgen version

Validation

  • cargo check
  • cargo check --target wasm32-unknown-unknown
  • cargo build --target wasm32-unknown-unknown
  • local release-style wasm packaging smoke test

@manuelmauro manuelmauro merged commit 68c8d5b into main May 6, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant