From 2fe3ca7e83919d9ba744ab9908c23b24308a5fc6 Mon Sep 17 00:00:00 2001 From: Francesco Novy Date: Mon, 30 Oct 2023 15:56:25 +0100 Subject: [PATCH] ref: Docs & mergability improvements (#128) 1. Add notes on major changes in this fork 2. Refactor a previous change a bit in order to keep line breaks etc. better aligned with upstream, in order to prevent future merge conflicts --- README.md | 8 ++++++++ packages/rrweb/src/record/observer.ts | 6 +++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d8af742090..68c3cc9acf 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,14 @@ From this monorepo, Sentry maintains and publishes the following NPM packages: - `@sentry-internal/rrweb-player` (corresponds to the [original `rrweb-player` package](https://www.npmjs.com/package/rrweb-player)) - `@sentry-internal/rrweb-snapshot` (corresponds to the [original `rrweb-snapshot` package](https://www.npmjs.com/package/rrweb-snapshot)) +## Major changes from upstream branch + +Apart from some small fixes/changes in this fork, these are the main relevant changes compared to the upstream rrweb repository: + +- Removed `hooks` related code, so passing `hooks: myHooks` to `record()` will have no effect +- Removed `plugins` related code, so passing `plugins: myPlugins` to `record()` will have no effect +- Added build flags to allow to disable iframe, canvas & shadow dom recording (in order to get bundle size optimizations) + # rrweb

diff --git a/packages/rrweb/src/record/observer.ts b/packages/rrweb/src/record/observer.ts index c3f36a1b1c..8e0b3e6cb5 100644 --- a/packages/rrweb/src/record/observer.ts +++ b/packages/rrweb/src/record/observer.ts @@ -35,6 +35,7 @@ import { fontParam, IWindow, SelectionRange, + hooksParam, } from '@sentry-internal/rrweb-types'; import MutationBuffer from './mutation'; import { callbackWrapper } from './error-handler'; @@ -1274,7 +1275,10 @@ function initCustomElementObserver({ return restoreHandler; } -export function initObservers(o: observerParam): listenerHandler { +export function initObservers( + o: observerParam, + _hooks: hooksParam = {}, +): listenerHandler { const currentWindow = o.doc.defaultView; // basically document.window if (!currentWindow) { return () => {