angular
angular copied to clipboard
Warn when non-OnPush is used inside of an OnPush
Internal users:
Embedding a ChangeDetectionStrategy.Default component inside of a ChangeDetectionStrategy.OnPush component leads to strange, and often undesired behavior. It might be nice to have this be a warning or an error at compile time.
Even if we kept this just at a warning, it might be pretty annoying to see over and over during builds.
It might be worth it though? @nshahan @TedSander
Is it ever possible that this is a pattern that you want and it works the way you would expect?
I mean, I'm sure folks do it, but I'm not sure on purpose.
I'd be in favor of a compiler warning. Seems like teams are just waiting for a bug without it. My only hesitation would be if it came up with directives or other situations where there was no possible fix.
On Fri, Aug 17, 2018, 4:50 PM Matan Lurey [email protected] wrote:
I mean, I'm sure folks do it, but I'm not sure on purpose.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/dart-lang/angular/issues/504#issuecomment-413984624, or mute the thread https://github.com/notifications/unsubscribe-auth/AFYd3K2QLIuDDGeJJ7fGD4kDyaaQ-gBmks5uRyyCgaJpZM4OTIki .
We could ignore the warning for directives, or make it a finer (not show on builds) log message.