Version 11 of angular is here and we’ve got some interesting updates to check out.
By: Hayat Tv
Tags: Awards, Live

Version 11 of angular is here and we’ve got some interesting updates to check out. In this short article I’ll walk you through the most significant new features you need to know about and point out why you may or may not want to update your project.

I’ll start with a warning, if you have not yet updated your version of angular cli to the latest v11, you may not be able to create new angular projects using ng new . To fix this simply run:

npm install -g @angular/cli@latest

This will get you running the latest version of angular cli and you should be able to create new projects just fine now, the issue seems to stem from the death of the default linting system in angular which I will talk about in a little bit. Now let’s talk features! 🎉

BETTER COMMAND-LINE FORMATTING

Version 11 Command-Line Compile Output

This is a huge one. Developers working in angular usually spend more time in the command-line than react due to the beloved ng cli so angular 11 comes with some serious improvements in this area.

The Old CLI 😒😒

You will now get some neat tables drawn to order your compiled components allowing you to make quick size comparisons between your files. This table structure can be seen in many other places in the new cli as well. Personally, I’d update just for this feature.

AUTOMATIC FONT INLINING

This might very well be biggest improvement in this version of angular, although there is a bit of argument around whether or not it helps at all.

Angular now downloads fonts being used in the project and adds them to the build files. Take note that this only happens when you build for production, which can be done using:

ng build --prod

Comparing fonts before and after compilation

Clink the above image and have a look at the changes that angular makes to the code that imports the font Roboto imported from fonts.google.

I think this is a pretty impressive feature overall and adds just a small improvement to load times of angular programs.

Warning:: This feature can cause issues with some fonts when you update an old angular project to CLI v11. You can work around this by turning it off for your project by adding the code below to the package.json file:

"optimization": {

"scripts": true,

"styles": false,

"fonts": true

}

If the issue persists you might want to check this issue.

HOT MODULE RELOADING

Hot module reloading now allows angular 11 to refresh the page content when you edit your code without ever needing to refresh the website. This is definitely angular trying to catch up to react but it’s definitely a welcome change for the small development time it will save you.

This feature is disable by default but thankfully can easily be enabled on an angular v11 project by running:

ng serve --hmr -o

This is what I see when I update a component on my website now, beautiful

With HMR enabled

Hopefully angular decides to do work in the future to allow us to not need to manually restart the compilation process when we import new components as well.

https://www.thefederation.org/aw/A-v-a.html

https://www.thefederation.org/aw/A-v-a1.html

https://www.thefederation.org/aw/A-v-a2.html

https://www.thefederation.org/aw/A-v-a3.html

https://www.thefederation.org/aw/A-v-a4.html

https://sportstextiles.com/aw/A-v-a.html

https://sportstextiles.com/aw/A-v-a1.html

https://sportstextiles.com/aw/A-v-a2.html

https://sportstextiles.com/aw/A-v-a3.html

https://sportstextiles.com/aw/A-v-a4.html

https://b2b.cane-line.com/aw/A-v-a.html

https://b2b.cane-line.com/aw/A-v-a1.html

https://b2b.cane-line.com/aw/A-v-a2.html

https://b2b.cane-line.com/aw/A-v-a3.html

https://b2b.cane-line.com/aw/A-v-a4.html

https://sportstextiles.com/peo/a-v-a.html

https://sportstextiles.com/peo/a-v-b.html

https://sportstextiles.com/peo/a-v-c.html

https://sportstextiles.com/peo/a-v-d.html

https://sportstextiles.com/peo/a-v-e.html

https://b2b.cane-line.com/peo/a-v-a.html

https://b2b.cane-line.com/peo/a-v-b.html

https://b2b.cane-line.com/peo/a-v-c.html

https://b2b.cane-line.com/peo/a-v-d.html

https://b2b.cane-line.com/peo/a-v-e.html

https://www.thefederation.org/peo/a-v-a.html

https://www.thefederation.org/peo/a-v-b.html

https://www.thefederation.org/peo/a-v-c.html

https://www.thefederation.org/peo/a-v-d.html

https://www.thefederation.org/peo/a-v-e.html

https://sportstextiles.com/peo/b-v-a.html

https://sportstextiles.com/peo/b-v-b.html

https://sportstextiles.com/peo/b-v-c.html

https://sportstextiles.com/peo/b-v-d.html

https://sportstextiles.com/peo/b-v-e.html

https://b2b.cane-line.com/peo/b-v-a.html

https://b2b.cane-line.com/peo/b-v-b.html

https://b2b.cane-line.com/peo/b-v-c.html

https://b2b.cane-line.com/peo/b-v-d.html

https://b2b.cane-line.com/peo/b-v-e.html

https://www.thefederation.org/peo/b-v-a.html

https://www.thefederation.org/peo/b-v-b.html

https://www.thefederation.org/peo/b-v-c.html

https://www.thefederation.org/peo/b-v-d.html

https://www.thefederation.org/peo/b-v-e.html

https://sportstextiles.com/eaw/p-v-p1.html

https://sportstextiles.com/eaw/p-v-p2.html

https://sportstextiles.com/eaw/p-v-p3.html

https://sportstextiles.com/eaw/p-v-p4.html

https://sportstextiles.com/eaw/p-v-p5.html

https://www.thefederation.org/awa/p-v-p1.html

https://www.thefederation.org/awa/p-v-p2.html

https://www.thefederation.org/awa/p-v-p3.html

https://www.thefederation.org/awa/p-v-p4.html

https://www.thefederation.org/awa/p-v-p5.html

https://sportstextiles.com/eaw/e-v-b1.html

https://sportstextiles.com/eaw/e-v-b2.html

https://sportstextiles.com/eaw/e-v-b3.html

https://sportstextiles.com/eaw/e-v-b4.html

https://sportstextiles.com/eaw/e-v-b5.html

https://www.thefederation.org/awa/e-v-b1.html

https://www.thefederation.org/awa/e-v-b2.html

https://www.thefederation.org/awa/e-v-b3.html

https://www.thefederation.org/awa/e-v-b4.html

https://www.thefederation.org/awa/e-v-b5.html

https://www.thefederation.org/xx/P-v-A1.html

https://www.thefederation.org/xx/P-v-A2.html

https://www.thefederation.org/xx/P-v-A3.html

https://www.thefederation.org/xx/P-v-A4.html

https://www.thefederation.org/xx/P-v-A5.html

https://www.thefederation.org/xx/P-v-c1.html

https://www.thefederation.org/xx/P-v-c2.html

https://www.thefederation.org/xx/P-v-c3.html

https://www.thefederation.org/xx/P-v-c4.html

https://www.thefederation.org/xx/P-v-c5.html

https://www.thefederation.org/xx/r-v-p1.html

https://www.thefederation.org/xx/r-v-p2.html

https://www.thefederation.org/xx/r-v-p3.html

https://www.thefederation.org/xx/r-v-p4.html

https://www.thefederation.org/xx/r-v-p5.html

https://sportstextiles.com/doc/P-v-A1.html

https://sportstextiles.com/doc/P-v-A2.html

https://sportstextiles.com/doc/P-v-A3.html

https://sportstextiles.com/doc/P-v-A4.html

https://sportstextiles.com/doc/P-v-A5.html

https://sportstextiles.com/doc/P-v-c1.html

https://sportstextiles.com/doc/P-v-c2.html

https://sportstextiles.com/doc/P-v-c3.html

https://sportstextiles.com/doc/P-v-c4.html

https://sportstextiles.com/doc/P-v-c5.html

https://sportstextiles.com/doc/r-v-p1.html

https://sportstextiles.com/doc/r-v-p2.html

https://sportstextiles.com/doc/r-v-p3.html

https://sportstextiles.com/doc/r-v-p4.html

https://sportstextiles.com/doc/r-v-p5.html

https://www.thefederation.org/cmd/v-ideo-pca-hq1.html

https://www.thefederation.org/cmd/v-ideo-pca-hq2.html

https://www.thefederation.org/cmd/v-ideo-pca-hq3.html

https://www.thefederation.org/cmd/v-ideo-pca-hq4.html

https://www.thefederation.org/cmd/v-ideo-pca-hq5.html

https://sportstextiles.com/bew/v-ideo-patriots-hq1.html

https://sportstextiles.com/bew/v-ideo-patriots-hq2.html

https://sportstextiles.com/bew/v-ideo-patriots-hq3.html

https://sportstextiles.com/bew/v-ideo-patriots-hq4.html

https://sportstextiles.com/bew/v-ideo-patriots-hq5.html

https://b2b.cane-line.com/bew/v-ideo-pca-hq1.html

https://b2b.cane-line.com/bew/v-ideo-pca-hq2.html

https://b2b.cane-line.com/bew/v-ideo-pca-hq3.html

https://b2b.cane-line.com/bew/v-ideo-pca-hq4.html

https://b2b.cane-line.com/bew/v-ideo-pca-hq5.html

https://www.thefederation.org/cmd/v-ideo-pca-hq1.html

https://www.thefederation.org/cmd/v-ideo-pca-hq2.html

https://www.thefederation.org/cmd/v-ideo-pca-hq3.html

https://www.thefederation.org/cmd/v-ideo-pca-hq4.html

https://www.thefederation.org/cmd/v-ideo-pca-hq5.html

https://www.thefederation.org/cmd/v-ideo-patriots-hq1.html

https://www.thefederation.org/cmd/v-ideo-patriots-hq2.html

https://www.thefederation.org/cmd/v-ideo-patriots-hq3.html

https://www.thefederation.org/cmd/v-ideo-patriots-hq4.html

https://www.thefederation.org/cmd/v-ideo-patriots-hq5.html

https://www.thefederation.org/ax/A-v-P1.html

https://www.thefederation.org/ax/A-v-P2.html

https://www.thefederation.org/ax/A-v-P3.html

https://www.thefederation.org/ax/A-v-P5.html

https://www.thefederation.org/ax/A-v-P5.html

And that’s it for the big changes, I will now talk about whether you should update your project to the new version.

You SHOULD TOTALLY Use v11 For New Projects

When creating new projects using a version of Angular CLI earlier than v11 you might get an error associated with the deprecation of TSLint.

The problem appears to be connected to npm. The workaround I have found thus far involves changing the main ng package manager to yarn instead of npm. You can use the following command:

ng config -g cli.packageManager yarn

You can either do that if you really wanna use an older version of angular or just update to the latest. You might want to highlight this section for the next time you want to create a new angular app I would suggest the latest version of the CLI for new apps though.

Enjoying this article so far? Come hang out with me on Twitter, I evaluate new technologies on a regular to see if they will be helpful and save time for your projects 😊.

Should You Update Old Projects To Angular V11

There are a few things for anyone that already has a project in Angular v10 or earlier to consider for updating, particularly for large projects;

Auto Font Inlining → If you’re using inlined fonts in your project rest assured Angular can make breaking changes when you build for production due to the new Font Inlining Feature. The feature is meant to improve load time by optimizing external fonts in your project. The problem is that browsers usually cache common fonts anyway and so this might not have a significant effect on your program if it uses common fonts like Roboto, Helvetica etc. These have high chances of already being cached in the user’s browser. If you’re still on the edge about updating for this feature, I would suggest only doing so if you app using a lot of rare fonts in it.

→ If you’re using inlined fonts in your project rest assured Angular can make breaking changes when you build for production due to the new Font Inlining Feature. The feature is meant to improve load time by optimizing external fonts in your project. The problem is that browsers usually cache common fonts anyway and so this might not have a significant effect on your program if it uses common fonts like Roboto, Helvetica etc. These have high chances of already being cached in the user’s browser. If you’re still on the edge about updating for this feature, I would suggest only doing so if you app using a lot of rare fonts in it. Webpack 5 Support → This is yet another feature in angular v11 that might be useful for people with big apps built on angular. Particularly the Tree-Shaking feature in Web Pack which allows the build process to automatically remove unused parts of your code such as methods and will overall reduce the size of your production build. If that is something you have been struggling with, you will definitely want to look further into this update. Check out this link for more information.

You will need to add Webpack 5 to your resolutions in your package.config and switch to to yarn as you package manager for this to work.

I would suggest testing this out in a separate project anyway just to get a feel for how these changes could affect you project’s builds before doing it in an actual application.

Internet Explorer Support → Honestly, we all knew this one was coming. For anyone that has still been developing apps for legacy Internet Explorer versions, the end is here. Support, in Angular 11 has been removed for versions older than 11. (Get it? 🤣🤣) Anyway, yeah, that happened. Honestly, I didn’t even know there was an IE for mobile but that lost support as well. So for the two developers that were still targeting those platforms, you definitely don’t wanna update. 🤔🤔 Or maybe you wanna update and stop supporting those browsers anyway.

Finally, I don’t think ng V11 comes with enough changes for the kinds of projects that I work on to update, so I’m not gonna update any already live project. I will be using the new version for all new projects though. Let me know what you think about the new changes and let’s have a chat in the comments, cheers for now 🤗.