mirror of
https://github.com/jlengrand/open-wc.git
synced 2026-03-10 08:31:19 +00:00
fix(dev-server-hmr): fix compatibility with scoped-elements
This commit is contained in:
committed by
Lars den Bakker
parent
f82795726e
commit
4c6447a934
@@ -90,9 +90,12 @@ export class WebComponentHmr extends HTMLElement {
|
||||
constructor(...args) {
|
||||
super(...args);
|
||||
const key = keysForClasses.get(this.constructor);
|
||||
const p = proxiesForKeys.get(key);
|
||||
// replace the constructor with a proxy that references the latest implementation of this class
|
||||
this.constructor = p.currentProxy;
|
||||
// check if the constructor is registered
|
||||
if (key) {
|
||||
const p = proxiesForKeys.get(key);
|
||||
// replace the constructor with a proxy that references the latest implementation of this class
|
||||
this.constructor = p.currentProxy;
|
||||
}
|
||||
// replace prototype chain with a proxy to the latest prototype implementation
|
||||
replacePrototypesWithProxies(this);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user