Upgrade client build to Vite 8 (Rolldown)#22145
Open
dannon wants to merge 4 commits intogalaxyproject:devfrom
Open
Upgrade client build to Vite 8 (Rolldown)#22145dannon wants to merge 4 commits intogalaxyproject:devfrom
dannon wants to merge 4 commits intogalaxyproject:devfrom
Conversation
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.
Member
|
Are the selenium and playwright tests related ? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
rollupOptions→rolldownOptions, converting the d3v3 pre-bundling compat plugin from esbuild's API to Rolldown's load hook, and swappingvite-tsconfig-pathsfor Vite 8's built-inresolve.tsconfigPaths. I had to addesbuildas an explicit devDep because@vitejs/plugin-vue2calls the now-deprecatedtransformWithEsbuildAPI — this bridge goes away when we complete the Vue 3 migration. LightningCSS is now the default CSS minifier, which requirederrorRecovery: trueto 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'sproxyWithRefUnwrap+@pinia/testing's WritableComputed plugin under Vite 8's module processing. This is test-environment-only (production Pinia handles it correctly). The test now triggershasChangesthrough 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 installcompletes without errorspnpm buildproduces correct output (libs.bundled.js, analysis.bundled.js, generic.bundled.js, base.css, manifest.json)pnpm test— 308 files, 1746 passed, 2 skippedpnpm eslint --quiet— clean