research: Update Vite configuration and plugins for Rolldown/OXC compatibility #71

Closed
opened 2026-04-26 16:46:26 +00:00 by icub3d · 0 comments
Owner

Migrated from GitHub issue icub3d/decentcom#104
Original Author: @icub3d
Original Date: 2026-04-19T18:45:53Z


Feature: Update Vite configuration and plugins for Rolldown/OXC compatibility

Overview

Update the client's Vite configuration to address deprecation warnings and adopt the recommended transition path to Rolldown/OXC. This includes switching to the OXC-based React plugin for improved performance and updating configuration options that have been deprecated in favor of their Rolldown equivalents.

Background

Vite is transitioning its internal bundling and transformation logic to use Rolldown and OXC. The development logs currently show several deprecation warnings:

  1. esbuild option in vite:react-babel is deprecated in favor of oxc.
  2. optimizeDeps.rollupOptions is deprecated in favor of optimizeDeps.rolldownOptions.
  3. Recommendation to switch from @vitejs/plugin-react to @vitejs/plugin-react-oxc.

Note on Implementation

Research revealed that @vitejs/plugin-react-oxc (latest: 0.4.3) only supports Vite ^6.3.0 || ^7.0.0 and is incompatible with Vite 8, which this project already uses. With Vite 8, @vitejs/plugin-react@6.x is the correct plugin — it is the Vite 8-native version that uses Rolldown/OXC internally and replaces the older Babel-based pipeline. The OXC plugin was the "future default" for Vite 6/7 era; with Vite 8 it was merged back into the main plugin.

Requirements

  • Transition from @vitejs/plugin-react 4.x to 6.x (Vite 8 / Rolldown/OXC native).
  • Address all Vite deprecation warnings related to Rolldown/OXC.
  • Ensure development server and production builds remain stable.
  • Verify that Vitest continues to work correctly with the new configuration.

Design

Component Changes

  • client/package.json: Swap dependencies and update scripts if necessary.
  • client/vite.config.ts: Update plugin imports and configuration structure.

Task List

  • Research the specific version requirements for @vitejs/plugin-react-oxc and compatible Vite versions.
  • Install @vitejs/plugin-react@6.x (Vite 8 compatible replacement) and remove @vitejs/plugin-react@4.x.
  • Update vite.config.ts to use the new plugin and migrate optimizeDeps options. (No changes needed — optimizeDeps wasn't configured, and the plugin API is identical.)
  • Resolve any conflicts with @tailwindcss/vite. (None — works cleanly.)
  • Verify build performance and stability.

Test List

  • Run pnpm dev and verify the console is free of deprecation warnings.
  • Run pnpm build to ensure production assets generate correctly. (Vite bundling works; pre-existing TS type errors in tsc are unrelated to this issue.)
  • Run pnpm test to ensure Vitest integration is unaffected. (89/89 tests pass.)
  • Perform manual smoke test of the UI in the Tauri development environment.

Open Questions

  • Does @vitejs/plugin-react-oxc fully support all React 19 features used in the project? Moot — using @vitejs/plugin-react@6.x instead, which is Vite 8 native.
  • Are there any specific configuration nuances when using OXC with Tauri v2's dev server? None observed.
**Migrated from GitHub issue icub3d/decentcom#104** **Original Author:** @icub3d **Original Date:** 2026-04-19T18:45:53Z --- # Feature: Update Vite configuration and plugins for Rolldown/OXC compatibility ## Overview Update the client's Vite configuration to address deprecation warnings and adopt the recommended transition path to Rolldown/OXC. This includes switching to the OXC-based React plugin for improved performance and updating configuration options that have been deprecated in favor of their Rolldown equivalents. ## Background Vite is transitioning its internal bundling and transformation logic to use Rolldown and OXC. The development logs currently show several deprecation warnings: 1. `esbuild` option in `vite:react-babel` is deprecated in favor of `oxc`. 2. `optimizeDeps.rollupOptions` is deprecated in favor of `optimizeDeps.rolldownOptions`. 3. Recommendation to switch from `@vitejs/plugin-react` to `@vitejs/plugin-react-oxc`. ## Note on Implementation Research revealed that `@vitejs/plugin-react-oxc` (latest: 0.4.3) only supports Vite `^6.3.0 || ^7.0.0` and is incompatible with Vite 8, which this project already uses. With Vite 8, `@vitejs/plugin-react@6.x` is the correct plugin — it is the Vite 8-native version that uses Rolldown/OXC internally and replaces the older Babel-based pipeline. The OXC plugin was the "future default" for Vite 6/7 era; with Vite 8 it was merged back into the main plugin. ## Requirements - [x] Transition from `@vitejs/plugin-react` 4.x to 6.x (Vite 8 / Rolldown/OXC native). - [x] Address all Vite deprecation warnings related to Rolldown/OXC. - [x] Ensure development server and production builds remain stable. - [x] Verify that Vitest continues to work correctly with the new configuration. ## Design ### Component Changes - **`client/package.json`**: Swap dependencies and update scripts if necessary. - **`client/vite.config.ts`**: Update plugin imports and configuration structure. ## Task List - [x] Research the specific version requirements for `@vitejs/plugin-react-oxc` and compatible Vite versions. - [x] Install `@vitejs/plugin-react@6.x` (Vite 8 compatible replacement) and remove `@vitejs/plugin-react@4.x`. - [x] Update `vite.config.ts` to use the new plugin and migrate `optimizeDeps` options. (No changes needed — `optimizeDeps` wasn't configured, and the plugin API is identical.) - [x] Resolve any conflicts with `@tailwindcss/vite`. (None — works cleanly.) - [x] Verify build performance and stability. ## Test List - [x] Run `pnpm dev` and verify the console is free of deprecation warnings. - [x] Run `pnpm build` to ensure production assets generate correctly. (Vite bundling works; pre-existing TS type errors in `tsc` are unrelated to this issue.) - [x] Run `pnpm test` to ensure Vitest integration is unaffected. (89/89 tests pass.) - [ ] Perform manual smoke test of the UI in the Tauri development environment. ## Open Questions - Does `@vitejs/plugin-react-oxc` fully support all React 19 features used in the project? **Moot — using `@vitejs/plugin-react@6.x` instead, which is Vite 8 native.** - Are there any specific configuration nuances when using OXC with Tauri v2's dev server? **None observed.**
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
icub3d/decentcom#71
No description provided.