Skip to content
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: add an option to not start a websocket server #16219

Merged
merged 3 commits into from
May 29, 2024

Conversation

sheremet-va
Copy link
Member

Description

This PR adds an option server.ws that can only be equal to false. I wasn't sure if I should change server.hmr type (make it nullable like the watcher?), so I added a new one. If we want to use server.hmr, we would need to replace all server.hmr === false.

Also, do we want to document this option?

Closes #14328

Additional context


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines, especially the Pull Request Guidelines.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Update the corresponding documentation if needed.
  • Ideally, include relevant tests that fail without this PR but pass with it.

Copy link

stackblitz bot commented Mar 20, 2024

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@sheremet-va sheremet-va added the p2-nice-to-have Not breaking anything but nice to have (priority) label Mar 20, 2024
@bluwy
Copy link
Member

bluwy commented Apr 9, 2024

@sheremet-va Is this something you'd like to get out soon? I think we can merge this in a patch since it's not a big change, otherwise if it's not urgent we can queue this for the next minor.

@sheremet-va
Copy link
Member Author

@sheremet-va Is this something you'd like to get out soon? I think we can merge this in a patch since it's not a big change, otherwise if it's not urgent we can queue this for the next minor.

I am fine with it being in a minor. I am using a workaround by assigning a dummy hmr.server for now.

@bluwy bluwy added this to the 5.3 milestone Apr 9, 2024
@bluwy bluwy merged commit 14b5ced into vitejs:main May 29, 2024
10 checks passed
@sheremet-va sheremet-va deleted the feat/add-ws-false branch May 29, 2024 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p2-nice-to-have Not breaking anything but nice to have (priority)
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Running two vite servers with middleware mode prints websocket error
3 participants