Skip to content

Commit 5499f44

Browse files
committed
add notes on new stuff
1 parent 2b5564d commit 5499f44

1 file changed

Lines changed: 22 additions & 10 deletions

File tree

CHANGELOG.md

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,34 +4,46 @@
44

55
### Breaking Changes
66

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)
1111

1212
### New Features
1313

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
1923

2024
### Internal
2125

2226
- 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
2328
- Named args for all parse elements (`this.args = { name: expr }` and `resolve(ctx, { name })`)
2429
- Tokenizer cleanup — private fields, removed duplicate methods, ~50% smaller
2530
- All extensions converted to proper class-based parse elements
2631
- Removed IE/legacy browser compatibility code
2732
- 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
2938

3039
### Bug Fixes
3140

3241
- Fixed EventSource reconnection backoff (`^``**` for exponentiation)
42+
- Fixed EventSource not using `closed` flag to prevent reconnection after explicit close
3343
- Fixed `AttributeRef` not stripping single-quoted values
3444
- 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
3547

3648
---
3749

0 commit comments

Comments
 (0)