Skip to content

chore(deps): bump vite to 8.x + plugin-react 6 + vitest 4.1 + esbuild 0.28#969

Open
jSydorowicz21 wants to merge 2 commits intoRunMaestro:rcfrom
jSydorowicz21:upgrade/stage-6-vite-8
Open

chore(deps): bump vite to 8.x + plugin-react 6 + vitest 4.1 + esbuild 0.28#969
jSydorowicz21 wants to merge 2 commits intoRunMaestro:rcfrom
jSydorowicz21:upgrade/stage-6-vite-8

Conversation

@jSydorowicz21
Copy link
Copy Markdown
Contributor

@jSydorowicz21 jSydorowicz21 commented May 7, 2026

Summary

Vite major bump from a planned package-upgrade pass. Surfaces and addresses two real Vite 8 / Rolldown behavior shifts.

  • vite ^5.0.11^8.0.11 (3 majors)
  • @vitejs/plugin-react ^4.2.1^6.0.1 (sync, vite 8 peer)
  • vitest ^4.0.15^4.1.5 (sync, latest 4.x; no v5 yet)
  • @vitest/coverage-v8 ^4.0.15^4.1.5 (sync)
  • esbuild ^0.24.2^0.28.0 (sync, vite 8 peer)
  • removed vite-plugin-electron ^0.28.2 — verified zero imports in source

Behavior shifts addressed in vite.config.{mts,web.mts}

  1. cssMinify: 'esbuild' pinned. Vite 8 changed the default CSS minifier to lightningcss, which strictly rejects xterm's intentionally-malformed selectors that esbuild's minifier silently passed through. A TODO(vite-css) comment beside each pin names three exit criteria (lightningcss tolerance, xterm upstream fix, or local pre-processing).
  2. esbuild.dropoxc.drop. Vite 8 with Rolldown uses oxc as the transformer; the legacy esbuild config block is silently ignored. Without this migration, source console.* calls leak into production bundles. Verified by grepping production output before/after — known source console.log strings (e.g. "AgentSessionsModal: No activeSession") are correctly stripped after the migration.

JSX Fast Refresh stays handled by react({ fastRefresh: !disableHmr }) from @vitejs/plugin-react; no separate oxc-level toggle is needed (would double-inject).

Verification

Merge ordering

⚠ Land after #965 (chore/dedup-test-imports). This branch bumps vitest to 4.1.x which has a stricter parser; without the dedup branch, 4 test files silently report (0 test).

Test plan

Summary by CodeRabbit

Release Notes

  • Chores
    • Upgraded development toolchain dependencies, including build and testing frameworks, for improved performance and stability.
    • Modernized build configuration to ensure compatibility with latest tool versions.

… 0.28

Stage 6 of the package-upgrade plan. Two Vite 8 behavior shifts surface
and are addressed surgically.

- vite ^5.0.11 -> ^8.0.11
- @vitejs/plugin-react ^4.2.1 -> ^6.0.1 (sync, vite 8 peer)
- vitest ^4.0.15 -> ^4.1.5 (sync, latest 4.x line - no v5 yet)
- @vitest/coverage-v8 ^4.0.15 -> ^4.1.5 (sync)
- esbuild ^0.24.2 -> ^0.28.0 (sync, vite 8 peer)
- removed vite-plugin-electron ^0.28.2 (never imported - confirmed by grep)

Vite 8 behavior shifts addressed in vite.config.{mts,web.mts}:

1) Default CSS minifier flipped to lightningcss, which rejects malformed
   CSS that esbuild's minifier tolerated. xterm's CSS includes one such
   pattern. Pinned cssMinify: 'esbuild' to preserve prior behavior.

2) Rolldown uses oxc as the transformer; existing esbuild.drop config
   was silently ignored, leaking source console.* calls into prod
   bundles. Migrated to oxc.drop with the same intent. Verified by
   grepping production output - source console.log strings (e.g.
   "AgentSessionsModal: No activeSession") are now stripped.

