ref(build): Use standard regex for minifying integration bundles #4651
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is very similar to #4592, which brought
@sentry/wasm
in line with other bundles in terms of which object properties it was willing to mangle (changing it from "nope, nuthin'" to "anything private, a.k.a., anything starting with exactly one underscore").That PR was effectively a no-op, in that we made a change to a class of property which it turns out doesn't exist anywhere in the wasm package. In the case of this PR, though, that's not true: private properties do exist, and where they've been heretofore left alone by terser, they will now be mangled. This is a small bundle size win, but it is also technically a breaking change, at least for anyone using those properties directly.
That said, there's a reason we use a leading underscore to mark them as internal and tag them as private in TS - people aren't supposed to be using them. Further, out of the (hopefully very small if not non-existent) group of people mucking with our internals, this will only affect the subset who are both using the CDN and using one of these optional integrations, which the majority of our users do not. I therefore think it's a very small risk with not one but two small rewards, the bundle size reduction and further standardization of our rollup config.