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 is deprecated #47

Closed
necolas opened this issue Mar 29, 2015 · 20 comments
Closed

peerDependencies is deprecated #47

necolas opened this issue Mar 29, 2015 · 20 comments

Comments

@necolas
Copy link

necolas commented Mar 29, 2015

In short, peerDependencies should probably be removed:

See for context: npm/npm#6565

@Couto
Copy link
Member

Couto commented Mar 30, 2015

oh thank god! :)

I'm in lazy mode, since is kinda late already here... so sorry for asking this, but what's the best approach? Just move peerDependencies to regular dependencies?

@necolas
Copy link
Author

necolas commented Mar 30, 2015

Yes I think you can make babel-core a dependency and drop webpack (which doesn't seem to be used by your tests either).

@gaearon
Copy link
Member

gaearon commented Apr 8, 2015

I don't see anywhere in that issue that they are going to be removed. The issue says their behavior will change (no longer automatically installing).

@necolas
Copy link
Author

necolas commented Apr 9, 2015

I didn't say it would be removed :). But babel-core shouldn't be a peerDependency as well as a dependency.

@gaearon
Copy link
Member

gaearon commented Apr 9, 2015

Why not? It's a way to specify compatibility.

@gaearon
Copy link
Member

gaearon commented Apr 9, 2015

If babel-core was moved to dependencies it'd be more complicated to pick specific Babel builds from your app's package.json. Being able to pick a specific build is important for tool like Babel that has large impact on your code.

@necolas
Copy link
Author

necolas commented Apr 9, 2015

Well it's already in the dependencies https://github.com/babel/babel-loader/blob/master/package.json#L7

@Couto
Copy link
Member

Couto commented Apr 13, 2015

It's in the dependencies for consistency with other babel utilities like grunt-babel and gulp-babel

In my opinion babel-core should live in the peer dependencies without requesting a specific version (*) so that users can pick their favorite version, however I'll do like others do to avoid confusion inside the babel's ecosystem.

I'm going, eventually, to remove the current peer dependencies in the next versions.

@necolas
Copy link
Author

necolas commented Apr 13, 2015

Yeah it's tricky, because I agree with gaearon's point (and had similar complaints with jscs-loader). Hah, perhaps peerDependencies is the way to go after all in this case.

@jhnns
Copy link
Contributor

jhnns commented Jul 15, 2015

The current README is misleading because peerDependencies are not deprecated. Auto-installing is deprecated.

And I can confirm @gaearon concerns: It should stay as peerDependencies. I've experienced similar issues with the less- and sass-loader.

@Couto
Copy link
Member

Couto commented Jul 15, 2015

I agree :)

However I can't really fix it right now (or today) if you're up for a PR that should be faster!

@SpaceK33z
Copy link

Is it intended behavior that babel-core now is installed twice in npm 2+? Once as peer dependency and once as normal dependency of babel-loader. babel-core is 21mb...

@gaearon
Copy link
Member

gaearon commented Aug 10, 2015

I don't think it's intended behavior. Delete both, set most recent versions in package.json and run npm install again?

@SpaceK33z
Copy link

That changes nothing, which makes sense, because if you look in the package.json of this package, you will see that babel-core is defined twice as a dependency.

Edit: three times even.

@gaearon
Copy link
Member

gaearon commented Aug 10, 2015

@SpaceK33z lol, you're right! I don't know why.

@sairion Any idea why it's both a peer, a regular, and a dev dep?

@Couto
Copy link
Member

Couto commented Aug 10, 2015

Actually, for no special reason other than it was left forgotten.

A PR is more than welcome, and I'll try to merge as soon as possible, since I am on mobile!

On August 10, 2015 12:30:24 PM GMT+01:00, Dan Abramov notifications@github.com wrote:

@SpaceK33z lol, you're right! I don't know why.

@sairion Any idea why it's both a peer, a regular, and a dev dep?


Reply to this email directly or view it on GitHub:
#47 (comment)

Sent from my Android device with K-9 Mail. Please excuse my brevity.

@SpaceK33z
Copy link

In #94 I've deleted the peer and dev dependency. This would the most consistent option, right? gulp-babel and grunt-babel also only have babel-core as dependency.

@tomasdev
Copy link

Hey guys

I'm getting

± npm install --save babel-loader
npm WARN peerDependencies The peer dependency babel-core@^5.0.0 included from babel-loader will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency 
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm ERR! Darwin 14.5.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "--save" "babel-loader"
npm ERR! node v0.12.4
npm ERR! npm  v2.10.1
npm ERR! code EPEERINVALID

npm ERR! peerinvalid The package babel-core does not satisfy its siblings' peerDependencies requirements!

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/tomas/WORK/Events/events-v2/npm-debug.log

But there's no "xxx@version wants yyy@version" in the npm-debug.log file — Any clue if this might be related to that?

@gaearon
Copy link
Member

gaearon commented Oct 31, 2015

@tomasdev

You probably already have babel-core@6.x and are trying to install babel-loader@5.x. They are incompatible. Stay on 5.x for everything until support comes.

@joshwiens
Copy link
Contributor

For reference - peerDependencies these days are used to convey supported versions of a library where multiple versions can be used. In this case, webpack1.x || 2.xwhich has been removed as adevDependency` bable-core and the es2015 preset are moving into devDeps.

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 a pull request may close this issue.

7 participants