-
-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(render): remove overlapping nodes + old connected nodes #702
Merged
Conversation
This file contains 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
brisa-adapter-vercel
brisa
brisa-pandacss
brisa-tailwindcss
create-brisa
www
commit: |
We can golfing bytes in future PRs to keep Web Components to 3kb |
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.
Fixes #686
This PR fixes bugs encountered with different reactive parts sharing nodes of the same element.
Example:
Signal 1 -> when true -> fragment -> Signal 2 -> when true -> render
-> render sibling
In this scenario, when Signal 2 changes, it updates the local refs of this reactivity part but does not communicate with Signal 1 to update this ref (so hard to do this...). So after this PR, when Signal 1 needs to update the nodes without this ref, it cleans the overlapped nodes first to do the job correctly. Then, instead of removing the referenced nodes, it removes the real ones, doing
nextSibling
until the last ref.For me, the ideal solution would be not to depend on these local references. But, at least, with this solution we avoid doing a reconciler for it or adding markers to the HTML. 😅
Caution
Bad part: It increases 110 bytes the client code, (still 3kb but rounded is 4kb). At least in a previous PR I reduce 26 bytes this code, so the total new bytes in the next release will be +84 bytes.