Skip to content

runtime: implement WebAssembly/ESM integration for .wasm imports - #35587

Open
robobun wants to merge 9 commits into
mainfrom
farm/dd4bd17b/wasm-esm-integration
Open

runtime: implement WebAssembly/ESM integration for .wasm imports#35587
robobun wants to merge 9 commits into
mainfrom
farm/dd4bd17b/wasm-esm-integration

address review: dedup watcher, zero-copy disk read, wasm→JS imports t…

48260d5
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed Jul 25, 2026 in 27m 22s

Code review found 8 potential issues

Found 1 candidates, confirmed 8. See review comments for details.

Details

Severity Count
🔴 Important 0
🟡 Nit 7
🟣 Pre-existing 1
Severity File:Line Issue
🟡 Nit src/runtime/jsc_hooks.rs:3277-3292 L::Wasm error paths skip watcher registration; --watch won't reload after fixing a bad wasm file

Annotations

Check warning on line 3292 in src/runtime/jsc_hooks.rs

See this annotation in the file changed.

@claude claude / Claude Code Review

L::Wasm error paths skip watcher registration; --watch won't reload after fixing a bad wasm file

`auto_watch_asset()` runs only after `check_magic(&bytes)?` passes (and not at all on the disk-read `Err` arm), so under `bun --watch` a truncated/mid-write `.wasm` file errors with "missing magic header" but is never registered with the watcher — fixing the file won't trigger a reload. The JS parse path in this same function explicitly registers on parse failure (jsc_hooks.rs:2582-2591, "Register with watcher even on parse failure"), and pre-PR the `L::Wasm` → `_` fallthrough called `auto_watch