Skip to content
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

peerDependencies #98

Closed
brigand opened this issue Jul 21, 2014 · 7 comments
Closed

peerDependencies #98

brigand opened this issue Jul 21, 2014 · 7 comments

Comments

@brigand
Copy link
Contributor

brigand commented Jul 21, 2014

I got some clarification on the peer dependencies issue.

It appears there's a semver caveat for 0.x.x versions where compatible means the same minor version, so ^0.10.0 is >=0.10.0 and <0.11.0, but I thought it meant >=0.10.0 and <1.0.0.

I apologize for the incorrect pull request.

"react": ">=0.10.0<1.0.0" would give the correct behavior, or simply "react": ">=0.10.0".

@bobeagan
Copy link
Contributor

👍 to moving back to peerDeps with the modified version target

@mjackson
Copy link
Member

is there a way to install peerDependencies using npm install ? I can't find it.

@mjackson
Copy link
Member

We actually depend on React for a few things (i.e. we require('react/lib/...')), so it is an actual dependency. How does us moving to peerDeps help you?

@jlongster
Copy link
Contributor

Right now, I have to fork react-nested-router and remove the react dependency to use it. I bundle everything with webpack and using this library bundles a whole other copy of React inside it, which is a non-starter.

Peer deps was initially meant to solve this, but a lot of people don't like them (in some cases it can force bad package installs or something, not sure). When I write plugins, I just don't specify a dependency at all, and just state the minimum version that it can be used with in the docs. If the user installs react, and then react-nested-router, all the require('react') calls in this library will resolve to the user-installed one.

If you want, you still could use peer deps. Just change the version to ">=0.10.0" instead of "^0.10.0" as stated in the original comment.

@mjackson
Copy link
Member

Thanks for the explanation @jlongster. I think I get it now. :)

@jlongster
Copy link
Contributor

Damn, that was fast :)

@ryanflorence
Copy link
Member

when @jlongster starts using your library, there is no time for shenanigans.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants