Releases: unjs/unhead
v3.1.4
🐞 Bug Fixes
- bundler:
- Resolve dynamic ogImage in useSeoMeta transform - by @harlan-zw in #770 (06a85)
- scripts:
- Resolve useScript load promise via microtask - by @harlan-zw in #772 (d3cc3)
- types:
- Correct
music.radio_station+ addpayment.linkOG - by @harlan-zw in #775 (80027)
- Correct
- unhead:
- Avoid crash on script template params with no type - by @harlan-zw in #773 (90e75)
- Parse HTML attribute values without backslash escaping - by @harlan-zw in #774 (88c9d)
🏎 Performance
- unhead: Skip defensive tag clones when no mutating hooks registered - by @harlan-zw in #776 (032f2)
View changes on GitHub
v3.1.3
🐞 Bug Fixes
- bundler: Resolve devtools bridge and UI assets from package root - by @harlan-zw in #768 (78bcb)
View changes on GitHub
v3.1.2
🐞 Bug Fixes
- server: Re-expose
omitLineBreaksrender option - by @harlan-zw in #767 (95604)
View changes on GitHub
v3.1.1
🐞 Bug Fixes
- Scope alternate link dedupeKey by href when type is used - by @EduardF1 in #759 (e8699)
- types: Support union rel/type in defineLink and defineScript - by @harlan-zw in #765 (e4663)
View changes on GitHub
v2.1.15
No significant changes
View changes on GitHub
v2.1.14
🐞 Bug Fixes
- Scope alternate link dedupeKey by href when type is used - by @harlan-zw in #760 (10846)
View changes on GitHub
v3.1.0
🛠️ Unhead CLI
To assist with migrations and overall DX a CLI has been introduced: @unhead/cli.
npx -y @unhead/cli It lets you do the following:
audit Lint your codebase for unhead misuse, type-narrowing issues, and SEO/perf foot-guns.
migrate Apply autofixes for v2-to-v3 migration: rewrite deprecated props and wrap tag literals in defineX helpers.
validate-html Run the runtime ValidatePlugin over prerendered HTML files (e.g. dist/, .output/, build/).
validate-url Fetch a rendered URL and run unhead\'s SEO/perf validation rules over its <head>. For example, try running audit on your own project for hints on how to improve your SEO.
✔️ Unhead ESLint
Knowing that your useHead() and useSeoMeta() code is right while your coding is important. While type-narrowing solves many broken cases, we introduce an ESLint plugin to help catch anything that the typechecker can't catch.
These rules are shared from the runtime ValidatePlugin
# flat-config ESLint plugin with v2→v3 migration autofixes
npm i -D @unhead/eslint-plugin```ts [eslint.config.ts]
import { configs } from '@unhead/eslint-plugin'
export default [
configs.recommended,
]🌊 Streaming SSR non-Vite support
The streaming plugin lived only at unhead/stream/vite previously, leaving non-Vite users with no way to wire the bootstrap. The plugin is now a bundler-agnostic unplugin factory with first-class webpack and Vite entries, and the framework packages compose it behind Unhead({ streaming: true }).
// vite.config.ts
import { Unhead } from '@unhead/vue/vite'
export default { plugins: [vue(), Unhead({ streaming: true })] }
// webpack.config.ts
import { Unhead } from '@unhead/vue/bundler'
export default { plugins: [...Unhead({ streaming: true }).webpack()] }Streaming also gains a nonce option (forwarded on every injected <script> for CSP support), a fixed async mode for production Vite builds (the IIFE is now emitted via this.emitFile() so the script src references a real hashed asset), a dev-mode warning when the client IIFE runs against an empty server queue, and a shared StreamingGlobal type so the server bootstrap, client, and injected IIFE agree on the shape of window.__unhead__. Default mode changed from async to inline for smaller TTFB.
Changelog
🚀 Features
- cli,eslint-plugin:
- Add @unhead/cli and @unhead/eslint-plugin - by @harlan-zw in #755 (9e300)
- stream:
- Unify framework plugins as Unhead({ streaming: true }) per bundler - by @harlan-zw (63c03)
- Webpack plugin + bundler-agnostic factory - by @harlan-zw in #751 (3ed06)
🐞 Bug Fixes
- stream:
- Add missing webpack/rspack/rollup plugin entries - by @harlan-zw (7feae)
- Address coderabbit review comments - by @harlan-zw (180f4)
- Restore unhead/stream/vite as deprecation stub + re-add moduleType - by @harlan-zw (feee2)
- vue:
- Batch streamed head updates via self-deleting inline scripts - by @harlan-zw in #752 (40f77)
View changes on GitHub
v3.0.5
🐞 Bug Fixes
- bundler:
- Preserve useSeoMeta import when sibling call is untransformable - by @harlan-zw (8ea48)
- Preserve useSeoMeta import when sibling call is untransformable - by @harlan-zw in #749 (f7176)
- types:
- Export new link rel types from #744 - by @harlan-zw in #745 and #744 (af549)
- vue:
- Symmetric HeadStream vnodes for clean streaming hydration - by @harlan-zw in #748 (e860d)
View changes on GitHub
v3.0.4
🐞 Bug Fixes
- types: Missing
relsitemap, amphtml, hub, apple-touch-startup-image - by @harlan-zw in #744 (578da)
View changes on GitHub
v3.0.3
🐞 Bug Fixes
- bundler:
- Disable SSRStaticReplace in vite dev mode - by @harlan-zw in #739 (13121)
- legacy:
- Restore exports for v2 migration - by @harlan-zw in #741 (c400d)
- types:
- Prevent string widening in SpeculationRules nested types - by @harlan-zw in #737 (2d097)