Skip to content

feat(test)!: upgrade to Vitest v5 with migration support - #2551

Draft
fengmk2 wants to merge 36 commits into
mainfrom
rfc/vitest-v5-upgrade
Draft

fengmk2 wants to merge 36 commits into
mainfrom
rfc/vitest-v5-upgrade

Conversation

@fengmk2

@fengmk2 fengmk2 commented Aug 24, 2026

Copy link
Copy Markdown
Member

BREAKING CHANGE: Upgrade vp test and vite-plus/test* from Vitest 4.1.11 to 5.0.1, with v5 API changes and defaults. Require Node.js ^22.18.0 || ^24.11.0 || >=26.0.0; remove CLI support for Node.js 20 and 25.

Remove the vite-plus/test/runners, vite-plus/test/suite, and runner/expect plugin exports. Update retained compatibility aliases, package resolution, and project plugin inheritance for Vitest v5. Align official Vitest packages with the bundled runner. Keep the community @vitest/browser-webdriverio version independent.

Add version-aware Vitest v4 migration to vp migrate. Use the existing native oxc parser for source analysis. Convert supported configuration, source APIs, benchmarks, and command options. Preserve explicit settings, inherited settings, and test timeouts. Limit global API edits to the applicable Vitest projects and setup files.

Upgrade incompatible Node.js runtime pins before dependency installation. Limit Node.js checks to .node-version, .nvmrc, and package.json. Preserve supported pins and public engines.node ranges. Add documentation links to Vitest v5 diagnostics.

Preserve the Vitest version during pnpm tool sync-remote and align vendored Vite dependencies. Update ecosystem CI revisions and compatibility settings.

Add migration guidance in docs/guide/vitest-v5.md and the upgrade design in rfcs/vitest-v5-upgrade.md.

@netlify

netlify Bot commented Aug 24, 2026

Copy link
Copy Markdown

Deploy Preview for viteplus-preview ready!

Name Link
🔨 Latest commit 88d0647
🔍 Latest deploy log https://app.netlify.com/projects/viteplus-preview/deploys/6a9ed69fc7071d000884db81
😎 Deploy Preview https://deploy-preview-2551--viteplus-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@fengmk2 fengmk2 self-assigned this Aug 30, 2026
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 3, 2026

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview URL: https://rfc-vitest-v5-upgrade-viteplus-dev.voidzero-docs.workers.dev (commit 134033e)

This URL reflects your latest Preview deployment

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://3457100d-viteplus-dev.voidzero-docs.workers.dev 134033e 2026-09-16T02:24:55.796Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://ed25d6b7-viteplus-dev.voidzero-docs.workers.dev 6a258a3 2026-09-16T01:24:47.119Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://4ec4e7af-viteplus-dev.voidzero-docs.workers.dev 708cd5c 2026-09-15T17:01:39.288Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://9e77dc98-viteplus-dev.voidzero-docs.workers.dev ad79f10 2026-09-15T15:37:58.351Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://376d7df4-viteplus-dev.voidzero-docs.workers.dev 26a6dfe 2026-09-15T14:17:22.653Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://f8f08cc4-viteplus-dev.voidzero-docs.workers.dev 3240c57 2026-09-15T13:57:23.262Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://a002944c-viteplus-dev.voidzero-docs.workers.dev a75c01b 2026-09-15T13:05:06.800Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://f6be60e6-viteplus-dev.voidzero-docs.workers.dev c6d669e 2026-09-15T12:13:57.562Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://9f821b84-viteplus-dev.voidzero-docs.workers.dev ffc328d 2026-09-15T11:01:18.924Z Visit the dashboard ↗
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://fd2aa39b-viteplus-dev.voidzero-docs.workers.dev 94289c1 2026-09-15T10:12:50.079Z Visit the dashboard ↗

View all previews: View all previews ↗

@fengmk2
fengmk2 force-pushed the rfc/vitest-v5-upgrade branch 2 times, most recently from 8186f1e to 2d55279 Compare September 4, 2026 16:41
@fengmk2 fengmk2 changed the title docs(rfc): plan Vitest v5 upgrade feat(test): upgrade to Vitest v5 with migration support Sep 6, 2026
@fengmk2
fengmk2 force-pushed the rfc/vitest-v5-upgrade branch from 5787285 to 0cc40f3 Compare September 6, 2026 15:46
@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

✅ Staging deployment successful!

Preview: https://viteplus-staging.void.app/
Commit: 134033e

