Featured image of post Angular 8 - Whats New?

Angular 8 - Whats New?

Its like christmas for web UI devs...

Whats New in Angular 8?

Ah, Angular 8!

The version where things get a bit fancier, a little faster, and developers collectively sighed in relief at some much-needed improvements.

πŸš€ New Features in Angular 8

1. Differential Loading of JavaScript

Angular 8 introduced differential loading, which means your modern browsers get modern JS, while older browsers get the legacy stuff. This improves performance significantly.

1
2
<script type="module" src="modern-bundle.js"></script>
<script nomodule src="legacy-bundle.js"></script>

2. Lazy Loading with Dynamic Imports

Previously, lazy loading used a string-based syntax. Now, it’s more TypeScript-y and supports dynamic imports!

1
2
3
const routes: Routes = [
  { path: 'lazy', loadChildren: () => import('./lazy/lazy.module').then(m => m.LazyModule) }
];

3. Web Workers for Performance

Need to offload heavy computations to a separate thread? Web Workers are officially supported now!

1
ng generate web-worker my-worker

4. Bazel Support (Experimental)

Bazel allows faster incremental builds and better dependency management. It’s still experimental but promising!

1
2
3
"builders": {
  "build": "@angular/bazel"
}

5. Ivy Rendering Engine (Still in Preview)

Ivy was getting polished in Angular 8 but wasn’t the default yet. It improves bundle size and debugging!

1
{ "enableIvy": true }

6. Support for TypeScript 3.4+

Angular 8 brings support for the latest TypeScript goodies, like const assertions:

1
const numbers = [10, 20, 30] as const;

7. Location Strategies Improved

Base href handling got better for lazy-loaded modules!

1
providers: [{ provide: APP_BASE_HREF, useValue: '/' }]

πŸ“œ Angular Versions and Features

VersionRelease DateKey Features
Angular 22016-09-14Component-based architecture, TypeScript adoption
Angular 42017-03-23Smaller bundles, better animations, improved AOT
Angular 52017-11-01Build optimizer, HttpClient, Service workers
Angular 62018-05-04Angular Elements, Tree-shakable providers, CLI improvements
Angular 72018-10-18CLI prompts, better performance, Virtual Scrolling
Angular 82019-05-28Differential loading, Ivy preview, Web Workers


πŸ“ Key Ideas Summary

FeatureDescription
Differential LoadingModern JS for modern browsers, legacy JS for old ones
Lazy LoadingUses dynamic imports, making it more modular
Web WorkersAllows background processing for performance
Bazel SupportFaster builds, better dependency management (experimental)
Ivy Rendering EngineNew, lightweight rendering engine (preview in Angular 8)
TypeScript 3.4+Supports new TypeScript features
Location StrategyImproved handling of base hrefs