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

Make angular and moment as peerDependencies #41

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Sauloxd
Copy link

@Sauloxd Sauloxd commented Mar 15, 2019

Motivation

Problem 1:
When my webpack bundles this package, it requires another whole angularjs as the md-picker
image
This could be resolved if I just add angularjs as an external by webpack so it bypass this (and all) angularjs require. But other libs take this approach and I also think it's better.

Problem 2:
Another issue is the #40 .
It is already using moment from the global window, so it is already a peerDependency.
Updated to latest, and no problems were seen in the built demo

Problem 3:
Make demo reference node_modules instead of deprecated bower_components. Needed to install angular-{aria,animate,message} as devDependencies

@dpoetzsch
Copy link
Owner

Your idea seems logical to me. From what I understand, a peer dependency is actually what we want.

However, shouldn't angular-material be a peer dependency as well? And what about angular-{aria,animate,message}?

Also, to make this repo work in development mode, I think one has to add angular and moment to devDependencies as well, no? In this case, the versions should be the ones from the peer dependencies. The same should be true for angular-{aria,animate,message}, no? At the moment I have angular 1.6 installed in dev environment, but angular-{aria,animate,message} in version 1.7.x, I feel this cannot be good.

@BaldemarJanrain
Copy link

BaldemarJanrain commented Jan 9, 2020

@dpoetzsch If you look at the repo you forked from, you'll see that package.json does not contain any angular nor moment dependencies, only gulp-* related. In the bower.json is where you want to have your dependencies needed to develop. When you import the component you'll get a WARNING: Tried to load AngularJS more than once. message because of this dependencies being required in the package.json.

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.

3 participants