Skip to content

feat(replay): Add _experiments.ignoreMutations option #16816

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

Merged
merged 3 commits into from
Jul 7, 2025

Conversation

mydea
Copy link
Member

@mydea mydea commented Jul 4, 2025

This option allows to configure a selector list of elements to not capture mutation for.

This is under _experiments for now:

Sentry.replayIntegration({
  _experiments: {
    ignoreMutations: ['.dragging']
  }
});

Fixes #16797

@mydea mydea requested a review from chargome July 4, 2025 12:24
@mydea mydea self-assigned this Jul 4, 2025
Copy link
Contributor

github-actions bot commented Jul 4, 2025

size-limit report 📦

Path Size % Change Change
@sentry/browser 23.99 kB - -
@sentry/browser - with treeshaking flags 23.76 kB - -
@sentry/browser (incl. Tracing) 39.59 kB - -
@sentry/browser (incl. Tracing, Replay) 77.77 kB +0.11% +80 B 🔺
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 70.85 kB +0.11% +76 B 🔺
@sentry/browser (incl. Tracing, Replay with Canvas) 82.49 kB +0.05% +33 B 🔺
@sentry/browser (incl. Tracing, Replay, Feedback) 94.65 kB +0.09% +83 B 🔺
@sentry/browser (incl. Feedback) 40.75 kB - -
@sentry/browser (incl. sendFeedback) 28.7 kB - -
@sentry/browser (incl. FeedbackAsync) 33.59 kB - -
@sentry/react 25.76 kB - -
@sentry/react (incl. Tracing) 41.58 kB - -
@sentry/vue 28.37 kB - -
@sentry/vue (incl. Tracing) 41.37 kB - -
@sentry/svelte 24.01 kB - -
CDN Bundle 25.5 kB - -
CDN Bundle (incl. Tracing) 39.6 kB - -
CDN Bundle (incl. Tracing, Replay) 75.58 kB +0.12% +86 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) 81.05 kB +0.11% +87 B 🔺
CDN Bundle - uncompressed 74.5 kB - -
CDN Bundle (incl. Tracing) - uncompressed 117.63 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 231.92 kB +0.11% +247 B 🔺
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 244.75 kB +0.11% +247 B 🔺
@sentry/nextjs (client) 43.22 kB - -
@sentry/sveltekit (client) 40.04 kB - -
@sentry/node 162.02 kB - -
@sentry/node - without tracing 98.64 kB - -
@sentry/aws-serverless 124.4 kB - -

View base workflow run

mydea added 2 commits July 7, 2025 14:27
This option allows to configure a selector list of elements to not capture mutation for.
@mydea mydea changed the title feat(replay): Add ignoreMutations option feat(replay): Add _experiments.ignoreMutations option Jul 7, 2025
@mydea mydea force-pushed the fn/replay-ignoreMutations branch from 912ed5c to 10752f4 Compare July 7, 2025 12:38
@mydea mydea marked this pull request as ready for review July 7, 2025 12:38
@mydea mydea requested a review from a team as a code owner July 7, 2025 12:38
Comment on lines +13 to +14
const el: HTMLElement | null = node.nodeType === node.ELEMENT_NODE ? (node as HTMLElement) : node.parentElement;
return el;

Choose a reason for hiding this comment

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

What's the purpose of declaring the el constant here?
Is it to make debugging easier? 🙂

Suggested change
const el: HTMLElement | null = node.nodeType === node.ELEMENT_NODE ? (node as HTMLElement) : node.parentElement;
return el;
return node.nodeType === node.ELEMENT_NODE ? (node as HTMLElement) : node.parentElement;

Copy link
Member Author

Choose a reason for hiding this comment

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

this is just vendored in from the rrweb implementation!

@mydea mydea merged commit f52ab47 into develop Jul 7, 2025
134 checks passed
@mydea mydea deleted the fn/replay-ignoreMutations branch July 7, 2025 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

High resource usage when using replay
3 participants