Nesting & Pipeline
Nesting & safety
Components can use other components. The composer resolves recursively up to 8 levels deep, baking scoped data at each level.
- Tenant isolation — a
useonly resolves within the same tenant. - Circular detection — the composer tracks visited handles and rejects cycles (
A → B → A). - Collision check — duplicate
metadata.nameacross the component library fails at load, never silently at render.
Composition pipeline
1. The document loads
2. Every `use` resolves (recursively, depth-limited) — configuration merges,
per-use data is baked in, section styles are stamped, content assembles
3. Remaining $data / $item tokens resolve with the caller's data
4. Globals ($global.PAGE, …) resolve and the final PDF / DOCX renders
Composition runs before the global data pass, so components can carry $data references that resolve with the caller's data.