Re: [w3c/webcomponents] Need a callback for when children changed or parser finished parsing children (#809)

@WebReflection your star element example from earlier in the thread, already gave me a clear understanding of your point and honestly it's something my team has been struggling with as well, often resorting to ugly setTimeout hacks. 

What I was trying to learn is the counter argument to this, which might not be immediately obvious if it comes down to performance or some other browser internals. By going through #550 as suggested by Domenic, I found this comment to be the most informative:

> As I've numerously stated in various threads & issues, the right approach is for the child to report its insertion to the parent. Waiting for all children to be parsed in order to initialize is never a good idiom because the HTML parser may pause for seconds at a time when there is a network delay.
>
> We used to have code like that in our builtin element implementations and we still do in some cases (due to historical reasons) but almost all such code end up causing bugs. It's simply not the right pattern by which to write an element.

_Originally posted by @rniwa in https://github.com/w3c/webcomponents/issues/550#issuecomment-458395228_


(P.S: I also wanted to avoid adding noise, which seems I have failed in doing 😅)

-- 
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/809#issuecomment-534119444

Received on Monday, 23 September 2019 14:18:26 UTC