ractivejs/ractive — pull request #1126 by Rich-Harris (2014-08-20 01:57:28+00:00)
Title: Gobble

I've been a bit quiet around these parts lately, largely because I've been working to get a couple of other projects off the ground. The first is [Esperanto](http://www.rich-harris.co.uk/esperanto/), a tool for transpiling ES6 modules to AMD/CommonJS (it had a brief moment in the [HN spotlight](https://news.ycombinator.com/item?id=8197988) today), the second is a new build tool called [gobble](https://github.com/gobblejs/gobble). This PR integrates both with Ractive.

Esperanto is just over 10 times faster than es6-module-transpiler, which we were previously using. As one of that project's devs noted, it doesn't fully capture ES6 module semantics (i.e. it doesn't handle cyclical dependencies), though aside from that it does a saner job of transpiling the syntax than the alternatives (including some of the syntax that es6-module-transpiler and traceur can't handle!). Since we don't need cyclicality, Esperanto is a better fit for Ractive.

Gobble isn't quite ready for primetime, but it's getting there, so in the spirit of dogfooding I've added a `gobblefile.js` in this PR. To prevent any cockups, I've left the existing `brocfile.js` and associated Grunt config in place.

To run gobble, you'll first need to `npm install` this repo's new devDependencies, then install gobble itself:

```bash
npm install -g gobble
```

Then, inside the project folder, type

```bash
gobble
```

and it will serve everything to [localhost:4567](http://localhost:4567).

Gobble is heavily inspired by [broccoli](https://github.com/broccolijs/broccoli), but with more of a focus on ease of use and debuggability. Typically, a gobblefile is about half the size of an equivalent brocfile, and writing plugins for gobble is far easier than for other build tools ([some comparisons here](https://github.com/gobblejs/gobble#sneak-preview)). It works hard to give you helpful error messages, e.g. instead of printing `EADDRINUSE` along with a stack trace, it'll say

```bash
port 4567 is already in use. Are you already running gobble? You can specify a different port with e.g. gobble -p 5678.
```

It hasn't been heavily optimised, but typically runs about 10-20% faster than broccoli according to my (somewhat biased) observations, both on initial and incremental builds. So once it reaches feature parity (e.g. livereload support) I'm hopeful that we can use gobble exclusively.