build(core): Do not mangle private methods used by Replay#6493
Merged
Conversation
5 tasks
Member
|
Very nice! I made a PR refactoring |
mydea
reviewed
Dec 12, 2022
mydea
approved these changes
Dec 12, 2022
Contributor
size-limit report 📦
|
mydea
reviewed
Dec 12, 2022
Co-authored-by: Francesco Novy <francesco.novy@sentry.io>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Clientclass. 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