- From: Nicolas Gilbert <notifications@github.com>
- Date: Thu, 13 Apr 2023 11:30:58 -0700
- To: WICG/webcomponents <webcomponents@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
- Message-ID: <WICG/webcomponents/issues/989/1507439146@github.com>
> fwiw, I think in practice registry inheritance is only going to be of much use when there is component inheritance and the base component uses child components itself. I think this is a fairly rare situation in the code bases I've seen, which haven't features deep class hierarchies where the base classes also creates shadow DOM. I might be missing something here, so I'll try make sure I understand. Here a common setup I've encountered with web framework: A developer works on a component that will be consumed in an unknown context. To avoid any chance of conflict, this component will use a scoped registry and avoid assuming global definitions altogether. Inside this component, elements will be used from various sources: a 3rd party component library, company level components, department level components, and some local component private to the current component. Let's assume a couple hundred components, which is conservative in my experience. In an ideal world, only components actually used in the component would be defined. But in real world, it may be difficult to know which components are used deeply, so this developer would like to define every known component. In this scenario, my understanding is that there will as many definitions on this registry as there are components available, is that correct? There may be many, many such components in an application. > And 2000 component definitions is a massive number that I haven't even seen in the largest apps. Photoshop uses ~100 on most pages, YouTube a couple hundred. Actually, the highest benchmark uses 2000 scoped custom element in the DOM, using 200 global definition definitions + 5 definitions specific to each registry scope. Again, nothing scientific, but still realistic I believe. 2000 custom elements may seem a lot, but if you have 100 elements in your DOM that use each 10 components that in turn use 2 elements, and each are scoped, you have 2000 scoped custom elements. -- Reply to this email directly or view it on GitHub: https://github.com/WICG/webcomponents/issues/989#issuecomment-1507439146 You are receiving this because you are subscribed to this thread. Message ID: <WICG/webcomponents/issues/989/1507439146@github.com>
Received on Thursday, 13 April 2023 18:31:03 UTC