Skip to content

study(deps): VitePress 2.0.0-alpha.17 for the docs site (addresses the nine open docs advisories) - #497

Draft
Alajmah wants to merge 1 commit into
masterfrom
study/vitepress-alpha17
Draft

Alajmah wants to merge 1 commit into
masterfrom
study/vitepress-alpha17

Conversation

@Alajmah

@Alajmah Alajmah commented Nov 22, 2026

Copy link
Copy Markdown
Contributor

Status

Experimental, and a draft. Merge and deployment need an independent review. Dependabot alert #105 stays open until a change like this is merged.

The advisories this addresses

Nine alerts are open on docs/package-lock.json. With the lockfile in this PR, npm audit reports 0 findings. Dependabot re-evaluates its alerts after a merge.

Alert Severity Package Range First patched
#105 high vite <= 6.4.3 6.4.4
#106 medium vite <= 6.4.3 6.4.4
#107 low vite <= 6.4.3 6.4.4
#100 medium vite <= 6.4.3 6.4.4
#95 medium vite <= 6.4.3 6.4.4
#74 medium vite <= 6.4.1 6.4.2
#4 medium vite <= 6.4.2 6.4.3
#2 medium vite <= 6.4.2 6.4.3
#73 medium esbuild <= 0.24.2 0.25.0

They sit in the Vite development server, in its launch-editor helper, and in esbuild's development server. Vite and esbuild run at build time. The published docs image is nginx:alpine with the built static files, so this code is not in it.

npm audit of the lockfile on master reports 3 of them (vite, esbuild, vitepress) and offers no fix. There is no lockfile-only fix: a patched vite needs a VitePress release that allows one.

No stable VitePress release allows a patched vite

From the npm registry, 2026-11-22:

VitePress release Published Depends on vite Allows a patched vite
1.6.4 (latest) — ^5.4.14 no
2.0.0-alpha.1 2025-01-22 ^6.0.11 yes
2.0.0-alpha.6 2025-06-12 ^6.3.5 yes
2.0.0-alpha.7 2025-06-24 ^7.0.0 yes
2.0.0-alpha.17 2026-03-19 ^7.3.1 yes
2.0.0-alpha.18 2026-07-06 ^8.1.3 yes, and needs Node 22
2.0.0-alpha.21 (next) 2026-10-25 ^8.3.4 yes, and needs Node 22

Every stable release from 1.4.0 to 1.6.4 depends on vite 5.x. The 2.0 line has been in alpha since January 2025.

From alpha.18 on, VitePress drops Node 20. Node 20 reached end of life on 2026-04-30 in the Node.js release schedule; Node 22 runs to 2027-04-30 and Node 24 to 2028-04-30. This repository builds its images on node:20-alpine and runs CI on Node 20.

Two candidates, both measured

2.0.0-alpha.17 (this PR) 2.0.0-alpha.6 (branch study/vitepress-alpha6, commit 35ca102)
vite in the lockfile 7.3.8 6.4.6
Lockfile entries 174 → 155 174 → 177
Versions changed 86, of which 23 across a major 74, of which 15 across a major
Entries added / removed 10 / 29 7 / 4
Pages built 150 150
Files built 472 472
Visible text against master differs on 149 of 150 pages, by the search button shortcut only (K becomes ⌘ Ctrl K) identical on all 150 pages
npm audit 0 0
Packages whose engines exclude Node 20.19 0 0
Build on Linux, Node 20.20.2 passed passed

Linux builds, both manual CI runs on the candidate branches: 45065940624 (alpha.17) and 45065957207 (alpha.6).

Why alpha.17 is the candidate here

It is the newest pre-release that still runs on the Node this repository uses. Its vite is one major behind the current line; the vite of alpha.6 is two behind. alpha.6 changes less: its output is identical to today's. The choice between them is a decision, not a finding.

Compatibility changes in the 2.0 line, and their effect on this site

The site uses the default theme, no Vite plugin, no custom component, and local search with default options.

Change In Effect here
vite 5 → 6 alpha.1 none in the build
markdown-it-async; shiki 3 alpha.3 matters only for a custom search renderer. None is used
useLocalNav and useSidebar removed; vp-code and vp-adaptive-theme classes no longer added to code blocks alpha.5 not used; no custom style refers to them
vite 6 → 7; globOptions of createContentLoader narrowed alpha.7 createContentLoader is not used
search moves to DocSearch v4 alpha.9 the search button markup changes. Search was tried in a browser: it opens, lists results and navigates to a result
CJK-friendly emphasis on by default; postcssIsolateStyles default alpha.12 no custom styles; on 150 pages the visible text differs only at the search button
markdown-it-attrs off inside fenced code blocks; cjkFriendly renamed; lastUpdated defaults to 0 alpha.13 none of the three is used
@include of a missing file is now an error alpha.17 the build passes, so no include in the docs source points at a missing file

What this PR changes

docs/package.json (vitepress to the exact version 2.0.0-alpha.17) and docs/package-lock.json, resolved by npm. Nothing else.

