Skip to content

Migrate to Vite 8 - #232

Open
WiXSL wants to merge 11 commits into
mainfrom
vite-8
Open

Migrate to Vite 8#232
WiXSL wants to merge 11 commits into
mainfrom
vite-8

Conversation

@WiXSL

@WiXSL WiXSL commented Mar 25, 2026

Copy link
Copy Markdown
Collaborator

Waiting for rolldown to be more stable

The migration is working technically: the project installs, typechecks, and builds successfully.

That said, there are still ecosystem compatibility gaps around Vite 8, so this PR is worth reviewing carefully before merge.

What was updated

  • upgraded vite to v8
  • upgraded @vitejs/plugin-react
  • upgraded vitest and related browser packages
  • upgraded storybook / @storybook/react-vite
  • adjusted the Vite config for the new build pipeline
  • updated .storybook/main.ts for ESM execution

Validation

I verified that these commands pass:

  • npm ci --ignore-scripts
  • npm run typecheck
  • npm run build
  • npm run build:demo
  • npm run build-storybook

I also verified the PWA flow still works:

  • production build still generates:
    • dist/registerSW.js
    • dist/sw.js
    • dist/workbox-*.js
  • dist/index.html still includes:
    • the manifest link
    • registerSW.js
  • local Chromium check:
    • service worker registers successfully
    • sw.js and workbox-*.js are requested
  • offline check:
    • after one online load, the app shell still loads offline under service worker control

Known issues

vite-plugin-pwa

vite-plugin-pwa@1.2.0 still declares Vite support only up to ^7.

This PR uses an overrides entry so npm resolves vite-plugin-pwa against the project's Vite 8 version.

Storybook transitive dependency

@storybook/react-vite still pulls in @joshwooding/vite-plugin-react-docgen-typescript through a dependency range that does not resolve to the Vite 8-compatible version by default.

This PR uses an overrides entry in package.json so that the resolved version is compatible with Vite 8.

Explicit Workbox packages

This PR keeps explicit workbox-build and workbox-window dependencies because vite-plugin-pwa requires them at build time in this setup.

@WiXSL WiXSL added the RFR label Mar 25, 2026
Comment thread vendor/vite-plugin-pwa-1.2.0.tgz Outdated

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.

Why do we commit this file ?
vite-plugin-pwa 1.2.0 is published on npm.

@WiXSL WiXSL Mar 26, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The npm package vite-plugin-pwa@1.2.0 still declares Vite support only up to ^7, so installing it with vite@8 fails with ERESOLVE.

vendor/vite-plugin-pwa-1.2.0.tgz is a patch version used as a workarround.

But I found a mutch better soluton for this: vite-pwa/vite-plugin-pwa#918

Comment thread package.json Outdated
Comment thread vite.config.ts Outdated
},
}),
VitePWA({
injectRegister: "script",

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.

We do not need this, it works without it.

@fzaninotto

Copy link
Copy Markdown
Member

I had to erase packages.lock and reinstall, otherwise the app crashed on startup

Comment thread package-lock.json
"integrity": "sha512-7PGFlmtwsEADb0WYyvCMa1t+yke6daIG4Wirafur5kcf+MhUnPms1UeR0CKQdTZD81yESwMHbtn+TR+dMviakQ==",
"dev": true,
"node_modules/rolldown": {
"version": "1.0.0-rc.12",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm a bit uncomfortable relying on a core dep that isn't stable yet

@ThieryMichel ThieryMichel added WIP and removed RFR labels Mar 26, 2026
@fzaninotto

fzaninotto commented May 28, 2026

Copy link
Copy Markdown
Member

rolldown v1 has been released. Can you update the PR? Also, needs rebase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants