Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: angular change detection mutation observer #1531

Merged
merged 6 commits into from
Nov 18, 2024

Conversation

pauldambra
Copy link
Member

we get periodic reports of performance issues with angular

angular change detection patches browser methods

we do change detection too

so we fight each other

this

  • grabs MutationObserver from an iframe so that we aren't using angular's patched methods
  • fixes detection of whether Angular has patched a method
  • adds an eslint rule so we don't use MutationObserver directly in future

TODO

  • also fix rrweb's detection of whether angular has patched this

Copy link

vercel bot commented Nov 18, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
posthog-js ✅ Ready (Inspect) Visit Preview Nov 18, 2024 11:43am

Copy link

github-actions bot commented Nov 18, 2024

Size Change: +15.6 kB (+0.5%)

Total Size: 3.13 MB

Filename Size Change
dist/all-external-dependencies.js 204 kB +651 B (+0.32%)
dist/array.full.es5.js 254 kB +441 B (+0.17%)
dist/array.full.js 356 kB +651 B (+0.18%)
dist/array.full.no-external.js 355 kB +651 B (+0.18%)
dist/array.js 171 kB +659 B (+0.39%)
dist/array.no-external.js 170 kB +657 B (+0.39%)
dist/dead-clicks-autocapture.js 13.7 kB +688 B (+5.3%) 🔍
dist/exception-autocapture.js 9.45 kB +644 B (+7.31%) 🔍
dist/external-scripts-loader.js 2.88 kB +686 B (+31.25%) 🚨
dist/main.js 172 kB +659 B (+0.38%)
dist/module.full.js 356 kB +651 B (+0.18%)
dist/module.full.no-external.js 355 kB +651 B (+0.18%)
dist/module.js 171 kB +659 B (+0.39%)
dist/module.no-external.js 170 kB +659 B (+0.39%)
dist/recorder-v2.js 114 kB +658 B (+0.58%)
dist/recorder.js 114 kB +658 B (+0.58%)
dist/surveys-preview.js 58.2 kB +1.55 kB (+2.74%)
dist/surveys.js 62.8 kB +688 B (+1.11%)
dist/tracing-headers.js 2.81 kB +1.48 kB (+111.36%) 🆘
dist/web-vitals.js 11.9 kB +1.52 kB (+14.68%) ⚠️

compressed-size-action

@@ -0,0 +1,28 @@
module.exports = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice, love the linter rule

@pauldambra pauldambra added the bump patch Bump patch version when this PR gets merged label Nov 18, 2024
Copy link
Member

@marandaneto marandaneto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't know much about angular but it looks like it does what the PR description says, LGTM

@pauldambra pauldambra merged commit 6870579 into main Nov 18, 2024
16 checks passed
@pauldambra pauldambra deleted the fix/angular-change-detection-attempt-2 branch November 18, 2024 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bump patch Bump patch version when this PR gets merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants