Conversation
commit: |
nuxt-root with upstreambdaa99c to
994d079
Compare
994d079 to
6eeb862
Compare
📝 WalkthroughWalkthroughBumps dependency versions across repo and examples (Nuxt 4.3.1→4.4.2, Vitest 4.0.18→4.1.0, Vite 7.3.1→8.0.0, std-env 3.10.0→4.0.0, etc.). Adds two Nitro API endpoints (GET/POST) at examples/nitro-v3/server/api/echo.* and corresponding e2e Vitest tests and project renaming to "e2e". Refactors the Vitest mock plugin transform into an inline Vite Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
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 |
examples/nitro-v3/package.json
Outdated
| "h3": "^2.0.1-rc.14", | ||
| "nitro": "https://pkg.pr.new/nitrojs/nitro@00598a8", | ||
| "nuxt": "https://pkg.pr.new/nuxt@33005" | ||
| "nuxt": "^4.4.2" |
There was a problem hiding this comment.
maybe we could use a new pkg.pr.new version for the latest commit to main?
There was a problem hiding this comment.
thanks for the reviews as always.
it seems like we need to upgrade to vite8 for the latest nuxt main. does that sound right?
There was a problem hiding this comment.
the pkg.pr.new version has been updated to the latest commit on main.
it did not work with vite7, so the vite8 upgrade from the Renovate PR was included.
this reproduced the issue reported in #1591, which has now been addressed with a fix.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@package.json`:
- Line 129: Update the Vite 8 migration by replacing any esbuild-related
configuration and APIs in src/e2e/run.ts: locate usages of
transformWithEsbuild() and any esbuild/ build settings and change them to
transformWithOxc() and oxcOptions respectively; update the object keys passed to
the Vite config (replace esbuild/ build.esbuild options with oxc/oxcOptions) and
ensure any transformWithEsbuild-specific options are adapted to the Oxc
equivalents, adjusting imports and types as needed so Vitest/vite-node continue
to work with the Rolldown+Oxc toolchain.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: f9973f74-d013-4950-bb15-425f3ee23db3
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (4)
examples/app-playwright/package.jsonexamples/nitro-v3/package.jsonexamples/nitro-v3/test/nuxt/fetch.spec.tspackage.json
🚧 Files skipped from review as they are similar to previous changes (1)
- examples/nitro-v3/package.json
| "unbuild": "latest", | ||
| "unimport": "6.0.0", | ||
| "vite": "7.3.1", | ||
| "vite": "8.0.0", |
There was a problem hiding this comment.
🧩 Analysis chain
🌐 Web query:
Vite 8 release notes breaking changes
💡 Result:
Key Vite 8 breaking changes / migration notes (from the official v7→v8 migration guide):
- New default browser target (
build.target: 'baseline-widely-available') bumped to newer baseline versions (Chrome/Edge 111, Firefox 114, Safari 16.4). If you rely on older targets, setbuild.targetexplicitly. [1] - Bundler/toolchain swap: Vite 8 moves from the esbuild+Rollup split to Rolldown (bundling/dep-optimizer) + Oxc (JS transforms/minify). This can change edge-case build behavior. [1][2]
- Dep optimization now uses Rolldown:
optimizeDeps.esbuildOptionsis deprecated in favor ofoptimizeDeps.rolldownOptions(a compatibility layer auto-converts some options). [1] - Transforms/minification by Oxc; esbuild becomes optional:
esbuildconfig is deprecated in favor ofoxc(auto-converted where possible). [1]esbuildis no longer a direct dependency; if you (or a plugin) usetransformWithEsbuild, you must addesbuildas a devDependency;transformWithEsbuildis deprecated in favor oftransformWithOxc. [1]- Minification defaults to Oxc;
build.minify: 'esbuild'is deprecated and requires installingesbuild. [1]
- Resolution/interop behavior changes:
- Removed “format sniffing” heuristic when both
browserandmodulefields exist; Vite now respectsresolve.mainFieldsorder. [1] - Preserves
require()for externalized modules (no longer rewritten toimport), with an opt-in plugin if you want conversion. [1]
- Removed “format sniffing” heuristic when both
- Output / Rollup-compat removals & deprecations:
import.meta.urlis no longer polyfilled for UMD/IIFE output (replaced withundefinedby default). [1]- Removed
build.rollupOptions.watch.chokidar. [1] build.rollupOptions.output.manualChunksobject form removed; function form deprecated in favor of RolldowncodeSplitting. [1]- Deprecated
build.rollupOptions/worker.rollupOptionsin favor ofbuild.rolldownOptions/worker.rolldownOptions(and some other related options become no-ops). [1]
- Removed deprecated feature: passing a URL to
import.meta.hot.acceptis no longer supported (pass an id instead). [1] - Dropped/limited support due to Rolldown: no
system/amdoutput formats, no ES5-and-below via@vitejs/plugin-legacy, and some Rollup hooks/features aren’t supported. [1]
Sources: Official Vite 8 beta announcement and migration guide. [1][2]
🏁 Script executed:
# First, read the package.json to see the full context around lines 129 and 184-185
wc -l package.jsonRepository: nuxt/test-utils
Length of output: 75
🏁 Script executed:
# Read the relevant sections of package.json
sed -n '120,145p' package.jsonRepository: nuxt/test-utils
Length of output: 739
🏁 Script executed:
# Also check lines 175-195 to see vite-node
sed -n '175,195p' package.jsonRepository: nuxt/test-utils
Length of output: 504
🏁 Script executed:
# Check if Vitest, Nuxt, or vite-node are in use
grep -E "(vitest|nuxt|vite-node)" package.jsonRepository: nuxt/test-utils
Length of output: 1136
🏁 Script executed:
# Check for vite config files
fd -e js -e ts -e mjs -e mts | grep -E "(vite|vitest|nuxt)\.config"Repository: nuxt/test-utils
Length of output: 1346
🏁 Script executed:
# Search for esbuild usage in the codebase
rg "transformWithEsbuild|esbuild" --type js --type tsRepository: nuxt/test-utils
Length of output: 90
🏁 Script executed:
# Check the esbuild usage in src/e2e/run.ts
cat -n src/e2e/run.ts | grep -B 5 -A 10 "esbuild:"Repository: nuxt/test-utils
Length of output: 474
🏁 Script executed:
# Check for any vite.config or vitest.config at root level
fd "(vite|vitest)\.config" -d 2Repository: nuxt/test-utils
Length of output: 41
🏁 Script executed:
# Check for transformWithEsbuild usage anywhere
rg "transformWithEsbuild" --type ts --type jsRepository: nuxt/test-utils
Length of output: 41
🏁 Script executed:
# Look at the broader context of the esbuild config in src/e2e/run.ts
cat -n src/e2e/run.ts | sed -n '35,75p'Repository: nuxt/test-utils
Length of output: 1097
🏁 Script executed:
# Check if esbuild is a direct dependency (which is no longer the case in Vite 8)
grep -E '"esbuild"' package.jsonRepository: nuxt/test-utils
Length of output: 41
🏁 Script executed:
# Search for any transformWithEsbuild usage
rg "transformWithEsbuild|transformWithOxc" --type ts --type jsRepository: nuxt/test-utils
Length of output: 41
Migrate esbuild config to oxc in Vite 8.
The Vite 8 upgrade affects this Nuxt/Vitest project. The esbuild config option in src/e2e/run.ts (lines 48–50) is deprecated in Vite 8; use oxc instead. Vitest 4.0.18 and vite-node 6.0.0 are compatible with Vite 8, but the toolchain shift from esbuild+Rollup to Rolldown+Oxc requires configuration updates. Review the esbuild config for any transformWithEsbuild() calls (deprecated in favor of transformWithOxc()) and ensure oxcOptions replaces deprecated build/esbuild settings.
Also applies to: 184-185
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@package.json` at line 129, Update the Vite 8 migration by replacing any
esbuild-related configuration and APIs in src/e2e/run.ts: locate usages of
transformWithEsbuild() and any esbuild/ build settings and change them to
transformWithOxc() and oxcOptions respectively; update the object keys passed to
the Vite config (replace esbuild/ build.esbuild options with oxc/oxcOptions) and
ensure any transformWithEsbuild-specific options are adapted to the Oxc
equivalents, adjusting imports and types as needed so Vitest/vite-node continue
to work with the Rolldown+Oxc toolchain.
bc1f877 to
c241655
Compare
c241655 to
760f8da
Compare
🔗 Linked issue
resolves #1591
📚 Description
this PR updates nuxt v4.4.2 and fixes ci failures.
callHookWithwas changed from rest parameters to an array, it is a concern in cases wherebeforeEachorafterEachare registered in previous versions.(
'vue:setup'is void, it might not be a problem...)temporarily changed nuxt v4.4.2 in nitro-v3 examplescould you please review this at your convenience 🙏