Title: [Replay] Move rrweb-specific configuration into `recordingOptions` · Issue #6390 · getsentry/sentry-javascript · GitHub
Open Graph Title: [Replay] Move rrweb-specific configuration into `recordingOptions` · Issue #6390 · getsentry/sentry-javascript
X Title: [Replay] Move rrweb-specific configuration into `recordingOptions` · Issue #6390 · getsentry/sentry-javascript
Description: Currently, replay is configured like this: new Replay({ // replay specific config useCompression: true, stickySession: true, // this is passed directly to rrweb blockClass: 'sentry-block', ignoreClass: 'sentry-ignore', maskTextClass: 'se...
Open Graph Description: Currently, replay is configured like this: new Replay({ // replay specific config useCompression: true, stickySession: true, // this is passed directly to rrweb blockClass: 'sentry-block', ignoreCl...
X Description: Currently, replay is configured like this: new Replay({ // replay specific config useCompression: true, stickySession: true, // this is passed directly to rrweb blockClass: 'sentry-block', ...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/6390
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[Replay] Move rrweb-specific configuration into `recordingOptions`","articleBody":"Currently, replay is configured like this:\r\n\r\n```js\r\nnew Replay({\r\n // replay specific config\r\n useCompression: true,\r\n stickySession: true,\r\n\r\n // this is passed directly to rrweb\r\n blockClass: 'sentry-block',\r\n ignoreClass: 'sentry-ignore',\r\n maskTextClass: 'sentry-mask'\r\n});\r\n```\r\n\r\nFrom a code perspective, this happens with a rest operator:\r\n\r\n```js\r\nconstructor({\r\n flushMinDelay = 5000,\r\n flushMaxDelay = 15000,\r\n initialFlushDelay = 5000,\r\n stickySession = true,\r\n useCompression = true,\r\n sessionSampleRate = DEFAULT_SESSION_SAMPLE_RATE,\r\n errorSampleRate = DEFAULT_ERROR_SAMPLE_RATE,\r\n maskAllText = true,\r\n maskAllInputs = true,\r\n blockAllMedia = true,\r\n blockClass = 'sentry-block',\r\n ignoreClass = 'sentry-ignore',\r\n maskTextClass = 'sentry-mask',\r\n blockSelector = '[data-sentry-block]',\r\n ...recordingOptions, // \u003c-- this is the important part\r\n }: ReplayConfiguration = {}) {\r\n```\r\n\r\nThis basically means that _any_ config passed to `new Replay()` that is not defined above will be passed to rrweb.\r\n\r\nIn order to streamline this and make this more explicit, I propose to change this API to:\r\n\r\n```js\r\nnew Replay({\r\n // replay specific config\r\n useCompression: true,\r\n stickySession: true,\r\n\r\n recordingOptions: {\r\n blockClass: 'sentry-block',\r\n ignoreClass: 'sentry-ignore',\r\n maskTextClass: 'sentry-mask'\r\n }\r\n});\r\n```\r\n\r\nThis would make it much more explicit which options are only related to rrweb.\r\nWe can still promote all options we care about/think are important to the top level and internall pass them to `recordingOptions`, e.g.:\r\n\r\n```js\r\nnew Replay({\r\n // replay specific config\r\n useCompression: true,\r\n stickySession: true,\r\n\r\n // Explicit rrweb options we care about - name can match, but could also be different\r\n blockClass: 'myClass',\r\n otherNameForIgnoreClass: 'ignore'\r\n\r\n recordingOptions: {}\r\n});\r\n```\r\n\r\nFor now, I propose to add these options to the top level:\r\n\r\n* `ignoreClass: string | string[]` one or multiple classes to ignore. We can internally convert this for `ignoreClass`\r\n* `blockClass: string | string[]`: one or multiple classes to block\r\n* `blockSelector: string | string[]`: One or multiple selectors to block\r\n* `maskTextClass: string | string[]`: one or multiple classes to mask text for\r\n* `inlineImages`: If true, inline images as data URIs\r\n* `recordCanvas`: If true, record canvas element content\r\n\r\nWhich covers the most relevant stuff, and also the stuff we currently provide default values for.\r\n\r\nFor the initial release, we can still handle the \"old\" way of config, warn when we detect \"unknown\" config, and still make it work. And then remove this deprecated functionality in the near future.","author":{"url":"https://github.com/mydea","@type":"Person","name":"mydea"},"datePublished":"2022-12-02T09:50:59Z","url":"https://github.com/getsentry/sentry-javascript/issues/6390"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:1f15d5d0-fdab-dada-43de-1cc307301448 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DC00:15C1B0:1AFA6C:24F3A1:6B04488A |
| html-safe-nonce | a798fe49fc59df504baa3cb76de7ddc43f88f9558704f5602f5e093ac1d15cc4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQzAwOjE1QzFCMDoxQUZBNkM6MjRGM0ExOjZCMDQ0ODhBIiwidmlzaXRvcl9pZCI6IjI0NTYyNTkyMDM4NzEwMzM0ODIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 5cc6c9fa0c3d0fc422040bcb70fa6a24a034a673ad0246cd8093bd191f8180e2 |
| hovercard-subject-tag | issue:1472595471 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-javascript/6390/issue_layout |
| twitter:image | https://opengraph.githubassets.com/354d78d67f9a877900d9810d3d6b136607b244218a45143c40847829f3630af1/getsentry/sentry-javascript/issues/6390 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/354d78d67f9a877900d9810d3d6b136607b244218a45143c40847829f3630af1/getsentry/sentry-javascript/issues/6390 |
| og:image:alt | Currently, replay is configured like this: new Replay({ // replay specific config useCompression: true, stickySession: true, // this is passed directly to rrweb blockClass: 'sentry-block', ignoreCl... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mydea |
| hostname | github.com |
| expected-hostname | github.com |
| None | d4495c3631faba668036f176d1f5946901c5172efd73a6edb984029e7d4f8e46 |
| turbo-cache-control | no-preview |
| go-import | github.com/getsentry/sentry-javascript git https://github.com/getsentry/sentry-javascript.git |
| octolytics-dimension-user_id | 1396951 |
| octolytics-dimension-user_login | getsentry |
| octolytics-dimension-repository_id | 3328572 |
| octolytics-dimension-repository_nwo | getsentry/sentry-javascript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 3328572 |
| octolytics-dimension-repository_network_root_nwo | getsentry/sentry-javascript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 9ac4337fb7c6a5846cdfdb1a04f154d3c33ebc77 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width