diff --git a/package.json b/package.json
index 43f4099319..a83bde8b2b 100644
--- a/package.json
+++ b/package.json
@@ -44,9 +44,9 @@
"@nuxt/vite-builder": "workspace:*",
"@nuxt/webpack-builder": "workspace:*",
"@types/node": "22.10.7",
- "@unhead/schema": "2.0.0-alpha.3",
- "@unhead/vue": "2.0.0-alpha.3",
- "@unhead/shared": "2.0.0-alpha.3",
+ "@unhead/schema": "2.0.0-alpha.4",
+ "@unhead/vue": "2.0.0-alpha.4",
+ "@unhead/shared": "2.0.0-alpha.4",
"@vue/compiler-core": "3.5.13",
"@vue/compiler-dom": "3.5.13",
"@vue/shared": "3.5.13",
@@ -63,7 +63,7 @@
"typescript": "5.7.3",
"ufo": "1.5.4",
"unbuild": "3.3.1",
- "unhead": "2.0.0-alpha.3",
+ "unhead": "2.0.0-alpha.4",
"unimport": "3.14.6",
"vite": "6.0.9",
"vue": "3.5.13"
@@ -83,8 +83,8 @@
"@types/babel__helper-plugin-utils": "7.10.3",
"@types/node": "22.10.7",
"@types/semver": "7.5.8",
- "@unhead/schema": "2.0.0-alpha.3",
- "@unhead/vue": "2.0.0-alpha.3",
+ "@unhead/schema": "2.0.0-alpha.4",
+ "@unhead/vue": "2.0.0-alpha.4",
"@vitest/coverage-v8": "3.0.2",
"@vue/test-utils": "2.4.6",
"acorn": "8.14.0",
diff --git a/packages/nuxt/package.json b/packages/nuxt/package.json
index ee8ce5ec03..d7abf8def5 100644
--- a/packages/nuxt/package.json
+++ b/packages/nuxt/package.json
@@ -71,7 +71,7 @@
"@nuxt/schema": "workspace:*",
"@nuxt/telemetry": "^2.6.4",
"@nuxt/vite-builder": "workspace:*",
- "@unhead/vue": "^2.0.0-alpha.3",
+ "@unhead/vue": "^2.0.0-alpha.4",
"@vue/shared": "^3.5.13",
"acorn": "8.14.0",
"c12": "^2.0.1",
diff --git a/packages/nuxt/src/app/components/nuxt-island.ts b/packages/nuxt/src/app/components/nuxt-island.ts
index 637f9b98b0..26bcd88e9e 100644
--- a/packages/nuxt/src/app/components/nuxt-island.ts
+++ b/packages/nuxt/src/app/components/nuxt-island.ts
@@ -3,14 +3,15 @@ import { Fragment, Teleport, computed, createStaticVNode, createVNode, defineCom
import { debounce } from 'perfect-debounce'
import { hash } from 'ohash'
import { appendResponseHeader } from 'h3'
-import { type ActiveHeadEntry, type Head, injectHead } from '@unhead/vue'
import { randomUUID } from 'uncrypto'
import { joinURL, withQuery } from 'ufo'
import type { FetchResponse } from 'ofetch'
+import type { ActiveHeadEntry, ResolvedHead } from '@unhead/vue/types'
import type { NuxtIslandResponse } from '../types'
import { useNuxtApp, useRuntimeConfig } from '../nuxt'
import { prerenderRoutes, useRequestEvent } from '../composables/ssr'
+import { injectHead } from '../composables/head'
import { getFragmentHTML } from './utils'
// @ts-expect-error virtual file
@@ -90,7 +91,7 @@ export default defineComponent({
const instance = getCurrentInstance()!
const event = useRequestEvent()
- let activeHead: ActiveHeadEntry
+ let activeHead: ActiveHeadEntry>
// TODO: remove use of `$fetch.raw` when nitro 503 issues on windows dev server are resolved
const eventFetch = import.meta.server ? event!.fetch : import.meta.dev ? $fetch.raw : globalThis.fetch
diff --git a/packages/nuxt/src/app/composables/head.ts b/packages/nuxt/src/app/composables/head.ts
new file mode 100644
index 0000000000..4ece97ad7c
--- /dev/null
+++ b/packages/nuxt/src/app/composables/head.ts
@@ -0,0 +1,78 @@
+import type { UseHeadInput, UseHeadOptions, UseHeadSafeInput, UseSeoMetaInput, VueHeadClient } from '@unhead/vue'
+import type { ActiveHeadEntry, MergeHead } from '@unhead/schema'
+import { hasInjectionContext, inject } from 'vue'
+import {
+ useHead as headCore,
+ useHeadSafe as headSafe,
+ headSymbol,
+ useSeoMeta as seoMeta, useServerHead as serverHead, useServerHeadSafe as serverHeadSafe,
+ useServerSeoMeta as serverSeoMeta,
+} from '@unhead/vue'
+import { tryUseNuxtApp, useNuxtApp } from '#app'
+import type { NuxtApp } from '#app'
+// @ts-expect-error build-time
+import { isNuxt4 } from '#build/nuxt.config.mjs'
+
+function resolveUnheadInject (): VueHeadClient | undefined {
+ // try use Vue inject
+ if (hasInjectionContext()) {
+ return inject>(headSymbol)!
+ }
+}
+
+/**
+ * Injects the head client from the Nuxt context or Vue inject.
+ *
+ * In Nuxt v3 this function will not throw an error if the context is missing.
+ */
+export function injectHead (nuxtApp?: NuxtApp): VueHeadClient {
+ // Nuxt 4 will throw an error if the context is missing
+ const nuxt = nuxtApp || (isNuxt4 ? useNuxtApp() : tryUseNuxtApp())
+ return nuxt?.ssrContext?.head || nuxt?.runWithContext(resolveUnheadInject) as VueHeadClient || resolveUnheadInject()
+}
+
+interface NuxtUseHeadOptions extends UseHeadOptions {
+ nuxt?: NuxtApp
+}
+
+export function useHead (input: UseHeadInput, options: NuxtUseHeadOptions = {}): ActiveHeadEntry> | void {
+ const head = injectHead(options.nuxt)
+ if (isNuxt4 || head) {
+ return headCore(input, { head, ...options }) as ActiveHeadEntry>
+ }
+}
+
+export function useHeadSafe (input: UseHeadSafeInput, options: NuxtUseHeadOptions = {}): ActiveHeadEntry> | void {
+ const head = injectHead(options.nuxt)
+ if (isNuxt4 || head) {
+ return headSafe(input, { head, ...options }) as ActiveHeadEntry
+ }
+}
+
+export function useSeoMeta (input: UseSeoMetaInput, options: NuxtUseHeadOptions = {}): ActiveHeadEntry | void {
+ const head = injectHead(options.nuxt)
+ if (isNuxt4 || head) {
+ return seoMeta(input, { head, ...options }) as ActiveHeadEntry
+ }
+}
+
+export function useServerHead (input: UseHeadInput, options: NuxtUseHeadOptions = {}): ActiveHeadEntry> | void {
+ const head = injectHead(options.nuxt)
+ if (isNuxt4 || head) {
+ return serverHead(input, { head, ...options }) as ActiveHeadEntry>
+ }
+}
+
+export function useServerHeadSafe (input: UseHeadSafeInput, options: NuxtUseHeadOptions = {}): ActiveHeadEntry | void {
+ const head = injectHead(options.nuxt)
+ if (isNuxt4 || head) {
+ return serverHeadSafe(input, { head, ...options }) as ActiveHeadEntry
+ }
+}
+
+export function useServerSeoMeta (input: UseSeoMetaInput, options: NuxtUseHeadOptions = {}): ActiveHeadEntry | void {
+ const head = injectHead(options.nuxt)
+ if (isNuxt4 || head) {
+ return serverSeoMeta(input, { head, ...options }) as ActiveHeadEntry
+ }
+}
diff --git a/packages/nuxt/src/app/composables/index.ts b/packages/nuxt/src/app/composables/index.ts
index 4b8704fa25..cd458ee257 100644
--- a/packages/nuxt/src/app/composables/index.ts
+++ b/packages/nuxt/src/app/composables/index.ts
@@ -26,3 +26,4 @@ export { useId } from './id'
export { useRouteAnnouncer } from './route-announcer'
export type { Politeness } from './route-announcer'
export { useRuntimeHook } from './runtime-hook'
+export { injectHead, useHead, useHeadSafe, useSeoMeta, useServerHead, useServerHeadSafe, useServerSeoMeta } from './head'
diff --git a/packages/nuxt/src/app/composables/script-stubs.ts b/packages/nuxt/src/app/composables/script-stubs.ts
index f1f54c9ff2..4f9364d84e 100644
--- a/packages/nuxt/src/app/composables/script-stubs.ts
+++ b/packages/nuxt/src/app/composables/script-stubs.ts
@@ -1,4 +1,4 @@
-import type { UseScriptInput } from '@unhead/vue'
+import type { UseScriptInput, UseScriptOptions } from '@unhead/vue/legacy'
import { createError } from './error'
function renderStubMessage (name: string) {
@@ -13,7 +13,7 @@ function renderStubMessage (name: string) {
}
// eslint-disable-next-line @typescript-eslint/no-unused-vars
-export function useScript> (input: UseScriptInput, options?: Record) {
+export function useScript> (input: UseScriptInput, options?: UseScriptOptions) {
renderStubMessage('useScript')
}
diff --git a/packages/nuxt/src/app/index.ts b/packages/nuxt/src/app/index.ts
index 9935ab9f75..ef62f0f814 100644
--- a/packages/nuxt/src/app/index.ts
+++ b/packages/nuxt/src/app/index.ts
@@ -1,7 +1,7 @@
export { applyPlugin, applyPlugins, callWithNuxt, createNuxtApp, defineAppConfig, defineNuxtPlugin, definePayloadPlugin, isNuxtPlugin, registerPluginHooks, tryUseNuxtApp, useNuxtApp, useRuntimeConfig } from './nuxt'
export type { CreateOptions, NuxtApp, NuxtPayload, NuxtPluginIndicator, NuxtSSRContext, ObjectPlugin, Plugin, PluginEnvContext, PluginMeta, ResolvedPluginMeta, RuntimeNuxtHooks } from './nuxt'
-export { defineNuxtComponent, useAsyncData, useLazyAsyncData, useNuxtData, refreshNuxtData, clearNuxtData, useHydration, callOnce, useState, clearNuxtState, clearError, createError, isNuxtError, showError, useError, useFetch, useLazyFetch, useCookie, refreshCookie, onPrehydrate, prerenderRoutes, useRequestHeaders, useRequestEvent, useRequestFetch, setResponseStatus, useResponseHeader, onNuxtReady, abortNavigation, addRouteMiddleware, defineNuxtRouteMiddleware, onBeforeRouteLeave, onBeforeRouteUpdate, setPageLayout, navigateTo, useRoute, useRouter, preloadComponents, prefetchComponents, preloadRouteComponents, isPrerendered, loadPayload, preloadPayload, definePayloadReducer, definePayloadReviver, getAppManifest, getRouteRules, reloadNuxtApp, useRequestURL, usePreviewMode, useId, useRouteAnnouncer, useHead, useSeoMeta, useServerSeoMeta, useRuntimeHook } from './composables/index'
+export { useHead, useHeadSafe, useServerSeoMeta, useServerHeadSafe, useServerHead, useSeoMeta, defineNuxtComponent, useAsyncData, useLazyAsyncData, useNuxtData, refreshNuxtData, clearNuxtData, useHydration, callOnce, useState, clearNuxtState, clearError, createError, isNuxtError, showError, useError, useFetch, useLazyFetch, useCookie, refreshCookie, onPrehydrate, prerenderRoutes, useRequestHeaders, useRequestEvent, useRequestFetch, setResponseStatus, useResponseHeader, onNuxtReady, abortNavigation, addRouteMiddleware, defineNuxtRouteMiddleware, onBeforeRouteLeave, onBeforeRouteUpdate, setPageLayout, navigateTo, useRoute, useRouter, preloadComponents, prefetchComponents, preloadRouteComponents, isPrerendered, loadPayload, preloadPayload, definePayloadReducer, definePayloadReviver, getAppManifest, getRouteRules, reloadNuxtApp, useRequestURL, usePreviewMode, useId, useRouteAnnouncer, injectHead, useRuntimeHook } from './composables/index'
export type { AddRouteMiddlewareOptions, AsyncData, AsyncDataOptions, AsyncDataRequestStatus, CookieOptions, CookieRef, FetchResult, NuxtAppManifest, NuxtAppManifestMeta, NuxtError, Politeness, ReloadNuxtAppOptions, RouteMiddleware, UseFetchOptions } from './composables/index'
export { defineNuxtLink } from './components/index'
diff --git a/packages/nuxt/src/core/runtime/nitro/renderer.ts b/packages/nuxt/src/core/runtime/nitro/renderer.ts
index 4c817499fc..8dcfe6dfb2 100644
--- a/packages/nuxt/src/core/runtime/nitro/renderer.ts
+++ b/packages/nuxt/src/core/runtime/nitro/renderer.ts
@@ -17,8 +17,7 @@ import destr from 'destr'
import { getQuery as getURLQuery, joinURL, withoutTrailingSlash } from 'ufo'
import { renderToString as _renderToString } from 'vue/server-renderer'
import { createHead as createServerHead, propsToString, renderSSRHead } from '@unhead/vue/server'
-import type { Head, HeadEntryOptions } from '@unhead/schema'
-import type { Link, Script, Style } from '@unhead/vue'
+import type { Head, HeadEntryOptions, Link, ResolvedHead, Script, Style } from '@unhead/vue/types'
import { resolveUnrefHeadInput } from '@unhead/vue'
import { defineRenderHandler, getRouteRules, useNitroApp, useRuntimeConfig, useStorage } from 'nitro/runtime'
@@ -78,7 +77,7 @@ export interface NuxtIslandContext {
export interface NuxtIslandResponse {
id?: string
html: string
- head: Head
+ head: Partial
props?: Record>
components?: Record
slots?: Record
@@ -474,7 +473,7 @@ export default defineRenderHandler(async (event): Promise = {}
for (const entry of head.headEntries()) {
for (const [key, value] of Object.entries(resolveUnrefHeadInput(entry.input) as Head)) {
const currentValue = islandHead[key as keyof Head]
diff --git a/packages/nuxt/src/core/templates.ts b/packages/nuxt/src/core/templates.ts
index 7a6890bf93..56912a5951 100644
--- a/packages/nuxt/src/core/templates.ts
+++ b/packages/nuxt/src/core/templates.ts
@@ -525,6 +525,7 @@ export const nuxtConfigTemplate: NuxtTemplate = {
`export const chunkErrorEvent = ${ctx.nuxt.options.experimental.emitRouteChunkError ? ctx.nuxt.options.builder === '@nuxt/vite-builder' ? '"vite:preloadError"' : '"nuxt:preloadError"' : 'false'}`,
`export const crawlLinks = ${!!((ctx.nuxt as any)._nitro as Nitro).options.prerender.crawlLinks}`,
`export const spaLoadingTemplateOutside = ${ctx.nuxt.options.experimental.spaLoadingTemplateLocation === 'body'}`,
+ `export const isNuxt4 = ${ctx.nuxt.options.future.compatibilityVersion === 4}`,
].join('\n\n')
},
}
diff --git a/packages/nuxt/src/head/module.ts b/packages/nuxt/src/head/module.ts
index f9865a5fd9..8432adda3e 100644
--- a/packages/nuxt/src/head/module.ts
+++ b/packages/nuxt/src/head/module.ts
@@ -42,7 +42,7 @@ export default defineNuxtModule({
const exportPath = resolve(runtimeDir, 'exports', isNuxtV4 ? 'v4' : 'v3')
nuxt.options.alias['#unhead/exports'] = exportPath
addImportsSources({
- from: exportPath,
+ from: '#app',
imports: unheadVueComposablesImports['@unhead/vue'],
})
diff --git a/packages/nuxt/src/head/runtime/components.ts b/packages/nuxt/src/head/runtime/components.ts
index c4bee3cae3..ccf1fd5b78 100644
--- a/packages/nuxt/src/head/runtime/components.ts
+++ b/packages/nuxt/src/head/runtime/components.ts
@@ -1,6 +1,5 @@
-import { defineComponent } from 'vue'
+import { computed, defineComponent } from 'vue'
import type { PropType, SetupContext } from 'vue'
-import { useHead } from '@unhead/vue'
import type {
CrossOrigin,
FetchPriority,
@@ -10,6 +9,7 @@ import type {
ReferrerPolicy,
Target,
} from './types'
+import { useHead } from '#app/composables/head'
const removeUndefinedProps = (props: Props) => {
const filteredProps = Object.create(null)
@@ -23,7 +23,7 @@ const removeUndefinedProps = (props: Props) => {
}
const setupForUseMeta = (metaFactory: (props: Props, ctx: SetupContext) => Record, renderChild?: boolean) => (props: Props, ctx: SetupContext) => {
- useHead(() => metaFactory({ ...removeUndefinedProps(props), ...ctx.attrs }, ctx))
+ useHead(computed(() => metaFactory({ ...removeUndefinedProps(props), ...ctx.attrs }, ctx)))
return () => renderChild ? ctx.slots.default?.() : null
}
diff --git a/packages/nuxt/src/head/runtime/exports.ts b/packages/nuxt/src/head/runtime/exports.ts
new file mode 100644
index 0000000000..02e69d41c4
--- /dev/null
+++ b/packages/nuxt/src/head/runtime/exports.ts
@@ -0,0 +1,17 @@
+export {
+ injectHead,
+ useHead,
+ useHeadSafe,
+ useSeoMeta,
+ useServerHead,
+ useServerHeadSafe,
+ useServerSeoMeta,
+} from '#app'
+
+export {
+ createHeadCore,
+ resolveUnrefHeadInput,
+ unheadVueComposablesImports,
+} from '@unhead/vue'
+
+export * from '@unhead/vue/types'
diff --git a/packages/nuxt/src/head/runtime/exports/v3.ts b/packages/nuxt/src/head/runtime/exports/v3.ts
deleted file mode 100644
index 2eb9a57003..0000000000
--- a/packages/nuxt/src/head/runtime/exports/v3.ts
+++ /dev/null
@@ -1,92 +0,0 @@
-import type { ActiveHeadEntry, MergeHead } from '@unhead/schema'
-import type { UseHeadInput, UseHeadOptions, UseHeadSafeInput, UseSeoMetaInput,
- VueHeadClient } from '@unhead/vue'
-import {
- useHead as head,
- useHeadSafe as headSafe,
- useSeoMeta as seoMeta,
- useServerHead as serverHead,
- useServerHeadSafe as serverHeadSafe,
- useServerSeoMeta as serverSeoMeta,
-} from '@unhead/vue'
-import type { UseScriptInput, UseScriptOptions, UseScriptReturn } from '@unhead/vue/legacy'
-import {
- injectHead as inject,
- useScript as script,
-} from '@unhead/vue/legacy'
-import { tryUseNuxtApp } from '#app'
-import type { NuxtApp } from '#app'
-
-export * from '@unhead/vue/legacy'
-
-interface NuxtUseHeadOptions extends UseHeadOptions {
- nuxt?: NuxtApp
-}
-
-/**
- * Injects the head client from the Nuxt context or Vue inject.
- *
- * In Nuxt v3 this function will not throw an error if the context is missing.
- */
-export function injectHead (nuxtApp?: NuxtApp): VueHeadClient | undefined {
- const nuxt = nuxtApp || tryUseNuxtApp()
- if (nuxt?.ssrContext?.head) {
- return nuxt?.ssrContext?.head
- }
- if (nuxt) {
- return nuxt.runWithContext(inject) as VueHeadClient
- }
- // try use Vue inject
- return inject()
-}
-
-export function useHead (input: UseHeadInput, options: NuxtUseHeadOptions = {}): ActiveHeadEntry> | void {
- const unhead = injectHead(options.nuxt)
- if (unhead) {
- return head(input, { head: unhead, ...options }) as ActiveHeadEntry>
- }
-}
-
-export function useHeadSafe (input: UseHeadSafeInput, options: NuxtUseHeadOptions = {}): ActiveHeadEntry> | void {
- const unhead = injectHead(options.nuxt)
- if (unhead) {
- return headSafe(input, { head: unhead, ...options }) as ActiveHeadEntry
- }
-}
-
-export function useSeoMeta (input: UseSeoMetaInput, options: NuxtUseHeadOptions = {}): ActiveHeadEntry | void {
- const unhead = injectHead(options.nuxt)
- if (unhead) {
- return seoMeta(input, { head: unhead, ...options }) as ActiveHeadEntry
- }
-}
-
-export function useServerHead (input: UseHeadInput, options: NuxtUseHeadOptions = {}): ActiveHeadEntry> | void {
- const unhead = injectHead(options.nuxt)
- if (unhead) {
- return serverHead(input, { head: unhead, ...options }) as ActiveHeadEntry>
- }
-}
-
-export function useServerHeadSafe (input: UseHeadSafeInput, options: NuxtUseHeadOptions = {}): ActiveHeadEntry | void {
- const unhead = injectHead(options.nuxt)
- if (unhead) {
- return serverHeadSafe(input, { head: unhead, ...options }) as ActiveHeadEntry
- }
-}
-
-export function useServerSeoMeta (input: UseSeoMetaInput, options: NuxtUseHeadOptions = {}): ActiveHeadEntry> | void {
- const unhead = injectHead(options.nuxt)
- if (unhead) {
- return serverSeoMeta(input, { head: unhead, ...options }) as ActiveHeadEntry
- }
-}
-
-/**
- * Aliased for users doing `import { useScript } from '@unhead/vue'`
- * @deprecated This will be removed in Nuxt v4. Use `useScript` exported from `@unhead/scripts/vue`
- */
-export function useScript = Record> (input: UseScriptInput, options?: UseScriptOptions & { nuxt?: NuxtApp }): UseScriptReturn | void {
- const unhead = injectHead(options?.nuxt)
- return script(input, { head: unhead, ...options })
-}
diff --git a/packages/nuxt/src/head/runtime/exports/v4.ts b/packages/nuxt/src/head/runtime/exports/v4.ts
deleted file mode 100644
index f8cfb5b4db..0000000000
--- a/packages/nuxt/src/head/runtime/exports/v4.ts
+++ /dev/null
@@ -1,58 +0,0 @@
-import type { ActiveHeadEntry, MergeHead } from '@unhead/schema'
-import type { UseHeadInput, UseHeadOptions, UseHeadSafeInput, UseSeoMetaInput, VueHeadClient } from '@unhead/vue'
-import { useHead as head, useHeadSafe as headSafe, injectHead as inject, useSeoMeta as seoMeta, useServerHead as serverHead, useServerHeadSafe as serverHeadSafe, useServerSeoMeta as serverSeoMeta } from '@unhead/vue'
-import type { NuxtApp } from 'nuxt/app'
-import { useNuxtApp } from 'nuxt/app'
-
-export * from '@unhead/vue'
-
-interface NuxtUseHeadOptions extends UseHeadOptions {
- nuxt?: NuxtApp
-}
-
-/**
- * Injects the head client from the Nuxt context or Vue inject.
- *
- * In Nuxt v3 this function will not throw an error if the context is missing.
- */
-export function injectHead (nuxtApp?: NuxtApp): VueHeadClient {
- const nuxt = nuxtApp || useNuxtApp()
- if (nuxt?.ssrContext?.head) {
- return nuxt?.ssrContext?.head
- }
- if (nuxt) {
- return nuxt.runWithContext(inject) as VueHeadClient
- }
- // try use Vue inject
- return inject()
-}
-
-export function useHead (input: UseHeadInput, options: NuxtUseHeadOptions = {}): ActiveHeadEntry> | void {
- const unhead = injectHead(options.nuxt)
- return head(input, { head: unhead, ...options }) as ActiveHeadEntry>
-}
-
-export function useHeadSafe (input: UseHeadSafeInput, options: NuxtUseHeadOptions = {}): ActiveHeadEntry> | void {
- const unhead = injectHead(options.nuxt)
- return headSafe(input, { head: unhead, ...options }) as ActiveHeadEntry
-}
-
-export function useSeoMeta (input: UseSeoMetaInput, options: NuxtUseHeadOptions = {}): ActiveHeadEntry | void {
- const unhead = injectHead(options.nuxt)
- return seoMeta(input, { head: unhead, ...options }) as ActiveHeadEntry
-}
-
-export function useServerHead (input: UseHeadInput, options: NuxtUseHeadOptions = {}): ActiveHeadEntry> | void {
- const unhead = injectHead(options.nuxt)
- return serverHead(input, { head: unhead, ...options }) as ActiveHeadEntry>
-}
-
-export function useServerHeadSafe (input: UseHeadSafeInput, options: NuxtUseHeadOptions = {}): ActiveHeadEntry | void {
- const unhead = injectHead(options.nuxt)
- return serverHeadSafe(input, { head: unhead, ...options }) as ActiveHeadEntry
-}
-
-export function useServerSeoMeta (input: UseSeoMetaInput, options: NuxtUseHeadOptions = {}): ActiveHeadEntry> | void {
- const unhead = injectHead(options.nuxt)
- return serverSeoMeta(input, { head: unhead, ...options }) as ActiveHeadEntry
-}
diff --git a/packages/schema/package.json b/packages/schema/package.json
index e439a85fa2..a7ce05ce5e 100644
--- a/packages/schema/package.json
+++ b/packages/schema/package.json
@@ -37,7 +37,7 @@
},
"devDependencies": {
"@types/pug": "2.0.10",
- "@unhead/schema": "2.0.0-alpha.3",
+ "@unhead/schema": "2.0.0-alpha.4",
"@vitejs/plugin-vue": "5.2.1",
"@vitejs/plugin-vue-jsx": "4.1.1",
"@vue/compiler-core": "3.5.13",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index fd78133aee..adaa8391ba 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -12,9 +12,9 @@ overrides:
'@nuxt/vite-builder': workspace:*
'@nuxt/webpack-builder': workspace:*
'@types/node': 22.10.7
- '@unhead/schema': 2.0.0-alpha.3
- '@unhead/vue': 2.0.0-alpha.3
- '@unhead/shared': 2.0.0-alpha.3
+ '@unhead/schema': 2.0.0-alpha.4
+ '@unhead/vue': 2.0.0-alpha.4
+ '@unhead/shared': 2.0.0-alpha.4
'@vue/compiler-core': 3.5.13
'@vue/compiler-dom': 3.5.13
'@vue/shared': 3.5.13
@@ -31,7 +31,7 @@ overrides:
typescript: 5.7.3
ufo: 1.5.4
unbuild: 3.3.1
- unhead: 2.0.0-alpha.3
+ unhead: 2.0.0-alpha.4
unimport: 3.14.6
vite: 6.0.9
vue: 3.5.13
@@ -83,11 +83,11 @@ importers:
specifier: 7.5.8
version: 7.5.8
'@unhead/schema':
- specifier: 2.0.0-alpha.3
- version: 2.0.0-alpha.3
+ specifier: 2.0.0-alpha.4
+ version: 2.0.0-alpha.4
'@unhead/vue':
- specifier: 2.0.0-alpha.3
- version: 2.0.0-alpha.3(vue@3.5.13(typescript@5.7.3))
+ specifier: 2.0.0-alpha.4
+ version: 2.0.0-alpha.4(vue@3.5.13(typescript@5.7.3))
'@vitest/coverage-v8':
specifier: 3.0.2
version: 3.0.2(vitest@3.0.2(@types/node@22.10.7)(happy-dom@16.6.0)(jiti@2.4.2)(terser@5.32.0)(tsx@4.19.2)(yaml@2.6.1))
@@ -339,8 +339,8 @@ importers:
specifier: 22.10.7
version: 22.10.7
'@unhead/vue':
- specifier: 2.0.0-alpha.3
- version: 2.0.0-alpha.3(vue@3.5.13(typescript@5.7.3))
+ specifier: 2.0.0-alpha.4
+ version: 2.0.0-alpha.4(vue@3.5.13(typescript@5.7.3))
'@vue/shared':
specifier: 3.5.13
version: 3.5.13
@@ -684,8 +684,8 @@ importers:
specifier: 2.0.10
version: 2.0.10
'@unhead/schema':
- specifier: 2.0.0-alpha.3
- version: 2.0.0-alpha.3
+ specifier: 2.0.0-alpha.4
+ version: 2.0.0-alpha.4
'@vitejs/plugin-vue':
specifier: 5.2.1
version: 5.2.1(vite@6.0.9(@types/node@22.10.7)(jiti@2.4.2)(terser@5.32.0)(tsx@4.19.2)(yaml@2.6.1))(vue@3.5.13(typescript@5.7.3))
@@ -2842,14 +2842,14 @@ packages:
'@ungap/structured-clone@1.2.0':
resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==}
- '@unhead/schema@2.0.0-alpha.3':
- resolution: {integrity: sha512-Q9xkdjtBNH0gBp0IzX2FIjRFencMlhQwZgm6L9HtPDtM1UEsOsHZq4f/EsaUyJj82py3aJrbVe6rQfTs1gPTjw==}
+ '@unhead/schema@2.0.0-alpha.4':
+ resolution: {integrity: sha512-iy2bqEDLcqoiShxb2iPpU6DBeBPuTugEgcg7Crixc2QZMRSPKYfjN2q0T5nRDJxQhOfuI7pEAFWUZ2prI6B4gw==}
- '@unhead/shared@2.0.0-alpha.3':
- resolution: {integrity: sha512-fiqKptv3VrjVASoMGMsLyKAFiVPyArPPr6VXDkhAPVlu1twvs58AhuWF6GJaJr2XJCnamPBj88rUVFO0x4E/9g==}
+ '@unhead/shared@2.0.0-alpha.4':
+ resolution: {integrity: sha512-1qXRbFGncCon7HBBX0wSVjZ8Y43kT6OnfXFcLNdNO5lpOZqrY9VCj+jqCpGPXGGtw+FAqzAk5EVw5fVVD/WzUw==}
- '@unhead/vue@2.0.0-alpha.3':
- resolution: {integrity: sha512-EpjNAykZ9XffZEPXxWp7iMAKrIordKjDfliaY8Wlz2fbsqbHnucTfTEvmJE+niFpA3pvjxJOd/atAME6MuYzbw==}
+ '@unhead/vue@2.0.0-alpha.4':
+ resolution: {integrity: sha512-RyzNur7Ui2XHCV07aw2r4g4Tf7wpL18XxYiOB6tqli3ryf5K1W728N53x0TCMrjfQksByCaIogHUsvI+cKx+ZQ==}
peerDependencies:
vue: 3.5.13
@@ -7278,10 +7278,6 @@ packages:
resolution: {integrity: sha512-i11VH5gS6IFeLY3gMBQ00/MmLncVP7JLXOw1vlgkytLmJK7QnEr7NXf0LBdxfmNPAeyetukOk0bOYrJrFGjYJQ==}
engines: {node: '>=14.0.0'}
- tinypool@1.0.1:
- resolution: {integrity: sha512-URZYihUbRPcGv95En+sz6MfghfIc2OJ1sv/RmhWZLouPY0/8Vo80viwPvg3dlaS9fuq7fQMEfgRRK7BBZThBEA==}
- engines: {node: ^18.0.0 || >=20.0.0}
-
tinypool@1.0.2:
resolution: {integrity: sha512-al6n+QEANGFOMf/dmUMsuS5/r9B06uwlyNjZZql/zv8J7ybHCgoihBNORZCY2mzUuAnomQa2JdhyHKzZxPCrFA==}
engines: {node: ^18.0.0 || >=20.0.0}
@@ -7436,8 +7432,8 @@ packages:
unenv@1.10.0:
resolution: {integrity: sha512-wY5bskBQFL9n3Eca5XnhH6KbUo/tfvkwm9OpcdCvLaeA7piBNbavbOKJySEwQ1V0RH6HvNlSAFRTpvTqgKRQXQ==}
- unhead@2.0.0-alpha.3:
- resolution: {integrity: sha512-L9KBaikZL/aftapkfKW9jN4PEGv0czhodZvxHFv7JGD85WdWvVW9KJ2c74qvGhz2Y53JMjP83//O6ZwW/LhGoA==}
+ unhead@2.0.0-alpha.4:
+ resolution: {integrity: sha512-BEcPo1xyQMpJjLuh3fh68zQA26rOsfNi/HjheCUBsn59Y+EnqYC/I8NH1QjPNIeXH8snCI3/D0IzKj16qkhsBA==}
unicode-emoji-modifier-base@1.0.0:
resolution: {integrity: sha512-yLSH4py7oFH3oG/9K+XWrz1pSi3dfUrWEnInbxMfArOfc1+33BlGPQtLsOYwvdMy11AwUBetYuaRxSPqgkq+8g==}
@@ -9114,7 +9110,7 @@ snapshots:
'@types/google.maps': 3.58.1
'@types/vimeo__player': 2.18.3
'@types/youtube': 0.1.0
- '@unhead/vue': 2.0.0-alpha.3(vue@3.5.13(typescript@5.7.3))
+ '@unhead/vue': 2.0.0-alpha.4(vue@3.5.13(typescript@5.7.3))
'@vueuse/core': 11.1.0(vue@3.5.13(typescript@5.7.3))
consola: 3.4.0
defu: 6.1.4
@@ -10070,22 +10066,22 @@ snapshots:
'@ungap/structured-clone@1.2.0': {}
- '@unhead/schema@2.0.0-alpha.3':
+ '@unhead/schema@2.0.0-alpha.4':
dependencies:
hookable: 5.5.3
zhead: 2.2.4
- '@unhead/shared@2.0.0-alpha.3':
+ '@unhead/shared@2.0.0-alpha.4':
dependencies:
- '@unhead/schema': 2.0.0-alpha.3
+ '@unhead/schema': 2.0.0-alpha.4
packrup: 0.1.2
- '@unhead/vue@2.0.0-alpha.3(vue@3.5.13(typescript@5.7.3))':
+ '@unhead/vue@2.0.0-alpha.4(vue@3.5.13(typescript@5.7.3))':
dependencies:
- '@unhead/schema': 2.0.0-alpha.3
- '@unhead/shared': 2.0.0-alpha.3
+ '@unhead/schema': 2.0.0-alpha.4
+ '@unhead/shared': 2.0.0-alpha.4
hookable: 5.5.3
- unhead: 2.0.0-alpha.3
+ unhead: 2.0.0-alpha.4
vue: 3.5.13(typescript@5.7.3)
'@unocss/astro@0.62.4(rollup@4.31.0)(vite@6.0.9(@types/node@22.10.7)(jiti@2.4.2)(terser@5.32.0)(tsx@4.19.2)(yaml@2.6.1))':
@@ -15440,9 +15436,6 @@ snapshots:
tinypool@0.8.4: {}
- tinypool@1.0.1:
- optional: true
-
tinypool@1.0.2: {}
tinyrainbow@1.2.0:
@@ -15637,10 +15630,10 @@ snapshots:
node-fetch-native: 1.6.4
pathe: 1.1.2
- unhead@2.0.0-alpha.3:
+ unhead@2.0.0-alpha.4:
dependencies:
- '@unhead/schema': 2.0.0-alpha.3
- '@unhead/shared': 2.0.0-alpha.3
+ '@unhead/schema': 2.0.0-alpha.4
+ '@unhead/shared': 2.0.0-alpha.4
hookable: 5.5.3
unicode-emoji-modifier-base@1.0.0: {}
@@ -15930,7 +15923,7 @@ snapshots:
dependencies:
cac: 6.7.14
debug: 4.4.0(supports-color@9.4.0)
- es-module-lexer: 1.5.4
+ es-module-lexer: 1.6.0
pathe: 1.1.2
vite: 6.0.9(@types/node@22.10.7)(jiti@2.4.2)(sass@1.78.0)(terser@5.32.0)(tsx@4.19.2)(yaml@2.6.1)
transitivePeerDependencies:
@@ -16122,7 +16115,7 @@ snapshots:
std-env: 3.8.0
tinybench: 2.9.0
tinyexec: 0.3.2
- tinypool: 1.0.1
+ tinypool: 1.0.2
tinyrainbow: 1.2.0
vite: 6.0.9(@types/node@22.10.7)(jiti@2.4.2)(sass@1.78.0)(terser@5.32.0)(tsx@4.19.2)(yaml@2.6.1)
vite-node: 2.1.8(@types/node@22.10.7)(jiti@2.4.2)(sass@1.78.0)(terser@5.32.0)(tsx@4.19.2)(yaml@2.6.1)