Skip to content

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

Merged
patak-cat merged 7 commits into
vitejs:mainfrom
emilefokkema:17627-fix-server-type
Jul 16, 2024
Merged

fix: make server type less restrictive (fix #17627)#17628
patak-cat merged 7 commits into
vitejs:mainfrom
emilefokkema:17627-fix-server-type

Conversation

@emilefokkema

Copy link
Copy Markdown
Contributor

Description

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

@bolt-new-by-stackblitz

Copy link
Copy Markdown

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

@bluwy bluwy left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
Contributor Author

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

Would you like me to remove the test I added?

@bluwy

bluwy commented Jul 16, 2024

Copy link
Copy Markdown
Member

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