-
-
Notifications
You must be signed in to change notification settings - Fork 1k
chore(bridge): Improve typing for vueApp #1996
Conversation
βοΈ Deploy Preview for nuxt3-docs canceled. π¨ Explore the source changes: 52dfb21 π Inspect the deploy log: https://app.netlify.com/sites/nuxt3-docs/deploys/6195195d2b13960008504a05 |
export interface NuxtAppCompat { | ||
nuxt2Context: Vue | ||
vue2App: ComponentOptions<Vue> | ||
|
||
vueApp: VueAppCompat | ||
vueApp: VueConstructor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
vueApp
is a vue@3
a partial shim (while VueConstructor
imported from vue
in Nuxt2/bridge is from Vue2). Maybe we can use VueConstructor
and keep VueAppCompat
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you maybe clarify the purpose of vueApp in the context of bridge. All plugins and other libraries are based on vue2 anyway. Or is it meant as a migration path to use vue3-based libraries with nuxt/bridge?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed. it mimic vue3 insterface for integrations with vue3-only libs like @vueuse/head
. Otherwise on bridge you should rely on nuxtApp.vue2App
if plugin is meant to be used for Vue2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay thanks for the clarification. In this case, this PR doesn't make any sense. Let me see if I find a nice solution for VueAppCompat and I'll open a new PR then.
π Linked issue
β Type of change
π Description
The methods of
nuxtApp.vueApp
were of typeany
for me. Instead of using theVueAppCompat
interface, I propose to directly useVueConstructor
.π Checklist