Support Vite 8 (issue #423)#425
Draft
yoannmoinet wants to merge 5 commits into
Draft
Conversation
|
thank you for this incredible turn around! |
3eee438 to
2d8b505
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why?
Adds Vite 8 support to
@datadog/vite-plugin(#423). The peer-dependency range previously capped atvite <= 7.x, blocking users on the newly released Vite 8.vitepeer range to>= 5.x <= 8.x.vitestays pinned at6.3.5— out of scope to bump).rollupto4.62.0for compatibility with Vite 8's types.How?
Peer range
packages/published/vite-plugin/package.json:vitepeer>= 5.x <= 7.x→>= 5.x <= 8.x.JSON import attribute (forward-compat)
src/index.tsnow useimport 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-markerregion soyarn cli integritydoesn't clobber it.Rollup bump
resolutions.rollup+ everyrollupdevDep pin (vite-plugin,esbuild-plugin,rollup-plugin,rspack-plugin,webpack-plugin,apps,bundler-report,tests) bumped4.45.1→4.62.0, lockfile refreshed.Vite 8 fixture + test
packages/tests/src/_jest/fixtures/vite_react_router_project/: a self-contained project (type: module) that links@datadog/vite-pluginand runs a realvite buildagainstvite@8.0.16+react-router@8+@vitejs/plugin-react-swc@4.3.1. Itsvite.config.jsconsumes the plugin's builtdistentry (the realistic published-artifact path) with RUM sourcemaps (bailOnError),metrics.enable: false,enableGit: false, and a fake API key.@tests/fixturesworkspaces;globalSetup'syarn installprovisions it. Per repo preference the fixture's.yarn/cacheis gitignored (drops the previously-tracked zips) — the committed lockfile keeps--immutableinstalls working.packages/tests/src/unit/published/vite-plugin/vite8.test.ts: spawns the build viaexecutefrom@dd/tools/helpersand asserts it ran onvite v8, emitted the plugin'sdist/build.json, and producedbuild/client. The build is offline-tolerant (the only network touch is analytics, which is swallowed). The fixture project is excluded from the@dd/teststsconfig so its newer-TS-syntax.d.tsfiles don't break typecheck.Regression fix from the rollup bump
@types/estree@1.0.9transitively, which shadowed@dd/apps-plugin's pinned1.0.8and brokediscovery.test.tstypecheck (decoratorsonClassDeclaration). Pinned@types/estree: 1.0.8in rootresolutions(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).Out of scope
vite@6.3.5.