Baroshem / nuxt-lazy-hydrate

💦 Lazy Hydration Module for Nuxt
https://www.npmjs.com/package/nuxt-lazy-hydrate
89 stars 1 forks source link

feat: add composables autoimport #4

Closed FRSgit closed 1 year ago

FRSgit commented 1 year ago

fix component import typings update module structure

BREAKING CHANGE: component is now autoimported as due to nuxt addComponent() issue

FRSgit commented 1 year ago

This PR fixes module behaviour in newer nuxt versions: <LazyHydrate> component typings weren't properly read by volar in VSC - component was typed as unknown.

Unfortunately, nuxt addComponent() api fails when trying to register component named Lazy* - component wasn't loading at all in the module playground. To avoid this issue I needed to change component name to NuxtLazyHydrate (this name follows pattern of NuxtLink or `NuxtImg).