Risks

  • It is a pre-release. The line has published 21 alphas and no stable release.
  • The docs image does not install from the lockfile. docs/Dockerfile runs npm install from docs/package.json, so an image built after this PR would take VitePress 2.0.0-alpha.17 with whatever transitive versions resolve that day. Making that image install from the lockfile is a separate unit.
  • The published docs image is unchanged. It is still the image from 2026-06-21, and its rebuild is on hold.
  • Node 20 is past end of life. Vite 7 needs Node 20.19 or later, which CI and the base image satisfy today. Newer VitePress needs Node 22.

Not verified

  • The docs image was not rebuilt.
  • In a browser I checked the home page and the search of the alpha.17 build. I did not compare the theme switch, the sidebar on a small screen, or the Mermaid diagram against the current build.
  • The local search index was not compared between builds, only the page HTML.

Experimental branch for the VitePress upgrade study (Dependabot alert
#105: vite <= 6.4.3, first patched 6.4.4). Not for merge without review.

No stable VitePress release depends on a patched vite: every 1.x
release depends on vite 5.x. 2.0.0-alpha.17 is the newest pre-release
that still supports Node 20; alpha.18 and later require Node 22.

docs/package.json: vitepress ^1.6.4 -> 2.0.0-alpha.17.
docs/package-lock.json: resolved by npm. vite 5.4.21 -> 7.3.8.

Local build on Windows with Node 22: 150 pages and 472 files, as on
master. The visible text of 149 of the 150 pages differs only in the
search button shortcut. Search works in a browser. npm audit of the
lockfile reports 0 findings; on master it reports 3.

Signed-off-by: Alajmah <55954113+Alajmah@users.noreply.github.com>

@gitwire-hq gitwire-hq Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🤖 AI Code Review — ✅ Approved

Confidence: high · Findings: 2
AI judgment: APPROVE · Evidence: COMPLETE · Authority: advisory
Evidence complete · 2/2 changed files accounted for

Other findings (2)

  • [low] New toolchain raises Node requirement to ^20.19.0 || >=22.12.0 — verify docs build environments
  • [low] Prerelease semver range may float to newer alphas or stable 2.x with different Node requirements ⚠️ unverified

🔮 Devil's Advocate (2 turns): 1 downgraded · 1 missed risk found


GitWire AI Review Gate (bundle-driven v2) · Structured schema · Scope-validated · Devil's Advocate · AI recommendation — maintainers and repository policy retain authority

Finding details (not annotatable inline)

  • [LOW] Prerelease semver range may float to newer alphas or stable 2.x with different Node requirements

    If docs/package.json declares vitepress as '^2.0.0-alpha.17' (likely, given the cited line 16), npm's semver semantics for prerelease caret ranges mean the range matches other 2.0.0 prereleases >= alpha.17 AND any stable 2.x/2.y. The initial review flagged the Node constraint as an environment concern but missed that the manifest itself can drift: a lockfile-less install, npm update, or fresh environment resolution could pull a newer alpha (with unknown breaking changes or its own Node floor, e.g., alpha.18+) or even the stable 2.0.0 release, silently reintroducing exactly the incompatibility class the review worried about. Mitigation is cheap: pin the exact alpha version and pair any added 'engines' field with engine-strict=true in .npmrc so it actually enforces.

Comment thread docs/package.json
"type": "module",
"devDependencies": {
"vitepress": "^1.6.4",
"vitepress": "2.0.0-alpha.17",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[LOW] New toolchain raises Node requirement to ^20.19.0 || >=22.12.0 — verify docs build environments

The lockfile now pins vite 7.3.8 and @vitejs/plugin-vue 6.0.11, both of which declare engines "^20.19.0 || >=22.12.0" (previously vite 5.4.21 accepted "^18.0.0 || >=20.0.0"). Vite 7 relies on Node >= 20.19 runtime features, so any CI job, Docker stage, or local environment used to build/preview the docs on Node 18 or Node 20.0–20.18 will either emit EBADENGINE warnings or fail at runtime. The PR description shows Node 20 support was a deliberate reason to choose alpha.17 over alpha.18+, but nothing in this diff updates the docs build image/CI config to guarantee >= 20.19. Suggested fix: confirm (or explicitly pin/document) the Node version in the docs Dockerfile and CI workflows is >= 20.19 (e.g. node:22-alpine), and add the constraint to docs/package.json "engines" so npm fails fast with a clear message instead of a confusing runtime crash.

@Alajmah

Alajmah commented Nov 22, 2026

Copy link
Copy Markdown
Contributor Author

Both findings of the automated review were checked against this branch.

Node requirement. vite 7.3.8 declares ^20.19.0 || >=22.12.0. The CI job docs-build ran on Node v20.20.2 (run 45065940624). node:20-alpine, the base image of docs/Dockerfile, resolves today to the digest sha256:fb4cd12c…, which is also the digest of the tag 20.20.2-alpine. Both satisfy the requirement. Node 20 passed its end-of-life date (2026-04-30 in the Node.js release schedule). A move to Node 22 is the separate decision listed under "Risks" in the description.

Floating range. docs/package.json on this branch declares the exact version 2.0.0-alpha.17. It is not a caret range, so an install cannot move to another alpha or to a stable 2.x without a change to the manifest.

An engines field on docs/package.json would make the Node requirement fail fast. It is not part of this PR.

@Alajmah

Alajmah commented Nov 22, 2026

Copy link
Copy Markdown
Contributor Author

Decision recorded (maintainer, 2026-11-22)

This pull request stays a draft and is not merged into production. 2.0.0-alpha.17 is the reference candidate for the rest of the study.

Three things keep the merge on hold: the release is still an alpha, Node 20 is past end of life, and the interface tests have not covered the theme switch, the sidebar on small screens and the Mermaid diagrams. The published docs image does not install from its lockfile either.

Dependabot alert #105 stays open. A clean npm audit on this branch is not evidence that the advisories are addressed in production.

An approval later needs four things first:

  1. The build verified on a supported Node release.
  2. The docs interface tested for function and appearance: theme switch, sidebar on small screens, Mermaid diagrams.
  3. docs/Dockerfile made to install from the lockfile.
  4. A rollback plan, before any pre-release is merged.

Vite is not forced onto the old VitePress with overrides.

@Alajmah

Alajmah commented Nov 22, 2026

Copy link
Copy Markdown
Contributor Author

Interface comparison of the alpha.17 build with the current one (2026-11-22)

This is progress on the second of the four conditions: the docs interface tested for function and appearance.

How

Both builds were made locally from the same sources, the current lockfile and the alpha.17 lockfile. A static server served each one, and a headless Chromium drove both at 1280×800 and at 390×844, in light and in dark. I compared three things: the computed style and position of 26 page elements, the behaviour of the theme switch and of the small-screen menu, and lossless screenshots pixel by pixel. Two loads of the same build give the same picture to the pixel, 0 pixels apart, so a difference between the builds is a real one.

What is identical

Check Result
Layout Position and computed style are the same for the nav bar, the site title, the menu links, the sidebar links, the heading levels 1 and 2, paragraphs, list items, links, bold text, inline code, code blocks, the copy button, the "On this page" column and the footer. The last paragraph of the page lies at the same y in both
Typography The same font family is loaded, the variable font Inter at weights 100 to 900. Same sizes, weights, line heights and colours on every element checked
Structure Same counts on the page checked: 15 links, 4 lists, 12 list items, 11 paragraphs, 351 code tokens, 8 headings of level 2
Theme switch, 1280 wide Same behaviour. Light, one click: dark, with the body at rgb(27, 27, 31) and the choice stored. A reload keeps dark. One more click: light again, and the stored choice returns to auto
Small screen, 390×844 Same behaviour. No horizontal overflow. The sidebar is off screen. The menu button opens a panel 390×780 under the bar, with 6 links and the appearance switch at the same place in both. A second click closes it
Console No error and no page error in either build

What differs

Where Current build alpha.17 build
Search button in the nav bar text "Search K". 150.66 × 40 px. 13.33 px, weight 500 text "Search ⌘ Ctrl K". 144.14 × 38 px. 14 px, weight 400
Code tokens that have no colour of their own rgb(103, 103, 108). 110 of the 351 tokens on the page rgb(36, 41, 46), so darker. The other 241 tokens keep their colours
Language label of a code block, such as yaml rgb(146, 146, 149) rgb(103, 103, 108), so darker
The font files 14 Inter files 14 Inter files with other hashes and sizes. Some letters render with small differences

The share of pixels that differ:

Screenshot Pixels that differ
Content page, 1280×800, light 7,094 of 1,024,000 (0.69 %)
Home page, 1280×800, dark 3,377 (0.33 %)
Content page, 390×844, menu closed 1,167 of 329,160 (0.35 %)
Content page, 390×844, menu open 187 (0.06 %)

Mermaid

Neither build renders Mermaid. 29 pages hold a Mermaid block, and all 29 show it as source text in a code block. No Mermaid script is shipped. So this is not a difference between the builds. It is a gap in the published site today, and it needs its own decision: a Mermaid plugin for the docs, or the source display as it is.

Not covered

  • Chromium on Windows only. Not Firefox, not WebKit, not a phone.
  • One content page and the home page.
  • The production image, which is nginx with the built files.
  • The search was tried on 2026-11-22, before this pass. It was not repeated here.

Where the four conditions stand

Condition State
Build on a supported Node Not shown for alpha.17. The Node 24 run in #500 built the docs with VitePress 1.6.4, the current version
Interface tested for function and appearance Done for the theme switch and the small screen, with the differences above. Mermaid is a gap in both builds
docs/Dockerfile installs from the lockfile Not done
A rollback plan Not written

This branch has not been deployed

No deployments
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