WebReflection / linkedom

A triple-linked lists based DOM implementation.
https://webreflection.medium.com/linkedom-a-jsdom-alternative-53dd8f699311
ISC License
1.66k stars 80 forks source link

why it is not allowed to redefine a custom element #148

Closed pYr0x closed 2 years ago

pYr0x commented 2 years ago

i wondering why it is not allowed to redefine a custom element https://github.com/WebReflection/linkedom/blob/main/cjs/interface/custom-element-registry.js#L108-L109

if you have something like a HMR you need to redefine the custom element to see the changes.

WebReflection commented 2 years ago

least surprise ... it encourage using multiple documents if different Custom Elements with same name are needed.

HMR requires the registry itself to be reloaded so there should be no issue whatsoever.

WebReflection commented 2 years ago

P.S. this is also standard Custom Elements Registyr behavior.

pYr0x commented 2 years ago

i don't know why you said linkedom is not too close to the standard, but here you insist exactly on the standard... but ok.

HMR requires the registry itself to be reloaded so there should be no issue whatsoever. i do not see any solution in your answer

WebReflection commented 2 years ago

HMR requires you invalidate previously loaded modules ... that includes the registry, right? I also don't accept any tone that is beyond respectful so you've been warned.

WebReflection commented 2 years ago

https://github.com/WebReflection/linkedom/blob/main/how-to-contribute.md