Skip to content

fix: align preload link type with unhead v3#2254

Merged
danielroe merged 1 commit into
mainfrom
fix-unhead3
May 25, 2026
Merged

fix: align preload link type with unhead v3#2254
danielroe merged 1 commit into
mainfrom
fix-unhead3

Conversation

@danielroe
Copy link
Copy Markdown
Member

🔗 Linked issue

📚 Description

addresses a failure in nuxt/ecosystem-ci

@danielroe danielroe changed the title fix(types): align preload link with unhead v3 fix: align preload link with unhead v3 May 25, 2026
@danielroe danielroe changed the title fix: align preload link with unhead v3 fix: align preload link type with unhead v3 May 25, 2026
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 25, 2026

Open in StackBlitz

npm i https://pkg.pr.new/@nuxt/image@2254

commit: 9c9b2f0

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 25, 2026

Review Change Stack

📝 Walkthrough

Walkthrough

This PR refactors the server-side preload <link> generation logic in NuxtPicture.vue. The guard condition now specifically checks whether the first computed source has a srcset property before generating a preload entry, rather than only validating source existence. The imagesizes property is now applied directly to the link object via conditional spreads during construction, eliminating the separate post-creation assignment previously based on sources.value[0].sizes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description check ✅ Passed The description mentions 'addresses a failure in nuxt/ecosystem-ci' which relates to the changeset, though it lacks specific details about the technical changes being made.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
Title check ✅ Passed The title 'fix: align preload link type with unhead v3' clearly summarizes the main change: updating preload link generation to align with unhead v3, which matches the technical details in the changeset about modifying server-side preload link generation in NuxtPicture.vue.

✏️ 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-unhead3

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.

@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying nuxt-image with  Cloudflare Pages  Cloudflare Pages

Latest commit: 9c9b2f0
Status: ✅  Deploy successful!
Preview URL: https://947beb64.nuxt-image.pages.dev
Branch Preview URL: https://fix-unhead3.nuxt-image.pages.dev

View logs

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 32.61%. Comparing base (984ad50) to head (9c9b2f0).

Files with missing lines Patch % Lines
src/runtime/components/NuxtPicture.vue 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2254      +/-   ##
==========================================
+ Coverage   32.52%   32.61%   +0.08%     
==========================================
  Files           7        7              
  Lines         372      371       -1     
  Branches      131      131              
==========================================
  Hits          121      121              
  Misses        194      194              
+ Partials       57       56       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@danielroe danielroe merged commit 405d60a into main May 25, 2026
13 checks passed
@danielroe danielroe deleted the fix-unhead3 branch May 25, 2026 12:10
@github-actions github-actions Bot mentioned this pull request May 25, 2026
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.

2 participants