Skip to content

Support Vite 8 (issue #423)#425

Draft
yoannmoinet wants to merge 5 commits into
masterfrom
yoann/support-vite-8-issue-423-91d166cd
Draft

Support Vite 8 (issue #423)#425
yoannmoinet wants to merge 5 commits into
masterfrom
yoann/support-vite-8-issue-423-91d166cd

Conversation

@yoannmoinet

Copy link
Copy Markdown
Member

What and why?

Adds Vite 8 support to @datadog/vite-plugin (#423). The peer-dependency range previously capped at vite <= 7.x, blocking users on the newly released Vite 8.

  • Widens the vite peer range to >= 5.x <= 8.x.
  • Verifies the plugin actually runs under a real Vite 8 build via a new fixture project + integration test (dev/test vite stays pinned at 6.3.5 — out of scope to bump).
  • Bumps rollup to 4.62.0 for compatibility with Vite 8's types.

How?

Peer range

  • packages/published/vite-plugin/package.json: vite peer >= 5.x <= 7.x>= 5.x <= 8.x.

JSON import attribute (forward-compat)

  • All five published plugins' src/index.ts now use import pkg from '../package.json' with { type: 'json' }. Consistent with the rollup configs (which already use the attribute) and required when a consumer's bundler processes these entry points; the line sits outside the #types-export-injection-marker region so yarn cli integrity doesn't clobber it.

Rollup bump

  • resolutions.rollup + every rollup devDep pin (vite-plugin, esbuild-plugin, rollup-plugin, rspack-plugin, webpack-plugin, apps, bundler-report, tests) bumped 4.45.14.62.0, lockfile refreshed.

Vite 8 fixture + test

  • New packages/tests/src/_jest/fixtures/vite_react_router_project/: a self-contained project (type: module) that links @datadog/vite-plugin and runs a real vite build against vite@8.0.16 + react-router@8 + @vitejs/plugin-react-swc@4.3.1. Its vite.config.js consumes the plugin's built dist entry (the realistic published-artifact path) with RUM sourcemaps (bailOnError), metrics.enable: false, enableGit: false, and a fake API key.
  • Registered in the @tests/fixtures workspaces; globalSetup's yarn install provisions it. Per repo preference the fixture's .yarn/cache is gitignored (drops the previously-tracked zips) — the committed lockfile keeps --immutable installs working.
  • packages/tests/src/unit/published/vite-plugin/vite8.test.ts: spawns the build via execute from @dd/tools/helpers and asserts it ran on vite v8, emitted the plugin's dist/build.json, and produced build/client. The build is offline-tolerant (the only network touch is analytics, which is swallowed). The fixture project is excluded from the @dd/tests tsconfig so its newer-TS-syntax .d.ts files don't break typecheck.

Regression fix from the rollup bump

  • Rollup 4.62 pulled in @types/estree@1.0.9 transitively, which shadowed @dd/apps-plugin's pinned 1.0.8 and broke discovery.test.ts typecheck (decorators on ClassDeclaration). Pinned @types/estree: 1.0.8 in root resolutions (the version the repo already standardizes on) — no test code change, no cast, no suppression.

Verification

  • yarn typecheck:all, yarn cli integrity, yarn build:all — all green (integrity produces no diff).
  • New Vite 8 fixture test passes; existing vite unit + factory integration tests pass.

Out of scope

  • Bumping the pinned dev/test vite@6.3.5.
  • CI matrix changes (no vite version matrix exists).

@daredoes

Copy link
Copy Markdown

thank you for this incredible turn around!

@yoannmoinet yoannmoinet force-pushed the yoann/support-vite-8-issue-423-91d166cd branch from 3eee438 to 2d8b505 Compare June 18, 2026 21:08
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.

2 participants