UI render tree contract
Contract
bus-gx owns the render tree. The first concrete contract is this Core
foundation: Text, Element, Fragment,
Props, VNode, and shared interfaces.
This patch excludes raw content, keyed updates, browser mounting, browser hydration, event handling, lifecycle hooks, and runtime hooks. Those features are rejected during node validation in v0.1.1; the renderer must not ignore them or silently pass them through.
Rendering is escaped and deterministic by default. Text content is escaped by Text, attributes are validated and serialized in stable order by Props, and Element only accepts lowercase HTML-compatible tags from the current allowlist. Raw HTML, inline JavaScript, template execution, shell execution, and untrusted expressions have no node shape in this patch.
Component authors build nodes with the concrete Core shapes:
| Shape | Implementation rule |
|---|---|
| Text | Carries only escaped text content. |
| Element | Uses a lowercase tag, Props, and ordered child nodes. |
| Fragment | Groups ordered child nodes without adding a wrapper. |
| VNode | Stores the normalized immutable node used by renderers and tests. |
| Props | Uses gx.Props entries directly; omitted entries use their zero behavior, and required values must be validated before constructing the node. |
Consequence
Components should return nodes that normalize to VNode before rendering. That keeps server rendering and unit-test inspection on the same tree without adding browser behavior to this patch.