Closed mydea closed 8 months ago
Can we make this default? (e.g. get rid of build flag?)
Yeah, I guess that makes sense here! 👍
Path | Size |
---|---|
rrweb - record only (gzipped) | 16.6 KB (-26.27% 🔽) |
rrweb - record only (min) | 57.17 KB (-27.45% 🔽) |
rrweb - record with treeshaking flags (gzipped) | 15.35 KB (+0.22% 🔺) |
rrweb - record & getCanvasManager only (gzipped) | 22.54 KB (added) |
OK, I fixed the tests, seems good now. I ended up changing it so that you have to pass in a getCanvasManager
method instead of the instance, which is a slightly "worse" API, but easier to implement because we need access to some of the parsed options from record, which we don't easily have otherwise 😬
This PR exports a new
getCanvasManager()
method which can be used to dynamically pass a canvas manager, allowing tree shaking.This also removes the
__RRWEB_EXCLUDE_CANVAS__
build flag - canvas will always be excluded now by default.Expected usage:
The idea is that we can expose this somehow (?) from replay, so users can do e.g.:
Or something like this, allowing people to opt-in to canvas recording at runtime, vs requiring a specific build step for it.