Skip to content

Upgrade client build to Vite 8 (Rolldown)#22145

Open
dannon wants to merge 4 commits intogalaxyproject:devfrom
dannon:vite8
Open

Upgrade client build to Vite 8 (Rolldown)#22145
dannon wants to merge 4 commits intogalaxyproject:devfrom
dannon:vite8

Conversation

@dannon
Copy link
Member

@dannon dannon commented Mar 17, 2026

Summary

Upgrades the client build from Vite 7 to Vite 8, which replaces the dual esbuild/Rollup architecture with Rolldown — a Rust-based bundler that implements the Rollup plugin API. Production builds drop from ~69s to ~16s (4.4x faster), and the test suite goes from ~69s to ~32s (2.1x faster).

The migration is mostly config-level: renaming rollupOptionsrolldownOptions, converting the d3v3 pre-bundling compat plugin from esbuild's API to Rolldown's load hook, and swapping vite-tsconfig-paths for Vite 8's built-in resolve.tsconfigPaths. I had to add esbuild as an explicit devDep because @vitejs/plugin-vue2 calls the now-deprecated transformWithEsbuild API — this bridge goes away when we complete the Vue 3 migration. LightningCSS is now the default CSS minifier, which required errorRecovery: true to handle pikaday's IE-era star property hacks.

One test needed adaptation: the workflow editor's "prevents navigation only if hasChanges" test called onChange() directly, which hit a subtle edge case with Vue 2.7's proxyWithRefUnwrap + @pinia/testing's WritableComputed plugin under Vite 8's module processing. This is test-environment-only (production Pinia handles it correctly). The test now triggers hasChanges through the name watcher instead, testing the same end-to-end behavior.

All 308 test files pass (1746 tests), ESLint is clean. Still needs manual verification of the dev server HMR and a production smoke test.

Test plan

  • pnpm install completes without errors
  • pnpm build produces correct output (libs.bundled.js, analysis.bundled.js, generic.bundled.js, base.css, manifest.json)
  • pnpm test — 308 files, 1746 passed, 2 skipped
  • pnpm eslint --quiet — clean
  • Manual: start dev server, verify HMR works
  • Manual: smoke test production build in Galaxy (workflow editor, d3 visualizations)

dannon added 3 commits March 16, 2026 21:53
Vite 8 replaces the dual esbuild/Rollup architecture with Rolldown, a
Rust-based bundler that implements the Rollup plugin API. Production
builds go from ~69s to ~16s on this codebase.

Adds esbuild as an explicit devDep because @vitejs/plugin-vue2 calls
the now-deprecated transformWithEsbuild API which requires it installed
separately. Removes the vite-tsconfig-paths plugin (replaced by Vite 8's
built-in resolve.tsconfigPaths) and the chokidar override (Vite 8 has
its own watcher stack). Adds pnpm peer dependency overrides for
plugin-vue2 and plugin-inject since neither declares Vite 8 / Rolldown
compatibility yet.
Renames build.rollupOptions to build.rolldownOptions and
optimizeDeps.esbuildOptions to optimizeDeps.rolldownOptions — both
auto-convert in Vite 8 but are deprecated. Rewrites the d3v3 IIFE
compat plugin for pre-bundling from esbuild's build.onLoad API to a
Rolldown load hook. Replaces the vite-tsconfig-paths plugin with Vite
8's built-in resolve.tsconfigPaths. Adds css.lightningcss.errorRecovery
since LightningCSS (now the default CSS minifier) chokes on pikaday's
IE-era star property hacks.
The "prevents navigation only if hasChanges" test called onChange()
directly, which sets this.hasChanges = true on the component instance.
With Vite 8, this no longer propagates through createTestingPinia's
store mutation tracking due to a subtle interaction between Vue 2.7's
proxyWithRefUnwrap, @pinia/testing's WritableComputed plugin, and the
new module processing. This is test-environment-only — production Pinia
handles the proxy setter correctly. Triggers hasChanges through the name
watcher instead, which tests the same end-to-end behavior.
Vite 8 removed the top-level "types" field from its package.json and
only declares types through the "exports" field. Since our tsconfig has
resolvePackageJsonExports: false (needed for Vue 2.7 compat), TypeScript
can't find the types. Adding an explicit path mapping, same pattern we
already use for fontawesome-common-types.
@dannon dannon marked this pull request as ready for review March 18, 2026 13:20
@dannon dannon changed the title WIP: Upgrade client build to Vite 8 (Rolldown) Upgrade client build to Vite 8 (Rolldown) Mar 18, 2026
@github-actions github-actions bot added this to the 26.1 milestone Mar 18, 2026
@mvdbeek
Copy link
Member

mvdbeek commented Mar 19, 2026

Are the selenium and playwright tests related ? test_user_address fails in both.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Needs Review

Development

Successfully merging this pull request may close these issues.

2 participants