Upgrade to Vue 3

Proprietary

Upgrade a Vue 2 project to Vue 3. Moves Vue Router to 4 first (new VueRouter to createRouter, * catch-all routes), then rewrites new Vue({render: h => h(App)}).$mount(sel) to createApp(App).mount(sel) with the global Vue.use/component/directive/mixin calls and the router and store options (MigrateNewVueToCreateApp), renames beforeDestroy and destroyed (RenameVueDestroyHooks), marks the removed $on/$off/$once, Vue.set/delete/filter/extend and filters (FindVue3RemovedApis), then upgrades vue, vue-router, vuex, @vue/test-utils and vue-loader in one edit and replaces vue-template-compiler with @vue/compiler-sfc. vue-loader 17 needs webpack 4 or 5, so a project on webpack 3 must run UpgradeToWebpack5 first. Not done by this recipe: code that MigrateNewVueToCreateApp declines (several new Vue, other root options, other Vue.* uses, require('vue')), v-model and .sync and <router-link tag/event> in .vue templates, the @vue/compat build, and moving @vue/cli-service to Vite.

org.openrewrite.nodejs.migrate.vue.UpgradeToVue3
mod run . --recipe=org.openrewrite.nodejs.migrate.vue.UpgradeToVue3

Install it once from Recipe actions, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.