fix(deps): chrono wasmbind feature for WASM compat #84

Merged
zaelgohary merged 1 commit from development_fix_chrono_wasmbind into development 2026-04-20 12:08:10 +00:00
Member

Summary

Fixes the WASM panic time not implemented on this platform that hit Calendar the moment it mounted.

chrono was missing the wasmbind feature, so chrono::Local::now() fell back to std::time::SystemTime::now() which WASM doesn't support. Adding wasmbind routes through js_sys::Date::now() instead.

Changes

  • Cargo.toml (workspace): add "wasmbind" to chrono's feature list.
  • archipelagos/calendar/Cargo.toml: switch from its local chrono = {...} override to chrono.workspace = true (inherits the feature automatically).

Test plan

  • cargo check -p hero_archipelagos_core -p hero_archipelagos_calendar green
  • cargo fmt --check green
  • dx build --package hero_os_app --web succeeds
  • Browser smoke: Calendar mounts and renders a month grid instead of panicking.

Closes #82
Closes lhumina_code/hero_os#51

## Summary Fixes the WASM panic `time not implemented on this platform` that hit Calendar the moment it mounted. chrono was missing the `wasmbind` feature, so `chrono::Local::now()` fell back to `std::time::SystemTime::now()` which WASM doesn't support. Adding `wasmbind` routes through `js_sys::Date::now()` instead. ## Changes - `Cargo.toml` (workspace): add `"wasmbind"` to chrono's feature list. - `archipelagos/calendar/Cargo.toml`: switch from its local `chrono = {...}` override to `chrono.workspace = true` (inherits the feature automatically). ## Test plan - [x] `cargo check -p hero_archipelagos_core -p hero_archipelagos_calendar` green - [x] `cargo fmt --check` green - [x] `dx build --package hero_os_app --web` succeeds - [x] Browser smoke: Calendar mounts and renders a month grid instead of panicking. Closes https://forge.ourworld.tf/lhumina_code/hero_archipelagos/issues/82 Closes https://forge.ourworld.tf/lhumina_code/hero_os/issues/51
fix(deps): chrono wasmbind feature for WASM compat
Some checks failed
Build and Test / build (pull_request) Failing after 11s
9a9965c900
chrono was declared with features = ["std", "clock"] and no "wasmbind".
On wasm32, chrono::Local::now() / Utc::now() then fall back to
std::time::SystemTime::now() — which WASM doesn't implement — and panic
the moment any view calls them. Calendar hits this on mount.

Add "wasmbind" to the chrono workspace entry so all crates pick it up.
Switch the calendar crate from its local chrono override to
chrono.workspace = true so there's one source of truth. js-sys is already
a direct workspace dep so no new bloat.

Closes #82
zaelgohary changed title from WIP: fix(deps): chrono wasmbind feature for WASM compat to fix(deps): chrono wasmbind feature for WASM compat 2026-04-20 12:08:02 +00:00
zaelgohary merged commit bc50d27a8c into development 2026-04-20 12:08:10 +00:00
zaelgohary deleted branch development_fix_chrono_wasmbind 2026-04-20 12:08:15 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lhumina_code/hero_archipelagos!84
No description provided.