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

fix: make server type less restrictive (fix #17627) #17628

Merged
merged 7 commits into from
Jul 16, 2024

Conversation

emilefokkema
Copy link
Contributor

Description

This fixes #17627 by making the type of server and server less restrictive.

Copy link

stackblitz bot commented Jul 7, 2024

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

Copy link
Member

@bluwy bluwy left a comment

Choose a reason for hiding this comment

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

The changes looks fine to me, though I'm not sure if we need tests for this. I think it's fine to omit them.

I've not seen it mentioned, but I believe the inconvenient typing is because of this?

export type HttpServer = http.Server | Http2SecureServer

The https possibility interferes when passing the server.httpServer.

@emilefokkema
Copy link
Contributor Author

@bluwy Exactly, that's where the inconvenience stems from.

Would you like me to remove the test I added?

@bluwy
Copy link
Member

bluwy commented Jul 16, 2024

Yes please, and appreciate the effort making the test! If another maintainer prefers keeping the test still, I don't mind, but I think at the moment it's rare to break it again.

@patak-dev patak-dev merged commit b55c32f into vitejs:main Jul 16, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Inconvenient typing of 'server' in 'middlewareMode' and 'hmr'
3 participants