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

feat: Window-independent requestAnimationFrame #11589

Conversation

CatchABus
Copy link
Contributor

This PR ensures that library will be able to use requestAnimationFrame method regardless of platform.
For example, one can declare a polyfill of this method to Node's global object instead of browser's window and make use of it.
Methods like setTimeout are already used that way so they need no additional handling.

Inspiration came by discussion in #11579 which suggested adding support to chart platforms but this seemed to be a cleaner solution.

@CatchABus
Copy link
Contributor Author

I close this as my solution doesn't seem very ideal. After all, a small window polyfill can do just fine in other environments.

Ideally, we wanted frame callback to be platform-specific but animation frame calls apply to all active charts and charts can have different platforms between each other. The latter was possible to implement but seemed to reduce performance a little bit and made things more complicated so I didn't bother more.
We might revisit it in the future.

@CatchABus CatchABus closed this Feb 6, 2024
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.

1 participant