Skip to content

feat(vite)!: migrate to Vite 8#34256

Merged
danielroe merged 42 commits intomainfrom
feat/vite-8
Mar 8, 2026
Merged

feat(vite)!: migrate to Vite 8#34256
danielroe merged 42 commits intomainfrom
feat/vite-8

Conversation

@danielroe
Copy link
Copy Markdown
Member

@danielroe danielroe commented Feb 6, 2026

this is an initial PR to update to Vite 8 for testing with the migration guide: https://main.vite.dev/guide/migration

we can ideally remove vite-node in the v5 branch in favour of the vite environment api, but until then it has a dependency on vite 7 which may pose issues when testing this.

@bolt-new-by-stackblitz
Copy link
Copy Markdown

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@coderabbitai

This comment has been minimized.

@danielroe danielroe force-pushed the feat/vite-8 branch 2 times, most recently from 3247206 to a64abc0 Compare February 6, 2026 12:39
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Feb 6, 2026

Open in StackBlitz

@nuxt/kit

npm i https://pkg.pr.new/@nuxt/kit@34256

@nuxt/nitro-server

npm i https://pkg.pr.new/@nuxt/nitro-server@34256

nuxt

npm i https://pkg.pr.new/nuxt@34256

@nuxt/rspack-builder

npm i https://pkg.pr.new/@nuxt/rspack-builder@34256

@nuxt/schema

npm i https://pkg.pr.new/@nuxt/schema@34256

@nuxt/vite-builder

npm i https://pkg.pr.new/@nuxt/vite-builder@34256

@nuxt/webpack-builder

npm i https://pkg.pr.new/@nuxt/webpack-builder@34256

commit: 2777450

@danielroe danielroe marked this pull request as draft February 6, 2026 12:44
@socket-security
Copy link
Copy Markdown

socket-security bot commented Feb 6, 2026

All alerts resolved. Learn more about Socket for GitHub.

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

View full report

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Feb 6, 2026

Merging this PR will improve performance by ×3.4

⚡ 1 improved benchmark
✅ 19 untouched benchmarks
⏩ 3 skipped benchmarks1

Performance Changes

Benchmark BASE HEAD Efficiency
initial production build in the minimal test fixture 3.6 s 1.1 s ×3.4

Comparing feat/vite-8 (ca69dfb) with main (25b61ad)

Open in CodSpeed

Footnotes

  1. 3 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@danielroe danielroe changed the title feat(vite): migrate to Vite 8 feat(vite)!: migrate to Vite 8 Feb 24, 2026
@danielroe danielroe force-pushed the feat/vite-8 branch 3 times, most recently from b558580 to d031749 Compare February 24, 2026 16:31
@danielroe danielroe marked this pull request as ready for review February 24, 2026 20:54
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

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 `@test/bundle.test.ts`:
- Around line 126-130: The test blindly updated the inline snapshot without
investigating a 104k regression; use
analyzeSizes/serverStats/modules/roundToKilobytes with serverDir to reproduce
both builds (one using rollupOptions and one using rolldownOptions) and compare
their output and module lists to find duplicated or unexpectedly large modules;
specifically run Rolldown with verbose/detailed reporting or enable source-map
analysis to inspect chunking and transitive deps, check for duplicated imports
or lack of dedupe/treeshake (e.g., compare the module list returned by
analyzeSizes and search for repeated module IDs or multiple copies of the same
package such as perfect-debounce), and only update the snapshot after confirming
the cause (fix bundler config—restore dedupe/treeshake/rollupOptions behavior or
adjust rolldownOptions) or documenting why the size increase is expected.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 2c7d6552-27e9-4acb-89c6-aa9f8e9a443b

📥 Commits

Reviewing files that changed from the base of the PR and between f1f727c and c19f713.

📒 Files selected for processing (3)
  • packages/nuxt/test/component-loader.test.ts
  • packages/nuxt/test/virtual.test.ts
  • test/bundle.test.ts

Comment on lines 126 to +130
const serverStats = await analyzeSizes(['**/*.mjs', '!node_modules'], serverDir)
expect.soft(roundToKilobytes(serverStats.totalBytes)).toMatchInlineSnapshot(`"300k"`)
expect.soft(roundToKilobytes(serverStats.totalBytes)).toMatchInlineSnapshot(`"404k"`)

const modules = await analyzeSizes(['node_modules/**/*'], serverDir)
expect.soft(roundToKilobytes(modules.totalBytes)).toMatchInlineSnapshot(`"1452k"`)
expect.soft(roundToKilobytes(modules.totalBytes)).toMatchInlineSnapshot(`"1455k"`)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

cd test && find . -name "bundle.test.ts" | head -20

Repository: nuxt/nuxt

Length of output: 69


🏁 Script executed:

cat -n test/bundle.test.ts | sed -n '100,150p'

Repository: nuxt/nuxt

Length of output: 2213


🏁 Script executed:

git log --oneline -20 -- test/bundle.test.ts

Repository: nuxt/nuxt

Length of output: 85


🏁 Script executed:

git show c19f7135:test/bundle.test.ts | sed -n '123,145p'

Repository: nuxt/nuxt

Length of output: 961


🏁 Script executed:

git show c19f7135~1:test/bundle.test.ts | sed -n '123,145p'

