Expose and make global the node_modules folder #11423
Unanswered
anoblet
asked this question in
Other feature requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
The Home Assistant frontend relies heavily on custom elements. One of the shortcomings of this is that once defined, custom elements cannot be upgraded or replaced.
An example scenario:
@material/mwc-button@^0.20.0
.@material/mwc-select@^0.25.3
Both elements use
@material/mwc-ripple
. When the page loads,@material/mwc-ripple
is not deduped and tries to define itself twice (@material/mwc-ripple@^0.20.0
, and@material/mwc-ripple@^0.25.3
). This will crash with the error:If we were to expose the
node_modules
folder (the same way addon, backups, config...) are exposed, we could dedupe these dependencies allowing for developers to upgrade/install new elements that may or may not share a common dependency.This is a known issue in the custom element community, and there are current initiatives on figuring out how to eliminate these conflicts including scoped custom element definitions and using IFrames to isolate the definitions though those may be far off.
Here's a discussion recently started in the
lit
repository, describing the issue and possible solutions: lit/lit#2432Beta Was this translation helpful? Give feedback.
All reactions