-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
feature request: create end-to-end dev serving solution with esbuild #537
Comments
of course this is just an opinion...
|
I know that this isn't exactly what you're looking for, but https://snowpack.dev/ is an opinionated dev server & build pipeline built on top of esbuild. May be worth checking out if you're interested in what tooling is growing around esbuild! |
I think this is actually in scope, as I wrote here: #21 (comment). Using a local server is hopefully more robust than file watching. I'm already most of the way there to an implementation of this, and of an incremental build API to go with it. Stay tuned! |
great stuff! quick comment: many newer JS browser features are not available when page is loaded via and if page is loaded via https, loading a module using http is blocked as mixed content is being phased out (starting with Chrome 80 and progressively more aggressive since then). perhaps adding a https server using self-signed certificate for dev server? |
Certs are tricky for different OSes and browsers that have different cert stores. I think if people need HTTPS they should use mkcert and a tiny reverse proxy? That's what their prod environment is going to be anyway. |
Sure, that's what I have in place already, custom reverse proxy https://github.com/vladmandic/piproxy. Goal here is to have something that works out-of-the-box for non-experienced user. And self-signed certs are not that tricky, it can be done inside NodeJS (not talking about wrapper for Unfortunately, APIs such as |
I'd argue that needing https and features like webcams are for experienced users. People are welcome to use one of the thousand existing dev servers on the market, or build their own. Dev servers are a slippery slope, and I've sure you've seen it time and time again that someone tries to build their own dev server and cert handler which ends up being several pages of documentation on how to setup path routing to their backend, headers + cors, proxies, middleware, compression, logging, websockets, and hmr... I don't know why that would be esbuild's job. I think it's great as a bundler that's embedded into larger packages like Snowpack to handle this use case. This is echoed in #537 (comment); Snowpack is a great solution for someone non-experienced wanting something out of the box. It has all the complicated features I'm talking about. It's also huge. I don't mean to throw shade, it's a lovely project, but a fresh install is 224 dependencies, 1981 files, and 13.6MB of code... (via npx howfat). I think we should keep that separate. |
Speaking of, your own PiProxy server that you link to takes 3 screens to display an example configuration. It looks like a very useful dev server, great work! I will check it out and learn from it, but I would also be sad to see its complexity as part of esbuild... |
oh, absulutely! :) |
This has now been released, and is documented here: https://esbuild.github.io/api/#serve. Good point about https. That might be the point at which it makes more sense to configure an external proxy, since certificate configuration can get pretty customized. |
big established bundlers have (to some level) capability to monitor sources for changes and rebuild/rebundle as needed.
additionally, for web development it's very useful to have a simple web server to serve bundled output.
strictly speaking this is all outside of the scope of esbuild, but it would be a very useful feature for larger community.
for example, i combine
chokidar
for file monitoring withesbuild
service to rebuild when triggered and nodejs built-inhttp2
module to serve it all for dev purposes: https://gist.github.com/vladmandic/9464558b5f5b583716ffba8f732f8cf2this feature request is nothing really new or challenging, it's just about polishing it and making it easily usable for larger community.
The text was updated successfully, but these errors were encountered: