Zone.js and Zoneless Change Detection
Explain what Zone.js does, why Angular has relied on it, and what zoneless change detection changes.
Zone.js is a library Angular has relied on since its early versions to automatically know when to run change detection: it monkey-patches nearly every async browser API (setTimeout, addEventListener, Promise callbacks, XHR completion) so that Angular can be notified whenever any of them fire, without the developer needing to manually tell Angular "something happened, please re-check the UI." This is genuinely convenient — it's why a plain setTimeout callback that changes a component property just works and updates the view without any explicit trigger — but it comes at a real cost: Zone.js's blanket monkey-patching means Angular conservatively re-checks broad swaths of the component tree on virtually any async event, whether or not that event actually affected anything visible.
Zone.js is like a building-wide intercom system that announces every single door opening anywhere in the building, prompting security to walk over and check regardless of whether that specific door actually needed attention; zoneless change detection is like replacing that with individual sensors on only the doors that matter, each one directly alerting exactly the right person the instant it actually opens.