About a year and half ago, the AngularJS team made the decision to drastically change the tremendously popular AngularJS framework. Google and the Angular contributors (including robust community) sought to better the framework by reducing the learning curve and providing performance enhancements. Big changes are unleashed with AngularJS 2.0, this surely makes the migration path somewhat unclear as well as challenging still overall with aim to make framework Fast, Universal and Flexible this is a step in correct direction. The direction that the AngularJS team has taken is bold but positive.
As the application development world is gearing up and waiting for production release of AngularJS 2.0 there is a lot of talk about direction taken by AngularJS team. However very few are aware of the approach adopted by AngularJS 2.0 to tame various challenges faced by the industry today. Lets try to understand what AngularJS 2.0 is trying to achieve in already crowded JS framework ecosystem.
To demystify AngularJS 2.0 the idea of this article is to focus on approach more than the execution of the approach. The four main concepts driving AngularJS 2.0 philosophy are Mobile First, Loosely Coupled Modules, Simplicity and Performance. Lets try to dissect each of these concepts and understand their impact on the application development landscape.
Mobile First – The AngularJS team has expressed time and again (via blogs, conference speeches, meetups) that they would go for mobile but very few thought or had conviction that it would mean the team will focus most efforts to get mobile right first and then work up to desktops. While it seems appropriate, with the extraordinary growth of mobile Internet access over past few years and exponential rise in number of smart phones activated every day, still surely this is a bold and without doubt a brilliant approach. Many application development platforms or tool chain players have talked about or recommended this approach for more than 3 years now especially for building an application that needs to live in both mobile and desktop platforms, however, not many have put it in execution whole heartedly. Surely facts remains that if you do it right on mobile and are able to tackle loading times, performance and other mobile challenges first, then desktop becomes a much easier task.
Loosely Coupled Modules – The AngularJS Team has been detaching modules from its core for several versions now hence while this is not at all surprising and was expected but with AngularJS 2.0 this approach has become more prominent. From mere process in earlier releases this has become approach in current release especially with the community becoming more active, innovative and connected (with AngularJS team as some of the modules have been adopted and have worked as options for some core angular modules) and started to offer some very interesting and impactful modules such as angular-ui, angular-translate, ui-router, ng-table and restangular. Further the AngularJS team and the community has successfully built a module ecosystem that keeps growing with every passing day (www.ngmodules.org holds nearly thousand modules and many more available but not indexed) hence proving this approach of “Loosely Coupled Modules” a great success. This approach also has an additional benefit that the smaller libraries or modules combined with lazy loading not only generate a huge boost on performance but also makes managing code easier.
Simplicity – Out of many goals for AngularJS team, one of the key goals for AngularJS 2.0 was to allow developers to concentrate on the lines of code related to their business domain and functional requirements. The focus is to better hide angular frame, annotations and ES6 provides the tools and standards to make this possible while ensuring the readability for developers to understand what is going on. Further the AngularJS team has also embraced feedback coming from a community who found directives syntax in older releases having a rather long learning curve hence not only using [properties] and (events) many directives that are not needed anymore are removed even the way of consuming directives is simplified. A much simple directives, like components, are incorporated to make the development simpler and easier for developers to adapt and adopt.