Skip to main content

The problem

Hypermedia swaps and client innerHTML insert new markup after the initial mount. That HTML is not wired to the page signal store unless you manually re-run binding setup.

How Aero helps

process(element) scans a DOM subtree for data-aero-* directives and attaches the same binding handlers used at initial mount. Hypermedia swaps call process automatically when both flags are on. See Using hypermedia with reactivity.

Hypermedia (automatic)

When both reactivity: true and hypermedia: true are set, swapped fragment HTML is processed into the shared page store. Compiled regions go through destroy → swap → remount/process so bindings stay consistent. No extra client code is required for standard action targets.

Manual process from client scripts

Insert HTML with data-aero-* attributes, then process:
In runtime fragments, prefix signal paths with $ to read from the page store ($note, $showNote).

Restricted grammar (default)

process() is eval-free. Supported attribute values:
  • Store refs: $note, $items, $auth.state
  • Structural: $status or string literals (loading, "error")
  • Events: hypermedia action grammar only (GET('/path')) — wired by hypermedia process() before reactivity runs
Arbitrary JavaScript in attributes (e.g. { count + 1 }) is rejected. Use <script is:state> for compiled bindings, or unsafeProcessFragment() from @aero-js/reactivity for trusted dynamic HTML only. See CSP and eval-free reactivity.

Structural fragments

Runtime HTML can include structural directives:
Call process(host) after inserting the markup.

Package API

Lower-level helpers live in @aero-js/reactivity:
Most apps use the composed runtime from @aero-js/core rather than calling these directly. unsafeProcessFragment is not re-exported from @aero-js/core.