gridcraft/crates
lloyd e893621d76 Web app: committing a cell no longer traps on the clock
Every edit goes through cmd::commit, which read std::time::Instant::now()
up front for GRIDCRAFT_PROFILE timing, whether profiling was on or not.
wasm32-unknown-unknown has no clock: Instant::now panics there, and with
panic=abort the browser reports `RuntimeError: unreachable`. So in the
web app, typing 1 into A1 and pressing Enter trapped (#118). The native
apps and the CLI have a clock and were unaffected.

commit now reads the clock only when GRIDCRAFT_PROFILE is set, and
never on wasm. The other clock reads (NOW(), the current year for typed
dates, the UI's frame timer) already skip wasm.

Native tests can't see this trap, so clippy.toml now disallows
Instant::now and SystemTime::now. A clock read has to be gated off wasm
and allowed at the call, and `cargo clippy -D warnings` fails on the old
commit code. The existing, already-gated reads and the native-only perf
example allow it.

Checked by building the engine for wasm32-unknown-unknown into a small
cdylib that runs cell.set A1=1 on a new workbook, and running it in
Node: before the fix it traps with `RuntimeError: unreachable`, after
it returns normally.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 09:03:33 +02:00
..
calc Web app: committing a cell no longer traps on the clock 2026-10-10 09:03:33 +02:00
chart Rename SheetCraft to GridCraft everywhere (crates, apps, bundle ids, packaging, docs) 2026-10-06 01:39:08 -04:00
core Web app: committing a cell no longer traps on the clock 2026-10-10 09:03:33 +02:00
engine Web app: committing a cell no longer traps on the clock 2026-10-10 09:03:33 +02:00
formula Rename SheetCraft to GridCraft everywhere (crates, apps, bundle ids, packaging, docs) 2026-10-06 01:39:08 -04:00
functions Rename SheetCraft to GridCraft everywhere (crates, apps, bundle ids, packaging, docs) 2026-10-06 01:39:08 -04:00
mcp Rename SheetCraft to GridCraft everywhere (crates, apps, bundle ids, packaging, docs) 2026-10-06 01:39:08 -04:00
model Rename SheetCraft to GridCraft everywhere (crates, apps, bundle ids, packaging, docs) 2026-10-06 01:39:08 -04:00
numfmt Rename SheetCraft to GridCraft everywhere (crates, apps, bundle ids, packaging, docs) 2026-10-06 01:39:08 -04:00
pdf Rename SheetCraft to GridCraft everywhere (crates, apps, bundle ids, packaging, docs) 2026-10-06 01:39:08 -04:00
ui-egui Web app: committing a cell no longer traps on the clock 2026-10-10 09:03:33 +02:00
xlsx Rename SheetCraft to GridCraft everywhere (crates, apps, bundle ids, packaging, docs) 2026-10-06 01:39:08 -04:00