angular icon indicating copy to clipboard operation
angular copied to clipboard

Warn when non-OnPush is used inside of an OnPush

Open matanlurey opened this issue 8 years ago • 5 comments

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.

matanlurey avatar Jul 10 '17 17:07 matanlurey

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

matanlurey avatar Aug 17 '18 18:08 matanlurey

Is it ever possible that this is a pattern that you want and it works the way you would expect?

nshahan avatar Aug 17 '18 20:08 nshahan

I mean, I'm sure folks do it, but I'm not sure on purpose.

matanlurey avatar Aug 17 '18 20:08 matanlurey

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 .

TedSander avatar Aug 17 '18 22:08 TedSander

We could ignore the warning for directives, or make it a finer (not show on builds) log message.

matanlurey avatar Aug 17 '18 22:08 matanlurey