djust 1.0.0rc18

Pre-releaseReleased
Install
pip install djust==1.0.0rc18

This is a pre-release. djust 1.0.0 has shipped since: read the djust 1.0.0 release notes.

Before you upgrade, read the upgrade guide.

Fixed

  • {% kanban_board %} card moves no longer storm html_recovery on a tabbed dashboard (#1678, fully fixed). This was a stacked bug (reopened 3×); both layers are now resolved:
    • Layer 1 — markers stripped from client HTML. _strip_comments_and_whitespace (hydrated-mount + SSE + html_recovery egress) removed all comments via re.sub(r"<!--.*?-->", "", …), including the <!--dj-if …--> / <!--/dj-if--> boundary markers — load-bearing VDOM structure the Rust parser counts as significant children and the client differ resolves patch paths against. The client DOM lost every dj-if marker while the server's last_vdom kept them. Fixed with a negative-lookahead regex (<!--(?!\s*/?dj-if\b).*?-->) that strips ordinary comments but preserves dj-if markers. Pinned by python/tests/test_djif_marker_preservation_1678.py.
    • Layer 2 (root cause) — client patch-ordering for nested boundaries. When a tab activates whose body is a nested conditional (the live shape: {% if active_tab=="ideas" %}{% if has_ideas %}{% kanban_board %}{% else %}{% empty_state %}{% endif %}{% endif %}), the differ emits MoveSubtree(outer boundary) + InsertSubtree(inner boundary) with final-structure indices. The client applied InsertSubtree (phase −1) before MoveSubtree (phase 3), so the inner span landed as a sibling of the outer boundary instead of nested inside it — the client's flat marker tree then diverged from the server's by one significant child, so the subsequent positional count SetText landed on a dj-if comment marker → html_recovery on every drag. With flat indices no single linear phase order satisfies #1370 (Insert-before-path), #1666 (Move-after-path) and #1678 (Insert-after-Move); the fix puts InsertSubtree + MoveSubtree in one boundary-span phase after the child ops, applied in ascending target index, so a moved outer boundary is repositioned before a nested insert lands inside it (src/12-vdom-patch.js _sortPatches + _applyPatchesInner). The #1370 corruption guard (RemoveSubtree before RemoveChild) is preserved. Verified by a new client-faithful differential harness (tests/js/vdom_client_faithful_diff.test.js) that replays real server patches through the actual client.js in jsdom and compares the full significant-child tree (incl. markers) to a fresh render — reproduced deterministically on both a synthetic fixture and the real captured djust_pm sequence, both green after the fix; tests/js/patch_sorting.test.js pins the ordering.

All releases · Atom feed