Skip to content

Commit 8a8cb58

Browse files
committed
make it experimental
1 parent 00469f4 commit 8a8cb58

File tree

4 files changed

+12
-13
lines changed

4 files changed

+12
-13
lines changed

dev-packages/browser-integration-tests/suites/replay/ignoreMutations/init.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ window.Replay = Sentry.replayIntegration({
66
flushMaxDelay: 200,
77
minReplayDuration: 0,
88
useCompression: false,
9-
ignoreMutations: ['.moving'],
9+
_experiments: {
10+
ignoreMutations: ['.moving'],
11+
},
1012
});
1113

1214
Sentry.init({

packages/replay-internal/src/integration.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ export class Replay implements Integration {
8484

8585
mutationBreadcrumbLimit = 750,
8686
mutationLimit = 10_000,
87-
ignoreMutations = [],
8887

8988
slowClickTimeout = 7_000,
9089
slowClickIgnoreSelectors = [],
@@ -168,7 +167,6 @@ export class Replay implements Integration {
168167
maskAllText,
169168
mutationBreadcrumbLimit,
170169
mutationLimit,
171-
ignoreMutations,
172170
slowClickTimeout,
173171
slowClickIgnoreSelectors,
174172
networkDetailAllowUrls,

packages/replay-internal/src/replay.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1305,8 +1305,8 @@ export class ReplayContainer implements ReplayContainerInterface {
13051305

13061306
/** Handler for rrweb.record.onMutation */
13071307
private _onMutationHandler(mutations: MutationRecord[]): boolean {
1308-
const { ignoreMutations } = this._options;
1309-
if (ignoreMutations.length) {
1308+
const { ignoreMutations } = this._options._experiments;
1309+
if (ignoreMutations?.length) {
13101310
if (
13111311
mutations.some(mutation => {
13121312
const el = rrwebUtils.closestElementOfNode(mutation.target);

packages/replay-internal/src/types/replay.ts

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -161,14 +161,6 @@ export interface ReplayPluginOptions extends ReplayNetworkOptions {
161161
*/
162162
mutationLimit: number;
163163

164-
/**
165-
* Completetly ignore mutations matching the given selectors.
166-
* This can be used if a specific type of mutation is causing (e.g. performance) problems.
167-
* NOTE: This can be dangerous to use, as mutations are applied as incremental patches.
168-
* Make sure to verify that the captured replays still work when using this option.
169-
*/
170-
ignoreMutations: string[];
171-
172164
/**
173165
* The max. time in ms to wait for a slow click to finish.
174166
* After this amount of time we stop waiting for actions after a click happened.
@@ -242,6 +234,13 @@ export interface ReplayPluginOptions extends ReplayNetworkOptions {
242234
*/
243235
recordCrossOriginIframes: boolean;
244236
autoFlushOnFeedback: boolean;
237+
/**
238+
* Completetly ignore mutations matching the given selectors.
239+
* This can be used if a specific type of mutation is causing (e.g. performance) problems.
240+
* NOTE: This can be dangerous to use, as mutations are applied as incremental patches.
241+
* Make sure to verify that the captured replays still work when using this option.
242+
*/
243+
ignoreMutations: string[];
245244
}>;
246245
}
247246

0 commit comments

Comments
 (0)