@unhead/shared
3.4.3 · 13 Oct 2026MIT586.1k / weekRepositoryHomepagenpmAtom feed
188 stable releases, newest first, by release line. Notes are quoted as the maintainers published them.
1.3.0
14 Aug 202330% Smaller: Now under 1kb (954 bytes)
~50% Faster: Taking a typical site from 30ms to 15ms to render tags on the initial mount and 11ms to 7ms on page changes.
Code was cleaned up and simplified
Highlights :fire
Improved DOM Renderer (#185)
The slowest part of Unhead is figuring out what DOM elements and attributes are needed to be added, updated or removed.
This release introduces an improved DOM renderer with some key improvements:
30% Smaller: Now under 1kb (954 bytes)
~50% Faster: Taking a typical site from 30ms to 15ms to render tags on the initial mount and 11ms to 7ms on page changes.
Bundle Improvements
You should see a ~20% reduction in your client bundle without losing any functionality.
Code was cleaned up and simplified
Utils no longer exported
Deprecated composables removed
Before
image
After
image
Hash Hydration Plugin (#183)
A flag was previously introduced that enabled experimental hash hydration
experimentalHashHydration. This reduces your initial mount time to 0ms for the dom renderer. This has now been moved to a plugin.This is now an optional plugin and should perform better.
createHead({ - experimentalHashHydration: true, + plugins: [ + HashHydrationPlugin() + ] })Other Changes
Debounced promise is now attached to the Unhead instance instead of global
New hook:
dom:renderedget tags once they're rendered
:warning: Breaking Changes
There were a number of more verbose composable which were deprecated in v1, they have now been removed. (#184).
If you're using any of the following, you should use the
useHeador other composable.1.2.2
2 Aug 2023unhead: only sort head tags with capo
unhead: opt-in capo tracking
1.2.1
1 Aug 20231.1.35
31 Jul 2023Allow async transformers
1.1.34
30 Jul 2023Allow hooking into before tag resolve
tags:beforeResolve
1.1.33
28 Jul 2023unhead: broken titles with $1 in them
1.1.32
17 Jul 2023schema: type new entry options
1.1.31
17 Jul 2023unhead: auto
mode: serverwhen usingcreateServerHeadunhead: support
tagPriorityandtagPositionentry options
1.1.30
5 Jul 2023addons: avoid duplicate twitter:card with
InferSeoMetaPluginunhead: preprocess
titlefor template paramsunhead: set default template param
separatoras|
1.1.29
1 Jul 2023unhead: string
themeColorregression
1.1.28
26 Jun 2023unhead: avoid deduping tags with higher priority
unhead: sorting tag alias offset relative
Notable Changes
Title / TitleTemplate Tag Priority (3807766), closes #165
For parity with how the tag priority works for other tags, you can now set a tag priority for title and title template.
useHead({ title: { textContent: 'high-priority title', tagPriority: 'high', }, }) // ... useHead({ title: 'new title' }) // ... // title will be "high-priortiy title"useSeoMeta
themeColorYou can now provide themeColor as an object or an array of objects with the
mediakey. This allows you to provide different themes depending on the device and user preferences.useSeoMeta({ themeColor: [ { content: 'cyan', media: '(prefers-color-scheme: light)' }, { content: 'black', media: '(prefers-color-scheme: dark)' }, ], }):bug: Bug Fixes
1.1.27
18 May 2023unhead: support Safari <= 13.0
1.1.25
25 Mar 20231.1.22
9 Mar 2023vue: types for nested templateParams
1.1.21
8 Mar 2023templateParams: substitute json values safely
1.1.20
7 Mar 2023inferSeoMetaPlugin: infer from titleTemplates
1.1.19
7 Mar 20231.1.17
6 Mar 2023ssr: stringify inner content
1.1.16
5 Mar 2023useSeoMeta: use correct og tag for site name
1.1.15
2 Mar 2023unhead:
templateParamsnot getting filteredvue: optimise useServerHead call stack
1.1.14
28 Feb 2023addons: export unplugin options
1.1.13
28 Feb 20231.1.12
28 Feb 2023addons: provide unplugin options
1.1.11
27 Feb 2023unhead: inline dependency
packrup
1.1.10
27 Feb 2023unhead: support
createServerHeadvue: polyfill
[@vueuse](https://github.com/vueuse)/head
1.1.9
26 Feb 2023addons: support stubbing
useSeoMeta({ title })
1.1.8
26 Feb 2023templateParams: edge-case regex issues
1.1.7
26 Feb 2023templateParams: always process params for %s usage
templateParams: support JSON templating
1.1.5
25 Feb 2023TreeshakeServerComposable: do not run on server builds
unhead: allow script objects
1.1.4
25 Feb 2023templateParams: %s and %pageTitle substitution
1.1.3
25 Feb 2023UseSeoMetaTransform: calleeName fallback
1.1.2
25 Feb 2023addons: avoid transpiling node_modules
1.1.1
25 Feb 2023addons: missing
rooterror
1.1.0
24 Feb 2023- Deprecated
unhead: deprecate shorthand composables #114
:magic_wand: Template Params (PR)
:safety_vest: useHeadSafe (PR)
1.1.0 is here and with it comes some exciting new features, significantly performance improvements a number of security improvements
and more!Highlights
:magic_wand: Template Params (PR)
Allows you to add template parameters that can be referenced in other tags. This is useful for reducing boilerplate and for third-party integrations to provide runtime configuration.
useHead({ templateParams: { seperator: '|', site: { name: 'My Site', url: 'https://example.com', } }, titleTemplate: '%s %seperator %site.name', meta: [ { property: 'og:url', content: '%site.url' }, { property: 'og:image', content: '%site.url/image.png' } ] }):safety_vest: useHeadSafe (PR)
This release signifies a shift in how we deal with potential XSS issues. The
useHeadSafecomposable is now the recommended way to
add head data when the input is not trusted. The white-listed tags and attributes are significantly limited, as
there are many more XSS vectors than just script tags.useHeadSafe({ title: 'About', meta: [ { name: 'description', content: 'My about page' } ] }):sparkles: Inner Content Changes (PR)
The previous recommendation for tag inner content was to use the
childrenkey. This worked well, but it was not clear what kind of
behaviour this would have in the DOM and SSR.childrenis now deprecated in favour of usingtextContentandinnerHTMLkeys.useHead({ script: [ // more obvious that this is dangerous { innerHTML: "console.log('hello world')" } ] })While dealing with tags, which will just be inner content such as
<style>and<script>, shorthand input is now available.useHead({ // This will be converted to <style>body { background: red; }</style> style: [ 'body { background: red; }' ], // shorthand urls are also supported: <script src="https://example.com/script.js"></script> script: [ 'https://example.com/script.js' ] })Opt-in Performance:
experimentalHashHydration(PR)
The experimentalHashHydration option is being introduced, it is opt-in. It offers some sites the ability to completely bypass the blocking CPU time for the client hydration of head tags. (between 5-25ms reduction)
createHead({ experimentalHashHydration: true, })Read more
Opt-in Performance:
UseSeoMetaTransform(PR)
The useSeoMeta function is a great addition for developer experience, but the code required to unpack the meta is around 2kb and in most cases is not needed at runtime. We add a custom Vite transformer which turns useSeoMeta into useHead.
import UnheadVite from '@unhead/addons/vite' export default defineConfig({ plugins: [ UnheadVite(), ], })Changelog
Fixes
- Deprecated
unhead: deprecate shorthand composables #114
1.0.22
16 Feb 2023- Security
Title XSS issue vulnerability
Avoid inlining unhead dependency
Head is not set correctly when using keepalive in router-view
Bug Fixes
Avoid inlining unhead dependency
Head is not set correctly when using keepalive in router-view
- Security
Title XSS issue vulnerability
Performance Improvements
createDocumentFragmentto minimise DOM patchesAvoid rebuilding props for non-event props
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.