2.7.16

Latest release in branch 2.7
Released 2 years ago (December 24, 2023)

Software Vue.js
Branch 2.7
Status
End of life
End of support (OSS) September 18, 2020
Commercial Support
(HeroDevs-NES)
TBD
First official release version 2.7.0
First official release date 3 years ago (July 01, 2022)
Release notes https://github.com/vuejs/core/releases/tag/v2.7.16
Source code https://github.com/vuejs/core/tree/v2.7.16
Documentation https://v2.vuejs.org
Vue.js 2.7 Releases View full list

What Is New in Vue.js 2.7

Vue 2.7 "Naruto" is a feature backport release, bringing key Vue 3 capabilities to Vue 2 for projects that need to stay on the older major version a while longer. It's a bridge, not a rewrite.

Category Key Changes
New Features Composition API, <script setup> syntax, `defineComponent` helper, `useAttrs`/`useSlots` hooks, `useCssModule`.
Improvements Better TypeScript support for Vue core, backported reactivity improvements from Vue 3.
Deprecated Vue.config.productionTip, Vue.config.ignoredElements (use `app.config.isCustomElement`).
Breaking Changes Template expressions no longer support `||` and `&&` without parentheses in certain cases. Requires ESLint plugin update.

In practice, this means you can start writing Composition API code in your Vue 2 projects today, which makes future migration smoother.

How does the Composition API work in Vue 2.7?

The Composition API is now natively available in Vue 2.7 without a separate plugin. You can import functions like `ref`, `reactive`, and `computed` directly from `vue`.

<script>
import { ref, computed } from 'vue'
export default {
  setup() {
    const count = ref(0)
    const double = computed(() => count.value * 2)
    return { count, double }
  }
}
</script>

This matters because it provides a more flexible way to organize component logic, especially for complex components. It's the same API design from Vue 3, so the knowledge transfers directly.

What is the benefit of <script setup>?

<script setup> is a compile-time syntactic sugar for the Composition API, drastically reducing boilerplate. Top-level bindings are automatically exposed to the template.

<script setup>
import { ref } from 'vue'
const msg = ref('Hello World!')
</script>

In practice, it leads to cleaner and more concise Single File Components. This syntax was one of the most requested features from Vue 3, and its inclusion here is a major productivity boost for Vue 2 codebases.

Is TypeScript support better now?

Yes, Vue 2.7 core includes improved type definitions that work with the new Composition API features. This provides better type inference for `defineComponent`, `props`, and `emits` declarations.

You don't need `@vue/composition-api` types anymore. The built-in types are more accurate and aligned with Vue 3's behavior. For most setups, TypeScript just works with less configuration hassle.

What changed in the build tooling?

The default template compiler is slightly stricter regarding expression parsing. Specifically, expressions using `||` and `&&` operators must be wrapped in parentheses when used in certain directive expressions.

<!-- May break in 2.7 -->
<div :class="'btn ' + isPrimary || isSecondary ? 'active' : ''"></div>

<!-- Fixed in 2.7 -->
<div :class="'btn ' + (isPrimary || isSecondary ? 'active' : '')"></div>

You'll need to update `vue-eslint-parser` and `eslint-plugin-vue` to the latest versions to handle this new syntax and the new features correctly.

FAQ

Should I upgrade my Vue 2 project to 2.7?
Yes, it's a recommended upgrade. It provides a clear path to eventually adopt Vue 3 patterns without an immediate, disruptive rewrite. The risk is low for most projects, just mind the breaking change around template expressions.

Can I mix Options API and Composition API in the same project?
Absolutely. You can use the Composition API in new components while leaving existing Options API components untouched. They interoperate seamlessly within the same app.

Do I need to change my Vuex or Vue Router setup?
No. Vue 2.7 works with the existing Vue 2 ecosystem. However, libraries like Vuex have their own Composition API helpers (e.g., `useStore`) that you can adopt if you wish.

Is the Vue 2.7 Composition API 100% identical to Vue 3's?
It's very close, but there are minor, non-breaking differences in advanced reactivity scenarios (e.g., `effectScope` API is not included). For the vast majority of use cases, they are functionally identical.

What happens to the @vue/composition-api plugin?
It becomes obsolete for Vue 2.7+. You should remove it and import everything directly from `vue`. The plugin maintainers will provide a migration guide.

Releases In Branch 2.7

Version Release date
2.7.16 2 years ago
(December 24, 2023)
2.7.16-beta.2 2 years ago
(December 14, 2023)
2.7.16-beta.1 2 years ago
(December 08, 2023)
2.7.15 2 years ago
(October 23, 2023)
2.7.14 3 years ago
(November 09, 2022)
2.7.13 3 years ago
(October 14, 2022)
2.7.12 3 years ago
(October 12, 2022)
2.7.11 3 years ago
(October 11, 2022)
2.7.10 3 years ago
(August 23, 2022)
2.7.9 3 years ago
(August 19, 2022)
2.7.8 3 years ago
(July 22, 2022)
2.7.7 3 years ago
(July 16, 2022)
2.7.6 3 years ago
(July 15, 2022)
2.7.5 3 years ago
(July 13, 2022)
2.7.4 3 years ago
(July 08, 2022)
2.7.3 3 years ago
(July 06, 2022)
2.7.2 3 years ago
(July 05, 2022)
2.7.1 3 years ago
(July 04, 2022)
2.7.0 3 years ago
(July 01, 2022)
2.7.0-beta.8 3 years ago
(June 28, 2022)
2.7.0-beta.7 3 years ago
(June 27, 2022)
2.7.0-beta.6 3 years ago
(June 26, 2022)
2.7.0-beta.5 3 years ago
(June 22, 2022)
2.7.0-beta.4 3 years ago
(June 21, 2022)
2.7.0-beta.3 3 years ago
(June 20, 2022)
2.7.0-beta.1 3 years ago
(June 17, 2022)
2.7.0-beta.2 3 years ago
(June 17, 2022)
2.7.0-alpha.9 3 years ago
(June 16, 2022)
2.7.0-alpha.10 3 years ago
(June 16, 2022)
2.7.0-alpha.11 3 years ago
(June 16, 2022)
2.7.0-alpha.12 3 years ago
(June 16, 2022)
2.7.0-alpha.7 3 years ago
(June 14, 2022)
2.7.0-alpha.8 3 years ago
(June 14, 2022)
2.7.0-alpha.6 3 years ago
(June 09, 2022)
2.7.0-alpha.5 3 years ago
(June 06, 2022)
2.7.0-alpha.2 3 years ago
(June 01, 2022)
2.7.0-alpha.3 3 years ago
(June 01, 2022)
2.7.0-alpha.4 3 years ago
(June 01, 2022)
2.7.0-alpha.1 3 years ago
(May 31, 2022)