Skip to content

Added separate Solid 2 vitest config#897

Merged
davedbase merged 2 commits into
solidjs-community:nextfrom
davedbase:update/v2/vitest-separation
May 14, 2026
Merged

Added separate Solid 2 vitest config#897
davedbase merged 2 commits into
solidjs-community:nextfrom
davedbase:update/v2/vitest-separation

Conversation

@davedbase
Copy link
Copy Markdown
Member

Adds configs/vitest.config.solid2.ts — a shared Vitest config using a direct Babel + babel-preset-solid@2.0.0-beta.12 transform instead of vite-plugin-solid, needed for packages whose tests use JSX with the Solid 2.0 @solidjs/web runtime (e.g. <For> children are now accessors)

  • Adds @babel/core and babel-preset-solid@2.0.0-beta.12 to root devDependencies so configs/vitest.config.solid2.ts resolves the correct preset (root previously only had 1.x via vite-plugin-solid)
  • Adds vitest2 / test:client2 / test:ssr2 scripts to root package.json, the package template, and packages/virtual — Solid 2.0 packages with JSX tests point test/test:ssr at vitest2; everything else keeps vitest

Why a separate config?

vite-plugin-solid bundles babel-preset-solid@1.x, which generates the _$effect(compute, apply) two-argument form incompatible with the Solid 2.0 runtime. The new config calls babel-preset-solid directly with moduleName: "@solidjs/web", producing correct output. Only packages with actual JSX in tests need this — the 20+ other already-migrated primitives use plain .ts tests and keep working with the existing config.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 14, 2026

⚠️ No Changeset found

Latest commit: 8ddb224

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@davedbase davedbase changed the base branch from main to next May 14, 2026 15:00
@davedbase davedbase merged commit 52feb47 into solidjs-community:next May 14, 2026
@davedbase davedbase deleted the update/v2/vitest-separation branch May 14, 2026 15:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants