plexus_ui_engine/lib.rs
1//! UI-6: **the engine** — the host interface `engine/1` of UI-4's contract.
2//!
3//! The engine owns what lives across swaps: the socket, the cache, the
4//! signals, the registry. A component owns only its tree and its folds; it
5//! never touches the DOM, the socket or another component.
6//!
7//! | module | what it holds |
8//! |---|---|
9//! | [`signals`] | a signal runtime: [`signals::Signal`], bindings re-run only when a signal they read changes |
10//! | [`tree`] | the compiled view tree (UI-4's schema), its interpreter over a [`tree::Renderer`]; the recording renderer (native tests) and, with `dom`, the DOM one |
11//! | [`live`] | `live()`: a collection `{ rows, status }` folded from a snapshot and a changes stream, shared by method and params, kept 5 s past its last reader |
12//! | [`folds`] | a component's handlers in Rhai — `(state, event) → state`, only `call` and `navigate` registered, `call` held to the component's `uses` |
13//! | [`swap`] | the bundle's manifest, the module registry (name → hashes), mounting, hot-swap, and the sections (slots and their assignments) |
14//! | [`html`] | UI-10: `{@html}` and `markdown()` — an allow-list sanitizer to a tree the renderer draws |
15//! | [`router`] | `manifest.routes`: a hash route to a component, its `:name` segments the props |
16//! | [`transport`] | the wire seam ([`transport::Wire`]): the one socket on wasm32, a fake for the tests |
17//! | [`bus`] | FRAME-12: what every mounted component is handed — `call` and `live` held to its `uses`, `emit` / `on`, `navigate`, `slots_set` |
18//! | [`keys`] | FRAME-36: every mounted component's shortcuts — chords and sequences, matched on the window's capture phase, the `?` overlay |
19//! | [`marks`] | FRAME-17: the host's steps on the page's clock, `performance.mark` `plexus-ui:*` |
20//! | [`module`] | FRAME-12: the module contract every profile implements, `mount(target, { props, bus }) → { update, destroy }` |
21//!
22//! FRAME-12 cuts it in two: the **host** — [`transport`], [`live`],
23//! [`swap`] (versions, hot-swap, sections), [`router`], [`bus`],
24//! [`module`] and the signals they publish on — and the **rhx runtime**,
25//! the first profile (`rhx/1`): [`tree`], [`folds`], [`html`]. A module of
26//! any other profile is an ES module the page imports; `js/host.js` is the
27//! host's JS face, beside `engine.js` in every bundle.
28//!
29//! The wasm entry (`boot`) is [`entry`], behind the `dom` feature.
30
31pub mod signals;
32pub mod tree;
33pub mod live;
34pub mod folds;
35pub mod swap;
36pub mod router;
37pub mod html;
38pub mod transport;
39pub mod bus;
40pub mod keys;
41pub mod module;
42pub mod marks;
43
44#[cfg(all(target_arch = "wasm32", feature = "dom"))]
45pub mod entry;
46#[cfg(all(target_arch = "wasm32", feature = "dom"))]
47pub mod host_js;
48#[cfg(all(target_arch = "wasm32", feature = "dom"))]
49pub mod frame;
50
51/// The host interface this engine implements; a manifest's `abi`.
52pub const ABI: &str = "engine/1";