tolgee / tolgee-js

Tolgee JavaScript libraries monorepo
https://tolgee.io
MIT License
218 stars 24 forks source link

refreshAll debounce #3294

Closed wfjsw closed 4 months ago

wfjsw commented 4 months ago

Add a debouncer to refreshAll to decouple it off the MutationObserver hot path, to hopefully bring better performance.

stepan662 commented 4 months ago

Hey @wfjsw, I can't really say I like this, because I can imagine cases, where the element list might not be cleaned at all (e.g. some element perodicaly re-rendering more often than 500ms). I think there should be some guarantee that elements will be cleaned at some point. Also when we're gathering context from the page, it should be cleaned before it, because it should not take irelevent elements into consideration.

wfjsw commented 4 months ago

One of the alternatives I could see here is to make an informed decision in cleanElementInactiveNodes by the MutationRecord.removedNodes

What I currently have here: image

wfjsw commented 4 months ago

Superseded by #3296