Skip to content

feat(replay): Streamline replay options #6641

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

Closed
wants to merge 1 commit into from

Conversation

mydea
Copy link
Member

@mydea mydea commented Jan 3, 2023

This streamlines options to be passed to replay a bit:

First, we deprecate passing arbitrary rrweb config through. Instead, you can provide recordingOptions directly, which will be passed through. For now, the old way still works, but we will remove this eventually.

Secondly, we explicitly defined the config options we do support. This should cover most things that users are actually using, thus most users shouldn't need to actually do anything.

Finally, this also separates the options we pass to the integration from the options we store on the replay container. There is no need to keep all the rrweb-specific config there, we only need this at init-time, and can then discard it.

Closes #6390

Note that this is technically a breaking change, because the type signature of replay.getOptions() is technically public, but this shouldn't really affect any user. Any other config users could use before should continue to work for the time being, until we remove the deprecated functionality.

This streamlines options to be passed to replay a bit:

First, we deprecate passing arbitrary rrweb config through. Instead, you can provide `recordingOptions` directly, which will be passed through. For now, the old way still works, but we will remove this eventually.

Secondly, we explicitly defined the config options we _do_ support. This should cover most things that users are actually using, thus most users shouldn't need to actually do anything.

Finally, this also separates the options we pass to the integration from the options we store on the replay container. There is no need to keep all the rrweb-specific config there, we only need this at init-time, and can then discard it.
@mydea mydea added the Package: replay Issues related to the Sentry Replay SDK label Jan 3, 2023
@mydea mydea requested review from billyvg and Lms24 January 3, 2023 15:03
@mydea mydea self-assigned this Jan 3, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Jan 3, 2023

size-limit report 📦

Path Size
@sentry/browser - ES5 CDN Bundle (gzipped + minified) 19.8 KB (+0.01% 🔺)
@sentry/browser - ES5 CDN Bundle (minified) 61.34 KB (0%)
@sentry/browser - ES6 CDN Bundle (gzipped + minified) 18.58 KB (0%)
@sentry/browser - ES6 CDN Bundle (minified) 54.93 KB (0%)
@sentry/browser - Webpack (gzipped + minified) 20.34 KB (0%)
@sentry/browser - Webpack (minified) 66.46 KB (0%)
@sentry/react - Webpack (gzipped + minified) 20.36 KB (0%)
@sentry/nextjs Client - Webpack (gzipped + minified) 47.62 KB (0%)
@sentry/browser + @sentry/tracing - ES5 CDN Bundle (gzipped + minified) 26.76 KB (+0.02% 🔺)
@sentry/browser + @sentry/tracing - ES6 CDN Bundle (gzipped + minified) 25.2 KB (-0.01% 🔽)
@sentry/replay ES6 CDN Bundle (gzipped + minified) 42.23 KB (+0.3% 🔺)
@sentry/replay - Webpack (gzipped + minified) 38.31 KB (+0.33% 🔺)

...recordingOptions
ignoreClass = 'sentry-ignore',
_experiments = {},
recordingOptions = {},
Copy link
Member

Choose a reason for hiding this comment

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

I would prefer if we pulled out the rrweb options that we want to allow. I still think having recordingOptions is a bit arbitrary when we have options like the above that could be considered recording options as well.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, that's basically what we are doing here anyhow :) All the options we really support are on the top level, and recordingOptions is really more of an escape hatch to allow passing arbitrary other options (for which we do not provide any guarantees). That was also the original idea for calling this option rrweb, as that is really rrweb-specific stuff that we do not explicitly support.

Copy link
Member

@billyvg billyvg Jan 4, 2023

Choose a reason for hiding this comment

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

Yeah my suggestion is to kill the escape hatch is we are going to change the API anyway. It should either be a first class option or not supported at all. I'm gonna go through the rrweb options and make a list of what I think we should support. Thoughts on that?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm also generally fine with that, although we may get into the situation where one customer wants to do some kind of weird thing that rrweb supports but we do not want to support. But I'm also happy with just saying "no, sorry, can't do that" in such a case!

@github-actions
Copy link
Contributor

This pull request has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you label it Status: Backlog or Status: In Progress, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

@mydea
Copy link
Member Author

mydea commented Jan 30, 2023

Closing this in favor of other stuff done in recent weeks!

@mydea mydea closed this Jan 30, 2023
@AbhiPrasad AbhiPrasad deleted the fn/replay-recordingOptions branch March 27, 2025 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Package: replay Issues related to the Sentry Replay SDK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Replay] Move rrweb-specific configuration into recordingOptions
2 participants