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

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

Merged
merged 9 commits into from
Aug 2, 2022
Merged

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

merged 9 commits into from
Aug 2, 2022

Conversation

harlan-zw
Copy link
Collaborator

@harlan-zw harlan-zw commented Aug 2, 2022

🔗 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
Copy link

netlify bot commented Aug 2, 2022

Deploy Preview for nuxt3-docs ready!

Name Link
🔨 Latest commit ed33e1e
🔍 Latest deploy log https://app.netlify.com/sites/nuxt3-docs/deploys/62e90d8306f743000859ec54
😎 Deploy Preview https://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 changed the title fix(head): render scripts that use body: true fix(nuxt): render head scripts that use body: true Aug 2, 2022
Copy link
Member

@atinux atinux left a comment

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 ☺️

docs/content/2.guide/2.features/4.head-management.md Outdated Show resolved Hide resolved
docs/content/2.guide/2.features/4.head-management.md Outdated Show resolved Hide resolved
docs/content/2.guide/2.features/4.head-management.md Outdated Show resolved Hide resolved
packages/nuxt/src/core/runtime/nitro/renderer.ts Outdated Show resolved Hide resolved
pi0 and 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:main Aug 2, 2022
@pi0
Copy link
Member

pi0 commented Aug 2, 2022

Thanks for docs improvements @DamianGlowala!

@pi0 pi0 mentioned this pull request Aug 5, 2022
@danielroe danielroe added the 3.x label Jan 19, 2023
Sign up for free to 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