Skip to content

Integrate WASM Compilation Target for Browser Play #49

Description

@Mkalbani

Description

Configure the quest-rust project to compile to WebAssembly so the game can run in a browser environment without any server-side execution. This dramatically expands reach — players who do not want to install a Rust binary can play directly in the browser. The WASM build should expose a clean JavaScript API wrapping the core session, puzzle, scoring, and hint modules, with the TUI layer replaced by a JS-driven frontend.

Acceptance Criteria

  • wasm-bindgen and wasm-pack are added and configured in Cargo.toml with a [lib] target
  • A wasm feature flag gates WASM-specific code paths to avoid breaking the native build
  • wasm-pack build --target web produces a valid pkg/ output with .wasm and JS bindings
  • Exported JS functions cover: startSession(puzzleId), submitAnswer(answer), revealHint(), getScore(), endSession()
  • std::time is replaced with web-sys time APIs under the wasm feature flag
  • File I/O in the persistence module is replaced with localStorage access under the wasm feature flag
  • A minimal index.html demo in web/ loads the WASM module and runs a complete puzzle session in the browser
  • CI builds both cargo build (native) and wasm-pack build to prevent regressions on either target

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial Campaign | FWC26Campaign: Official Campaign | FWC26

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions