@praxisjs/head
Changelog for @praxisjs/head — reactive document title, meta, og:*, twitter:*, preload, and prefetch management via the @Head decorator.
@praxisjs/head
0.3.3
Depends on the other @praxisjs/* packages through caret ranges (^2.3.0) instead of exact versions, so npm no longer installs a second copy of a package when two releases disagree, and upgrades no longer end in peer conflicts.
0.3.2
The published package no longer contains the package's tests (compiled tests in dist/__tests__, test sources in src/__tests__).
The package is marked "sideEffects": false, so bundlers leave out the modules of it that an app does not use.
Updates diff tags by a plain string key instead of JSON.stringify, and only query the whole <head> once, on the first update after load or resetHeadState(), to sweep tags left by a prerender. Updating or removing an entry that is not the top of the stack (an outer @Head while an inner one is mounted) no longer touches the document; headVersion still increments. A head update with a dozen tags is about twice as fast.
Bug fix: removeHead() with an id that was never pushed (or was already removed) reset document.title.
0.3.1
Updating the head no longer removes and recreates every managed tag. Tags the new config shares with the previous one stay in the document untouched, and only the difference is added or removed — a reactive @Head that changes one field now touches one tag. Repeated identical tags are kept as separate elements, a managed tag removed from the document is recreated on the next update, and tags left behind by a prerender are still swept. headVersion still increments on every update.
0.3.0
Added a @praxisjs/head/internal entry point exporting resetHeadState(), so @praxisjs/ssg's prerender runner can clear <head> tag state between routes rendered in the same Node process.
0.2.0
Added preload and prefetch link support to HeadConfig.
preload?: LinkPreload[]— emits<link rel="preload" href="..." as="...">tags. Supports optionaltypeandcrossOriginattributes (required for fonts with cross-origin isolation).prefetch?: LinkPrefetch[]— emits<link rel="prefetch" href="...">tags with an optionalashint.
Both fields are reactive: passing them inside a getter re-applies the correct link tags whenever their signal dependencies change. All managed tags are cleaned up on unmount.
New exported types: LinkPreload, LinkPrefetch.
0.1.0
Initial release.
@Head — class decorator that reactively manages the document <head> for a component. Accepts a static HeadConfig object or a reactive getter (self) => HeadConfig. Any signal read inside the getter triggers an automatic update.
Supported fields: title, description, canonical, meta[], og.*, twitter.*.
Stack-based: each component instance owns one entry. The last mounted entry wins; removing an entry restores the previous one. All managed tags are cleaned up automatically on unmount.