The Angular CLI v7.3 brought us differential polyfills to prevent modern browsers from paying the cost of downloading polyfills. CLI v8 brings us true differential loading to create completely separate bundles for es5 and es2015+ browsers!
With differential loading, Angular CLI understand this problem in advance. The CLI judges whether the app has to support ES5 browsers, and check the current tsconfig's target can support them.
If they are mismatched, all bundles are separated as like main-es5.bundle.js and main-es2015.bundle.js.
If you're looking to increase your code reuse, Angular libraries are here to help. Tomas shows how to properly lazy load modules or components or complete sub-applications into your parent application. This is a really flexible architecture. He also shows how this approach will get simpler when Ivy is released. This is a great article for anyone wanting to get started with their first Angular Library or for someone looking to up their skills.
On Twitter, Minko Gechev shared a repo that is an example of how to implement a new Angular CLI Builder that allows you to execute ng run project-name:builder-name
The API is stable and allows you to extend the CLI. Check it out!
The Angular Community of developers continues to grow. Every new Angular developer needs to learn how to properly test their applications and every seasoned developer could use a refresher. By the end of the article, you'll have a solid understanding of how you can test your app.
This article focuses on how to write (simple) unit tests for your Angular modeling blocks (services, components, async tasks etc). We will be using a simple Quotes application to demonstrate how you can write a unit tests for your project.
This article focuses specifically on testing pipes, both pure and impure. Testing pipes is perhaps one of the simplest things you can do to improve the stability of your application.
The difference between pure and impure pipes are impure pipes executes for every change detection and pure pipes execute whenever there is a change in the primitive values, object references, etc.. This is important because we don’t want to execute pipe before updating the view for each change detection, that would be expensive.
It's in our nature as developers to strive for code re-use. It's expensive and frankly maddening when you have to refactor large quantities of duplicate code in an application. But when can our desire to create shareable components backfire? This article explores that question and provides techniques to avoid some common pitfalls.
The point is: less code duplication is not beneficial it if it makes the code harder to use and maintain.