- From: Andy Earnshaw <notifications@github.com>
- Date: Mon, 28 Jan 2019 07:56:36 -0800
- To: w3c/webcomponents <webcomponents@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <w3c/webcomponents/issues/785/458187594@github.com>
As mentioned in #550, the main arguments against `childConnectedCallback` were performance related (the main reason mutation events are also inadvisable). I think those objections preclude adding anything that would make it straightforward to implement the same thing in a roundabout way such as this. Speaking as someone who has used a lot of hacks to work around otherwise-unassailable problems over the years, I see this as something that would be used in much the same way. When you find a lot of dependencies all using this technique to work around their own otherwise-unassailable problems then you can find yourself deep in performance issues. Imagine thousands of nodes being connected at once, each one triggering your function, which adds more nodes, which triggers more connected callbacks. Now imagine your dependencies doing the same thing in addition. This kind of impact is detrimental to the web, even if you have good use cases and intentions. Besides the performance implication, this suggestion renders closed shadow trees nearly pointless. Although it is easy to override `attachShadow` to prevent closed shadow trees, that's an intentional action that requires awareness of the consequences of doing so. Providing any override method on all elements means that closed shadow tree access and mutation could happen unintentionally (by accessing `this` properties within the override). -- 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/785#issuecomment-458187594
Received on Monday, 28 January 2019 15:56:58 UTC