Description
What problem does this feature solve?
- Allows to drop
@vue/composition-api
plugin after migrating fromvue@^2.6.x
into^2.7.x
. - It makes migration from
2.x
to3.x
one step easier.
If you were previously using @vue/composition-api, update imports from it to vue instead. Note that some APIs exported by the plugin, e.g. createApp, are not ported in 2.7.
— https://blog.vuejs.org/posts/vue-2-7-naruto.html
The release notes do mention that some APIs are not ported to 2.7
, that's why this is not a bug report because it might be intentional.
defineAsyncComponent
looks like something that would be a nice addition to this final 2.x
version, since async components already exist in vue2 land: the syntax just slightly changed (v2 vs v3).
Also @vue/composition-api
version does it and it does not appear to use any vue3 internals, so it seems technically achievable.
What does the proposed API look like?
implement and export a defineAsyncComponent
using prior art (@vue/composition-api
plugin version as base).
- import { defineAsyncComponent } from '@vue/composition-api'
+ import { defineAsyncComponent } from 'vue'