Skip to content
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

Implement instance cloning methods in WeakDom #312

Merged
merged 25 commits into from
Jul 7, 2023

Conversation

kennethloeffler
Copy link
Member

Closes #282 by implementing WeakDom::clone_within and WeakDom::clone_into_external.

}

ctx.ref_rewrites.insert(original_ref, new_ref);
builder
Copy link
Member Author

Choose a reason for hiding this comment

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

This builder never has any children and kinda makes me want a fast path in WeakDom::insert that doesn't create a VecDeque for builders with no children - kind of irrelevant for this PR, but I'll put it on my back burner...

Currently fails because the rewrite_refs implementation in
a253fef rewrites all refs that point
outside the cloned subtree to none, which is not correct

Revert "Fix ref rewrites"

This reverts commit 41a2fe6f1418a48e86d622a336854f9276977c38.
rbx_dom_weak/src/dom.rs Outdated Show resolved Hide resolved
@Dekkonot
Copy link
Member

Dekkonot commented Jul 7, 2023

Can you add these to the Changelog also?

Copy link
Member

@Dekkonot Dekkonot left a comment

Choose a reason for hiding this comment

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

LGTM

@Dekkonot Dekkonot merged commit e7a813d into rojo-rbx:master Jul 7, 2023
2 checks passed
@kennethloeffler kennethloeffler deleted the dom-clone branch July 7, 2023 22:31
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.

rbx_dom_weak should provide a way to clone instances
2 participants