Skip to content

Conversation

@emilefokkema
Copy link
Contributor

Description

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

@bolt-new-by-stackblitz
Copy link

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
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