1.0.25 • Published 1 month ago

vue-upgrade-tool v1.0.25

Weekly downloads
-
License
MIT
Repository
github
Last release
1 month 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

Vue

PluginMigration TypeMigration Guide
data option must return a functionautomaticLink
component options wrapped with defineComponent()automaticLink
Vue.delete() / this.$delete() rewritten to delete expressionautomaticLink
remove .native modifier from v-on directivesautomaticLink
remove functional component markersautomaticLink
render function h()automaticLink
hook: events renamed to vue:automaticLink
$nextTick()automaticLink
$scopedSlots removedautomaticLink
Vue.set() removedautomaticLink
v-bind:foo.sync becomes v-model:fooautomaticLink
$listeners removedautomatic / manualLink
destroyed and beforeDestroy lifecycle hooks renamedautomaticLink
v-model updatesautomaticLink
transition-group no longer renders a root elementautomaticLink
transition props were renamedautomaticLink
is attribute can only be used on a <component> tagmanualLink
$children removedmanualLink
v-if / v-for precedence changedmanualLink
vue filters removedmanualLink
global application instance / app instantiationmanualLink

Vue Router

PluginMigration TypeMigration Guide
vue-router instantiation changed (WIP)automaticLink
currentRoute.something becomes currentRoute.value.somethingautomaticLink
onReady replaced with isReadyautomaticLink
router.getMatchedComponents() removedautomaticLink
passing slot content to router-viewautomaticLink
RouteConfig, Location, Route types renamedautomaticLink
router.app removedmanualLink
catch-all routes syntax changedmanualLink
append prop in router-link removedmanualLink
event and tag props in router-link removedmanualLink
exact prop in router-link removedmanualLink
router.match() removedmanualLink

Vuex

PluginTypeMigration Guide
Store instantiation changedautomaticLink

Vue Test Utils

PluginMigration TypeMigration Guide
propsData mount option renamed to propsautomaticLink
new global mount optionautomaticLink
wrapper.destroy() renamed to wrapper.unmount()automaticLink
scopedSlots option merged with slotsautomaticLink
createLocalVue removedautomatic / manualLink
Wrapper APIs removedmanualLink
1.0.25

1 month ago

1.0.22

2 months ago

1.0.24

2 months ago

1.0.23

2 months ago

1.0.19

2 months ago

1.0.18

2 months ago

1.0.17

2 months ago

1.0.16

2 months ago

1.0.21

2 months ago

1.0.20

2 months ago

1.0.15

2 months ago

1.0.14

2 months ago

1.0.13

2 months ago

1.0.12

2 months ago

1.0.11

2 months ago

1.0.9

2 months ago

1.0.10

2 months ago

1.0.8

2 months ago

1.0.7

2 months ago

1.0.6

2 months ago

1.0.5

2 months ago

1.0.4

3 months ago

1.0.3

3 months ago

1.0.1

3 months ago

1.0.0

3 months ago

0.0.3

3 months ago

0.0.2

3 months ago