Fly.js: New generation build system
github.com
github.com
That said, this is really interesting way of tackling a build system. I love the use of `exports` and generators make a lot of sense for this sort of control flow; I wrote a "block" system for Wordpress that used generators to allow you to render the blocks in a loop inside a template, pause execution of said loop and render more of the template, then continue on. Basically insertion points for completely dynamic layout and contents.
I am sorry I missed this post.
You are not required to create packages to use Fly! You can simply pass your transformer function to `Fly.prototype.filter` and be done with it. I think plugins should be true thin wrappers to whatever utilities you are trying to incorporate into your build task.
Compare this to gulp where you sometimes need to use vinyl and other abstractions, plus stream wrappers and other deps.
I'll upvote this mostly for the clever use of exports and (ab)use of generators.
my build system does the same as that Flyfile and add source maps to my coffee files, looks like this: http://pastebin.com/BtegzqVX
You could argue my polvo.yml file has more lines in it and it's less customisable compared to a script, but still i believe my .yml config is very organised and i can hook up any script to happen afterwards by appending a line to my beautiful makefile.
Not to say, with the "setup" target you could even install node.js or fly or whatever you need before even being able to execute fly.
EDIT: or at least, for me, this yaml-formatted bash script is functionally indistinguishable from a simple makefile.
Thanks! I agree with you. I understand the opinion of the person below, but I think there is room for improvement in this area so I am trying to make the build system the JavaScript community really deserves.
One question, if this is ES6, then why:
exports.foo = function* () {}
...instead of: export function* foo() {}
?The second snippet uses ES6 modules [2]. Babel actually transpiles those ES6 modules into CommonJS modules when used in a Node.js environment (which is the case with a build tool).
Since even IO.js doesn't support ES6 modules for now and you're likely to use a build tool in order to use babel, you shouldn't use ES6 modules in a build file.
[1]: http://www.commonjs.org/ [2]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
What is the primary advantage over make? I imagine it looks much easier to read for a novice than make, but there are probably much better reasons than this one.
anything different than this seems to become very messy super fast, specially compared to make files
not to say, using identantion kills a lot of stuff people use this days, like js linters and whatnot.
not saying this tools are not useful in specific circumstances, which i can happily say i never faced.
*with a "setup" target you could even install node.js or fly or whatever you need before even being able to execute fly.
Fly tasks are co-routine-wrapped generators, so you get modern async flow inside your tasks out of the box and right off the bat.
TBH I don't know exactly how Fly is better than make since I don't use make since college years.
I just found there's very little I needed them for that couldn't be resolved using a makefile or package.json scripts.
I legitimately love gulp though, because it finally let me grok streams.
I guess it depends a lot on your infra, but wouldn't (ba)sh be the most universal shell? so if shell = bash, then "shell script" = "bash script"
Also, plugins. Arguably, shell scripts are also a plugin ecosystem. Perhaps a less convenient one, it's hard to say from my perspective. It's definitely hard to find versionned coffeescript bash files.
That said, wouldn't it be wonderful if Windows had bash built-in?
People have already gotten tired of the JavaScript framework/build system/distribution tool bang. Improvements need to be more than incremental before people will choose to learn new APIs and be able to find new package ecosystems.
Gulp uses streams, this uses generators. Some folks may like the look and feel of generators more than streams.
If it came with a set of modules for other packages so people could at the very least try the demo version before they buy into it, and it really is that much cleaner and more powerful, then I think people could really get behind it.
The trick to making a successful JS package nowadays is marketing, honestly.
I find it disappointing how some people have such an allergic reaction to others trying something new. If you don't like it, don't use it.
Which is a valid point, IMO. When there already multiple widely-used tools that do X, marketing your new tool as "Does X!!!" isn't very compelling in itself.
The first thing I want to see on the project page is something like "Why you should use this new tool over existing proven build systems with already flourishing ecosystems".
I like to play with new ideas, and some of them don't end up hitting critical mass, but I appreciate their creation all the same. Often, they cause me to reconsider approaches I've taken on other projects.
I'm starting a new project tonight and will give this a go. It may not work, and all I've lost is a few hours. Creation for creation sake is what we should be about. Not everything should be about differentiators, and productivity gains. Sometimes, it's far more rewarding to just create, or to use someone else's creation. Almost every painting I have ever seen did nothing to differentiate itself in style, but I'm glad every single last one of them was painted.
Moving from callback-based programming to generators + promises is like going from burning logs in dirt pits to gas stovetops. A build tool that incorporates it successfully deserves a hard look, at least.
If an objective is for it to be simple to write and extend, why use two shiny new features that most programmers will be unfamiliar or inexperienced with?
I'm also reacting to the idea that staying with existing tools is a good idea. People make new tools to solve new problems. And Make has a ton of problems.
2) They do not contain shell-specific code like Makefiles with a bunch of bashisms in them.
So why not use autoconf or Cmake, then? Well, why would I want to write and maintain scripts in M4 when I can do it in javascript (the language I'm actually programming in)? And again you get into the configuration vs code question. Why should I rely on configurations files and learning how a complex tool works when I can write what I want to do in a scripting language (not-so-coincidentally the language I'm actually programming in)?
In fact, in our shop for various projects we use makefiles, shell scripts, rake and gulp/webpack. It's nice to use a tool that is set up for the idiosynchracies of the language you're programming in. We could make do with just one (probably rake since we do mostly ruby coding), but I can tell you with certainty that it would be more work than the varied ecosystem that we have.