Angular 4; is it fantastic?


The good folks at Google unleashed Angular 4 or just Angular, a week ago. Let's take a look at some of the features that are new in Angular 4. In fact let's look at four of them.

First, if you are curious, Google decided to skip Angular 3 and go straight to 4. Which is fine by me because I would have probably had to use a graphic of the band Rush to represent Angular 3 and no one wants that. Here are some of the features that I have taken advantage of:

TypeScript 2.1

Angular 4 now supports TypeScript 2.1 which is cool but I was kinda hoping it would support TypeScript 2.2. It is my understanding that if you are using Yarn instead of the Node Package Manager, Angular 4 with 2.2 will give you fits.

But we do get some cool features in TypeScript 2.1 things like async/await and also Object Rest & Spread which helps with copying and merging, a la the Redux library.

You can read all the updates in TypeScript 2.1 Here .

Animations

In Angular 4, animations have been removed from the core Angular module. This means if you don't use animations, which I don't typically, you don't have to load the animations module. So you get a smaller app.

Errors

Angular 4 has improved the way the source map works with the template so if there is an error caused by something in the template, you now get a better, more meaningful error message. This can be very helpful if you nest several templates and generate an error. The better messaging helps in troubleshooting.

Ahead Of Time Compiler (AOT)

This is the main improvement that sold me on Angular 4. I am a fan of using AOT compiler instead of the Just In Time (JIT) compiler. One drawback with using AOT in Angular 2 was that the package size was massive, some times up to 10X the original file size. Angular 4 significantly reduces the size of the package by half or better, making a smaller, faster app.

Conclusion

Is Angular 4 the big leap forward Angular 2 was? No, but we do get some nice features. I still hope they add TypeScript 2.2 support, especially in the Angular CLI. So while Angular 4 may not be fantastic, it is very useful.

Next time I promise we will finish looking at the default files the Angular CLI creates. No really, I promise.

Catch you later,
Allen

Comments

Popular posts from this blog

Using the Angular CLI to set up an Angular 2 project