Skip to content

Commit d36de87

Browse files
authored
build(core): Do not mangle private methods used by Replay (#6493)
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 patch 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.
1 parent 13778da commit d36de87

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

rollup/plugins/bundlePlugins.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,9 @@ export function makeTerserPlugin() {
104104
'_driver',
105105
'_initStorage',
106106
'_support',
107+
// TODO: Get rid of these once we use the SDK to send replay events
108+
'_prepareEvent', // replay uses client._prepareEvent
109+
'_updateSessionFromEvent', // replay client._updateSessionFromEvent
107110
],
108111
},
109112
},

0 commit comments

Comments
 (0)