yesodweb/yesod — Issue #271: Which folders to watch with yesod devel
Author: luite
Created: 2012-02-16 18:47:46+00:00
State: open

The current version of yesod devel does a lot of work to determine hamlet and other TH dependencies for haskell files. With the recent release of ghc 7.4.1 that includes the improvements by @gregwebs, the ugly parser stuff can be removed from `yesod devel`. However, this does mean that `yesod devel` does not know exactly anymore which file changes require the program to be rebuilt. My own wiki project for example stores data files in `wikidata/`, triggering a restart on every file change would be really annoying.

Any suggestions for what exactly to do? I have some ideas:

1. restart/recompile for all changes except hidden folders, sqlite files, `dist/` and `data/`, and ignore patterns in a `.devel_ignore` file. Suggest that users place runtime data in the `data/` dir.
2. use .hi files to determine dependencies, recompile only if .hi files say so (probably add exception for staticFiles)

I think 2 is a bit too complex, and I don't really like to force users too much to use a particular folder layout, but it's nice and simple Any other options?

I've just pushed bindings for fsevents to https://github.com/luite/hfsevents , which means that we can now get event-based filesystem watching on Linux (hinotify on hackage) and OS X. I'd like to update yesod devel to the new file-scanning code, to reduce its cpu usage and to make it pick up file changes much faster.