Repository navigation
fix!: drop deprecations - #624
Merged
Merged
Conversation
Merged
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔗 Linked issue
❓ Type of change
📚 Description
Drops all deprecated items from Unhead v2.
1. Legacy Property Names
Impact: High - Many existing codebases use these legacy property names.
The
DeprecationsPluginthat automatically converted legacy property names has been removed. You must update your head entries to use the current property names.children→innerHTMLhead.push({ script: [{ - children: 'console.log("hello")', + innerHTML: 'console.log("hello")', }] })hid/vmid→keyhead.push({ meta: [{ - hid: 'description', + key: 'description', name: 'description', content: 'My description' }] })head.push({ meta: [{ - vmid: 'og:title', + key: 'og:title', property: 'og:title', content: 'My Title' }] })body: true→tagPosition: 'bodyClose'head.push({ script: [{ src: '/script.js', - body: true, + tagPosition: 'bodyClose', }] })Quick Reference
childreninnerHTMLhidkeyvmidkeybody: truetagPosition: 'bodyClose'2. Schema.org Plugin
Impact: High - Anyone using
@unhead/schema-orgwill need to update.The
PluginSchemaOrgandSchemaOrgUnheadPluginexports have been removed. UseUnheadSchemaOrginstead.For Vue users:
3. Server Composables
Impact: Medium-High - Common in SSR applications.
The
useServerHead,useServerHeadSafe, anduseServerSeoMetacomposables have been removed. Use the standard composables instead.useServerHead→useHeaduseServerHeadSafe→useHeadSafeuseServerSeoMeta→useSeoMetaNote: If you need server-only head management, use conditional logic or framework-specific SSR detection instead of mode-based composables.
4. Vue Legacy Exports
Impact: Medium - Affects Vue users on older setups.
/legacyExport Path RemovedThe
/legacyexport path has been removed from@unhead/vue.createHeadCoreRemoved5. Core API Changes
Impact: Medium - Affects custom integrations and advanced usage.
createHeadCore→createUnheadheadEntries()→entriesMapThe
headEntries()method has been removed. Access entries directly via theentriesMap.modeOption RemovedThe
modeoption on head entries has been removed. Runtime mode detection is no longer supported.head.push({ title: 'My Page', - }, { mode: 'server' }) + })If you need server-only or client-only head management, use the appropriate
createHeadfunction:6. Schema.org Config Options
Impact: Low-Medium - Affects users with custom Schema.org configuration.
The following Schema.org config options have been removed:
canonicalHosthostcanonicalUrlpath+hostpositiontagPositionon individual schema entriesdefaultLanguageinLanguageon schema nodesdefaultCurrencypriceCurrencyon schema nodesUnheadSchemaOrg({ - canonicalHost: 'https://example.com', - canonicalUrl: 'https://example.com/page', + host: 'https://example.com', + path: '/page', })7. Server Utilities
Impact: Low - Only affects users parsing HTML for head extraction.
extractUnheadInputFromHtml→parseHtmlForUnheadExtractionThe function has been moved from
unhead/servertounhead/parser.8. Type Changes
Impact: Low - Only affects TypeScript users with explicit type imports.
Removed Type Aliases
HeadHeadTagor specific tag typesResolvedHeadResolvedHeadTagMergeHeadMetaFlatInputMetaFlatResolvedMetaFlatMetaFlatRuntimeMode9. Hooks
Impact: Low - Only affects users with custom hook implementations.
initHook RemovedThe
inithook has been removed fromHeadHooks.dom:renderTagHook RemovedThe
dom:renderTaghook has been removed. This hook was called for each tag during DOM rendering.dom:renderedHook RemovedThe
dom:renderedhook has been removed. DOM rendering is now synchronous.If you need to run logic after DOM rendering, call
renderDOMHeaddirectly and add your logic after:dom:beforeRenderis Now SynchronousThe
dom:beforeRenderhook no longer supports async handlers.head.hooks.hook('dom:beforeRender', (ctx) => { - await someAsyncOperation() ctx.shouldRender = true })renderDOMHeadis Now SynchronousThe
renderDOMHeadfunction no longer returns a Promise.10. Other Removed APIs
Impact: Low - Internal utilities rarely used directly.
resolveScriptKeyThe
resolveScriptKeyfunction is no longer exported. This was an internal utility.resolveUnrefHeadInput(Vue)- import { resolveUnrefHeadInput } from '@unhead/vue'Reactive head input resolution now happens automatically within the head manager.
setHeadInjectionHandler(Vue)Head injection is now handled automatically.
DeprecationsPlugin- import { DeprecationsPlugin } from 'unhead/plugins'Instead of using this plugin, update your code to use the current property names (see Section 1).
Quick Reference: Import Changes