Vue 3.0 is out! What can we learn?
Tags: vue, webdev, news
Published: 2020-09-18 23:53:06

Hey everyone! It's really been a *while* since I posted a blog post but I'm back after months of working on passion projects, designing interfaces, and learning lots.

I recently attended my first Vue.js conference! Wooo go [#vuejsglobal](https://twitter.com/hashtag/vuejsglobal)!

## Table of Contents:
- [Preamble](#preamble)
- [Introduction](#introduction)
- [Technical changes](#technical-changes)
- [Conclusion](#conclusion)
- [Links](#links)

----------

### Preamble
I've been diving into Vue.js for several months now and really coming to love it. Vue.js is by far, my most favourite web framework alongside [Nuxt.js](https://nuxtjs.org) (I was going to learn [React.js](https://reactjs.org), but that's for another blog post ;)) that have also come out with their own updates like [Nuxt full static](https://nuxtjs.org/blog/going-full-static). On top of their newest updates, I'm excited for Nuxt.js for its built in SEO and pre-rendering capabilities. It's a powerful and all-around beautiful framework to work with straight out of the box 📦.

Either way, the Vue.js Global Online Conference 2020 was a blast. I got to virtually chat with members of the Vue Core Team and VueMastery, network with professional Vue developers, and meet Pink DJ Penguin (don't ask :D). Overall, it was an amazing experience getting to know the Vue team screen-to-screen.

-------

> WATCH: [Evan You's live-streamed Vue 3 announcement and nuggets of wisdom](https://www.youtube.com/watch?v=Vp5ANvd88x0&list=PLCxzy-hmQq9HOg0mS0laLkMiTov2zyZ5q)

-------

### Introduction

Today, Vue.js 3.0.0 (codenamed "One Piece") is officially out! 💚
![Cheering excitedly](https://i.gifer.com/D9SC.gif)
Now, as excited as I am to binge-learn [Vue Mastery](https://www.vuemastery.com) on the new features like [Composition API](https://composition-api.vuejs.org), and all the [other new features](https://v3.vuejs.org/guide/migration/introduction.html#breaking-changes), I wanted to write about how the Vue team released the version and the way they went about it that I feel really **sets it apart from other frameworks and version changes**. *"I know,"* you say, *"It's just another documentation update and new changes to learn"* 🙄, but I think there's some deeper lessons we can learn about how they did went about it.

Vue.js 3.0.0 now comes with a [couple deprecations and breaking changes](https://v3.vuejs.org/guide/migration/introduction.html#notable-new-features). But don't worry, the Vue Core Team and Evan You have made it clear that there will only be a *few breaking changes* to make the learning curve *easier for beginners new to Vue*.

> **The journey to v3**: The Vue Core Team quotes in the [v3.0.0 One Piece](https://github.com/vuejs/vue-next/releases/tag/v3.0.0?utm_campaign=Vue.js%20News&utm_medium=email&utm_source=Revue%20newsletter), *"2 years of development efforts, featuring 30+ RFCs, 2,600+ commits, 628 pull requests from 99 contributors [...]"*

### Technical Changes
Delving into the v3 documentation, it became clear to me exactly where I could find v3 changes. This is great communication to users. The documentation is clear, precise, and gives reasoning for why the changes were pushed. For beginner developers, the reasoning was the biggest aspect of the Vue documentation that I really love Vue for. Most framework documentation I've read don't exactly go into why they've done what they've done, and this can be particularly confusing to beginners. The Vue Core Team has done a great job on providing developers with necessary information when needed and where needed.

Below, I'll break down some of the major changes. Many of the changes have to do with usability and clarity surrounding terminology. These types of changes enable easier comprehension and uptake by beginners and experts alike.

One of the first changes I've noted is the overall base layout with the deprecation of the Global root element. Finally, we don't need a root `<div>` element anymore.

Another major change was the creation of the new [Global API](https://v3.vuejs.org/guide/migration/global-api.html#a-new-global-api-createapp) `createApp`. This change prevents potential "pollution" of test cases (i.e. developers would have needed to restore the original global configuration) - [see here](https://v3.vuejs.org/guide/migration/global-api.html#a-new-global-api-createapp). Plus, there would be no worry of having multiple app instances with potentially different configurations.

![Vue.js new Global API `createApp`](https://dev-to-uploads.s3.amazonaws.com/i/xxtpwlssjj8q1sqkm38e.png)

As well, slots have also undergone some [changes in Vue 3.0.0](https://github.com/vuejs/rfcs/blob/master/active-rfcs/0001-new-slot-syntax.md) (`slot` and `slot-scope` attributes have been kept for 2.x to reduce issues of breaking syntax for new learners) and will be using the one `v-slot` directive, condensing the functions of `slot` and `slot-scope` attributes.

Here's an overview of the changes Vue has listed on the [new documentation](https://v3.vuejs.org/guide/migration/introduction.html#overview):

![vue3-docs-notable-changes](https://dev-to-uploads.s3.amazonaws.com/i/neukowkhm6nd7b8psoma.png)

Furthermore, other changes include the deprecation of `filters` (the functions were very similar to methods anyway), `EventBus` (considered anti-pattern; removed $on, $once, and $off instance methods because to facilitate a more direct flow of data transfer - using [*"props down, events up"*](https://github.com/vuejs/rfcs/blob/master/active-rfcs/0020-events-api-change.md)).

Another intuitive change to watch out for is the renaming of two lifecycle hooks: `destroyed` and `beforeDestroyed`. `destroyed` is now named `unmounted`, and `beforeDestroyed` is now `beforeUnmount`. This clarifies any confusion in terminology and is more straightforward.

### Conclusion

I think this goes to show the care and effort the Core Team went into making these changes known, easy to understand and *adopt*. There's no fluff. These decisions were made with [developers -- *users* -- in mind](https://evrone.com/evan-you-interview). It seems like these are just simple documentation changes that come with any framework update, but when we think about this way of communication in situations where others rely on our work and it's a reciprocal relationship, it's definitely interesting to see how a web framework's documentation communicates changes through gathering the opinion from their community, and putting their users first ([Evan you explains why/what RFCs for Vue, @11:54 timestamp](https://www.youtube.com/watch?v=Vp5ANvd88x0)).


By all means, this article doesn't list all the changes so I encourage you to read up the v3 documentation.


<br>

### Links

Thank you for reading! As always, I've listed some cool links below - enjoy with a coffee or tea ☕️

- Stay informed for upcoming VueConf events if you're in Toronto/GTA (updated per event): [Vue Toronto Meetup](https://www.meetup.com/Vue-Toronto/)
- [Vue 3 documentation](https://v3.vuejs.org/guide/introduction.html#introduction)
- [Nuxt.js 3 RFCs](https://github.com/nuxt/rfcs)
- If you want to start learning Vue.js, [Vue Mastery](https://www.vuemastery.com) is a great platform