News for hackers. Stuff that matters.
Re:Grunt 1.0.0 released by igl on Tuesday April 05, 2016 @06:29AM (#11429288)
Obsolete before it hit 1.0. While grunt/gulp was fun for a while... i am not looking back to our 800 line grunt file, complicated async configuration and the tons of dev-dependencies.

Webpack blew everything out of the water. 80 lines of config, hot-reloading, code-spliting, hash-filenames... Looking forward to whats coming next.

Re:Grunt 1.0.0 released by rkwz on Tuesday April 05, 2016 @07:37AM (#11429569)
The problem with Webpack is that if you want to do something that's not straightforward[1] or covered in the dozen tutorials that are on the web, you're going to have a hard time.

The docs are very basic and there are so many configuration params.

If you want to do something that's not covered in tutorials or boilerplates, be prepared to spend a ridiculous amount of time reading Webpack PRs, issues and the codebase.

Webpack does a great job and it's a nice concept but it has very bad documentation.

[1] Isomorphic apps, or multiple builds for i18n etc

Re:Grunt 1.0.0 released by amelius on Tuesday April 05, 2016 @08:32AM (#11429825)
> The problem with Webpack is that if you want to do something that's not straightforward[1] or covered in the dozen tutorials that are on the web, you're going to have a hard time.

I really hate systems that are built like that. Nobody should build software like that.

I just want simple tools with a clear API that I can combine together and easily replace by other tools, like in the Unix tradition.

I guess it is a case of "LEGO versus Playmobil". The former allows modularity, while the latter is just complex crap that allows you to do nothing other than what the instructions say.

Re:Grunt 1.0.0 released by igl on Tuesday April 05, 2016 @10:25AM (#11430591)
Webpack does not glob-search against the filesystem like grunt/gulp/brunch/broccoli/make. If you look for that: Sorry, webpack does not "replace" simple tools like that.

Think of it as a tool executing require.extensions at build time. It's not operating on files as much as it's looking directly at the source-code AST. That makes it more complex to get into over the glob tools but it's worth it.

It's also just as modular as anything else: http://npmsearch.com/?q=loader%20AND%20keywords:webpack

Re:Grunt 1.0.0 released by johnieeboy on Tuesday April 05, 2016 @11:51AM (#11431364)
Funny enough, if you look at the comments for pretty much the landing page of web pack you get the same sentiment

http://webpack.github.io/docs/what-is-webpack.html

Re:Grunt 1.0.0 released by petejodo on Tuesday April 05, 2016 @03:52PM (#11433775)
Yeah I agree with most of the sentiment but I let it by when you go to the github repo and check out contributor statistics. Pretty much it's just sokra doing everything and he does it in his free time last I heard. I think webpack is missing the support it needs in regards to how much it's actually getting used.
Re:Grunt 1.0.0 released by rhinoceraptor on Tuesday April 05, 2016 @12:17PM (#11431653)
I could not for the life of me get Webpack to bundle '.json' files that were require()d by some library code I was using. Of course, this functionality comes out of the box with Browserify.
Re:Grunt 1.0.0 released by aidos on Tuesday April 05, 2016 @07:15AM (#11429475)
I went through this in the last couple of weeks. After about a week of infuriating behaviour trying to get gulp/grunt working even remotely how I wanted (eg vendor stuff split so builds don't take 10 seconds) I decided to give webpack a shot.

For anyone else in this position, sorry to the gulp/grunt guys, but skip them - go straight for webpack. It's still taken a lot of work to get a config that works nicely for my usecase, but all in all the experience was really good and I was 80% of the way there in no time at all.

Re:Grunt 1.0.0 released by DiabloD3 on Tuesday April 05, 2016 @07:31AM (#11429543)
Grunt was nasty as hell, and clearly didn't learn any of the lessons from, say, proper Makefiles from the UNIX world over the past 30 years.

Gulp is a looooot better, especially when I have things like Foundation 6's zurb-template, which is basically configured out of the box how I setup my Foundation 5 era projects.

I don't care how big a Gulp file is if I'm not the one having to do major maintenance on it.

Re:Grunt 1.0.0 released by laichzeit0 on Tuesday April 05, 2016 @09:53AM (#11430339)
This is what I don't get.

Do authors of these build tools actually sit down for a couple of months looking at things like Makefiles that have been around forever, perhaps even Maven, etc. Take all these things together and go "This is what sucks in all of them, and here's how we can do it better" and still cater for all the use cases that these tools are brilliant at.

It's like there's no thought put into these tools and nothing is built on computer science foundations. Like why are you using Json as the syntax? Ant build files were an abomination and Json really isn't offering anything better (actually way less), except a slightly more readable syntax for trivial use cases.

Re:Grunt 1.0.0 released by oblio on Tuesday April 05, 2016 @10:05AM (#11430441)
I think not even Node or NPM learned any lessons from older tools. Look at the recent leftpad fiasco. A decent part of it could have been avoided with namespacing (hello Maven groupIds!). npm didn't have it from day 1 and even now it's optional and basically unused.
Re:Grunt 1.0.0 released by k__ on Tuesday April 05, 2016 @11:16AM (#11431001)
Haha, yes.

When I saw that LiveScript was using Makefiles[0] to build, I was baffled. To me they were ancient and complicated C/C++ stuff. But when I looked into them, everything seemed rather straight forward, even a bit nicer than Gulp, because of the syntax.

    [0] https://github.com/gkz/LiveScript/blob/master/Makefile
Re:Grunt 1.0.0 released by wmil on Tuesday April 05, 2016 @09:23PM (#11435932)
Makefiles have some glaring issues that can't be easily fixed.

The big one is that they break if there are spaces in file or directory names.

Sure, you can argue spaces are bad practice. But they are common on OS X and windows. It's a little silly to use a build system that doesn't support them.

Re:Grunt 1.0.0 released by DiabloD3 on Wednesday April 06, 2016 @12:04PM (#11439666)
That isn't entirely true. It depends entirely on how you quote your filenames. But yes, historically, there's a lot of broken Makefiles that way.
Re:Grunt 1.0.0 released by k__ on Wednesday April 06, 2016 @06:17AM (#11437826)
Ah, didn't know that.
Re:Grunt 1.0.0 released by rtpg on Tuesday April 05, 2016 @11:01AM (#11430863)
I don't get it, what part of Makefiles are missing in Grunt? I've set up a project pretty simply through Grunt without too many headaches (after grocking how to properly write base tasks)
Re:Grunt 1.0.0 released by DiabloD3 on Wednesday April 06, 2016 @12:05PM (#11439674)
The simplicity, plus Grunt has an entire ecosystem of already made tasks that none of them really work the same, so you have to learn the quirks of other people's code.

Its basically the NPM problem all over again, but as a build system, while also using NPM which doesn't make not not the NPM problem.

Re:Grunt 1.0.0 released by uhtred on Tuesday April 05, 2016 @08:51AM (#11429927)
Holy crap! I left a company 6 months ago and we were using Gulp there, and it was, as far as I am aware, the hot thing to use (I'm no front-end dev). Now you're telling me it is obsolete?! Javascript world is silly.
Re:Grunt 1.0.0 released by Akkuma on Tuesday April 05, 2016 @09:41AM (#11430256)
It isn't obsolete. Webpack just reduces task runners even more, since webpack takes care of taking your source, copying your source to your build/dist/whatever directory, minifying everything, creating hashes in filenames, being able to update html with those hash names, etc.. Basically, if you can use `import` on a file in Webpack 2 or `require` in either Webpack 1/2 you don't need Gulp/Grunt to do that work.

I personally work on things that still need other aspects of the task runners.

Re:Grunt 1.0.0 released by splintercell on Tuesday April 05, 2016 @10:27AM (#11430603)
I am sorry but if someone told me that the product which came out yesterday is obsolete then I'd understand that Javascript world is silly, but if at your company a product which was popular 3 years ago cool, then it's your company's fault.
Re:Grunt 1.0.0 released by biot on Tuesday April 05, 2016 @12:12PM (#11431597)
Javascript was popular 3 years ago. What new, cool thing have you moved on to?
Re:Grunt 1.0.0 released by scotty79 on Tuesday April 05, 2016 @06:32AM (#11429301)
I don't regret learning gulp. Node streams are bizarre, interesting construct and I'd probably had no chance to touch them but gulp made me understand them to the minute detail.
Re:Grunt 1.0.0 released by nailer on Tuesday April 05, 2016 @06:45AM (#11429350)
One thing this dissuaded me from webpack is that it markets itself on support for AMD and script tags - if you need JS modules that are only available as AMD or script tags in 2016 it's a worry.

That said, I use gulp now and a notice lot of gulp seems to be replicating parts of JS itself - tasks are just functions, I don't see why they need to be special. There's always 'gulp foo' which is a less maintained wrapper around 'foo'. And browserify seems slow to build bundles - is webpack any faster?

Re:Grunt 1.0.0 released by Ciantic on Tuesday April 05, 2016 @07:00AM (#11429400)
Markets itself with support for AMD and script tags? What are you talking about, it's all about bundling things automatically without script tags, you don't even need to write the damned html file if you use loader for it.

Also it may have support for AMD, but it's key usage is to bundle libraries from npm using commonjs.

I'm not saying webpack is all roses (even in version 2), but these two things are not the issue.

Re:Grunt 1.0.0 released by nailer on Tuesday April 05, 2016 @07:47AM (#11429607)
You misunderstand what I meant. Nobody has written or suggested that webpack outputs script tags or AMD. I simply stated that webpack markets itself as using script tags and AMD as input, which is true: from the meta description on webpack.github.io:

"Webpack is a module bundler. It packs CommonJs/AMD modules i. e. for the browser"

If you use AMD as input you have to get updates to your libraries separately, and your libraries are bloated since AMD modules tend to use dependencies less.

You should also check out https://news.ycombinator.com/newsguidelines.html.

Re:Grunt 1.0.0 released by pcr0 on Tuesday April 05, 2016 @08:45AM (#11429897)
Where does it say it uses script tags for input? The quote you mention says CommonJS/AMD. CommonJS is the de-facto standard these days. Typically, people write in ES6 imports, which then gets transpiled to CommonJS anyway.

It accepts AMD as an option, but honestly, I've been using webpack for about a month and I haven't come across a single library that recommends using AMD. It's just there as an option for those who need it. Most of the world has moved on from AMD due to its issues, so I can't really see your point.

Re:Grunt 1.0.0 released by mwhite on Tuesday April 05, 2016 @07:35PM (#11435451)
I think by script tags he means JS modules that only "export" things using globals.
Re:Grunt 1.0.0 released by nailer on Tuesday April 05, 2016 @10:53AM (#11430815)
You admit most of the world had moved on from AMD, but don't see why advertising AMD support as a main feature - to the point it's mentioned in the sites description - would dissuade people?

Being able to shim script tag libraries is mentioned in various places through the docs (and used to be even more prominent than it is now).

I'm responding out of charity here: you made an angry response, were shown to have misread the post, and haven't apologised. Be civil.

Re:Grunt 1.0.0 released by Ciantic on Tuesday April 05, 2016 @11:49AM (#11431346)
Mr. that was not my reply, and I didn't made a angry response... If you thought my characters conveyed angryness I apologize, I just critcized your points.
Re:Grunt 1.0.0 released by nailer on Tuesday April 05, 2016 @06:04PM (#11434926)
oops I didn't realise someone else chimed in.

Re your original post, the 'damned' and 'what are you talking about' and not reading my post charitably (that I was lying rather than just reading the site description) seemed rude. Thank you for apologising.

Re:Grunt 1.0.0 released by Cthulhu_ on Tuesday April 05, 2016 @10:42AM (#11430728)
The 800 lines are you or your team's own fault; it's just a file run in NodeJS, it's trivial to separate it in task-specific files and load them with either `require` or one of the `loader` projects. Build tooling (what Grunt is) configuration, maintenance and maintainability is also the responsibility of developers.

Of course, the async thing (and such) is something I agree with, newer tooling has iterated and improved on Grunt.

Re:Grunt 1.0.0 released by drinchev on Tuesday April 05, 2016 @11:27AM (#11431098)
Not everything is covered by webpack. And also you just replaced huge configuration with another huge configuration.

Webpack is amazing tool, but it's not a task runner like gulp.

Re:Grunt 1.0.0 released by chadscira on Tuesday April 05, 2016 @06:30AM (#11429291)
Totally agree, the key was loaders...