RMT Reference: Document, Template and Import
The parser implementation for these forms lives in tools/rmt-language/vnext-parser.js.
This page describes the outer document shape of RMT vNext.
Syntax
Allowed contexts
import, template, surface and remote surface are the normal top-level operators. Primitive declarations may also be top-level, but app sources usually group them in a template.
Parameters
name: qualified identifier such asdocs.shell.remote: static string for package, manifest or remote ID.kindandcomponent: inline attributes for surface type and host component.
Description
An RMT document does not describe imperative execution. It describes records that parsers, compilers, schedulers and host adapters can process.
Examples
import "./shared.rmt"
template reference.document {
portal app.root root "#app" layer surface
surface home kind page component x-section {
portal app.root
lane visible weight 80 {
mount home.content from endpoint app.home
}
}
}
Diagnostics
Unexpected top-level tokens produce syntax diagnostics. Imperative words such as if, for, return or async are rejected intentionally.
Related operators
portal, lane, mount, remote surface, owner team, trust boundary.
Related reading
The RMT reference index connects document, template, and import syntax with the other grammar families. Related article