3

Just now, Yuxi You, the author of the Vue.js framework, announced that Vue 3 will become the new default version on February 7, 2022.

In its latest submission to GitHub's announcement information, "developers should pay attention to the measures that may need to be taken to confirm whether corresponding changes need to be made before the default version switch to avoid exceptions."

The following is the original text of You Yuxi's announcement:

From library to framework

In the beginning, Vue was just a runtime library. But over the years, it has evolved into a framework with many sub-projects:

  • The core library, the vue npm package
  • Content enough to be the documentation for a book
  • Build toolchain (Vue CLI, Vue Loader and other support packages)
  • Routing Vue Router for building single page apps
  • Vuex for state management
  • Browser Developer Tools extension for debugging and profiling
  • Vetur, a VSCode extension to support the development of single-file components
  • ESLint plugin for static style/error checking
  • Vue Test Utils for Component Testing
  • Custom JSX Babel plugin leveraging Vue runtime capabilities
  • VuePress for static website generation

This is all possible because Vue is a community-driven project. Many of these projects were initiated by community members who later became members of the Vue team. The rest of the project was originally started by me, but is now almost entirely maintained by the team except for the core library.

The "soft release" of Vue 3

As new major versions of the core library are released, all other parts of the framework need to be updated in sync. We also need to provide an upgrade package for Vue 2 users. This is a huge project for a community-driven team like Vue. By the time Vue 3's core library is complete, the rest of the framework is either still in beta or hasn't started adapting to Vue 3 yet. At that time, our decision was to release the core library first, so that early users can use it first, and developers of the library and the upper-level framework can adapt it first, while we continue to update the rest of the framework.

In the process, we still keep Vue 2 as the default version for documentation and npm installs. This is because we know that for most users, Vue 2 still provides a more consistent and complete experience until the rest of Vue 3 is perfected.

Brand new Vue

The "soft release" process took longer than expected, but the moment has finally arrived: we're happy to announce that Vue 3 will be the new default release on February 7, 2022.

We've improved almost every aspect of the framework except the Vue core library.

  • Extremely fast build toolchain based on Vite
  • Development experience brought by <script setup> Smoother composition API syntax
  • Single-file component TypeScript IDE support provided by Volar
  • Command-line type checking and generation for single-file components provided by vue-tsc
  • Easier state management provided by Pinia
  • The new developer tools extension supports both Vue 2/Vue 3 and provides a plugin system to allow community libraries to extend the developer tools panel by themselves.

We've also completely rewritten the main document. The brand new vuejs.org (currently in a pending state, translation in Chinese is still in progress) will provide an up-to-date framework overview and development advice, flexible learning paths for users of different backgrounds, throughout the guides and examples. Toggle between options API and composition API, plus many new in-depth chapters. The site performance of the new documentation itself is also excellent - we'll explore more in another blog post shortly.

Version switch details

Below are the specifics of what we call "the new default version". Also, please read the Possible Actions section to see if you need to make changes before switching to the default version to avoid exceptions.

npm release tags

  • npm install vue will install Vue 3 by default.
  • The latest release tags of all other official npm packages will point to their Vue 3 compatible versions, including vue-router, vuex, vue-loader, and @vue/test-utils.

Official Documentation and Site

All documentation and official site will switch to Vue 3 version by default. include:

  • vuejs.org
  • router.vuejs.org
  • vuex.vuejs.org
  • vue-test-utils.vuejs.org (will migrate to test-utils.vuejs.org)
  • template-explorer.vuejs.org

Note that the new vuejs.org will be a completely rewritten version, not the version currently deployed at v3.vuejs.org.

The current Vue 2 versions for these sites will be migrated to the new address (version prefixes indicate the respective versions of the libraries, not the version of the Vue core library):

  • vuejs.org -> v2.vuejs.org (the old v2 URL will automatically redirect to the new one)
  • router.vuejs.org -> v3.router.vuejs.org
  • vuex.vuejs.org -> v3.vuex.vuejs.org
  • vue-test-utils.vuejs.org -> v1.test-utils.vuejs.org
  • template-explorer.vuejs.org -> v2.template-explorer.vuejs.org

GitHub repository

As of this writing, the repository-related changes are already in effect.

All GitHub repositories under the vuejs organization will switch the default branch to the version corresponding to Vue 3. Additionally, the following repositories will all be renamed to remove next from their names:

  • vuejs/vue-next -> vuejs/core
  • vuejs/vue-router-next -> vuejs/router
  • vuejs/docs-next -> vuejs/docs
  • vuejs/vue-test-utils-next -> vuejs/test-utils
  • vuejs/jsx-next -> vuejs/babel-plugin-jsx

Additionally, the translation repository for the main document will be moved under the vuejs-translations organization.

GitHub automatically handles redirection of repositories, so previous links to source code and issues should still work.

Developer Tools Extension

Developer Tools v6 is currently released to the beta channel of the Chrome Web Store and will be moved to the stable channel after the version switch.

The current stable channel is still available. It will be migrated to legacy channels.

Possible Actions {#potential-required-actions}

Use an unspecified version of the CDN link

If you are using Vue 2 via CDN link without specifying a version, make sure to specify a version range with @2:

  • <script src="https://unpkg.com/vue"></script>
  • <script src="https://unpkg.com/vue@2"></script>
  • <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.min.js"></script>
  • <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.min.js"></script>

Note: Even with Vue 3, you should always specify a version range in production to avoid accidentally loading into future major versions.

npm latest tags

If you use the latest tag or * to install Vue or other official libraries from npm, update to explicitly use a Vue 2-compatible version:

{
"dependencies": {

  • "vue": "latest",
  • "vue": "^2.6.14",
  • "vue-router": "latest",
  • "vue-router": "^3.5.3",
  • "vuex": "latest"
  • "vuex": "^3.6.2"
    },
    "devDependencies": {
  • "vue-loader": "latest",
  • "vue-loader": "^15.9.8",
  • "@vue/test-utils": "latest"
  • "@vue/test-utils": "^1.3.0"
    }
    }

MissD
955 声望41 粉丝