mgechev / eap-feedback

11 stars 0 forks source link

Redux Devtools floods profiler event list #2

Open fmalcher opened 3 years ago

fmalcher commented 3 years ago

tl;dr; message events trigger CD which makes the Profiler unusable together with Redux DevTools


Example project: https://github.com/angular-schule/2021-03-angular-workshop-online/tree/main/book-rating

Screenshot 2021-03-19 at 10 27 24

This problem is not specifically related to the Angular DevTools, but I never noticed this behavior before. It could be solved on the NgRx or Redux DevTools side, but it would be cool to have a solution within Angular DevTools for this, too.

Idea

GregOnNet commented 3 years ago

image

Observed Behaviour

mgechev commented 3 years ago

Looks like Redux DevTools triggers change detection cycles. Not sure if Angular DevTools should be aware of other existing tooling that communicates via postMessage.

So far it feels like a won't fix, but let me know if you have other thoughts.

GregOnNet commented 3 years ago

I will investigate this issue a little further. Even without Redux DevTools the Angular DevTools recognize hundreds of CD-Cycles in one second.

Currently, I cannot tell what the root cause is.


So far it feels like a won't fix, but let me know if you have other thoughts.

Maybe this question can be answered after getting more feedback how many teams out there rely on Redux DevTools. A simple solution would be to mention a workaround in the documentation. I myself tried to disable the Redux DevTools in Chrome and in my application without success.

@fmalcher Can you try to disable Redux DevTools and see if the problem persists?

Cheers Gregor

fmalcher commented 3 years ago

It got worse... 🐞 Communication with the Redux Devtools floods the event list with hundreds of entries per second. This freezes the whole browser and I can only force quit it. It also outputs warnings on the console so I can't use the console anymore (can't even open it).

The event filter is a good means in general to go and see the CD cycles. However, for me it doesn't even come this far when I can't stop the profiling recording.

I think there are very many people using the Redux DevTools extension so we need a practical and pragmatic solution here. Otherwise those people (including me) would not be able to actually use ADT . What do you think about a hard switch like "Ignore window.message events"? @mgechev

Screenshot 2021-04-26 at 21 02 16

Screenshot 2021-04-26 at 21 07 38 Screenshot 2021-04-26 at 21 07 43

mgechev commented 3 years ago

What do you think about a hard switch like "Ignore window.message events"?

We can skip important change detection cycles this way. I'm not confident the fix should be in Angular DevTools given that these are actual change detection cycles that the app performs.