-
Notifications
You must be signed in to change notification settings - Fork 810
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
fix(node): add optional peer dependencies for the default plugins #1853
Conversation
Yarn PnP requires all dependencies loaded at runtime using `require()` to be declared. Dependencies that are "optional" like these plugins can be declared as a "peerDependency" that is optional.
Codecov Report
@@ Coverage Diff @@
## master #1853 +/- ##
==========================================
- Coverage 92.63% 92.61% -0.02%
==========================================
Files 174 174
Lines 6054 6054
Branches 1288 1288
==========================================
- Hits 5608 5607 -1
- Misses 446 447 +1
|
Wow I didn't know about the being able to make these optional. Does it then suppress warnings typically emitted if peer dependencies are missing? |
Yeah, that's exactly why this was added. See also: |
ok but why you are trying to add this to node package ? |
When the |
The dependencies have to be listed on the package that calls |
please hold with this, very soon node package will not have PluginLoader anymore -> #1760 |
I think this is a good idea while we wait on #1760 which will take a while to implement. |
Yarn PnP requires all dependencies loaded at runtime using
require()
tobe declared. Dependencies that are "optional" like these plugins can be
declared as a "peerDependency" that is optional.
By adding the default plugins as peer dependencies we should get this to work with yarn pnp out of the box, at least for those plugins.