API Reference alternera_plugin_lua54 v#0.9.0

Copy Markdown View Source

Modules

The Lua 5.4 step: a Lua 5.4 script with Script's API, run on the request or the response in a fresh WebAssembly instance per call. What it returns goes where its To rows say, as Script's returned value does.

Compiles the Lua 5.4 module once when the package starts (PluginWasmFramework.Modules.load/2): compiling the interpreter takes a few hundred milliseconds, which would otherwise fall on the first step that runs. A module that fails to compile is logged there and fails each step that runs it; the application starts regardless, so the rest of the proxy does.

The Lua 5.4 step's editor: the framework's PluginWasmFramework.StepEditor over Lua54.language/0, and the Help it shows. The colouring is registered by Lua54.EditorMode.

The Lua 5.4 step's colouring in the proxy's code editor: a colocated hook whose module code registers the language "lua54" with the editor when app.js loads (window.AlterneraEditorModes, read by the proxy's assets/js/lua_editor/registered_modes.js), with formatSyntax: "lua54" so Format parses Lua 5.4. The hook itself does nothing and no element uses it.