Skip to content

feat: rename server.hmr options to server.ws options#21357

Merged
sapphi-red merged 4 commits into
mainfrom
feat/rename-server-hmr-options-to-server-ws-options
Jun 2, 2026
Merged

feat: rename server.hmr options to server.ws options#21357
sapphi-red merged 4 commits into
mainfrom
feat/rename-server-hmr-options-to-server-ws-options

Conversation

@sapphi-red

Copy link
Copy Markdown
Member

I noticed that it's not possible to configure the ws settings when the HMR is disabled by server.hmr: false. This PR moves all ws related options under server.hmr to server.ws. This would make it possible to configure ws settings while disabling HMR.

fixes #18489
refs #18489 (comment), #18489 (comment)

@sapphi-red sapphi-red added this to the 8.1 milestone Jan 1, 2026
@sapphi-red sapphi-red added the p2-edge-case Bug, but has workaround or limited in scope (priority) label Jan 1, 2026

@bluwy bluwy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall lgtm 👍

Comment thread packages/vite/src/node/utils.ts Outdated
Comment on lines +1389 to +1391
if (rootPath === 'server') {
setupHmrWsOptionCompat(merged)
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a bit strange for me to put compat code in the merge function, but I suppose it works temporarily for now.

Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
bluwy
bluwy previously approved these changes Jan 9, 2026
@sapphi-red

Copy link
Copy Markdown
Member Author

/ecosystem-ci run

@pkg-pr-new

pkg-pr-new Bot commented Jun 2, 2026

Copy link
Copy Markdown

Open in StackBlitz

@vitejs/plugin-legacy

pnpm add https://pkg.pr.new/@vitejs/plugin-legacy@21357 -D
npm i https://pkg.pr.new/@vitejs/plugin-legacy@21357 -D
yarn add https://pkg.pr.new/@vitejs/plugin-legacy@21357.tgz -D

vite

pnpm add https://pkg.pr.new/vite@21357 -D
npm i https://pkg.pr.new/vite@21357 -D
yarn add https://pkg.pr.new/vite@21357.tgz -D

commit: 90c9819

@vite-ecosystem-ci

Copy link
Copy Markdown

@sapphi-red sapphi-red merged commit 9ce3036 into main Jun 2, 2026
43 of 44 checks passed
@sapphi-red sapphi-red deleted the feat/rename-server-hmr-options-to-server-ws-options branch June 2, 2026 05:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

p2-edge-case Bug, but has workaround or limited in scope (priority) trigger: preview

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Disabling WebSocket and HMR

2 participants