Repository: nuxt/nuxt

Length of output: 93


🏁 Script executed:

rg "perfect-debounce" --type ts --type js --type json

Repository: nuxt/nuxt

Length of output: 630


🏁 Script executed:

git log --oneline -30 -- package.json | head -20

Repository: nuxt/nuxt

Length of output: 85


🏁 Script executed:

git diff c19f7135~0 c19f7135 -- test/bundle.test.ts | head -100

Repository: nuxt/nuxt

Length of output: 35


🏁 Script executed:

git log --oneline --all -- test/bundle.test.ts | head -20

Repository: nuxt/nuxt

Length of output: 1508


🏁 Script executed:

git show c19f7135 --stat

Repository: nuxt/nuxt

Length of output: 50365


🏁 Script executed:

git log --oneline -50 -- test/bundle.test.ts | grep -i "snapshot\|bundle\|size"

Repository: nuxt/nuxt

Length of output: 85


🏁 Script executed:

git show HEAD:test/bundle.test.ts 2>/dev/null | sed -n '123,145p'

Repository: nuxt/nuxt

Length of output: 961


🏁 Script executed:

cat -n test/bundle.test.ts | sed -n '1,50p'

Repository: nuxt/nuxt

Length of output: 2618


🏁 Script executed:

find test/fixtures/minimal-pages -name "package.json" -o -name "nuxt.config.ts" | head -10

Repository: nuxt/nuxt

Length of output: 136


🏁 Script executed:

cat -n test/bundle.test.ts | sed -n '132,180p'

Repository: nuxt/nuxt

Length of output: 1719


🏁 Script executed:

git log --oneline -100 -- packages/nuxt/package.json | head -20

Repository: nuxt/nuxt

Length of output: 85


🏁 Script executed:

git log --oneline -p -- packages/nuxt/package.json | grep -A5 -B5 "perfect-debounce" | head -50

Repository: nuxt/nuxt

Length of output: 365


🏁 Script executed:

cat test/fixtures/minimal-pages/package.json

Repository: nuxt/nuxt

Length of output: 250


🏁 Script executed:

cat test/fixtures/minimal-pages/nuxt.config.ts

Repository: nuxt/nuxt

Length of output: 748


🏁 Script executed:

git log --all --oneline -- test/bundle.test.ts

Repository: nuxt/nuxt

Length of output: 7735


🏁 Script executed:

git reflog | head -20

Repository: nuxt/nuxt

Length of output: 176


🏁 Script executed:

git show 157e42be:test/bundle.test.ts | sed -n '123,160p'

Repository: nuxt/nuxt

Length of output: 1181


🏁 Script executed:

git log --all --oneline -p -- packages/nuxt/package.json | grep -B20 "perfect-debounce" | head -60

Repository: nuxt/nuxt

Length of output: 1796


🏁 Script executed:

git show 157e42be --stat | head -50

Repository: nuxt/nuxt

Length of output: 1163


🏁 Script executed:

git log 157e42be..c19f7135 --oneline

Repository: nuxt/nuxt

Length of output: 85


🏁 Script executed:

git diff 157e42be c19f7135 -- test/fixtures/minimal-pages/nuxt.config.ts

Repository: nuxt/nuxt

Length of output: 563


🏁 Script executed:

git show 157e42be:test/bundle.test.ts | sed -n '136,159p'

Repository: nuxt/nuxt

Length of output: 550


🏁 Script executed:

git diff 157e42be c19f7135 -- packages/nuxt/src | wc -l

Repository: nuxt/nuxt

Length of output: 54


🏁 Script executed:

git diff --stat 157e42be c19f7135 -- packages/nuxt/src | head -30

Repository: nuxt/nuxt

Length of output: 35


Investigate the root cause of the 104 kilobyte non-node_modules budget regression before accepting this snapshot update.

The bundle size increased from 300k to 404k, and whilst perfect-debounce was added to the bundle, this small utility library alone does not account for a 104 kilobyte jump. The configuration change from rollupOptions to rolldownOptions (Rolldown bundler) suggests the build system may be duplicating code or applying different chunking strategies. This test must verify the regression source rather than bless it—please confirm whether Rolldown is creating duplicate modules or if transitive dependencies are unexpectedly inflating the bundle.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@test/bundle.test.ts` around lines 126 - 130, The test blindly updated the
inline snapshot without investigating a 104k regression; use
analyzeSizes/serverStats/modules/roundToKilobytes with serverDir to reproduce
both builds (one using rollupOptions and one using rolldownOptions) and compare
their output and module lists to find duplicated or unexpectedly large modules;
specifically run Rolldown with verbose/detailed reporting or enable source-map
analysis to inspect chunking and transitive deps, check for duplicated imports
or lack of dedupe/treeshake (e.g., compare the module list returned by
analyzeSizes and search for repeated module IDs or multiple copies of the same
package such as perfect-debounce), and only update the snapshot after confirming
the cause (fix bundler config—restore dedupe/treeshake/rollupOptions behavior or
adjust rolldownOptions) or documenting why the size increase is expected.

@danielroe danielroe merged commit c6ed807 into main Mar 8, 2026
50 checks passed
@danielroe danielroe deleted the feat/vite-8 branch March 8, 2026 01:18
This was referenced Mar 8, 2026
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.

2 participants