Skip to content

ref(utils): test for webpack error before running replace #7412

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

Merged
merged 1 commit into from
Mar 13, 2023

Conversation

JonasBa
Copy link
Member

@JonasBa JonasBa commented Mar 10, 2023

If we do not match a webpack error, then dont run replace as it will allocate a new string. This optimizes for non-webpack style errors. For cases where we would actually sanitize the string, calling test + replace makes it slightly slower.

Browser benchmarks (node benchmarks seem to confirm this)

@JonasBa JonasBa requested review from timfish and AbhiPrasad March 10, 2023 14:18
@github-actions
Copy link
Contributor

size-limit report 📦

Path Size
@sentry/browser - ES5 CDN Bundle (gzipped + minified) 20.25 KB (+0.2% 🔺)
@sentry/browser - ES5 CDN Bundle (minified) 62.98 KB (+0.15% 🔺)
@sentry/browser - ES6 CDN Bundle (gzipped + minified) 18.88 KB (+0.16% 🔺)
@sentry/browser - ES6 CDN Bundle (minified) 55.89 KB (+0.17% 🔺)
@sentry/browser - Webpack (gzipped + minified) 20.64 KB (+0.19% 🔺)
@sentry/browser - Webpack (minified) 67.41 KB (+0.13% 🔺)
@sentry/react - Webpack (gzipped + minified) 20.66 KB (+0.2% 🔺)
@sentry/nextjs Client - Webpack (gzipped + minified) 48.55 KB (+0.2% 🔺)
@sentry/browser + @sentry/tracing - ES5 CDN Bundle (gzipped + minified) 27.52 KB (+0.25% 🔺)
@sentry/browser + @sentry/tracing - ES6 CDN Bundle (gzipped + minified) 25.77 KB (+0.25% 🔺)
@sentry/replay ES6 CDN Bundle (gzipped + minified) 43.17 KB (0%)
@sentry/replay - Webpack (gzipped + minified) 37.19 KB (0%)
@sentry/browser + @sentry/tracing + @sentry/replay - ES6 CDN Bundle (gzipped + minified) 61.19 KB (+0.11% 🔺)
@sentry/browser + @sentry/replay - ES6 CDN Bundle (gzipped + minified) 54.37 KB (+0.06% 🔺)

@AbhiPrasad AbhiPrasad changed the title ref(parser): test for webpack error before running replace ref(utils): test for webpack error before running replace Mar 13, 2023
@AbhiPrasad AbhiPrasad merged commit 3376a15 into develop Mar 13, 2023
@AbhiPrasad AbhiPrasad deleted the jb/ref/webpack-parser-error branch March 13, 2023 12:57
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