v0.11.0
Breaking Changes
New Nuxt Version Requirement
The latest Nuxt Scripts now requires Nuxt v3.16. Please upgrade using nuxi upgrade --force
.
Updated useScript()
🚦 Impact Level: High
- Script instance is no longer augmented as a proxy and promise
script.proxy
is rewritten for simpler, more stable behaviorstub()
and runtime hookscript:instance-fn
are removed
Replacing promise usage
If you're using the script as a promise you should instead opt to use the onLoaded()
functions.
const script = useScript()
-script.then(() => console.log('loaded')
+script.onLoaded(() => console.log('loaded'))
Replacing proxy usage
If you're accessing the underlying API directly from the script instance, you will now need to only access it from the .proxy
.
const script = useScript('..', {
use() { return { foo: [] } }
})
-script.foo.push('bar')
+script.proxy.foo.push('bar')
Replacing stub()
If you were using stub for anything you should replace this with either custom use()
behavior.
const script = useScript('...', {
- stub() { return { foo: import.meta.server ? [] : undefined } }
})
+script.proxy = {} // your own implementation
What's Changed
- fix(googleMaps): fix window type augmentation by @huang-julien in #409
- build: add missing externals by @huang-julien in #415
Full Changelog: v0.10.5...v0.11.0