Angular 13. What's new

What's new in angular 13

Angular 13 was recently released, let me tell you what I consider to be the most relevant changes.

LinkBuild Cache

You can now cache your builds, so if a module hasn't changed, Angular doesn't have to rebuild it. That alone will improve your build speed by around 68%.

TypeScript
{
  "cli": {
    "cache": {
      "enabled": true,
      "path": ".angular/cache",
      "environment": "all"
    }
  }
}

LinkTestBed Destroy After Each

Tests are now faster because Angular does a better job of tearing down after each test. That introduced some race conditions in my codebase, so I had to turn that off. I'd say it needs a few weeks to become stable.

TypeScript
getTestBed().initTestEnvironment(
  BrowserDynamicTestingModule,
  platformBrowserDynamicTesting(),
  { teardown: { destroyAfterEach: false } }
);

LinkDropped Support for Internet Explorer 11

Finally, we're dropping support for Internet Explorer 11, which allows Angular to leverage modern browser features, such as CSS variables.

LinkDependency Updates

TypeScript 4.4 and RxJS 7.4 are now supported! I made a video on RxJS 7, the link is in the description.

LinkDynamically create components

If you create components dynamically, good news, you don't need the component factory anymore, just use ViewContainerRef.createComponent

TypeScript
const componentFactory =
  componentFactoryResolver.resolveComponentFactory(Component);

const componentRef = componentFactory.create(injector);

viewContainer.insert(componentRef.hostView);

const componentRef = viewContainer.createComponent(Component);

LinkConclusion

References are below. Subscribe if you're into web development, and have a great day.

LinkReferences

  1. Angular v13 is now available
  2. Internet Explorer 11 support deprecation and removal
  3. Advantages of Dropping Support for Internet Explorer 11

Join our Newsletter and be the first to know when I launch a course, post a video or write an article.

This field is required
This field is required