The new version, a beta of which was released by Google today, introduces numerous changes that are not compatible with AngularJS 1, but which together yield an eight-fold speed increase for rendering and updating pages, Google claimed.
Some of those changes between version one and two can be intermingled thanks to a free tool from the Angular team inside Google. This tool will allow the use of AngularJS 2 idioms inside AngularJS 1 applications.
Other changes, however, require the entire application to be reworked in AngularJS 2. These are both changes that stem from the decision to decouple Angular from the DOM.
Brad Green, engineering director at Google, said, “Because we made these architectural changes, we had to decouple Angular from the DOM, which allowed us to support some other modes of running AngularJS. This allows for a very fast startup rendered on the server-side, where Angular runs inside Node.js or some other server-side technology. This is called Angular Universal, and it allows that very first view to be very quick.
“The second thing [that] being decoupled from the DOM in-browser allows us to do is run most of Angular inside a Web Worker. This is a unique ability among frameworks. It means all the heavy lifting can happen outside the UI [processing] thread. For building Angular 1 applications, if you want to use a Web worker, it’s very developer-intensive. In Angular 2, it’s just a configuration change. You run Angular in a different mode.”
The Angular 2 beta includes all of these features, but more are coming as the development process continues on. A command-line interface for Angular 2 is still in the alpha stages, and the binary size of Angular overall is being trimmed to allow mobile usage to be quicker and more lightweight.
Green said that the final release of the AngularJS 2 framework should be ready for the public in the coming months.