getsentry / getsentry/sentry-javascript

Angular change detection problems in Replay

未关闭
#12,443 3 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看
Angular Improvement Replays
主要语言
TypeScript
星标
8.7k
派生
1.8k
平均合并
1 天 17 小时
30 天内合并 PR
515

描述

Angular monkeypatches [browser APIs](https://github.com/angular/angular/blob/main/packages/zone.js/STANDARD-APIS.md) so that when they are called, will trigger Angular's change detection. This means that our SDK can end up causing customer applications to unnecessarily re-render, which in turn causes our Replay SDK to perform more work and can even cause performance regressions.

Some example areas where this happens:
* In the `rrweb-snapshot` package, [`snapshot.ts`](https://github.com/getsentry/rrweb/blob/sentry-v2/packages/rrweb-snapshot/src/snapshot.ts) is using the global `setTimeout` and `clearTimeout` functions, which are monkeypatched by Angular and triggers their change detection.
* `Promise`
* Any `EventTarget` (e.g. `window`, `Performance`, `Worker`)

Related to https://github.com/getsentry/sentry-javascript/issues/11661

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。