getsentry / getsentry/sentry-javascript
Angular change detection problems in Replay
- Lingua principale
- TypeScript
- Stelle
- 8.7k
- Fork
- 1.8k
- Merge medio
- 1g 17h
- PR unite (30g)
- 515
Descrizione
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
Guida per i contributori
Apri la guida per i contributori
Valutazione
Questa issue non è ancora stata valutata.