This diff replaces the dagit watch/no-watch behavior with a button
in the UI that can be clicked to relaunch Dagit (and refresh the web UI without
a page reload!)
There are a few things to discuss here:
- I removed watch/no-watch, but we could also disable --watch by default and leave it as an option.
- I think the old watch mode may have been partially broken because it watched './', meaning it would only work if you launched dagit from a repo folder. dagit.py doesn't do enough arg inspection to know where it should be watching. (Eg:, if you run dagit -y /Users/bengotow/Work/F376/Projects/dagster/examples/repository.yaml from your Desktop, it's monitoring your Desktop not the repo.)
- watchmedo only monitors directories, so we create a tmp directory containing a single file to monitor for changes.
- Some very whacky weakref magic causes dirs created via seven.TemporaryDirectory() to be deleted when watchmedo relaunches the child process. Moving the invocations of this outside of main() fixes it and I'd love to know why...
- The UI does not show a "unsaved changes" state. I think we can do this, but it'll be a bit complicated and we may decide we don't want it, so I'll explore that in a stacked diff.