shake for js/css projects with file watch?

104 views
Skip to first unread message

Thomas Koch

unread,
Aug 7, 2014, 12:37:07 PM8/7/14
to shake-bui...@googlegroups.com
Hi,

I'm curious to use shake for a PHP/JS project (that's where my money comes
from...). A major requirement are automatic and sub-second rebuilds on every
file change. I've seen [1]. Are there any news on this? There might be reusable
code in git-annex for cross-platform file-change notifications.

[1] http://stackoverflow.com/questions/18004102/how-can-i-use-the-shake-
library-to-build-a-reactive-build-system

Are there people who already have snippets for JS/CSS (SASS) compilation,
minification, testing, linting?

Thank you,

Thomas Koch

Bob Ippolito

unread,
Aug 7, 2014, 3:32:47 PM8/7/14
to Thomas Koch, shake-bui...@googlegroups.com
Have you tried to use hobbes, as suggested in the answer to that question? It's worked for me in the past (as a standalone tool, haven't tried it as a library), and does cross-platform file-change notifications. https://hackage.haskell.org/package/hobbes

Neil Mitchell

unread,
Aug 7, 2014, 4:52:09 PM8/7/14
to Bob Ippolito, Thomas Koch, shake-bui...@googlegroups.com
Hi Thomas,

Shake is sufficiently fast that I suspect you can just detect changes,
and then rerun Shake from scratch. Taking the example of the Ninja
build source (which I benchmark on every checkin), which is a 24
command build with 74 files, Shake from scratch takes 0.008s if
nothing needs building and 0.039 if everything needs building, minus
the time to run the commands. If that isn't fast enough, there's lots
I can do to cache the database in memory, avoid doing modtime checks
etc, but let me know if it's a problem. Using --timing or
shakeTimings=True to get some idea about where the time goes.

I certainly think there is some scope with integrating with Hobbes.
I've raised a ticket to either document how to do it, or perhaps
provide a helper function. I was thinking of implementing the logic on
4 from the StackOverflow question.

Thanks, Neil
Reply all
Reply to author
Forward
0 new messages