Re: [whatwg/dom] Make it possible to observe connected-ness of a node via MutationObserver (#533)

@annevk I'm not proposing any particular solution, just trying to describe why we need this, and what are the options today that do not fulfill those use-cases.

To be more specific about use-cases, I have one main user-story for the sync version of the connect-ness detection:

> as a developer, I can emulate what you can do with a custom element callbacks without requiring to use a custom element.

The use-cases are various, here are a few:

* frameworks and libraries that do not use custom elements, requires a recursive search on subtrees to trigger their own disconnect hook even though not all elements use that hook.
* frameworks and libraries that create node-trees during the diffing algo, and later on install them at once into the document, will have to either a) trigger the connect hook when the element is added to its parent (even though it is not really in the doc yet - usually this is the solution), or b) recursively search in the virtual tree for vnodes that requires connect hook, to trigger that after the root was inserted into the dom, or c) never do node-trees in memory, always create them in the actual document (which has perf implications).
* polyfilling custom elements, or emulating custom elements in general, is impossible without hacking many APIs today.

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

Received on Tuesday, 14 May 2019 15:52:48 UTC