1.0.28 • Published 9 months ago

vue-upgrade-tool v1.0.28

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

vue-upgrade-tool

NPM License NPM Version GitHub Actions Workflow Status

A codemod built on vue-metamorph to upgrade Vue 2 projects to Vue 3.

It will upgrade JS/TS files, SFCs, and unit tests.

!IMPORTANT Results are not guaranteed to be perfect! You should manually verify every single change this tool made. There are probably edge cases I missed here. Please open a GitHub Issue if you spot something it did wrong, or if it should have transformed/reported on something and didn't!

!NOTE vue-metamorph does not print well-formatted code when making changes. Use a formatting tool such as eslint or prettier to fix formatting in accordance with your project's code style conventions

Usage

Since the list of manual migrations can be large depending on your project, it's recommended to pipe the output into a file.

npx vue-upgrade-tool --files 'src/**/*' > vue_upgrade_output

To run only some transformations, lookup their IDs in the table below or find them using npx vue-upgrade-tool --list-plugins, then pass them via the --plugins flag using a micromatch pattern. To use multiple micromatch patterns, pass --plugins multiple times:

npx vue-upgrade-tool --files 'src/**/*' --plugins 'vue-*' --plugins 'test-utils-*' > vue_upgrade_output

Vue

PluginPlugin NameMigration TypeMigration Guide
data option must return a functionvue-data-functionautomaticLink
component options wrapped with defineComponent()vue-defineComponentautomaticLink
Vue.delete() / this.$delete() rewritten to delete expressionvue-deleteautomaticLink
remove .native modifier from v-on directivesvue-v-on-nativeautomaticLink
remove functional component markersvue-functional-componentautomaticLink
render function h()vue-contextual-hautomaticLink
hook: events renamed to vue:vue-hook-eventsautomaticLink
$nextTick()vue-nextTickautomaticLink
$scopedSlots removedvue-scoped-slotsautomaticLink
Vue.set() removedvue-set / vue-set-manualautomaticLink
v-bind:foo.sync becomes v-model:foovue-v-bind-syncautomaticLink
$listeners removedvue-remove-$listeners / vue-remove-$listeners-manualautomatic / manualLink
destroyed and beforeDestroy lifecycle hooks renamedvue-lifecycle-hooksautomaticLink
v-model updatesvue-v-modelautomaticLink
transition-group no longer renders a root elementvue-transition-group-root-elementautomaticLink
transition props were renamedvue-transition-propsautomaticLink
is attribute can only be used on a <component> tagvue-is-attributemanualLink
$children removedvue-$childrenmanualLink
v-if / v-for precedence changedvue-if-for-precedencemanualLink
vue filters removedvue-filtersmanualLink
global application instance / app instantiationvue-globalsmanualLink

Vue Router

PluginPlugin NameMigration TypeMigration Guide
vue-router instantiation changed (WIP)vue-router-instantiationautomaticLink
currentRoute.something becomes currentRoute.value.somethingnot yet implementedautomaticLink
onReady replaced with isReadyvue-router-onReadyautomaticLink
router.getMatchedComponents() removedvue-router-getMatchedComponents'automaticLink
passing slot content to router-viewvue-router-view-slot-contentautomaticLink
RouteConfig, Location, Route types renamednot yet implementedautomaticLink
router.app removedvue-router-router.appmanualLink
catch-all routes syntax changedvue-router-catch-allmanualLink
append prop in router-link removedvue-router-link-propsmanualLink
event and tag props in router-link removedvue-router-link-propsmanualLink
exact prop in router-link removedvue-router-link-propsmanualLink
router.match() removedvue-router-matchmanualLink

Vuex

PluginPlugin NameMigration TypeMigration Guide
Store instantiation changedvuex-instantiationautomaticLink

Vue Test Utils

PluginPlugin NameMigration TypeMigration Guide
propsData mount option renamed to propstest-utils-propsDataautomaticLink
new global mount optiontest-utils-global-mount-optionsautomaticLink
wrapper.destroy() renamed to wrapper.unmount()test-utils-wrapper-destroyautomaticLink
scopedSlots option merged with slotstest-utils-scoped-slots-mount-optionautomaticLink
createLocalVue removedtest-utils-createLocalVuemanualLink
Wrapper APIs removedtest-utils-removed-wrapper-apismanualLink
1.0.28

9 months ago

1.0.27

12 months ago

1.0.25

1 year ago

1.0.22

1 year ago

1.0.24

1 year ago

1.0.23

1 year ago

1.0.19

1 year ago

1.0.18

1 year ago

1.0.17

1 year ago

1.0.16

1 year ago

1.0.21

1 year ago

1.0.20

1 year ago

1.0.15

1 year ago

1.0.14

1 year ago

1.0.13

1 year ago

1.0.12

1 year ago

1.0.11

1 year ago

1.0.9

1 year ago

1.0.10

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago