What are the Latest Features in Vue 3.5?

Posted by


Vue 3.5 is the latest release in the Vue.js framework and it comes with a number of exciting new features and improvements. In this tutorial, we will delve into the changes and enhancements that are included in the Vue 3.5 update.

  1. Teleport Component: The new Teleport component allows developers to render a child component at a different DOM location in the document. This can be useful for creating modals, popovers, context menus, and other components that need to be rendered outside the normal flow of the application.
<template>
  <teleport to="body">
    <modal :show="isOpen" @close="isOpen = false" />
  </teleport>
</template>
  1. Composition API Enhancements: The Composition API has been enhanced to support the new onUnmounted lifecycle hook, which can be used to perform cleanup tasks when a component is unmounted from the DOM. This can be useful for cleaning up event listeners, timers, or other resources that may need to be cleaned up when a component is no longer needed.
import { onUnmounted } from 'vue'

setup() {
  onUnmounted(() => {
    // Cleanup tasks
  })
}
  1. Improved TypeScript Support: Vue 3.5 includes improvements to TypeScript support, including better type inference and improved type checking. This can help developers catch more errors at compile time and write more robust and type-safe Vue applications.
const state = ref<number>(0)
  1. Performance Improvements: Vue 3.5 includes various performance improvements, such as faster rendering times, reduced memory usage, and improved reactivity system performance. These enhancements can help make Vue applications faster and more responsive, especially for large and complex applications.

  2. Easier SSR Setup: Server-side rendering (SSR) setup has been made easier in Vue 3.5, with simplified server-side hydration and improved support for async components in SSR. This can help developers build faster-loading and more SEO-friendly Vue applications.

  3. New Features in the Composition API: The Composition API has been enhanced with new features, such as provide and inject for providing and injecting dependencies into components, watchEffect for creating reactive side effects, and toRefs for converting reactive objects to refs. These new features can help developers write more flexible and modular Vue components.
export default {
  setup() {
    const { user } = inject('userStore')

    watchEffect(() => {
      console.log(user.name)
    })

    return { user }
  }
}

Overall, Vue 3.5 brings a number of exciting new features and improvements that can help developers build faster, more robust, and more maintainable Vue applications. By taking advantage of these new features and enhancements, developers can create better user experiences and more efficient web applications using the Vue.js framework.

0 0 votes
Article Rating
9 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
@hugazo
1 month ago

Thanks, this video solved an issue i was dealing with

@виртуоз_ру
1 month ago

Хорош 👍

@timmeehan2365
1 month ago

Really lookfing forward to trying out this hydrateOnVisible feature!

@crazwade
1 month ago

Bye toRefs

@mtzrmzia
1 month ago

Props destructuring and defaults looks 🔥

@mykelchang846
1 month ago

Please do not use dark theme for videos. Think about people which can't handle it.
Accessibility matters. Thank you.

@horatiuranca9005
1 month ago

Cool stuff, excited to put them in practice🎉

@MrJloa
1 month ago

useTemplateRef…
Omg, the $ref() util which returns the component/element reference the proper way was the first thing ive written when migrated to v3😂
Yet again it is sad that Evan (or the core team) is not consecutive in their changes. $ is a standard for dom since jquery era, also v2 had a proper api which was $refs.
And instead of calling the api $ref() they named it in a weird way…
No logic found, as always.

@rrd_webmania
1 month ago

Thanks for the recap