8000 feat(replays): Add an SDK _experiments configuration flag to enable canvas recording by c298lee · Pull Request #9723 · getsentry/sentry-javascript · GitHub
[go: up one dir, main page]

Skip to content

feat(replays): Add an SDK _experiments configuration flag to enable canvas recording #9723

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 17 commits into from
Dec 7, 2023

Conversation

c298lee
Copy link
Contributor
@c298lee c298lee commented Dec 1, 2023

SDK _experiments configuration flag to enable canvas recording. It allows snapshot canvas recording at 4fps.

Closes https://github.com/getsentry/team-replay/issues/306

@c298lee c298lee requested a review from billyvg December 1, 2023 18:34
Copy link
Contributor
github-actions bot commented Dec 1, 2023

size-limit report 📦

Path Size
@sentry/browser (incl. Tracing, Replay, Feedback) - Webpack (gzipped) 74.73 KB (+0.1% 🔺)
@sentry/browser (incl. Tracing, Replay) - Webpack (gzipped) 66.08 KB (+0.12% 🔺)
@sentry/browser (incl. Tracing, Replay) - Webpack with treeshaking flags (gzipped) 59.68 KB (+0.13% 🔺)
@sentry/browser (incl. Tracing) - Webpack (gzipped) 31.13 KB (0%)
@sentry/browser (incl. Feedback) - Webpack (gzipped) 29.74 KB (0%)
@sentry/browser - Webpack (gzipped) 21.39 KB (0%)
@sentry/browser (incl. Tracing, Replay, Feedback) - ES6 CDN Bundle (gzipped) 71.3 KB (+0.08% 🔺)
@sentry/browser (incl. Tracing, Replay) - ES6 CDN Bundle (gzipped) 63.02 KB (+0.09% 🔺)
@sentry/browser (incl. Tracing) - ES6 CDN Bundle (gzipped) 29.65 KB (0%)
@sentry/browser - ES6 CDN Bundle (gzipped) 21.71 KB (0%)
@sentry/browser (incl. Tracing, Replay) - ES6 CDN Bundle (minified & uncompressed) 198.5 KB (+0.08% 🔺)
@sentry/browser (incl. Tracing) - ES6 CDN Bundle (minified & uncompressed) 89.78 KB (0%)
@sentry/browser - ES6 CDN Bundle (minified & uncompressed) 64.76 KB (0%)
@sentry/browser (incl. Tracing) - ES5 CDN Bundle (gzipped) 32.3 KB (0%)
@sentry/react (incl. Tracing, Replay) - Webpack (gzipped) 66.44 KB (+0.12% 🔺)
@sentry/react - Webpack (gzipped) 21.43 KB (0%)
@sentry/nextjs Client (incl. Tracing, Replay) - Webpack (gzipped) 83.17 KB (+0.1% 🔺)
@sentry/nextjs Client - Webpack (gzipped) 48.23 KB (0%)
@sentry-internal/feedback - Webpack (gzipped) 16.19 KB (0%)

@billyvg billyvg marked this pull request as ready for review December 1, 2023 20:01
@billyvg billyvg marked this pull request as draft December 1, 2023 20:01
@billyvg
Copy link
Member
billyvg commented Dec 1, 2023

Let's make the options == what is described in https://github.com/getsentry/team-replay/issues/306 so that we can customize rrweb options without having to release a new SDK version

@c298lee c298lee marked this pull request as ready for review December 5, 2023 16:38
c298lee and others added 2 commits December 5, 2023 16:01
Co-authored-by: Billy Vong <billyvg@users.noreply.github.com>
@c298lee c298lee requested a review from billyvg December 5, 2023 22:18
Comment on lines 237 to 238
fps: number;
quality: number;
Copy link
Member

Choose a reason for hiding this comment

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

Can we make these optional and set defaults for them?

@billyvg billyvg requested a review from mydea December 6, 2023 18:54
@@ -339,6 +339,12 @@ export class ReplayContainer implements ReplayContainerInterface {
...(this.recordingMode === 'buffer' && { checkoutEveryNms: BUFFER_CHECKOUT_TIME }),
emit: getHandleRecordingEmit(this),
onMutation: this._onMutationHandler,
...(this._options._experiments.canvas && {
Copy link
Member

Choose a reason for hiding this comment

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

l: Could we extract this out to avoid having so many repetitions here, as they are quite long? Something like this:

const canvas = this._options._experiments.canvas;
// ...
onMutation: this._onMutationHandler,
...(canvas && { 
  recordCanvas: true,
  sampling: {
    canvas: canvas.fps || 4,
    // ...
  }
}

@c298lee c298lee merged commit b3f8d9b into develop Dec 7, 2023
@c298lee c298lee deleted the experimental-canvas branch December 7, 2023 16:50
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.

3 participants
0