build(core): Do not mangle private methods used by Replay #6493
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.
In Replay, we access some private methods from the core SDK package from the
Client
class. Because we mangle private fields by default, our SDK CDN bundles wouldn't expose these methods and fields anymore in their clear name to external callers, such as our Replay CDN bundle, producing runtime errors because the methods were not found.This PR fixes these errors by explicitly excluding the called private methods from mangling so that they can be accessed externally. This is admittedly not a clean solution but it unblocks minified CDN bundle users. In the long run we can revert this PR once we streamlined Replay event sending into the SDK (#6480) (as well as breadcrumbs via hooks?).
Note: This unfortunately increases bundle size, not just for the Replay CDN bundle, but also for the Browser SDK CDN bundle.
fixes #6466