Skip to content

Releases: unjs/unhead

v1.9.8

01 May 13:03
Compare
Choose a tag to compare

   🐞 Bug Fixes

    View changes on GitHub

v1.9.7

19 Apr 07:30
Compare
Choose a tag to compare

   🐞 Bug Fixes

    View changes on GitHub

v1.9.6

19 Apr 05:48
Compare
Choose a tag to compare

   🐞 Bug Fixes

   🏎 Performance

    View changes on GitHub

v1.9.5

12 Apr 03:14
Compare
Choose a tag to compare

   🐞 Bug Fixes

    View changes on GitHub

v1.9.4

01 Apr 08:30
Compare
Choose a tag to compare

   🐞 Bug Fixes

    View changes on GitHub

v1.9.3

29 Mar 06:48
Compare
Choose a tag to compare

   🐞 Bug Fixes

    View changes on GitHub

v1.9.2

27 Mar 14:54
Compare
Choose a tag to compare

   🐞 Bug Fixes

    View changes on GitHub

v1.9.1

25 Mar 03:19
Compare
Choose a tag to compare

   🐞 Bug Fixes

   🏎 Performance

    View changes on GitHub

v1.9.0

25 Mar 02:17
Compare
Choose a tag to compare

Release 1.9.0 - useScript Stable

useScript is 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 idle

While this was handy in user-land, providing support for it meant providing a polyfill for window.requestIdleCallback due 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-prefetch or a preconnect <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 $script object 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

   🐞 Bug Fixes

    View changes on GitHub

v1.8.20

16 Mar 03:58
Compare
Choose a tag to compare

   🏎 Performance

    View changes on GitHub