Skip to content

feat(vitest-plugin): add vite 8 support#74

Draft
adriencaccia wants to merge 2 commits intomainfrom
feat/vite-8-support
Draft

feat(vitest-plugin): add vite 8 support#74
adriencaccia wants to merge 2 commits intomainfrom
feat/vite-8-support

Conversation

@adriencaccia
Copy link
Member

@adriencaccia adriencaccia commented Mar 23, 2026

Add Vite 8 to the supported peer dependency range for @codspeed/vitest-plugin.

Vite 8 replaces esbuild and Rollup with Rolldown and Oxc. This changes the internal Plugin type inheritance chain (Plugin now extends Rolldown.Plugin). The vitest-plugin only uses basic plugin hooks (name, apply, enforce, config) — none of which are affected by Vite 8's breaking changes.

Changes:

  • Add ^8.0.0 to peerDependencies.vite
  • Bump devDependencies.vite from ^7.0.0 to ^8.0.0
  • Add rolldown as a dev dependency — needed because pnpm's strict isolation doesn't hoist rolldown (a transitive dep of Vite 8), and TypeScript needs it to resolve Rolldown.Plugin in the type chain

Vite 8 breaking changes reviewed (none affect this plugin):

  • Rolldown replaces esbuild/Rollup — plugin doesn't use bundler APIs
  • moduleType: 'js' required in load/transform hooks — plugin doesn't use these hooks
  • Removed hooks (shouldTransformCachedModule, resolveImportMeta, etc.) — not used
  • build.rollupOptionsbuild.rolldownOptions — not used
  • esbuild → oxc config migration — not used

Note: Vite 8 requires Node.js ^20.19.0 || >=22.12.0. CI may need a Node.js bump to run integration tests against Vite 8. See #76.

Vitest v4 support was already in place (^3.2 || ^4 peer dep, ^4.0.18 dev dep) — no changes needed there.

adriencaccia and others added 2 commits March 23, 2026 16:52
Add vite ^8.0.0 to the peer dependency range and bump the dev
dependency to test against the latest. Vite 8 replaces esbuild/Rollup
with Rolldown, which changes the Plugin type's inheritance chain.
Add rolldown as a dev dependency so pnpm can resolve the transitive
types needed for the build.

Co-Authored-By: Claude <[email protected]>
Vite 8 removed the `main` and `types` top-level fields from its
package.json, relying entirely on the `exports` map. Since the base
tsconfig uses `moduleResolution: "node"` (TypeScript 4.9.4), the
compiler cannot resolve `import { Plugin } from "vite"` without
an explicit path mapping.

Co-Authored-By: Claude <[email protected]>
@codspeed-hq
Copy link

codspeed-hq bot commented Mar 23, 2026

Merging this PR will degrade performance by 99.97%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 3 improved benchmarks
❌ 10 regressed benchmarks
✅ 155 untouched benchmarks

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Memory wait 500ms 39.1 KB 64.1 KB -39.05%
Memory wait 500ms 15 KB 64.1 KB -76.63%
Memory recursive fibo 15 19 B 65,624 B -99.97%
Memory wait 1ms 7 B 10 B -30%
Simulation wait 500ms 8.7 ms 12 ms -28.05%
Simulation wait 1sec 19.2 ms 22.5 ms -14.38%
Simulation one 585 µs 407.6 µs +43.53%
Simulation wait 500ms 10.5 ms 11.9 ms -12.01%
WallTime short body 1.5 µs 1.9 µs -20.65%
WallTime switch 2 312 ns 348 ns -10.34%
WallTime short body 2.1 µs 1.7 µs +21.28%
WallTime short body 2.1 µs 1.7 µs +25%
WallTime fibo 30 29.9 ms 34.1 ms -12.47%

Comparing feat/vite-8-support (1a48730) with main (4f97cbe)

Open in CodSpeed

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