Expand description
Rux script tier, milestone M8.
Wraps a rhai engine that holds the app’s live state (the script’s top-level
let variables persist in a Scope) and evaluates {{ }} bindings,
r-if/r-for expressions, and @tap handlers against it. Native
capabilities are exposed under the host:: namespace via the builder.
This replaces the M5 signal reader and the M6 inline-expression evaluator
with a real scripting language: named fn handlers, full expressions, and
the compiled-Rust boundary (docs/04-architecture.md, script/host tiers).
Structs§
- Builder
- Builds an
Engine: register host functions, thenbuildwith the script. Host functions must be registered before the script runs, since the script may call them during initialization. - Engine
- A live script engine: state in
scope, script functions infuncs.
Enums§
- Nav
- One navigation asked for by a script: where to go, or which way along the history that has already been walked.
Constants§
- CAN_
BACK_ SIGNAL - Whether there is anywhere to go back to, and anywhere to go forward to.
Signals rather than functions, because what they are for is disabling a
button, and a button’s
:classreads signals. - CAN_
FORWARD_ SIGNAL - PARAMS_
SIGNAL - The signal holding what the matched route captured, as a map, so
{{ params.id }}works anywhere and not only inside the matched view. - QUERY_
SIGNAL - The signal holding the query string, parsed, as a map.
- ROUTER_
SIGNALS - Every name the router provides. A script declaring one of these is warned.
- ROUTE_
SIGNAL - The signal the router keeps the current path in. Reserved: a document that declares it is warned rather than quietly overwritten.
Functions§
- parse_
query - Parse
a=1&b=twointo pairs, undoing percent-encoding. - percent_
decode - Percent-decode, treating
+as a space the way a query string does. - set_
routes - Tell the script tier what the document’s named routes are. Replaces the previous set, since a reload may have changed them.
- set_
stderr_ echo - Stop (or resume) mirroring warnings to stderr.
- split_
query - Split a location into its path and its query string.
- take_
emissions - Take the events emitted since the last call, emptying the sink.
- take_
navigations - Take the navigations asked for since the last call, emptying the sink.
- take_
warnings - Take the expression failures raised since the last call, emptying the sink.
- warn_
script - Raise a script warning from outside the engine.