Skip to main content

Module component

Module component 

Source
Expand description

The LGX component model — the first-class AST for a page, a component, a store, and the sections they own: State: (the record), Actions: (the only mutators, plus the English event sentences that trigger them), View: (the template, already parsed into the view IR), and Style: (the component’s CSS).

Nothing here is desugared: the definition is kept as it was written, and the lowering (parser::lgx_lower) turns it into the page’s LOGOS, which every tier runs — the tree-walker, the VM for WASM and the compiled backends, AOT-Rust for server rendering.

Structs§

ActionDef
To name (params): in Actions:.
ComponentDef
One ## Page / ## Component / ## Store / ## Error page definition.
EventHandler
StateField
Let x be <init>. or Let x always be <expr>. (derived) in a State: section.
StyleBlock
A Style: section: the dedented CSS text, the file offset of its first character, and the indentation stripped from each of its lines.

Enums§

ComponentKind
RouteBody
A ## Route’s body: ordinary statements, or a template for a -> View route. The template is boxed: a ViewDef inline would make every Stmt as wide as a view route.
StoreMode
Trigger
What an English When …: sentence in Actions: waits for.

Constants§

RENDER_DEPTH_LIMIT
How deeply components may nest while one paint is drawn before the page is refused as one with no finite rendering (render_depth_message).
STORE_CASCADE_LIMIT
How many rounds of When <Store>'s <field> changes: may cascade — a watcher’s write waking a watcher, which wakes another — before the page is refused as one that never settles. Every tier counts the same rounds and says the same sentence (store_cascade_message).

Functions§

directive_failure_prefix
What every tier puts in front of a trap inside a ## Directive’s block (removed: its When removed: block): from the page’s side, the directive is what went wrong.
render_depth_message
What every tier says when component is nested past RENDER_DEPTH_LIMIT while drawing.
store_cascade_message
What every tier says of a store-watcher cascade deeper than STORE_CASCADE_LIMIT.
timer_period_not_positive
What every tier says of a timer whose period, as its instance was drawn, is not positive.
typed_fetch_refusal
What every tier says of Get … as <ty> when the derived JSON codec cannot read ty: a typed request decodes its answer through fromJson_<T> for a declared record, fromJsonSeq_<T> for a list of records or scalars, and takes Text verbatim — nothing else.