Repository navigation
v0.7.0 — one name for each thing, colors as values, and data reads that are checked
0.7 is a naming release. Every name the platform puts in a program's scope is now
capitalized and is one of four kinds: a class (Button), a type (Stroke,
Color, Easing), a service (Clipboard, Keyboard) or a theme (SanFrancisco).
The platform adds no lowercase names of its own, so every lowercase word in a program is the
program's. Where the platform builds or works on a value, it does so through the value's
type: Stroke(1, red), Gradient.linear(…), VisualFilter.blur(3), Easing.steps(4),
Color.mix(a, b, 0.5).
card: View [ width = 160, height = 90, cornerRadius = 12,
fill = { Gradient.linear("90deg", Gradient.stop(0, #2E6FE0), Gradient.stop(1, #7B4FE0)) },
stroke = Stroke(1, #1D3F86), shadow = Shadow(0, 2, 10, #00000033),
visualFilter = [VisualFilter.blur(0)] ]
Alongside it, a pass over names that read like something else: a change is handed back to
commit(v) on every class that hands one back, every overlay opens with show, showFor and
showAt, a replicated record's identity is identityKey, and abbreviations are spelled out.
A Color is now one thing, a number in the runtime's encoding, and two colors compare with
==. Text becomes a color only where the program says so, with Color.from(s), and
Color.hex(c) turns one back into text. Data schemas keep JSON's field types, so a color in
data is a string like any other.
A :path read inside { } now has its field's type, so :done * 2 or a string headed for a
color is refused where it is written. And change handlers hear every change in a settle: a
settle runs in rounds, and nothing paints until a round assigns nothing.
The flagship calendar is 177.9 KB gzipped at this tag.
Breaking: 28 changes to make — npx declare-changes app.declare lists the ones in your program.
Breaking changes
stroke(…), shadow(…) and the gradient builders → on their types: Stroke(…), Shadow(…), Gradient.linear(…)
A builder belongs to the type it builds, and is spelled the same in a bare value and inside
{ }. gradient, radialGradient, conicGradient and colorStop are now Gradient.linear,
Gradient.radial, Gradient.conic and Gradient.stop.
Find: /(?<![\w.$])(?:stroke|shadow|gradient|radialGradient|conicGradient|colorStop)\(/
card: View [ width = 120, height = 80, stroke = stroke(1, #1D3F86), shadow = shadow(0, 2, 8, #00000033),
fill = { gradient("90deg", colorStop(0, #2E6FE0), colorStop(1, #7B4FE0)) } ]
card: View [ width = 120, height = 80, stroke = Stroke(1, #1D3F86), shadow = Shadow(0, 2, 8, #00000033),
fill = { Gradient.linear("90deg", Gradient.stop(0, #2E6FE0), Gradient.stop(1, #7B4FE0)) } ]
Docs: Paint and themes · Stroke · Gradient
Watch for: a drawing's own d.stroke() and d.shadowBlur are the canvas context's and keep their names. The lowercase names are free for a program's own members.
The filter builders → VisualFilter.blur(…) and the rest; ImageFilter and FilterList → VisualFilter
Each filter is built through its type, as a stroke or a gradient is: VisualFilter.blur,
.brightness, .contrast, .saturate, .grayscale, .invert, .sepia, .hueRotate,
.colorize and .frost. The types ImageFilter and FilterList are one name, VisualFilter
(and VisualFilter[]), as the attribute is visualFilter.
Find: /[=\[,(]\s*(?:blur|brightness|saturate|grayscale|invert|sepia|hueRotate|colorize|frost)\s*\(|:\s*(?:ImageFilter|FilterList)\b/
card: View [ width = 120, height = 80, fill = #2E6FE0, visualFilter = [blur(4), brightness(0.8)] ]
card: View [ width = 120, height = 80, fill = #2E6FE0, visualFilter = [VisualFilter.blur(4), VisualFilter.brightness(0.8)] ]
Docs: Paint and themes · View.visualFilter
Watch for: a CSS filter string a drawing hands its context (d.filter = "blur(4px)") is the canvas's own and is unchanged.
The easing builders → Easing.steps(…) and the rest; EasingCurve → Easing
steps, cubicBezier, back and laszlo are built through Easing, and a built curve and a
named one (quadOut) are one type, Easing: easing = quadOut and easing = { Easing.steps(4) }
are values of the same type.
Find: /(?<![\w.$])(?:steps|cubicBezier|laszlo)\(|:\s*EasingCurve\b/
spin: Animator [ attribute = rotation, to = 360, duration = 800, easing = { cubicBezier(0.2, 0, 0, 1) } ]
spin: Animator [ attribute = rotation, to = 360, duration = 800, easing = { Easing.cubicBezier(0.2, 0, 0, 1) } ]
Docs: Motion · Easing
Watch for: back(…) is Easing.back(overshoot); it is not searched for here, since back is a common word.
colorWithAlpha(c, 0–255) → Color.withAlpha(c, 0–1); activeTone retired
A color's operations live on Color, and alpha is written as CSS writes it, from 0 to 1: the
old alpha divided by 255 (255 → 1, 128 → 0.5, 90 → 0.35, 64 → 0.25, 40 → 0.16). Beside
it: Color.mix(a, b, t), Color.lighter(c, k) and Color.darker(c, k) (in OKLCH),
Color.contrast(a, b) (the WCAG ratio) and Color.components(c). activeTone(accent, surface)
was a mix: it is Color.mix(surface, accent, 0.22).
Find: /\b(?:colorWithAlpha|activeTone)\s*\(/
veil: View [ width = 200, height = 120, fill = { colorWithAlpha(app.accent, 128) } ]
veil: View [ width = 200, height = 120, fill = { Color.withAlpha(app.accent, 0.5) } ]
Docs: Paint and themes · Color
Watch for: the alpha's scale. A value carried over unchanged (128) is far past 1 and is held at fully opaque; divide it by 255.
hostProvided(name, fallback) → app.hostProvided(name, fallback)
A value the host provides is the program's, the same from every node, so it is read from the
App. afterDelay, afterSettle and providedTextStyle are now methods of every node, so a
bare call in a body is unchanged, and row.afterDelay(…) works too.
Find: /(?<![\w.$])hostProvided\s*\(/
App [ program: string = { hostProvided("program", "") } ]
App [ program: string = { app.hostProvided("program", "") } ]
Docs: Embedding
Focus [ … ], Tooltips [ … ] and Keyboard [ … ] listeners → facts
What these relayed is now a fact to read: app.focusedView (the focused view, or null),
View.containsFocus (true while the focus is on the view or anything inside it),
app.focusGeometry (the focused control's outline) and app.tooltipRequest (the tooltip a
view is asking for). A fact is read by a constraint and heard by onChange. Focus and
Keyboard remain services (Focus.focus(v), Focus.holds(v)), not classes to place.
Find: /\b(?:Focus|Tooltips|Keyboard)\s*\[/
panel: View [ width = 240, height = 120,
Focus [ onFocusChange(v: View) { app.panel.lit = Focus.holds(app.panel) } ],
lit: boolean = false, fill = { this.lit ? #EEF4FF : #FFFFFF } ]
panel: View [ width = 240, height = 120, fill = { this.containsFocus ? #EEF4FF : #FFFFFF } ]
Docs: App.focusedView · View.containsFocus · Pointer and keyboard
Numerals → NumeralStyle (and numerals → numeralStyle); Axis → LayoutAxis
The shape of the digits pairs with numeralWidth; a layout's axis type is named for layouts,
leaving Axis free for a chart's. axis = y is written as before. Percent is internal: it
is how 50% is held, not a name a program writes.
Find: /\bnumerals\s*=|:\s*(?:Numerals|Axis|Percent)\b/
total: Text [ numerals = oldstyle, text = "1,234" ]
total: Text [ numeralStyle = oldstyle, text = "1,234" ]
Docs: Text
A color in a data schema → a string, read with Color.from(s)
A data schema's field types are JSON's: string, number, boolean, any, a schema, a literal union
or a nested record. A field typed Color is refused, as one typed Length is. A color in data
is text like any other, and becomes a color where the program says so: Color.from(s) reads
"#RGB", "#RRGGBB" or "#RRGGBBAA" (or gives null), and Color.hex(c) writes one back.
Find: /schema\s+\w+\s*\[[^\]]*:\s*Color\b/
schema Label [ name: string, tone: Color ]
schema Label [ name: string, tone: string ]
Docs: Schemas · Color
Watch for: a string in a color slot is refused with the fix, Color.from(s). A record built by
the program with a color in it holds the text the service expects: Color.hex(c).
Change handlers hear every change in a settle
A settle runs in rounds: constraints come to rest, then afterSettle steps, then change
events, and whatever a step or handler assigns is settled in the next round. Nothing paints
until a round assigns nothing. A handler is told, each round, every tracked value that differs
from what it was last told. Before, a handler heard each value once per chain, so a second
change in the same settle (a focus that moved twice) was missed.
App [ query: string = "", trackChanges = ["query"],
onChange(name: string) { app.query = app.query.trim() } ]
App [ typed: string = "", query: string = { app.typed.trim() } ]
Docs: Constraints
Watch for: a handler that assigns a value it tracks is refused at compile time where the
trackChanges list and the handler show it (x = …, this.x = …, app.x = … on the App).
A settle still going after 100 rounds stops with an error that names the handlers.
blend → blendMode
A view's compositing operator is named the way CSS (mix-blend-mode), Canvas and design tools name it: a blend mode.
Find: /\bblend\s*=(?!=)/
chip: View [ width = 40, height = 40, fill = #CC3344, blend = multiply ]
chip: View [ width = 40, height = 40, fill = #CC3344, blendMode = multiply ]
Docs: Paint and themes · View.blendMode
Watch for: a { } body that reads .blend on a view — it is .blendMode now, and the compiler names it there.
Text.outline → textStroke, built with Stroke(width, color)
A stroke along the glyphs' edges is the same width-and-color value as a box's stroke, so it takes that value, built with Stroke(…), and sits with its siblings textColor, textFill and textShadow; the outline() constructor is gone.
Find: /\boutline\s*=(?!=)|\boutline\s*\(/
Text [ fontSize = 28, textColor = white, outline = outline(1, #C0392B), text = "ringed" ]
Text [ fontSize = 28, textColor = white, textStroke = Stroke(1, #C0392B), text = "ringed" ]
Docs: Text · Text.textStroke
Watch for: a style bundle, a textStyles record or a drawing's text style that names outline — the field is textStroke there too. outline is no longer reserved, so a member of your own may take the name.
stretches → fit on Image and Video
How a picture meets its box is its fit, as CSS's object-fit says; the values (none, width, height, both, cover, contain) are unchanged.
Find: /\bstretches\s*=\s*(?:none|width|height|both|cover|contain|\{)/
Image [ width = 120, height = 120, source = "logo.png", stretches = cover ]
Image [ width = 120, height = 120, source = "logo.png", fit = cover ]
Docs: Media · Image.fit · Video.fit
Watch for: a { } body that reads .stretches on an Image or Video — it is .fit now.
onDblClick → onDoubleClick
The double-click event is spelled out, as React spells it, so the handler reads as what it answers; the event itself is doubleClick. Nothing about when it fires changes: a view that declares it still hears the first click at once and the second as onDoubleClick, and a double tap on a touch device is one too.
Find: /\bonDblClick\b/
row: View [ width = 200, height = 32, fill = #EEF1F4, onDblClick(e: PointerEvent) { this.opacity = 0.5 } ]
row: View [ width = 200, height = 32, fill = #EEF1F4, onDoubleClick(e: PointerEvent) { this.opacity = 0.5 } ]
Docs: Pointer and keyboard · View.onDoubleClick
Watch for: a method still named onDblClick compiles, but as an ordinary method that nothing calls — the compiler warns (DECLARE4019) and names onDoubleClick. The verify driver's drive.dblclick(path) and look --dblclick keep their names: they are Playwright's, and they make the gesture rather than name the event.
Animator.motion → easing
The curve a timed run follows is its easing, the word CSS, design tools and every animation library use; motion read as the whole movement rather than its shape. It changes on Animator and AnimatorGroup (where members still inherit the group's), and in a scroll glide's options. The tokens (cubicOut and the rest) are unchanged; the built curves are Easing.cubicBezier(…), Easing.back(…), Easing.steps(…) and Easing.laszlo(…).
Find: /\bmotion\s*=\s*(?:linear|ease|quad|cubic|quart|quint|sine|expo|circ|back|laszlo|steps)|\bmotion\s*:\s*"/
View [ width = 200, height = 40,
slide: Animator [ attribute = x, to = 160, duration = 400, motion = cubicOut, started = true ],
onClick() { this.scrollToX(240, { duration: 260, motion: "cubicOut" }) } ]
View [ width = 200, height = 40,
slide: Animator [ attribute = x, to = 160, duration = 400, easing = cubicOut, started = true ],
onClick() { this.scrollToX(240, { duration: 260, easing: "cubicOut" }) } ]
Docs: Motion and states · Animator.easing · AnimatorGroup.easing · Easing
Watch for: a { } body that reads .motion on an animator — it is .easing now, and the compiler names it there. The curve's type is named for it too: Motion and MotionCurve are both Easing, so a body that annotates a curve (const c: Motion = …) takes the new names.
App.navigate(to) → openURL(to)
The method leaves the app for another address — another site, or another program — and navigate read as in-app routing, which is what a web or React developer expects it to do. openURL says what it does and pairs with openWindow. Moving between the app's own places is unchanged: write app.location, or give a view a link.
Find: /\bapp\.navigate\b/
Text [ text = "Declare on GitHub", onClick() { app.navigate("https://github.com/") } ]
Text [ text = "Declare on GitHub", onClick() { app.openURL("https://github.com/") } ]
Docs: URLs, links and history · Embedding · App.openURL
Watch for: app.navigate(…) is refused, and the message names openURL and app.location. An island's onNavigate(n: IslandNavigation) and boot({ onNavigate }) keep their names: they are the host's side of the same call, and they now receive a program's openURL(to) and openWindow(to). A class of your own that declares a method named navigate is unaffected.
input(v) → commit(v) on every class that hands a change back
One name for where the person's change goes: the value controls already took it in commit(v), and now every other library class that hands a change back does too — Segmented and TabBar, TextSizeSwitch, AppearanceSwitch, Disclosure, Tree, Table and DataGrid, Carousel, Splitter, ToolButton, Breadcrumb, Window, and every overlay (Popover, Dialog, Sheet, Menu, ContextMenu, Toast, Tooltip, and a Floating of your own). What the class delivers is unchanged: a Segmented's value, a Disclosure's open, a Table's selection, an overlay's shown.
Find: /\b(?:{Floating}|{Window}|{Segmented}|{Disclosure}|{Table}|{Tree}|{Carousel}|{Splitter}|{ToolButton}|{AppearanceSwitch}|{Breadcrumb})\s*\[(?:[^\[\]]|\[(?:[^\[\]]|\[[^\[\]]*\])*\])*?\binput\s*\(/
App [ editing: boolean = false, page: string = "general",
TabBar [ value = { app.page }, input(v: string) { app.page = v },
choices = { [ ({ id: "general", label: "General" }), ({ id: "privacy", label: "Privacy" }) ] } ],
Sheet [ accessibilityLabel = "Edit", shown = { app.editing }, input(open: boolean) { app.editing = open } ]
]
App [ editing: boolean = false, page: string = "general",
TabBar [ value = { app.page }, commit(v: string) { app.page = v },
choices = { [ ({ id: "general", label: "General" }), ({ id: "privacy", label: "Privacy" }) ] } ],
Sheet [ accessibilityLabel = "Edit", shown <-> app.editing ]
]
Docs: Controls · Menus and overlays · Floating.commit · Segmented.commit · Table.commit
Watch for: a constrained attribute with input(…) beside it (shown = { app.editing }, input(open: boolean) { … }) is refused — the class now wants commit(…) beside it, and the message says to rename it. An input(…) on one of these classes with nothing constrained compiles, but as an ordinary method nothing calls — the compiler warns (DECLARE4042) and names commit. A call of your own, app.tabs.input("b") or super.input(open), is refused and named the same way. <-> now works on all of these classes, not only on value controls: Segmented [ value <-> app.mode ], Disclosure [ open <-> app.more ], Popover [ shown <-> app.editing ], Table [ selection <-> app.chosen ]. Tree's second hook is not commit: applyExpanded(ids) delivers expanded, as DataGrid's applySort, applyColumnOrder, applyColumnWidth and applyEdit deliver theirs (each renamed from its …Input name, below). A class of your own that extends Control with a hook it named input keeps it — rename it to commit if it should read like the library's.
openFor(v) → showFor(v), openAt(v, e) → showAt(v, e), and ContextMenu.open(v, e) → showAt(v, e)
Every overlay opens with one family of verbs — show(), showFor(v), showAt(v, e) — where a menu had a second family of its own. A Menu's showFor(v) drops it below v, flipping above when there is no room, as openFor did; showAt(v, e) opens it at the pointer, as openAt and ContextMenu.open did. Dialog.open(title, message, …) keeps its name: it opens a dialog with content.
Find: /\.open(?:For|At)\s*\(|\.open\s*\(\s*[\w.]+\s*,\s*e\s*\)/
App [ width = 300, height = 160,
sort: Menu [ items = { [ ({ id: "date", label: "Date" }), ({ id: "name", label: "Name" }) ] } ],
rowMenu: ContextMenu [ items = { [ ({ id: "delete", label: "Delete" }) ] } ],
b: Button [ x = 20, y = 20, label = "Sort", onClick() { app.sort.openFor(this) } ],
View [ x = 20, y = 70, width = 200, height = 40, fill = #EEF1F4,
onContextMenu(e: PointerEvent) { app.rowMenu.open(this, e) },
onHold(e: PointerEvent) { app.rowMenu.openAt(this, e) } ]
]
App [ width = 300, height = 160,
sort: Menu [ items = { [ ({ id: "date", label: "Date" }), ({ id: "name", label: "Name" }) ] } ],
rowMenu: ContextMenu [ items = { [ ({ id: "delete", label: "Delete" }) ] } ],
b: Button [ x = 20, y = 20, label = "Sort", onClick() { app.sort.showFor(this) } ],
View [ x = 20, y = 70, width = 200, height = 40, fill = #EEF1F4,
onContextMenu(e: PointerEvent) { app.rowMenu.showAt(this, e) },
onHold(e: PointerEvent) { app.rowMenu.showAt(this, e) } ]
]
Docs: Menus and overlays · Menu.showFor · Menu.showAt · ContextMenu
Watch for: menu.showFor(btn) now places the menu below btn — it used to be Floating's, which opened a menu wherever it last stood, so a menu shown that way and then moved by hand now lands below its opener first. A menu opened with show() is still not placed. openFor, openAt and a ContextMenu's open are refused, and the message names showFor or showAt. A Menu or ContextMenu subclass of your own that overrode openFor, openAt or open overrides showFor or showAt now.
The Blend type → BlendMode
The type of a view's blendMode is named after it, as Easing is the type of easing; the tokens (multiply, screen, colorDodge, …) are unchanged.
Find: /:\s*Blend\b(?!Mode)/
App [ mode: Blend = "multiply", View [ width = 40, height = 40, fill = #CC3344, blendMode = { app.mode } ] ]
App [ mode: BlendMode = "multiply", View [ width = 40, height = 40, fill = #CC3344, blendMode = { app.mode } ] ]
Docs: Paint and themes · BlendMode
Watch for: only a declaration or a { } body that names the type changes; blendMode = multiply is written as before.
A view's filter → visualFilter
A view's effect chain (a blur, a brightness, a shadow of its painted alpha) is named for what it is, which leaves filter to mean what an app means by it: the filter on a list, a filter() method of its own. backdrop keeps its name.
Find: /(?<![\w.$])(?<!(?:let|const|var)\s+)filter\s*(?:=(?!=)|<->)/
card: View [ width = 120, height = 80, fill = #2E6FE0, filter = [blur(4), brightness(0.8)] ]
card: View [ width = 120, height = 80, fill = #2E6FE0, visualFilter = [VisualFilter.blur(4), VisualFilter.brightness(0.8)] ]
Docs: Paint and themes · View.visualFilter
Watch for: a { } body that reads .filter on a view — it is .visualFilter now, and the compiler names it there. A drawing's d.filter keeps its name: it is the canvas context's own. filter is no longer a view's, so a member of your own may take the name — filter: string = "open" on the App, or a filter(…) method.
Segmented.choices → items, on TabBar and TextSizeSwitch too
A segmented control's segments are records, as a Menu's, a Tree's, a Combobox's and a DataGrid's are, so they take the name those take.
Find: /\b{Segmented}\s*\[(?:[^\[\]]|\[(?:[^\[\]]|\[(?:[^\[\]]|\[[^\[\]]*\])*\])*\])*?\bchoices\s*(?:=|<->)/
App [ page: string = "general",
TabBar [ width = 240, value <-> app.page,
choices = { [ ({ id: "general", label: "General" }), ({ id: "privacy", label: "Privacy" }) ] } ]
]
App [ page: string = "general",
TabBar [ width = 240, value <-> app.page,
items = { [ ({ id: "general", label: "General" }), ({ id: "privacy", label: "Privacy" }) ] } ]
]
Docs: Controls · Segmented.items · TabBar
Watch for: a { } body that reads .choices on a segmented control — it is .items now, and the compiler names it there. A class of your own that extends Segmented and declared its own items collides with it now. choices stays an ordinary name everywhere else.
Table.selected → selectedItem, Table.active → activeItem, on DataGrid too
A table's selection and keyboard position hold records, while every other selected and active — a TableRow's, a tab's, a stream's — is a boolean; the table's now say what they hold, beside selection and activeIndex.
Find: /\b{Table}\s*\[(?:[^\[\]]|\[(?:[^\[\]]|\[(?:[^\[\]]|\[[^\[\]]*\])*\])*\])*?\b(?:selected|active)\s*(?:=(?!=)|<->)/
App [ d: Dataset { { "rows": [ { "id": 1, "label": "Ada" }, { "id": 2, "label": "Grace" } ] } },
chosen: object = null,
t: Table [ width = 200, height = 80, datapath = { app.d.value }, selected = { app.chosen },
commit(sel: object) { app.chosen = sel != null && sel.length > 0 ? sel[sel.length - 1] : null },
TableRow [ datapath = :rows[], height = 26, Text [ x = 8, text = :label ] ] ],
Text [ y = 100, text = { app.t.active != null ? "on " + app.t.active.label : "" } ]
]
App [ d: Dataset { { "rows": [ { "id": 1, "label": "Ada" }, { "id": 2, "label": "Grace" } ] } },
chosen: object = null,
t: Table [ width = 200, height = 80, datapath = { app.d.value }, selectedItem = { app.chosen },
commit(sel: object) { app.chosen = sel != null && sel.length > 0 ? sel[sel.length - 1] : null },
TableRow [ datapath = :rows[], height = 26, Text [ x = 8, text = :label ] ] ],
Text [ y = 100, text = { app.t.activeItem != null ? "on " + app.t.activeItem.label : "" } ]
]
Docs: Collections · Table.selectedItem · Table.activeItem
Watch for: a handler that moves the keyboard itself — app.list.active = rows[j] beside activeIndex = j — writes activeItem now; the compiler names it. A TableRow's own selected and active are unchanged: they are its booleans, and a row's fill = { selected ? … } reads them as before. A class of your own that extends Table and declared a selected or active of its own keeps it, no longer shadowing the table's.
DataGrid.headerH → headerHeight, Segmented.segMin → segmentMinWidth, Button.inkColor → ink
Abbreviations spelled out, and a button's one ink named as the ink of a segment, a tree row, a menu bar and an icon already is.
Find: /\b(?:headerH|segMin|inkColor)\b/
App [ col: View [ layout: SimpleLayout [ axis = y, spacing = 8 ],
DataGrid [ width = 300, height = 120, headerH = 34, columns = { [ { id: "title", title: "Title" } ] } ],
Segmented [ segMin = 72 ],
Button [ label = "Delete", inkColor = #C0392B ] ] ]
App [ col: View [ layout: SimpleLayout [ axis = y, spacing = 8 ],
DataGrid [ width = 300, height = 120, headerHeight = 34, columns = { [ { id: "title", title: "Title" } ] } ],
Segmented [ segmentMinWidth = 72 ],
Button [ label = "Delete", ink = #C0392B ] ] ]
Docs: DataGrid.headerHeight · Segmented.segmentMinWidth · Button.ink
Watch for: a Button subclass that declared an ink of its own collides with the button's now. Each old name is refused, and the message names the new one.
DataGrid's sortInput, arrangeInput, resizeInput, editInput and Tree.expandInput → applySort, applyColumnOrder, applyColumnWidth, applyEdit, applyExpanded
The person's request — a sort, a column dragged to a new place or width, an edited cell, rows opened and closed — lands in one hook whose default carries it out and whose override changes how; each is named for what it applies. The parameters and the behaviour are unchanged, and applyEdit returning false still means "not now".
Find: /\b(?:sortInput|arrangeInput|resizeInput|editInput|expandInput)\b/
App [ d: Dataset { { "rows": [ { "id": 1, "title": "Fix the rail" } ] } },
sortOn: string = "", sortDir: string = "", saved: string = "",
DataGrid [ width = 300, height = 120, items = { app.d.value.rows },
columns = { [ { id: "title", title: "Title", width: 240, edit: true } ] },
sortOn = { app.sortOn }, sortDir = { app.sortDir },
sortInput(on: string, dir: string) { app.sortOn = on; app.sortDir = dir },
editInput(record: object, field: string, value: string) -> boolean { app.saved = value; return false } ]
]
App [ d: Dataset { { "rows": [ { "id": 1, "title": "Fix the rail" } ] } },
sortOn: string = "", sortDir: string = "", saved: string = "",
DataGrid [ width = 300, height = 120, items = { app.d.value.rows },
columns = { [ { id: "title", title: "Title", width: 240, edit: true } ] },
sortOn = { app.sortOn }, sortDir = { app.sortDir },
applySort(column: string, direction: string) { app.sortOn = column; app.sortDir = direction },
applyEdit(record: object, field: string, value: string) -> boolean { app.saved = value; return false } ]
]
Docs: Collections · DataGrid.applySort · DataGrid.applyEdit · Tree.applyExpanded
Watch for: an override under an old name still compiles, but as an ordinary method nothing calls — the sort, the drag or the edit goes through the default instead, and the compiler warns (DECLARE4042) and names the new hook. A call of your own, app.grid.resizeInput("title", 150) or super.editInput(…), is refused and named the same way. A method of that name on a class that is no DataGrid or Tree is left alone.
Internal now: Control.rightIcon, Segmented.count, idx, lane and segW, Menu.checkW, textEdge and widestLabel
These were the classes' own arithmetic — the right-hand icon the control settles on, the segmented pill's place and width, the menu's column metrics — and read like settings. They are internal now, out of the reference; what they were derived from is still there to read.
Find: /\.(?:rightIcon|segW|checkW|textEdge|widestLabel)\b/
App [ seg: Segmented [ width = 240, choices = { [ ({ id: "a", label: "A" }), ({ id: "b", label: "B" }) ] } ],
View [ y = 40, height = 2, fill = #2E6FE0, width = { app.seg.segW } ]
]
App [ seg: Segmented [ width = 240, items = { [ ({ id: "a", label: "A" }), ({ id: "b", label: "B" }) ] } ],
View [ y = 40, height = 2, fill = #2E6FE0, width = { app.seg.width / app.seg.items.length } ]
]
Docs: Control.iconRight · Segmented · Menu
Watch for: segW was renamed and made internal in one step (_segmentWidth), as was checkW (_checkWidth): both are arithmetic only the class reads. A read of any of the old names is refused, and the message names what to read instead — items.length for count, value for idx and lane, iconRight for rightIcon. A Menu's kind row still begins at the menu's text edge without reading it.
key → identityKey, a replicated record's identity
The field a replicated row follows when it is not the record's id is named for what it is. key was replication metadata wherever an element was used, so no class could have an attribute called key — not a shortcut's key, not a record's key, not a map's. identityKey takes over that one job, and key is an ordinary name again. The record's id is still the identity with nothing declared.
Find: /(?<![\w.$])key\s*=\s*:/
App [ d: Dataset { { "items": [ { "sku": "A-1", "name": "Lamp" }, { "sku": "B-2", "name": "Desk" } ] } },
list: View [ datapath = { app.d.value }, layout: SimpleLayout [ axis = y, spacing = 4 ],
Text [ datapath = :items[], key = :sku, text = :name ] ]
]
App [ d: Dataset { { "items": [ { "sku": "A-1", "name": "Lamp" }, { "sku": "B-2", "name": "Desk" } ] } },
list: View [ datapath = { app.d.value }, layout: SimpleLayout [ axis = y, spacing = 4 ],
Text [ datapath = :items[], identityKey = :sku, text = :name ] ]
]
Docs: Collections · View.identityKey
Watch for: a program that still writes key = :sku on a replicated node is refused, and the message names the fix with your field — identityKey = :sku. key is now free for your own data: a class may declare key: string and a use may set it, key = :key on a replicated row included, with nothing reserved and no hint. identityKey is View's now, so a class of your own that declared an identityKey collides with it.
Inline views come from a tagViews map
A tag inside Markdown or HTMLText content builds a view only when the rich text's tagViews map names it: tagViews = { { Chip: Chip } }, then <Chip label='docs'/>. Before, any tag spelled like one of the program's view classes built that class, so content from elsewhere (a post, a comment) could build any of them. Now the map is the list of what content may build, and with no map no tag is a view. The map is inherited like tagStyles, so one entry on the App covers every rich text below; the key is the tag as the content writes it and the value is the class, so { ticket: IssueChip } is allowed too.
class Chip [ label: string = "", height = 19, width = 60, fill = #DDF4E4 ]
App [ width = 380, height = 60,
HTMLText [ html = "Filed under <Chip label='docs'/> today." ]
]
class Chip [ label: string = "", height = 19, width = 60, fill = #DDF4E4 ]
App [ width = 380, height = 60, tagViews = { { Chip: Chip } },
HTMLText [ html = "Filed under <Chip label='docs'/> today." ]
]
Docs: Text · RichText.tagViews
Watch for: a tag spelled exactly as one of your classes, with no map entry, now renders as text and says so once at run time, naming the entry to add. A map value must be a view class written as its name (Chip, not "Chip"); anything else is refused at its line. use [ Chip ] is no longer needed to keep an inline view's class in a production build: the map names it. The warning for a class named like an HTML tag (class code) is gone, since such a class no longer takes the tag over.
pointerEvents = "none" switches off everything inside
pointerEvents = "none" now reaches a view's whole subtree: nothing inside it takes a press, hover or cursor, a control's own insides included (a Combobox's field). A view below it that says "auto" switches its own part back on. Before, "none" applied to the one view, and a child with a handler kept taking presses; on the page, "auto" also forced a view to catch presses it had no handler for, which it no longer does.
dock: View [ width = 390, height = 76, pointerEvents = "none",
add: Control [ x = end, width = 56, height = 56, press() { } ] ]
dock: View [ width = 390, height = 76, pointerEvents = "none",
add: Control [ x = end, width = 56, height = 56, pointerEvents = "auto", press() { } ] ]
Docs: View.pointerEvents
Watch for: a strip or layer that lets presses through and holds a button needs "auto" on the button. Overlays (menus, popovers, dialogs, toasts) switch themselves back on inside their layers.
RangeSlider's value is one record, { low, high }
RangeSlider is a value control: its value is the range as one record, and commit(v) receives it, as every value control's does. So in a Form it takes name, required and validate. low and high remain readable, derived from the value.
Find: /RangeSlider\s*\[[^\]]*?\b(low|high)\s*=|commit\(\s*\w+\s*:\s*number\s*,\s*\w+\s*:\s*number\s*\)/
RangeSlider [ low = { app.lo }, high = { app.hi },
commit(low: number, high: number) { app.lo = low; app.hi = high } ]
RangeSlider [ value = { { low: app.lo, high: app.hi } },
commit(v: object) { app.lo = v.low; app.hi = v.high } ]
Docs: RangeSlider
Watch for: low and high are read-only now; set the range through value.
New
A color is a value; text becomes one with Color.from
A Color is a number in the runtime's encoding, so two colors compare with ==. Inside { }
a color may be written as a literal, "#RRGGBB", "#RRGGBBAA" or a CSS name ("royalblue"),
beside 0x…; the compiler turns each into its number, and a misspelled name is a type error.
Text from anywhere else (data, a field the person typed in) is not a color until the program
reads it as one: Color.from(s) gives the color it writes, or null, and Color.hex(c) gives
the text back. Arithmetic on a color is refused with the operations to use instead.
swatch: View [ width = 40, height = 40, fill = { Color.from(:tone) ?? #CCCCCC },
stroke = { Stroke(1, Color.darker(Color.from(:tone) ?? #CCCCCC, 0.2)) } ]
Docs: Color · Paint and themes
A :path read inside { } has its field's type
Names read through : were already checked against the schema; now each read has the field's
type too, so :done * 2 (a boolean in arithmetic) or fill = { :tone } (text headed for a
color) is refused where it is written. An optional field reads as T | null | undefined, so the
type check asks for a fallback. Data of no declared shape stays unchecked. The check adds
nothing to the running program: every program that compiled before compiles to the same output.
Text [ text = { (:note ?? "no note").toUpperCase() } ]
Docs: Schemas
app.unsavedChanges
A fact the program states. While it is true, leaving the page asks first (the browser's own
question), and on the Mac the window shows the edited mark and closing it or quitting asks.
App [ unsavedChanges = { app.doc.dirty } ]
Docs: App.unsavedChanges
minScale and maxScale
The range a view's scale stays in, as minWidth and maxWidth bound a width: a scale
written or computed outside it is held at the nearer bound. How the scale changes (a pinch,
buttons) is still the program's. The touch-target check judges a control inside such a view at
its largest scale.
Docs: Touch
app.fullScreen
Whether the app fills the screen, both ways: it reads true while it does and false when the
person leaves, and writing it asks to enter or leave. A browser enters full screen only in answer
to a press, so write it from one.
Button [ label = { app.fullScreen ? "Exit full screen" : "Full screen" },
onClick() { app.fullScreen = !app.fullScreen } ]
Docs: App.fullScreen
Tables and grids
- A DataGrid selects first, then edits. A press selects a cell; Enter, F2 or a second press
enters it, with its text selected, so typing replaces it; Escape or Enter leaves it, and Tab
moves a cell along, wrapping at the row's ends. A column may name aneditor:besidecell:,
the class a cell becomes while it is edited. Accents and input methods compose natively. Table.selectAll(), and ⌘A or Ctrl+A in a table that allows more than one.DataSource.errorSchema: a refusal's body declared, typed and checked, asschemais
for a value.- A class can say which record it stands on:
record: Seatchecks the class's:reads
againstSeat, and each use site must stand on records with its fields.
Docs: Collections · DataGrid.columns
Forms, files and dialogs
Segmentedis a form field: in aFormit takesname,requiredandvalidate, and a
Fieldaround it names it.TabBarandTextSizeSwitchfollow.FilePicker.savesaves through the platform's own panel.destructive: trueon aDialogbutton record gives its label the theme's error color.Toast.clearance: how far above the bottom of its layer a toast sits, so a program with
a bar along its foot raises it clear.
Docs: Form · Dialog · Toast
Accessibility
- Roles
menuItemRadio,meterandcontentinfo;Gaugeis ameter. accessibilityCurrent: a view says it is the current page, step, location, date, time or
item among views of its kind.- Menu rows that share a
groupare one choice, read as radio items. - A
Fieldnames any control it holds that has no name of its own.
Docs: Accessibility
Keys and fields
KeyEvent.altGraphtells a typed character such as € from a chord.TextInput.showsCaret = false: a focused field that shows no caret or selection until it
is edited, as a spreadsheet cell does.T?inside a{ }body means what it means in a declaration,T | null;x as array
andx as objectare casts too.
Tools
declare-look --from-startlooks from the first frame and says, as text, what moved
while the app loaded, and over which milliseconds.--filmstrip DIRsaves a picture at
each step.drive.hold({ method, path })holds a request unsent, so a script can check what the
program shows while it waits;drive.read(path)reads a value.declare-help Interface.memberanswers for one member of an event or record type,
declare-help PointerEvent.deltaX, inherited members included.
Docs: Verify
Smaller changes
- A press is carried to what was pressed when the layout moves it during the press, so a
field's blur that reflowed a toolbar no longer costs the first click on it. A view that takes
no pointer events is never the one pressed. - A program's first evaluation knows the window's size, and an App's unset height counts as
its own in its layout, so a rule that depends on width is right the first time. - Overlays: a closing overlay takes no presses; a layer painted above an open modal stays
live (a toast over a sheet takes presses and is read aloud); an overlay stays above a view
built again beneath it; aPopovergiven a width gives it to its content; an overlay's
fillis painted once. - History records one entry per settle, however many rounds it takes.
- Layout: a view sized by its content holds a child it centres; a
TweenLayoutbox may
leave out what it does not move; the layout check names a child that collapses to 0, not only
one that spills;disabledon a container switches off every control inside it. - New messages:
onChangewhere nothing is tracked (DECLARE4041); a view written inside a
Button(DECLARE4043); a text face on a container with the wrong type; afocusShapethat
returns no box; focusing a hidden view says it is hidden. A role's missing method is named
with advice for that role (DECLARE2006). - Data: an auto-fetch decides at the settle's close, with every header in place; a derived
dataset no longer takes over its source's records; a line that begins with:pathstarts a
statement. - Input: a diagonal wheel over a pane that scrolls both ways moves both axes; a DatePicker
given a value that names no day shows today's month. - The reference corrects a drag's
deltaX/deltaY(in the frame the dragged view's own
xandyare set in, not root space), says anautoFetchsource with an emptyurl
fetches nothing, anddeclare.md's example of a class-typed attribute that may be empty is
Menu? = null. - A quoted color in a bare value is the same color as unquoted, and the run-time error for
an unreadable color string names its place. - Form's default messages are neutral about what was being sent.
- The formatter reads a path as the compiler does (
:stories[0].image). declare-changes --jsondelivers a long plan whole; it was cut off past 64 KB when piped.- The guide teaches a page that needs an account showing sign-in where it is, and
npm startsays it serves at the address it prints.