chore(deps-dev): bump vite from 7.3.3 to 8.2.1 - #1126
Conversation
Vite 8 replaces Rollup and esbuild with Rolldown and Oxc, which is a breaking change for the build configuration of the three vite examples. Migrate the example configurations: - `build.rollupOptions` becomes `build.rolldownOptions`. - The object form of `output.manualChunks` no longer exists. It is replaced by `output.codeSplitting.groups`, and not by `output.advancedChunks` which is already deprecated in the Rolldown version bundled with Vite 8. - A group captures modules by matching their id, whereas the removed object form matched a package name. As Vite resolves symlinks to their real path, the ids of `@maxgraph/core` point to the workspace directory and never to `node_modules`, so the configurations resolve the package directory instead of matching the package name. This keeps the `maxgraph` chunk correct both in this repository and for a standalone consumer. Two dependencies have to be bumped along with vite, they are not optional: - Storybook, because `@storybook/builder-vite` only accepts vite 8 from 10.3 onwards. - `@types/node`, because Storybook 10.5 pulls an optional `vite-plus` and `vitest` peer chain that requires `@types/node` 20 or later, which made the install unresolvable with the former `^18` range. Version 24 also aligns with the version declared in `.nvmrc`. The lockfile is updated surgically rather than regenerated. A full regeneration drifts `@types/react` to 19, whose types drop the global `JSX` namespace, which breaks the `tsc` run of the core package through `@types/mdx`. Recalibrate the chunk size warning limits, which are meant to sit just above the current size so that a bundle size regression is reported. The Oxc minifier and Lightning CSS make every example smaller: | Example | v0.24.0 | now | limit | | --- | --- | --- | --- | | ts-example | 434.58 kB | 428.51 kB | 429 | | ts-example-selected-features | 366.37 kB | 361.38 kB | 362 | | ts-example-without-defaults | 303.7 kB | 299.46 kB | 300 | The ts-example limit was already stale: at v0.24.0 the chunk was 434.58 kB for a limit of 433, so that build was warning.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (3)
WalkthroughThe pull request updates development dependencies for Vite 8, Storybook 10.5.7, Node.js types, and the Storybook ESLint plugin. Three TypeScript example builds now use Rolldown chunk groups for ChangesVite and Rolldown upgrade
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested labels: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
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 |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: ee6572ad-b23f-4a5c-a12d-76cec261038f
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (8)
package.jsonpackages/html/package.jsonpackages/ts-example-selected-features/package.jsonpackages/ts-example-selected-features/vite.config.jspackages/ts-example-without-defaults/package.jsonpackages/ts-example-without-defaults/vite.config.jspackages/ts-example/package.jsonpackages/ts-example/vite.config.js
`realpathSync` returns native separators on Windows, while Vite normalizes module ids to POSIX ones, so comparing the two raw values makes the substring matcher fail and the `maxgraph` chunk silently disappear. CI runs on windows-2022, so this has to hold there too. Normalize both sides with Vite `normalizePath` rather than only the resolved directory: it is unclear whether Rolldown reports native or POSIX ids on Windows, and normalizing the id as well makes the comparison correct either way. Also match with `startsWith` on a directory ending with a separator instead of a plain substring, so that a sibling directory such as `packages/core-extra` is no longer captured by the group.
|



Overview
Bump
vitefrom 7.3.3 to 8.2.1 in the four packages that use it (html,ts-example,ts-example-selected-features,ts-example-without-defaults).Vite 8 replaces Rollup and esbuild with Rolldown and Oxc, which is a breaking change for the build configuration of the vite examples. Migration follows the official guide.
Configuration migration
build.rollupOptionsbecomesbuild.rolldownOptions.output.manualChunksno longer exists. It is replaced byoutput.codeSplitting.groups, not byoutput.advancedChunks, which is already deprecated in the Rolldown version bundled with Vite 8.@maxgraph/corepoint to the workspace directory and never tonode_modules. A name-based regex would therefore silently produce nomaxgraphchunk in this repository. The configurations resolve the package directory instead, which keeps the chunk correct both here and for a standalone consumer.Two companion bumps, both mandatory
These are not opportunistic updates, the install cannot resolve without them:
eslint-plugin-storybook):@storybook/builder-vite@10.1declaresvite: ^5 || ^6 || ^7. Vite 8 support starts at 10.3.@types/node^18.19.123to^24.10.7: Storybook 10.5 pulls an optionalvite-plusandvitest@4peer chain requiring@types/node20 or later. Version 24 also aligns with the version declared in.nvmrc, which was already inconsistent.Bundle sizes
The Oxc minifier and Lightning CSS make every example smaller. The chunk size warning limits are meant to sit just above the current size so that a regression is reported, so they are recalibrated:
The
ts-examplelimit was already stale: at v0.24.0 the chunk was 434.58 kB for a limit of 433, so that build was emitting a warning.Notes
The lockfile is updated surgically, not regenerated. A full regeneration drifts 2530 transitive versions, including
@types/react18.2.58 to 19.2.18. React 19 types drop the globalJSXnamespace, which breaks thetscrun of the core package through@types/mdx(core setsskipLibCheck: falsewith notypesrestriction, so it type-checks every@typespackage in the tree). Worth knowing before any future full regeneration.Validation. The full CI suite from
CLAUDE.mdpasses locally: core build,test-check, 498 tests,ts-support, all examples, Storybook build, circular dependencies,check:npm-packageand lint.The chunk size guard was checked to be genuinely live under Rolldown rather than silently ignored: lowering
ts-exampleto 428 does emitSome chunks are larger than 428 kB, while 429 does not, against an actual size of 428.51 kB.No screenshots: this only changes build tooling and example bundling, with no runtime or rendering behaviour change in the library itself.
Summary by CodeRabbit