You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This discussion is to follow up on our conversation around bundling and to help us define a common understanding on how to use dependencies in our packages.
Let's discuss
Please add your comments on which scenarios you consider we use a dependency as a devDependency, Dependency or PeerDependency
For example:
My understanding of peerDependencies is ...
I think we should use this dep as a peerDependency because ...
We should not use this dep as a dependency because ...
Based on this we can write a guide on how to move forward.
Some Initial Context
Yarn Definitions
The following are literal definitions taken from yarn
dependencies
These are your normal dependencies, or rather ones that you need when running your code (e.g. React or ImmutableJS).
devDependencies
These are your development dependencies. Dependencies that you need at some point in the development workflow but not while running your code (e.g. Babel or Flow).
peerDependencies
Peer dependencies are a special type of dependency that would only ever come up if you were publishing your own package.
Having a peer dependency means that your package needs a dependency that is the same exact dependency as the person installing your package. This is useful for packages like react that need to have a single copy of react-dom that is also used by the person installing it.
When a user installs your package, npm will emit warnings if packages specified in peerDependencies are not already installed. The peerDependenciesMeta field serves to provide npm more information on how your peer dependencies are to be used. Specifically, it allows peer dependencies to be marked as optional.
Other information
peerDependencies seem to have been created to use for plugins.
Please follow up our Including Lit as a dependency discussion for more context on how each of this impact our project.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
This discussion is to follow up on our conversation around bundling and to help us define a common understanding on how to use dependencies in our packages.
Let's discuss
Please add your comments on which scenarios you consider we use a dependency as a
devDependency
,Dependency
orPeerDependency
For example:
My understanding of
peerDependencies
is ...I think we should use
this dep
as apeerDependency
because ...We should not use
this dep
as adependency
because ...Based on this we can write a guide on how to move forward.
Some Initial Context
Yarn Definitions
The following are literal definitions taken from yarn
dependencies
These are your normal dependencies, or rather ones that you need when running your code (e.g. React or ImmutableJS).
devDependencies
These are your development dependencies. Dependencies that you need at some point in the development workflow but not while running your code (e.g. Babel or Flow).
peerDependencies
Peer dependencies are a special type of dependency that would only ever come up if you were publishing your own package.
Having a peer dependency means that your package needs a dependency that is the same exact dependency as the person installing your package. This is useful for packages like react that need to have a single copy of react-dom that is also used by the person installing it.
From node blog
peerDependenciesMeta
From npm
When a user installs your package, npm will emit warnings if packages specified in peerDependencies are not already installed. The peerDependenciesMeta field serves to provide npm more information on how your peer dependencies are to be used. Specifically, it allows peer dependencies to be marked as optional.
Other information
peerDependencies
seem to have been created to use for plugins.Please follow up our Including Lit as a dependency discussion for more context on how each of this impact our project.
Beta Was this translation helpful? Give feedback.
All reactions