Skip to content

Commit

Permalink
ref: Docs & mergability improvements (#128)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mydea authored and billyvg committed Apr 26, 2024
1 parent 7a31a7e commit 2fe3ca7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

<p align="center">
Expand Down
6 changes: 5 additions & 1 deletion packages/rrweb/src/record/observer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ import {
fontParam,
IWindow,
SelectionRange,
hooksParam,
} from '@sentry-internal/rrweb-types';
import MutationBuffer from './mutation';
import { callbackWrapper } from './error-handler';
Expand Down Expand Up @@ -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 () => {
Expand Down

0 comments on commit 2fe3ca7

Please sign in to comment.