Skip to main content

Documents and delivery

Before you start: deliver a document.

A document is source + data. Source is XML; data is a JSON record available as read-only data in the document root scope.

{"source":"<Text bind-text=\"data.title\" />","data":{"title":"A change of scenery"}}

source is required. data defaults to an empty record. The optional format defaults permanently to 1; an unsupported explicit format fails before mounting.

One rendered root​

A simple document uses its rendered root directly. Use UI when including definitions:

<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.

Definitions do not render by themselves. UI contains definitions followed by exactly one rendered invocation. Components receive explicit props and do not implicitly capture the document's data.

Assemble on the server​

Use your backend's normal modules and composition tools. The delivered response includes the definitions it needs; the client doesn't resolve template imports or download component packages. The Components CLI can assemble transitive definitions for you.

Update data or replace the document​

Use a session's updateData to replace root data while preserving compatible local state. Use explicit document replacement when source changes. The engine ignores document revisions. Your host can track them for diagnostics.

Keep compatibility and HTTP caching separate from UI identity. See delivery and rollout for cache partitioning, fallback, and client capabilities.