Skip to content

πŸ“¦ deps(vite): upgrade Vite 6 β†’ 8.0.3#272

Merged
cteyton merged 12 commits intomigration-node-24-14from
vite8
Apr 2, 2026
Merged

πŸ“¦ deps(vite): upgrade Vite 6 β†’ 8.0.3#272
cteyton merged 12 commits intomigration-node-24-14from
vite8

Conversation

@cteyton
Copy link
Copy Markdown
Contributor

@cteyton cteyton commented Apr 1, 2026

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)
  • All @nx/* packages 22.6.0 β†’ 22.6.3 (adds Vite 8 peer dep support)
  • nx 22.6.0 β†’ 22.6.3
  • All @react-router/* packages ^7.12.0 β†’ ^7.14.0-pre.0 (first release with Vite 8 peer dep support)
  • Installed @emotion/react (declared peer dep of @chakra-ui/react, previously silently skipped by Rollup; Rolldown now errors on unresolvable imports)
  • Removed build.commonjsOptions (now a no-op in Vite 8) from apps/frontend and packages/ui configs
  • Renamed build.rollupOptions β†’ build.rolldownOptions in packages/ui/vite.config.ts
  • Fixed tsconfigPaths plugin call in packages/ui/vite.config.ts (tsconfigPaths β†’ tsconfigPaths())
  • Externalized all non-relative imports in packages/ui library build (Rolldown is strict about unresolvable deps)

Type of Change

  • Bug fix
  • New feature
  • Improvement/Enhancement
  • Refactoring
  • Documentation
  • Breaking change

Affected Components

  • Domain packages affected: packages/ui, apps/frontend, apps/playground
  • Frontend / Backend / Both: Frontend
  • Breaking changes (if any): @react-router/dev@7.14.0-pre.0 is a pre-release; @emotion/react added as new dependency

Testing

  • Unit tests added/updated
  • Integration tests added/updated
  • Manual testing completed
  • Test coverage maintained or improved

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 in RuleDetails.spec.tsx unrelated to this upgrade) βœ…
  • All 26 affected projects pass in nx affected:test βœ…

TODO List

  • CHANGELOG Updated
  • Documentation Updated

Reviewer Notes

  • @react-router/dev@7.14.0-pre.0 is 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.
  • The packages/ui library build now externalizes all node_modules (function-based external), which is the correct pattern for library builds and was previously incomplete (only react, react-dom, react/jsx-runtime were externalized).

- 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-apps
Copy link
Copy Markdown
Contributor

greptile-apps bot commented Apr 1, 2026

Greptile Summary

This PR upgrades the frontend toolchain from Vite 6 to Vite 8 (which replaces Rollup/esbuild with Rolldown/Oxc), updating all peer packages (@vitejs/plugin-react, @nx/*, @react-router/*) and fixing the Vite configuration to match Vite 8's API changes. As a secondary cleanup, test factories previously scattered across domain packages (@packmind/deployments/test, @packmind/git/test, etc.) are consolidated into @packmind/test-utils, with new factories for git repos, recipes, recipe versions, standards, deployment overviews, and standard deployment overviews.

Key changes:

  • vite ^6.3.6 β†’ ^8.0.3; @vitejs/plugin-react ^4.2.0 β†’ ^5.2.0; nx/@nx/* 22.6.0 β†’ 22.6.3
  • @react-router/* + react-router upgraded to ^7.14.0-pre.0 (first version with Vite 8 peer dep support β€” pre-release)
  • build.rollupOptions renamed to build.rolldownOptions and build.commonjsOptions removed (both are Vite 8 breaking changes)
  • packages/ui library build now externalizes all non-relative imports via a function-based external, correctly handling all node_modules
  • @emotion/react added as an explicit dependency (Rolldown is strict about unresolvable peer dep imports that Rollup previously silently skipped)
  • tsconfigPaths bug fixed in packages/ui/vite.config.ts (was passed as a reference instead of called as a function)
  • Test factory consolidation: new factories in packages/test-utils with proper uuidv4() IDs; unstable_optimizeDeps: true added to react-router.config.ts without documentation

Confidence Score: 5/5

  • Safe to merge β€” all 756+ tests pass and the only open findings are P2 style suggestions.
  • All remaining findings are P2 (undocumented unstable flag). The pre-release semver concern was raised and discussed in a prior review thread. The hardcoded StandardVersionId issue in standardDeploymentOverviewFactory was also previously flagged. No new P0/P1 issues were found; builds and full test suite pass per the PR description.
  • apps/frontend/react-router.config.ts β€” undocumented unstable_optimizeDeps flag; packages/test-utils/src/factories/deployments/standardDeploymentOverviewFactory.ts β€” hardcoded StandardVersionId (prior thread)

Important Files Changed

Filename Overview
packages/ui/vite.config.ts Removes commonjsOptions (no-op in Vite 8), renames rollupOptions β†’ rolldownOptions, fixes tsconfigPaths() call, and switches to a function-based external that correctly externalizes all node_modules in the library build.
apps/frontend/vite.config.ts Removes commonjsOptions (no-op in Vite 8) and adds resolve.dedupe for react/react-dom/react-router to prevent duplicate module instances.
apps/frontend/react-router.config.ts Adds unstable_optimizeDeps: true without documentation; this is an experimental React Router flag that may change between pre-releases.
package.json Upgrades vite 6β†’8, @vitejs/plugin-react 4β†’5, nx 22.6.0β†’22.6.3, all @react-router/* to ^7.14.0-pre.0, and adds @emotion/react as an explicit dependency.
packages/test-utils/src/factories/deployments/deploymentOverviewFactory.ts New factory module using uuidv4 for all IDs β€” each createDeployedRecipeInfo call generates unique recipe and version IDs, avoiding the duplicate-ID problem seen in standardDeploymentOverviewFactory.
packages/test-utils/src/factories/deployments/standardDeploymentOverviewFactory.ts createMockStandardVersion always produces the same hardcoded StandardVersionId ('test-standard-version-id'), so deployedVersion and latestVersion in createDeployedStandardInfo share the same ID (already flagged in a prior review comment).
packages/test-utils/src/factories/recipes/recipeVersionFactory.ts New factory using uuidv4 for unique IDs per call and randomIn to vary content; all five pre-defined versions are correctly typed against RecipeVersion.
apps/frontend/jest.config.ts Removes isolatedModules: true (enables full type-checking in tests, at the cost of slightly slower compilation) alongside minor whitespace cleanup.
apps/frontend/src/domain/rules/components/RuleDetails.spec.tsx Updates MemoryRouter import from react-router-dom to react-router, correct for React Router v7 which merges both packages.

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
Loading

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",
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.

P2 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:

Suggested change
"@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.

cteyton and others added 7 commits April 1, 2026 11:51
- 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>
Comment on lines +33 to +45
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 = (
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.

P1 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.

Suggested change
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.

cteyton and others added 4 commits April 1, 2026 14:48
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>
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 2, 2026

@cteyton cteyton merged commit d6b9ac5 into migration-node-24-14 Apr 2, 2026
18 of 20 checks passed
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