Skip to content

Update to Vite v8#9393

Open
hotzenklotz wants to merge 16 commits intomasterfrom
vite-8
Open

Update to Vite v8#9393
hotzenklotz wants to merge 16 commits intomasterfrom
vite-8

Conversation

@hotzenklotz
Copy link
Copy Markdown
Member

@hotzenklotz hotzenklotz commented Mar 13, 2026

  • This PR updates to vite 8 following the steps in their release announcement and migration guide.
  • Updated vitest (and @vitest/coverage-v8) to v4.1. to match.
  • Updated @vitejs/plugin-react to v6 to match. The plugin was also migrated to use new Rust-based vite toolchain (oxc) and drops babel. Babel, however, is a requirements for the React compiler (and slow). I added the suggested config from their release notes: https://github.com/vitejs/vite-plugin-react/releases/tag/plugin-react%406.0.0
  • Resolved Typescript type errors for JSX.Element by either removing the type hint (automatic inference) or replacement with React.ReactElement
  • Updated react-markdown to version 10 to fix type error with JSX types
  • Ran yarn dedupe to eliminate duplicate versions of packages
  • Added config stub to enable vite dev tools for package inspection
  • Added code splitting config for preventing too many small chunks and by bundling vendor packages in several chunks

URL of deployed dev instance (used for testing):

  • https://___.webknossos.xyz

Steps to test:

  • Test that is works locally
  • Test build on dev server

Issues:

  • fixes #

(Please delete unneeded items, merge only when none are left open)

  • Added changelog entry (create a $PR_NUMBER.md file in unreleased_changes or use ./tools/create-changelog-entry.py)
  • Added migration guide entry if applicable (edit the same file as for the changelog)
  • Updated documentation if applicable
  • Adapted wk-libs python client if relevant API parts change
  • Removed dev-only changes like prints and application.conf edits
  • Considered common edge cases
  • Needs datastore update after deployment

@hotzenklotz hotzenklotz self-assigned this Mar 13, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 13, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Tightened Node engine to >=22.12.0, updated Vite and related devDependencies, added @rolldown/plugin-babel and @vitejs/devtools, removed tsconfig-paths/analyzer dev deps, and refactored Vite config to use native tsconfig resolution, rolldownOptions, and the Rolldown Babel React preset.

Changes

Cohort / File(s) Summary
Package manifest
package.json
Updated engines.node>=22.12.0; added devDeps @rolldown/plugin-babel ^0.2.1, @vitejs/devtools ^0.1.11; upgraded vite^8.0.2, @vitejs/plugin-react^6.0.1, vitest^4.1.1, @vitest/coverage-v8^4.1.0, vite-plugin-wasm^3.6.0; removed vite-bundle-analyzer and vite-tsconfig-paths.
Vite config
vite.config.ts
Removed tsconfigPaths() import/invocation and bundle analyzer; enabled resolve.tsconfigPaths: true; replaced previous React/Babel setup with @rolldown/plugin-babel using reactCompilerPreset and a plain react() plugin call; renamed build rollupOptionsrolldownOptions; enabled devtools.enabled: true; simplified worker plugin list (kept wasm() only).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • Add React Compiler #9381: Also adjusts React/Babel integration in the Vite config (related changes to React compiler/babel configuration).

Suggested labels

frontend

Suggested reviewers

  • philippotto
  • normanrz

Poem

🐰 I hopped through configs, neat and spry,
Rolldown carrots, Vite on high,
Babel tunes and paths made right,
Plugins swapped beneath moonlight,
A joyful rabbit bounces by 🥕✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Update to Vite v8' is concise and clearly describes the main change in the changeset—upgrading Vite to version 8 with related dependency updates.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description check ✅ Passed The pull request description clearly relates to the changeset, explaining the Vite v8 upgrade, dependency updates, and configuration changes with references to official migration guides.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch vite-8

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
package.json (1)

14-37: ⚠️ Potential issue | 🟠 Major

Resolve peer dependency mismatch between plugin-react and plugin-babel.

@vitejs/plugin-react@^6.0.0 specifies @rolldown/plugin-babel@^0.1.7 as a peer dependency, but the package.json declares @rolldown/plugin-babel@^0.2.1. This creates an unmet peer dependency that will cause npm install warnings or resolution failures.

Upgrade @vitejs/plugin-react to ^6.0.1, which updates the peer range to ^0.1.7 || ^0.2.0.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@package.json` around lines 14 - 37, Update the `@vitejs/plugin-react`
dependency version to ^6.0.1 in package.json so its peer range includes
`@rolldown/plugin-babel` ^0.2.0; specifically change the "@vitejs/plugin-react"
entry (which currently is "^6.0.0") to "^6.0.1" to resolve the peer dependency
mismatch with "@rolldown/plugin-babel" and then reinstall dependencies.
🧹 Nitpick comments (1)
vite.config.ts (1)

45-49: Set build.copyPublicDir explicitly to false when outputting to public.

Line 46 sets outDir: "public", which overlaps with Vite's default publicDir. By default, Vite 8 enables copyPublicDir: true, causing it to copy publicDir into outDir, resulting in a self-copy edge case and warnings about non-separate folders. Explicitly disabling this avoids the unnecessary copy and warnings.

♻️ Proposed config tweak
   build: {
     outDir: "public", // note: /public is handled by the backend/Play framework for asset delivery
     emptyOutDir: true,
+    copyPublicDir: false,
     sourcemap: true,
     rolldownOptions: {
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@vite.config.ts` around lines 45 - 49, Set build.copyPublicDir to false in the
Vite config to prevent Vite from copying the publicDir into outDir when outDir
is "public"; update the build block (where outDir: "public", emptyOutDir,
sourcemap, and rolldownOptions are defined) to include copyPublicDir: false so
the build doesn't attempt the self-copy/warnings.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@package.json`:
- Line 59: Update the Node engine constraint in package.json so it excludes Node
versions 22.0–22.11; specifically change the "engines.node" value (currently
">=22") to ">=22.12.0" so Vite 8 and `@vitejs/plugin-react` 6 are guaranteed
compatible.

---

Outside diff comments:
In `@package.json`:
- Around line 14-37: Update the `@vitejs/plugin-react` dependency version to
^6.0.1 in package.json so its peer range includes `@rolldown/plugin-babel` ^0.2.0;
specifically change the "@vitejs/plugin-react" entry (which currently is
"^6.0.0") to "^6.0.1" to resolve the peer dependency mismatch with
"@rolldown/plugin-babel" and then reinstall dependencies.

---

Nitpick comments:
In `@vite.config.ts`:
- Around line 45-49: Set build.copyPublicDir to false in the Vite config to
prevent Vite from copying the publicDir into outDir when outDir is "public";
update the build block (where outDir: "public", emptyOutDir, sourcemap, and
rolldownOptions are defined) to include copyPublicDir: false so the build
doesn't attempt the self-copy/warnings.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 6b36eb90-2cf5-40be-9bab-e86601426a21

📥 Commits

Reviewing files that changed from the base of the PR and between c58f924 and 9fb3793.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (2)
  • package.json
  • vite.config.ts

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