Skip to content

chore(site): upgrade to Vite 8 - #23485

Merged
DanielleMaywood merged 1 commit into
mainfrom
danielle/vite-8-upgrade
Apr 1, 2026
Merged

DanielleMaywood merged 1 commit into
mainfrom
danielle/vite-8-upgrade

Conversation

@DanielleMaywood

@DanielleMaywood DanielleMaywood commented Mar 24, 2026 •

Copy link
Copy Markdown
Collaborator

🤖 This PR was written by Coder Agent on behalf of Danielle Maywood 🤖

Summary

Upgrade the frontend build toolchain to Vite 8, which replaces the dual esbuild+Rollup pipeline with the unified Rolldown bundler.

Package changes

Package Before After
vite 7.2.6 8.0.2
@vitejs/plugin-react 5.1.1 6.0.1
vitest 4.0.14 4.1.1
@vitest/browser-playwright 4.0.14 4.1.1
vite-plugin-checker 0.11.0 0.12.0
rollup-plugin-visualizer 5.14.0 7.0.1
@storybook/* 10.2.10 10.3.3
@rolldown/plugin-babel — 0.2.2 (new)

Config changes

  • Rename build.rollupOptions to build.rolldownOptions.
  • Migrate deprecated manualChunks to Rolldown codeSplitting.groups.
  • Migrate @vitejs/plugin-react inline babel option to standalone @rolldown/plugin-babel with reactCompilerPreset. Babel was removed as a dependency in plugin-react v6; the react-compiler integration now runs as a separate Rolldown plugin.
  • Work around a Rolldown minification bug where rest elements in module-level array destructuring (const [first, ...rest] = arr) don't get properly declared as variables.

Build performance

Measured on the same machine, back-to-back, three runs each.

End-to-end production build (includes vite-plugin-checker TypeScript checking):

Vite 7.2.6 Vite 8.0.2
Cold ~49s ~41s
Warm ~49s ~22s
Speedup — ~2.2x

Bundler-only (checker disabled, isolates Rollup→Rolldown improvement):

Vite 7 (Rollup) Vite 8 (Rolldown)
Warm ~48s ~11s
Speedup — ~4.4x

The gap between the bundler-only and end-to-end numbers comes from two sources:

  1. @rolldown/plugin-babel adds ~8s running babel-plugin-react-compiler on src/pages/AgentsPage/. This is the cost of migrating from the old inline babel option (which ran inside plugin-react's own transform pipeline) to a standalone Rolldown babel plugin. As more of the codebase opts into the compiler, this cost will grow, but it can be mitigated by narrowing the filter or by switching to the SWC-based compiler plugin when available.
  2. vite-plugin-checker runs TypeScript in a worker thread during the build. On Vite 7, the ~48s Rollup bundling dominated so the checker finished for free; on Vite 8, the bundler finishes in ~11s and then waits for the checker, adding ~3s of visible overhead.

@github-actions github-actions Bot added the community Pull Requests and issues created by the community. label Mar 24, 2026
@matifali matifali removed the community Pull Requests and issues created by the community. label Mar 24, 2026
Comment on lines -70 to 78
const [first, ...others] = WorkspaceTimingsResponse.agent_script_timings;
const failedScriptTimings = WorkspaceTimingsResponse.agent_script_timings;
export const FailedScript: Story = {
args: {
agentScriptTimings: [
{ ...first, status: "exit_failure", exit_code: 1 },
...others,
{ ...failedScriptTimings[0], status: "exit_failure", exit_code: 1 },
...failedScriptTimings.slice(1),
],
},
};

@DanielleMaywood DanielleMaywood Mar 24, 2026 •

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Something in the dependency chain is unable to handle const [first, ...others] = WorkspaceTimingsResponse.agent_script_timings;. Unfortunately it generates invalid code

@DanielleMaywood
DanielleMaywood force-pushed the danielle/vite-8-upgrade branch 6 times, most recently from ea45fc7 to 8ae16b5 Compare April 1, 2026 14:37
Upgrade the frontend build toolchain to Vite 8, which replaces the
dual esbuild+Rollup pipeline with the unified Rolldown bundler.

Package changes:
- vite 7.2.6 → 8.0.2
- @vitejs/plugin-react 5.1.1 → 6.0.1
- vitest 4.0.14 → 4.1.1
- @vitest/browser-playwright 4.0.14 → 4.1.1
- vite-plugin-checker 0.11.0 → 0.12.0
- rollup-plugin-visualizer 5.14.0 → 7.0.1
- @storybook/* 10.2.10 → 10.3.3

Config changes:
- Rename build.rollupOptions to build.rolldownOptions
- Migrate manualChunks to codeSplitting.groups

Production build time drops from ~56s to ~12s (~4.8x faster).
@DanielleMaywood
DanielleMaywood force-pushed the danielle/vite-8-upgrade branch from 8ae16b5 to affc30b Compare April 1, 2026 14:42

@jakehwll jakehwll left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Script available on-request but this seems to be doing things faster and more consistently 🙂

% pnpm run bench:vite-upgrade -- --base main --candidate danielle/vite-8-upgrade --runs 5 --warmups 1

> coder@0.0.0 bench:vite-upgrade /home/coder/coder
> node scripts/benchmark-vite-upgrade.mjs -- --base main --candidate danielle/vite-8-upgrade --runs 5 --warmups 1

Vite upgrade benchmark
repo: /home/coder/coder
base: main
candidate: danielle/vite-8-upgrade
runs: 5, warmups: 1
install: yes
temp worktree root: /tmp/vite-upgrade-bench-ZMvt6Z

[base:main] pnpm install --frozen-lockfile
[base:main] warmup 1/1: 49212.3ms
[base:main] run 1/5: 46274.3ms, 134.65 MiB
[base:main] run 2/5: 74953.8ms, 134.65 MiB
[base:main] run 3/5: 69332.3ms, 134.65 MiB
[base:main] run 4/5: 48958.7ms, 134.65 MiB
[base:main] run 5/5: 43710.6ms, 134.65 MiB

[candidate:danielle/vite-8-upgrade] pnpm install --frozen-lockfile
[candidate:danielle/vite-8-upgrade] warmup 1/1: 35982.2ms
[candidate:danielle/vite-8-upgrade] run 1/5: 16879.2ms, 133.44 MiB
[candidate:danielle/vite-8-upgrade] run 2/5: 16820.8ms, 133.44 MiB
[candidate:danielle/vite-8-upgrade] run 3/5: 16368.9ms, 133.44 MiB
[candidate:danielle/vite-8-upgrade] run 4/5: 16698.7ms, 133.44 MiB
[candidate:danielle/vite-8-upgrade] run 5/5: 16406.3ms, 133.44 MiB

Base (main)
  avg build time: 56645.9ms
  min/max build time: 43710.6ms / 74953.8ms
  avg output size: 134.65 MiB
  min/max output size: 134.65 MiB / 134.65 MiB

Candidate (danielle/vite-8-upgrade)
  avg build time: 16634.8ms
  min/max build time: 16368.9ms / 16879.2ms
  avg output size: 133.44 MiB
  min/max output size: 133.44 MiB / 133.44 MiB

Delta (candidate - base)
  build time: -40011.2ms (-70.63%)
  output size: -1.21 MiB (-0.90%)

@DanielleMaywood
DanielleMaywood marked this pull request as ready for review April 1, 2026 15:04
@DanielleMaywood
DanielleMaywood enabled auto-merge (squash) April 1, 2026 15:06
@DanielleMaywood
DanielleMaywood merged commit 2806286 into main Apr 1, 2026
47 of 51 checks passed
@DanielleMaywood
DanielleMaywood deleted the danielle/vite-8-upgrade branch April 1, 2026 15:11
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 1, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants