@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.9.5
12 Apr 2024scripts: Privacy default attributes
unhead: Handle
undefinedstyle attributes
1.9.4
1 Apr 2024scripts: Trigger load on client-side by default
1.9.3
29 Mar 2024scripts: Avoid recursive promise objects
scripts: Silently fail broken
useusagescripts: Ensure Vue
statusgets reactive stub
Bug Fixes
scripts: Avoid recursive promise objects
scripts: Silently fail broken
useusagescripts: Ensure Vue
statusgets reactive stubscripts: More open types for function callbacks
1.9.2
27 Mar 2024useScript: Support
trigger: (fn: Function)useScript: Vue status
loadingnot syncinguseScript: Incorrect
onerrortriggering
1.9.1
25 Mar 2024scripts: Avoid recursive event handling
scripts: Skip
onloadstartevent
1.9.0
25 Mar 2024- Breaking
script: Remove
script:transformhook - Breaking
script:
$scriptpromisable, removewaitForLoad - Breaking
script: Remove
$script.loaded
Release 1.9.0 -
useScriptStableuseScriptis built to provide better performance and DX when working with Third-Party Scripts. In this release we reduce the composable size has been reduced by 30% with some notable breaking changes:Removed trigger
idleWhile this was handy in user-land, providing support for it meant providing a polyfill for
window.requestIdleCallbackdue to limited browser support. Most integrations will already ship a polyfill for this so it added extra unnecessary weight.If you'd like to re-implement this behaviour there's a recipe on the docs and you should provide your own polyfill (if needed).
Early connections removed
When using the composable it would try and guess how the script is being used and append a
dns-prefetchor apreconnect<link>depending on usage. To reduce the composable weight, this should now be implemented in user or integration land.<link rel="dns-prefetch" href="<script-domain>" />
Awaiting Script Changes
When you wanted to avoid using the Proxy API and use the script instance directly, you could use the
$script.waitForLoad()function. To reduce the weight, the$scriptobject itself is now a promise:const { $script } = useScript('<src>', { use: () => window.myScript }) $script .then(instance => { // script is loaded, instance is the same as window.myScript }) .catch(() => { // script failed to load })Changelog
Breaking Changes
- Breaking
script: Remove
script:transformhook - Breaking
script:
$scriptpromisable, removewaitForLoad - Breaking
script: Remove
$script.loaded - Breaking
script: EventContext option, skip
onabort,onprogressevents - Breaking
script: Remove early connections
Bug Fixes
script: Typed
data-*keys
1.8.20
16 Mar 2024Always skip DOM render when not dirty
1.8.19
16 Mar 2024scripts: Re-using script breaks proxy
1.8.18
14 Mar 20241.8.17
14 Mar 2024scripts: Ensure script is synced to deduper
scripts: Hook into proxy calls with
script:instance-fn
1.8.16
13 Mar 2024scripts: Duplicate event registrations
1.8.15
13 Mar 2024scripts: Support string src
scripts: Avoid using inline events for client only
1.8.14
12 Mar 2024unhead: Handle style
urls
1.8.13
11 Mar 2024unhead: Support normalising
style
1.8.11
4 Mar 2024- Breaking
useSeoMetano longer supports getter types Gracefully handle disappearing head elements
Handle hydrating dupeable tags
1.8.10
16 Jan 2024useScript missing script API's return in proxy
1.8.9
8 Dec 2023unhead: Falsey
class/stylebreaks merging
1.8.8
23 Nov 2023schema-org: more accurate id resolving
1.8.7
21 Nov 2023Empty string
childrenbeing converted totrue
1.8.6
21 Nov 2023- Security
Check innerHTML is a string when applying XSS fixes
1.8.4
16 Nov 2023schema-org:
JobPostingrefinementsschema-org: allow overriding tag
tagPositionschema-org: isolated
Organizationfor Logo rich results
1.8.3
4 Nov 2023vue: maybe improve subpath export types
1.8.2
1 Nov 2023schema.org: more intuitive overrides
schema.org: support template params
1.8.1
29 Oct 2023scripts: better types for
transform
1.8.0
28 Oct 2023scripts: drop global index on
remove()Add ts auto-completions for
separatorscripts: removal scripts
$script.remove()
Bug Fixes
scripts: drop global index on
remove()Add ts auto-completions for
separator
Features
scripts: removal scripts
$script.remove()useScript
1.7.4
16 Sep 2023useSeoMeta regressions
1.7.3
14 Sep 2023Drop shorthand
{ script: [ '/script.js' ]support
1.7.2
13 Sep 20231.7.0
12 Sep 2023- Deprecated
vue: deprecate
polyfillAsVueUseHead
1.6.2
10 Sep 2023opt-in only to process innerHTML template params
Simplified tag prop normalisation
1.6.1
10 Sep 2023vue2: broken vue import
dirtyflag to avoid redundant head updatesResolve tags after
dom:beforeRender
1.6.0
10 Sep 2023addons: InferSeoMetaPlugin adding
og:titleto bodyunhead: increase all
tagPriorityweights by 10xunhead: new useSeoMeta logic with new opengraph tags
Bug Fixes
addons: InferSeoMetaPlugin adding
og:titleto bodyunhead: increase all
tagPriorityweights by 10x
Features
unhead: new useSeoMeta logic with new opengraph tags
vue: new Vue 2, Options Mixin install
1.5.5
9 Sep 2023ssr: fix JSON innerHTML encoding
1.5.4
7 Sep 2023infer-seo-meta-plugin: correct twitter card detection
1.5.2
5 Sep 2023vue: expose
setHeadInjectionHandler
1.5.1
4 Sep 2023dom: hydrate initial payload with current title
unhead: add title to server payload
1.5.0
3 Sep 2023schema-org: avoid appending null
ReadActiontoWebPageschema-org: avoid duplicate array entries
schema-org: delete shortcut props on
Question
Notice
This minor introduces warnings when using
useHeadwithout the Vue context available.Unhead is missing Vue context, falling back to shared context. This may have unexpected results.
When these warnings are shown, Unhead falls back to a shared context. Using this context has known issues when SSR parallel requests.
See #22712 for more context.
Bug Fixes
schema-org: avoid appending null
ReadActiontoWebPageschema-org: avoid duplicate array entries
schema-org: delete shortcut props on
Questionschema-org: export simpler plugin API
PluginSchemaOrgschema-org: prefer logo url over graph node
schema-org: resolve relation @id's with host
schema-org: simpler reactivity
vue: handle dom updates off of main thread
Features
vue: useHead
headoption to bypass injection
1.4.1
31 Aug 2023Avoid processing template
unhead:payload
1.3.9
27 Aug 2023unhead: encode template params for json
1.3.8
26 Aug 2023unhead: set payload type to
application/json
1.3.5
19 Aug 2023vue: support vue2 options API
1.3.4
15 Aug 2023Support SSR titleTemplate and templateParams
1.3.3
14 Aug 20231.3.2
14 Aug 2023HashHydrationPlugin: avoid setting empty hash
Avoid setting
mode: 'server'from head scope
1.3.1
14 Aug 2023
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.