Live data from Hacker News

Why I Left Gulp and Grunt for Npm Scripts

medium.com

41–50 of 75 posts

Re: Why I Left Gulp and Grunt for Npm Scripts

#41
post #30

> Misconception #3: Gulp’s Streams Are Necessary for Fast Builds The author fails to acknowledge that gulp is also asynchronous. This is what makes it "fast". Streaming is just a nice abstraction for passing data through a pipeline. Sure you can do async on command line but that's not trivial and the author doesn't address that.

'make -j' seems trivial enough to me.

Re: Why I Left Gulp and Grunt for Npm Scripts

#43
post #35

I may not have been in the node and npm space long enough to fully understand the point of this, but it sounds like the endless argument of "stop using jQuery and go with raw Javascript instead". The argument goes that modern Javascript has moved far enough along that a library like jQuery is not as necessary. But the majority of the examples I've seen of how to avoid jQuery means essentially coding your own custom v…

There is definitely a level of that in the article. "Use command line tools. Or, if it gets complex, make a .js file and use ShellJS" is basically suggesting you create your own version of the plugins already available.

Re: Why I Left Gulp and Grunt for Npm Scripts

#45
post #38

Earlier quoted context omitted.

We don't choose our tools, the customer's IT does it, so are the wonders of consulting when you work on existing projects. And they choose them, because they follow fashion.

Do your customers really dictate that you use grunt or gulp in your build process in their project? I seriously find this to be very implausible.

I seriously find this to be very implausible.

Why? If they're already using gulp and have people in-house that understand gulp, why is it so unreasonable that they don't want their consultants adding a new build system to the mix?

Re: Why I Left Gulp and Grunt for Npm Scripts

#46

This. A thousand times this. Embrace the unix philosophy of small tools and npm scripts and watch your baroque frontend build process with all its plugin dependencies reduce to amazing simplicity. Here's another good write up with some significantly more useful examples: http://blog.keithcirkel.co.uk/how-to-use-npm-as-a-build-tool... > Package.json also doesn’t support variables Not sure what he means by this, npm sc…

Gulp does embrace the unix philosophy of small tools and piping output.

Re: Why I Left Gulp and Grunt for Npm Scripts

#47
post #35

I may not have been in the node and npm space long enough to fully understand the point of this, but it sounds like the endless argument of "stop using jQuery and go with raw Javascript instead". The argument goes that modern Javascript has moved far enough along that a library like jQuery is not as necessary. But the majority of the examples I've seen of how to avoid jQuery means essentially coding your own custom v…

It is nothing like that. Npm/node is the task runner and you are not doing anything yourself that you wouldn't have to do with grunt/gulp anyway. They are the equivalent of making a function like `add(a, b) { return a + b; }` instead of just using the `+` operator that is already there, it is nothing like jQuery vs "raw javascript".

Re: Why I Left Gulp and Grunt for Npm Scripts

#48
post #45

Earlier quoted context omitted.

Do your customers really dictate that you use grunt or gulp in your build process in their project? I seriously find this to be very implausible.

I seriously find this to be very implausible. Why? If they're already using gulp and have people in-house that understand gulp, why is it so unreasonable that they don't want their consultants adding a new build system to the mix?

Well, I was implying that those projects in question are greenfield not inherited ones but even in the case of inherited projects, I think that devs/consultants have bargaining power when negotiating contracts to work out a compromise when it comes to non core details of the project like build systems and the like and project owners or managers could accommodate the consultants' requests regarding these points.

Re: Why I Left Gulp and Grunt for Npm Scripts

#50
Many a time I have begun a node project, and many a time I have started under the basic premise of "I'll just use an npm task for this one little build task". Task runners do seem to add a bit of complexity to a project which new contributors sometimes find friction in. As the project grows and I add more and more tasks - for linting, building sub projects, testing, etc - I end up writing "glue" js files which get called by npm to get the desired output of a library or tool, or to compose a set of tools in the way I need. After a while you realize its been done before, and in a composable way - you're writing gulp and grunt tasks without actually calling gulp or grunt, and you've ceded reusing any existing code for it. Upon this realization I normally realize I can pull in gulp and then discard a large chunk of my handwritten tasks in favor of easily composing task runner plugins.

Also, minor nit: The author claims `&&` is "cross platform". I regret to inform him it is not. It may well work for bash and cmd.exe but it has been disallowed as a command seperator in powershell for a few versions. Aiming for cross-shell compatible commands is more of a minefield than you'd expect - I actually knew someone who'd rewired a ruby DSL to use for a shell. I've found it best for crossplat to write as much in JS as possible and just let npm tasks call out to scripts, to use as little of the shell as possible.

Post reply on HN