wasm

command
v0.3.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 17, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Rendered for js/wasm

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL