wasm

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package wasm provides WASM component helpers for Vango.

Deprecated: The v1 Developer Guide exposes WASM components via `el.WASMComponent`. This package is retained for legacy/internal use only.

WASM components run client-side and communicate with the server via message passing.

Usage (v1 canonical):

Div(
	WASMComponent("canvas", map[string]any{"tool": "pen"}),
)

Client modules are loaded from /js/wasm/<id>.js by default unless overridden with WASMModule. Modules should export a mount(el, props, api) function that can optionally return {update, destroy, onMessage}.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SendToWASM

func SendToWASM(id string, payload any)

SendToWASM sends a message to the client-side WASM component.

func SetupOnWASMMessage

func SetupOnWASMMessage[P any](s *vango.SetupCtx[P], id string, handler func(vango.WasmMessage))

SetupOnWASMMessage registers a handler for messages from the WASM component during Setup. This is the spec-aligned Setup-only variant.

func WASMComponent

func WASMComponent(id string, props any) []vdom.Attr

WASMComponent marks an element as a WASM component boundary. For custom module paths, set WASMModule on the same element.

func WASMModule

func WASMModule(path string) vdom.Attr

WASMModule overrides the default module path for a WASM component.

Types

This section is empty.

Jump to

Keyboard shortcuts

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