Open jakearchibald opened 5 months ago
So would undefining go through the existing custom elements and change the prototype and even remove shadow DOM, or what?
This is a duplicate of https://github.com/WICG/webcomponents/issues/820, but maybe it's useful to track it in multiple places. As Olli indicates, having something more concrete to evaluate would help.
@smaug----
So would undefining go through the existing custom elements and change the prototype and even remove shadow DOM, or what?
Yeah, my feeling is it would revert the prototypes to HTMLElement
. Obviously any shadow DOM etc left behind would still be there.
@annevk yeeeeeep, this is a dupe. Forgot to check that repo.
What problem are you trying to solve?
Over in frameworks land, hot module replacement allows development servers to seemingly apply changes made in the editor directly onto the the active page, without a refresh, and without losing current state.
This is impossible with web components, because once a component is defined, it's forever-defined. In particular, things like
observedAttributes
cannot be changed.What solutions exist today?
https://open-wc.org/docs/development/hot-module-replacement/, but it notes the following limitations:
How would you solve it?
Being able to programatically 'undefine' a custom element, allowing it to be re-defined with a new class, would solve the limitations encountered by open-wc.
Anything else?
No response