Conversation
|
📝 WalkthroughWalkthroughThis change adds the XHTML namespace declaration ( Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
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. Comment Tip CodeRabbit can approve the review once all CodeRabbit's comments are resolved.Enable the |
Bundle Size Benchmarks
Trend sparkline is historical gzip bytes ending with this PR measurement; lower is better. |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/start-plugin-core/src/build-sitemap.ts (1)
202-209:⚠️ Potential issue | 🟠 MajorThe
xhtmlnamespace fix is correct, butimage:andnews:namespaces are also missing.The added
xmlns:xhtmldeclaration properly resolves the reported validation error forxhtml:linkelements. However, the code also usesimage:image(line 98) andnews:news(line 111) prefixes without declaring their namespaces, which will cause identical validation errors when those features are used.🔧 Proposed fix to add all required namespace declarations
function createXml(elementName: 'urlset' | 'sitemapindex'): XMLBuilder { return create({ version: '1.0', encoding: 'UTF-8' }) .ele(elementName, { xmlns: 'https://www.sitemaps.org/schemas/sitemap/0.9', 'xmlns:xhtml': 'http://www.w3.org/1999/xhtml', + 'xmlns:image': 'http://www.google.com/schemas/sitemap-image/1.1', + 'xmlns:news': 'http://www.google.com/schemas/sitemap-news/0.9', }) .com(`This file was automatically generated by TanStack Start.`) }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/start-plugin-core/src/build-sitemap.ts` around lines 202 - 209, The createXml function currently adds only xmlns and xmlns:xhtml but omits the image and news namespaces used elsewhere; update the element attributes in createXml (the ele call that takes elementName) to also include xmlns:image with "http://www.google.com/schemas/sitemap-image/1.1" and xmlns:news with "http://www.google.com/schemas/sitemap-news/0.9" so that image:image and news:news prefixed elements validate correctly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@packages/start-plugin-core/src/build-sitemap.ts`:
- Around line 202-209: The createXml function currently adds only xmlns and
xmlns:xhtml but omits the image and news namespaces used elsewhere; update the
element attributes in createXml (the ele call that takes elementName) to also
include xmlns:image with "http://www.google.com/schemas/sitemap-image/1.1" and
xmlns:news with "http://www.google.com/schemas/sitemap-news/0.9" so that
image:image and news:news prefixed elements validate correctly.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: f18b2fc0-f3a1-4e2f-af34-b1a44a4eb5ce
📒 Files selected for processing (1)
packages/start-plugin-core/src/build-sitemap.ts
Currently the generated sitemap will show an error if you try to validate it:
By adding
to the root of the sitemap it won't show any validation errors anymore
Summary by CodeRabbit