Skip to content

fix(start-plugin-core): declare image and news namespaces in sitemap.xml - #8692

Merged
Sheraff merged 1 commit into
mainfrom
fix/sitemap-xml-namespaces
Oct 12, 2026
Merged

Sheraff merged 1 commit into
mainfrom
fix/sitemap-xml-namespaces

Conversation

@Sheraff

@Sheraff Sheraff commented Oct 12, 2026 •

Copy link
Copy Markdown
Collaborator

Bug

createXml in packages/start-plugin-core/src/build-sitemap.ts declared only the default sitemap namespace and xmlns:xhtml on <urlset>, but the writer also emits image:* and news:* elements. Any sitemap with images or news came out as <image:image xmlns=""> with an undeclared prefix, so it was not namespace-well-formed XML. Strict parsers reject it. For example, xmlbuilder2's own parser fails with "The operation is not allowed by Namespaces in XML".

Fix

Declare both prefixes on <urlset>:

  • xmlns:image="http://www.google.com/schemas/sitemap-image/1.1"
  • xmlns:news="http://www.google.com/schemas/sitemap-news/0.9"

Tests

The regression tests (golden tests against Google's example sitemaps, plus value-rule tests) are in the stacked PR #8693. Its image and news golden tests fail without this fix.

Validation

  • @tanstack/start-plugin-core:test:unit: 47 files, 820 passed, 1 expected fail (the existing it.fails in tests/compiler.test.ts)
  • @tanstack/start-plugin-core:test:types: pass
  • @tanstack/start-plugin-core:test:eslint: pass

Build-time only, with no client JavaScript changes. Includes a patch changeset.

🤖 Generated with Claude Code

@changeset-bot

changeset-bot Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 81b4fb3

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@tanstack/start-plugin-core Patch
@tanstack/react-start-rsc Patch
@tanstack/react-start Patch
@tanstack/solid-start Patch
@tanstack/vue-start Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Changeset Version Preview

3 package(s) bumped directly, 6 bumped as dependents.

🟩 Patch bumps

Package Version Reason
@tanstack/router-generator 1.167.41 → 1.167.42 Changeset
@tanstack/router-plugin 1.168.43 → 1.168.44 Changeset
@tanstack/start-plugin-core 1.171.50 → 1.171.51 Changeset
@tanstack/react-start 1.168.61 → 1.168.62 Dependent
@tanstack/react-start-rsc 0.1.60 → 0.1.61 Dependent
@tanstack/router-cli 1.167.41 → 1.167.42 Dependent
@tanstack/router-vite-plugin 1.167.43 → 1.167.44 Dependent
@tanstack/solid-start 1.168.58 → 1.168.59 Dependent
@tanstack/vue-start 1.168.57 → 1.168.58 Dependent

@nx-cloud

nx-cloud Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

View your CI Pipeline Execution ↗ for commit 81b4fb3

Command Status Duration Result
nx affected --targets=test:eslint,test:unit,tes... ✅ Succeeded 16m 8s View ↗

☁️ Nx Cloud last updated this comment at 2026-10-12 20:08:44 UTC

@coderabbitai

coderabbitai Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: TanStack/router/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 8feb377d-632c-445d-8a10-fbed09d9645f

📥 Commits

Reviewing files that changed from the base of the PR and between 19524cc and a080023.


📒 Files selected for processing (10)
  • .changeset/sitemap-xml-namespaces.md
  • packages/start-plugin-core/src/build-sitemap.ts
  • packages/start-plugin-core/tests/fixtures/google-sitemap-examples/LICENSE.md
  • packages/start-plugin-core/tests/fixtures/google-sitemap-examples/README.md
  • packages/start-plugin-core/tests/fixtures/google-sitemap-examples/hreflang-sitemap.xml
  • packages/start-plugin-core/tests/fixtures/google-sitemap-examples/image-sitemap.xml
  • packages/start-plugin-core/tests/fixtures/google-sitemap-examples/news-sitemap.xml
  • packages/start-plugin-core/tests/fixtures/google-sitemap-examples/sitemap.xml
  • packages/start-plugin-core/tests/sitemap-page-rules.test.ts
  • packages/start-plugin-core/tests/sitemap-spec.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.



📝 Walkthrough
📝 Walkthrough
📝 Walkthrough

Walkthrough

Generated sitemap XML now declares the Google Image and News namespaces. New tests cover sitemap page-rule parsing and compare generated sitemaps with pinned Google examples.

Changes

Sitemap output and validation

Layer / File(s) Summary
Sitemap page-rule validation tests
packages/start-plugin-core/tests/sitemap-page-rules.test.ts
Tests cover accepted and rejected priority and change-frequency values, required news and image fields, and required alternate-link fields.
Generated sitemap namespaces
packages/start-plugin-core/src/build-sitemap.ts, .changeset/sitemap-xml-namespaces.md
createXml adds the Google Image and News namespace declarations to the XML root. The changeset records a patch release for @tanstack/start-plugin-core.
Google sitemap fixture comparisons
packages/start-plugin-core/tests/fixtures/google-sitemap-examples/*, packages/start-plugin-core/tests/sitemap-spec.test.ts
Committed fixtures cover standard, image, news, and hreflang sitemaps. Tests verify fixture hashes and compare normalized XML with generated output. Fixture documentation describes provenance and comparison exceptions.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix


Merge Risk: ⚪ Minimal · up to a0800

The sitemap namespace fix is mergeable after normal checks.

Pre-merge checks · Passed 4 · Failed 1

Failed Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 3 files. (7 skipped: 7… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks (4 passed)
Check name Status Explanation
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 clearly and concisely describes the primary fix: declaring the image and news XML namespaces in sitemap.xml.
Description check Passed The description clearly covers the bug, fix, regression tests, validation results, release impact, changeset, and AI assistance. It does not reproduce the template headings or checklist, but it provid…

Full details: Docstring Coverage

Explanation

Docstring coverage is 16.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 3 files. (7 skipped: 7 unsupported.)


  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR

🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@github-actions

Copy link
Copy Markdown
Contributor

Bundle Size Benchmarks

This pull request does not affect bundle size in any measured scenario.

@pkg-pr-new

pkg-pr-new Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
More templates

@tanstack/arktype-adapter

npm i https://pkg.pr.new/@tanstack/arktype-adapter@8692

@tanstack/eslint-plugin-router

npm i https://pkg.pr.new/@tanstack/eslint-plugin-router@8692

@tanstack/eslint-plugin-start

npm i https://pkg.pr.new/@tanstack/eslint-plugin-start@8692

@tanstack/history

npm i https://pkg.pr.new/@tanstack/history@8692

@tanstack/nitro-v2-vite-plugin

npm i https://pkg.pr.new/@tanstack/nitro-v2-vite-plugin@8692

@tanstack/react-router

npm i https://pkg.pr.new/@tanstack/react-router@8692

@tanstack/react-router-devtools

npm i https://pkg.pr.new/@tanstack/react-router-devtools@8692

@tanstack/react-router-ssr-query

npm i https://pkg.pr.new/@tanstack/react-router-ssr-query@8692

@tanstack/react-start

npm i https://pkg.pr.new/@tanstack/react-start@8692

@tanstack/react-start-client

npm i https://pkg.pr.new/@tanstack/react-start-client@8692

@tanstack/react-start-rsc

npm i https://pkg.pr.new/@tanstack/react-start-rsc@8692

@tanstack/react-start-server

npm i https://pkg.pr.new/@tanstack/react-start-server@8692

@tanstack/router-cli

npm i https://pkg.pr.new/@tanstack/router-cli@8692

@tanstack/router-core

npm i https://pkg.pr.new/@tanstack/router-core@8692

@tanstack/router-devtools

npm i https://pkg.pr.new/@tanstack/router-devtools@8692

@tanstack/router-devtools-core

npm i https://pkg.pr.new/@tanstack/router-devtools-core@8692

@tanstack/router-generator

npm i https://pkg.pr.new/@tanstack/router-generator@8692

@tanstack/router-plugin

npm i https://pkg.pr.new/@tanstack/router-plugin@8692

@tanstack/router-ssr-query-core

npm i https://pkg.pr.new/@tanstack/router-ssr-query-core@8692

@tanstack/router-utils

npm i https://pkg.pr.new/@tanstack/router-utils@8692

@tanstack/router-vite-plugin

npm i https://pkg.pr.new/@tanstack/router-vite-plugin@8692

@tanstack/solid-router

npm i https://pkg.pr.new/@tanstack/solid-router@8692

@tanstack/solid-router-devtools

npm i https://pkg.pr.new/@tanstack/solid-router-devtools@8692

@tanstack/solid-router-ssr-query

npm i https://pkg.pr.new/@tanstack/solid-router-ssr-query@8692

@tanstack/solid-start

npm i https://pkg.pr.new/@tanstack/solid-start@8692

@tanstack/solid-start-client

npm i https://pkg.pr.new/@tanstack/solid-start-client@8692

@tanstack/solid-start-server

npm i https://pkg.pr.new/@tanstack/solid-start-server@8692

@tanstack/start-client-core

npm i https://pkg.pr.new/@tanstack/start-client-core@8692

@tanstack/start-fn-stubs

npm i https://pkg.pr.new/@tanstack/start-fn-stubs@8692

@tanstack/start-plugin-core

npm i https://pkg.pr.new/@tanstack/start-plugin-core@8692

@tanstack/start-server-core

npm i https://pkg.pr.new/@tanstack/start-server-core@8692

@tanstack/start-static-server-functions

npm i https://pkg.pr.new/@tanstack/start-static-server-functions@8692

@tanstack/start-storage-context

npm i https://pkg.pr.new/@tanstack/start-storage-context@8692

@tanstack/valibot-adapter

npm i https://pkg.pr.new/@tanstack/valibot-adapter@8692

@tanstack/virtual-file-routes

npm i https://pkg.pr.new/@tanstack/virtual-file-routes@8692

@tanstack/vue-router

npm i https://pkg.pr.new/@tanstack/vue-router@8692

@tanstack/vue-router-devtools

npm i https://pkg.pr.new/@tanstack/vue-router-devtools@8692

@tanstack/vue-router-ssr-query

npm i https://pkg.pr.new/@tanstack/vue-router-ssr-query@8692

@tanstack/vue-start

npm i https://pkg.pr.new/@tanstack/vue-start@8692

@tanstack/vue-start-client

npm i https://pkg.pr.new/@tanstack/vue-start-client@8692

@tanstack/vue-start-server

npm i https://pkg.pr.new/@tanstack/vue-start-server@8692

@tanstack/zod-adapter

npm i https://pkg.pr.new/@tanstack/zod-adapter@8692

commit: 81b4fb3

@codspeed

codspeed Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

ℹ️ 3 benchmarks have no flame graph

The flamegraph could not be generated because too much time was spent in runtime internals, making the visualization not useful for performance analysis.

✅ 194 untouched benchmarks
⏩ 3 skipped benchmarks1


Comparing fix/sitemap-xml-namespaces (81b4fb3) with main (19524cc)

Open in CodSpeed

Footnotes

  1. 3 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

The sitemap writer emitted image:* and news:* elements, but <urlset> only
declared the default sitemap namespace and xmlns:xhtml. xmlbuilder2
serialized those elements with xmlns="" and an undeclared prefix, so
sitemaps with images or news were not namespace-well-formed XML. Declare
xmlns:image and xmlns:news on <urlset>.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Sheraff
Sheraff force-pushed the fix/sitemap-xml-namespaces branch from a080023 to 81b4fb3 Compare October 12, 2026 19:30
@Sheraff
Sheraff merged commit f3d7ee3 into main Oct 12, 2026
32 of 33 checks passed
@Sheraff
Sheraff deleted the fix/sitemap-xml-namespaces branch October 12, 2026 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant