Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: use Nuxt components loader instead custom Vite plugin #276

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

userquin
Copy link
Member

@userquin userquin commented Sep 11, 2024

DON'T MERGE YET

Description

This PR will use Nuxt auto import instead custom Vuetify Vite plugin to resolve components, this will allow:

  • use resolveComponent with Vuetify components
  • allow use LazyV** Vuetify variants (defineAsyncComponent): LazyVBtn for example
  • add support for future Nuxt v4 and Vue 3.5 hydration stuff for free (<LazyVisibleVBtn />, <LazyIdleVBtn /> , <LazyEventVBtn />, <LazyMediaVBtn />...): feat: delayed hydration nuxt/nuxt#26468
  • directives still being resolved by custom Vite plugin: I'll try to add the support to Nuxt

This PR also includes:

  • update Nuxt Kit and Nuxt in playground to 3.13.1 (playgrounds)
  • update pnpm to 9.10.0
  • update Vuetify to 3.7.1
  • update TypeScript to 5.6.2
  • update Vue to 3.5.4 (all workspaces)
  • update VitePress to 1.3.4 (docs)
  • update Vite PWA plugin to 0.20.5 (docs)
  • update VitePress PWA integration to 0.5.3 (docs)
  • update Vite PWA assets generator to 0.2.6 (docs)
  • update vue-tsc to 2.1.6

Linked Issues

Additional Context

There is some Nuxt module or dependency (Vuetify or I18n Nuxt module) still augmenting @vue/runtime-core instead vue: added declarations.d.ts in playground root.


Tip

The author of this PR can publish a preview release by commenting /publish below.

Copy link

pkg-pr-new bot commented Sep 11, 2024

pnpm add https://pkg.pr.new/vuetify-nuxt-module@276

commit: bfc472d

@@ -54,29 +54,42 @@ export function configureNuxt(
})

nuxt.hook('prepare:types', ({ references }) => {
references.push({ types: 'vuetify' })
// references.push({ types: 'vuetify' })
Copy link
Member Author

@userquin userquin Sep 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Testing with and without this, VSCode doesn't seem to work on LazyVbtn (missing auto completion/props suggestion), IntelliJ works 🤔

kebabName: toKebabCase(component),
export: component,
filePath,
shortPath: filePath,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we should try with vuetify/components, vuetify resolving to lib/index.d.mts:

imagen

@userquin userquin changed the title feat!: use Nuxt auto import instead custom Vite plugin feat!: use Nuxt components import instead custom Vite plugin Sep 11, 2024
.entries(components)
.forEach(([component, entry]) => {
const from = entry.from
const name = from.split('/').at(-1)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this can be removed, the name is the component var

import { isPackageExists } from 'local-pkg'
import type * as Components from 'vuetify/components'
import type * as Directives from 'vuetify/directives'
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

review these 2 imports

@userquin userquin changed the title feat!: use Nuxt components import instead custom Vite plugin feat!: use Nuxt components loader instead custom Vite plugin Sep 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant