Document format
A self-contained document is XML source plus an optional JSON data record.
Quick reference
| Syntax | Behavior |
|---|---|
source | Required XML string with one rendered root. |
data | Read-only root record; defaults to {}. |
format | Optional integer; defaults permanently to 1. Unsupported explicit formats fail before mount. |
id / revision | Optional metadata for the host to track. The engine ignores these fields. |
UI | Optional document wrapper for definitions and exactly one rendered root. |
Example
<UI>
<Component name="Greeting" props="name"><Text bind-text="props.name" /></Component>
<Greeting bind-name="data.name" />
</UI>
Supply {"name":"Relo"} as the document’s data.
Rules and validation
Source without definitions can use its rendered root directly. A standalone definition is not mountable.
Definitions are direct UI children and cannot shadow installed components. Duplicate names, unknown
syntax/props, malformed XML, and reachable missing registrations fail preparation. Unused definitions
are syntax-checked. Component namespaces are authoring syntax. Run
relo-components build before passing that source to a client. The resulting
document includes the component definitions needed to mount.
Component authoring and assembly.
Unknown envelope metadata is ignored, but removed entry, requires, and envelope props fields
are rejected. Explicit source replacement resets document state; a compatible data update preserves
instances. JSON data must be a record. Bindings preserve evaluated JSON types.
Limits
Expressions are bounded; the shared evaluator allows 100,000 work units and checks its execution
budget. Collection/string expansion and XML parsing also have limits. Treat limitExceeded as an
error and use host fallback; do not use documents as an unbounded compute or background-work system.