getsentry / rrweb

record and replay the web
https://www.rrweb.io/
Other
12 stars 5 forks source link

feat: Refactor module scope vars & export `mirror` & `takeFullSnapshot` directly #113

Closed mydea closed 11 months ago

mydea commented 11 months ago

Currently, we use these from record.xx, which is not ideal thinking about treeshaking and lazy loading.

This moves these to be proper exports so we can use the in Replay without having to import record and everything that comes with it (=everything).

mydea commented 11 months ago

I've updated this to actually remove as much module scope vars as possible, removing things we put on record.xxx that we don't actually need (this cannot be tree shaken), and streamlining this as much as possible. This should safe us a few bytes...!

github-actions[bot] commented 11 months ago

size-limit report 📦

Path Size
rrweb - record only (gzipped) 23 KB (-0.22% 🔽)
rrweb - record only (min) 80.57 KB (-0.26% 🔽)
rrweb - record with treeshaking flags (gzipped) 15.8 KB (-0.29% 🔽)