RMT Reference: Primitives
Primitives sind die stabilen App-Platform-Records in RMT vNext.
Syntax
Allowed contexts
Primitives dürfen top-level, im template und teilweise in primitive-scoped Surfaces stehen. Sie deklarieren Records; sie führen keinen Host-Code aus.
Parameters
Die wichtigsten Parameter sind Identifier, Source-Referenzen, Typnamen, Katalogwerte und statische Strings.
Description
Primitives bilden die Brücke zwischen RMT-Authoring und Core-Format. Sie werden zu State-, Selector-, DataSource-, Action-, Portal-, Overlay-, Resource-, Validation-, Transition- und Surface-Records kompiliert.
Examples
template reference.primitives {
state app.status type object preserve {
initial {
text "Ready"
}
}
selector app.statusView from state app.status {
output StatusView
}
datasource app.messages from endpoint "/api/messages" {
method GET
result list
fallback fixture messages.fallback
}
action app.refresh {
input id string
status app.status
reduce state.app.status.text = "Loading"
emit app.refreshed with id input.id
}
portal app.root root "#app" layer surface
overlay app.toast kind toast portal app.root
resource app.timer kind timer owner surface.home {
dispose clear
}
validation app.form {
mode blocking
target action app.refresh
field app.email required email message "Valid email"
}
animation app.motion {
effect pop
durationMs 180
reducedMotion fade
}
transition app.next {
trigger action app.refresh
from surfaces [home]
to surfaces [done]
use animation app.motion
effect fade
durationMs 120
easing "ease-out"
interrupt replace
reducedMotion fade
lane transition
}
surface home kind card component x-status {
portal app.root
lane visible weight 80 {
hydrate status.card from selector app.statusView
}
}
}
Diagnostics
Fehlende Owner, unbekannte Referenzen, unkeyed Repeater und Actions ohne Reducer oder Payload-Vertrag werden semantisch gemeldet.
Related operators
template, surface, lane, from, when, payload, trust boundary.
Weiterführend
Der RMT-Referenzindex zeigt, an welchen Stellen Primitive Records in einem Dokument zulässig sind. Verwandter Artikel