vue-upgrade-tool

1.0.25 • Public • Published

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

Plugin Migration Type Migration Guide
data option must return a function automatic Link
component options wrapped with defineComponent() automatic Link
Vue.delete() / this.$delete() rewritten to delete expression automatic Link
remove .native modifier from v-on directives automatic Link
remove functional component markers automatic Link
render function h() automatic Link
hook: events renamed to vue: automatic Link
$nextTick() automatic Link
$scopedSlots removed automatic Link
Vue.set() removed automatic Link
v-bind:foo.sync becomes v-model:foo automatic Link
$listeners removed automatic / manual Link
destroyed and beforeDestroy lifecycle hooks renamed automatic Link
v-model updates automatic Link
transition-group no longer renders a root element automatic Link
transition props were renamed automatic Link
is attribute can only be used on a <component> tag manual Link
$children removed manual Link
v-if / v-for precedence changed manual Link
vue filters removed manual Link
global application instance / app instantiation manual Link

Vue Router

Plugin Migration Type Migration Guide
vue-router instantiation changed (WIP) automatic Link
currentRoute.something becomes currentRoute.value.something automatic Link
onReady replaced with isReady automatic Link
router.getMatchedComponents() removed automatic Link
passing slot content to router-view automatic Link
RouteConfig, Location, Route types renamed automatic Link
router.app removed manual Link
catch-all routes syntax changed manual Link
append prop in router-link removed manual Link
event and tag props in router-link removed manual Link
exact prop in router-link removed manual Link
router.match() removed manual Link

Vuex

Plugin Type Migration Guide
Store instantiation changed automatic Link

Vue Test Utils

Plugin Migration Type Migration Guide
propsData mount option renamed to props automatic Link
new global mount option automatic Link
wrapper.destroy() renamed to wrapper.unmount() automatic Link
scopedSlots option merged with slots automatic Link
createLocalVue removed automatic / manual Link
Wrapper APIs removed manual Link

Readme

Keywords

none

Package Sidebar

Install

npm i vue-upgrade-tool

Weekly Downloads

6

Version

1.0.25

License

MIT

Unpacked Size

67 kB

Total Files

4

Last publish

Collaborators

  • unrefinedbrain