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
{{ message }}
This repository has been archived by the owner on Jun 17, 2024. It is now read-only.
So when I look through the package.json of your OSS projects and others (in this case, glamorous), I notice that many will add certain packages they depend on as peerDependencies instead of just dependencies. I'm curious to what the benefit is of this - at first glance, it just makes the user go through one more install step. Thanks!
The text was updated successfully, but these errors were encountered:
Hi @chrisdhanaraj,
You're correct! The user doeshave to go through one more install step. But you could also think of it as: "The user gets to go through one more install step." Specifically, that the user gets to choose which version of the peerDependency they want to use. Especially for React-based projects, it's better for them to list React as a peerDependency because you don't want each of your component libraries to bring all of React with them. It's like making a batch of cookies. You already have the flour, and you don't want the sugar to bring flour with it too. The flour is a peer-dependency of the sugar.
For glamorous specifically, I didn't want to bundle glamor with it because I see them as complimentary. I want people to use glamor directly in their app when it makes sense, and glamorous in other places. They interop so well together, and serve different use cases.
So when I look through the
package.json
of your OSS projects and others (in this case, glamorous), I notice that many will add certain packages they depend on as peerDependencies instead of just dependencies. I'm curious to what the benefit is of this - at first glance, it just makes the user go through one more install step. Thanks!The text was updated successfully, but these errors were encountered: