Skip to content

Releases: vuejs/vue-cli

v4.2.1

07 Feb 10:16
8b951f8
Compare
Choose a tag to compare

🐛 Bug Fix

v4.2.0

07 Feb 08:02
079a451
Compare
Choose a tag to compare

Notable Changes

Vue CLI UI CORS Issue

A critical CORS vulnerability is fixed in this version.
We recommend all users of vue ui to upgrade to this version as soon as possible.

#4985 #5142

Lock Minor Version By Default

From this version on, newly-created projects and newly-added CLI plugins will lock the plugin version ranges to their minor versions.

The core functionalities of Vue CLI is quite stable at the moment. So we decided to make this change to improve project stability even more.

Users can run vue upgrade periodically to bump the minor versions in the projects.
We also expect this change to make the adoption of new features smoother.

See more detailed explanation at #5012

ESLint 6

With the recent updates in the ecosystem (eslint-plugin-vue, @vue/eslint-config-airbnb, @vue/eslint-config-standard, @vue/eslint-config-prettier, @vue/eslint-config-typescript), Vue CLI now supports ESLint 6. It will scaffold all new projects will ESLint 6.

For users from older versions, ESLint 5 is still supported. If you want to adopt ESLint 6 in the project, it's recommended to migrate through the vue upgrade command; otherwise, there will be much manual work to do.

Optional Chaining & Nullish Coalescing

We now support the optional chaining and nullish coalescing operators!

Note: scripts only, support in template expressions only available for Vue 3

// Optional chaining
a?.(); // undefined if `a` is null/undefined
b?.c; // undefined if `b` is null/undefined

// Nullish coalescing
undefined ?? 'some other default'; // result: 'some other default'
null ?? 'some other default'; // result: 'some other default'
'' ?? 'some other default'; // result: ''
0 ?? 300; // result: 0
false ?? true; // result: false

If you're using Babel, these syntaxes supported by default since this version, so no actions to take.

If you're using TypeScript, the vue upgrade command will automatically do the necessary
configurations for you, or you can manually upgrade your typescript dependency to 3.7.0 or later.

vue upgrade and vue migrate

See the Pull Request at #5091

You may have encountered the TypeError: Invalid Version: N/A error if you ran vue upgrade in a monorepo or forgot to run npm install first.
It is because, to run corresponding migration scripts, Vue CLI needs to know which versions of plugins the project previously depended on.

Monorepo support has been added since v4.2.

But in case of missing dependencies or any other edge cases, you can pass a --from option to the command to skip the local version detection step. For example: vue upgrade eslint --from 4.1.2.

A vue migrate --from command is available for those already bumped to the latest versions but didn't run the migration scripts.

Better Yarn 2 Support

Previously in v4.1.0, we added basic Yarn 2 support with the introduction of vue-cli-plugin-pnp package.

Now since Yarn 2 has officially released, we have also improved the support in Vue CLI.
You can create new projects directly with Yarn 2 and run it. That extra plugin is no longer required.

Note
Not every plugin works under Yarn 2. Yarn 2 comes with a lot of breaking changes that make requires some serious work to be done in the entire Node.js ecosystem.
As for Vue CLI, we still have much work to do for the compatibility of the typescript, unit-*, and e2e-* plugins. There may also be a few glitches in the eslint plugin.

yarn dlx -p @vue/cli vue create hello-yarn-2 --default
cd hello-yarn-2
yarn serve

Project Template Changes

  1. The default ESLint version is bumped to v6. Users can upgrade through vue upgrade.
  2. The default TypeScript version is bumped from ~3.5.3 to ~3.7.5. Users can upgrade through vue upgrade, or manually change the dependency version in package.json
  3. For ESLint + TypeScript + Nightwatch users, due to the ESLint rule change, an additional rule needs to be added to tests/e2e/.eslintrc. We haven't implemented an automatic migration script for it. Please add it manually. See https://github.com/vuejs/vue-cli/blob/v4.2.0/packages/%40vue/cli-plugin-e2e-nightwatch/generator/template/tests/e2e/_eslintrc.js#L5
  4. The default @vue/test-utils version used for unit tests is bumped from 1.0.0-beta.29 to 1.0.0-beta.31. Due to the breaking changes, we didn't migrate it automatically for old projects. Please read the release notes and upgrade at your own will.

Detailed Changelog

🚀 New Features

  • @vue/cli-plugin-babel, @vue/cli-plugin-eslint, @vue/cli-plugin-typescript, @vue/cli
    • #5149 feat(GeneratorAPI): allow passing options to api.extendPackage (@sodatea)
  • @vue/cli-plugin-unit-jest, @vue/cli-plugin-unit-mocha
    • #5147 feat: create projects with @vue/test-utils beta 31 (@sodatea)
  • @vue/cli-ui, @vue/cli
    • #5134 feat: lock minor versions when creating projects / adding plugins (@sodatea)
  • @vue/cli-plugin-typescript, @vue/cli-ui
  • @vue/cli
    • #5091 feat: vue upgrade monorepo support, --from option, and a new vue migrate --from command (@sodatea)
    • #4828 feat: add option --merge to create command (@zyy7259)
  • @vue/cli-service
  • @vue/babel-preset-app, @vue/cli-plugin-e2e-nightwatch, @vue/cli-plugin-eslint, @vue/cli-plugin-pwa, @vue/cli-ui-addon-webpack, @vue/cli-ui-addon-widgets, @vue/cli-ui, @vue/cli
  • @vue/cli-service, @vue/cli-shared-utils, @vue/cli
  • @vue/babel-preset-app
  • @vue/cli-service-global
    • #5029 feat: don't throw on console/debugger statements for vue serve (@sodatea)

🐛 Bug Fix

  • @vue/cli-shared-utils, @vue/cli
    • #5150 fix: should infer package manager from config if there's no lockfile in the project (@sodatea)
    • #5045 refactor: use a plain http request to get package metadata (@sodatea)
  • @vue/cli
    • #5062 fix afterInvoke/onCreateComplete callbacks in Migrator (@sodatea)
    • #5038 fix: extendPackage dependency versions should be string (@pksunkara)
  • @vue/cli-ui, @vue/cli
    • #4985 fix(CORS): only allow connections from the designated host (@Akryum)
    • #5142 fix(CORS): fixup #4985, allow same-origin ws requests of any domain (@sodatea)
  • @vue/cli-plugin-e2e-cypress
  • @vue/cli-service
    • #5113 fix: correctly calculate cacheIdentifier from lockfiles (@sodatea)
  • @vue/cli-plugin-pwa
    • #5089 fix: pwa-plugin avoid generating manifest when path is an URL (@tkint)
  • @vue/cli-plugin-unit-jest, @vue/cli-plugin-unit-mocha
    • #5028 fix applyESLint when eslint plugin is added after unit test plugins (@sodatea)
  • @vue/cli-service, @vue/cli-test-utils
  • @vue/cli-plugin-e2e-nightwatch
Read more

v4.1.2

28 Dec 12:59
3b7227d
Compare
Choose a tag to compare

4.1.2 (2019-12-28)

🐛 Bug Fix

  • @vue/cli-plugin-pwa
    • #4974 fix: fix several bugs in the PWA plugin UI, make it usable again (@sodatea)
  • @vue/cli
    • #4922 fix: should download to different tmp directories for different preset names (@sodatea)
  • @vue/cli-plugin-babel
    • #4924 fix: do not throw when babel config contains ignore/include/exclude (@sodatea)

📝 Documentation

🏠 Internal

Committers: 9

v4.1.1

27 Nov 15:15
2ddcc65
Compare
Choose a tag to compare

🐛 Bug Fix

  • @vue/cli-plugin-typescript

Committers: 1

v4.1.0

27 Nov 07:05
d316a18
Compare
Choose a tag to compare

Notable Changes

Improved Default Babel Preset

We've refactored the defautl babel preset with #4797 and #4777.

