From the course: Reactivity and Signals in Angular
Unlock this course with a free trial
Join today to access over 24,900 courses taught by industry experts.
The problems with zone-based reactivity - Angular Tutorial
From the course: Reactivity and Signals in Angular
The problems with zone-based reactivity
- [Instructor] Using Zone.js to power change detection comes at a cost. One drawback is the need to download and initialize another dependency. When the application is requested, Zone must be included in the initial bundle and initialized when the application loads. Because of the way Angular uses Zone, debugging issues can be more difficult. Zone-related errors clutter stack traces, making it hard to debug issues from code running outside of Zone. Angular's reliance on Zone can make adopting JavaScript ecosystem tools and libraries difficult or even impossible. This is because Zone works by patching native browser APIs. When browsers introduce changes to their APIs, Zone does not automatically get updated. Zone patches to native browser APIs can also interfere with the way some libraries work. For example, Angular has to patch the native async/await API to ensure compatibility with Zone. Zone can also negatively impact performance in Angular apps by causing change detection to run…