Skip to main content

Module reducer

Module reducer 

Source
Expand description

The reducer: a surface’s flat component list (A2UI updateComponents, core OR basic catalog OR an extension) → ONE normalized tree in the core vocabulary, macros expanded, every unknown component the explicit Unknown placeholder. Mirrors src/reducer.ts; the fixtures lock it.

Structs§

ReduceOptions
ReduceResult

Constants§

RESERVED_KEYS
The keys of a flat component that are not props (round 1 adds visible).

Functions§

component_issues
VAPP-103 rfix: the issues ONE component raises on its own (an unknown component or basic mapping, its props, visible, children it may not take, slots it lacks): what a streamed updateComponents reports at once while the tree reduces lazily. Tree issues (missing ids, cycles, depth, limits) come with the next reduce. lookup = the surface’s components (a basic component consumes its children).
preorder
Pre-order ids of a tree (slots first, then children), the painters’ accessibility order.
reduce_nested
The nested authoring form → a normalized tree (same validation and expansion as reduce_surface; root_id is ignored).
reduce_surface
Reduce a flat component list. Children resolve from the root down, so components nothing references (a basic Button’s consumed Text child) do not appear. A missing or cyclic reference becomes an Unknown placeholder plus an issue. VAPP-103: an id placed a second time (two parents, or one parent twice) renders at its first place only (id used twice), a node deeper than maxDepth is an Unknown placeholder, and past maxComponents nodes the rest is dropped (catalog/limits.json).
slot_allowed
A component’s slot list admits a name when it lists it or lists *.
valid_visible
A visible value is a boolean or a dynamic value (a binding or a call).