Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOM nodes keeps increasing #76

Open
vfxturjo opened this issue Feb 3, 2023 · 3 comments
Open

DOM nodes keeps increasing #76

vfxturjo opened this issue Feb 3, 2023 · 3 comments

Comments

@vfxturjo
Copy link

vfxturjo commented Feb 3, 2023

hi. i am trying to understand why DOM nodes count is increasing constantly
image

i found this div to be reacting automatically in the background...
image

if i remove this event listener, i get this: the div gets filled with lots of texts... mainly this is midi device ports...
image

i am thinking why did this happen??
i searched for possible reasons for this dom to be created and found this. (it might help demystify..?)
image

if i let it run, the count goes crazy high like this...
image
😭

i dont understand why this is happening and how to fix... please help

my code may be the problem, but i want to know why it happened and how to avoid this problem...

@vfxturjo
Copy link
Author

vfxturjo commented Feb 3, 2023

hi. update:
I found that commenting out this line solves the problem.

image

and by analysing, i found:
image

when i click on refresh button which does JZZ().refresh() method, the <div id="jazz-midi-msg">...</div> updates. also, DOM node count increases by 3.

if i remove the event listener...
image

then on each run of JZZ().refresh() method, one line is added: (i clicked 5 times)
image

so, i think JZZ().refresh() method is keeping history of all times when refresh() method is called. maybe to compare the current value with previous one to see if there is any difference? (just my thought), but it uses memory and DOM.
is this intentional? or is this a bug?

@jazz-soft
Copy link
Owner

jazz-soft commented Feb 3, 2023

This DIV is used to communicate with the Jazz-MIDI browser extension.
The event listener reads it and then cleans it up.
I don't understand what you are trying to accomplish by removing the event listener.

@vfxturjo
Copy link
Author

vfxturjo commented Feb 3, 2023

I see... I removed the event listener just to try to understand what it does.

Mainly my problem is with DOM nodes count. I mean, even if i didn't remove the event listener, the count was increasing gradually.

Mainly if i use JZZ().refresh() method.
(+3 DOM nodes per call)
Or if i subscribe to onChange() method...
(+3 or +6 DOM nodes per second)

I was trying to understand if this is normal or not... that constant increase of DOM nodes count

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants