gob
gob copied to clipboard
Smarter dependency watching
Because of OSX fs watcher limits, instead of dropping a watcher in every single package, it would be nice to find the lowest common ancestor for a bundle of dependencies and watch recursively from that root.
Hiyo!
https://github.com/b1lly/gob/tree/master/dependencies
Did we not want to add a weighted aspect - i.e. dependencies used more heavily throughout a package are more important to watch?
That's definitely a good question, I'm totally open to doing this. I assume to do this, we'd need to get the imports for a package at the file level in order to figure out how many occurrences throughout the built package. This is what you're referring too right?
Currently it recognizes dependencies used cross-package as duplicates and weights them heavier during prioritization.
I wrote a little tool that does this during gophercon - I'll push it to develop when I get a chance.
I pushed this tool now, it exposes a useful API (I think).
https://godoc.org/github.com/ttacon/heavydep