Skip to content

Tie element with owner lifecycle instead of insert/delete queue #39

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

Draft
wants to merge 1 commit into
base: rc3
Choose a base branch
from

Conversation

thetarnav
Copy link
Contributor

@thetarnav thetarnav commented Apr 8, 2025

This is just an experiment.
Deleting the element when the owner disposes would make the current queue logic unnecessary, and also allow for removing elements from the tree, keeping in memory and then re-adding again without deleting the element in the process. Which make using Suspense, createRootPool and other primitives that keep elements in memory possible.
Currently this breaks onDestroy animations, because of node.parent = undefined in removeNode. It is necessary for elements kept in memory to not be displayed, but it also mean that all elements removed are removed immediately without animations.

@thetarnav thetarnav changed the base branch from main to rc3 April 8, 2025 11:32
@thetarnav thetarnav changed the title Delete-oncleanup Tie element with owner lifecycle instead of insert/delete queue Apr 8, 2025
Comment on lines +17 to 20
let o = s.getOwner();
if (o != null) {
s.onCleanup(el.destroy.bind(el));
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Guess my only question / concern would be the performance overhead of this...

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.

2 participants