wasm

command
v1.14.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2023 License: Apache-2.0 Imports: 23 Imported by: 0

README

WebAssembly zed Package

This package provides zed's functionality via a WebAssembly interface, for use with browser-based tooling.

Warning The WebAssembly development interface is not stable and subject to change between versions of zed.

Generating WebAssembly

GOOS=js GOARCH=wasm go build -o main.wasm

Testing

go install github.com/agnivade/wasmbrowsertest@latest
GOOS=js GOARCH=wasm go test ./... -exec $(go env GOPATH)/bin/wasmbrowsertest

Integrating with the browser

To see an example of invoking the WebAssembly based interface:

  1. Build main.wasm and copy into the example directory.
  2. Copy https://github.com/golang/go/blob/master/misc/wasm/wasm_exec.js into the example directory
  3. Run an HTTP server over the example directory and visit wasm.html:
python3 -m http.server

Documentation

Rendered for js/wasm
The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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