rive_wasm_scripting library

The wasm scripting backend as the editor drives it: a VM booted from a baked module, and hosts that run a stage scripted object on it through the runtime's own ScriptBackend seam. Only available when the native library was built with --scripting_vm=wasm or both; see riveScriptingWasm.

Classes

GamepadWire
A gamepad invocation as the editor's stage sees it.
PathEffectPaint
The paint snapshot a path effect script reads from its node argument.
ScriptDataResult
ScriptedHost
One stage scripted object running on a file's wasm VM. The Dart core object owns it and forwards every protocol call.
WasmNodeSource
The nodes a script reaches on a stage whose shapes live in Dart: a path effect's shape, or the artboard a scripted object lives in, and the nodes reached from them. Ids are the source's own, 0 is none. A path effect's need only hold for the ScriptedHost.pathEffect call that lent the shape; ScriptedHost.setStageNodes lends a source for as long as the host.
WasmScriptingVM
WasmVMBoot
Outcome of WasmScriptingVM.boot: a VM, or the boot error.

Enums

ScriptDataKind
WasmExecutionTier
What a booted module executes on: the interpreter, native code wamrc compiled ahead of time at -O0 or -O3, or the browser's own engine.

Constants

riveScriptingFlavor → const String
Which scripting backend the native library carries, fixed at build time: luau (default), wasm, or both. Every Luau only or wasm only code path branches on these constants so the other backend's bindings are never looked up in a library that does not export them.
riveScriptingLuau → const bool
True when the library links the Luau VM.
riveScriptingWasm → const bool
True when the library links the wasm VM.

Properties

wasmScriptingAvailable → bool
Whether the loaded native library carries the wasm scripting backend.
no setter

Functions

configureWasmAotCompiler({required String wamrcPath, required String cacheDir}) → void
Points the AOT compiler at wamrcPath and the directory its artifacts persist in. An empty wamrcPath falls back to RIVE_WAMRC.
hasPendingWasmAsyncWork() → bool
Whether pollWasmAsyncWork still has work to deliver on this thread: fetches and decodes, and the wasm VMs' held outcomes, lanes, main waits and streams. False with a library built before it.
pollWasmAsyncWork() → void
Delivers async work for every VM on this thread. The editor polls with this only where Luau is not linked.