Re: [w3c/webcomponents] Presence of disconnectedCallback can expedite an invocation of connectedCallback (#760)

> I think in most cases the parent should be handling the relationship with the children and not the other way around.

You can't do that though, given that callbacks are triggered on the child, not the parent. It's also pretty awkward to implement and spec; triggering callbacks on X when X gets connected/disconnected is easy, but having X's parent watch all of X's children (or descendants, in some cases!) requires a lot more machinery.

> Or is it worth discussing the fact that maybe an element should have their connected / disconnected callbacks invoked if it's moved, but not if it's added then removed very quickly?

Right now moving is defined as removing and then adding, so introducing this distinction would be an unfortunate complication to the model.

Overall I'm leaning back toward the status quo, just because it's more primitive and fundamental, and you can implement semantic batching on top of it. I'm also worried about implementing batching at this level for connect/disconnect but not attributeChanged, although as @rniwa points out it might not be observable in practice given the current set of DOM APIs.



-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/webcomponents/issues/760#issuecomment-445582875

Received on Sunday, 9 December 2018 23:19:33 UTC