Emiliano-Bucci/react-spring-carousel-js

Peer dependency warnings

josantana opened this issue · 2 comments

Hello there,

The React Spring documentation specifies that it is a cross platform lib, and it gives us the option to install the right version for each project. By instance, I'm using it for web-only projects, so I've installed @react-spring/web.

When I install your package, I receive a lot of warnings because you're using the entire react-spring library:

Peer dependency warnings

Of course, they would not lead me into errors, but it would be nice to avoid it. I've two suggestions:

  1. Build the lib the same way react-spring does, so we can internally rely on the right react-spring version;
  2. Move react-spring to peer dependency on your package.json, just like you do with React and React DOM.

I think the second one is much simpler. Also, it is a basic scenario. I think most people that will use your package already has react-spring as a dependency anyway.

Thanks for your awesome work.

@josantana Hi, thanks for your feedback and for using the library! :) Regarding your point, I was initially thinking to do something similar. My whole "concern" is that, eventually, for people who don't install react-spring my library won't work; I mean, they would also have to install it manually and in those cases I wanted to avoid them to do it.

Looking this issue -> pmndrs/react-spring#1413, I believe a possible solution could be to rely only on the @react-spring/web package anyway, since this is what this library was created for.