Skip to content

fix(deps): add support for unhead v3#795

Open
danielroe wants to merge 3 commits into
mainfrom
fix/unhead-v3
Open

fix(deps): add support for unhead v3#795
danielroe wants to merge 3 commits into
mainfrom
fix/unhead-v3

Conversation

@danielroe
Copy link
Copy Markdown
Member

🔗 Linked issue

closes #703

📚 Description

this is an initial stab at making nuxt/scripts pass in ecosystem-ci with nuxt v4.5 (which contains unhead v3)

I've made a few guesses but feel free to scrap this!

@danielroe danielroe requested a review from harlan-zw May 26, 2026 08:54
@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented May 26, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
scripts-playground Error Error May 26, 2026 8:55am

link: [
{
rel: props.loading === 'eager' ? 'preconnect' : 'dns-prefetch',
rel: (props.loading === 'eager' ? 'preconnect' : 'dns-prefetch') as 'preconnect',
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

is this correct? do we not support dns-prefetch as a rel value

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 26, 2026

Open in StackBlitz

npm i https://pkg.pr.new/@nuxt/scripts@795

commit: dd74394

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 26, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a925285e-456b-4eb2-b03d-528326e5e883

📥 Commits

Reviewing files that changed from the base of the PR and between 90aced6 and dd74394.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (6)
  • packages/script/package.json
  • packages/script/src/assets.ts
  • packages/script/src/runtime/components/GoogleMaps/ScriptGoogleMapsStaticMap.vue
  • packages/script/src/runtime/composables/useScript.ts
  • packages/script/src/runtime/composables/useScriptEventPage.ts
  • test/nuxt-runtime/warmup.nuxt.test.ts
💤 Files with no reviewable changes (1)
  • packages/script/src/assets.ts

📝 Walkthrough

Walkthrough

This PR prepares the codebase for Unhead v3 compatibility. The peer dependency constraint for @unhead/vue is widened to accept both v2 and v3. TypeScript type casts and non-null assertions are added throughout composables (useScript, useScriptEventPage) and a Vue component to resolve type compatibility with Unhead v3. An unused NitroConfig type import and its associated module augmentation are removed. Tests are migrated from createHeadCore() to createHead({ disableDefaults: true }) and TypeScript ignore comments are removed as types are now properly aligned.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title 'fix(deps): add support for unhead v3' directly and clearly summarizes the main change: adding support for unhead v3 as a dependency fix.
Description check ✅ Passed The description is directly related to the changeset, explaining the intent to add unhead v3 support for nuxt v4.5 compatibility in ecosystem-ci.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/unhead-v3

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant