Google's AngularJS 2 promises faster, slicker, future-proof JavaScript

Next major revision of Google's JavaScript framework plans to target ECMAScript 6, have a more modular design, and ditch older browsers

Work is about to begin on the second big revision of Angular, Google's JavaScript UI framework, according to a blog post on Judging from the list of features, Angular 2 isn't likely to be ready anytime soon, but the changes -- such as using ECMAScript 6+ to develop the framework, rather than the current version -- cast an eye to the future.

Angular is one of the most popular frameworks for JavaScript in terms of contributors. It was built to enable the quick and easy creation of single-page Web applications, where content and code are inserted dynamically. Rather than forcing the developer to write JavaScript to assemble everything, Angular instead allows the developer to use HTML markup, not inline JavaScript or script includes, to declare behaviors and data bindings.

First and foremost, Angular 2 is "designed for the future." This means using ECMAScript 6+ as the language to develop the framework, although it's transpiled to ECMAScript 5 since no browser supports EC6 yet. EC6 is not supposed to have been formally codified until the end of 2014, but the Angular developers want to get ahead of the game and are using the Traceur compiler (another Google creation) to generate compact, backward-compatible code.

A second goal is to make Angular work on what its developers call "evergreen" browsers that are kept current to match evolving Web standards: Chrome, FireFox, Opera, Safari, and IE11. One possible pain point as a result of this, for both developers and users, is that earlier versions of the Android browser might not be supported, in big part because the stock Android browser -- as opposed to Chrome for Android -- is revved so slowly.

Leaving out earlier versions of Android would not be a trivial decision, since according to AppBrain, as of March 15, 24 percent of Android devices are running versions of Android earlier than 4.0, and Google Chrome for Android doesn't run on any version of Android earlier than 4.0. No hard decision has been made on this yet, though.

The nuts-and-bolts changes to Angular are in line with most 2.0 revisions of a product: to make it faster and simpler, and to add more features that developers want. Some improvements in speed will be leveraged by using the new Object.observe() mechanism in JavaScript, slated to be supported in Chrome in version 35. But other improvements are planned that involve optimizing Angular as-is and don't require newer language features.

To simplify Angular, one of the ideas on the table is to modularize it. "Every piece of Angular should be optional, replaceable, and even used in other non-Angular frameworks," the Angular blog says. In Google's view, developers should swap out or upgrade pieces by hand if need be. The company claims some of this is already happening -- such as when it split the $route function into a separate library, "several innovative replacements popped up."

Angular's dependency injection system, one of the features Angular co-creator Misko Hevery cited as a key differentiator for Angular over other frameworks, is slated for major improvement as well. The plan is to make the dependency injection system less complicated to set up, less cumbersome in its syntax, and more a part of how Angular itself works -- for example, by allowing Angular's own code to be lazily loaded via injectors.

Design documents for Angular 2 are available on Google Drive, and weekly meeting notes will be posted as the development process continues.

This story, "Google's Angular.js 2 promises faster, slicker, future-proof JavaScript," was originally published at Get the first word on what the important tech news really means with the InfoWorld Tech Watch blog. For the latest developments in business technology news, follow on Twitter.

Copyright © 2014 IDG Communications, Inc.

How to choose a low-code development platform