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
Declare drivers as optionalDependencies (Fix #3059) #3081
Conversation
So what does yarn --pnp does in this case? pack all the optional drivers to .pnp.js ? I asked those questions in #3059 because I really would like to know what actually happens :) |
I PR'd this to be more explicit about the changes involved. Also that made me actually check what was happening in practice, as you asked. The problem with optionalDependencies is that npm or yarn (even in --prod mode) try to install all of them and don't fail if they can't. That's why the "peerDependencies" + "peerDependenciesMeta" was implemented by yarn: it silence the warnings about uninstallable peer dependencies, and do both the job of not installing the modules that are not already installed, and properly setup .pnp.js with the peerDependencies that are actually available. |
Please don't merge this PR, it's work in progress. |
The problem with peerDependenciesMeta is that it's not supported by npm, and there is no sign showing it will be soon. However missing peerDependencies only shows warnings, not failures, and i think most npm users just use them as hints when something goes wrong. |
@kapouer Is this PR still work in progress? And if yes, what are the blockers? |
It can be merged, however it might make npm users yell about the warnings. |
Wondering if this could get merged. I'd like to migrate a project to using Yarn PnP, and I'd love to be able to use it without forking this project. |
Update: npm/cli#224 now peerDependenciesMeta is supported by npm ! |
Woohoo! |
Wait, |
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.
Please bump driver versions
Done. I supposed no new driver has been added since march 2019. |
Thanks! |
@jthn Released in 0.20.1 |
It's supported but still prints a WARNing. |
Fix #3059
This is a simpler approach using optionalDependencies.
It's already supported by npm, and yarn --pnp is happy with it.