-
Notifications
You must be signed in to change notification settings - Fork 206
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
Component installations may need manual version resolutions #1228
Comments
Yes, this is a situation where I wish we had a better answer for consumers. This situation arises from the fact that package managers count ever feature (0.x.0) release pre-1.0.0 as breaking and assume you can't upgrade across those versions. With that assumption comes the possibility of supplying you with sub-dependencies that mismatch. In some projects, the worst problem that causes is duplicated code for you consumers, for web components that can cause the You
A more "wholistic" workaround would be to rely on THE answer to this situation is for us to get past 1.0.0 in the versions for all of our packages so that semver and package managers can once again do their jobs and resolve all of these things on their own. We're attempting to solidify what would be needed to make this try either at the full project level or at the individual package level via https://github.com/adobe/spectrum-web-components/projects/1 and #865 where we would absolutely love your insight into what would make these packages "stable" and/or "complete" from your perspective. As you'll notice from the conversations to date, the main areas of concern at this moment are:
In that long term world you shouldn't need to "install" the latest version of things, the latest version of what's needed for you project will be resolved to, and we'd like to get to a place of guaranteeing that as soon as it viable. In the meantime, we leverage Knowing this situation, is there anything else that we could be doing/documenting/etc at the library level to further support you finding success in your work? |
Thanks for the thoughtful & comprehensive reply! So far, I've been following the second pattern you mentioned (
TIL about Regarding v1.0, my experience sketching out a reasonably complex UI with SWC has been brilliant. It's already as stable and unsurprising as any of the alternatives I've tried (material, ionic, various in-house component libraries). It's unusually internally-consistent, and aspects that I honestly didn't expect to work out-of-the-box (theming, adapting global dimensions for mobile, a11y-by-default) just did. In my work with it, I've come up with several nice-to-haves, but none are "1.0"-level:
My main 1.0 ask is already covered in #1189. A non-select-stateful menu is just too common of a control not to have. |
Excellent to hear, we’ll keep charging forward and have a solid plan to share soon then. FYI: In https://opensource.adobe.com/spectrum-web-components/components/slider/api check out |
Oh, another thing I ran into that seems like a "1.0" component (so much so that I think it's probably there and I'm missing it) is a non-dropdown https://webcomponents.dev/edit/br27MZF5BQMA7wEGWjW5/src/index.ts |
Check out some ongoing work outlined by #1189 I’ll pass this feedback to @adixon-adobe who's working on that, and I think the work therein might empower this. |
Expected Behaviour
The latest version of all components depend upon the latest versions of all other components, avoiding duplicate registrations of the same component via multiple included versions.
Should this be expected?
It's been working so far, but maybe that's not a guarantee the library makes.
Actual Behaviour
Without overriding transitive dependencies in package.json via resolutions, some combinations of components are incompatible.
The multiple installed versions lead to
Uncaught DOMException: Failed to execute 'define' on 'CustomElementRegistry': the name ${tagName} has already been used with this registry
errors.Steps to Reproduce
create a package.json:
install packages with
yarn
, then run:and:
You can also see this with
yarn list
, which will show the multiple versions of both "overlay" and "popover."Because of the multiple versions,
customElements.define
will be called multiple times by different versions of overlay/popover, and the second invocation of each will fail. (bundle sizes will also be increased)Platform and Version
Workarounds
As long as the components pointing to older versions of component dependencies are compatible with the newer versions, you can force the newer versions to be installed everywhere via
resolutions
inpackage.json
. For example:The text was updated successfully, but these errors were encountered: