Repository navigation
[vite-plugin] Route v1 DevTools WebSocket upgrades explicitly - #16540
Conversation
|
| Name | Type |
|---|---|
| @cloudflare/vite-plugin | Patch |
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
|
Codeowners approval required for this PR:
|
|
@petebacondarwin (original author) @dario-piotrowicz (human ant-core approver): please check this v1 backport of #16519 and approve it if it looks good. This replaces auto-merged #16538 after the requested reorder; it is now directly on #16504, with #16444 above it. GitHub marked the earlier PR merged into its temporary base branch when I pushed the reordered ancestry too early; vite-plugin-v1 was never changed. The same three-file source/socket-test/changeset diff passes build, all checks, retained tests and WebSockets dev/preview on its new base. The earlier request is #16538 (comment); this is its replacement review location. |
commit: |
|
✅ Approved — No issues found: the explicit DevTools path check replaces the fragile write-count heuristic, Sandbox forwarding still works, the tests cover the regressions, and the changeset is accurate. The decision is advisory: this comment never approves, blocks or requests changes on the pull request. ✅ All checks passed🚀 Release: ✅ LGTMLow risk. The changeset is a 🔒 Security: ✅ LGTMNo security concerns in the routing change. 📖 AGENTS.md: ✅ LGTMConsistent with the repository conventions. 📋 Code Quality: ✅ LGTMNo issues in ⚡ Performance: ✅ LGTMNo performance concerns. 📝 Documentation: ✅ LGTMThe updated changeset accurately describes the user-facing fix. Reviewed commit: |
3ca16f5 to
599b671
Compare
workers-devprod
left a comment
There was a problem hiding this comment.
Codeowners reviews satisfied
Backports #16519 to Vite plugin v1, stacked directly on #16504, as requested. #16444 follows this fix in the v1 stack.
Replaces #16538: while reordering, pushing its rebased commit into the old base branch caused GitHub to mark that PR merged and delete its head branch. The v1 target branch was never changed. GitHub rejects changing that merged PR's base; this replacement keeps the same three-file fix and requested direct base, without adding another changeset or dependency upgrade.
Vite DevTools upgrades at
/__devtools/__wsmust reach its own listener without being dispatched to the Worker. Replace the inherited write-count heuristic from #16504 with explicit routing, preserving Sandbox forwarding. This also fixes a legitimate Worker upgrade being rejected when an earlier pipelined HTTP response finishes during dispatch. The original source, socket regressions, and existing changeset apply directly; no dependency upgrade or additional changelog entry is needed.Validation: Node 22.22.1 / pnpm 10.33.0;
pnpm build,pnpm check,pnpm test:ci, and the WebSockets playground in dev and built preview.Note
This is a contribution from an AI agent: Codex, under the authorized v1 backport automation.