-
Notifications
You must be signed in to change notification settings - Fork 396
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Flag to disable upgradable constructor #3202
Comments
This issue has been linked to a new work item: W-12152305 |
One tricky part will be getting this to work in the Karma tests. A few options:
I'm leaning toward #3 or #4. /cc @jmsjtu |
If we do this, we will want to remove this line, so that the lwc/packages/@lwc/engine-dom/src/renderer.ts Lines 33 to 34 in dfae644
Incidentally this should be fine per the comment, because the shared global cache would be gone. |
By default, we define a custom element with an "upgradable constructor":
lwc/packages/@lwc/engine-dom/src/custom-elements/create-custom-element-vanilla.ts
Lines 27 to 44 in f817a04
This allows us to define multiple LWC components with the same tag name.
However, maybe we should just register one LWC component per tag name. In other words, this would fail:
Benefits:
attributeChangedCallback
s for each component Components do not respect observedAttributes/attributeChangedCallback #2972document.createElement('x-foo')
to work Component constructors cannot be new-ed #2970To achieve this, we can add a runtime flag (e.g.
DISABLE_UPGRADABLE_CONSTRUCTOR
)./cc @caridy
The text was updated successfully, but these errors were encountered: