Skip to content

Commit 653d816

Browse files
committed
ref(replay): Extract types into types.ts
To avoid circular dependencies.
1 parent b0cc06b commit 653d816

28 files changed

+94
-81
lines changed

packages/replay/.madgerc

Lines changed: 0 additions & 7 deletions
This file was deleted.

packages/replay/jest.setup.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
import { getCurrentHub } from '@sentry/core';
33
import { Transport } from '@sentry/types';
44

5-
import { ReplayContainer } from './src/replay';
6-
import { Session } from './src/session/Session';
5+
import type { ReplayContainer, Session } from './src/types';
76

87
// @ts-ignore TS error, this is replaced in prod builds bc of rollup
98
global.__SENTRY_REPLAY_VERSION__ = 'version:Test';

packages/replay/src/coreHandlers/breadcrumbHandler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Breadcrumb, Scope } from '@sentry/types';
22

3-
import { InstrumentationTypeBreadcrumb } from '../types';
3+
import type { InstrumentationTypeBreadcrumb } from '../types';
44
import { DomHandlerData, handleDom } from './handleDom';
55
import { handleScope } from './handleScope';
66

packages/replay/src/coreHandlers/handleFetch.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { ReplayPerformanceEntry } from '../createPerformanceEntry';
2-
import type { ReplayContainer } from '../replay';
2+
import type { ReplayContainer } from '../types';
33
import { createPerformanceSpans } from '../util/createPerformanceSpans';
44
import { isIngestHost } from '../util/isIngestHost';
55

packages/replay/src/coreHandlers/handleGlobalEvent.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Event } from '@sentry/types';
22

33
import { REPLAY_EVENT_NAME, UNABLE_TO_SEND_REPLAY } from '../constants';
4-
import type { ReplayContainer } from '../replay';
4+
import type { ReplayContainer } from '../types';
55
import { addInternalBreadcrumb } from '../util/addInternalBreadcrumb';
66

77
/**

packages/replay/src/coreHandlers/handleHistory.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { ReplayPerformanceEntry } from '../createPerformanceEntry';
2-
import type { ReplayContainer } from '../replay';
2+
import type { ReplayContainer } from '../types';
33
import { createPerformanceSpans } from '../util/createPerformanceSpans';
44

55
interface HistoryHandlerData {

packages/replay/src/coreHandlers/handleXhr.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { ReplayPerformanceEntry } from '../createPerformanceEntry';
2-
import type { ReplayContainer } from '../replay';
2+
import type { ReplayContainer } from '../types';
33
import { createPerformanceSpans } from '../util/createPerformanceSpans';
44
import { isIngestHost } from '../util/isIngestHost';
55

packages/replay/src/coreHandlers/performanceObserver.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import type { ReplayContainer } from '../replay';
2-
import { AllPerformanceEntry } from '../types';
1+
import type { AllPerformanceEntry, ReplayContainer } from '../types';
32
import { dedupePerformanceEntries } from '../util/dedupePerformanceEntries';
43

54
/**

packages/replay/src/createPerformanceEntry.ts

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

44
import { WINDOW } from './constants';
5-
import { AllPerformanceEntry, PerformanceNavigationTiming, PerformancePaintTiming } from './types';
5+
import type { AllPerformanceEntry, PerformanceNavigationTiming, PerformancePaintTiming } from './types';
66
import { isIngestHost } from './util/isIngestHost';
77

88
export interface ReplayPerformanceEntry {

packages/replay/src/eventBuffer.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import { captureException } from '@sentry/core';
55
import { logger } from '@sentry/utils';
66

7-
import { RecordingEvent, WorkerRequest, WorkerResponse } from './types';
7+
import type { EventBuffer, RecordingEvent, WorkerRequest, WorkerResponse } from './types';
88
import workerString from './worker/worker.js';
99

1010
interface CreateEventBufferParams {
@@ -35,13 +35,6 @@ export function createEventBuffer({ useCompression }: CreateEventBufferParams):
3535
return new EventBufferArray();
3636
}
3737

38-
export interface EventBuffer {
39-
readonly length: number;
40-
destroy(): void;
41-
addEvent(event: RecordingEvent, isCheckout?: boolean): void;
42-
finish(): Promise<string | Uint8Array>;
43-
}
44-
4538
class EventBufferArray implements EventBuffer {
4639
private _events: RecordingEvent[];
4740

0 commit comments

Comments
 (0)