-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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(nuxt): add useHeadSafe
and remove layer around head imports
#19548
Conversation
|
#head
and #app
imports for autoImportSources#head
and #app
for auto-imports
#head
and #app
for auto-imports#head
and #app
for auto-imports
This is great! To reduce breaking changes, do you think we can keep an export from |
I've tentatively pushed a reversion of the breaking change in favour of deprecating the exports/interface, but happy to rethink if you think this isn't sensible. π |
#head
and #app
for auto-imports#head
and #app
for auto-imports
#head
and #app
for auto-importsuseHeadSafe
and remove layer around head imports
π Linked issue
β Type of change
π Description
For some context, Nuxt 3 was initially built to support different head providers. Initially, it was providing support for @vueuse/head and Vue meta (although there was no way to opt-in to it).
With
@vueuse/head
moving towards deprecation and Nuxt going all-in on Unhead, it makes sense to clean up some of the technical debt introduced in supporting multiple head providers.This technical debt can be summarised as:
#head
alias - pointed towards where the head composables where for#app
re-exporting the#head
composables - allowed nuxt internally to use any head providerWith this PR we move all head composables to the auto imports. For the Nxut app internal useHead calls, we import directly from
@unhead/vue
.Inadvertibly we also are adding support for the new composable
useHeadSafe
so I have provided doc and tests for it.useHead
from#head
or#app
. Users should switch to importing from#imports
. Also, we no longer recommend augmentingHeadAugmentations
; instead, we can directly augment the Unhead schema if we want to add custom completions.π Checklist