Skip to main content

ARC 2.0.0-beta.25

Nodes, values, and sugar

Use readable node sugar for author intent, while knowing the semantic AUP node it compiles into.

DSL node sugar keeps authoring concise; it does not create a separate renderer contract. The compiler lowers common forms into semantic AUP nodes:

DSL formCompiles to
stack, row, grid, cardview
h1, h2, h3, p, badgetext
button, tabaction
repeatafs-list

An inline literal becomes text.content or action.label; key=value supplies properties. Values can be strings, numbers, booleans, null, objects, or arrays. The DSL has compile-time + and * operations and macro substitution; it is not a general JavaScript expression language.

Data, visibility, and events

aup
button rename "Rename" primary ->
  set headline props {content: "Renamed"}

button load "Load" primary ->
  set list src "/modules/index"

from sets src; show if sets visible; and on <event> -> ... can bind an explicitly named event. A bare -> is reserved for the click shorthand on action/button.

show if is presentation control, not authorization. A hidden tree is not an AFS access policy.

Be explicit when another node refers to an ID

The compiler can infer stable IDs when authors omit them. When an event target, patch, test anchor, or another node must name the target, give it an explicit ID. It makes the source easier to review and avoids accidental identity changes during a refactor.

-> page lowers to the current root update { target: "_root", set: { page } }; use the DSL form rather than writing legacy top-level page fields into new source.

For runtime semantic fields, see Nodes, events, and messages. For compile-time components and loops, continue to Components, loops, and i18n.