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

Use peerDependencies instead of dependencies #24

Closed
wants to merge 1 commit into from

Conversation

hlehmann
Copy link

This would avoid conflict and redundancies with other libraries.

This would avoid conflict and redundancies with other libraries.
@urish
Copy link
Owner

urish commented Mar 25, 2016

Hi, thanks for your contribution! Can you point out why peerDependencies make more sense?
Also, are there any other angular2 modules who took this approach? If there is a discussion or a blog post about this, I would love to read it and learn...

Thanks!

@hlehmann
Copy link
Author

As anguar2 is a major library, peerDependencies let the developer have the final choice of the version (or not to install it) and also avoid that two different versions are installed. We expect to have a better control of client side libraries due to size constraints.

Some using peerDependencies

Ionic still use "dependencies".
Lot's doesn't precise angular at a dependency at all or use devDependencies.

I find an old article : https://nodejs.org/en/blog/npm/peer-dependencies/

It's finally hard to find unanimity, but peerDependencies or devDependencies seems to give more control.

@urish
Copy link
Owner

urish commented Mar 25, 2016

Thanks the references @hlehmann!

I am going to do a little more research on the subject and then see what the best option would be for angular2.

What about moment?

@hlehmann
Copy link
Author

Well if it's important to avoid multiple versions of a dependency, which is the case for client libraries, I would put moment in peerDependencies too.

@urish urish closed this in 768a2f1 Mar 26, 2016
@urish
Copy link
Owner

urish commented Mar 26, 2016

Ok, we will start with angular2 for now, and see about moment later.

Thanks for the input!

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

Successfully merging this pull request may close these issues.

2 participants