If you are experiencing code size bloat with core-js-pure imports, or encountering obscure errors when adding packages to transpileDependencies, this release should have fixed these problems for you.

Basic Yarn 2 Support

Great thanks to @arcanis for his help on this feature.

New projects created with the default preset now have proper support for Yarn 2.
You can try it out with the following commands:

yarn global add @vue/cli@next
vue create -d hello-yarn-2
cd hello-yarn-2
yarn policies set-version v2
yarn
yarn add vue-cli-plugin-pnp -D
yarn serve

We are still working on making the entire CLI work properly under Yarn 2, and hope to support the Plug'n'Play feature in Yarn v1, too, in the near future.
If you have any idea on how to better support these package managers, contributions are more than welcome.

For more information on Yarn 2, here's a great talk about its upcoming new features: https://2019.jsconf.eu/mael-nison/yarn-2019-and-beyond.html

Better Scaffolding Experience for Users in China

CDN URLs of several popular native packages are blocked in China, including the cypress, chromedriver and node-sass package. So we have now added support for mirror URLs of binary packages, following the implementation of the cnpm package.
Now if you have configured useTaobaoRegistry, dependency installation during vue create would be more seamless.


Detailed Changelog

🚀 New Features

  • @vue/cli
    • #4715 feat(GeneratorAPI): accept multiple arguments for the resolve method (@sodatea)
    • #4767 feat: support binary mirrors for taobao registry (@sodatea)
  • @vue/cli-service, @vue/cli-ui-addon-webpack, @vue/cli-ui-addon-widgets, @vue/cli-ui, @vue/cli
    • #4798 feat: enable postcss+autoprefixer by default internally, reducing boilerplate (@sodatea)
  • @vue/cli-plugin-pwa
    • #4736 feat: allow use of full url for pwa manifest and icons (@tkint)

🐛 Bug Fix

  • @vue/cli-service
  • @vue/babel-preset-app
    • #4797 fix: add sourceType: 'unambiguous' to babel preset (@sodatea)
  • @vue/babel-preset-app, @vue/cli-plugin-babel, @vue/cli-service
    • #4777 refactor: use babel overrides to transpile babel runtime helpers (@sodatea)
  • @vue/babel-preset-app, @vue/cli-plugin-babel, @vue/cli-plugin-typescript, @vue/cli-service, @vue/cli-ui
  • @vue/cli-shared-utils
    • #4842 Replace chalk.reset with stripAnsi in @vue/cli-shared-utils/lib/logger.js (@perakerberg)
  • @vue/cli
    • #4883 fix: support parser option for codemods, and enable ts parsing by default (@sodatea)
    • #4859 fix: invalid version error when modules not installed (@yannbertrand)

🏠 Internal

  • @vue/cli-ui
  • @vue/babel-preset-app, @vue/cli-plugin-babel, @vue/cli-service
    • #4777 refactor: use babel overrides to transpile babel runtime helpers (@sodatea)

📝 Documentation

Committers: 15

v4.1.0-beta.0

09 Nov 14:27
1c41371
Compare
Choose a tag to compare
v4.1.0-beta.0 Pre-release
Pre-release

🚀 New Features

  • @vue/cli
    • #4715 feat(GeneratorAPI): accept multiple arguments for the resolve method (@sodatea)
    • #4767 feat: support binary mirrors for taobao registry (@sodatea)
  • @vue/cli-service, @vue/cli-ui-addon-webpack, @vue/cli-ui-addon-widgets, @vue/cli-ui, @vue/cli
    • #4798 feat: enable postcss+autoprefixer by default internally, reducing boilerplate (@sodatea)

🐛 Bug Fix

  • @vue/cli-service
  • @vue/babel-preset-app
    • #4797 fix: add sourceType: 'unambiguous' to babel preset (@sodatea)
  • @vue/babel-preset-app, @vue/cli-plugin-babel, @vue/cli-service
    • #4777 refactor: use babel overrides to transpile babel runtime helpers (@sodatea)
  • @vue/babel-preset-app, @vue/cli-plugin-babel, @vue/cli-plugin-typescript, @vue/cli-service, @vue/cli-ui

