Live data from Hacker News

The Hitchhiker's Guide to Modern JavaScript Tooling

reactkungfu.com

21–30 of 120 posts

Re: The Hitchhiker's Guide to Modern JavaScript Tooling

#21
post #3

Gulp is really great and better, than Grunt, but sometimes make seems to be a good choice that people forget about.

since i switched to webpack, i've had very little reason to use gulp in my projects.

Anything extra was very easily managed by some simple Makefiles.

Re: The Hitchhiker's Guide to Modern JavaScript Tooling

#22
post #10
post #8

Very useful. This will be required reading for all our students :) I created a react/grunt/browserify/babelify (+bootstrap) starter repo to clone from github for them but think it's still confusing. This provides much needed background information in one bundled place (even though the stack is slightly different and only mentions grunt).

That repo sounds like a good candidate for replacement with a Yeoman generator!

Yep pretty much a planned project but for now I'm keeping everything as sort of a learning exercise. master is ES5 and I have an es6 branch. The idea is to have students look at the ES5 version first to appreciate the ES6 changes. [actually a basic git primer is the first step :D]

The more practical solution would indeed be yeoman (imo)

Re: The Hitchhiker's Guide to Modern JavaScript Tooling

#23
post #17
post #3

Gulp is really great and better, than Grunt, but sometimes make seems to be a good choice that people forget about.

I'd rather use JS than add shell mixed in with Makefile. Two extra languages just to run a build system seems like adding unnecessary complexity.

I find it depends on the scale of the project. If I just need something to encapsulate my test runner and packing tool invocations, then I'll just toss those in a five-line Makefile, because why add a heavyweight build tool most of whose capabilities I'm not going to exercise?

Re: The Hitchhiker's Guide to Modern JavaScript Tooling

#24
post #13

I think it's good to note that you don't actually need a single one of these tools to make functioning software. You can pack your scripts with cat and download libraries with wget and use regular old JavaScript without transpilers. When you have a problem with this, you can use tools... But you don't have to top-load every project with a whole suite of complex tools just for the sake of it.

No one needs anything. You can write code in notepad. No one wants that, and no one wants to have a million globals on the browser or hit F5 every single save any more. While there is a learning curve to something like gulp, you really only need to set it up once and you can use it on every project as simply as typing "npm i".

Re: The Hitchhiker's Guide to Modern JavaScript Tooling

#25
post #16
post #13

I think it's good to note that you don't actually need a single one of these tools to make functioning software. You can pack your scripts with cat and download libraries with wget and use regular old JavaScript without transpilers. When you have a problem with this, you can use tools... But you don't have to top-load every project with a whole suite of complex tools just for the sake of it.

Well, you do at minimum need something that understands CommonJS modules, if you want to pack isomorphic code to run in the browser, so you need Browserify or Webpack. And you need a module downloader that resolves and installs dependencies, so you need NPM and/or Bower. And, if you want to write unit tests (which you should!) then you need a Javascript test harness, because otherwise you're going to have a bad time…

> Well, you do at minimum need something that understands CommonJS modules, if you want to pack isomorphic code to run in the browser, so you need Browserify or Webpack.

No, you don't. These are optional. You only need these for larger applications that need packing.

> And you need a module downloader that resolves and installs dependencies, so you need NPM and/or Bower.

No, you don't. You can manually keep things up to date.

> And, if you want to write unit tests (which you should!) then you need a Javascript test harness, because otherwise you're going to have a bad time instantiating your modules and injecting mocks into them.

Okay, you probably do need this.

Re: The Hitchhiker's Guide to Modern JavaScript Tooling

#26
post #3

Gulp is really great and better, than Grunt, but sometimes make seems to be a good choice that people forget about.

Yes, I feel like both Gulp and Grunt miss something fundamental that Make still has. I don't want to depend on other people's plugins for basic tasks and I want to only rebuild the stuff that changed. I tried Gulp with some 'notice if changed' plugins but it didn't seem to work so I end up sticking to Make.

Some of my Make build systems have gotten a bit unwieldy so recently I have been looking at using Ninja and ninja-build-gen from npm. This way I can still write my configure and my build tasks in JS/CoffeeScript and get to use a modern less cluttered version of Make that will scale well with the project.

Re: The Hitchhiker's Guide to Modern JavaScript Tooling

#27
post #11

We talk about "modern JavaScript tooling" but year after year, the list essentially stays the same. Maybe few new players have appeared (Gulp, WebPack, Babeljs) but they do exactly the same thing that the tools we had before (e.g. Grunt, Browserify, Traceur). It occurs to me that "modern JavaScript tooling" is growing only vertically (better tools to build, better tools to modularize, better tools to transpilation),…

> * better editors for HTML/CSS, maybe even some decent WYSIWYG

Editors? How about an IDE.

In the java environment I can manage an application container, profiler, debugger, compiler, packager, test suite all from one application.

Also included: near-omniscient auto-complete, hot-code replace, incremental building, dependency fetching, visual version control, automatic refactoring, deployment and many other conveniences I'm taking for granted. Hell, I could even file tickets from my IDE if I wanted to.

Re: The Hitchhiker's Guide to Modern JavaScript Tooling

#28
post #3

Gulp is really great and better, than Grunt, but sometimes make seems to be a good choice that people forget about.

since i switched to webpack, i've had very little reason to use gulp in my projects. Anything extra was very easily managed by some simple Makefiles.

Same here.

It didn't just eliminate the use of gulp for much things, but also minimized the boilerplate I needed to get this stuff done in gulp.

Everything is just a "loader" away and doesn't need much configuration.

I even got rid of Bower for most libraries.

Re: The Hitchhiker's Guide to Modern JavaScript Tooling

#30
post #24
post #13

I think it's good to note that you don't actually need a single one of these tools to make functioning software. You can pack your scripts with cat and download libraries with wget and use regular old JavaScript without transpilers. When you have a problem with this, you can use tools... But you don't have to top-load every project with a whole suite of complex tools just for the sake of it.

No one needs anything. You can write code in notepad. No one wants that, and no one wants to have a million globals on the browser or hit F5 every single save any more. While there is a learning curve to something like gulp, you really only need to set it up once and you can use it on every project as simply as typing "npm i".

I wrote code in Notepad for years. Often now I use cat instead. Sometimes even ed, which is surprisingly useful for many editing tasks. Knowing how to do things in the most basic, fundamental way is nourishing. And I've heard from many people that the JavaScript ecosystem—by which they seem to mean all the stuff they hear that everyone else is using—makes them feel overwhelmed. So it's good to have this clear explanation of the "modern" tools. But it's also good to know that it's all optional and that you can start without them. It is entirely possible to make a modern web application with just a few plain JS files included with script tags. Yet people think the first step is to learn about half a dozen sophisticated tools that they don't even know why they need. So I say start with Notepad. Be aware that there are popular tools to improve your workflow... But also that sometimes the best workflow is the one you fully understand.
Post reply on HN