Verification:
- npm install + electron-rebuild against E28 succeeded
- npm run lint clean (3 tsconfigs)
- npm run lint:eslint clean
- npm run format:check (src/) clean
- npm run build succeeded under Vite 8 / Rolldown
- Targeted vitest 4.1.5 run on Vite 8: 74 tests passed
Two small follow-ups to Stage 6's vite.config edits, surfaced by code
review:

1. Removed `oxc.jsxRefresh` from vite.config.mts. The renderer config
   passes `react({ fastRefresh: !disableHmr })` to @vitejs/plugin-react,
   which owns Fast Refresh injection; an oxc-level toggle alongside is
   redundant and could double-inject. The web config never had this
   line; the renderer-only setting was an asymmetry without rationale.

2. Added a TODO(vite-css) comment beside both `cssMinify: 'esbuild'`
   pins, naming the three exit criteria for revisiting (lightningcss
   tolerance update, xterm CSS upstream fix, or local pre-processing).
   The pin works around xterm's malformed CSS that Rolldown's
   lightningcss minifier rejects but esbuild silently passed through.

No behavior change.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 7, 2026

Review Change Stack
No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 078856ab-b80a-4016-9676-16d6840abcb1

📥 Commits

Reviewing files that changed from the base of the PR and between deb2532 and 2c2a04d.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (3)
  • package.json
  • vite.config.mts
  • vite.config.web.mts

📝 Walkthrough

Walkthrough

This PR upgrades development dependencies to Vite 8 with Rolldown and migrates build configurations accordingly. Vite, Vitest, esbuild, and related plugins are bumped to newer major/minor versions. Both vite.config.mts and vite.config.web.mts replace esbuild-based drop rules with oxc-based drop rules. The web config additionally pins CSS minification to esbuild to preserve earlier tolerance for malformed CSS.

Changes

Vite 8 & Rolldown Migration

Layer / File(s) Summary
Development Dependencies
package.json
Vite upgraded from 5.0.11 to 8.0.11; Vitest from 4.0.15 to 4.1.5; esbuild from 0.24.2 to 0.28.0; @vitejs/plugin-react from 4.2.1 to 6.0.1; @vitest/coverage-v8 from 4.0.15 to 4.1.5.
Core Build Configuration
vite.config.mts
Drop rules for console and debugger statements migrated from esbuild to oxc configuration block. Production builds drop console and debugger; non-production builds preserve all output. Build output directory and emptyOutDir settings retained.
Web Build Configuration
vite.config.web.mts
oxc drop rules added to replace esbuild configuration for production console/debugger stripping. build.cssMinify explicitly set to 'esbuild' to restore tolerance for malformed CSS (e.g., from xterm), overriding Vite 8's stricter default lightningcss behavior.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 Vite, Rolldown, oxc so new,
Dependencies dance in a timely brew,
esbuild steps aside for the lighter way,
CSS quirks embraced—hooray, hooray!
Configuration whispers of optimization's call.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change—dependency version bumps for Vite, plugin-react, vitest, and esbuild—which is the primary focus of the PR.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented May 7, 2026

Greptile Summary

This PR bumps Vite from 5 to 8 (via Rolldown/Oxc) and syncs peer dependencies (@vitejs/plugin-react 4→6, vitest 4.0→4.1, esbuild 0.24→0.28), removing the now-unused vite-plugin-electron. Two Vite 8 behavior shifts are addressed in both vite configs: the default CSS minifier is pinned back to esbuild to tolerate xterm's malformed selectors, and esbuild.drop is migrated to oxc.drop to preserve production console stripping under the new Rolldown/Oxc pipeline.

  • oxc.drop legitimacy: The Vite 8 docs describe oxc as extending Oxc Transformer's options, whose published fields (jsx, target, define, inject, etc.) do not include drop. If this key is silently ignored, production console calls leak in both the renderer and web builds.
  • Deprecated build.minify: 'esbuild' in vite.config.web.mts: Vite 8 marks build.minify: 'esbuild' as deprecated. Using esbuild for minification while relying on oxc.drop for console stripping also creates a potential gap if drop is implemented at the minifier layer rather than the transformer layer.
  • Package bump and vite-plugin-electron removal look correct and consistent.

