getsentry / rrweb

record and replay the web
https://www.rrweb.io/
Other
9 stars 5 forks source link

fix(rrweb): Use unpatched `requestAnimationFrame` when possible #150

Closed mydea closed 6 months ago

mydea commented 6 months ago

As explained here: https://github.com/getsentry/sentry-javascript/issues/6946#issuecomment-1875842171 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!

github-actions[bot] commented 6 months ago

size-limit report 📦

Path Size
rrweb - record only (gzipped) 16.67 KB (+0.64% 🔺)
rrweb - record & getCanvasManager only (gzipped) 19.23 KB (+0.49% 🔺)
rrweb - record only (min) 56.87 KB (+0.6% 🔺)
rrweb - record with treeshaking flags (gzipped) 15.46 KB (+0.73% 🔺)