Repository navigation
[APPS-2961] Update: require Vite 6.4 or later for the apps plugin - #622
gh-worker-dd-mergequeue-cf854d[bot] merged 1 commit into
Conversation
a181de9 to
8cc274c
Compare
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
🟢 Approval recommended
The Apps-only version requirement and compatibility cleanup are consistent, with only nonblocking coding-convention feedback remaining.
3 open issues
What changed in this PR
Requires Vite 7 or later when the Apps plugin is enabled, preparing local backend execution for the upcoming per-call process changes. Other Datadog plugins retain their existing Vite compatibility.
Changes:
- Adds an early version check with an upgrade hint and tests for rejection, acceptance, and the repository test bypass.
- Removes Vite 5/6 compatibility branches and their obsolete tests.
- Documents the Apps-specific Vite requirement.
| File | Description |
|---|---|
packages/plugins/apps/src/vite/vite-version.ts |
Adds the Vite version guard and upgrade message. |
packages/plugins/apps/src/vite/vite-version.test.ts |
Tests supported, unsupported, and missing versions. |
packages/plugins/apps/src/vite/vite-parse-ast.ts |
Removes legacy CommonJS parser handling. |
packages/plugins/apps/src/vite/vite-parse-ast.test.ts |
Updates parser fixtures and removes the legacy case. |
packages/plugins/apps/src/vite/network-guard.ts |
Removes the Vite 5 plugin-container exemption. |
packages/plugins/apps/src/vite/network-guard.test.ts |
Removes tests for the deleted exemption. |
packages/plugins/apps/src/vite/index.ts |
Enforces the version floor and removes compatibility fallbacks. |
packages/plugins/apps/src/vite/index.test.ts |
Tests version enforcement and removes Vite 5 coverage. |
packages/plugins/apps/src/vite/dev-server-module-graph.ts |
Uses the SSR environment graph directly. |
packages/plugins/apps/src/vite/dev-server-module-graph.test.ts |
Updates fixtures to include the SSR environment. |
packages/plugins/apps/README.md |
Documents the Vite 7 minimum. |
Review effort: Balanced
|
Codex Review: Didn't find any major issues. Breezy! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
8cc274c to
9847ad6
Compare
9847ad6 to
ddbd01f
Compare
ddbd01f to
ef2034f
Compare
The apps plugin's config hook refuses a Vite below 6.4. It reads this.meta.viteVersion, which Vite 7+ gives every hook, and on Vite 6 falls back to the imported vite module's version. A running Vite 7+ whose imported vite module is older is refused too, naming both versions, since the plugin calls that module's APIs. The repo's own unit tests skip the check, since they run with mock bundler versions. Remove the branches the floor makes dead: the Vite 5 module graph fallback, the Vite 5 plugin container exemption, the CJS parseAst getter handling, the load hook's filter recheck for Vite below 6.3 and the fallback for a Vite without defaultServerConditions. Refs APPS-2961 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ef2034f to
5b3a161
Compare
Live Debugger Runtime BenchmarkSDK-loaded dormant-probe runtime overhead, measured against an uninstrumented bundle in the same browser session.
What do the Tiny and Hot workloads represent? Browser Debugger SDK: Full diagnosticsRaw samples are in the |

Motivation
Architecture
flowchart LR A["vite build / vite dev"] --> B{"config hook: this.meta.viteVersion, else the imported vite version"} B -- "below 6.4" --> C["Throw: needs Vite 6.4 or later, with upgrade hint"] B -- "6.4 or later" --> D["Rest of the apps plugin"]@datadog/vite-pluginpeer range stays>= 5.x <= 8.x: only the enabled apps plugin refuses an older Vite.Changes
10 changes across vite-version.ts, package.json, index.ts, dev-server-module-graph.ts, vite-parse-ast.ts, network-guard.ts, build-config.ts, dev-server-request-guard.ts and README.md
semverthethis.meta.viteVersionor, on Vite 6, the importedviteversion.vite-version.tssemver7.7.2, already in the lockfile, as a dependency of the apps plugin and so of each published plugin.package.jsonconfighook, outside this repo's test env.index.tsdev-server-module-graph.tsparseAstgetter: the parser loads through a native dynamic import, which gets Vite's ESM entry.vite-parse-ast.tsnetwork-guard.tsloadhook's own filter recheck, since Vite 6.3 and later apply hook filters.index.tsdefaultServerConditionsunconditionally, dropping the Vite 5 fallback.build-config.tsREADME.mddev-server-request-guard.tsQA Instructions
5b3a1614. Setup: build-plugins: Testing and QA Guide.vite buildon Vite 6.4.5 and 8.3.4✓ built in 57msand35ms, each writingdist/datadog-app-assets.zipvitedev server on Vite 6.4.5 and 8.3.4VITE v6.4.5 ready in 431 ms,VITE v8.3.4 ready in 331 ms;GET /returns 200POST /__dd/debugBundleon bothtext/plainbundle holdinggetGreetingHost: attacker.exampletext/plain403vite buildandviteon Vite 6.3.7Error: The Datadog Apps plugin needs Vite 6.4 or later (found 6.3.7).; no server startsdev:verifyon Vite 6.4.5getGreetingreturns 200 throughpreview-asyncBlast Radius
@datadog/vite-pluginare unaffected.Out of Scope / Follow-ups
3 items deferred
BUILD_PLUGINS_ENV=test, since they use mock bundler versions.vitemodule's version, which can belong to another install in a mixed setup.server.environments?.reads stay, since unit-test fakes omit them.Documentation
🤖 Generated with Claude Code