Skip to content

feat: upgrade Vite 7 to Vite 8#23893

Merged
Artur- merged 15 commits into
mainfrom
feature/vite8
Mar 27, 2026
Merged

feat: upgrade Vite 7 to Vite 8#23893
Artur- merged 15 commits into
mainfrom
feature/vite8

Conversation

@Artur-
Copy link
Copy Markdown
Member

@Artur- Artur- commented Mar 16, 2026

Vite 8 replaces esbuild and Rollup with Rolldown (Rust-based bundler).

  • Bump vite to ^8.0.0 and @vitejs/plugin-react to ^6.0.0
  • Replace build.rollupOptions with build.rolldownOptions
  • Replace optimizeDeps.esbuildOptions (no longer needed, target already set in build.target)
  • Remove esbuild config (Rolldown preserves legal comments by default)
  • Remove manualChunks workaround (Rolldown handles CJS differently, the commonjsHelpers circular dependency workaround is not needed)
  • Replace RollupOutput with RolldownOutput in service worker plugin
  • Remove esbuild install.js from vaadin-dev-server install-deps script

Vite 8 replaces esbuild and Rollup with Rolldown (Rust-based bundler).

- Bump vite to ^8.0.0 and @vitejs/plugin-react to ^6.0.0
- Replace build.rollupOptions with build.rolldownOptions
- Replace optimizeDeps.esbuildOptions (no longer needed, target already
  set in build.target)
- Remove esbuild config (Rolldown preserves legal comments by default)
- Remove manualChunks workaround (Rolldown handles CJS differently,
  the commonjsHelpers circular dependency workaround is not needed)
- Replace RollupOutput with RolldownOutput in service worker plugin
- Remove esbuild install.js from vaadin-dev-server install-deps script
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 16, 2026

Test Results

 1 386 files  ±0   1 386 suites  ±0   1h 22m 35s ⏱️ - 4m 20s
 9 927 tests ±0   9 856 ✅ ±0  71 💤 ±0  0 ❌ ±0 
10 400 runs  ±0  10 320 ✅ ±0  80 💤 ±0  0 ❌ ±0 

Results for commit 843b91d. ± Comparison against base commit d877765.

♻️ This comment has been updated with latest results.

Rolldown does not guarantee ESM-spec module execution order by default,
which causes null reference errors ('_root') when Vaadin/Polymer
components are initialized out of order. This is triggered when
top-level await is present in the module graph.

Enable output.strictExecutionOrder to inject runtime helpers that
preserve correct initialization order at a slight bundle size cost.
@github-actions github-actions Bot added +1.0.0 and removed +0.0.1 labels Mar 16, 2026
Artur- added 2 commits March 17, 2026 08:55
Use separate @rolldown/plugin-babel for Babel transforms since
@vitejs/plugin-react v6 removed the babel option. Trim media query
in theme-util.js to avoid leading space in link elements. Accept
both quote styles in PWA service worker importScripts assertion
since Rolldown preserves single quotes unlike esbuild.
@github-actions github-actions Bot added +0.0.1 and removed +1.0.0 labels Mar 17, 2026
Artur- added 4 commits March 17, 2026 12:26
Add @babel/core and @rolldown/plugin-babel to expected dev
dependencies list in NodeUpdaterTest.
In v6, babel presets and plugins are top-level options instead of
nested under a 'babel' key. Removes unnecessary @rolldown/plugin-babel
dependency. Adds debug output to PwaTestIT to diagnose SW content.
Revert reactPlugin() back to original babel: nested format — the
v6 top-level babel options caused production build failures. The
babel option being silently ignored doesn't break existing tests.

Fix SW importScripts by using self.importScripts() so Rolldown
preserves it in IIFE bundles instead of dropping the bare global
call. Remove debug output from PwaTestIT.
@github-actions github-actions Bot added +1.0.0 and removed +0.0.1 labels Mar 18, 2026
Artur- added 2 commits March 18, 2026 07:21
@vitejs/plugin-react v6 uses OXC instead of Babel for JSX. Use
jsxImportSource option for custom JSX runtime. Add @rolldown/plugin-babel
for only the non-JSX babel plugins (function source location and
signals transform) without @babel/preset-react to avoid double
JSX transformation.
@github-actions github-actions Bot added +0.0.1 and removed +1.0.0 labels Mar 18, 2026
Rolldown uses backtick strings in its output, so checking for
specific quote styles doesn't work. Check for importScripts( and
the filename separately instead.
@Artur- Artur- marked this pull request as ready for review March 25, 2026 16:16
@sonarqubecloud
Copy link
Copy Markdown

@Artur- Artur- enabled auto-merge March 27, 2026 09:23
@Artur- Artur- added this pull request to the merge queue Mar 27, 2026
Merged via the queue into main with commit 482b350 Mar 27, 2026
31 checks passed
@Artur- Artur- deleted the feature/vite8 branch March 27, 2026 09:46
@vaadin-bot
Copy link
Copy Markdown
Collaborator

This ticket/PR has been released with Vaadin 25.2.0-beta1.

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.

3 participants