Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Implement Traceur compilation for modules/ES.Next #214

paulirish opened this Issue Aug 16, 2012 · 20 comments


None yet
6 participants

paulirish commented Aug 16, 2012

RIght now we're using require-hm for our ES6 Modules support. It looks like Traceur covers the complete scope of what require-hm does, plus can transpile down to ES5 a whole lot fo goodness from ES6 and Beyond.

On it's modules support, from primary developer Erik Arvidsson:

Actually I don't see anything in require-hm that traceur does not support. The major thing that is not supported in Traceur is mutually recursive modules and RequireJS does not support those either.

If we can get all modules and the ES Next goodness for free for all users, it'd be excellent. First-class support for Coffeescript & ES6 transpilation. \o/


addyosmani commented Aug 16, 2012

I can take another look at this tomorrow. I probably have some rough work with integration lying around from the first time we looked at it. Was also thinking how hot it would be to get all the ES Next support Traceur offers out of the box, so like minds there :D


sindresorhus commented Aug 16, 2012

++++ \o/ ++++

Regardless of how much ES6 you use doesn't traceur include the whole ~200kb lib it requires once you've compiled to ES5?


addyosmani commented Aug 17, 2012

I'll double check with the Traceur team that it doesn't but if it does, I think its acceptable given it would still live under 'experimental support for ES6' and not recommended for prod :)


addyosmani commented Aug 17, 2012

Boom: https://github.com/addyosmani/traceur - Traceur support via node that we can go and create a task with (I'll do that next week).

@ryanseddon with respect to your question:

There is currently a "runtime.js" which is small but needed. I'm (Alex Russell) working on removing Tue need for this so that the generated code is standalone. In neither case, though, is all of traceur needed at runtime

I just added support to inline modules at compile time. This allows you to compile one es6 with external dependencies into a single file. This is just a command line tool at this point but I don't see why the same code could not be used on a node web server.

Nice thanks @addyosmani

@ghost ghost assigned addyosmani Aug 24, 2012


addyosmani commented Nov 14, 2012

Moving to 1.1


sindresorhus commented Jan 31, 2013

ping @addyosmani ref grunt task

I am gonna take a look at this also. I need a grunt task for Traceur.


addyosmani commented Feb 17, 2013

Feel free to build on the node traceur work previously started for this. Would love to see it implemented as a grunt task.

Close. Maybe tonight I will be done. When I am done I will want your feedback.


addyosmani commented Feb 19, 2013


So far. I just barely got it working. I need to see about getting sourcemaps included, and need to do some testing to make sure it is good. Also need to add documentation about including the runtime.js file into their code.

To answer a previous question, it doesn't force you to include the entire 200kb traceur.js file. HOWEVER, you have to include the runtime.js file though (~13kb), which helps shim some final functionality into your environment.

Will post once I have something more final. I am very excited about this!


addyosmani commented May 12, 2013

@sindresorhus @paul_Irish as there are now quite a few grunt tasks that solve this problem for us shall we make a call on whether we want Traceur support in our webapp generator or not? If not we can close this issue otherwise I can put together a PR post I/O.


sindresorhus commented May 12, 2013

I'd say yes; though as long as it works perfectly.

But not until the open issues on grunt-traceur are fixed, @passy's concerns about it are resolved and the author confirms willingness to keep the task up to date. I've been burned by hit&run grunt tasks too many times.


passy commented May 12, 2013

One of the problems with grunt-traceur is that it ships with a bundled version of traceuer instead of depending on the npm module. It also implements the grunt file expansion incorrectly. Given the fairly small amount of code I suggest we should consider writing our own from scratch with the goal of merging it with grunt-traceur eventually.

@sindresorhus I will take a look at the sourcemaps issue this week. I just merged in a PR that took care of improving some testing and fixed the external dependency issue. It now relies on the npm traceur package.

Once sourcemaps are working (or sooner), I would love to get @passy's input on where I went wrong with the implementing the file expansion stuff.

Additionally, I think that it would be wise to add some people as collaborators so that we don't risk having a "hit&run" scenario, as @sindresorhus mentioned. Let me know who I should add and I will add them as collaborators on the repo.


sindresorhus commented May 12, 2013

@aaronfrost you could add me, Addy, and passy.



addyosmani commented Jan 9, 2014

We've started prototyping how this might look as part of a separate generator but won't be bringing it to generator-webapp until we feel the solution is stable enough. We'll track progress on this upstream.

@addyosmani addyosmani closed this Jan 9, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment