Repository navigation
Releases
XON 2.1.2
Fixed - XON next to other libraries
Plain words are ordinary data-* attributes, and other libraries use some of the same names. A page that mixed XON
with Bootstrap or older code (the Xonry dashboard) saw data-load="app.init" next to data-require fetched as an
address, data-show="#panel" on classic &template rows reported as XON236, Bootstrap's data-toggle="tab|pill| dropdown|collapse|modal|tooltip|popover|button" bound as XON toggles, and data-table on list items loading the table
part. The fix, for any page (docs/guide.md, "Using XON with other libraries"):
- Values that can not be XON's are left alone - a debug note, not an error:
data-toggle/data-show/
data-hide/data-openwhose value is not an id, or is a Bootstrap word (tab, pill, collapse, dropdown, modal,
tooltip, popover, button, buttons, offcanvas, list) that no element has as its id (XON257, which replaces the
errorsXON240/XON241);data-loadnext todata-requireor naming a function offered withxon.use
(XON258);data-tableon anything but a<table>(XON800, now a debug note). The boot build gives
data-toggleitsaria-controls/aria-expandedonly for an element of the page, outsidedata-xon-words="off"
and only with the plain words on (wordssetting), and insidedata-xon-words="off"onlydata-xonand tags count
as XON markup for its event queue. data-xon-words="off"switches the plain words off for an element and everything inside it,"on"back on
inside; the nearest wins. Symbol tokens (data-xon) and component tags keep working (a component's own markup is
XON's).xon.config({ words: true | 'scoped' | false })(alsowindow.xonConfig.words): everywhere (default),
only insidedata-xon-words="on", or nowhere. The lint skips the plain-word checks insidedata-xon-words="off"and
reports a value XON leaves to other scripts as a warning.- Dashboard build: an element in a classic form (
data-xon="&template",&onload..., ordata-require) is left
to the classic layer - itsdata-show,data-load,data-toggleare never read as plain words. The Xonry
dashboard can drop its workaround (xon.binder.level1.bind = null).
Added
<xon-multiselect>: several values from one list - a filter field (WAI-ARIA combobox), a multi-select listbox
(aria-multiselectable,aria-activedescendant), chips that remove a value, Select all / Clear,max,required
(the field's own validity), form values asname="tags[]"(one hidden field per value,FormData.getAll), form
reset,el.value, a<select multiple>inside as the no-JavaScript fallback; eventchoose. Replaces SlimSelect.<xon-countdown>: the time left untiltoor for aduration;role="timer"named by the label and the time in
words; a status region speaks only at the milestones (milestones="1h 10m 1m 10s") and at the end, never every
second; it stops ticking while the page is hidden or the tag is off screen;paused,el.restart(), eventdone.- The part
sortable(data-sortable, docs/sortable.md): reorder a list or table rows by dragging (pointer
events: mouse, pen, touch;data-sortable-handle) or with the keyboard (Space / Enter picks up and drops, arrows and
Home / End move, Esc puts back), each step said in anaria-liveregion and the instructions as the items'
description; withdata-eachon the same element the data list is reordered (the list moves the row); event
sorted{ from, to, order }. Words in any language (data-sortable-help,-grabbed,-moved,-dropped,
-cancelled). components/xon-ui.cssstyles the two components and the sortable states; components/manifest.json lists twelve
components.
Changed
data-show-result-inis bound by the part request (likedata-loadsince 2.1.1); the core keeps the trigger and
prepares the part while the page is idle (boot build: a form submitted before the engine waits for the part). This
paid for the new core code: core 30,629 bytes gzip (limit 30,720), engine 31,126 (31,232), boot 5,926 (6,144).
XON 2.1.1
Changed - speed
- A row's plain words with blanks (
data-class-selected="{id} == app.selected",data-attr-*,data-text,
data-ifin adata-eachrow) are compiled once per list, with each blank a parameter (the row's value, never parsed
into the condition), and need no effect per row: one effect per word and list. When the condition compares the list's
key with one value, a change of that value updates the two rows it concerns. Rows stay in the fast cloned form
(before: each row was rendered as markup and each condition parsed and tracked on its own - 4-10x slower). - The wiring of the page runs at background priority (
scheduler.postTask, else a long enough
requestIdleCallbackmoment, else a timer) and no longer queries 30+ attribute selectors over the whole page: the
plain words are found in the same pass asdata-attr-*/data-class-*. A first click no longer waits for it
(Firefox, 10,000 elements: click to painted 18 ms -> 0.4 ms). - Boot build: without
requestIdleCallback(Safari) the engine loads after the first frame is drawn (a frame, then
a task), not before the first paint (WebKit, 10,000 elements: ready to painted 265 ms -> 41 ms). - Boot build, first click as the engine arrives: the veil that hides
data-if/ row markup until the engine runs
is now switched off with a class of<html>(the sheet stays), not by taking the style sheet away - that restyled
and repainted the whole page in the frame of the first click; a page with nothing to hide drops it once parsed.
Without idle scheduling (Safari) the engine's search of the whole page runs in ~1 ms slices. Boot build, first click
on the last of 10,000 elements, click to painted (total time, median of 7): WebKit 28.4 ms before this fix -> 11.2 ms
(other libraries 7.5-10.5 ms); Firefox 47.9 ms in 2.1.0 -> 0.26 ms. - Core size: tabs are the new part tabs (loaded by
data-tabsor the first$xon.ui.tab), the worddata-loadis
bound by the part request (which every request needs anyway), and the in-place patch of a changed markup-form
row is in the part morph (loaded with such a list; without it the row is replaced).
Fixed
- An explicit render (
xon.render(), the dashboard build at start) no longer binds the row markup of adata-eachthat
the list already took out of the page (it reportedXON129for every{blank}in a plain word).
Added - AI-ready
- AGENTS.md: how to write XON 2.1 correctly, for AI coding assistants and people - the rules, a cheat sheet of the
symbols and every plain word, the settings and the API, the security essentials, common mistakes with their fixes,
and copy-ready patterns (counter, form, list with a key, fetch into a target, navigation, component, boot build).
Every pattern is a test: it passestools/lint.jsand runs in Chrome on every build (tests/browser/docs.test.js). - llms.txt (the llmstxt.org index of the docs) and llms-full.txt (AGENTS.md, README and
every page of docs/ in one file). tools/llms-build.jswrites llms.txt, llms-full.txt and the tables of AGENTS.md from docs/ and the vocabulary;
./build.sh --checkfails when one of them is stale.tools/lint.js --json: a list of{ file, line, col, code, severity, message, fix: { description, replacement? }, rule };
--stdin(with--name), exit codes 0 (no errors) / 1 (errors) / 2 (the command was wrong). See docs/debugging.md.- dist/xon.schema.json: a JSON Schema (draft 2020-12) of every attribute, symbol, setting and API name, written
from the vocabulary bytools/schema-build.js(checked by./build.sh --check).#/$defs/attributeschecks the
XON attributes of one element,#/$defs/configthe settings. See docs/index.md, "Machine-readable files". - The vocabulary lists the settings of
xon.config()/window.xonConfig(config, in docs/vocabulary/core.json).
Security
- The Trusted Types policy
xonis narrow (all builds).createHTMLandcreateScriptaccept only the string
XON's own sink is handing over at that moment (its callers in the core parse only into inert containers: the
sanitizer's<template>, aDOMParserdocument, a<textarea>; script text only for the inline scripts of content
your script trusts with its scripts); any other string is refused withXON255.createScriptURLaccepts only
http(s) addresses of this page's site or of the site of the XON script - the rule of the part loader - and refuses
anything else withXON256. Before, the policy passed every string through, andxon._.scriptURL()(reachable
by any page script) turned any address into a trusted script address; it is gone - the part "offline" uses
xon._.policy. The boot build's policy follows the same
rules (the engine gives it the markup rule when it takes over; until then it refuses markup). - Under Trusted Types a
<script src>of another site inside trusted content is left out and reported (XON256)
instead of being loaded.
Changed
xon._.policy: the policy itself, for the parts and for tests (it refuses what it was not handed).- Core 30,720 bytes gzip (limit 30,720, unchanged): the new policy rules were paid for by sharing one address check
(ours) between the policy, the part loader andxon.config({ parts }), and by moving the worker address helper
out of the core.
Benchmarks (script time, total time with paint in Chrome/Firefox/WebKit, and a local js-framework-benchmark run): bench/RESULTS.md
XON 2.1.0
Faster
- Lists: rows are clones of one prepared row; only the values that changed are written. 1,000 rows: create
16.5 ms (was 28.2), replace 18.5 (25.3), append 9.4 (18.2), update every 10th 1.3 (8.5), swap 1.0 (5.0),
remove one 0.55 (3.4) - median of 7 cold runs at CPU 1x. - Start-up: a page with 10,000 elements is ready in 15.7 ms (was 66.8); no XPath scan, wiring waits for idle time.
- State: a write through a store's own proxy is a plain write; 10,000 writes to 100 bindings 4.1 ms (was 13.8).
- First click: the event path is prepared at start; 0.28 ms on the last of 1,000 elements (was 5.7).
- Memory: no weak-table entry per row; 200 create + clear cycles grow the heap by about 0.2 MB (was 0.7).
Added
- Boot build (optional):
dist/xon.boot.min.js, 5.4 KB gzip, starts in about 3 ms and loads the engine
(dist/parts/xon.engine.min.js, the same code as the core) in idle time or on first use. Events that arrive
first are queued with the facts of their moment and replayed by the engine, which checks them as usual.
See docs/parts.md, "Boot build". xon.ready(fn): runsfn(xon)once XON runs (boot build: once the engine has arrived; core: at once); returns a
promise. The same page works with either build.- Budget tests for swap, remove, first click, the boot build, and tighter list / write / memory budgets.
Security
- The script tag can not be faked (S21-01). XON reads its own
<script>tag through the browser's real
document.currentScriptand only when it is a script element. Markup before the tag (<img name="currentScript" data-parts="/uploads/" data-debug>, DOM clobbering) chose the parts folder - in the boot build the engine itself -
data-path,data-trustand debug mode; it no longer can. The engine of the boot build checks the tag it is handed. - Addresses are checked as a whole (S21-02). A list blank in an address attribute is judged by the whole address
the attribute gets, in both list forms and in:attr:href="{a}{b}"withjava+script:…, or a blank before
literal text, can not make a script address (the blank becomes#). The values an SVG<set>/<animate>writes
(to,from,by,values) are checked as addresses;srcdocandattributeNamenever take a blank. :attr/data-attr-*may not set an attribute XON reads (S21-03):data-on-*,data-load*,data-each,
data-xon,data-text,data-every… (XON194), so data can not pick the function a click calls.- Boot build: the hand-over is the engine's only (S21-04). It is given only to the engine script the boot file made,
while it runs; a page script callingxon.__boot()gets nothing (no Trusted Types policy, no queue). The boot's
policy accepts script addresses of the site (or of the boot file's site) only. - An element named
xonis not XON (S21-05):<form id="xon"><input name="version">…no longer switches XON off. - Boot build: a write through an object that inherits from a store lands on that object, as with the core (S21-06);
every documented function of the API exists before the engine (S21-07, see below).
Fixed
- Lists made of another store's items (
t.open = t.items.filter(…),t.sel = [t.items[0]]) follow a change of an
item again (2.1 regression). - Boot build: text typed and boxes ticked before the engine arrive stay (they were wiped by the
data-modelbindings);
when the engine can not be loaded (offline, 404) held links and forms work as plain HTML and the problem is reported
once throughxon.onError/xon:error(XON233); the engine is also looked for next to the boot file when the
data-partsfolder has none; a full queue no longer drops a click or holds a link forever (typing is kept per field,
a click or submit takes the place of old typing, an event that is not queued is not held); a person's form or link
whose moment is too old to write (engine took over 10 s) is sent / followed by the browser instead of being lost;
data-ifcontent anddata-eachrow markup are not shown before the engine;data-togglegets its
aria-expanded/aria-controlsbefore the engine. - Boot build: every documented function of the API (
xon.http.request,xon.ui.*,xon.validate,xon.native,
xon.template.*…) exists before the engine; calls are queued and made on it, in order. - A
data-on-*value that is not a plain name (data-on-click="hit()") is reported when the page loads, not at the
first click. e.stopPropagation()in a handler stops an outerdata-on-click.
Changed
- The size limit of the core is 30,720 bytes gzip (was 27,648) for the new list engine and fast paths. The engine part
of the boot build has its own budget: the core limit plus 512 bytes for the hand-over glue. - The type checks of
xon.utils(isFunction,isObject,isArray,isNumeric,isJson,lookup,
functionExists) are in the dashboard build only; nothing in the core used them. - Without
data-each-key, what a visitor did inside a row (an unbound ticked box, an open<details>) stays at its
position when items are added or reordered (2.0.1 reset it); docs/guide.md says so next todata-each-key. - Production builds are ES2015.
Full benchmark (10 libraries + Next.js): bench/RESULTS.md
XON 2.0.1
Fixed
- Memory. After many large list renders, the JS heap no longer stays at its peak: 200 create + clear cycles
of a 1,000-row list now end at about 2.05 MB of heap (was 4.04 MB). The cause was the browser's weak tables,
which never shrink after their keys are collected: four reactivity tables are now one, and the "already bound"
marks of the binder are removed as soon as they are used. No behaviour changes.
Added
- A memory budget test (
memory200CyclesBytesintests/budget.json): the build fails if 200 create + clear
cycles grow the heap past the limit, or if a cleared list leaves detached DOM nodes behind.
Full benchmark: bench/RESULTS.md
XON 2.0.0
Changelog
All notable changes to XON. The version follows Semantic Versioning: one number for the
core, the dashboard build and every part (xon.version, package.json, the banner of each file in dist/).
2.0.0 - 2026-11-29
The first stable release.
XON began as the small attribute library behind the Xonry dashboard: data-xon tokens, classic & directives
and a flat helper API. It was then rebuilt around one parser, one binder, one sanitizer and one registry of what
markup may call, audited for security and correctness, and finally given plain-word attributes for people who
know only HTML. 2.0.0 is that rebuild, released as one product.
Hardening before release (security and correctness audits)
These change behaviour compared with the 2.0.0 previews; each is covered by tests/browser/hardening.test.js.
- Writes are sent only for a click / submit that started ON the element (its target, and the person's last
pointer press or the keyboard focus, are inside it): a<label for>click, a click elsewhere,.window,
.documentand.outsidenever write; a write token with those modifiers is refused when parsed (XON226). - Functions without
autorun only for an activation on their own element (click, key press, input, change,
submit ...) or a custom event your own script dispatches; hover, mouse moves, focus, scroll and page-wide
listeners needxon.use.auto(). Dashboard layer:$computedand&onmouseover& co. follow the same rule. xon.http.allowWritesprefixes stop at a path step ('/contact'no longer allows/contact-fail); the same
forxon.include.trust.- Blanks in XON attributes (
data-xon,data-load,data-every,data-key,data-text...) may only hold
[A-Za-z0-9_.-](XON227); adata-on-*value is never taken from data (XON228).data-every,data-key
anddata-waitare validated (XON250-XON252). - Data can not ask for raw HTML (
"raw": [...]in an island or answer is ignored);{!name}in the markup does. - One HTML rule (part request:
xon.http.isFragment/accepts): text/html + the HEADERX-Xon-Fragment: 1(or a
matchingX-Xon-Layout), or a location the script trusted. A marker in the body never counts by itself.
#componentsfollow it too (XON249);xon.include.trust(prefix, { scripts: false })trusts a folder's markup
without running its scripts (static sites, component folders). - Live fragments are bound only where a person acts; markup that runs or requests by itself is removed
(XON632) unless the element saysdata-live-bind. window.xonConfigcounts only as a plain object; everyxon.config()option is type-checked (XON223-XON225);
parts load only from this site or the core's own site. The core no longer readswindow.xonryCsrf(the dashboard
layer reads it only as a string).- Router: a
<title>at the start of a fragment becomes the page title; a hover request is reused by the click
and never started after it; an address that answered with a normal page is a plain link afterwards; no early
requests fordata-no-prefetch,rel="nofollow", logout / delete-like addresses or addresses outsidexon.path. - Forms are sent urlencoded like the browser (multipart with a file field); pending submit buttons get
aria-disabledinstead ofdisabled, so the keyboard focus stays; a second submit while pending is ignored;
a marked 4xx answer (422 + messages) is shown in the target. - The symbol spelling of tabs works like
data-tab; thedata-load-intosymbol equivalent is#get:/url~>#id~/. - Component scoped CSS drops
@import, statements and at-rules other than@media/@supports/@container
/@keyframes. A resume note is read only as a child of<head>/<body>(XON304). - A part that can not be loaded is reported once (
XON233) and retried when the browser is back online. - Faster lists (
data-each,:each,%templates, the visible window ofdata-virtual): new rows of a first render,
an append or a replace are built as ONE string with the same context-aware escaping and parsed in ONE pass, placed
as one fragment per run of neighbours; a replace-all empties the host at once; a row is re-rendered only when one
of its values changed; a keyed list depends on its length plus the fields its rows show (an index write counts as
a change of the list); new rows are wired with one query, only for what must work without an event (event-only
words such asdata-on-clickare wired by their first event, as at start-up), and the document observer does not
scan them a second time. Small changes keep the in-place patch (focus and typed text survive; swap = 2 moves). - New file
dist/xon.core.js: the readable core (the code ofxon.min.jswith comments and messages, no dashboard
layer).xon.jsis the source of the full build. In debug mode the core build names dashboard-only APIs (XON913).
The core (dist/xon.min.js)
- Plain words (level 1):
data-toggledata-showdata-hidedata-opendata-closedata-tabs/data-tab
data-load(+data-every,data-when-visible)data-show-result-indata-textdata-modeldata-each