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

ref(build): Remove constToVarPlugin #5970

Merged
merged 12 commits into from Oct 18, 2022
Merged

Conversation

lforst
Copy link
Member

@lforst lforst commented Oct 17, 2022

This PR started out as an experiment but thinking more about this, I would actually go forward with this change, because:

  • It fixes cases where replacing const with var causes actual problems (ui.vue application render is always cancelled #5917)
  • Bundle size impact is like +23 bytes gzipped for the React SDK, +90 bytes gzipped for the Next.js SDK which is negligible, and it even reduces gzipped bundle size for the CDN bundles (???)
  • Slightly reduces the complexity and duration of our build-process
  • Moderately reduces the complexity and duration of our test process (by removing the jest transformer)
  • Removes ambiguity of local variables named global and the ambient global global.

I am open to discussing any drawbacks this might have! So far I don't really see any besides changes in bundle size.

Resolves #5925

@github-actions
Copy link
Contributor

github-actions bot commented Oct 17, 2022

size-limit report 📦

Path Size
@sentry/browser - ES5 CDN Bundle (gzipped + minified) 19.41 KB (-0.01% 🔽)
@sentry/browser - ES5 CDN Bundle (minified) 60.09 KB (0%)
@sentry/browser - ES6 CDN Bundle (gzipped + minified) 18.03 KB (-0.08% 🔽)
@sentry/browser - ES6 CDN Bundle (minified) 53.44 KB (+0.88% 🔺)
@sentry/browser - Webpack (gzipped + minified) 19.79 KB (+0.16% 🔺)
@sentry/browser - Webpack (minified) 64.93 KB (+1.01% 🔺)
@sentry/react - Webpack (gzipped + minified) 19.81 KB (+0.14% 🔺)
@sentry/nextjs Client - Webpack (gzipped + minified) 45.53 KB (+0.01% 🔺)
@sentry/browser + @sentry/tracing - ES5 CDN Bundle (gzipped + minified) 25.86 KB (-0.01% 🔽)
@sentry/browser + @sentry/tracing - ES6 CDN Bundle (gzipped + minified) 24.29 KB (+0.01% 🔺)

@lforst lforst marked this pull request as ready for review October 17, 2022 14:46
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.

I was initially more in favour of changing const->var to const->let which would have solved at least the two Vue-related issues we've talked about. However, seeing that there are a lot of advantages in removing this plugin entirely, I think we can live with the (as you said negligible) bundle size impact.
Also, great that this simplifies our testing setup!

@lforst lforst merged commit 3a12ba5 into master Oct 18, 2022
@lforst lforst deleted the lforst-remove-const-to-var-plugin branch October 18, 2022 10:46
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.

Dangerous const to var rollup plugin
3 participants