getsentry / getsentry/sentry-javascript

Angular change detection problems in Replay

オープン
#12,443 コメント 3 件 リアクション 1 件 担当者 0 名 GitHub で見る
Angular Improvement Replays
主要言語
TypeScript
スター
8.7k
フォーク
1.8k
平均マージ
1日 17時間
マージ済み PR(30日)
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 を短くまとめたダイジェスト。