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

[webpack-dev-server and webpack-dev-middleware] Enable use other than express #4741

Open
anonrig opened this issue Feb 16, 2023 · 10 comments
Open

Comments

@anonrig
Copy link

anonrig commented Feb 16, 2023

Feature Proposal

I recommend migrating to Fastify rather than using Express. The performance impact will be 7x (according to fastify readme), and I think it would be a lot beneficial for everybody.

Feature Use Case

I didn't understand why I need to write my system information while proposing a feature, but...

  System:
    OS: macOS 13.2.1
  Binaries:
    Node: 19.6.0 - /opt/homebrew/bin/node
    Yarn: 1.22.19 - /opt/homebrew/bin/yarn
    npm: 9.4.0 - /opt/homebrew/bin/npm
  Browsers:
    Chrome: 109.0.5414.119
    Safari: 16.3
@ScriptedAlchemy
Copy link
Member

+1 on this, would improve startup times alot and the middleware apis are very similar if i recall.

@alexander-akait - thoughts?

@snitin315
Copy link
Member

We do have similar plans as mentioned in #4303. However, this is not yet prioritized. We will gladly accept a PR.

@alexander-akait
Copy link
Member

@ScriptedAlchemy Fully agree, but we should start with https://github.com/webpack/webpack-dev-middleware, now we have compatibility using fastify-express, but will be great to be more native here, I don't have deep experience, so I will be glad to get help here webpack/webpack-dev-middleware#945 (comment), do you want to help with dev middle and when we can do it here too 😄

@anonrig
Copy link
Author

anonrig commented Mar 7, 2023

@alexander-akait Is there a specific reason to keep support for Express? I don't see the point of supporting Express.js since it might create unnecessary abstraction and maintenance burdens.

@alexander-akait
Copy link
Member

@anonrig for dev server we don't need it, but webpack-dev-middleware should, because it is used for custom dev servers and we should support as much as possible, otherwise some developers will be angry 😄

@silverwind
Copy link

silverwind commented Mar 17, 2023

Personally, I prefer to just use node core http with router@2.0.0-beta.1 for the routing. Great performance, and supports express-compatible middleware.

@alexander-akait
Copy link
Member

@silverwind And you're right too, I think the best solution would be an abstract API, it takes time, but allow to use very fast and any other solutions.

Somebody want to try it (I will help), I personally think this is the right direction.

@alexander-akait alexander-akait changed the title Migrating to fastify Enable use other than express May 2, 2023
@alexander-akait alexander-akait changed the title Enable use other than express [webpack-dev-server and webpack-dev-middleware]Enable use other than express May 2, 2023
@alexander-akait alexander-akait changed the title [webpack-dev-server and webpack-dev-middleware]Enable use other than express [webpack-dev-server and webpack-dev-middleware] Enable use other than express May 2, 2023
@alexander-akait
Copy link
Member

Fixed:

@alexander-akait
Copy link
Member

alexander-akait commented Apr 24, 2024

Now we have tests only for express and connect I will add router and fastify and also add a http2 supports

@alexander-akait
Copy link
Member

In the next major release we will migrate from express to connect or router

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

No branches or pull requests

5 participants