AngularJS Events27 oktober 2016

Late september 2016, a small delegation of Trivento’s frontend developers traveled to London to attend AngularConnect, one of the biggest Angular-focused conferences in Europe. About one week before this event, the Angular Core Team announced the final version of Angular 2, mystically named ‘proprioception-reinforcement’.

This was a greatly anticipated event for a lot of Angularians all over the world, because the announcement of Angular 2 and all of its changes to the framework had felt like being hit with a ton of bricks two years ago at the ng-europe conference in Paris. The infamous Graveyard-presentation, where the demise of numerous Angular-features was announced for the first time, kept a lot of us awake at night. Okay, maybe not really. But still.

angularconnect The infamous Tombstone Presentation

Last year at AngularConnect in London we were all excited to hear at least something resembling an announcement for the final release date of Angular 2. However, Brad Green (engineering director of the Angular 2 Core Team) could not be persuaded to mention a release date. Instead, he announced that the Angular 2 product would be a lot bigger than angularJS 1.x ever was – so big in fact, that it couldn’t possibly be called a framework anymore. It was now a Platform!

So we all left the conference a bit disappointed because the wait would be even longer, but also filled with even more anticipation because we would be getting a lot more! I think this two-year-process of excitement and anticipation but also chaos and confusion is illustrated best by Shai Reznik in his hilarious ‘ng-show’ talk at ng-conf 2016. An absolute must-see.

angularconnect Shai Reznik's ng-show at ngconf2016

So here we were, at AngularConnect 2016. The final version 2.0.0 was just launched the week before, so this was going to be the European launch party, right?

To be honest, I was a bit underwhelmed by the understated way this was acknowledged in the opening keynote by Jules Kremer. She mentioned it like it was just another thing they did. A missed opportunity to celebrate with all these European developers who had highly anticipated that release for two years, I thought. But maybe I just expected too much.


The Buzz

Usually, a conference has some sort of hidden ‘theme’ in the form of a buzzword or catch-phrase that keeps turning up. Something new that you keep hearing in different talks. AngularConnect this year was no exception: the focus in the last stages of development of Angular 2 has been (and still is, by the way) performance and reduction of downloaded bytes (payload), two things that go hand-in-hand up to a certain extent. The terms connected to this, that we kept hearing were the ‘Ahead-of-Time Compiler’ and ‘Tree-Shaking’.

So what do they mean?

Ahead-of-Time Compiler

Up until now, the angular-specific code in your app had to be compiled to regular javascript within the browser. This involves evaluating binding expressions connecting javascript code to UI elements in the DOM and parsing the templates, which are converted to executable javascript that the browser will execute to render the app.

Angular 2 now has the capability to do this compilation before that moment in time. It will be done as a build step before the code is loaded into the browser, which brings two performance benefits: the browser is not bothered with that compile-task and the compiler itself can be omitted from Angular itself (which reduces the payload), since it is not used by the browser anymore.

Tree shaking

Angular is a big platform with a lot of features. Chances are, your app does not use all of these. For better performance it would be useful if these unused bits of code are left out of the downloaded app. Angular now has the capability to walk through the code dependency tree and shake out all the code that is not used in the app. Hence the term ‘Tree shaking’! (not coined by the Angular Team though, it has been used in other technologies.)

Both these performance enhancements seem like very sensible additions to the platform. It makes so much sense even, that you might think: why did we ever do compilation like we did?

Anyway, I am more interested to see how Angular 2 and its userbase develops in the coming year(s) now that it is finally released. Facebook’s React seems to be gaining ever more traction within the Guild of Developers so the question rises if Angular’s 2.0.0 release may be too little, too late. I guess time will tell.