angular / components

Component infrastructure and Material Design components for Angular
https://material.angular.io
MIT License
24.37k stars 6.75k forks source link

Should Tree use OnPush? #25440

Open jelbourn opened 2 years ago

jelbourn commented 2 years ago

Right now, CdkTree explicitly marks itself as ChangeDetectionStrategy.Default: https://github.com/angular/components/blob/513832845403e88712e0d9f69ca68f3928cb6821/src/cdk/tree/tree.ts#L65-L69

I suspect the rationale here is no longer may no longer be accurate. My understanding is that, under Ivy, change detection happens at both the declaration point (the end-developer's component) and the insertion point (the cdkTreeNodeOutlet inside the CdkTree template).

We should determine whether we should change the tree back to OnPush.

crisbeto commented 2 years ago

This was actually made specifically for Ivy, because of the different behavior for transplanted views.