Skip to content

feat(vite)!: Upgrade to Vite 6#1376

Open
Tobbe wants to merge 5 commits intomainfrom
tobbe-gemini-vite-6
Open

feat(vite)!: Upgrade to Vite 6#1376
Tobbe wants to merge 5 commits intomainfrom
tobbe-gemini-vite-6

Conversation

@Tobbe
Copy link
Member

@Tobbe Tobbe commented Mar 16, 2026

Upgrade Vite from 5.4.21 to 6.3.7 across all packages and templates.
Update internal framework usage of ViteRuntime to the new ModuleRunner API.
Update internal createViteRuntime calls to createServerModuleRunner.
Update internal executeUrl usage to import.
Update rollup-plugin-commonjs and postcss-load-config dependencies.
Update test project fixtures.

Upgrade Vite from 5.4.21 to 6.3.7 across all packages and templates.
Update internal framework usage of ViteRuntime to the new ModuleRunner API.
Update internal createViteRuntime calls to createServerModuleRunner.
Update internal executeUrl usage to import.
Update rollup-plugin-commonjs and postcss-load-config dependencies.
Update test project fixtures.
Add release notes.
@netlify
Copy link

netlify bot commented Mar 16, 2026

Deploy Preview for cedarjs canceled.

Name Link
🔨 Latest commit 45bd321
🔍 Latest deploy log https://app.netlify.com/projects/cedarjs/deploys/69b853a07a7638000885534a

@github-actions github-actions bot added this to the next-release-major milestone Mar 16, 2026
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Mar 16, 2026

Greptile Summary

Upgrades Vite from 5.4.21 to 6.3.7 across all packages and templates. The core framework changes migrate from the deprecated ViteRuntime API to the new ModuleRunner API: createViteRuntime(server)createServerModuleRunner(server.environments.ssr), ViteRuntime type → ModuleRunner, and runtime.executeUrl(url)runtime.import(url). Also bumps esbuild from 0.21.5 to 0.25.12 in multiple packages, and updates test fixture data to fix pre-existing uniqueness constraint collisions.

  • API Migration: All ViteRuntime/executeUrl/createViteRuntime references fully replaced with Vite 6 ModuleRunner/import/createServerModuleRunner equivalents across packages/vite and packages/router
  • Dependency Updates: Vite 6.3.7 in all package.json files and resolution overrides; esbuild 0.25.12 in 7 packages; postcss/autoprefixer bumps in fixtures
  • Test Fixtures: Updated scenario data to use unique titles and valid emails, fixing pre-existing test collisions with validateUniqueness and validateEmail
  • Release Notes: Added Vite 6 section to .changesets/release_notes_major.md documenting breaking changes and user-facing upgrade steps
  • Housekeeping: Three internal planning documents (vite-6-upgrade-findings.md, vite-6-upgrade-plan.md, vite-6-upgrade-spec.md) are committed to the repo root and should be removed before merge

Confidence Score: 4/5

  • This PR is safe to merge after removing the three internal planning documents from the repo root.
  • The Vite 5 → 6 API migration is straightforward and correctly follows the official Vite 6 migration path. All old API references are fully replaced. The createServerModuleRunner usage matches the documented Vite 6 API. Test fixture updates are reasonable fixes for pre-existing data collisions. The only concern is three planning documents committed to the repo root that should be cleaned up.
  • The vite-6-upgrade-findings.md, vite-6-upgrade-plan.md, and vite-6-upgrade-spec.md files should be removed before merge as they are internal planning artifacts.

Important Files Changed

Filename Overview
packages/vite/src/devFeServer.ts Core migration: replaced createViteRuntime with createServerModuleRunner(env.environments.ssr) and executeUrl with import. API usage is correct per Vite 6 docs.
packages/vite/ambient.d.ts Updated global type declarations from ViteRuntime to ModuleRunner with correct import from vite/module-runner.
packages/router/ambient.d.ts Updated global type declarations from ViteRuntime to ModuleRunner, consistent with the vite package.
packages/vite/src/rsc/rscRenderer.ts Replaced all executeUrl calls with import on the ModuleRunner. No logic changes.
packages/vite/src/rsc/utils.ts Replaced executeUrl with import in importRscReact and importRsdwServer functions.
packages/vite/src/lib/registerFwGlobalsAndShims.ts Replaced single executeUrl call with import in the webpack chunk load shim.
packages/router/src/rsc/clientSsr.ts Replaced executeUrl with import for loading Routes component in SSR dev mode.
packages/router/src/rsc/utils.ts Replaced executeUrl with import for loading RSDW server module.
vite-6-upgrade-findings.md Internal planning document committed to repo root — should be removed before merge.
vite-6-upgrade-plan.md Internal planning document committed to repo root — should be removed before merge.
vite-6-upgrade-spec.md Internal planning document committed to repo root — should be removed before merge.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    subgraph "Vite 5 (Before)"
        A1["createViteRuntime(viteServer)"] --> B1["ViteRuntime instance"]
        B1 --> C1["runtime.executeUrl(path)"]
    end

    subgraph "Vite 6 (After)"
        A2["createServerModuleRunner(viteServer.environments.ssr)"] --> B2["ModuleRunner instance"]
        B2 --> C2["runner.import(path)"]
    end

    subgraph "Affected Global Vars"
        G1["__rwjs__vite_ssr_runtime: ModuleRunner"]
        G2["__rwjs__vite_rsc_runtime: ModuleRunner"]
    end

    subgraph "Consumer Files"
        D1["devFeServer.ts"] --> G1
        D1 --> G2
        D2["rscRenderer.ts"] --> G2
        D3["registerFwGlobalsAndShims.ts"] --> G1
        D4["clientSsr.ts"] --> G2
        D5["router/utils.ts"] --> G2
        D6["vite/utils.ts"] --> G2
    end
Loading

Last reviewed commit: 2cd4915

@nx-cloud
Copy link

nx-cloud bot commented Mar 16, 2026

🤖 Nx Cloud AI Fix

Ensure the fix-ci command is configured to always run in your CI pipeline to get automatic fixes in future runs. For more information, please see https://nx.dev/ci/features/self-healing-ci


View your CI Pipeline Execution ↗ for commit 45bd321

Command Status Duration Result
nx run-many -t build:pack --exclude create-ceda... ✅ Succeeded 2s View ↗
nx run-many -t test --minWorkers=1 --maxWorkers=4 ✅ Succeeded 4m 11s View ↗
nx run-many -t test:types ✅ Succeeded 9s View ↗
nx run-many -t build ✅ Succeeded 7s View ↗

☁️ Nx Cloud last updated this comment at 2026-03-16 19:24:00 UTC

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