fret-platform-web 0.1.0

Web platform integration for Fret on wasm32 targets.
Documentation

fret-platform-web

Browser/wasm32 platform services used by the Fret runtime.

This crate is expected to be used from crates/fret-runner-web (or other wasm runners) to satisfy fret-runtime::Effects that require browser APIs (timers, file inputs, IME bridges, etc.).

It intentionally does not implement input/event mapping; use winit (or another runner) for that layer.

Module ownership map

  • src/wasm/mod.rs: wasm32 WebPlatformServices facade and effect dispatcher.
  • src/wasm/ime.rs: IME textarea bridge and debug snapshot plumbing.
  • src/wasm/timers.rs: timer wiring (set/cancel/collect fired tokens).
  • src/wasm/file_dialog.rs: file input + read-all plumbing for FileDialog* effects.
  • src/native/mod.rs: non-wasm stub types to keep cross-target builds explicit.
  • src/lib.rs: cfg-based module selection + public re-exports.

Public surface

On wasm32, fret_platform_web re-exports the wasm implementation. On non-wasm targets, it re-exports stub types that report “wasm32 only”.

Refactor gates

  • Formatting: cargo fmt
  • Native build check: cargo nextest run -p fret-platform-web --no-tests pass
  • Wasm build check: cargo check -p fret-platform-web --target wasm32-unknown-unknown