-
-
Notifications
You must be signed in to change notification settings - Fork 430
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
node-sass peer dependency #668
Comments
Already discussed, no, we can't add Oh, my mistake, let' discussion about |
As mentioned the situation is different because optional peer dependencies are a thing now. You could potentially list both |
@arcanis it is bad solution, we will get many issue about this warning |
It would look like this: {
"peerDependencies": {
"node-sass": "*"
},
"peerDependenciesMeta": {
"node-sass": {
"optional": true
}
}
} |
@arcanis |
We can't add something in |
Also we can't break |
We can't use |
At the moment the best documentation is the merged RFC. It's fairly complete so I didn't put up a duplicate page on the website yet.
They wouldn't break, they would start to get a warning. The reason I don't personally see adding something new to
As a side note I'm sure npm would be more enthusiast about fixing things if were held accountable for it (just like we've implemented the optional peer dependencies because we've seen that people were using hacks instead). Hiding warnings under the carpet doesn't help your users.
Note that PnP isn't broken. It works fine, even with My point is that by not listing the peer dependency, you're actively making use of an undefined behavior. It's a dangerous thing, even outside of the PnP mode. Peer dependencies have actual implications regarding how the package manager decides to hoist the packages in the dependency tree, and not listing them leaves the door open to errors super-hard to understand. This issue isn't about PnP (which, again, works fine). I'm just another open-source lover that cares about seeing the ecosystem improve incrementally and in a scalable way instead of building layers of hacks 🙂 |
/cc @arcanis so |
Expected Behavior / Situation
The
sass-loader
package requiresnode-sass
, and as suchnode-sass
should be a dependency (or a peer dependency).Actual Behavior / Situation
The
sass-loader
package doesn't listnode-sass
at all.Modification Proposal
The peer dependency should be listed. I've seen that removing it was a conscious choice in #532, hence why I'm opening this issue rather than a PR (I can open a PR once we agree) cc @gaearon
Note that the problem described in #532 is partially fixed already - Yarn supports optional peer dependencies through the use of the
peerDependenciesMeta
field. We have an intent to implement from pnpm, only remains npm which doesn't communicate much anyway.The text was updated successfully, but these errors were encountered: