-
Notifications
You must be signed in to change notification settings - Fork 385
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(utils): replace fastify and express with tinyhttp and friends #7050
base: main
Are you sure you want to change the base?
feat(utils): replace fastify and express with tinyhttp and friends #7050
Conversation
…tlessguy/cli into remove-fastify-and-express
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🙌🏼 Thanks for taking this on! I've taken a first pass at reviewing it. Could you please give this a quick rebase and take a look at my comments? I haven't had time to debug your integration tests yet, but I'll get to it soon.
await server.listen({ port: settings.frameworkPort }) | ||
const [address] = server.addresses() | ||
|
||
const server = createServer((req, res) => app.handler(req as Request, res as Response)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Type assertions are unsafe. Why is there a mismatch here? How can we resolve it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tinyhttp's Request and Response extend node:http
's Request and Response. Probably could pass as a generic to createServer
but if I recall correctly, it throws a type error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a TypeScript issue with extension depth. Request
extends IncomingMessage
, which itself extends Stream
. TypeScript thinks that Request
doesn't extend Stream
because of that, even though it does
🎉 Thanks for submitting a pull request! 🎉
Summary
Replaces express, express-loggin, fastify and fastify-static with tinyhttp, @tinyhttp/logger, sirv and milliparsec
See e18e/ecosystem-issues#156
For us to review and ship your PR efficiently, please perform the following steps:
passes our tests.
A picture of a cute animal (not mandatory, but encouraged)