Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best practices for easy migration from VueJS2 to VueJS3?

I am currently developing a web frontend of an enterprise application with vuejs 2 and vuetify 2. The plan is to migrate to Vuejs 3 after the release.

Are there any coding pattern which should be avoided now for any easy future migration to vuejs 3?

The github for the Vue 3 release road map says:

High level API remains as close to 2.x as possible. Breaking changes only made where necessary, and will be communicated through the RFC process. (https://github.com/vuejs/roadmap)

like image 884
Simon Thiel Avatar asked Oct 13 '19 20:10

Simon Thiel


People also ask

How do I migrate from vue2 to Vue3?

Before, moving on to the files here is the basic process that's need to be followed to migrate from Vue2 to Vue3: First, we make sure that our @vue/cli-service is in the newest version. To update our vue-cli command is – vue upgrade. Now modify our 'package.

Is Vue3 compatible with vue2?

Vue 3 is the current, latest major version of Vue. It contains new features that are not present in Vue 2, for example Teleport, Suspense, and multiple root elements per template. It also contains breaking changes that makes it incompatible with Vue 2. Full details are documented in the Vue 3 Migration Guide.

Does Buefy work with Vue 3?

Buefy (8.7k stars on GitHub) integrates the CSS framework Bulma (43.7k stars on GitHub) into Vue. js 2 projects. However Buefy does not support Vue. js 3 yet.

Should I use Vue3?

If you are facing performance issues after doing various optimizations, then use Vue 3. This is written from scratch and offers better performance than its previous version. If you need better TypeScript compatibility use Vue 3, it's much better than before!


1 Answers

Are there any coding pattern which should be avoided now for any easy future migration to vuejs 3?

Yes. Class-based components should be avoided. They won't be marked as obsolete, but it won't be possible to use the composition API with them. Class components are not anymore the future of Vue.

On this subject:

  • Type Issues with Class API
  • Vue 3.0 Discards Class-Based API for Reusable, Composable Function-Based Approach
like image 68
Paleo Avatar answered Oct 20 '22 18:10

Paleo