📝 Documentation

🏠 Internal

  • @vue/cli-ui
  • @vue/babel-preset-app, @vue/cli-plugin-babel, @vue/cli-service
    • #4777 refactor: use babel overrides to transpile babel runtime helpers (@sodatea)

Committers: 5

v4.0.5

22 Oct 11:58
17925c6
Compare
Choose a tag to compare

🐛 Bug Fix

  • @vue/cli
    • #4741 fix: should tolerate cli version check error (@sodatea)
    • #4720 fix: do not install core plugins that have major version bumps (@sodatea)
  • @vue/cli-plugin-eslint
    • #4740 fix: autofix code style after scaffolding on older versions of cli (@sodatea)
    • #4728 fix: fix eslint not found error in vue serve command (@sodatea)
  • @vue/cli-ui
    • #4739 fix: "add router" button should not require prompt in terminal (@sodatea)
    • #4724 fix: fix latest version check always displaying "0.1.0" (@sodatea)

📝 Documentation

  • #4733 Fix indentation of --inline-vue description (@mul14)

🏠 Internal

  • @vue/babel-preset-app, @vue/cli-plugin-babel, @vue/cli-plugin-e2e-cypress, @vue/cli-plugin-e2e-nightwatch, @vue/cli-plugin-eslint, @vue/cli-plugin-router, @vue/cli-plugin-typescript, @vue/cli-plugin-unit-jest, @vue/cli-plugin-unit-mocha, @vue/cli-service-global, @vue/cli-service, @vue/cli-test-utils, @vue/cli-ui-addon-webpack, @vue/cli-ui-addon-widgets, @vue/cli-ui, @vue/cli

Committers: 2

v4.0.4

18 Oct 09:37
d82a2bb
Compare
Choose a tag to compare

We've also released v3.12.1 to address the router plugin issue in a different way. See the release notes for more explanation.

🐛 Bug Fix

  • @vue/cli-service
    • #4711 fix: fix a typo that caused router failed to install in CLI 3.x (@sodatea)

📝 Documentation

Committers: 2

v3.12.1

18 Oct 10:03
0817e6d
Compare
Choose a tag to compare

Regarding recent patch releases of Vue CLI v4, we are not fixing bugs in v4 itself, but for v3 compatibility actually (to be more specific, for the vue add router and vue add vuex commands in the older CLI versions, user projects are not likely affected). We still recommend all users to upgrade to v4 early.

This is because we've made a mistake in implementing the version check mechanism of core plugins in v3. As we expect to bring users the latest and best practices for their projects, we always use the latest versions of the core plugins for scaffolding. This, however, became a burden when we bump the major versions. During the RC phase, the version check logic wasn't triggered, thus we failed to spot this problem early enough.

Luckily, few breaking changes have been made in v4 regarding the scaffolding part, so most users are not affected.
The main issues are due to the changed locations of router and vuex templates. But as the usage varies (scaffolding via Vue CLI UI / command line; calling CLI v4 in v3 projects; calling CLI v3 in v4 projects, etc.), it took us several patches to fully address these issues. We are now also releasing this patch version in v3 so that users who are not confident enough to upgrade their workflow to v4 can have a more backward-compatible CLI to use.


🐛 Bug Fix

  • @vue/cli
    • #4712 fix(v3): do not install core plugins that have major version bumps (@sodatea)

Committers: 1

v4.0.3

17 Oct 08:02
aa29fd1
Compare
Choose a tag to compare

🐛 Bug Fix

  • @vue/cli-ui, @vue/cli
    • #4698 fix: fix vue add router command in v3 projects (@sodatea)
  • @vue/cli-service
    • #4696 fix: allow v3 cli to invoke vuex & router plugin from inside cli-service v4 (@sodatea)
  • @vue/cli-plugin-eslint, @vue/cli-plugin-typescript, @vue/cli-ui
    • #4697 fix: fix "lint on commit" projects generation error (@sodatea)

Committers: 1