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

Bug: under tracking javascript time #295

Open
RobPruzan opened this issue Feb 28, 2025 · 0 comments
Open

Bug: under tracking javascript time #295

RobPruzan opened this issue Feb 28, 2025 · 0 comments

Comments

@RobPruzan
Copy link
Collaborator

React Scan tracks the JavaScript phase of interaction times by tracking the time from the first event handler, to the last event handler. This misses async work done in things like requestAnimationFrom.

For example:

requestAnimationFrame(() => setState(prev => prev + 1))

Would not get tracked under JS time, but would get tracked under render time. This makes it possible to violate the invariant that JavaScript time must be a superset of render time.

This can be partially fixed by "backfilling" js time by the render time accumulated during the requestAnimationFrame stage, and monkey patching requestAnimationFrame (and other async API's) to track the time of the callbacks, and back filling that into JS time.

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

1 participant