🌳 Plant another (metadata) tree#365
Merged
hayleigh-dot-dev merged 12 commits intomainfrom Aug 7, 2025
Merged
Conversation
Collaborator
|
Incredible stuff yoshi 💕 |
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.
Keeps
parentandchildrenreferences inside the metadata that we attach to each node. These references are updated in sync with the real DOM tree, and are used to navigate the DOM while traversing the patches.Compared to the normal DOM tree, this metadata tree contains fragments; All the special casing for fragments (compared to elements) is now no longer necessary and got removed. Instead, the reconciler can traverse fragments like normal elements by using the new tree.
This should fix most fragment bugs, and make Lustre more resilient against other scripts or the browser mucking with the DOM; The
offsetthat we keep for stylesheets for example is no longer required, and in general other scripts can insert and move Lustres elements around freely. In the future, we could detect some cases (for example translators) and handle those more intelligently. It also should fix all the event-related problems with fragments, since now our original assumption is actually always true.fixes #355.