3 ms·
My only issue with Web Components is that, by design, they need to be registered with a globally unique tagname and can't be unregistered. It's a reasonable co
by wildpeaks 2mo ago
My only issue with Web Components is that, by design, they need to be registered with a globally unique tagname and can't be unregistered.
It's a reasonable compromise given the original purpose of custom elements, but in practice it ends up more maintainable to be inspired by its structures without using real custom elements despite I was initially excited that jsdom supports custom elements nowadays.
- mock-possum 2mo agoWhy is the uniqueness constraint of tag names a problem?
- cube00 2mo agoThe scoped custom element registries proposal covers some of the use cases where global elements are problematic https://github.com/WICG/webcomponents/blob/gh-pages/proposals/Scoped-Custom-Element-Registries.md#why-do-developers-need-scoped-custom-element-registries https://github.com/WICG/webcomponents/blob/gh-pages/proposal...
- cube00 2mo agoScoped custom element registries should help with this letting you register to a shadow root instead of globally. [1] Unfortunately Firefox hasn't come to the party yet. [2] [1]: https://developer.mozilla.org/en-US/docs/Web/API/Web_components/Using_custom_elements#scoped_custom_element_registries https://developer.mozilla.org/en-US/docs/Web/API/Web_compone... [2]: https://bugzilla.mozilla.org/show_bug.cgi?id=1874414 https://bugzilla.mozilla.org/show_bug.cgi?id=1874414