Skip to content

Conversation

@715d
Copy link
Contributor

@715d 715d commented Jan 30, 2026

In the TypeScript client's Patch.applyPatch, the REPLACE action uses target.outerHTML = e.HTML to swap an element. After this assignment, target still references the old element that was removed from the DOM. The subsequent call to EventDispatch.updated(target) passes this detached "ghost" element to user hooks.

This PR changes the logic to use replaceWith and only parses the HTML once, which should also be a net performance improvement (especially for large diffs).

@715d 715d marked this pull request as ready for review January 30, 2026 03:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant