Comments on: On abandoning Gulp https://blog.berniesumption.com/software/on-abandoning-gulp/ Various writings on software development and photography Fri, 10 Aug 2018 08:19:11 +0000 hourly 1 https://wordpress.org/?v=4.9.11 By: bernie https://blog.berniesumption.com/software/on-abandoning-gulp/#comment-23795 Thu, 30 Nov 2017 12:34:36 +0000 http://blog.berniesumption.com/?p=795#comment-23795 To be clear, I didn’t post the Gulp file that the package.json replaced, but trust me it was hideous! If anything, syntax highlighting in Gulp files just serves to highlight all that unnecessary noise and implementation details, calls to .pipe(), functions etc. And this is just talking about readability – writability of Gulp files is even worse, for example getting calls to .pipe() in the wrong order will totally break things, so you need to understand what’s going on under the hood. Command line interfaces are more of a black box, and generally you can mix arguments around and not break things.

So yes I’d argue that the package.json was a big improvement, but you’re right that it could be further improved. Embedding shell scripts in JSON isn’t exactly pretty.

]]>
By: NotAScriptKiddy https://blog.berniesumption.com/software/on-abandoning-gulp/#comment-23794 Thu, 30 Nov 2017 11:21:57 +0000 http://blog.berniesumption.com/?p=795#comment-23794 You may continue to love you shell scripts. But to state that the posted package.json is more readable than a Gulp script or in any kind readable at all is just pure nonsense (just look at the highlighting…).

]]>
By: bernie https://blog.berniesumption.com/software/on-abandoning-gulp/#comment-20272 Thu, 15 Sep 2016 09:18:45 +0000 http://blog.berniesumption.com/?p=795#comment-20272 a) Yes. The example in the post doesn’t use it, but 6 months later I’m still using package scripts, and I’m doing watch mode perfectly happily. I use the watch mode built into many npm packages, e.g. with the –watch flag on the typescript compiler. If there’s no built in watch mode I use wr. I serve from live-server to get browser refresh.

b) I don’t notice my live builds being slow. One second from changing a file to seeing the changes reflect in the browser.

c) Yup, glorious, simple shell scripts. Love ’em.

]]>
By: Richard Rivers https://blog.berniesumption.com/software/on-abandoning-gulp/#comment-20239 Sun, 11 Sep 2016 17:19:32 +0000 http://blog.berniesumption.com/?p=795#comment-20239 It does makes certain sense in simplifying things, however its rather limiting in flexibility and speed.
a) Can your npm example do watch on files or folders and process only those files that had changed?
Moreover, in watch mode, Gulp code/tasks are already compiled and ready to run, fast. Npm scripts however runs a new npm each time and is slow.
b) Gulp pipes uses in-memory node stream which is much faster than disk io.
c) Gulp is basically javascript code, which gives it unlimited flexibility, including logical operations and running of shell scripts. Npm script is basically just console shell scripts alone.

]]>
By: Christopher https://blog.berniesumption.com/software/on-abandoning-gulp/#comment-16740 Tue, 26 Jan 2016 17:57:54 +0000 http://blog.berniesumption.com/?p=795#comment-16740 You may have discovered this by now but in package.json you can omit the `./node_modules/.bin/` when starting executables that were installed locally with npm.

I still use gulp, but I don’t want to force others to install gulp globally, so I do this:
“dependencies”: {
“gulp”: “latest”
},
“scripts”: {
“start”: “gulp build”
}

This will also let me switch to the next shinier gulp replacement without changing my build instructions at all. npm scripts are great, but it doesn’t have to be all or nothing.

]]>
By: bernie https://blog.berniesumption.com/software/on-abandoning-gulp/#comment-8438 Tue, 08 Sep 2015 10:21:33 +0000 http://blog.berniesumption.com/?p=795#comment-8438 ES6 modules (and the JSPM/system.js projects that will smooth their adoption) are going to be a great boon to the JS community and solve lots of problems with the current state of affairs.

Still, in a post-ES6 we’ll still need build systems. Your JS in a complex app will still need to be minified and concatenated, and the build handles other tasks like compiling LESS to CSS and generating regular versions of retina images.

Cheers,

Bernie :o)

]]>
By: Chad https://blog.berniesumption.com/software/on-abandoning-gulp/#comment-8390 Sun, 06 Sep 2015 21:31:14 +0000 http://blog.berniesumption.com/?p=795#comment-8390 Double win, use JSPM/system.js?

]]>
By: mp https://blog.berniesumption.com/software/on-abandoning-gulp/#comment-6194 Tue, 23 Jun 2015 10:51:37 +0000 http://blog.berniesumption.com/?p=795#comment-6194 BTW, you don’t need ./node_modules/.bin/ prefix for executables, npm handles that for you.

]]>