@socket-security

socket-security Bot commented Sep 6, 2026

Copy link
Copy Markdown

Warning

Review the following alerts detected in dependencies.

According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.

Action Severity Alert  (click "▶" to expand/collapse)
Warn High
Obfuscated code: npm data-urls is 90.0% likely obfuscated

Confidence: 0.90

Location: Package overview

From: crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/test_v5_optional_packages/package.jsonnpm/jsdom@27.2.0npm/data-urls@6.0.1

ℹ Read more on: This package | This alert | What is obfuscated code?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support@socket.dev.

Suggestion: Packages should not obfuscate their code. Consider not using packages with obfuscated code.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/data-urls@6.0.1. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

View full report

@fengmk2
fengmk2 force-pushed the rfc/vitest-v5-upgrade branch 3 times, most recently from 5a72e21 to ac38d99 Compare September 11, 2026 04:08
@fengmk2 fengmk2 added test: e2e Auto run e2e tests test: install-e2e run vite install e2e test test: create-e2e Run `vp create` e2e tests test: sfw labels Sep 11, 2026
@github-actions

github-actions Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

CLI artifact sizes (6a258a3)

Final release artifacts built by the canonical build-upstream and build-windows-cli actions.
The dist rows use the Linux build. The core total excludes .node files to match the release artifact.

Artifact Format Base PR Change
packages/cli/dist Directory total 2.15 MiB 2.28 MiB +139.54 KiB (+6.35%)
packages/core/dist Directory total 3.94 MiB 3.94 MiB +224 B (+0.01%)
Combined package dist Directory total 6.09 MiB 6.22 MiB +139.75 KiB (+2.24%)
vp (Linux x64) Binary 11.18 MiB 11.19 MiB +4.00 KiB (+0.03%)
vp (Linux x64) gzip -9 4.84 MiB 4.84 MiB +1.49 KiB (+0.03%)
NAPI (Linux x64) Binary 32.12 MiB 32.16 MiB +44.13 KiB (+0.13%)
NAPI (Linux x64) gzip -9 12.70 MiB 12.73 MiB +23.07 KiB (+0.18%)
vp (macOS ARM64) Binary 8.33 MiB 8.33 MiB 0 B (0.00%)
vp (macOS ARM64) gzip -9 4.21 MiB 4.22 MiB +1.05 KiB (+0.02%)
NAPI (macOS ARM64) Binary 39.68 MiB 39.71 MiB +32.31 KiB (+0.08%)
NAPI (macOS ARM64) gzip -9 17.00 MiB 17.02 MiB +21.57 KiB (+0.12%)
vp (Windows x64) Binary 9.06 MiB 9.07 MiB +7.00 KiB (+0.08%)
vp (Windows x64) gzip -9 3.95 MiB 3.96 MiB +7.01 KiB (+0.17%)
NAPI (Windows x64) Binary 27.02 MiB 27.07 MiB +43.00 KiB (+0.16%)
NAPI (Windows x64) gzip -9 10.80 MiB 10.82 MiB +16.50 KiB (+0.15%)
Trampoline (Windows x64) Binary 13.50 KiB 13.50 KiB 0 B (0.00%)
Trampoline (Windows x64) gzip -9 7.03 KiB 7.03 KiB 0 B (0.00%)
Installer (Windows x64) Binary 4.53 MiB 4.53 MiB 0 B (0.00%)
Installer (Windows x64) gzip -9 2.12 MiB 2.12 MiB +6 B (+0.00%)

@fengmk2
fengmk2 force-pushed the rfc/vitest-v5-upgrade branch from cd650ad to 912a5b8 Compare September 11, 2026 14:47
@fengmk2 fengmk2 added the preview-build Publish this PR's commits to the registry bridge as preview builds label Sep 11, 2026
@github-actions

github-actions Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Registry bridge build (6a258a3)

This commit build is published to the registry bridge, which serves these as ordinary npm versions (every other package proxies to npmjs):

Package Version
vite-plus 0.0.0-commit.6a258a34bf54bf52fd566afbed0cb44d450c4365
@voidzero-dev/vite-plus-core 0.0.0-commit.6a258a34bf54bf52fd566afbed0cb44d450c4365

Install the Vite+ CLI built from this commit, then migrate a project:

