XTend Documentation
Enable dark mode

XTend Developer Center

Build with XTend today

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

OperatorFormAllowed contextsParametersFunctionDiagnosticsRelated operators
kindsurface shell kind pageSurface header, overlay, resourcecatalog value or identifierClassifies a surface, overlay or resource.Surface headers allow only kind and component.component
componentcomponent x-sectionSurface headercustom element name or identifierBinds a host component.Unexpected header clauses are reported.surface
sourcesource selector app.itemsSurface, resourcesource kind and referenceBinds a primitive record as source.Missing references are semantic diagnostics.repeat from
repeat fromrepeat from selector app.itemsSurfacesource referenceCreates repeated surface instances.Repeaters need stable keys.key
keykey item.idSurfacepathDeclares the stable repeater key.Unkeyed repeaters can be blocked.repeat from
boundsbounds x 0 y 0 width 640 height 400Surfacekey/value pairsSets initial geometry.Bounds keys need values.surface
preserve on minimizepreserve on minimizeSurfaceraw clausePreserves surface state when minimized.Only valid in surface.preserve
destroy releasesdestroy releases resource app.streamSurfaceresource referenceBinds surface destroy to resource cleanup.Resource must exist.resource, dispose
lanelane visible weight 80 { ... }Surfacelane name, optional weightGroups scheduled work.Lanes may contain lifecycle or stream only.weight, mount
weightweight 80Lane headernonnegative integerPrioritizes lane work.Weight must be a nonnegative integer.lane
mountmount card from endpoint app.cardLane, slottarget, optional source, condition, policyMaterializes new UI work.Operations may not be top-level.slot, when
hydratehydrate card from selector app.cardLane, slottarget, sourceFills existing UI with data.Source kind must be allowed.hydration policy
suspendsuspend cardLane, slottargetPauses a UI or resource unit.Only valid in lane or slot.resume
resumeresume cardLane, slottargetResumes paused work.Only valid in lane or slot.suspend
invalidateinvalidate cardLane, slottargetMarks work for recomputation.Only valid in lane or slot.update
disposedispose cardLane, slot, resource blocktarget or cleanup textReleases work or a resource.Wrong context is reported.destroy releases
prewarmprewarm data from worker prepareLane, slottarget, sourcePrepares data or UI before it becomes visible.Source kind must be static.worker, idle
recyclerecycle row from resource poolLane, slottarget, sourceReuses existing instances.Resource must exist.resource
detachdetach panelLane, slottargetDetaches a surface unit from the current host context.Only valid in lane or slot.reattach
reattachreattach panelLane, slottargetAttaches a detached unit again.Only valid in lane or slot.detach
streamstream feed from sse app.feedLane, slottarget, sourceDescribes incremental rendering data.stream requires a data source.sse, sanitize
slotslot header { hydrate title from selector app.title }Policy blockslot nameGroups operations in a composition slot.Slots allow only lifecycle or stream.mount, hydrate
resumabilityresumability mode server_prerender_resumePolicy blockmode, snapshot, event replay or integrityDeclares full SSR resumability as a resume handoff.Clauses must be static and use a known resumability axis.hydration mode, resume

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.

surface, portal, source, when, slot, on, resource, trust boundary.

The RMT reference index connects surfaces and lanes with scheduling and lifecycle syntax. Related article

(c) 2026 - CCS Networks | Powered by XRouter PHP Extension