Skip to content
This repository was archived by the owner on Jan 18, 2022. It is now read-only.

vue-template-compiler as a peer dependency #126

Merged
merged 7 commits into from
Sep 26, 2017

Conversation

oligot
Copy link

@oligot oligot commented Aug 25, 2017

vue-template-compiler is now a peer dependency instead of a direct dependency.
This allows the user to pin vue-template-compiler to a specific version instead of relying on the implicit upgrades from a semver caret range.

Without this change, updating Vue.js to version 2.4.2 can result in
errors like this:

Vue packages version mismatch:

  • vue@2.4.2
  • vue-template-compiler@2.4.1

This may cause things to work incorrectly. Make sure to use the same version for both.
If you are using vue-loader@>=10.0, simply update vue-template-compiler.
If you are using vue-loader@<10.0 or vueify, re-installing vue-loader/vueify should bump vue-template-compiler to the latest.

This was first reported in vue-loader and later fixed in version 10.0.0.

There is also an open issue on vueify but it's not currently fixed.

`vue-template-compiler` is now a peer dependency instead of a direct dependency.
This allows the user to pin `vue-template-compiler` to a specific version instead of relying on the implicit upgrades from a semver caret range.

Without this change, updating Vue.js to version 2.4.2 can result in
errors like this:

Vue packages version mismatch:

- vue@2.4.2
- vue-template-compiler@2.4.1

This may cause things to work incorrectly. Make sure to use the same version for both.
If you are using vue-loader@>=10.0, simply update vue-template-compiler.
If you are using vue-loader@<10.0 or vueify, re-installing vue-loader/vueify should bump vue-template-compiler to the latest.

This was first reported in
[vue-loader](vuejs/vue-loader#470) and later
[fixed in version
10.0.0](https://gist.github.com/yyx990803/faebe22e8763f5b17572b35ed96f52fe#vue-loader1000).

There is also [an open issue on
vueify](vuejs/vueify#159) but it's not
currently fixed.
@znck
Copy link
Member

znck commented Sep 5, 2017

Peer dependencies are deprecated from npm v3.x

@znck znck closed this Sep 5, 2017
@oligot
Copy link
Author

oligot commented Sep 14, 2017

According to the npm 3.0.0 release doc, peerDependencies no longer cause anything to be implicitly installed but the notion of peer dependencies is still there and clearly not deprecated.

Instead, npm will now warn if a packages peerDependencies are missing, but it's up to the consumer of the module (i.e. you) to ensure the peers get installed / are included in package.json as direct dependencies or devDependencies of your package.

Could this PR be reopened as I still get errors when upgrading to Vue 2.4.3 this time ?

@znck znck reopened this Sep 14, 2017
@znck
Copy link
Member

znck commented Sep 14, 2017

Please check for failing tests.

Olivier Ligot added 2 commits September 15, 2017 09:46
@oligot
Copy link
Author

oligot commented Sep 15, 2017

Tests now work when run locally but they fail on Circle CI and I don't really know why (this doesn't seem to be related to this PR)...

Can you have a look and see what's wrong with Circle CI ?

@znck znck merged commit 5ebe340 into vuejs:master Sep 26, 2017
@oligot oligot deleted the compiler-peer-dep branch September 26, 2017 09:57
@oligot
Copy link
Author

oligot commented Sep 26, 2017

Thanks ✌️

@oligot
Copy link
Author

oligot commented Oct 5, 2017

I just noticed that you reverted the changes in 42082ff (vue-template-compiler is now a dependency instead of a peerDependency).
Can you explain why you reverted these changes ?

@znck
Copy link
Member

znck commented Oct 6, 2017

That was a fix failing build on CI. vue-template-compiler should be in devDependencies and peerDependencies.

@znck
Copy link
Member

znck commented Oct 6, 2017

I'll patch it today. ,

@oligot
Copy link
Author

oligot commented Oct 6, 2017

Ok thanks !

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

Successfully merging this pull request may close these issues.

2 participants