Skip to content

ref(vue): Use string.repeat() #6663

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
Jan 5, 2023
Merged

ref(vue): Use string.repeat() #6663

merged 1 commit into from
Jan 5, 2023

Conversation

mydea
Copy link
Member

@mydea mydea commented Jan 5, 2023

I stumbled over this by accident, and was wondering what you thought about making use of the in-built string.repeat() method there. This is not supported in IE11, but IMHO it is acceptable to fall back to just use the string once in that case, as it will only result in less-nice-looking nesting, not break. But not sure, maybe it is a bad idea, WDYT?

@mydea mydea added the Package: vue Issues related to the Sentry Vue SDK label Jan 5, 2023
@mydea mydea requested review from lforst and Lms24 January 5, 2023 11:56
@mydea mydea self-assigned this Jan 5, 2023
Copy link
Member

@Lms24 Lms24 left a comment

Choose a reason for hiding this comment

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

Lol, never saw this before xD. I think this should be fine. If users bundle their app and they want to support IE11, they could just polyfill String.repeat

Also, this is only used for creating a component "trace" (overloaded term...) in event.context.vue of error events, so the impact shouldn't be too drastic

@github-actions
Copy link
Contributor

github-actions bot commented Jan 5, 2023

size-limit report 📦

Path Size
@sentry/browser - ES5 CDN Bundle (gzipped + minified) 19.84 KB (-0.01% 🔽)
@sentry/browser - ES5 CDN Bundle (minified) 61.43 KB (0%)
@sentry/browser - ES6 CDN Bundle (gzipped + minified) 18.61 KB (+0.02% 🔺)
@sentry/browser - ES6 CDN Bundle (minified) 54.98 KB (0%)
@sentry/browser - Webpack (gzipped + minified) 20.38 KB (0%)
@sentry/browser - Webpack (minified) 66.62 KB (0%)
@sentry/react - Webpack (gzipped + minified) 20.41 KB (0%)
@sentry/nextjs Client - Webpack (gzipped + minified) 47.65 KB (0%)
@sentry/browser + @sentry/tracing - ES5 CDN Bundle (gzipped + minified) 26.81 KB (+0.02% 🔺)
@sentry/browser + @sentry/tracing - ES6 CDN Bundle (gzipped + minified) 25.25 KB (-0.01% 🔽)
@sentry/replay ES6 CDN Bundle (gzipped + minified) 42.99 KB (-0.01% 🔽)
@sentry/replay - Webpack (gzipped + minified) 38.24 KB (-0.02% 🔽)

@mydea
Copy link
Member Author

mydea commented Jan 5, 2023

Lol, never saw this before xD. I think this should be fine. If users bundle their app and they want to support IE11, they could just polyfill String.repeat

Also, this is only used for creating a component "trace" (overloaded term...) in event.context.vue of error events, so the impact shouldn't be too drastic

Yeah, I thought so as well. And we can save a few precious bytes ;)

@mydea mydea merged commit 0def7bc into master Jan 5, 2023
@mydea mydea deleted the fn/use-str-repeat branch January 5, 2023 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Package: vue Issues related to the Sentry Vue SDK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants