Documentation
¶
Overview ¶
Command wasm is the DART-03 WEB front door: a standard-Go GOOS=js GOARCH=wasm module that registers a JS-global `pressRender` calling the SAME pure-Go bind/capi/core.RenderJSON seam (07-01) the cgo shim (bind/capi) calls. It is a SEPARATE package main from bind/capi because cgo and GOOS=js GOARCH=wasm are mutually exclusive build modes (RESEARCH Pitfall 1): the browser target cannot link the cgo `//export` glue, so the web boundary re-exposes the identical JSON entrypoint over syscall/js instead.
Compiled with standard Go (the resolved decision -- NOT TinyGo; TinyGo's partial reflection is a correctness risk against goldmark/yaml.v3, and no TinyGo precedent exists for the full press dependency chain). The whole file is gated behind `//go:build js && wasm`, so it is excluded from the host `go build ./...` / `go vet ./...` / `go test ./...` builds and only compiles under GOOS=js GOARCH=wasm.
Build it with scripts/build-wasm.sh (which also copies the version-pinned wasm_exec.js loader); exercise the compiled artifact with bind/wasm/smoke/smoke.mjs under Node.