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§
- Action
Def To name (params):inActions:.- Component
Def - One
## Page/## Component/## Store/## Error pagedefinition. - Event
Handler - State
Field Let x be <init>.orLet x always be <expr>.(derived) in aState:section.- Style
Block - A
Style:section: the dedented CSS text, the file offset of its first character, and the indentation stripped from each of its lines.
Enums§
- Component
Kind - Route
Body - A
## Route’s body: ordinary statements, or a template for a-> Viewroute. The template is boxed: aViewDefinline would make everyStmtas wide as a view route. - Store
Mode - Trigger
- What an English
When …:sentence inActions: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: itsWhen removed:block): from the page’s side, the directive is what went wrong. - render_
depth_ message - What every tier says when
componentis nested pastRENDER_DEPTH_LIMITwhile 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 readty: a typed request decodes its answer throughfromJson_<T>for a declared record,fromJsonSeq_<T>for a list of records or scalars, and takes Text verbatim — nothing else.