-
Notifications
You must be signed in to change notification settings - Fork 141
Remove children when updating a host node to an element with nil children #210
Remove children when updating a host node to an element with nil children #210
Conversation
This caused an issue when updating an element that had children - when an element went from having children to having nil children, the rendered objects would not be removed.
This change looks good to me, but I want to wait for @ZoteTheMighty. Can we pull benchmark numbers out for this change, too? |
This looks okay to me, but I have a couple comments to consider: I did some quick benchmarking, and there's a somewhat consistent 20-25% slowdown on benchmarks for specifically mount and update operations. Note that mounting and updating big nested trees sees a much smaller effect. The performance effect is specifically on the leaves of these element trees. That said, there are a couple things we might be able to do regain some of this performance and still fix the bug.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Requesting changes (according to the above suggestions)
…al check to resolve the bug.
Co-Authored-By: Lucien Greathouse <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LG...T...M...
Closes #209. In ea822f6 we introduced an optimization in RobloxRenderer that avoids calling into the reconciler to update children if the element's children are
nil
. This introduced #209, where when updating a tree with an element that hasnil
children (not an empty table), the existing children are not unmounted.Checklist before submitting:
CHANGELOG.md
Added/updated documentation