Skip to content

Conversation

Zyie
Copy link
Member

@Zyie Zyie commented Jun 4, 2025

  • Ensures size updates are executed immediately when the throttle interval is set to zero.
  • Replaces custom throttle implementation with a more robust and feature-rich debounce and throttle utility based on requestAnimationFrame for smoother updates.
  • Adds leading/trailing edge options to throttle.

@md-amus
Copy link

md-amus commented Jun 9, 2025

if multiple changes are made to a container with throttle zero will it recalculate the whole layout multiple times? is it possible to throttle it per frame, so throttle until before we render and then recalculate, instead of based on time, so we still get performance without the elements jumping around for a couple frames when baased on time? or is this already implemented? thanks.

@Zyie
Copy link
Member Author

Zyie commented Jun 13, 2025

Hey @md-amus the recalculation will only happen once per frame, if using autoUpdate, if you are manually updating then it will recalculate whenever you call app.renderer.layout.update(container).

Also just to note that there is still yoga level caching so if yoga doesn't detect a change it won't recalculate the entire layout tree.

@Zyie Zyie added this pull request to the merge queue Jun 13, 2025
Merged via the queue into main with commit 853eff1 Jun 13, 2025
1 check passed
@Zyie Zyie deleted the fix/throttle branch June 13, 2025 12:56
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

Successfully merging this pull request may close these issues.

2 participants