-
Notifications
You must be signed in to change notification settings - Fork 265
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
Remove prop-types from peer dependencies #87
Comments
This project does |
@robmadole Yes OK.. but why is it a I'm sure I've just misunderstood something, but to me PropTypes is optional, if FontAwesome needs it then it should be its dependency. |
@cristianrgreco you might have a specific version of |
Like @cristianrgreco, I also do not use PropTypes as I'm using TypeScript and don't need it in my project. I came here wondering what was up and found this issue. This seems to be a wart in npm publishing imho as I should not be forced to depend on it if I'm not using it. The (ugly) workaround to this issue for me is: This way, my project doesn't actually depend on it and yarn doesn't throw warnings. |
Ok @lookfirst perhaps I'm missing something then. Because this project uses PropTypes: https://github.com/FortAwesome/react-fontawesome/blob/master/index.es.js#L2 So are you suggesting that we remove this? Why is this an ugly workaround to install peer dependencies for a project that uses it? |
@robmadole I think you just said it, if it's a dependency for fontawesome then it should be listed as such. To the argument of 'the client may use a different version of a dependency'; can't the same be said of all dependencies? I would assume NPM raises some issue if the user installs an incompatible version. |
@cristianrgreco sure, you could say the same about any dependency. And one of the core benefits of the way that NPM handles dependency resolution is that your 3rd party libraries have guarantees that a compatible version of what they need will be available. However with our |
I'm just a clueless yarn user, but if this project uses a In this case, it is not only listed as a I don't know the absolute right solution here and it really isn't in my interest to argue about it. I found a workaround that is good enough for me. Cheers. |
Hi all, This confusion is common and happened before in several other projects. Here are some of the note I gather from those occasions: From the README of
Also in facebook/prop-types#44, it's said:
Also from the same person in cssinjs/react-jss#164:
I personally think it makes more sense to include it in |
So my objection to this is that there is a mechanism that is documented, well supported, and mature for handling this exact use case. I do understand the pragmatism of listing it in I'd be happy to change our documentation to mention this to smooth out some of the rough corners of this. But I'm not convinced that this is an issue. I don't think it's unreasonable to expect someone who wishes to use this library to take 5 minutes and understand peer dependencies. Maybe I'm being grumpy or unreasonable (or un-empathetic). |
I mean, inclusion in
I've never encountered
EDIT: also need to point this out if Currently |
@robmadole Please re-open and fix, @panjiesw details things extremely well. |
Ok, I'll cry uncle :) I'll get this change made. |
Ok, dependency was moved in 0.0.19 and 0.1.0-10. |
Thanks Rob. =) Node is a never ending battle of dependency brittleness and the more we can do to just reduce necessary dependencies, the better. Just today, |
Yep, it's not an easy problem to solve 😃 |
Really appreaciate it @robmadole! |
My project doesn't use prop-types, is there a reason why it's a peer dependency?
The text was updated successfully, but these errors were encountered: