Hacker News new | ask | show | jobs
by greggman 4122 days ago
I probably just don't have enough experience. I like the idea that Grunt and Gulp are written in JS so using JS to build JS seems like a win.

But...., aren't build systems supposed to do dependency checking and just built the minimal amount of stuff? Maybe few JS projects are big enough for it to matter or maybe I missed where the dependencies are checked but AFAICT the default is to build everything always.

3 comments

Grunt doesn't do dirty-file dependency checking. Gulp does, sort of, but it's awkward.

There are many, many build tools in JS-land. Grunt and Gulp happen to be the most popular. (This isn't really due to technical merit. They're popular mostly because they're popular.) My personal favorite is Jake, which is a classic Rake-like (or Make-like) tool.

Or instead of a Make-like tool you could just use Make itself :) Works really well.
You could, but I much prefer more expressive tools. Make's DSL is spectacularly crappy.
You can do dependency check via Bower + NPM.

Your grunt or glup file can run a command to check for those dependency and update it via bower and npm.

Bower are for front end dependency check and NPM are for the backend dependency check.

Grunt and Glup are more of a task management system where you run tasks. Such as transpiling your jade/haml/sass, minifying your js, running your test cases. You can run these tasks in specific orders.

There's also gruntfile too but it's been a while since I've use these things. I think gruntfile are for grunt specific module for tasks though, so it'll dependency check grunt modules?

I'm a recovering frontend guy, well at least I did front end in a few gigs that were suppose to be fullstack.

greggman is talking about dependencies between build targets (such as files or directories or projects), eg: "lib.js depends on lib.coffee" + "lib.coffee's last modified time > lib.js's last modified time" = "must run task that regenerates lib.js"
First the build tool needs to load the build files that declare the dependencies, so it knows which dependencies to check. For big, distributed projects, this step can be slow.
Could this not be cached? If deps aren't changing, why do them all from scratch?