Vuelve Vue 2! A critical look at the Composition API in Vue 3

By Armagan Amcalar

Elevator Pitch

The Composition API introduced in Vue 3 brings a composable, but imperative model of programming to Vue.

This talk explores the ideas of declarative programming vs imperative programming in the context of Vue and introduces Vuelve, a library that brings Vue 2 style declarative programming to Vue 3.

Description

I will start the talk by briefly introducing the Composition API in Vue 3, and show examples of how it compares to the Options API in Vue 2. We will then look at definitions of imperative and declarative programming in the context of CSS, JavaScript and HTML.

In the second part of the talk I will argue that Vue 3 Composition API is a step back for the library’s programming model, and introduce Vuelve, an open-source library I wrote to enhance the imperative programming model of Vue 3 with a declarative syntax similar to Vue 2.

Finally, I will give examples of how this results in less code, and an easier-to-understand mental model.