DEV Community

Discussion on: Hot Reloading Go Programs – With Docker, Glide & Fresh

Collapse
 
matro profile image
൱αϯr๏ • Edited

Would a more flexible but general-purpose file-watcher like Modd be a replacement for Fresh? Or maybe an additional layer of watching/automation?

On one hand, this would add a system dependency rather than letting you rely on Go packages... but on the other hand, this lets you watch any/all files and directories in a project, so the "watch Glide's vendor folder" problem is solvable. In addition triggering tasks from watch patterns, Modd can also run and manage processes; so you could automatically run/restart/shutdown your Docker container here, plus run Fresh's watcher as well. Or if the project also has, say, some MkDocs content, its trivial to watch/build/serve your docs' HTML or just run mkdocs serve.

A heavier option for this kind of "watch the world and manage child-watchers" thing is Watchman, but I like the like Modd's simpler and more ad-hoc way of doing things.

Either way, I like leaving domain-specific watching to focused tools like Fresh (or available built-in functionality like what sass/compass and most static site generators ship with). Then something like Modd or Watchman lets me fill in the gaps, tie the domain-specific bits together, and watch a project as a whole. One command, and the whole dev. environment (and all it's supporting/peripheral bits) is up and running, live-reloaded wherever possible, and I'm one ctrl-c away from shutting it all down when my attention gets sucked away to something else.

Collapse
 
craigchilds94 profile image
Craig Childs

Thanks for the reply, that's a great suggestion! I'll take a look into it :)