Confidence Score: 3/5

The renderer config migration looks structurally sound, but the web config retains a deprecated minifier and the oxc.drop mechanism is unverified against Vite 8 type definitions, which could mean console calls silently leak into production web bundles.

The renderer config migration looks structurally sound, but the web config retains a deprecated minifier and the oxc.drop mechanism is unverified — two open questions that could mean console calls silently leak into production web bundles.

vite.config.web.mts — the deprecated build.minify: 'esbuild' and its interaction with oxc.drop need attention before this lands on the rc branch.

Important Files Changed

Filename Overview
vite.config.mts Migrates esbuild.drop → oxc.drop for console stripping, pins cssMinify to esbuild for xterm compatibility — oxc.drop is not a documented OxcOptions field and may be silently ignored
vite.config.web.mts Same esbuild→oxc migration as renderer config, but retains a deprecated build.minify: 'esbuild' that was not updated in this PR — creates a potential gap where console stripping via oxc.drop may not apply to the web production bundle
package.json Bumps vite 5→8, @vitejs/plugin-react 4→6, vitest/coverage-v8 4.0→4.1, esbuild 0.24→0.28; removes vite-plugin-electron; all version ranges look correct and internally consistent

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    SRC[Source Files\nTS / TSX / CSS]

    subgraph renderer[Vite 8 Build Pipeline renderer vite.config.mts]
        OXC_T1[Oxc Transformer\noxc.drop: console+debugger\njsx: @vitejs/plugin-react]
        ROLL1[Rolldown Bundler]
        MIN1[Oxc Minifier\nbuild.minify: oxc default]
        CSS1[CSS Minifier\ncssMinify: esbuild\nxterm compat pin]
    end

    subgraph web[Vite 8 Build Pipeline web vite.config.web.mts]
        OXC_T2[Oxc Transformer\noxc.drop: console+debugger\njsx: @vitejs/plugin-react]
        ROLL2[Rolldown Bundler]
        MIN2[esbuild Minifier\nbuild.minify: esbuild DEPRECATED]
        CSS2[CSS Minifier\ncssMinify: esbuild\nxterm compat pin]
    end

    SRC --> OXC_T1 --> ROLL1 --> MIN1 --> CSS1 --> OUT1[dist/renderer]
    SRC --> OXC_T2 --> ROLL2 --> MIN2 --> CSS2 --> OUT2[dist/web]
Loading

Comments Outside Diff (1)

  1. vite.config.web.mts, line 153 (link)

    P1 Deprecated minify: 'esbuild' left unaddressed in Vite 8 migration

    The Vite 8 docs explicitly state: "build.minify: 'esbuild' is deprecated and will be removed in the future." This PR migrates every other esbuild-to-oxc pattern but leaves this one in place. As a result the web build still uses esbuild for minification while oxc.drop is meant to strip console calls — if oxc.drop operates at the minifier level rather than the transformer level, console.* calls would silently survive in web production bundles despite oxc: { drop: ['console', 'debugger'] } being set. The renderer config (which doesn't override minify) uses the default 'oxc' minifier and is not affected.

Reviews (1): Last reviewed commit: "chore(vite): drop redundant oxc.jsxRefre..." | Re-trigger Greptile

Comment thread vite.config.mts
Comment on lines +61 to 63
oxc: {
drop: mode === 'production' ? ['console', 'debugger'] : [],
},
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 oxc.drop is not a documented Vite 8 OxcOptions field

The official Vite 8 docs for oxc say it "extends Oxc Transformer's options," whose published fields are jsx, target, typescript, assumptions, define, inject, decorator, and plugins — no drop. Neither the rolldown-vite maintainers (as of July 2025) nor the oxc-transform docs list a drop option for the transformer. An unrecognized key in OxcOptions may be silently ignored, leaving production console calls unstripped even though the build succeeds. It is worth confirming via TypeScript types (npx tsc --noEmit) that oxc.drop is actually a valid key in the installed Vite 8 type definitions, and that the grep verification covers the web build output as well.

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