Why Angular 9
Angular is widely used front end framework to build client side applications and they have been improving a lot on every version.
Here are my observations after upgrading to Angular 9
Do not worry about migrating the code yourself. After you have updated to version 9, your codebase will be automatically migrated. This also applies to all migration schematics, as soon as you update with the command:
ng update
Welcome Default Ivy
In Angular 8 Ivy was available but at an opt-in level to use that we need to add the below line in tsconfig.json
"angularCompilerOptions": { "enableIvy": true }
Now this is set to default and no need to add in tsconfig any more.
Angular Core Type-Safe Changes
One of the APIs for testing Angular apps is called TestBed. Before this new version, it had a get function called TestBed.get() that stopped taking string values after version 8. This was a breaking change and Now the TestBed API has been improved so that the inject function does exactly what the get does, while being type-safe at the same time.
ModuleWithProviders Support
If you have used ModuleWithProviders before Angular 9, you may or may not have been strongly typing it, but now in this version you have to always use the generic ModuleWithProviders<T>
type to show your module type.
Changes with Angular Forms
- The
<ngForm></ngForm>
is no longer a valid selector to use while referencing an Angular form. FormsModule.withConfig
has been removed and you can now use theFormsModule
directly.
Dependency Injection Changes in Core
Not many changes but some supprot has been added for the providedIn value
Enhancement of Language Service
Integration support for vscode and webstorm has been improved.
Service Worker Updates
service workers the deprecated versioned files option in the service worker asset group config has been removed and replaced with files
No More Entry Components
A long time ago, in a time of myth and legend, only one person knew when we needed to define entryComponents
in our NgModules. Ok, that’s not entirely accurate as many of us have used entryComponents
. We need to look at code and remove them.
I have found this has improved lot of performance and rendering UI