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

Support Express v5 in @connectrpc/connect-fastify #1297

Merged

Conversation

timostamm
Copy link
Member

This relaxes the peer dependency constraint on express to include ^5.0.1.

Closes #1293.

Copy link
Member Author

@timostamm timostamm left a comment

Choose a reason for hiding this comment

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

  • Passes conformance tests
  • Example works as expected

Comment on lines +74 to +75
Note that Express does not support the Node.js `http2` module. You can serve the
Connect protocol and gRPC-Web with Express, but not gRPC.
Copy link
Member Author

Choose a reason for hiding this comment

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

V2 gRPC clients do not support H1: #1279

@@ -97,8 +97,10 @@ function main() {
switch (req.httpVersion) {
case HTTPVersion.HTTP_VERSION_1:
server = req.useTls
? https.createServer(serverOptions, app)
: http.createServer(app);
? // eslint-disable-next-line @typescript-eslint/no-misused-promises -- typing issue in express
Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure why eslint considers this to be a promise misuse. Either way, it isn't something we can fix, since it's an issue with Express' typings.

"tsx": "^4.19.0"
},
"peerDependencies": {
"express": "^4.18.2 || ^5.0.1",
Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure why we didn't have a peer dependency for express before.

@timostamm timostamm merged commit a7cfa96 into main Nov 4, 2024
47 checks passed
@timostamm timostamm deleted the tstamm/v2/Support-Express-v5-in-@connectrpc/connect-fastify branch November 4, 2024 15:09
@srikrsna-buf srikrsna-buf mentioned this pull request Nov 5, 2024
@srikrsna-buf srikrsna-buf mentioned this pull request Nov 19, 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.

Support Express v5 in @connectrpc/connect-express
2 participants