-
-
Notifications
You must be signed in to change notification settings - Fork 244
TypeScript 3 peerDependencies warning #133
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
Comments
Not a bad idea. But I think actually removing them from peerdeps would be better: #109 |
I wasn't aware ts-loader didn't have a peer dependency on typescript, do you know why? Peer dependencies are meant to signify dependencies used with plugins and tools that can have different versions, removing it from peer dependencies is not a good idea unless this plugin can somehow use all of typescript's features without typescript installed, like with a remote web service. |
I'm not completely sure - sorry. That said, given peerDependencies only trigger a warning in an (already noisy) install log I don't think they provide a ton of value. Particularly given the current situation which has prompted this discussion: i.e. there's a new version of TypeScript and because of the major version increment, we now need to ship a new version of fork-ts-checker-webpack-plugin just to silence the noise. Yeah, it's situations like this that make me less keen on peerDependencies! |
I agree that the noise isn't ideal, but as I mentioned in #102 (comment) I think the safest option is to continue using peerDependencies, and it makes more sense to me semantically. If I understand correctly, this package only works when TypeScript is manually installed by the user, and peerDependencies remind users to install shared dependencies manually. If you want to automatically install peerDependencies in npm 3+, there's a handy install-peerdeps package. Note that peerDependencies on TypeScript are typical in type packages and tools like TSLint. If you don't want to have to update the peerDependencies to support new major versions, it's best to use "peerDependencies": {
"tslint": ">= 4.0.0",
"typescript": ">= 2.1.0",
"webpack": ">= 2.3.0"
} |
If you want to submit a PR with |
I would not agree with you. I think it depends on user preferences - for example, I always check peer dependencies when I install a new package. I remember when webpack bumped version to 3.0.0 we had to do some changes in this plugin to make it compatible so it's not only dumb warning :) |
Okay cool - so shall we merge this PR? 😄 |
@piotr-oles peerDependencies says what OTHER dependencies should be, and npm no longer installs them automatically. This means that updating a restriction to support a new version of TS still requires a manual upgrade to the new version of TS separately, so you would still be aware of breaking changes in other packages. That being said, peerDependencies should still reflect what the package that has them (this one) is known to support, though I've seen some packages use less restrictive version ranges and warn users in the readme when some versions haven't been officially tested. |
If this project officially supports TypeScript 3, its peer dependencies should be updated to allow it.
The text was updated successfully, but these errors were encountered: