feat(vitest-plugin): add vite 8 support - #74
Conversation
Merging this PR will regress 15 benchmarks
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ❌ | Simulation | recursive fibo 10 |
299.9 µs | 1,372.5 µs | -78.15% |
| ❌ | Simulation | switch 1 |
202.1 µs | 534.3 µs | -62.17% |
| ❌ | WallTime | fibo darwin |
8.8 ms | 11.9 ms | -25.59% |
| ❌ | Memory | end |
2 KB | 2.6 KB | -24.55% |
| ❌ | Memory | short body |
656 B | 784 B | -16.33% |
| ❌ | Memory | short body |
656 B | 784 B | -16.33% |
| ❌ | Memory | short body |
656 B | 784 B | -16.33% |
| ❌ | WallTime | short body |
1.9 µs | 2.2 µs | -14.29% |
| ❌ | WallTime | switch 1 |
72 ns | 84 ns | -14.29% |
| ❌ | WallTime | switch 1 |
72 ns | 84 ns | -14.29% |
| ❌ | WallTime | switch 2 |
84 ns | 96 ns | -12.5% |
| ❌ | Memory | two |
1.8 KB | 2.1 KB | -11.94% |
| ❌ | Memory | one |
2 KB | 2.2 KB | -11.27% |
| ❌ | WallTime | short body |
1.9 µs | 2.2 µs | -10.56% |
| ❌ | WallTime | test sync baz 10 |
108 ns | 120 ns | -10% |
| ⚡ | Simulation | test_recursive_fibo_10 |
11,699.9 µs | 274.3 µs | ×43 |
| ⚡ | Simulation | recursive fibo 10 |
1,371.7 µs | 300.5 µs | ×4.6 |
| ⚡ | Memory | wait 1sec |
64.2 KB | 20.3 KB | ×3.2 |
| ⚡ | WallTime | test_recursive_cached_fibo_10 |
2.3 µs | 2 µs | +15.34% |
| ⚡ | WallTime | switch 2 |
96 ns | 84 ns | +14.29% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing feat/vite-8-support (facdae6) with main (9338d9a)
|
|
I don't think this is necessary. Either of the following options should be sufficient:
It's important to note that the 20.19 release was over a year ago. |
|
If you want to detect whether Vite is v8, you can use |
|
@adriencaccia any chance to have this PR resurrected? If not, I am happy to take over the works. We need this (plus some other fixes) to make the plugin work at Starlight. At the moment, our biggest blockers are:
|
It seems the biggest blocker for vite 8 was bumping the node version of the repo as explained in #76. Regarding the setup/teardown, @GuillaumeLagrange do you remember why we closed #46? |
No particular reason comes to mind, I think it's just a branch that was forgotten and never merged |
Accept vite 8 in the peer dependency range and test against it. Vite 8 replaces esbuild and Rollup with Rolldown and Oxc. The plugin only uses `name`, `apply`, `enforce` and `config`, none of which are affected by the breaking changes, but two build-level adjustments are needed: - Vite 8 publishes types through `exports` only, which the legacy `moduleResolution: "node"` cannot read. Switch the package to `moduleResolution: "bundler"`. - rollup-plugin-dts forces `preserveSymlinks: true`, which prevents TypeScript from reaching `rolldown` (a transitive dependency of vite 8) in a pnpm store, leaving `Plugin` without its base members. Disable it for the declaration build and keep `vite` external. Bump the vitest dev dependency to ^4.1.11: vitest depends on vite directly, and 4.1 is the first release accepting vite 8, so without it the dev environment resolves two different vite copies. Co-Authored-By: Claude <noreply@anthropic.com>
1a48730 to
facdae6
Compare
|
Thank you. It would be great to have those hooks fixed. For some reason, the benchmarks stale https://github.com/withastro/starlight/actions/runs/33494510505/job/99813536944?pr=4157 and we believe the cause is those hooks |
Add Vite 8 to the supported peer dependency range for
@codspeed/vitest-plugin, and test against it.Vite 8 replaces esbuild and Rollup with Rolldown and Oxc. The plugin only uses
name,apply,enforceandconfig, none of which are affected by the breaking changes. Two build-level adjustments were needed:exportsonly, which the legacymoduleResolution: "node"cannot read, so the package now usesmoduleResolution: "bundler".rollup-plugin-dtsforcespreserveSymlinks: true, which stops TypeScript from reachingrolldown(a transitive dep of Vite 8) in a pnpm store and leavesPluginwithout its base members. It is disabled for the declaration build, withvitekept external.The vitest dev dependency moves to
^4.1.11: vitest depends on vite directly, and 4.1 is the first release accepting Vite 8, so without it the dev environment resolves two different vite copies and the plugin never actually runs on Vite 8.Verified on Node 24.19.0:
pnpm turbo run lint typecheck testgreen (29/29) with--frozen-lockfiledist/index.d.tsbyte-identical tomain, build emits no warnings.d.tstypechecksexamples/with-vitest-v3(vitest 3.2.4) andexamples/with-typescript-esm(vitest 4.0.18) still pass on vite 7Vitest 4.1 prints deprecation warnings for the
vitest/runnersandvitest/suitesubpath imports the plugin uses. That is fixed by #75, stacked on this branch.