Skip to content

chore(electron): upgrade Vite to v8 - #89

Open
sheepbox8646 wants to merge 1 commit into
LodyAI:mainfrom
sheepbox8646:chore/upgrade-vite-8
Open

chore(electron): upgrade Vite to v8#89
sheepbox8646 wants to merge 1 commit into
LodyAI:mainfrom
sheepbox8646:chore/upgrade-vite-8

Conversation

@sheepbox8646

@sheepbox8646 sheepbox8646 commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Related issue

Closes #154

The Issue was created after this PR to correct an authoring-process oversight and is awaiting explicit maintainer agreement.

Problem / pressure

The Electron application was still pinned to Vite 7 while the repository already carries and validates Vite 8 elsewhere. The Electron-specific build chain and Rollup-era configuration needed to move together so the desktop production build could use Vite 8 without peer mismatches or losing its guarded Mermaid chunk boundary.

Summary

  • Upgrade the Electron workspace to Vite 8, @vitejs/plugin-react 6, and the Vite 8-compatible electron-vite 6 beta.
  • Migrate renderer build options from Rollup compatibility keys to Rolldown-native rolldownOptions and codeSplitting.groups.
  • Keep shared Vite aliases and plugins structurally typed so hosts on different Vite majors can consume them.
  • Record the documented Vite 8 compatibility of vite-plugin-wasm@3.5.0 in pnpm peer rules and refresh the lockfile.

Before / after

Before After
Electron resolved Vite 7.3.1 with electron-vite 5 and React plugin 5. Electron resolves Vite 8.1.5 with electron-vite 6 beta and React plugin 6.
Renderer chunking used build.rollupOptions, manualChunks, and onlyExplicitManualChunks. Renderer chunking uses build.rolldownOptions.output.codeSplitting.groups; mermaid-deps remains isolated.
Shared config helpers exposed the Components workspace's Vite types to every host. Shared helpers expose only the structural alias/plugin data consumed across host Vite majors.

Test plan

  • corepack pnpm --dir apps/electron build:app — passed; built main, preload, and renderer with Vite 8.1.5, including WASM assets and the isolated mermaid-deps chunk.
  • corepack pnpm --dir apps/electron test — passed, 43 tests.
  • corepack pnpm --filter @lody/components typecheck — passed.
  • corepack pnpm --filter @lody/components exec vitest run tests/vite-renderer-bundle-aliases.test.ts — passed, 2 tests.
  • corepack pnpm check:public-boundary and Prettier checks for changed files — passed.
  • Scoped type-aware oxlint for changed TypeScript files — 0 errors and 11 existing warnings.
  • corepack pnpm check:quick — attempted but blocked by pre-existing errors in untouched files and the independently managed Kimi submodule.
  • Not run: packaging for every target operating system and architecture.

Context handoff

Instructions for reviewing agents

  • Review focus: Check the dependency trio and electron.vite.config.ts Rolldown chunk configuration, especially preserved Mermaid and WASM behavior.
  • Decisions to challenge: Decide whether adopting electron-vite@6.0.0-beta.1 is acceptable before stable Vite 8 support is released.
  • Plausible failures / evidence gaps: Packaging was not run for every target OS/architecture, and the repository-wide quick check is blocked by unrelated baseline failures.

Authoring context

  • User goal / directives: Move the Electron build chain to Vite 8 while retaining the current renderer output boundaries and shared workspace behavior.
  • Constraints / non-goals: Do not redesign chunking, duplicate shared helpers, upgrade unrelated packages, or claim unperformed cross-platform packaging coverage.
  • Risk-bearing decisions: Use the electron-vite 6 beta, migrate to Rolldown-native chunk configuration, and narrow shared helper types across temporarily mixed Vite majors.
  • Destructive or irreversible behavior: None for user data; dependency and lockfile changes are source-controlled and reversible.
  • Deliberately not done or tested: No all-platform packaging matrix and no clean full-repository quick check because of documented unrelated baseline failures.
  • Unknowns / confidence: The tested desktop build is high confidence; residual risk is beta electron-vite behavior and untested platform-specific packaging.

Upgrade the Electron build chain to Vite 8, the compatible React plugin, and electron-vite 6 beta. Migrate renderer bundling to Rolldown-native options while preserving the guarded Mermaid chunk and keeping shared Vite helpers compatible across workspace majors.

Model: gpt-5
@github-actions github-actions Bot added scope: desktop scope: components scope: repository status:needs-pr-body PR body does not meet the contribution template status:pr-too-large External PR over 200 changed lines needs a prior issue within seven days labels Aug 27, 2026
@github-actions github-actions Bot removed status:needs-pr-body PR body does not meet the contribution template status:pr-too-large External PR over 200 changed lines needs a prior issue within seven days labels Aug 29, 2026
@Leeeon233

Copy link
Copy Markdown
Contributor

Might the electron-vite 6 beta carry a risk of instability?

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.

[Feature Request] Upgrade the Electron build chain to Vite 8

2 participants