getsentry / getsentry/sentry-javascript

Angular change detection problems in Replay

Đang mở
#12,443 3 bình luận 1 reaction 0 người được giao Xem trên GitHub
Angular Improvement Replays
Ngôn ngữ chính
TypeScript
Star
8.7k
Fork
1.8k
Merge trung bình
1 ngày 17 giờ
Pull request đã merge (30 ngày)
515

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.