-
Notifications
You must be signed in to change notification settings - Fork 8
fix(rrweb): Use unpatched requestAnimationFrame when possible
#150
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
Conversation
As explained here: getsentry/sentry-javascript#6946 (comment) the usage of `requestAnimationFrame` can lead to issues when working with Zone.js.
size-limit report 📦
|
Lms24
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like this solution! Thinking about it, we might run into some kind of trouble for no longer using a patched version of raf but let's worry about it if anyone complains 😅
Curious how much this is gonna improve perf on Angular!
billyvg
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Browser JS is wild
- fix(rrweb): Use unpatched requestAnimationFrame when possible [#150](getsentry/rrweb#150) - ref: Avoid async in canvas (#143) - feat: Bundle canvas worker manually (#144) - build: Build for ES2020 (#142)
- fix(rrweb): Use unpatched requestAnimationFrame when possible [#150](getsentry/rrweb#150) - ref: Avoid async in canvas (#143) - feat: Bundle canvas worker manually (#144) - build: Build for ES2020 (#142)
This bump contains the following changes: - fix(rrweb): Use unpatched requestAnimationFrame when possible [#150](getsentry/rrweb#150) - ref: Avoid async in canvas [#143](getsentry/rrweb#143) - feat: Bundle canvas worker manually [#144](getsentry/rrweb#144) - build: Build for ES2020 [#142](getsentry/rrweb#142) Extracted out from #9826 Closes #6946
As explained here: getsentry/sentry-javascript#6946 (comment) the usage of `requestAnimationFrame` can lead to issues when working with Zone.js. With this fix, where possible we should now use the `requestAnimationFrame` implementation from an iframe, if possible, and else fall back on just using `window.requestAnimationFrame` as before. We already do something similar in sentry-javascript to get an unpatched `fetch`: https://github.com/getsentry/sentry-javascript/blob/23ef22b115c8868861896cc9003bd4bb6afb0690/packages/browser/src/transports/utils.ts#L65-L71 so this should hopefully work fine!
As explained here: getsentry/sentry-javascript#6946 (comment) the usage of
requestAnimationFramecan lead to issues when working with Zone.js.With this fix, where possible we should now use the
requestAnimationFrameimplementation from an iframe, if possible, and else fall back on just usingwindow.requestAnimationFrameas before.We already do something similar in sentry-javascript to get an unpatched
fetch: https://github.com/getsentry/sentry-javascript/blob/23ef22b115c8868861896cc9003bd4bb6afb0690/packages/browser/src/transports/utils.ts#L65-L71 so this should hopefully work fine!