Skip to content

v0.6.0

Compare
Choose a tag to compare
@harlan-zw harlan-zw released this 06 Jul 11:11
· 477 commits to main since this release

compare changes

This release includes several breaking changes. It will most likely be the last release with major breaking changes, leading to a stable release and public announcement. Please see the migration guide at the bottom of the release notes if you've started using Nuxt Scripts in public preview.

🚀 New Facade Components

This release includes Facade components for Crisp, Intercom and Lemon Squeezy. These should provide an improvement to your web vitals.

You can learn more about these work on the new Facade Components documentation.

v0.6.0

🚀 Enhancements

  • Detect await $script.load() (#117)
  • ⚠️ Convert module config globals to object (#127)
  • ScriptIntercom (fa5ab56)
  • useScriptCrisp and ScriptCrisp (#128)
  • ⚠️ ScriptLemonSqueezy (#130)

🩹 Fixes

  • tpc: Respect script location and action field (#105)
  • docs: Matomo-analytics website url (#118)
  • Generate globals plugin correctly (1594f67)
  • Use object syntax to define NuxtConfigScriptRegistry (#124)
  • Avoid adding plugin if module is disabled (2e4df43)
  • Devtool UI improvements (a8bf500)
  • Make scripts accessible at nuxtApp.$scripts (a41347c)
  • Hook up UI props (993c123)
  • ⚠️ ScriptCarbonAds prefer ready event (d32e0d8)
  • Consistent component error event emits (c9d2b3e)
  • ⚠️ Rename useElementScriptTrigger, useConsentScriptTrigger, useAnalyticsPageEvent (038d891)
  • Properly support array triggers with useScriptTriggerElement (ade64a4)

💅 Refactors

  • tpc: Move tests to AST instead of code snapshots (#99)
  • Refactor import { type foo } to import type { foo } (#108)
  • tpc: Remove augmentWindowTypes (#119)

📖 Documentation

  • readme: Fix links in Next Steps (#102)
  • Add basic contribution guide (#109)
  • Refactor script setup lang="ts" (#116)
  • Fix contributing guide (#122)

⚠️ Breaking Changes

  • ⚠️ Convert module config globals to object (#127)
  • ⚠️ ScriptLemonSqueezy (#130)
  • ⚠️ ScriptCarbonAds prefer ready event (d32e0d8)
  • ⚠️ Rename useElementScriptTrigger, useConsentScriptTrigger, useAnalyticsPageEvent (038d891)

❤️ Contributors

Migration Guide

Object Globals Config

The globals config now must be provided as an object. This allows us to create an easy to reference id for accessing the script instance. Please see the updated global scripts docs.

export default defineNuxtConfig({
  scripts: {
-   globals: [/* ... */]
+   globals: {/* ... */]
  }
})

Composable renames

All of the Nuxt Scripts composables have been renamed for improved scope clarity.

  • useElementScriptTrigger -> useScriptTriggerElement
  • useConsentScriptTrigger -> useScriptTriggerConsent
  • useAnalyticsPageEvent -> useScriptEventPage