wasmexec

package
v1.6.0-beta.9 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const FileName = "wasm_exec.js"

FileName is the basename this shim is served under, below /_gothic/.

Variables

View Source
var Shim []byte

Shim is the TinyGo wasm_exec shim served at /_gothic/wasm_exec.js. Slot reclamation in the _values ref table belongs entirely to the TinyGo runtime, whose syscall/js registers real finalizers (finalizeRef).

There is deliberately only ONE shim. An earlier design embedded a second copy carrying manual reclamation (_releaseValue) for toolchains without finalizers and chose between them at request time from an environment variable the CLI set on the server it launched. Any server started outside that path, a plain `go run` against the app or the EMBEDDED single binary, silently got the manual copy: two independent reclaimers then managed the same table and force-freed slots the runtime still tracked. A single shim removes the pairing and with it the possibility of getting the pairing wrong.

Functions

func AssetPath

func AssetPath() string

AssetPath is the URL the per-instance bootstrap fetches, cache-buster included.

func Selected

func Selected() []byte

Selected returns the wasm_exec shim bytes to serve.

func Version

func Version() string

Version returns the shim's content hash: the ?v= cache-buster its URL carries.

This asset is served immutably for a year outside dev, so the ONLY thing that lets a toolchain bump reach a returning browser is the URL changing with the bytes. A bare /_gothic/wasm_exec.js would pin whatever shim a visitor happened to cache, against a core and components that moved on — the shim/runtime mismatch this package's doc describes, except unreachable by any redeploy.

Types

This section is empty.

Jump to

Keyboard shortcuts

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