These libraries are experimental. APIs may change without notice. Generated from source with koruc 0.1.7 on 8/19/2026.
Dom
@korulang/domkoru/dom markup facet — the `component` transform, ported from koru/vaxis
dom/index.kz · 0 tors
koru/dom markup facet — the `component` transform, ported from koru/vaxis · 43 more lines
koru/dom markup facet — the `component` transform, ported from koru/vaxis
(vaxis/index.kz:2944) onto the retained-mode DOM target.
RULED 2026-08-07 (DOM_GAUNTLET.md, "how Koru writes HTML") — this file
builds exactly that spelling:
- a tag starting with a CAPITAL letter is ours: it compiles to a call to
that component's synthesized event — a real invocation graph in the AST.
- any other tag is passed through untouched. Not looked up, not validated,
not compared against a table of HTML element names — the compiler stays
ignorant of HTML, which is what makes SVG, elements added to HTML later,
and third-party custom elements work for free.
What one component synthesizes (architecture shared with the vaxis original;
only the paint is retained-mode):
koru/dom:component(Row) { <tr data-id={{ id:d }}>…</tr> }
→ event `Row { parent: string, id: i64, … }` — props read off the
{{ ident:type }} placeholders (s/d/f/b, as in vaxis)
→ a |js paint body: clone a module-level <template> holding the STATIC
markup, assign the dynamic attrs/text, append the root to
document.querySelector(parent). The template is built once at module
load — the same clone-and-fill shape the reference's hand-written
rowTemplate uses (vanillajs Main.js:7-9); here the compiler writes it.
A row goes in AS IT IS PAINTED, one append each. Batching a task's rows
into a detached fragment and attaching once — the trick the reference
uses by hand — was built, measured, and REVERTED: on a quieted machine
it is 1.112x of hand-written against 1.101x without it. See
dom/board/timings-2026-08-08/probes/README.md.
Markup dialect (the vaxis attribute forms, extended to passthrough tags):
attr="lit" static — lives in the template HTML.
attr={{ ident:t }} dynamic — a setAttribute at paint, registers a prop.
element text static text lives in the template; text containing a
placeholder becomes a textContent assignment and must
not share its element with child elements.
Capital child tags at the TOP LEVEL of the markup become invocations of the
child component's event in a synthesized impl flow, parent forwarded, in
document order. A capital tag nested INSIDE a lowercase element is refused
loudly this rung (the mount-into-a-node story does not exist yet).
The paint is a JS-target lowering; compiling a component under any other
--lang refuses loudly, naming this file.