VueJS Meetup in London: Migrating to Vue 3 & Adopting Pinia

Being big fans of the Vue ecosystem, James and I made our way to the Vue.js London November meetup hosted by Microsoft at their Reactor office.

The venue was great and, after grabbing a few slices of pizza and chatting with some fellow developers (about the World Cup and other topics), we all sat down for the first talk by Joe O’Reilly, Software Developer at Elementsuite, on “Getting started with testing Vue & Pinia.”

Getting started with testing Vue & Pinia

Pinia, created by Eduardo San Martin Morote of the Vue Core Team, is a store library that is compatible with both Vue 2 and Vue 3. It is also now recognised as the official state management system for Vue, although Vuex has not been deprecated.

Generally, the purpose of a datastore like Pinia is to contain data for an application that is used by more than one component. Alongside the @pinia/testing library, Pinia can easily be used to initialise data for unit testing, either to assert the existence or absence of data. A major advantage of Pinia is it also stubs out all store actions unless told otherwise. This allows you to test your components and stores separately.

The second talk of the evening by Domagoj Vidovic, Senior Frontend Engineer at Orbital Witness, was entitled “You can’t upgrade to Vue 3”.

You can't upgrade to Vue 3

His talk highlighted some of the difficulties faced by developers seeking to upgrade pre-existing Vue 2 applications to Vue 3. Whilst it’s not entirely impossible to upgrade from version 2 to 3, it became clear from the talk that this can be fraught with incompatible external libraries and breaking changes causing many issues.

Domagoj suggested some ways in which it can be made easier to upgrade between versions 2 and 3 and why his team found it difficult to upgrade to Vue 3.

The composition API was an original feature of Vue 3. But with the final Vue 2 release of Vue 2.7, the composition API has now been backported.

Vue 2 is not due to reach end-of-life until the end of 2023. It is also a stable, proven framework that is tried and tested.

Overall the evening was a great success with plenty of audience participation helping to bring the community together.

Related Reading

Get in touch. Email hello@gpmd.co.uk or call +44 20 7183 1072.

Sign up for our newsletter