vite icon indicating copy to clipboard operation
vite copied to clipboard

feat: add `server.hmr.update` to allow configuring ws settings while disabling HMR

Open sapphi-red opened this issue 2 months ago • 2 comments

Description

I noticed that it's not possible to configure the ws settings when the HMR is disabled by server.hmr: false. This PR adds server.hmr.update: false option which works similarly to server.hmr: false.

The alternative way is to move all ws related options under server.ws. This feels more correct, but I'm not sure if the required migration effort for the users is worth.

fixes https://github.com/vitejs/vite/issues/18489 refs https://github.com/vitejs/vite/issues/18489#issuecomment-2440919752, https://github.com/vitejs/vite/issues/18489#issuecomment-3417066808,

sapphi-red avatar Oct 19 '25 11:10 sapphi-red

Interesting. Yeah since we had issues being confused of hmr: false not actually disabling websockets, I think it's worth considering a new ws option instead, or rename as ws and put hmr into ws.hmr: boolean.

I think we can discuss more in the next meeting, but migration-wise I think it'll hurt for sure but we can bring the change slowly like, (1) deprecating via types first, (2) log deprecation message v8.1?, (3) remove in v9.

bluwy avatar Oct 20 '25 01:10 bluwy

memo: go with server.ws

sapphi-red avatar Oct 29 '25 08:10 sapphi-red