Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

Commit

Permalink
refactor(nuxt): deprecate <Script> component tag in template (#8197)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Oct 15, 2022
1 parent 256c1fd commit 5e7dfc2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/nuxt/src/head/runtime/components.ts
Expand Up @@ -66,6 +66,10 @@ const globalProps = {
}

// <script>

let scriptDeprecated = false

/** @deprecated */
export const Script = defineComponent({
// eslint-disable-next-line vue/no-reserved-component-names
name: 'Script',
Expand Down Expand Up @@ -93,6 +97,11 @@ export const Script = defineComponent({
renderPriority: [String, Number]
},
setup: setupForUseMeta((props, { slots }) => {
if (process.dev && !scriptDeprecated) {
console.log('[nuxt] `<Script>` is deprecated and may be removed in a future release. We advise using `useHead()` directly.')
scriptDeprecated = true
}

const script = { ...props }
const textContent = (slots.default?.() || [])
.filter(({ children }) => children)
Expand Down

0 comments on commit 5e7dfc2

Please sign in to comment.