xiel / embla-carousel-wheel-gestures

wheel interactions for Embla Carousel
https://embla-carousel-wheel-gestures.xiel.dev/react.html
MIT License
57 stars 9 forks source link

Remove Peer Dep #174

Closed Eben-Hafkamp closed 1 year ago

Eben-Hafkamp commented 1 year ago

Describe the bug

After installing the embla-carousel-wheel-gestures plugin and using it successfully with embla-carousel-vue I keep getting npm warnings because embla-carousel is a peer dependency of the embla-carousel-wheel-gestures package.

Steps to reproduce

  1. Install embla-carousel-vue
  2. Install embla-carousel-wheel-gestures
  3. See the warnings in the terminal

Expected behavior

xiel commented 1 year ago

@Eben-Hafkamp Mh... interesting. Do you use npm, yarn, pnpm? Isn't embla-carousel-vue installing the base package embla-carousel as it's dependencies?

Sadly the peer dependencies are a bit messed up in my experience (in general).

Eben-Hafkamp commented 1 year ago

Hey @xiel I am using pnpm and I can confirm that embla-carousel-vue is listing embla-carousel as an internal dependency. I'd prefer to keep it there, instead of downloading the library myself in order to avoid confusion within the project.

I've also had mixed experiences with peer deps in the past but I can see its usefulness. As it stands though, there are around 5 flavours of the library so I'm assuming anyone not using the base JS version will also be getting these warnings.

Do you think another package manager will recognise the embedded library? From my understanding pnpm does a good job of bundling mutual libraries.

xiel commented 1 year ago

I will need to test that again. The problem is the base package is a dependency of this plugin. So it should either be declared as a peer dep or a normal dep.

Behavior I've seen with yarn before was, that for example a project had a base package installed, and later installed a plugin with the base package as a real dependency. Then the later install would install the base package again with a newer version, without deduplicating. And one ends up with two installed versions of the same package.

davidjerleke commented 1 year ago

@Eben-Hafkamp have you tried installing any of the other plugins? Does that trigger any warnings?