djust 0.4.4 was stabilized through 1 pre-release, and most of its changes are recorded under them: 0.4.4rc1.
Changed
Remove double
updateHooks()/bindModelElements()scanning — These were called in bothapplyPatches()andreinitAfterDOMUpdate(), scanning the full DOM twice per patch cycle. Removed fromapplyPatches(). Saves ~5ms per event.Delegated scoped listeners (dj-window-, dj-document-) — Replaced
querySelectorAll('*')full DOM scan with a registry-based delegation pattern. Scoped elements are scanned once at mount time and registered in a Map. Event listeners on window/document dispatch to the registry. Handles dotted attribute variants (dj-window-keydown.escape).Use
orjson.loads()for patch JSON parsing — 2-3x faster than stdlibjson.loads()when orjson is installed. Falls back gracefully.Gate debug payload behind panel open state —
get_debug_update()(dir + getattr + json.dumps per attribute) only runs when the debug panel is actually open, not on every event in DEBUG mode. Saves ~2-5ms per event. Panel sendsdebug_panel_open/debug_panel_closeWS messages on toggle.