Repository navigation
Conversation
Yahiro025
force-pushed
the
fix-removed-wrapper-cleanup
branch
from
December 1, 2026 07:40
d056c00 to
1c3e479
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When Alpine starts, it only initializes the matched root elements, so a plain wrapper around a component never gets an
_x_marker. If that wrapper is removed, the mutation observer skipped it entirely and the component's listeners and effects kept running on the detached subtree.The removed-node check now also accepts a wrapper that contains an initialized descendant. Nodes with no Alpine state still return early, so the fast path for untouched DOM is unchanged. An element that
morphreplaces is marked and skipped, which keeps the detached old tree reactive as it was before.tests/vitest/mutation-cleanup.spec.jsremoves such a wrapper and asserts the component is destroyed. It fails on main.Fixes #4951