-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
deno watch for web development #2401
Comments
Duplicate of #1826 |
I'd say it's related rather than a duplicate. #1826 is about the I also found #2251 which is related. It's about "automatically restarting the server". I think the solution to that would be the subcommand / flag. |
Once #1826 is done, I would consider this. Tho it would need to be carefully specified - and I'm not sure if it can be accomplished in general. |
Now, when #1826 is done, we can consider this again. Based on another issue #4830 I implemented a small typescript script. https://github.com/Caesar2011/rhinoder This could at least be used for |
I have made denon which serves the same purpose but with a bit more configurability. |
Don't think that this should be part of Deno core anymore, closing. |
@MarkTiedemann I think this should be part of Deno core. We already have unit test, code format, bundler, .etc. Watch for development must be major piece of Deno core as well. |
Consider |
First of all, I think Deno is fast enough that you don't really need a watcher. Just Then there's two arguments I made when originally opening this issue:
2, I think, is out of scope anyways. Deno should not have live-reload integration or some hacky server-sent events that trigger in-browser refresh, as I originally proposed. In retrospect, I think that is a dumb idea. If you really need something like that, write it yourself, put it on GitHub - but I don't think this should ever be in core. 1, I think, is doable and could potentially be in core some day. But then again, I don't think If someone wants to open another issue for this, feel free. This one I'd like to keep closed. |
@MarkTiedemann Closing the whole issue because 2 isn't a good idea but 1 would be a big win. It is very common when working on an API application to restart deno. The sad part is right now I use Node.js nodemon to do it.
But will gladly open another issue to be more clear with what is needed and the win for having it in the core. |
Also, there is |
I was surprised seeing that there is no watch mode for development purposes in Deno (correct me if I am wrong). After going through Deno's philosophy, IMO it shouldn't be the case that I already have to fallback to nodemon or a third-party (?) like denon for this. This is a core developer experience issue for me. |
Just in case someone is wondering, #7382 got merged successfully 22 days ago |
|
Seems like deno run --watch=./**/*.ts,./**/*.tsx server.ts |
@asbjornu Through research at jurassiscripts/velociraptor#80 we found out |
Would love to have a better web development experience with Deno out of the box.
For the server, I'd like to propose a
deno watch
subcommand ordeno run --watch
flag that automatically restarts the server in a controlled way, e.g.If we also had a
Deno.watch
API for watching directories or files, we could then implement a simple client refresh via server-sent events (example) or web sockets.EDIT: It would be nice if the
watch
subcommand/flag would be able to notify the running code that it will/should be restarted - maybe something via signals (e.g.SIGUSR1
), command line flags, some API, or a similar mechanism - so that the server could notify the client that it will be restarted and that the client needs to be reloaded.The text was updated successfully, but these errors were encountered: