Closed mydea closed 7 months ago
Path | Size |
---|---|
rrweb - record only (gzipped) | 16.57 KB (0%) |
rrweb - record & getCanvasManager only (gzipped) | 19.11 KB (-9.49% 🔽) |
rrweb - record only (min) | 56.53 KB (0%) |
rrweb - record with treeshaking flags (gzipped) | 15.35 KB (0%) |
Tracking this upstream as well: https://github.com/rrweb-io/rrweb/issues/1376
While trying to get the ReplayCanvas integration to properly tree shake, I noticed that the current way this worker is built is not ideal, and maybe is not treeshakeable properly. We use a rollup plugin to convert the worker to a base64 string, which a) is more verbose than just having the worker be a plain string, and b) possibly is not tree shakeable.
This refactors the worker to work the same way as the compression worker in Sentry - we build it to a string and use that in rrweb. This is a bit more complicated, from a setup perspective, but gives us full control over the worker build.