Skip to content

chore(deps): Update to Vitest 4 and Vite 8 - #24746

Open
Lms24 wants to merge 4 commits into
developfrom
chore/upgrade-vitest-4
Open

Lms24 wants to merge 4 commits into
developfrom
chore/upgrade-vitest-4

Conversation

@Lms24

@Lms24 Lms24 commented Sep 25, 2026 •

Copy link
Copy Markdown
Member

This PR updates Vitest to v4, and Vite to v8. In a previous attempt that kept Vite on v7, we encountered several problems with yarn, hence I made the jump to vite 8 directly. Shouldn't affect anything else, since we only use vite for vitest.

Changes:

  • Bump vitest and @vitest/coverage-v8 from 3.2 to 4.1 across the monorepo.
  • Bump vite to 8 in packages that previously pinned Vite 6 or 7.
  • Replace the removed poolOptions.threads.singleThread with maxWorkers: 1 in the bun and cloudflare integration tests.
  • Give the bun integration test project its own sequence.groupOrder, which Vitest 4 requires for projects with different maxWorkers.
  • Run the shared vitest-esm-only plugin with enforce: 'pre' so TS transpilation can't move its marker comments.
  • Use function implementations for mocks called with new, which Vitest 4 no longer allows as arrow functions.
  • Clear or reset mocks explicitly, since vi.restoreAllMocks() no longer resets vi.fn() mocks.
  • Fix type errors from Vite 8 plugin hook types and the DOM lib types Vitest 3 used to pull in.
  • Move test options to the second argument in the deno and debug-id-sourcemaps tests.

@github-actions

github-actions Bot commented Sep 25, 2026 •

Copy link
Copy Markdown
Contributor

size-limit report 📦

⚠️ Warning: Base artifact is not the latest one, because the latest workflow run is not done yet. This may lead to incorrect results. Try to re-run all tests to get up to date results.

Path Size % Change Change
@sentry/browser 29.24 kB - -
@sentry/browser - with treeshaking flags 27.5 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 27.4 kB - -
@sentry/browser (incl. Tracing) 51.15 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 51.17 kB - -
@sentry/browser (incl. Tracing, Profiling) 54.18 kB - -
@sentry/browser (incl. Tracing, Replay) 90.76 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 79.86 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 95.46 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 108.41 kB - -
@sentry/browser (incl. Feedback) 46.76 kB - -
@sentry/browser (incl. sendFeedback) 34.3 kB - -
@sentry/browser (incl. FeedbackAsync) 39.41 kB - -
@sentry/browser (incl. Metrics) 30.25 kB - -
@sentry/browser (incl. Logs) 30.51 kB - -
@sentry/browser (incl. Metrics & Logs) 31.18 kB - -
@sentry/react 31 kB - -
@sentry/react (incl. Tracing) 53.45 kB - -
@sentry/vue 36.74 kB - -
@sentry/vue (incl. Tracing) 53.7 kB - -
@sentry/svelte 29.26 kB - -
CDN Bundle 30.93 kB - -
CDN Bundle (incl. Tracing) 51.69 kB - -
CDN Bundle (incl. Logs, Metrics) 33.2 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 53.66 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 73.92 kB - -
CDN Bundle (incl. Tracing, Replay) 89.28 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 91.25 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 95.45 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 97.42 kB - -
CDN Bundle - uncompressed 91.4 kB - -
CDN Bundle (incl. Tracing) - uncompressed 153.77 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 97.97 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 159.73 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 227.54 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 273.5 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 279.44 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 287.2 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 293.13 kB - -
@sentry/nextjs (client) 55.77 kB - -
@sentry/sveltekit (client) 51.59 kB - -
@sentry/core/server 39.95 kB - -
@sentry/core/browser 13.63 kB - -
@sentry/node 137.13 kB +0.01% +10 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 82.8 kB - -
@sentry/node - without tracing 90.73 kB +0.02% +11 B 🔺
@sentry/node - without channel injection 115.5 kB +0.01% +11 B 🔺
@sentry/aws-serverless 99 kB +0.01% +9 B 🔺
@sentry/cloudflare (withSentry) - minified 206.62 kB - -
@sentry/cloudflare (withSentry) 514.02 kB - -

View base workflow run

@Lms24
Lms24 force-pushed the chore/upgrade-vitest-4 branch 2 times, most recently from 1598459 to 4be15ae Compare September 28, 2026 08:49
@Lms24

Lms24 commented Sep 28, 2026

Copy link
Copy Markdown
Member Author

bugbot review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 4be15ae. Configure here.

@Lms24
Lms24 force-pushed the chore/upgrade-vitest-4 branch from 4be15ae to f84706f Compare September 28, 2026 09:20
Lms24 and others added 4 commits September 28, 2026 11:55
Vitest 3 transitively pulled in DOM lib types, which the bun and
cloudflare integration tests relied on. Add DOM to the bun tsconfig
lib, matching node-integration-tests whose runner the bun suites now
compile, and reference the DOM lib in the browser-only cloudflare
client file.

Vite 8 types the plugin `config` hook with a `ConfigPluginContext`
`this`, which broke nuxt's typechecked unit tests. Cast the hook before
calling it, as the remix tests already do.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Bump deno-integration-tests and the debug-id-sourcemaps e2e app to
Vitest 4. Vitest 4 no longer accepts test options as the third
argument, so pass them second.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Vitest 4 rejects projects that share a `sequence.groupOrder` but set
different `maxWorkers`. The `bun` project pins `maxWorkers: 1`, so it
now runs in a separate group after the node suites.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@Lms24
Lms24 force-pushed the chore/upgrade-vitest-4 branch from f84706f to 68c0334 Compare September 28, 2026 09:56
@Lms24
Lms24 added this pull request to stack #24790 September 28, 2026 09:56
@Lms24 Lms24 changed the title chore(deps): Update to Vitest 4 chore(deps): Update to Vitest 4 and Vite 8 Sep 28, 2026
@Lms24
Lms24 marked this pull request as ready for review September 28, 2026 12:31
@Lms24
Lms24 requested review from a team as code owners September 28, 2026 12:31
@Lms24
Lms24 requested review from JPeer264, isaacs, logaretm, msonnb, nicohrubec and s1gr1d and removed request for a team September 28, 2026 12:31
@Lms24 Lms24 self-assigned this Sep 28, 2026
const build = config.build || {};
// SolidStart builds with vinxi's Vite, which predates `rolldownOptions`
// oxlint-disable-next-line typescript/no-deprecated
const rollupOptions = build.rollupOptions || {};

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

q: Do we need to have a follow up ticket for this to change it to rolldownOptions?

@Lms24 Lms24 Sep 29, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

It's a good point. The Vite bump here raises that rollupVersions is now an alias of rolldownOptions. Switching would break support for older Vite versions though. So we likely need to set the correct property based on vite version to be fully compatible in the long run. Let me ask our bundler plugin experts.

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.

3 participants