chore(deps): upgrade vite to v8 with required migration#275
Conversation
WalkthroughUpdated the build bundler options configuration key in Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~1 minute 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…Vite 8 Vite 8 replaces Rollup with Rolldown as the bundler. The config key is deprecated in v8 and will be removed in a future version. Renames to to align with the Vite 8 migration guide: https://vite.dev/guide/migration#other-related-deprecations
fbeb894 to
b4196ae
Compare
There was a problem hiding this comment.
🧹 Nitpick comments (1)
vite.config.ts (1)
38-61: Migrate the warning handler from the deprecatedonwarnto Rolldown's currentonLogAPI.
build.rolldownOptionsis the correct Vite 8 key, but the warning handler still usesonwarn, which is deprecated in Rolldown. Since this PR is already updating to Vite 8/Rolldown, switching toonLognow avoids technical debt later.♻️ Proposed refactor
- onwarn(warning, warn) { + onLog(level, warning, defaultHandler) { // Ignore warnings about react-router-dom being external if ( + level === "warn" && warning.code === "UNRESOLVED_IMPORT" && warning.message?.includes("react-router-dom") ) { return; } - warn(warning); + defaultHandler(level, warning); },🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@vite.config.ts` around lines 38 - 61, Replace the deprecated onwarn handler in build.rolldownOptions with Rolldown's onLog API: change onwarn(warning, warn) to onLog(log, warn) and update references to use log (e.g., log.code and log.message) instead of warning; keep the same filtering logic (if log.code === "UNRESOLVED_IMPORT" && log.message?.includes("react-router-dom") return) and call the provided warn(log) for all other cases so unresolved-import warnings for react-router-dom are suppressed while other logs are forwarded.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@vite.config.ts`:
- Around line 38-61: Replace the deprecated onwarn handler in
build.rolldownOptions with Rolldown's onLog API: change onwarn(warning, warn) to
onLog(log, warn) and update references to use log (e.g., log.code and
log.message) instead of warning; keep the same filtering logic (if log.code ===
"UNRESOLVED_IMPORT" && log.message?.includes("react-router-dom") return) and
call the provided warn(log) for all other cases so unresolved-import warnings
for react-router-dom are suppressed while other logs are forwarded.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 966d6d68-37e5-4e6d-b42d-79d7808dfcee
⛔ Files ignored due to path filters (2)
package.jsonis excluded by!**/*.jsonpnpm-lock.yamlis excluded by!**/pnpm-lock.yaml,!**/*.yaml
📒 Files selected for processing (1)
vite.config.ts
Summary
Upgrades Vite from v7 to v8 and
@vitejs/plugin-reactfrom v5 to v6, with the required migration changes to keep the codebase aligned with the new API.Changes
vite:^7.0.0→^8.0.0- Vite 8 ships Rolldown as the default bundler.build.rollupOptions→build.rolldownOptionsinvite.config.ts(required by Vite 8 / Rolldown).@vitejs/plugin-react:^5.0.0→^6.0.0- v6 drops Babel and requires Vite 8+.react()with no options, so the removed Babel integration has no effect.Related PRs
Supersedes / replaces Renovate PRs:
Both are bundled here because
@vitejs/plugin-reactv6 has a hard peer dependency onvite: "^8.0.0"- they must land together.