π¦ deps(vite): upgrade Vite 6 β 8.0.3#272
Conversation
- Bump vite ^6.3.6 β ^8.0.3 - Bump @vitejs/plugin-react ^4.2.0 β ^5.2.0 (Vite 8 support) - Bump all @nx/* packages 22.6.0 β 22.6.3 (adds Vite 8 peer dep) - Bump nx 22.6.0 β 22.6.3 - Bump @react-router/* packages ^7.12.0 β ^7.14.0-pre.0 (first release with Vite 8 support) - Install @emotion/react (missing peer dep of @chakra-ui/react, previously silently ignored by Rollup; Rolldown now errors) - Remove build.commonjsOptions (no-op in Vite 8) from frontend and ui configs - Rename build.rollupOptions β build.rolldownOptions in packages/ui config - Fix tsconfigPaths plugin call syntax in packages/ui config (tsconfigPaths β tsconfigPaths()) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Greptile SummaryThis PR upgrades the frontend toolchain from Vite 6 to Vite 8 (which replaces Rollup/esbuild with Rolldown/Oxc), updating all peer packages ( Key changes:
Confidence Score: 5/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
subgraph Build["Build Toolchain (Vite 8)"]
Vite8["vite ^8.0.3\n(was ^6.3.6)"]
PluginReact["@vitejs/plugin-react ^5.2.0\n(was ^4.2.0)"]
Rolldown["Rolldown + Oxc\n(replaces Rollup + esbuild)"]
Vite8 --> Rolldown
PluginReact --> Vite8
end
subgraph FrontendConfig["apps/frontend/vite.config.ts"]
DedupeReact["resolve.dedupe: react, react-dom, react-router"]
RemovedCommonJS["build.commonjsOptions removed (no-op)"]
end
subgraph UIConfig["packages/ui/vite.config.ts"]
RolldownOpts["build.rolldownOptions (was rollupOptions)"]
ExternalFn["external: fn β all non-relative imports"]
TsconfigFix["tsconfigPaths() fixed (was tsconfigPaths)"]
end
subgraph RouterConfig["apps/frontend/react-router.config.ts"]
UnstableOpt["unstable_optimizeDeps: true β οΈ"]
ReactRouter["@react-router/* ^7.14.0-pre.0"]
end
subgraph Deps["New/Updated Dependencies"]
EmotionReact["@emotion/react ^11.14.0 (new β explicit peer dep)"]
NX["@nx/* 22.6.3 (Vite 8 peer dep support)"]
end
Vite8 --> FrontendConfig
Rolldown --> UIConfig
ReactRouter --> RouterConfig
Rolldown -->|"strict import resolution"| EmotionReact
Reviews (8): Last reviewed commit: "Add migration script" | Re-trigger Greptile |
| @@ -33,24 +33,24 @@ | |||
| "@eslint/js": "^9.39.2", | |||
| "@nestjs/schematics": "^11.0.0", | |||
There was a problem hiding this comment.
Pre-release semver range for
@react-router packages
All five @react-router packages (and react-router itself) are pinned to ^7.14.0-pre.0. Using ^ with a pre-release identifier can produce surprising resolution behaviour: npm will match any 7.14.0-pre.* pre-release but will also match the eventual 7.14.0 stable release, while ignoring 7.14.1-pre.* pre-releases altogether. This is an unusual hybrid of "pin to pre-release line" and "accept stable when it lands."
The standard recommendation for pre-release packages in production is to pin the exact version (no range operator), so that npm ci / npm install always resolves to the same artefact:
| "@nestjs/schematics": "^11.0.0", | |
| "@react-router/dev": "7.14.0-pre.0", |
Apply the same exact-pin to @react-router/fs-routes, @react-router/node, @react-router/serve, and react-router. This avoids a future scenario where a 7.14.0-pre.1 (or the stable 7.14.0 before it is fully validated) silently enters the build.
The PR description already acknowledges this is a pre-release; pinning exactly is the safe complement to that acknowledgement.
- RuleDetails uses useSearchParams from 'react-router' but test imported MemoryRouter from 'react-router-dom' (different package version), causing missing router context in tests Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Remove isolatedModules from jest.config.ts as it's already set in tsconfig.spec.json - Eliminates ts-jest deprecation warning about isolatedModules being removed in v30 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Move test factories used by frontend specs into @packmind/test-utils to break the transitive dependency chain (frontend β deployments β node-utils). This reduces frontend build dependencies from 16 to 5 packages. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remove the `branches: ['main']` filter on `pull_request` so the CI pipeline runs on PRs targeting any branch, not just main. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Disable @nx/enforce-module-boundaries for jest.config.ts files, allow @packmind/test-utils in browser spec files, update @nx/devkit version, and remove stale eslint-disable directives. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
| id: createStandardVersionId('test-standard-version-id'), | ||
| standardId: createStandardId('test-standard-id'), | ||
| name: 'Test Standard', | ||
| slug: 'test-standard', | ||
| version: 1, | ||
| description: 'Test standard description', | ||
| summary: null, | ||
| userId: createUserId('test-user-id'), | ||
| scope: null, | ||
| ...standardVersion, | ||
| }); | ||
|
|
||
| export const createDeployedStandardInfo = ( |
There was a problem hiding this comment.
Hardcoded ID causes duplicate StandardVersion identities
createMockStandardVersion always produces id: createStandardVersionId('test-standard-version-id'). When createDeployedStandardInfo (and createDeployedStandardTargetInfo) calls it twice for deployedVersion and latestVersion, both objects end up with the same id:
const deployedVersion = createMockStandardVersion({ standardId: standard.id });
// deployedVersion.id === createStandardVersionId('test-standard-version-id')
const latestVersion = createMockStandardVersion({
standardId: standard.id,
version: deployedVersion.version + 1,
});
// latestVersion.id === createStandardVersionId('test-standard-version-id') β same!Any code under test that de-duplicates, maps, or compares versions by id will silently treat these two as the same version. The parallel recipe factory (recipeVersionFactory) avoids this by calling uuidv4() for each instance.
| id: createStandardVersionId('test-standard-version-id'), | |
| standardId: createStandardId('test-standard-id'), | |
| name: 'Test Standard', | |
| slug: 'test-standard', | |
| version: 1, | |
| description: 'Test standard description', | |
| summary: null, | |
| userId: createUserId('test-user-id'), | |
| scope: null, | |
| ...standardVersion, | |
| }); | |
| export const createDeployedStandardInfo = ( | |
| export const createMockStandardVersion = ( | |
| standardVersion?: Partial<StandardVersion>, | |
| ): StandardVersion => ({ | |
| id: createStandardVersionId(uuidv4()), | |
| standardId: createStandardId(uuidv4()), | |
| name: 'Test Standard', | |
| slug: 'test-standard', | |
| version: 1, | |
| description: 'Test standard description', | |
| summary: null, | |
| userId: createUserId('test-user-id'), | |
| scope: null, | |
| ...standardVersion, | |
| }); |
You'll also need to add import { v4 as uuidv4 } from 'uuid'; at the top of the file.
Align react-router-dom to ^7.14.0-pre.0 across root and frontend package.json to prevent npm from nesting a second react-router copy. Add resolve.dedupe for React packages in Vite config as safety net. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
react-router-dom was causing @react-router/dev to pre-bundle it as a separate optimized dep from react-router, creating two copies of the router context. Since all imports use react-router directly (v7 pattern), react-router-dom is unnecessary. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
β¦re-optimization Vite 8 lazily discovers new deps when navigating to routes, causing the optimizer to re-run and create chunks with different version hashes. Old and new chunks coexist, splitting react-router context. Enabling unstable_optimizeDeps adds all route files as optimizeDeps entries so all deps are discovered upfront at startup. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|

Explanation
Upgrades Vite from 6.3.6 to 8.0.3, the latest stable release. Vite 8 replaces Rollup + esbuild with Rolldown and Oxc, bringing significant build performance improvements.
Changes made:
vite^6.3.6 β ^8.0.3@vitejs/plugin-react^4.2.0 β ^5.2.0 (Vite 8 compatible, supports Vite 4β8)@nx/*packages 22.6.0 β 22.6.3 (adds Vite 8 peer dep support)nx22.6.0 β 22.6.3@react-router/*packages ^7.12.0 β ^7.14.0-pre.0 (first release with Vite 8 peer dep support)@emotion/react(declared peer dep of@chakra-ui/react, previously silently skipped by Rollup; Rolldown now errors on unresolvable imports)build.commonjsOptions(now a no-op in Vite 8) fromapps/frontendandpackages/uiconfigsbuild.rollupOptionsβbuild.rolldownOptionsinpackages/ui/vite.config.tstsconfigPathsplugin call inpackages/ui/vite.config.ts(tsconfigPathsβtsconfigPaths())packages/uilibrary build (Rolldown is strict about unresolvable deps)Type of Change
Affected Components
packages/ui,apps/frontend,apps/playground@react-router/dev@7.14.0-pre.0is a pre-release;@emotion/reactadded as new dependencyTesting
Test Details:
nx build frontend,nx build ui,nx build playgroundβ all pass βnx test uiβ 154 tests pass βnx test frontendβ 602 tests pass (8 pre-existing failures inRuleDetails.spec.tsxunrelated to this upgrade) βnx affected:testβTODO List
Reviewer Notes
@react-router/dev@7.14.0-pre.0is a pre-release but is the only version with Vite 8 peer dep support. React Router pre-releases follow a predictable pattern and are typically stable.packages/uilibrary build now externalizes all node_modules (function-based external), which is the correct pattern for library builds and was previously incomplete (onlyreact,react-dom,react/jsx-runtimewere externalized).