Re: [whatwg/dom] Custom element callback/promise for "connected and parsed" (#662)

> I don't feel strongly about this, so I'll leave it for others to add use cases.

I can help with that. 😄 One good use case might be in my Svelte custom element polyfill, [`svelte-retag`](https://github.com/patricknelson/svelte-retag/). Essentially, it was built to support slots in the _light DOM_, among other things (one of its core differentiating features from Svelte's existing custom elements).

Doing this _well_ is of course a bit tricky if you're balancing performance concerns. Funny enough, my workaround ended up looking a bit like, uh... a light "shadow" DOM of sorts... in order to efficiently get out of the way of the parser to facilitate rendering ASAP (at least on the next `rAF`). [Demo here](https://svelte-retag.vercel.app/iife.html). I also [wrote in some detail](https://github.com/patricknelson/svelte-retag/issues/20) about it if you're at all interested.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/issues/662#issuecomment-1848266384
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/dom/issues/662/1848266384@github.com>

Received on Saturday, 9 December 2023 06:46:21 UTC