An attempted taxonomy of web components
zachleat.com
zachleat.com
That said, this is actually closer to the actual original idea of web components [1] than the "react is bad frameworks are bad use the platform" chorus of recent years [2].
[1] See this original talk (and transcript) by Alex Russel sometime in 2011: https://fronteers.nl/congres/2011/sessions/web-components-an...
[2] Which is ironic because web components are extremely bad at using the platform themselves https://threadreaderapp.com/thread/1717580502280867847
Seems like each component has its own shadow DOM that gets fired up. This would be fine under normal circumstances, but we use a tool called Cohere (now Cardina after the Ramp acquisition) which listens to the DOMContentLoaded [1] event.
Looking at flame graphs, this event, when fired, seems to cause Cohere to traverse the DOM. This becomes very expensive when you are loading something like an Ionic grid, with lots of rows and columns. Unfortunately this Cohere code lives within a dynamic JS module that they load at runtime, which is proprietary, so there isn't a way to submit a PR to change the behavior.
I'd love if someone knew more about that event in the context of the shadow DOM in particular. Perhaps there is a way to limit its invocation through the Web Component API.
[1] - https://developer.mozilla.org/en-US/docs/Web/API/Document/DO...
https://developer.mozilla.org/en-US/docs/Web/API/Event/stopP...
Immediately after the section about javascript-only web components is an interesting takeaway.