# macOS / Linux
curl -fsSL https://raw.githubusercontent.com/voidzero-dev/vite-plus/6a258a34bf54bf52fd566afbed0cb44d450c4365/packages/cli/install.sh | VP_PR_VERSION=2551 VP_LEGACY_INSTALLER_URL=https://raw.githubusercontent.com/voidzero-dev/vite-plus/6a258a34bf54bf52fd566afbed0cb44d450c4365/packages/cli/install-legacy.sh bash
# Windows (PowerShell)
$env:VP_PR_VERSION="2551"; $env:VP_LEGACY_INSTALLER_URL="https://raw.githubusercontent.com/voidzero-dev/vite-plus/6a258a34bf54bf52fd566afbed0cb44d450c4365/packages/cli/install-legacy.ps1"; irm https://raw.githubusercontent.com/voidzero-dev/vite-plus/6a258a34bf54bf52fd566afbed0cb44d450c4365/packages/cli/install.ps1 | iex

Or download the standalone Windows installer built from this commit:

Architecture Installer
x64 vp-setup-x86_64-pc-windows-msvc.exe
Arm64 vp-setup-aarch64-pc-windows-msvc.exe

GitHub requires you to sign in and downloads each installer as a ZIP artifact. Extract vp-setup.exe, then run it against this preview build:

.\vp-setup.exe --version "0.0.0-commit.6a258a34bf54bf52fd566afbed0cb44d450c4365" --registry "https://registry-bridge.viteplus.dev/"

After installing, upgrade the current project's vite-plus to this test build with:

vp migrate

Or point your package manager at the bridge registry https://registry-bridge.viteplus.dev/:

Package manager Registry config
npm / pnpm / Bun .npmrc: registry=https://registry-bridge.viteplus.dev/
Yarn (v2+) .yarnrc.yml: npmRegistryServer: "https://registry-bridge.viteplus.dev/"

Then pin the build (vite aliases to vite-plus-core; pnpm can use a catalog, npm an overrides entry):

{
  "devDependencies": {
    "vite-plus": "0.0.0-commit.6a258a34bf54bf52fd566afbed0cb44d450c4365",
    "vite": "npm:@voidzero-dev/vite-plus-core@0.0.0-commit.6a258a34bf54bf52fd566afbed0cb44d450c4365"
  }
}

@github-actions

github-actions Bot commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

🐳 Docker preview image

Built from this PR's registry bridge build:

Image Compressed size
ghcr.io/voidzero-dev/vite-plus:pr-2551 224MB
# remove any stale local copy from a previous run, then pull fresh
docker rmi ghcr.io/voidzero-dev/vite-plus:pr-2551 2>/dev/null; docker pull ghcr.io/voidzero-dev/vite-plus:pr-2551

Quick check:

docker run --rm ghcr.io/voidzero-dev/vite-plus:pr-2551 vp --version

See docs/guide/docker.md for usage.

@fengmk2
fengmk2 force-pushed the rfc/vitest-v5-upgrade branch 2 times, most recently from 3f5d35d to 8078906 Compare September 14, 2026 07:54
@fengmk2
fengmk2 force-pushed the rfc/vitest-v5-upgrade branch from a158fd8 to 89812ee Compare September 15, 2026 03:52
@fengmk2 fengmk2 added preview-build Publish this PR's commits to the registry bridge as preview builds and removed preview-build Publish this PR's commits to the registry bridge as preview builds labels Sep 15, 2026
@fengmk2
fengmk2 force-pushed the rfc/vitest-v5-upgrade branch from ec42677 to aadf507 Compare September 15, 2026 08:03
@fengmk2 fengmk2 removed the preview-build Publish this PR's commits to the registry bridge as preview builds label Sep 15, 2026
Automate direct benchmarks, add diagnostic documentation links, and limit Node compatibility checks to project declarations.
@fengmk2
fengmk2 force-pushed the rfc/vitest-v5-upgrade branch from 6a258a3 to 134033e Compare September 16, 2026 02:23
@fengmk2 fengmk2 added preview-build Publish this PR's commits to the registry bridge as preview builds and removed preview-build Publish this PR's commits to the registry bridge as preview builds labels Sep 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

preview-build Publish this PR's commits to the registry bridge as preview builds test: create-e2e Run `vp create` e2e tests test: e2e Auto run e2e tests test: install-e2e run vite install e2e test test: sfw

Projects

None yet

Development

Successfully merging this pull request may close these issues.

vite-plus peers @vitest/browser-playwright at an exact 4.x, so browser-mode projects cannot adopt Vitest 5

1 participant