Vue.js
Past, Present
and Future
(Or: A Series of Fortunate Nerd Snipes)
Alex Riviere
- Senior Frontend Developer
- Atlanta Vue.js Co-Organizer
- Handwritten Font Connoisseur
Nerd Sniping
October 26th, 2018
React Hooks is demoed publicly for the first time
October 27th, 2018
CodeSandbox
June 7th, 2019
Vue RFC #42 is proposed for
"Function-based Component API"
This is what later becomes known as
"Composition API"
Vue 3.0.0
(Released 2020-09-18)
-
New Reactivity System using Proxy Objects
-
Composition API and setup method
-
Removal of filters
Composition API
Options API
<script>
export default {
data(){
return {
count: 0,
}
},
methods:{
increment(){
this.count++;
}
},
}
</script>
<template>
<button type="button" @click="increment">
the count is {{count}}
</button>
</template>
<script>
import {ref} from 'vue';
export default {
setup(){
const count = ref(0);
const increment = ()=>count.value++
return{
count,
increment,
}
}
}
</script>
<template>
<button type="button" @click="increment">
the count is {{count}}
</button>
</template>
Vite 1.0.0-rc.13
(Released 2020-11-25)
- Core team realized with minor changes could be more than a vue build tool
- Ditched v1, and started on v2
Vite 2.0.0
(Released 2021-02-16)
- Supports multiple frameworks
- Super fast dev experience
- Builds with rollup
Vue 3.1.0
Migration Build
-
@vue/compat to help you migrate your app
from to Vue 3 - Gives lots of Errors and warnings
that will be relevant to getting you up to date
(Released 2021-06-07)
Vue 3.1.0
(Released 2021-06-07)
Component level compilerOptions
Lets you adjust your vue compiler settings on a per component basis
Vue 3.2.0
(Released 2021-08-09)
- v-bind in style block
- v-memo
- effectScope
- defineCustomElement
- script setup syntax
Composition API
<script>
import {ref} from 'vue';
export default {
setup(){
const count = ref(0);
const increment = ()=>count.value++
return{
count,
increment,
}
}
}
</script>
<template>
<button type="button" @click="increment">
the count is {{count}}
</button>
</template>
Script Setup
<script setup>
import {ref} from 'vue';
const count = ref(0);
const increment = ()=>count.value++
</script>
<template>
<button type="button" @click="increment">
the count is {{count}}
</button>
</template>
Vue 2.7.0
(Released 2022-07-01)
Backported many Vue 3 features to Vue 2.
- Composition API
- SFC
<script setup>
- SFC CSS v-bind
-
defineComponent()
-
h()
,useSlot()
,useAttrs()
,useCssModules()
-
set()
,del()
andnextTick()
Vue 2.7.0
(Released 2022-07-01)
Vue 2 End of Life Announced
December 31st, 2023
Vue 3.3.0
(Released 2023-05-11)
- Better TypeScript support
- <script setup> generics support
- Generally, a lot of DX improvements.
But what does the future hold?
"Vapor" Mode
- Opt in mode to remove VDOM
- Can be done at either component level or app level
- only works with <script setup>
- will be compatible with vdom components
"Vapor" Mode
MyCounter.vue
<script setup>
import { ref } from 'vue'
const count = ref(0)
</script>
<template>
<div>
<button @click="count++">
{{ count }}
</button>
</div>
</template>
MyCounter.js
import { toDisplayString as _toDisplayString,
createElementVNode as _createElementVNode,
openBlock as _openBlock,
createElementBlock as _createElementBlock } from "vue"
import { ref } from 'vue'
const __sfc__ = {
__name: 'App',
setup(__props) {
const count = ref(0)
return (_ctx, _cache) => {
return (_openBlock(), _createElementBlock("div", null, [
_createElementVNode("button", {
onClick: _cache[0] || (_cache[0] = $event => (count.value++))
}, _toDisplayString(count.value), 1 /* TEXT */)
]))
}
}
}
__sfc__.__file = "src/App.vue"
export default __sfc__
"Vapor" Mode
MyCounter.vapor.vue
<script setup>
import { ref } from 'vue'
const count = ref(0)
</script>
<template>
<div>
<button @click="count++">
{{ count }}
</button>
</div>
</template>
MyCounter.vapor.js
import { ref, effect } from "vue"
import { template, on, setText } from 'vue/vapor'
const t0 = template('<div><button>')
export default () => {
const count = ref(0)
let div = t0()
let button = div.firstChild
let _button_text
effect(()=>{
setText(button, _button_text, count.value)
})
on(button, 'click', () => count.value++)
return div
}
Thank YOU!
Questions?
Slides:
https://slides.com/fimion/hackbuddy-2023-08
Twitter: @fimion - Blog: Alex.Party - Github: fimion
Vue.js Past, Present, and Future
By Alex Riviere
Vue.js Past, Present, and Future
Let's talk through Vue 3 features, how we've kept up to date, and maybe where it is going.
- 285