Skip to content

feat(bolt-vite-react-ts): upgrade to vite 8 - #132

Draft
sheepsteak wants to merge 1 commit into
mainfrom
chris/bolt-vite-react-ts-vite-8
Draft

sheepsteak wants to merge 1 commit into
mainfrom
chris/bolt-vite-react-ts-vite-8

Conversation

@sheepsteak

Copy link
Copy Markdown
Member

Problem

bolt-vite-react-ts is still on Vite 5 (vite ^5.4.2, @vitejs/plugin-react ^4.3.1), while bolt-slides moved to Vite 8 in #121. The previous attempt (#120) bundled Vite 8 with React 19, Tailwind 4, TypeScript 6, and removing ESLint, and was reverted in #123.

Solution

Upgrade only the build tooling: vite to ^8.3.3 and @vitejs/plugin-react to ^6.1.2 (the v6 line targets Vite 8). React 18, Tailwind 3 with PostCSS, ESLint, TypeScript, and vite.config.ts are unchanged. The existing resolve.alias and optimizeDeps.exclude options still work in Vite 8.

Implementation Details

  • Lockfile: regenerated with the repo's pinned npm 10.2.3, and npm ci passes with it. Only the Vite toolchain moved: Babel, esbuild, and Rollup drop out, Rolldown and Lightning CSS come in, and postcss goes from 8.4 to 8.5 because Vite 8 requires ^8.5.28.
  • removeFileHash: reapplies the fix from feat(bolt-vite-react-ts): modernize toolchain and remove eslint #120. Vite hashes are base64url and can contain -, so the regex now strips from the first - up to the file extension.
  • Assets snapshot: sorted before comparing, because readdir in the WebContainer returned index.js before index.css. Older Vite 5 checkouts of the template fail the same way, so the ordering isn't specific to Vite 8.
  • .bolt/prompt: unchanged. The Vite 8 note feat(bolt-vite-react-ts): modernize toolchain and remove eslint #120 added was about resolve.tsconfigPaths, which this PR doesn't adopt.
  • Other bolt-* templates: bolt-slides is already on Vite 8, and bolt-expo (Metro) and bolt-remotion (Webpack) don't use Vite. bolt-qwik stays on Vite 5: Qwik 1.x, including the latest 1.20.2, declares vite: ">=5 <8", so npm install fails with ERESOLVE, and even with overrides the client build fails under Rolldown. Vite 8 needs the Qwik 2 migration (@qwik.dev/core, currently 2.0.0-rc.2), which can wait until Qwik 2 is stable.

Test plan

  • npm ci, npm run build, npm run typecheck, tsc --noEmit -p tsconfig.node.json, and npm run lint pass in bolt-vite-react-ts
  • Dev server starts on Vite 8.3.3 and resolves @/ imports
  • test/bolt-vite-react-ts.test.ts passes in Chromium (build in a WebContainer, dev server preview updates on edit)
  • Firefox test project
  • New Bolt project from this template

Bump vite to ^8.3.3 and @vitejs/plugin-react to ^6.1.2 and regenerate
the lockfile. Make the build test tolerant of `-` in Vite's base64url
hashes and of readdir ordering.
@bolt-new-by-stackblitz

Copy link
Copy Markdown

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

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant