Closed vesper8 closed 4 years ago
There's no Vue.use
in Vue 3.
So the signature of third-party plugins needs some change.
Per the experience from vue-router & vuex, a possible new API is like app.use(router)
where router
used to be a root component option in Vue 2.
At the time of developing this plugin, I assume users only use the core packages as most third-party libraries haven't been upgraded to Vue 3. So I wrote a straightforward codemod to strip Vue.use
and turn root options to app.use()
.
This is no longer correct though. As of vuetify@next, app.use
still expects .use(Vuetify)
. I'll fix the code logic in the next version.
@sodatea ping for next version fix? Hope all is good with you in China?
Thanks for reminding me. I'm busy with some personal stuff and will be off for the next few days. I may have the time to fix the bugs later next week.
Meanwhile, it's hard to get everything right for a plugin that is invoked after the project scaffolding, considering there may be unexpected third-party libraries that are not supported. So I'm working on a PR to directly create Vue 3 projects with Vue CLI https://github.com/vuejs/vue-cli/pull/5637 Hopefully it will be included in the mid-July release. People will no longer need this plugin after that release.
I just tried adding this plugin to an existing project to see what would happen. It did a lot of changes, mostly renaming props to use
#
, changing dependencies in mypackage.json
and making a few changes in mymain.js
One change that didn't make any sense to me is that it removed all this:
while leaving:
Is this right? are imports now sufficient and you no longer need to add
Vue.use
?