Skip to content
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

feat: allow custom replay root #1061

Closed
wants to merge 2 commits into from
Closed

feat: allow custom replay root #1061

wants to merge 2 commits into from

Conversation

daibhin
Copy link
Contributor

@daibhin daibhin commented Mar 8, 2024

Changes

Add a new root option to the JS session_replay config

Checklist

  • Tests for new code (see advice on the tests we use)
  • Accounted for the impact of any changes across different browsers
  • Accounted for backwards compatibility of any changes (no breaking changes in posthog-js!)

Copy link

github-actions bot commented Mar 8, 2024

Size Change: +146 B (0%)

Total Size: 853 kB

Filename Size Change
dist/array.full.js 183 kB +38 B (0%)
dist/array.js 124 kB +36 B (0%)
dist/es.js 124 kB +36 B (0%)
dist/module.js 124 kB +36 B (0%)
ℹ️ View Unchanged
Filename Size
dist/exception-autocapture.js 12.1 kB
dist/recorder-v2.js 106 kB
dist/recorder.js 58.7 kB
dist/surveys-module-previews.js 62 kB
dist/surveys.js 58.3 kB

compressed-size-action

Copy link
Member

@marandaneto marandaneto left a comment

Choose a reason for hiding this comment

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

If that's a quick win and it works with Flutter web, I'd be fine with it.

@daibhin
Copy link
Contributor Author

daibhin commented Mar 13, 2024

@pauldambra is there a reason we hadn't included this as an option before?

@@ -61,6 +61,7 @@ export declare type recordOptions<T> = {
plugins?: RecordPlugin[]
mousemoveWait?: number
keepIframeSrcFn?: KeepIframeSrcFn
root?: HTMLElement
Copy link
Member

Choose a reason for hiding this comment

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

should we document here why we're adding this config?
do all flutter users have to set it?

@@ -171,6 +171,7 @@ export interface SessionRecordingOptions {
// our settings here only support a subset of those proposed for rrweb's network capture plugin
recordHeaders?: boolean
recordBody?: boolean
root?: HTMLElement
Copy link
Member

Choose a reason for hiding this comment

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

oh... or should comment on when and why go here?

Copy link
Member

@pauldambra pauldambra left a comment

Choose a reason for hiding this comment

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

test failure looks easy to fix

we should definitely confirm this still works for web and solves problem for flutter but otherwise no reason not to expose it - just probably need a really clear comment on when and why to set it

@daibhin
Copy link
Contributor Author

daibhin commented Mar 14, 2024

Do not need this in favour of #1082

@daibhin daibhin closed this Mar 14, 2024
@daibhin daibhin deleted the dn-feat/custom-root branch March 14, 2024 17:27
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