-
Notifications
You must be signed in to change notification settings - Fork 270
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
[Discussion] IO Watch Expressions #4851
base: trunk
Are you sure you want to change the base?
Conversation
Here's my use case and my thoughts, basically I'm just looking for a live-reload of
Similiar to
No real preference here.
I believe most dev servers kill the old one, not sure about this tho. |
My thoughts:
On every save. If someone has But one concern that I would have is if people have editors that auto-save every second or something. This could get really annoying for them. But I think that it would be reasonable to release it as a new feature and see whether people complain about this (maybe they just will use run instead of IO watch expressions?)
No strong preference is obvious to me right now, as long as I can ctrl-c it if we opt for the former.
The use-case that I have in mind is live reloading of an HTTP server, and in that case I think that we want to kill it. |
Does this imply that UCM is blocking for it to finish? Does a ctrl-c in UCM go to UCM itself (if you run a long-running history command) or to the IO watch; and if you have many IO watches, which one? |
@ChrisPenner hmm good questions. I wasn't considering the case of multiple One option is that ucm runs all IO watch expressions and blocks on the result, with ctrl-c interrupting all of them. But I feel like this could get annoying in the case of an HTTP server where you might not want to ctrl-c every time as you But if it just runs all of them in the background then it will be easy to forget that they might be running. And there isn't an obvious way to stop them. I'd imagine that the case of multiple running would be fairly rare unless we change So maybe we go with the blocking approach and try it on for size? If we are hesitant to commit to this feature we could put it behind some sort of flag. |
I'd agree with this, but I can imagine that Unison might be the exception here, because people would like to run multiple services at once to do some sortof test? Just because of how easy it is to do microservices.
For sure this though! 👍 even in Vite, Elixir-land or Scala live-reload isn't ideal, but they are comfy to use for almost everything. |
Just wanted to +1 this since it came up in discord (when discussing dev live-reloading for web apps) edit: I would probably use this to do |
Here's another perspective by
|
This is an old Branch I'm just making a PR for to open the discussion about it since it comes up in Discord quite often.
It proves the concept of
io>
watch expressions isn't too hard to build, it's more a matter of design at this point. Some questions:Certain use-cases require different permutations of these, maybe we can come up with 2 or 3 different types of watch expressions that handle each purpose, but finding good names and explaining how they work isn't trivial.