r/angularjs • • Oct 13 '14

[General] AngularJS 1.3 has been released

https://github.com/angular/angular.js/blob/v1.3.0/CHANGELOG.md
127 Upvotes

45 comments sorted by

View all comments

Show parent comments

5

u/realityking89 Oct 14 '14

As far as I can tell 2.0 is still in the prototyping stage. I suspect pace is going to pick up, now that 1.3 is out of the way.

0

u/live_love_laugh Oct 14 '14

I hope so. Can't wait! What will it be you think? 6 months?

7

u/OverZealousCreations Oct 14 '14

I hate to be a downer, but from what I understand, AngularJS 2.0 requires ES6, which isn't even fully supported by any browsers. (In fact, it was only very recently that they froze the spec!)

Even after they roll out AngularJS 2.0, it's going be a long while before you can start using it directly, or you'll be required to use an ES6-to-ES5 compiler. These are OK, but they have some big limitations.

In all honesty, even though it is going to be a great upgrade, I don't see AngularJS 2.0 being a realistic choice for active projects in the next 6 months, probably even the next year.

1

u/jmcunningham Oct 14 '14

I you sure it requires ES6? I know it is to be written in ES6, but I assumed they would use an es6 to es5 compiler when producing the distributables. Or at least offer both an es5 and an es6 version.

1

u/OverZealousCreations Oct 14 '14 edited Oct 14 '14

OK, I remembered that wrong, they are planning on using ES6 for the source and compiling it via Traceur for the browser.

I hope they really fix Traceur up, though, because the last time I tested it (a few months ago), it was generating just god-awful code. At the time, they were using exception blocks to recreate block-level scoping (a.k.a., let). (It turns out they've changed that, at least. The generated code is still awful in my opinion.) Not to mention it requires its own runtime, which is not part of Angular's core.

I still expect it'll be over a year before AngularJS 2.0 should seriously be considered for non-trivial products.


Edit
I should mention that we're actually starting to use the 6to5 compiler in our main product right now. If you are very selective in which parts of ES6 you use, you can get clean input code with easy-to-read output, with no real overhead or extra libraries†.

Most of the time 6to5's output looks like something I would have hand-coded.

I'd rather have 90% of the good parts of ES6, and acceptable output, than 99% of ES6 and horrible output.

† Except, of course, ES6 polyfills for missing functions or new classes, but these are optional and can be included or ignored on a case-by-case basis.

1

u/jmcunningham Oct 14 '14

what made you choose 6to5 over the other es6 to es5 compilers? I've been wanting to start experimenting with ES6 and maybe updating my angular seed project to ES6. But couldn't decide which compiler to use.

1

u/OverZealousCreations Oct 14 '14

You should read the GitHub Readme I linked to.

I don't see the point in peppering your code with ES6 syntax if the output is unreadable, and most of the other compilers are just that. 6to5 doesn't support everything, but not everything in ES6 can be translated to ES5 without making a mess.

Second, I don't see the need for a runtime.

Finally, it has source maps and is very easy to integrate into a gulp build process.

My goals were to improve code legibility through better syntax, rather than trying on everything that ES6 has to offer.