Home / Companies / Sentry / Blog / Post Details
Content Deep Dive

How We Reduced Replay SDK Bundle Size by 35%

Blog post from Sentry

Post Details
Company
Date Published
Author
Francesco Novy
Word Count
1,657
Company Posts That Month
14
Language
English
Hacker News Points
-
Post removed?
No
Summary

SDK engineers at Sentry face the challenge of balancing functionality with bundle size, particularly with features like Session Replay that significantly increase the JavaScript SDK's size. Session Replay aids in debugging by capturing user browser activity but necessitates a substantial amount of JavaScript, thus inflating bundle size. To address this, Sentry updated the rrweb package to version 2.0, initially increasing the bundle size, which prompted a concentrated effort to reduce it. Through various strategies such as removing unused code, optimizing tree shaking, and switching to a smaller compression library, they successfully reduced the minified and gzipped bundle size by up to 35% with maximum tree shaking. These efforts included making certain features optional at build time and allowing the hosting of compression workers separately, ultimately saving additional space and providing flexibility for users with strict Content Security Policies.

Trends Found in this Post

No tracked trend matches for this post yet.

Use This Data

Use this post, company, and trend context to find content marketing opportunities, perform competitive analysis, or address product feature gaps via the Plushcap MCP server or the Plushcap API.