|
4 | 4 |
|
5 | 5 | ### Breaking Changes |
6 | 6 |
|
7 | | -- **Extensions moved to `dist/ext/`** — `dist/hdb.js` → `dist/ext/hdb.js`, same for socket, template, worker, eventsource, tailwind |
8 | | -- **`dist/_hyperscript.js` is now IIFE** (was UMD) — still works with plain `<script>` tags, no change needed for most users |
9 | | -- **ESM available as `dist/_hyperscript.esm.js`** — use this for `import` statements |
10 | | -- **`processNode()` deprecated** — use `process()` instead (alias still works) |
| 7 | +- Extensions moved to `dist/ext/` — `dist/hdb.js` → `dist/ext/hdb.js`, same for socket, template, worker, eventsource, tailwind |
| 8 | +- `dist/_hyperscript.js` is now IIFE (was UMD) — still works with plain `<script>` tags, no change needed for most users |
| 9 | +- ESM available as `dist/_hyperscript.esm.js` — use this for `import` statements |
| 10 | +- `processNode()` deprecated — use `process()` instead (alias still works) |
11 | 11 |
|
12 | 12 | ### New Features |
13 | 13 |
|
14 | | -- **`breakpoint` command in core** — pauses in browser DevTools without needing hdb extension |
15 | | -- **`toggle between` attributes** — `toggle between [@data-state='active'] and [@data-state='inactive']` |
16 | | -- **htmx 4 support** — listens for `htmx:after:process` event in addition to `htmx:load` |
17 | | -- **Platform scripts** — `node-hyperscript.js`, `deno-hyperscript.js`, `bun-hyperscript.js` for running `.hs` files outside the browser |
18 | | -- **Brotli-compressed builds** — `.br` files for all minified bundles |
| 14 | +- `breakpoint` command in core — pauses in browser DevTools without needing hdb extension |
| 15 | +- `toggle between` attributes — `toggle between [@data-state='active'] and [@data-state='inactive']` |
| 16 | +- htmx 4 support — listens for `htmx:after:process` event in addition to `htmx:load` |
| 17 | + - htmx 4 morph swap support — `process()` detects when `_=` attribute changed (via script hash) and reinitializes automatically |
| 18 | +- `cleanup()` API — `_hyperscript.cleanup(elt)` removes all event listeners, disconnects observers, clears timers, recursively cleans children. Called automatically before reinitialization. |
| 19 | +- htmx inspired lifecycle events — `hyperscript:before:init`, `hyperscript:after:init`, `hyperscript:before:cleanup`, `hyperscript:after:cleanup` fired per element. `before:init` is cancelable via `preventDefault()`. |
| 20 | +- htmx inspired `data-hyperscript-powered` attribute — set on all initialized elements for fast querying and morph compatibility |
| 21 | +- htmx inspired `config.logAll` — when `true`, logs all hyperscript events to console (matches htmx's `logAll`) |
| 22 | +- Platform scripts — `node-hyperscript.js`, `deno-hyperscript.js`, `bun-hyperscript.js` for running `.hs` files outside the browser |
19 | 23 |
|
20 | 24 | ### Internal |
21 | 25 |
|
22 | 26 | - Complete ESM rewrite of all source files (45 modules) |
| 27 | +- **Element state on `elt._hyperscript`** — all hyperscript state stored directly on elements (inspectable in DevTools), aligned with htmx's `elt._htmx` pattern |
23 | 28 | - Named args for all parse elements (`this.args = { name: expr }` and `resolve(ctx, { name })`) |
24 | 29 | - Tokenizer cleanup — private fields, removed duplicate methods, ~50% smaller |
25 | 30 | - All extensions converted to proper class-based parse elements |
26 | 31 | - Removed IE/legacy browser compatibility code |
27 | 32 | - Runtime split into focused modules (runtime, collections, conversions, cookies) |
28 | | -- Test suite migrated to Playwright (~8s, from ~250s with old runner) |
| 33 | +- Parse tree is now immutable — mutable event state (execCount, debounced, lastExec) moved from parsed eventSpec objects to per-element storage |
| 34 | +- Event listeners and observers tracked in `elt._hyperscript.listeners` and `elt._hyperscript.observers` for proper cleanup |
| 35 | +- Test suite migrated to Playwright (~9s, from ~250s with old runner), 888 tests passing |
| 36 | +- IIFE + ESM dual builds with minified + brotli variants for core and all extensions |
| 37 | +- Clean dist structure: no source tree mirror, just bundled files |
29 | 38 |
|
30 | 39 | ### Bug Fixes |
31 | 40 |
|
32 | 41 | - Fixed EventSource reconnection backoff (`^` → `**` for exponentiation) |
| 42 | +- Fixed EventSource not using `closed` flag to prevent reconnection after explicit close |
33 | 43 | - Fixed `AttributeRef` not stripping single-quoted values |
34 | 44 | - Fixed `ElementCollection.id` getter calling `className` as a method |
| 45 | +- Fixed string throws (7 instances) — now throw proper `Error` objects with stack traces |
| 46 | +- Fixed silent failure when command doesn't return next element — now throws instead of logging and returning undefined |
35 | 47 |
|
36 | 48 | --- |
37 | 49 |
|
|
0 commit comments