You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: Add build flags to allow noop iframe/canvas/shadow dom managers (#114)
This PR adds 3 new build flags to rrweb:
* `__RRWEB_EXCLUDE_CANVAS__`
* `__RRWEB_EXCLUDE_SHADOW_DOM__`
* `__RRWEB_EXCLUDE_IFRAME__`
If you set these to `true` at build time, it will replace the regular
`ShadowDomManager` / `CanvasManager` / `IframeManager` with a noop
variant of these managers.
All of these together shave off about 8 KB gzipped from our replay
bundles, if set to `true`.
For now, we'll probably keep this enabled by default, but at least we
have a path for users to shake this out if they don't need these
features.
Note: I played with some other approaches, e.g. instead of having the
noop class make these e.g. `iframeManager: IframeManager | undefined`,
but I think overall the code to guard against using this everywhere ends
up being a similar amount of bytes, plus we need to spread this much
more through the codebase, making rebasing on upstream master etc.
potentially harder. This way, IMHO it should be the easiest way to keep
this as contained as possible.
0 commit comments