Skip to content

fix(utils): Normalize HTML elements as string - #7916

Merged
mydea merged 1 commit into
developfrom
fn/normalize-htmlelements
Apr 20, 2023
Merged

fix(utils): Normalize HTML elements as string#7916
mydea merged 1 commit into
developfrom
fn/normalize-htmlelements

Conversation

@mydea

Copy link
Copy Markdown
Member

Currently, we do not special-case html elements in normalization. This means they are still normalized as objects, leading to potentially deeply nested stuff, and to problems with e.g. replay. IMHO it is more expected to see a string representation of this element instead.

Ref https://github.com/getsentry/team-replay/issues/67

@mydea
mydea requested review from a team and billyvgApril 20, 2023 09:48
@mydeamydea self-assigned this Apr 20, 2023
@mydea
mydea requested review from AbhiPrasad and Lms24 and removed request for a teamApril 20, 2023 09:48
@github-actions

github-actionsBot commented Apr 20, 2023

Copy link
Copy Markdown
Contributor

size-limit report 📦

PathSize
@sentry/browser - ES5 CDN Bundle (gzipped + minified)21.02 KB (+0.18% 🔺)
@sentry/browser - ES5 CDN Bundle (minified)65.65 KB (+0.24% 🔺)
@sentry/browser - ES6 CDN Bundle (gzipped + minified)19.56 KB (+0.18% 🔺)
@sentry/browser - ES6 CDN Bundle (minified)58.1 KB (+0.27% 🔺)
@sentry/browser - Webpack (gzipped + minified)21.16 KB (+0.2% 🔺)
@sentry/browser - Webpack (minified)69.06 KB (+0.23% 🔺)
@sentry/react - Webpack (gzipped + minified)21.18 KB (+0.2% 🔺)
@sentry/nextjs Client - Webpack (gzipped + minified)49.03 KB (+0.09% 🔺)
@sentry/browser + @sentry/tracing - ES5 CDN Bundle (gzipped + minified)28.59 KB (+0.13% 🔺)
@sentry/browser + @sentry/tracing - ES6 CDN Bundle (gzipped + minified)26.82 KB (+0.15% 🔺)
@sentry/replay ES6 CDN Bundle (gzipped + minified)46.04 KB (+1.53% 🔺)
@sentry/replay - Webpack (gzipped + minified)39.92 KB (+1.64% 🔺)
@sentry/browser + @sentry/tracing + @sentry/replay - ES6 CDN Bundle (gzipped + minified)64.91 KB (+1.06% 🔺)
@sentry/browser + @sentry/replay - ES6 CDN Bundle (gzipped + minified)57.88 KB (+1.2% 🔺)

@mydea
mydeaforce-pushed the fn/normalize-htmlelements branch from e2e3379 to 10d17c6CompareApril 20, 2023 10:31
@mydea

Copy link
Copy Markdown
MemberAuthor

I also added an integration test to ensure console log is captured this way for replays.

Currently, we do not special-case html elements in normalization. This means they are still normalized as objects, leading to potentially deeply nested stuff, and to problems with e.g. replay. IMHO it is more expected to see a string representation of this element instead? Either just the element class name (this PR), or alternatively
@mydea
mydeaforce-pushed the fn/normalize-htmlelements branch from 6dadad6 to 0968722CompareApril 20, 2023 13:50
@mydea
mydea merged commit cd7a513 into developApr 20, 2023
@mydea
mydea deleted the fn/normalize-htmlelements branch April 20, 2023 14:08
Sign up for freeto 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.

4 participants

@mydea@lforst@Lms24@AbhiPrasad