Re: [w3c/webcomponents] Custom Element - untrackable upgrade (#671)

`whenDefined(element)` will only work if one knows the name of the type of element it will be used on in order to get references to those elements, otherwise it will lead to the problem of [leaking promises](https://github.com/w3c/webcomponents/issues/674).

To summarize from there, this illustrates a potential problem:

> > Suppose a lib has a custom element that needs to detect if certain child elements are `instanceof ACertainClass` regardless of what name the _end user_ of the library assigned the constructor to. 
> > 
> > The custom element would have to call `whenDefined(elementName)` of every child's name just to detect if _only some of them_ are instances of a constructor of interest.
> > 
> > So, if an application has thousands of nodes, this can lead to many Promises leaked inside of `customElements` which the HTML engine is waiting to `resolve()` but will never resolve them.
> 
> This problem still applies with @rniwa's [`whenDefined(elementInstance)` idea](https://github.com/w3c/webcomponents/issues/671#issuecomment-333006549).

-- 
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/671#issuecomment-361034654

Received on Sunday, 28 January 2018 03:09:30 UTC