Загрузка...

Coming in Angular 22: OnPush is the New Default!

Angular 22 introduces a fundamental shift in how the framework handles component updates. In v22, OnPush officially replaces Default as the baseline ChangeDetectionStrategy. This means that if a component's changeDetection property is left undefined, the Angular compiler will now treat it as OnPush by default.

⚠️ Breaking Change: developers wishing to maintain the traditional "check always" behavior must now explicitly specify the Eager strategy. Eager strategy was introduced in Angular 21.2 as an alias for the legacy Default strategy, which was deprecated in the same version and is slated for removal in a future release, likely Angular 24.

To ease this transition, the Angular 22 migration tool (ng update) includes automated logic to update your project:
● Components without a specified strategy will have Eager added automatically
● Default will be renamed to use Eager
● OnPush will remain untouched

✔️ This video explains all these changes quickly, concisely, and clearly in a visual form.

⚠️ Please note: Angular 22 is still in development and is scheduled for a later release.

Thanks to the @Angular Team for the valuable work.

ℹ️ Source: https://github.com/angular/angular/pull/67687

Follow me on:
▪️Twitter: https://twitter.com/TheIgorSedov
▪️LinkedIn: https://www.linkedin.com/in/igorsedov/
▪️Bluesky: https://bsky.app/profile/igorsedov.com
▪️Instagram: https://www.instagram.com/theigorsedov/

Website: https://igorsedov.com
Email: me@igorsedov.com

Angular is a registered trademark of Google and/or its affiliates. Other names may be trademarks of their respective owners/holders. Use of them does not imply any affiliation with or endorsement by them.

#angular #angular22

Видео Coming in Angular 22: OnPush is the New Default! канала Igor Sedov
Яндекс.Метрика
Все заметки Новая заметка Страницу в заметки
Страницу в закладки Мои закладки
На информационно-развлекательном портале SALDA.WS применяются cookie-файлы. Нажимая кнопку Принять, вы подтверждаете свое согласие на их использование.
О CookiesНапомнить позжеПринять