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

chore(build): Update and hoist rollup-plugin-terser #4539

Merged
merged 3 commits into from
Feb 10, 2022

Conversation

lobsterkatie
Copy link
Member

@lobsterkatie lobsterkatie commented Feb 10, 2022

In preparation for the new bundling process, this updates rollup-plugin-terser to latest and hoists it into the main package.json.

To see what effects this has on the resulting minified bundles (because this is terser we're talking about, there's no effect on non-minified bundles), it's easiest to think of the upgrade in stages.

First bump: 4.x -> 5.x.

Effect 1: License text in minified bundles:

image

This can be mitigated by enforcing the removal of comments (in the terser settings):

image

image

Effect 2: Extra parentheses. This is easiest to see in a file where each character has been put on its own line.

image

Second bump: 5.x -> 6.x

This results in no bundle changes

Third bump: 6.x -> 7.x

(Note: screenshots are all from bundle.min.js from @sentry/browser after it's been run through auto-formatting to make it easier for git to figure out what the actual differences are.)

Effect 1: return (x = someFunc)(args) -> return( (x = someFunc), x(args) )

image

Effect 2: Assigning repeated values to a variable

image

Effect 3: Lots of renaming of single-letter variables

image

Because these are all essentially cosmetic changes, this should be a safe upgrade.

@lobsterkatie lobsterkatie changed the title chore(build): Update and hoise rollup-plugin-terser chore(build): Update and hoist rollup-plugin-terser Feb 10, 2022
@github-actions
Copy link
Contributor

size-limit report

Path Base Size (ebba343) Current Size Change
@sentry/browser - ES5 CDN Bundle (gzipped + minified) 19.78 KB 19.79 KB +0.08% 🔺
@sentry/browser - ES5 CDN Bundle (minified) 63.2 KB 63.24 KB +0.07% 🔺
@sentry/browser - ES6 CDN Bundle (gzipped + minified) 18.52 KB 18.55 KB +0.15% 🔺
@sentry/browser - ES6 CDN Bundle (minified) 56.82 KB 56.83 KB +0.02% 🔺
@sentry/browser - Webpack (gzipped + minified) 22.22 KB 22.22 KB 0%
@sentry/browser - Webpack (minified) 76.05 KB 76.05 KB 0%
@sentry/react - Webpack (gzipped + minified) 22.25 KB 22.25 KB 0%
@sentry/nextjs Client - Webpack (gzipped + minified) 46.33 KB 46.33 KB 0%
@sentry/browser + @sentry/tracing - ES5 CDN Bundle (gzipped + minified) 28.33 KB 28.35 KB +0.08% 🔺

@lobsterkatie lobsterkatie merged commit e00b419 into master Feb 10, 2022
@lobsterkatie lobsterkatie deleted the kmclb-update-rollup-plugin-terser branch February 10, 2022 14:23
@AbhiPrasad AbhiPrasad added this to the Pre 7.0.0 Work milestone Feb 23, 2022
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.

None yet

2 participants