Repository navigation
[vite-plugin] Close disabled v1 HMR WebSocket upgrades - #16578
Conversation
🦋 Changeset detectedLatest commit: ee13faa The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Codeowners approval required for this PR:
|
|
@edmundhung (original author) @petebacondarwin (verified human ant-core approver): please check this v1 backport of #15290 and approve it if it looks good. The original plugin source/tests apply directly to v1, closing raw HMR upgrades when |
|
✅ Approved — This pull request correctly closes HMR upgrades that nothing will handle when server.ws is disabled. It includes tests and a changeset, and no issues were found. The decision is advisory: this comment never approves, blocks or requests changes on the pull request. ✅ All checks passed📋 Code Quality: ✅ LGTM
📝 Documentation: ✅ LGTMThe changeset describes the user-facing fix, and the inline comment explains why the socket is destroyed. Reviewed commit: |
90b69f3 to
ee13faa
Compare
commit: |
workers-devprod
left a comment
There was a problem hiding this comment.
Codeowners reviews satisfied
Backports #15290 to Vite plugin v1, stacked on #16543's published runtime update.
With
server.ws: false, Vite installs no HMR upgrade handler and v1 leaves the browser's raw socket pending. Pass Vite's WebSocket setting into the plugin's upgrade handler and close unclaimed HMR sockets. Preserve enabled HMR, Vite DevTools and Sandbox/Worker WebSocket routing. The source/test diff applies to v1, with the optional argument default kept enabled so preview and other callers that omit it retain their existing handoff; the existing stack contains no equivalent fix. Includes the original plugin patch changeset and tests for enabled, disabled and unspecified HMR.Validation: Node 22.22.1/pnpm 10.33.0;
pnpm check(build, types, lint, format; all 58 tasks) and the WebSocket/container-server suites pass. The first test command accidentally ran the whole plugin suite concurrently with a clean build, which removed generated Worker files mid-test; rerunning affected suites after build completion passes. Parent #16543 validates the published dependency graph and asset/WebSocket dev/preview playgrounds.server.wsbehavior; the plugin changeset describes it.Note
This is a contribution from an AI agent: Codex, under the authorized v1 backport automation.