-
-
Notifications
You must be signed in to change notification settings - Fork 6.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: allow disabling ws server completely if hmr: false
#2474
Conversation
@danielroe is this condition right? |
@danielroe happens 🙈 I was just curious and it struck me why would you want to do the opposite 😅 |
@danielroe sorry to bother but this should solve the issue (nuxt/vite#70), right? When do you think it could be released? I'd love to use vite in this particular project. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As mentioned in the comments. Marked as changed requested for tracking
Apologies for the delay. An initial mock implementation done. Very happy for changes to be made 👍 |
From our last meeting with Evan, our concern is that the Websocket Server is not only for HMR but also for page reloading or plugins. And it's not very clear why you want to disable this completely, can you provide more context? Thanks |
In my case I need sometimes to see what's going on on dev/staging server, thus I need dev environment. It's possible to set it up in plain vue, but impossible in nuxt -> I need to startup dev server but without all of the HMR as nothing changes on file system. I tried to configure reverse proxy to work with the websocket, but without any success so far. |
@danielroe is this feat still needed? Maybe we should close this one if it isnt longer blocking you |
I think there might be other issues that could be resolved by this? Not 100% sure that they're related, but I found this PR referenced while investigating the CodeSandbox issue (which also happens with |
Closing this one, IIUC, this isn't an issue for Nuxt at this point. @danielroe would you open an issue to keep discussing the use cases for something like this if it is still required? |
why close this. |
I've encountered wanting to disable this during development because we don't use have a SPA app that we want reloading, instead we will just reload the page as needed. While |
#6315 has more info on how the ws server is still needed. |
I've also run into the same use case where I can't have a websocket connection. Totally cool with a separate config as I can see how it's confusing to tie the websocket functionality to hmr when the websocket is used for other things. I'd like to propose something like this: ...
server: {
ws: false
}
... |
Vite exposes the option of disabling HMR completely. I'd welcome a contrary opinion, but there seems to be no reason to start a WS server in this case, and there are reasons why users might want to have it disabled.
In this instance we might also consider not attempting a connection in
packages/vite/src/client/client.ts
either, or disabling the client completely.