Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

chore(bridge): Improve typing for vueApp #1996

Closed
wants to merge 3 commits into from

Conversation

tobiasdiez
Copy link
Contributor

πŸ”— Linked issue

❓ Type of change

  • πŸ“– Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

The methods of nuxtApp.vueApp were of type any for me. Instead of using the VueAppCompat interface, I propose to directly use VueConstructor.

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@netlify
Copy link

netlify bot commented Nov 17, 2021

βœ”οΈ Deploy Preview for nuxt3-docs canceled.

πŸ”¨ Explore the source changes: 52dfb21

πŸ” Inspect the deploy log: https://app.netlify.com/sites/nuxt3-docs/deploys/6195195d2b13960008504a05

@tobiasdiez tobiasdiez mentioned this pull request Nov 17, 2021
38 tasks
export interface NuxtAppCompat {
nuxt2Context: Vue
vue2App: ComponentOptions<Vue>

vueApp: VueAppCompat
vueApp: VueConstructor
Copy link
Member

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?

Copy link
Contributor Author

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?

Copy link
Member

@pi0 pi0 Nov 18, 2021

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

Copy link
Contributor Author

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants