Description
@codspeed/vitest-plugin@5.2.0 emits deprecation warnings when used with Vitest 4.1:
Importing from "vitest/runners" is deprecated since Vitest 4.1. Please use "vitest" instead.
Importing from "vitest/suite" is deprecated since Vitest 4.1. Please use static methods of "TestRunner" from the "vitest" entry point instead: e.g., `TestRunner.getCurrentTest()`.
These warnings originate from the plugin's internal imports:
node_modules/@codspeed/vitest-plugin/dist/runners.js:19:9
node_modules/@codspeed/vitest-plugin/dist/suite.js:8:9
Environment
@codspeed/vitest-plugin: 5.2.0
vitest: 4.1.2
vite: 8.0.3 (via Vite+ vite-plus@0.1.15)
- CodSpeed Action: v4.13.0
- Mode: simulation
- Runner:
ubuntu-latest
Note on Vite+
This project uses Vite+ (vite-plus), a unified toolchain that bundles Vite, Vitest, and other tools. Vite and Vitest are not installed directly — they are provided by vite-plus. The versions of Vite (8.0.3) and Vitest (4.1.2) are resolved transitively through vite-plus@0.1.15.
The @codspeed/vitest-plugin peer dependency declaration currently specifies vite: ^4.2.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 and vitest: ^3.2 || ^4, so Vite 8.x as provided by Vite+ is technically outside the declared peer range, though it appears to work at runtime.
Reproduction
- Create a project with
vitest@4.1.2 and @codspeed/vitest-plugin@5.2.0
- Add a benchmark file:
import { bench, describe } from "vitest";
describe("example", () => {
bench("noop", () => {});
});
- Run
vitest bench --run
- Observe deprecation warnings in stderr
Expected behavior
No deprecation warnings. The plugin should import from the vitest entry point instead of the deprecated vitest/runners and vitest/suite subpaths.
Additionally, it would be helpful to add vite: ^8.0.0 to the plugin's peer dependency range, as Vite 8 is now available via toolchains like Vite+.
CI logs
Full stderr output from the CodSpeed action step:
stderr | file:/home/runner/work/ja4/ja4/node_modules/.pnpm/vitest@4.1.2_@types+node@25.5.0_vite@8.0.3_@emnapi+core@1.9.1_@emnapi+runtime@1.9.1_@ty_9ae930c9106c2e325a0aaa7b6bbd4837/node_modules/vitest/dist/runners.js:19:9
Importing from "vitest/runners" is deprecated since Vitest 4.1. Please use "vitest" instead.
stderr | file:/home/runner/work/ja4/ja4/node_modules/.pnpm/vitest@4.1.2_@types+node@25.5.0_vite@8.0.3_@emnapi+core@1.9.1_@emnapi+runtime@1.9.1_@ty_9ae930c9106c2e325a0aaa7b6bbd4837/node_modules/vitest/dist/suite.js:8:9
Importing from "vitest/suite" is deprecated since Vitest 4.1. Please use static methods of "TestRunner" from the "vitest" entry point instead: e.g., `TestRunner.getCurrentTest()`.
You can check that logs at my PR: hckhanh/ja4#20
Description
@codspeed/vitest-plugin@5.2.0emits deprecation warnings when used with Vitest 4.1:These warnings originate from the plugin's internal imports:
node_modules/@codspeed/vitest-plugin/dist/runners.js:19:9node_modules/@codspeed/vitest-plugin/dist/suite.js:8:9Environment
@codspeed/vitest-plugin: 5.2.0vitest: 4.1.2vite: 8.0.3 (via Vite+vite-plus@0.1.15)ubuntu-latestNote on Vite+
This project uses Vite+ (
vite-plus), a unified toolchain that bundles Vite, Vitest, and other tools. Vite and Vitest are not installed directly — they are provided byvite-plus. The versions of Vite (8.0.3) and Vitest (4.1.2) are resolved transitively throughvite-plus@0.1.15.The
@codspeed/vitest-pluginpeer dependency declaration currently specifiesvite: ^4.2.0 || ^5.0.0 || ^6.0.0 || ^7.0.0andvitest: ^3.2 || ^4, so Vite 8.x as provided by Vite+ is technically outside the declared peer range, though it appears to work at runtime.Reproduction
vitest@4.1.2and@codspeed/vitest-plugin@5.2.0vitest bench --runExpected behavior
No deprecation warnings. The plugin should import from the
vitestentry point instead of the deprecatedvitest/runnersandvitest/suitesubpaths.Additionally, it would be helpful to add
vite: ^8.0.0to the plugin's peer dependency range, as Vite 8 is now available via toolchains like Vite+.CI logs
Full stderr output from the CodSpeed action step:
You can check that logs at my PR: hckhanh/ja4#20