Vue three – A roundup of infos approximately the new edition of Vue.js

By now you are in all likelihood conscious we were given a glittery new edition of Vue (Vue or “One Piece”). Evan You introduced it returned in Fall 2018 at Vue.js London – 2 years earlier than its authentic launch in September 2020.

We’re going to gather all precious infos and assets in this newsletter for you, so you may be up to date approximately the discharge system and your first steps with Vue three.

Vue three launch date

Vue three has formally been launched on 18 September 2020, and is the brand new default model as of seven February 2022

While we’ve got all been expecting the transfer from @subsequent to default, there was quite a few community-pushed paintings at the back of it to hold the revel in of the surroundings as seamless because it continually has been with Vue 2. (Successfully, via way of means of the manner!)

All crucial subprojects consisting of the Vue Devtools, Vue Router, Vue Test Utils and others are Vue three-geared up and we have got were given bright new doctors as well!

There also are plenty of recent and advanced equipment round to beautify your Vue three improvement revel in – like less difficult nation control with Pinia (study greater approximately nation control alternatives for Vue three right here!), or a construct toolchain powered via way of means of the blazing speedy Vite.

You can study all approximately the heritage of the discharge system and new tooling in Evan You’s article Vue three because the New Default. There’s additionally a migration manual to be had, highlighting adjustments for Vue 2 users.

Vue three capabilities adjustments

As Evan You summarized it, Vue three is faster, smaller greater maintainable and it is less difficult to goal native.

Composition API

One of the maximum vast adjustments is that a brand new API so that it will permit for a function-primarily based totally manner of writing your thing, stimulated via way of means of React Hooks.

It helps you to encapsulate common sense into “composition functions” and reuse that common sense throughout additives. Read the API reference for greater info.

Yes, this virtually adjustments the manner we use Vue (if we determine to apply the Composition API). However, it may not damage some thing for your Vue 2.x apps, as Vue three remains 100% well suited with the present day syntax / the alternatives-primarily based totally API. Personally, we assume that the Composition API will convey us quite a few flexibility, and result in higher based code in addition to scalability.

If you need to begin experimenting inside your Vue 2 apps, the brand new Composition API is to be had for 2.x as a plugin as well.

Other adjustments in Vue three:

  • Virtual DOM rewrite for higher overall performance and advanced TypeScript support
  • Native portals – now known as Teleport
  • Fragments (digital factors that may not be rendered withinside the DOM tree)
  • More flexibility for worldwide mounting
  • Conditional postponing of thing rendering

Migration from Vue 2

So, what takes place to Vue 2, and the way will migration be handled? There might be one closing launch for model 2 which backports well suited Vue three capabilities and provides deprecation warnings for breaking adjustments.

This model might be to be had as a LTS (long-time period support) model for 18 months, this means that that it’ll nonetheless get protection updates and is definitely secure to hold the usage of.

Can I use Vue three or must I nonetheless use Vue 2 for a brand new task?

You can begin your new manufacturing tasks with Vue three – the center and subprojects are geared up to apply. Keep in thoughts that the surroundings remains evolving, so a few open-supply additives might not but to be had in Vue three versions.

If you continue to determine to begin your task in Vue 2, hold an eye fixed at the adjustments and keep away from the usage of eliminated capabilities in addition to 1/3 celebration libraries that probably may not get up to date quickly. This will make any migration plenty less difficult later!

Learning Vue three

There are already assets to be had assisting you may analyze greater approximately new functionality. As continually, the Vue doctors are a awesome region to begin.

We have prepare a Vue three getting to know aid listing providing awesome publications, books and greater.

Should I begin getting to know Vue 2 or Vue three?

If you are absolutely new to Vue, simply begin getting to know with Vue three. There are many tutorials and publications for Vue 3available.

Don’t be afraid to test older v2 getting to know assets either – they may be now no longer routinely obsolete. Many of the important thing ideas are nonetheless the same!

Vue three drama

In case you bear in mind listening to some thing vital approximately model three waaay returned, we would want to debunk that simply in case

What could be extrade with out a bit drama? There has been a heated dialogue in the community (f.ex. on HackerNews and on Reddit) whilst the RFC for the Composition API changed into first launched in June 2019.

Community participants were given a chunk agitated (and on occasion rude, sadly) – specially as it changed into a chunk uncertain at the beginning whether or not the brand new Composition API might be merely additive (which it might be!), or if the present day API might be deprecated (which it may not be!). Also, humans have been afraid that every one the time they spent getting to know Vue changed into wasted (which it wasn’t!).

If you’re nonetheless a chunk fearful approximately model three due to a few bad comments, right here are a few articles explaining why you should not be:

Vue’s Darkest Day via way of means of Daniel Elkington on

Why humans were given dissatisfied with Vue three via way of means of Alex Kyriakidis on

three Key Insights from Vue’s new useful API RFC via way of means of Kevin Ball on (we specifically like that he factors out that this alteration suggests that it does not depend which framework you choose, which we have got additionally written approximately.)

Framework adjustments may be stressful. But we’re satisfied that the adjustments in v3 are a big step forward

Leave a Reply