Re: [w3c/webcomponents] connectedCallback timing when the document parser creates custom elements (#551)

> Alternatively, we could add something like finishedParsingChildrenCallback 

I think nobody needs that, but `createdCallback` from V0 would be already great, assuming it triggers as soon as the live node has been parsed so that if the CE is defined upfront, it won't trigger until the end of the node is reached, and if the CS is defined after, it triggers as soon as the browser can access its content.

Basically your solution to put an element at the end of a Custom Element to know if its ready should be backed in the Custom Element API itself, not a per-developer responsibility, since that's the moment any custom element would like to setup.

Those created procedurally via JS can trigger the same thing via tick so that adding nodes on the fly synchronously would be still possible and the component can initialize itself properly right after.

If `createdCallback` from V0 is a bad name due history, let it be `contentParsedCallback` or even `readyCallback` so that at least the standard would provide a universal way to setup CEs without needing mandatory ShadowDOM to be consistent (yet with same problem if there was content inside the node or not during its construction/upgrade).

-- 
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/551#issuecomment-429476158

Received on Friday, 12 October 2018 22:08:27 UTC