- From: Trey Shugart <notifications@github.com>
- Date: Thu, 01 Dec 2016 16:03:47 -0800
- To: w3c/webcomponents <webcomponents@noreply.github.com>
- Message-ID: <w3c/webcomponents/issues/504/264334412@github.com>
To get around the expensive checks, you could make it so it can only check and warn in dev so that the expensive checks aren't run in prod code. On Fri., 2 Dec. 2016, 10:59 Joseph Orbegoso Pea, <notifications@github.com> wrote: > It might still be nice for a Custom Element to detect distribution > (without leaking structure of a shadow root) because then with this > knowledge it can trigger an event if it needs to. This is not possible with > slotchange because there's no way for a slot to determine which event a > distributed node should fire. > > After thinking about this for a while, and after successfully making my > library compatible with ShadowDOM V1 including closed shadow roots > <https://github.com/trusktr/infamous/issues/40>, I still think the a > solution to the need described in this issue would be invaluable because > then I would be able to detect certain conditions that I can not otherwise > detect without crazy hacks, in order to give the end user of my library > helpful console messages like "Warning: Your motor-node#someID element does > not work when distributed to such-an-such element. It must be distributed > to a motor-scene or motor-node element.` > > With slotchange and assignedNodes, I can only detect proper use cases > where a shadow root is the root of one of my library's custom elements and > when a slot is child of one of my library's custom elements and when one of > my library's elements are connected or distributed directly to another > element of my library. Detecting the other cases would be too hacky and > expensive so far as I can imagine (involving hijacking attachShadow and > traversing all shadow roots). > > — > You are receiving this because you were mentioned. > Reply to this email directly, view it on GitHub > <https://github.com/w3c/webcomponents/issues/504#issuecomment-264333536>, > or mute the thread > <https://github.com/notifications/unsubscribe-auth/AAIVbO87Q7bJfosEptFGeRY5aPEsGaO7ks5rD19NgaJpZM4IkCcX> > . > -- 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/504#issuecomment-264334412
Received on Friday, 2 December 2016 00:04:28 UTC