Skip to content
This repository was archived by the owner on Apr 6, 2023. It is now read-only.
/frameworkPublic archive

fix(nuxt): render head scripts that use body: true - #6293

Merged
pi0 merged 9 commits into
nuxt:mainfrom
harlan-zw:fix/use-head-script-body
Aug 2, 2022
Merged

fix(nuxt): render head scripts that use body: true#6293
pi0 merged 9 commits into
nuxt:mainfrom
harlan-zw:fix/use-head-script-body

Conversation

@harlan-zw

@harlan-zwharlan-zw commented Aug 2, 2022

Copy link
Copy Markdown
Collaborator

🔗 Linked issue

@vueuse/head PR: vueuse/head#67

issues: nuxt/nuxt#13069, nuxt/nuxt#13991, nuxt/nuxt#13345

❓ Type of change

  • 📖 Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

With nuxt using the latest version of @vueuse/head, it already has support for appending script and links to the end of the body tag with the body: true option.

However due to a mismatch with property names of NuxtMeta and @vueuse/head nothing is rendered, this fixes that and adds some small doc and tests around the feature

Note: This does not work in components, this will need to be looked at in a separate PR as there is some extra complexity involved

📝 Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

Resolves naming difference with NuxtMeta and @vueuse/head causing the scripts not to be rendered. This allows applies to `link`.
@netlify

netlifyBot commented Aug 2, 2022

Copy link
Copy Markdown

Deploy Preview for nuxt3-docs ready!

NameLink
🔨 Latest commited33e1e
🔍 Latest deploy loghttps://app.netlify.com/sites/nuxt3-docs/deploys/62e90d8306f743000859ec54
😎 Deploy Previewhttps://deploy-preview-6293--nuxt3-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

pi0
pi0 approved these changes Aug 2, 2022
@pi0pi0 changed the title fix(head): render scripts that use body: truefix(nuxt): render head scripts that use body: trueAug 2, 2022

@atinuxatinux left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks you! Looks good to me, let's have a second eye from other core team members ☺️

Comment threaddocs/content/2.guide/2.features/4.head-management.md Outdated
Comment threaddocs/content/2.guide/2.features/4.head-management.md Outdated
Comment threaddocs/content/2.guide/2.features/4.head-management.md Outdated
Comment threadpackages/nuxt/src/core/runtime/nitro/renderer.ts Outdated
pi0and others added 4 commits August 2, 2022 13:41
Co-authored-by: Damian Głowala <48835293+DamianGlowala@users.noreply.github.com>
Co-authored-by: Damian Głowala <48835293+DamianGlowala@users.noreply.github.com>
Co-authored-by: Damian Głowala <48835293+DamianGlowala@users.noreply.github.com>
Co-authored-by: Damian Głowala <48835293+DamianGlowala@users.noreply.github.com>
@pi0
pi0 merged commit 622c976 into nuxt:mainAug 2, 2022
@pi0

pi0 commented Aug 2, 2022

Copy link
Copy Markdown
Member

Thanks for docs improvements @DamianGlowala!

@pi0pi0 mentioned this pull request Aug 5, 2022
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@harlan-zw@pi0@atinux@DamianGlowala@danielroe