Repository navigation
chore(sitemap): upgrade sitemap to v9 (AI-assisted) - #12564
Merged
Merged
Conversation
This was referenced Oct 2, 2026
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
✅ [V2]
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Size Change: 0 B Total Size: 12.4 MB ℹ️ View Unchanged
|
⚡️ Lighthouse report for the deploy preview of this PR
|
|
The latest updates on your projects. Learn more about Argos notifications ↗︎
|
|
Size Change: 0 B Total Size: 12.6 MB ℹ️ View Unchanged
|
slorber
force-pushed
the
slorber/sitemap-v9
branch
from
October 2, 2026 09:52
a6fd8de to
6e80d4c
Compare
slorber
force-pushed
the
slorber/sitemap-v9
branch
from
October 2, 2026 10:00
6e80d4c to
6df57ae
Compare
Upgrade sitemap from ^7.1.3 to ^9.0.1, with no sitemap output change. v9 is a dual ESM/CJS package, so our CJS package keeps requiring it. We keep the lib instead of generating the XML ourselves: users can return undocumented fields from createSitemapItems() (links, img, video, news...) that the lib serializes, and a custom serializer would silently drop them. Co-Authored-By: Claude Opus 5.5 <[email protected]>
slorber
force-pushed
the
slorber/sitemap-v9
branch
from
October 2, 2026 10:15
6df57ae to
be22592
Compare
1 of 3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pre-flight checklist
Motivation
Stacked PR 3/3 to modernize
@docusaurus/plugin-sitemapXML generation, with zero sitemap output change.This upgrades
sitemapfrom^7.1.3to^9.0.1. No plugin code change, apart from comments inxml.ts.Options evaluated
a) Upgrade
sitemap7 → 9 (this PR)Changelog review (CHANGELOG.md):
SitemapAndIndexStream(unused).hostname/xslUrloptions, and the..checks only apply to file paths. None of them apply to items written toSitemapStream. Text now also escapes>(URLs are already percent-encoded bynew URL(), so<loc>can't contain one). Invalidlastmodvalues throw a clearer error.requireexport condition points todist/cjs, so our CJS package requires it as before (norequire(esm)needed), and TSNodeNextpicks the CJS types.SitemapStream/streamToPromiseAPI, namespace defaults (news,xhtml,image,video),normalizeURL()(new URL(url).toString()),lastmodDateOnlyand the<url>tag order are unchanged.xslUrlescaping, parser limits), unrelated to our usage.arg,sax,@types/sax,@types/node). Its@types/noderuntime dependency goes from 17 to 24, which matches our Node >=24.21 requirement better.b) Generate the XML ourselves (resolve the
TODO)I prototyped it (about 40 lines: header,
new URL(),&/<escaping,toISOString(),toFixed(1)). It's byte-identical for every documentedSitemapIteminput: 69/70 of the pinned tests pass.It fails the last one:
createSitemapItems()can return items with undocumented fields that sitemap.js serializes today (linksfor hreflang alternates,img,video,news,expires,androidLink,ampLink,fullPrecisionPriority). A custom serializer would silently drop them. Since hreflanglinksis a plausible use case for i18n sites, I chose not to take that risk in a "zero change" PR.Important
Decision for the maintainer: I went with a). If we prefer b) (one less dependency tree:
sitemap,sax,arg,@types/sax,@types/node), we first need to decide how to handle these undocumented fields: officially support some of them (e.g.links), or warn/throw on unknown fields, which is better done in a major version.Test Plan
pnpm test,pnpm lint,pnpm dedupe --checkpnpm build:website:fast:website/build/sitemap.xmlis byte-identical before/after (cmp)pnpm argos:build:text-snapshots && pnpm argos:format:text-snapshots: the raw and formatted Argossitemap.xmlare byte-identical before/afterTest links
Deploy preview: https://deploy-preview-12564--docusaurus-2.netlify.app/
Related issues/PRs
sitemapbump, opened before the switch to pnpm, without output verification)🤖 Generated with Claude Code