-
Notifications
You must be signed in to change notification settings - Fork 112
Remove @types packages from peerDependencies #104
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
Conversation
This project uses typescript in its development - but by the time it's published to NPM, it's compiled down to vanilla JS. The @types packages which were specified in peerDependencies would be useful for consumers that use typescript, but: 1. those users will already know to install those @types packages, because that's how React and Angular get their types, and 2. the users who _don't_ use typescript will get warnings Those types are more accurately peer dependencies _for React and Angular_, and _only when tuypescript is in use_. In order to kill off those extraneous warnings, I've removed those packages from peerDependencies. It should have no impact on the package itself, only the warnings produced when installed.
|
TypeScript doesn't have a great story here. Ideally, we'd detect when the consumer is using TS and install peerTypes automatically (Yarn is moving in that direction). Until then, I'd prefer to keep this as-is: the trade-off is hard-to-debug errors for TS users vs. ignorable warning messages for non-TS users; my hunch is it's better to optimize for the former in this case. Thanks for taking the time to contribute, and sorry if this isn't the outcome you wanted! |
bcherny
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
^
|
Thanks for the response! Obviously, that's your perogative. That being said... if you don't mind, I'd like to present a counter-argument, if for no other reason than a sense of completeness on this PR. The first one is on ignorable warnings. I respect the sentiment of what you're saying - especially in this case, the warnings can be safely ignored. However, if a project begins accumulating warnings, then all warnings begin getting ignored, simply on human nature. If running In the case of The second one is on the utilitty. I'd suggest that the vast, vast majority of projects that use Angular or React, in conjunction with TypeScript, will already have There's nothing about In short: most TypeScript users will already have those Again, totally up to you - this isn't my project, and your reasons aren't necessarily invalid. Sorry for writing a bit of an essay here, and I hope it makes sense. |
|
I might be missing something here, but Including dependencies that are only used for development as It communicates to the consumer of the package, that something is missing, which they need to install. But really they don't, as they are consuming transpiled ES5 not TypeScript(?) Perhaps adding information about the necessary |
|
guys, I know this is fairly minor but can this not be merged? We also do not use typescript and yet get this warning. I'd ideally like to get rid of all warnings for my project from the console but this is a blocker |
|
Going to close this. Seems like it'll never be merged, so might as well declutter. |
This project uses typescript in its development - but by the time it's published to NPM, it's compiled down to vanilla JS. The @types packages which were specified in peerDependencies would be useful for consumers that use typescript, but:
Angular get their types, and
Those types are more accurately peer dependencies for React and Angular, and only when typescript is in use. They probably don't belong on this package, which simply uses whatever version of React and Angular it gets.
In order to kill off those extraneous warnings, I've removed those packages from peerDependencies. It should have no impact on the package itself, only the warnings produced when installed.