Skip to content

Commit 67fec37

Browse files
authored
ref(replay): Use Sentry's forked rrweb packages (#6935)
As outlined in getsentry/rrweb#15, we're now releasing packages of our rrrweb fork: * replace the original rrweb dependency with our forked one * remove the patches for the original rrweb dependency which we now don't need anymore * remove the `patch-package` dev dependency, as we're not patching any package anymore In terms of building the rrweb package, nothing changes - we're still inlining the rrweb code.
1 parent 77de64e commit 67fec37

File tree

12 files changed

+29
-10902
lines changed

12 files changed

+29
-10902
lines changed

package.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@
2525
"postpublish": "lerna run --stream --concurrency 1 postpublish",
2626
"test": "lerna run --ignore @sentry-internal/* test",
2727
"test-ci-browser": "lerna run test --ignore \"@sentry/{node,opentelemetry-node,serverless,nextjs,remix,gatsby}\" --ignore @sentry-internal/*",
28-
"test-ci-node": "ts-node ./scripts/node-unit-tests.ts",
29-
"postinstall": "patch-package"
28+
"test-ci-node": "ts-node ./scripts/node-unit-tests.ts"
3029
},
3130
"volta": {
3231
"node": "16.18.1",
@@ -91,7 +90,6 @@
9190
"mocha": "^6.1.4",
9291
"nodemon": "^2.0.16",
9392
"npm-run-all": "^4.1.5",
94-
"patch-package": "^6.5.0",
9593
"prettier": "2.7.1",
9694
"recast": "^0.20.5",
9795
"replace-in-file": "^4.0.0",

packages/replay/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
"@types/pako": "^2.0.0",
5050
"jsdom-worker": "^0.2.1",
5151
"pako": "^2.0.4",
52-
"rrweb": "1.1.3",
52+
"@sentry-internal/rrweb": "1.100.1",
5353
"tslib": "^1.9.3"
5454
},
5555
"dependencies": {

packages/replay/src/coreHandlers/addBreadcrumbEvent.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
import { EventType } from '@sentry-internal/rrweb';
12
import type { Breadcrumb } from '@sentry/types';
2-
import { EventType } from 'rrweb';
33

44
import type { ReplayContainer } from '../types';
55
import { addEvent } from '../util/addEvent';

packages/replay/src/coreHandlers/handleDom.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
import { record } from '@sentry-internal/rrweb';
12
import type { Breadcrumb } from '@sentry/types';
23
import { htmlTreeAsString } from '@sentry/utils';
3-
import { record } from 'rrweb';
44

55
import type { ReplayContainer } from '../types';
66
import { createBreadcrumb } from '../util/createBreadcrumb';

packages/replay/src/replay.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/* eslint-disable max-lines */ // TODO: We might want to split this file up
2+
import { EventType, record } from '@sentry-internal/rrweb';
23
import { captureException } from '@sentry/core';
34
import type { Breadcrumb, ReplayRecordingMode } from '@sentry/types';
45
import type { RateLimits } from '@sentry/utils';
56
import { disabledUntil, logger } from '@sentry/utils';
6-
import { EventType, record } from 'rrweb';
77

88
import { MAX_SESSION_LIFE, SESSION_IDLE_DURATION, VISIBILITY_CHANGE_TIMEOUT, WINDOW } from './constants';
99
import { setupPerformanceObserver } from './coreHandlers/performanceObserver';

packages/replay/src/util/createPerformanceEntries.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
import { record } from '@sentry-internal/rrweb';
12
import { browserPerformanceTimeOrigin } from '@sentry/utils';
2-
import { record } from 'rrweb';
33

44
import { WINDOW } from '../constants';
55
import type {

packages/replay/src/util/createPerformanceSpans.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { EventType } from 'rrweb';
1+
import { EventType } from '@sentry-internal/rrweb';
22

33
import type { AddEventResult, ReplayContainer, ReplayPerformanceEntry } from '../types';
44
import { addEvent } from './addEvent';

packages/replay/test/integration/autoSaveSession.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { EventType } from 'rrweb';
1+
import { EventType } from '@sentry-internal/rrweb';
22

33
import type { RecordingEvent } from '../../src/types';
44
import { addEvent } from '../../src/util/addEvent';

packages/replay/test/mocks/mockRrweb.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { record as rrwebRecord } from 'rrweb';
1+
import type { record as rrwebRecord } from '@sentry-internal/rrweb';
22

33
import type { RecordingEvent } from '../../src/types';
44

@@ -41,8 +41,8 @@ export function mockRrweb(): { record: RecordMock } {
4141
mockRecordFn._emitter(createCheckoutPayload(isCheckout), isCheckout);
4242
});
4343

44-
jest.mock('rrweb', () => {
45-
const ActualRrweb = jest.requireActual('rrweb');
44+
jest.mock('@sentry-internal/rrweb', () => {
45+
const ActualRrweb = jest.requireActual('@sentry-internal/rrweb');
4646

4747
return {
4848
...ActualRrweb,

0 commit comments

Comments
 (0)