-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Refactor module scope vars & export mirror
& takeFullSnapshot
directly
#113
Conversation
let canvasManager!: CanvasManager; | ||
let recording = false; | ||
|
||
const mirror = createMirror(); | ||
export const mirror = createMirror(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤔
so rrweb1 did have mirror
exported directly, but they deprecated that -- I'm not sure the reasoning (it's possible they wanted to keep compatibility and decided to have a different interface to mirror
, but maybe worthwhile to dig in and see why they changed public interface to mirror.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah so that mirror was different - it was a shared mirror for recording/replaying, I believe (also that mirror was a noop by now).
This is different in that we just always export the recording mirror from @sentry/rrweb
.
a5bcc01
to
677e95d
Compare
takeFullSnapshot
and mirror
from record
mirror
& takeFullSnapshot
directly
I've updated this to actually remove as much module scope vars as possible, removing things we put on |
33f7886
to
20d18b7
Compare
20d18b7
to
39ceb88
Compare
size-limit report 📦
|
39ceb88
to
c22a3e8
Compare
- feat: Export getCanvasManager & allow passing it to record() [#122](getsentry/rrweb#122) - feat: Remove hooks related code, which is not used [#126](getsentry/rrweb#126) - feat: Remove plugins related code, which is not used [#123](getsentry/rrweb#123) - feat: Refactor module scope vars & export mirror & `takeFullSnapshot` directly [#113](getsentry/rrweb#113) - fix(rrweb): Fix rule.style being undefined [#121](getsentry/rrweb#121) - ref: Avoid unnecessary cloning of objects or arrays [#125](getsentry/rrweb#125) - ref: Avoid cloning events to add timestamp [#124](getsentry/rrweb#124)
- feat: Export getCanvasManager & allow passing it to record() [#122](getsentry/rrweb#122) - feat: Remove hooks related code, which is not used [#126](getsentry/rrweb#126) - feat: Remove plugins related code, which is not used [#123](getsentry/rrweb#123) - feat: Refactor module scope vars & export mirror & `takeFullSnapshot` directly [#113](getsentry/rrweb#113) - fix(rrweb): Fix rule.style being undefined [#121](getsentry/rrweb#121) - ref: Avoid unnecessary cloning of objects or arrays [#125](getsentry/rrweb#125) - ref: Avoid cloning events to add timestamp [#124](getsentry/rrweb#124)
- feat: Export getCanvasManager & allow passing it to record() [#122](getsentry/rrweb#122) - feat: Remove hooks related code, which is not used [#126](getsentry/rrweb#126) - feat: Remove plugins related code, which is not used [#123](getsentry/rrweb#123) - feat: Refactor module scope vars & export mirror & `takeFullSnapshot` directly [#113](getsentry/rrweb#113) - fix(rrweb): Fix rule.style being undefined [#121](getsentry/rrweb#121) - ref: Avoid unnecessary cloning of objects or arrays [#125](getsentry/rrweb#125) - ref: Avoid cloning events to add timestamp [#124](getsentry/rrweb#124)
- feat: Export getCanvasManager & allow passing it to record() [#122](getsentry/rrweb#122) - feat: Remove hooks related code, which is not used [#126](getsentry/rrweb#126) - feat: Remove plugins related code, which is not used [#123](getsentry/rrweb#123) - feat: Refactor module scope vars & export mirror & `takeFullSnapshot` directly [#113](getsentry/rrweb#113) - fix(rrweb): Fix rule.style being undefined [#121](getsentry/rrweb#121) - ref: Avoid unnecessary cloning of objects or arrays [#125](getsentry/rrweb#125) - ref: Avoid cloning events to add timestamp [#124](getsentry/rrweb#124) Note: With this update, canvas is _always_ excluded, unless we opt in by passing a `getCanvasManager` function to `record()`. We'll provide a way to do this once we have a fully formed canvas story. For now, this will reduce bundle size considerably for all SDK users.
…t` directly (#113) 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).
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).