尤雨溪 Vue 2022 回顾及 2023 展望
Vue 作者尤雨溪日前发文对 Vue 的 2022 进行回顾并展望了一下项目 2023 年的发展。
在 2022 年 2 月,Vue 的默认版本切换到了 3.x;最新的稳定版本是 11 月发布的 Vue 3.2.45。尤雨溪称,这一转变标志着 v3 框架的所有官方部分都已准备就绪,包括对提供最新最佳实践指南的文档进行重大修改。不过其目前仍处于生态系统迁移到 Vue 3 的过渡期。因此在转换之后,开发团队更专注于通过投资工具来改善 Vue 的开发人员体验;包括积极参与 Vite 的开发,通过发布 Volar 1.0 对 Vue 的 IDE 和 TypeScript 支持进行重大改进等。
数据显示,2022 年期间 Vue 3 的 NPM 使用率增长了近 200%。社区方面,Vue 3 生态系统也已成熟。Nuxt 3 和 Vuetify 3 均在 2022 年 11 月达到稳定状态,NativeScript for Vue 3 则于近期推出了 beta 版本。但鉴于迁移的成本问题,许多用户仍停留在 Vue 2。因此,Vue 团队决定将 Vue 2 的源代码转移到 TypeScript,并在 Vue 2.7 中 back-ported 了一些最重要的 Vue 3 功能;以及确保 Vite、Vue Devtools 和 Volar 都同时支持 Vue 2 和 Vue 3。
而随着最后一个 Vue 2 次要版本 (2.7) 的发布,尤雨溪表示,其预计将在 2023 年全速推出 Vue 3 核心功能的发布。发布节奏方面也将进行改进,Vue 将遵循 semver;以期望在 2023 年通过发布更小、更频繁的次要版本,更快地推出更多功能。
这也意味着 3.3 版本中的内容将进行调整,现处于实验状态的 Suspense 和 Reactivity Transform 仍需要进一步讨论,“且它们不应该阻碍其他更直接的功能的实现”。目前,3.3 的目标是将不需要再进行 RFC 讨论的提议 / 计划功能落地,例如在 <script setup> 宏中支持外部导入的类型。
与此同时,再进一步评估 Suspense 和 Reactivity Transform 的准备情况、评估未完成的用户提交的 RFC 和功能请求,以及发布打算在 3.4 及更高版本中实现的功能的 RFC(例如 SSR lazy hydration)。更多细节将在本月晚些时候发布。
尤雨溪透露,在可预见的未来没有对 Vue 进行重大的、突破性改变的计划。
此外,他们还在研究一种被称为 Vapor Mode 的编译策略,灵感来自 Solid。该策略将 Vue SFC 编译成 JavaScript 输出,与现有的 virtual DOM0-based output 相比,它具有更高的性能、使用更少的内存并且需要更少的运行时支持代码。目前,Vapor Mode 还尚处于早期阶段。
更多详情可查看博客全文:
Happy new year, Vue community! With 2023 upon us, we would like to take this opportunity to recap what happened in 2022, and discuss what to expect in 2023.
Recap for 2022
In February 2022, we switched Vue’s default version to 3.x. The switch marked the readiness of all the official parts of the framework for v3, including a major revamp of the documentation that provides guidance on latest best practices.
We are still in a transition period for the ecosystem to move to Vue 3. So after the switch, we focused more on improving Vue’s developer experience by investing in tooling. Our team members have been actively involved in the development of Vite, and we made significant improvement to Vue’s IDE and TypeScript support by shipping Volar 1.0.
Over the course of 2022, we saw the NPM usage of Vue 3 grew by almost 200%. On the community side, the Vue 3 ecosystem is now ripe with great solutions to help boost your productivity. Both Nuxt 3 and Vuetify 3 reached stable status in November 2022, and NativeScript for Vue 3 recently launched beta. In addition, we want to give a shout out to other great projects that had already supported Vue 3 for quite some time: Quasar, NaiveUI, Ionic Vue, PrimeVue, InkLine, ElementPlus, and more.
Despite Vue 3 being now the default, we understand that many users have to stay on Vue 2 due to the cost of migration. To ensure that Vue 2 users benefit from the advancement of the framework, we decided to move Vue 2’s source code to TypeScript and back-ported some of the most important Vue 3 features in Vue 2.7. We also made sure that Vite, Vue Devtools and Volar all simultaneously support Vue 2 and Vue 3.
What to Expect in 2023
Smaller and More Frequent Minor Releases
With the last Vue 2 minor release (2.7) out of the door, we expect to be full steam ahead shipping features for Vue 3 core in 2023. We have quite a long list of features that we are excited to work on!
One thing we would like to improve is our release cadence. Vue follows semver, which means we should only ship features in minor versions. In the past, we did a “big minor” approach where we group many features together in big, infrequent minor releases. This has resulted in quite some low-complexity features being blocked while we worked on other high-complexity ones. In 2023, we want to do smaller and more frequent minor releases so that we can get more features out, faster.
This also means we will be adjusting what goes into 3.3. Originally, we planned to graduate Suspense and Reactivity Transform from experimental status in 3.3. However, we feel that both still need further RFC discussion, and they should not block other more straightforward features to land. Now, the goal of 3.3 is to land proposed / planned features that are clear wins and do not require RFC discussion – for example, supporting externally imported types in <script setup> macros.
In parallel to that, we will:
Further evaluate the readiness of Suspense and Reactivity Transform.
Spend time to evaluate outstanding user-submitted RFCs and feature requests.
Post RFCs for features that we intend to land in 3.4 and beyond, for example SSR lazy hydration.
Expect more details later this month.
Another thing to note is there is no plan for big breaking changes for the foreseeable future. Acknowledging the challenges users faced during the v2 to v3 transition, we want to have a better long term upgrade story for Vue going forward.
Vapor Mode
Vapor Mode is an alternative compilation strategy that we have been experimenting with, inspired by Solid. Given the same Vue SFC, Vapor Mode compiles it into JavaScript output that is more performant, uses less memory, and requires less runtime support code compared to the current Virtual DOM based output. It is still in early phase, but here are some high level points:
Vapor Mode is intended for use cases where performance is the primary concern. It is opt-in and does not affect existing codebases.
At the very least, you will be able to embed a Vapor component subtree into any existing Vue 3 app. Ideally, we hope to achieve granular opt-in at the component level, which means freely mixing Vapor and non-Vapor components int the same app.
Building an app with only Vapor components allows you to drop the Virtual DOM runtime from the bundle, significantly reducing the baseline runtime size.
In order to achieve the best performance, Vapor Mode will only support a subset of Vue features. In particular, Vapor Mode components will only support Composition API and <script setup>. However, this supported subset will work exactly the same between Vapor and non-Vapor components.
We will share more details as we make more progress later in the year.
Conferences
There are already many in-person Vue conferences lined up for 2023:
Vue.js Amsterdam – Feb 9-10, Amsterdam, The Netherlands
Vue.js Live – May 12 & 15th, London, UK
VueConf US – May 24-26th, New Orleans, USA
VueFes Japan – October 28th, Tokyo, Japan (info TBA)
I (Evan) plan to attend all of these in person. After almost 3 years of absence, I can’t wait to meet the community again – please come say hi!
One Year Until Vue 2 EOL
As a reminder, today marks exactly one year until the end of Vue 2 support. We have created a page explaining the implication of this and outlining the options for those who expect to be using Vue 2 beyond the EOL date: Details on Vue 2 EOL and Extended Support.

