Skip to content

XON 2.0.0

Choose a tag to compare

@oncebuilder oncebuilder released this 29 Nov 23:43
· 5 commits to main since this release

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,
    .document and .outside never write; a write token with those modifiers is refused when parsed (XON226).
  • Functions without auto run 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 need xon.use.auto(). Dashboard layer: $computed and &onmouseover & co. follow the same rule.
  • xon.http.allowWrites prefixes stop at a path step ('/contact' no longer allows /contact-fail); the same
    for xon.include.trust.
  • Blanks in XON attributes (data-xon, data-load, data-every, data-key, data-text ...) may only hold
    [A-Za-z0-9_.-] (XON227); a data-on-* value is never taken from data (XON228). data-every, data-key
    and data-wait are 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 HEADER X-Xon-Fragment: 1 (or a
    matching X-Xon-Layout), or a location the script trusted. A marker in the body never counts by itself.
    #components follow 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 says data-live-bind.
  • window.xonConfig counts only as a plain object; every xon.config() option is type-checked (XON223-XON225);
    parts load only from this site or the core's own site. The core no longer reads window.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 for data-no-prefetch, rel="nofollow", logout / delete-like addresses or addresses outside xon.path.
  • Forms are sent urlencoded like the browser (multipart with a file field); pending submit buttons get
    aria-disabled instead of disabled, 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; the data-load-into symbol 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 of data-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 as data-on-click are 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 of xon.min.js with comments and messages, no dashboard
    layer). xon.js is 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-toggle data-show data-hide data-open data-close data-tabs/data-tab
    data-load (+ data-every, data-when-visible) data-show-result-in data-text data-model data-each