ES6 Module Transpiler - Tomorrow's JavaScript module syntax today
corner.squareup.com
corner.squareup.com
The next step would be to take this and use it to polyfill the ES6 Loader API (probably using something like the require.js loader, but doing the actual transpilation in JavaScript). I also hope that people build tools on top for things like grunt, brunch and other common build tools.
There's still a lot of work to be done before final approval of the module spec, but I hope that wider use of the module syntax will provide some much-needed perspective on the syntax and how it is likely to be used.
One important point: I wrote the original Ruby version of this when single-export was still a part of the proposal. It has since been deferred (although that may still change again! We live in interesting times).
To emulate single export using ES6 modules (this syntax is not yet supported by the transpiler, but it should be):
// glob.js
function module() {
// implementation of glob
}
export module;
// glob_user.js
import { module: glob } from "glob";
glob("**/*.js");
I hope that the transpiler continues to track the current state of the spec as it moves towards completion :)I hope you don't mind if I ask, how do you organize your projects? How do you organize Ember.js development? Is there a package manager out there that does bower/volo/componet install X and also adds it to my RequireJS config? or is this still done manually? Is there a bullet proof grunt configuration that you would recommend? any skeleton projects that you would use? I find it really hard to come up with a best practice, when there are so many possible practices, so your opinion is highly appreciated.
Sorry for the a bit off topic question, but thought others might benefit from your answer.
I'd bet that it will within a year (or maybe even a few months if we get lucky!)
That's the preferred way to export a single function in CommonJS/Node, and one of the main sticking points in the current ES6 spec.