Help us shape the future of Go! Take the 2026 Go Developer Survey

javyplugin

package
v0.2.50 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: MPL-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package javyplugin vendors the Javy QuickJS plugin used to run JS/TS nano-ops as *dynamically linked* wasm modules.

Background: a self-contained `javy build` module embeds the whole QuickJS engine (~1.25 MB) per op. With dynamic linking the engine lives in ONE shared plugin module and each op compiles to just its own bytecode (~1 KB), importing `invoke`/`cabi_realloc`/`memory` from this plugin's namespace. The op author's build (chassis/cli/op) links against this exact plugin via `-C plugin=`, and the runtime (chassis/compute/wazero) links against the SAME bytes — so the vendored file here is the single source of truth for both sides. They MUST match: a dynamic module's embedded bytecode is specific to the plugin's QuickJS build, and its imports are pinned to the namespace version below.

Regenerate (only when bumping Javy): `javy emit-plugin -o plugin.wasm` with the pinned Javy version, then re-run the op-build tests. Do not hand-edit.

Index

Constants

View Source
const ConfigJSON = `{"event-loop":true}`

ConfigJSON is the SharedConfig the plugin reads from stdin at `initialize-runtime`. The plugin's base config already enables text-encoding, javy-stream-io, and simd-json-builtins; only the event loop is off by default, and our SDK runtime relies on it (top-level `await`). Kebab-case keys per the plugin's config schema.

View Source
const JavyVersion = "8.1.1"

JavyVersion is the Javy toolchain the vendored plugin was emitted from. The op-build path requires a matching `javy` on PATH; mismatches can produce modules whose bytecode the plugin can't decode.

View Source
const Namespace = "javy-default-plugin-v3"

Namespace is the wasm import module name a dynamically linked module uses to reach this plugin (`<dynmod>` imports `Namespace.invoke`, `.cabi_realloc`, and `.memory`). It is version-pinned by Javy; emit-plugin for 8.1.1 yields v3.

Variables

This section is empty.

Functions

func Bytes

func Bytes() []byte

Bytes returns the vendored plugin module. The slice is shared and read-only — callers must not mutate it.

Types

This section is empty.

Jump to

Keyboard shortcuts

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