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

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

Merged
merged 1 commit into from
Apr 20, 2023

Conversation

mydea
Copy link
Member

@mydea mydea commented Apr 20, 2023

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 billyvg and a team April 20, 2023 09:48
@mydea mydea self-assigned this Apr 20, 2023
@mydea mydea requested review from Lms24 and AbhiPrasad and removed request for a team April 20, 2023 09:48
@github-actions
Copy link
Contributor

github-actions bot commented Apr 20, 2023

size-limit report 📦

Path Size
@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 mydea force-pushed the fn/normalize-htmlelements branch from e2e3379 to 10d17c6 Compare April 20, 2023 10:31
@mydea
Copy link
Member Author

mydea commented Apr 20, 2023

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 mydea force-pushed the fn/normalize-htmlelements branch from 6dadad6 to 0968722 Compare April 20, 2023 13:50
@mydea mydea merged commit cd7a513 into develop Apr 20, 2023
@mydea mydea deleted the fn/normalize-htmlelements branch April 20, 2023 14:08
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.

4 participants