RMT Reference: Surfaces, Lanes and Lifecycle
tools/rmt-language/vnext-surfaces.js and the scheduler emit the normalized runtime records.
Surfaces describe UI areas. Lanes schedule work. Lifecycle operations describe what happens in a lane.
Syntax
Allowed contexts
lane belongs directly in surface. Lifecycle operations and stream belong in lane or slot. slot, on, trust, hydration, resumability, isolation and sanitize belong in lifecycle policy blocks.
bounds stays pixel-exact by default; responsive bounds are opt-in and accept quoted CSS-native sizes, for example bounds mode responsive scope viewport x "1rem" y "1rem" width "clamp(20rem, 70vi, 52rem)" height "min(80dvh, 42rem)" minWidth "18rem" maxHeight "48rem".
Parameters
Targets are identifiers. Sources follow from <kind> <target>. Conditions follow when. Policy blocks use braces.
Description
Lifecycle syntax separates visible work, user-blocking interaction, background work and diagnostics. The host can map these records to scheduler lanes without executing free functions from the RMT source.
Examples
template reference.lifecycle {
state app.ready type boolean initial true
state app.status type object preserve {
initial {
text "Ready"
}
}
selector app.header from state app.status {
output HeaderView
}
selector app.cardView from state app.status {
output CardView
}
resource app.stream kind stream owner surface.shell
resource app.pool kind object-url owner surface.shell
portal app.root root "#app" layer surface
surface shell kind page component x-section {
portal app.root
bounds x 0 y 0 width 640 height 400
preserve on minimize
destroy releases resource app.stream
lane visible weight 90 {
mount shell.card from endpoint app.card when app.ready == true {
slot header {
hydrate header.view from selector app.header
}
on click ".save" -> action app.save {
payload id from target.dataset.id
preventDefault true
}
}
hydrate shell.card from selector app.cardView {
hydration mode server_prerender_resume
resumability mode server_prerender_resume
resumability snapshot surface_state
resumability event replay intent_queue
resumability integrity signed_manifest
}
suspend shell.card
resume shell.card {
resumability mode server_prerender_resume
resumability snapshot surface_state
resumability event replay intent_queue
resumability integrity signed_manifest
}
invalidate shell.card
dispose shell.card
prewarm shell.data from worker app.prepare
recycle shell.row from resource app.pool
detach shell.panel
reattach shell.panel
stream shell.feed from sse app.feed
}
}
action app.save {
input id string
reduce state.app.status.text = "Saved"
emit app.saved with id input.id
}
}
Diagnostics
Lifecycle and stream statements outside lanes or slots produce context diagnostics. Missing selector, resource or action references are reported semantically.
Related operators
surface, portal, source, when, slot, on, resource, trust boundary.
Related reading
The RMT reference index connects surfaces and lanes with scheduling and lifecycle syntax. Related article