Live data from Hacker News

Why we should stop using Grunt and Gulp

blog.keithcirkel.co.uk

21–30 of 108 posts

Re: Why we should stop using Grunt and Gulp

#21
tl;dr: The author meant to say "Use Browserify instead of Grunt/Gulp" but then got all confused and wrote some unrelated stuff about how npm has a case..esac statement built in.

While we're at the subject, might I suggest using webpack instead of browserify? It's roughly the same, but less buggy.

Re: Why we should stop using Grunt and Gulp

#22
I've found Grunt useful as I ended up using it for a large variety of tasks mostly related to building. However I also decided to stop using it but for a different reason than the article.

Grunt and Gulp kinda create a siloed set of tasks that are annoying to run in-line with the rest of the node application (different contexts). I never think I'm going to run into it until I somehow run into a situation where I want to run or re-run a specific task on an application that is already deployed. To do so now I have to install grunt in a production system and restart the application...or I simply code up my tasks into reusable bits of JavaScript that the normal application can use plus I can use npm to run them under normal conditions.

Honestly Grunt does help get things going really quickly but there are a lot of immature things about it and Gulp.

Re: Why we should stop using Grunt and Gulp

#23
I decided to code my own build library (https://github.com/jeswin/fora-build) instead of Grunt. Documentation needs to be better, so don't use this yet.

a) I wanted to use simple shell commands, like cp and mv. b) Instead of trying to learn how to use a plugin, it's often easier to just write a few lines of code. c) Wanted to use async goodness with generators. d)The important task the build library does is "watching".

Couple of example build scripts:

1) https://github.com/jeswin/fora/blob/master/server/build-conf...

2) https://github.com/jeswin/fora/blob/master/www-client/build-...

Re: Why we should stop using Grunt and Gulp

#24
In a project I worked recently we started using it because it was just "cool". It only had a jshint task. but gradually as the project evolved we added lot of tasks including minifying assets, configuring build for different API endpoints ( prod.api/dev.api ) , creating a zip file and deploying the code .

Re: Why we should stop using Grunt and Gulp

#25
i've used gulp for building frontend dependencies, as well as running automated tests whenever a file changes. It's been working well, with the exception that sometimes it just dies, and sometimes there's a failure and some streams dont work properly.

Re: Why we should stop using Grunt and Gulp

#26
post #10

Why don't people just use make?

Make has really horrific syntax and semantics, and doesn't integrate as nicely if you're dedicated to JavaScript. I mean, the Unix philosophy is about small programs that work together, not "only use old Unix tools". I'm reminded of https://news.ycombinator.com/item?id=5106767

The "horrific syntax and semantics" claim seems pretty drive-by, the variables and some function names might be arcane, but newer releases have nicer aliases for those who care for them. I don't know what is so horrific about the semantics though, they are pretty straightforward. A Makefile is a set of rules, each rule being a target file, its dependencies, and the recipe to turn the dependencies into the target. Make can figure out which steps need to actually run based on the states of the targets and dependencies (prereqs in Make terms). It's a really powerful way to describe the relationships and transformation steps for files, and you get partial builds for free! Not that make is without problems (the initiative behind DJB's redo addresses them at length) but unsubstantiated FUD isn't necessary.

Re: Why we should stop using Grunt and Gulp

#27

This article seems super weird -- do people actually use Grunt/Gulp to run a single command at a time? Most uses that I've encountered are along the lines of 'we've got this huge build process involving compass, sass, uglify, ng-annotate, and 13 other things', and Grunt/Gulp allow you to do the whole thing, automatically re-running on file changes, with a single command.

Same here, a bunch of complex & dependent tasks all boiled down to a few commands run often, and a bunch more less so.

I also use grunt-shell a great deal rather than find/write a new plugin, pretty decent way to call out to bash.

Re: Why we should stop using Grunt and Gulp

#28
post #26

Earlier quoted context omitted.

Make has really horrific syntax and semantics, and doesn't integrate as nicely if you're dedicated to JavaScript. I mean, the Unix philosophy is about small programs that work together, not "only use old Unix tools". I'm reminded of https://news.ycombinator.com/item?id=5106767

The "horrific syntax and semantics" claim seems pretty drive-by, the variables and some function names might be arcane, but newer releases have nicer aliases for those who care for them. I don't know what is so horrific about the semantics though, they are pretty straightforward. A Makefile is a set of rules, each rule being a target file, its dependencies, and the recipe to turn the dependencies into the target. Mak…

> unsubstantiated FUD isn't necessary

Sure.

...but to be fair, regardless of the make syntax, you've also got to look at the history of make, and what it's designed to achieve.

Make is for executing shell commands on file patterns with dependency rules.

It's not designed to use an ecosystem of plugins or have long running processes (eg. to run a local server or watch for file changes). It's not designed to be a scripting language (although it can be, since it's technically turing complete).

Now, when you look at other things which have come along to replace make as a build tool: cmake, grunt, gulp, ant, rake, maven, scons, premake, etc.

I think it's probably a little bit superscillious to suggest that all the people building these tools were just too retarded to realize how good make was.

More likely, they had specific needs that make didn't address.

Rust, for example, just recently had a reasonable make based solution, but they decided to depreciate it in favour of cargo, because it was simply too difficult to support in an appropriate cross platform manner.

Make isn't a bad tool; for very doing some specific things. Specifically building c code on unix-ish systems.

Is it the right tool for fetching the dependencies of and invoking a large set of ruby/javascript/python scripts and plugins to build the assets for a website, running a local development server and watching file changes and pushing livereload changes to the browser as the files change?

No. Make is absolutely rubbish at doing those things.

...not because make is rubbish, but because it's not for doing those sorts of things.

Re: Why we should stop using Grunt and Gulp

#29
post #10

Why don't people just use make?

FWIW, I do use make. I could not deal with gulp’s issues[1], so I wrote a little thing of my own, just to quickly whip up websites for my projects[2].

[1]: https://github.com/gulpjs/gulp/issues/651

[2]: https://cannot.mietek.io

Re: Why we should stop using Grunt and Gulp

#30
I simply use Make for all my web projects, whether it's a Ruby JSON API, or a React front-end. It's reliable, pre-installed everywhere, and can wrap anything in one consistent CLI. Why have to remember whether to type lein repl, pry, or rails console, when make repl will do everytime? Ditto, bundle install, npm install, lein deps => make deps. make server can easily wrap whatever command launches the server, make dev can easily use a filesystem watching tool to restart make server on any change. And beyond that, make can be used as usual to "compile" the project, ie. run whatever static analysis and preprocessing is necessary in the web world (jshint, jsx etc.).
Post reply on HN