Skip to content

Releases: teryxjs/xhtmlx

v0.4.1

Choose a tag to compare

@dkropachev dkropachev released this 22 Mar 04:07

What's Changed

Full Changelog: v0.4.0...v0.4.1

v0.4.0

Choose a tag to compare

@dkropachev dkropachev released this 21 Mar 20:27
1f04c99

Security

  • Apply sanitizeHtml hook in plan-based and DOM-patching innerHTML paths (XSS fix)
  • Add cross-origin validation to boostForm and popstateHandler
  • Mitigate ReDoS in xh-validate-pattern

Fixed

  • Evict failed template fetches from cache
  • Null-guard closest("[xh-boost]") in boost handlers
  • CSP-safe child clearing in router, boost, and popstate
  • Router 404 template fetch error handler
  • Clear all caches on version switch and destroy()
  • Bounds-check navigatePath
  • Skip File inputs in formDataToObject
  • Clean up WebSocket handlers before reconnect
  • Bound triggerSpecCache (500) and validationRegexCache (200) to prevent leaks

Added

  • Logo and favicon (X-in-a-Tag design) integrated into docs site
  • logos/ directory with dark/light logo, icon, favicon, and social preview SVGs

Changed

  • Upgrade React devDependency from 18.3 to 19.2 for benchmarks
  • Updated benchmark results across README and docs site

Full changelog: https://github.com/teryxjs/xhtmlx/blob/main/CHANGELOG.md

v0.3.1

Choose a tag to compare

@dkropachev dkropachev released this 20 Mar 00:01

Performance optimizations

Comprehensive render pipeline optimizations delivering 20-110% throughput improvements across key scenarios, with no API or behavior changes.

Highlights

Scenario Improvement
xh-if true +113%
4 class toggles +93%
1 text bind render+swap +48%
xh-if false +40%
nav menu 8 items +26%
counter update +20%
list 50 update +22%

Changes

  • Pre-compute numeric binding type codes in render plan
  • Skip child creation when xh-text/xh-html will overwrite
  • textContent = '' instead of innerHTML = "" in performSwap
  • Batch classList.add calls in plan bindings
  • Single instanceof MutableDataContext check per render
  • Shared frozen PROCESSED_STATE constant
  • WeakSet replaces data-xh-each-item setAttribute
  • Eliminate renderItem closure in plan-based processEach
  • Compiled render plans with direct DOM creation
  • Inline plan bindings bypass DOM setAttribute round-trip
  • Eliminate redundant DOM scans, cache hot paths, fix resource leaks

See CHANGELOG.md for full details.

v0.3.0

Choose a tag to compare

@dkropachev dkropachev released this 18 Mar 02:55

What's New

Analytics

  • xhtmlx.analytics(handler) — pluggable analytics adapter
  • xh-track — declarative event tracking on click/submit
  • xh-track-view — viewport-based impression tracking via IntersectionObserver
  • xh-track-vals — attach extra data to analytics events
  • Automatic request lifecycle tracking (request:start, request:success, request:error)

Responsive

  • resize trigger — re-fetch/re-render on viewport resize
  • Breakpoint-aware templates (xh-template-sm, xh-template-md, xh-template-lg)
  • $viewport variable (xs/sm/md/lg/xl) available in templates

Templates

  • <template xh-name> — named inline template definitions

Security

  • config.cspSafe — CSP-safe mode

Tooling

  • npx xhtmlx-migrate — CLI migration tool from htmx to xhtmlx
  • Migration guide documentation

Documentation

  • Interactive tutorial, API reference, playground, StackBlitz template

Bug Fixes

  • outerHTML swap binding + rAF guard
  • Auto-init when loaded after DOMContentLoaded
  • Memory leaks in DOM traversals

Performance

  • 9 optimizations: single-pass rendering, selector caching, i18n regex caching, reduced DOM traversals, and more

See CHANGELOG.md for full details.

v0.2.0

Choose a tag to compare

@dkropachev dkropachev released this 15 Mar 12:19

Major feature release

v0.1.0 — Initial Release

Choose a tag to compare

@dkropachev dkropachev released this 15 Mar 03:20

xhtmlx v0.1.0

First release. Declarative HTML attributes for REST API driven UIs — like htmx, but your server returns JSON and xhtmlx renders client-side.

Features

  • REST verbs: xh-get, xh-post, xh-put, xh-delete, xh-patch
  • Templates: external files (xh-template) with caching, inline <template> fallback
  • Data binding: xh-text, xh-html, xh-attr-*
  • Iteration: xh-each with $index, $parent, $root
  • Conditionals: xh-if, xh-unless
  • Triggers: click, load, every Ns, revealed, delay, throttle, once, changed, from:selector
  • Targeting: xh-target, xh-swap (8 modes)
  • Error handling: xh-error-template, per-status-code templates, xh-error-boundary, global config
  • Indicators: xh-indicator
  • URL interpolation: {{field}}
  • Custom DOM events: xh:beforeRequest, xh:afterRequest, xh:beforeSwap, xh:afterSwap, xh:responseError
  • MutationObserver for dynamically added elements

Stats

  • Zero dependencies
  • ~5KB gzipped
  • 404 tests