Skip to content

Commit 3048f84

Browse files
authored
feat(replay): Add option to skip requestAnimationFrame for canvas snapshots (#17380)
1 parent 81108d3 commit 3048f84

File tree

4 files changed

+12
-7
lines changed

4 files changed

+12
-7
lines changed

.size-limit.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ module.exports = [
8282
path: 'packages/browser/build/npm/esm/index.js',
8383
import: createImport('init', 'browserTracingIntegration', 'replayIntegration', 'feedbackIntegration'),
8484
gzip: true,
85-
limit: '95 KB',
85+
limit: '96 KB',
8686
},
8787
{
8888
name: '@sentry/browser (incl. Feedback)',

packages/replay-canvas/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
},
6767
"homepage": "https://docs.sentry.io/platforms/javascript/session-replay/",
6868
"devDependencies": {
69-
"@sentry-internal/rrweb": "2.35.0"
69+
"@sentry-internal/rrweb": "2.37.0"
7070
},
7171
"dependencies": {
7272
"@sentry-internal/replay": "10.5.0",

packages/replay-canvas/src/canvas.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,12 @@ import { defineIntegration } from '@sentry/core';
33
import type { CanvasManagerInterface, CanvasManagerOptions } from '@sentry-internal/replay';
44
import { CanvasManager } from '@sentry-internal/rrweb';
55

6+
interface SnapshotOptions {
7+
skipRequestAnimationFrame?: boolean;
8+
}
9+
610
interface ReplayCanvasIntegration extends Integration {
7-
snapshot: (canvasElement?: HTMLCanvasElement) => Promise<void>;
11+
snapshot: (canvasElement?: HTMLCanvasElement, options?: SnapshotOptions) => Promise<void>;
812
}
913

1014
interface ReplayCanvasOptions {
@@ -106,9 +110,10 @@ export const _replayCanvasIntegration = ((options: Partial<ReplayCanvasOptions>
106110
...(CANVAS_QUALITY[quality || 'medium'] || CANVAS_QUALITY.medium),
107111
};
108112
},
109-
async snapshot(canvasElement?: HTMLCanvasElement) {
113+
async snapshot(canvasElement?: HTMLCanvasElement, options?: SnapshotOptions) {
110114
const canvasManager = await _canvasManager;
111-
canvasManager.snapshot(canvasElement);
115+
116+
canvasManager.snapshot(canvasElement, options);
112117
},
113118
};
114119
}) satisfies IntegrationFn<ReplayCanvasIntegration>;

packages/replay-internal/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@
8282
"devDependencies": {
8383
"@babel/core": "^7.27.7",
8484
"@sentry-internal/replay-worker": "10.5.0",
85-
"@sentry-internal/rrweb": "2.35.0",
86-
"@sentry-internal/rrweb-snapshot": "2.35.0",
85+
"@sentry-internal/rrweb": "2.37.0",
86+
"@sentry-internal/rrweb-snapshot": "2.37.0",
8787
"fflate": "0.8.2",
8888
"jest-matcher-utils": "^29.0.0",
8989
"jsdom-worker": "^0.3.0",

0 commit comments

Comments
 (0)