feat(replay): Improve types for replay recording events by billyvg · Pull Request #8224 · getsentry/sentry-javascript · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions packages/replay/src/coreHandlers/handleScope.ts
8 changes: 8 additions & 0 deletions packages/replay/src/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
export { Replay } from './integration';
export type {
BreadcrumbFrame,
BreadcrumbFrameEvent,
ReplayFrame,
ReplayFrameEvent,
SpanFrame,
SpanFrameEvent,
} from './types/replayFrame';
9 changes: 5 additions & 4 deletions packages/replay/src/replay.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable max-lines */ // TODO: We might want to split this file up
import { EventType, record } from '@sentry-internal/rrweb';
import { captureException, getCurrentHub } from '@sentry/core';
import type { Breadcrumb, ReplayRecordingMode, Transaction } from '@sentry/types';
import type { ReplayRecordingMode, Transaction } from '@sentry/types';
import { logger } from '@sentry/utils';

import {
Expand All @@ -21,6 +21,7 @@ import type {
AddEventResult,
AddUpdateCallback,
AllPerformanceEntry,
BreadcrumbFrame,
EventBuffer,
InternalEventContext,
PopEventContext,
Expand Down Expand Up @@ -808,7 +809,7 @@ export class ReplayContainer implements ReplayContainerInterface {
/**
* Tasks to run when we consider a page to be hidden (via blurring and/or visibility)
*/
private _doChangeToBackgroundTasks(breadcrumb?: Breadcrumb): void {
private _doChangeToBackgroundTasks(breadcrumb?: BreadcrumbFrame): void {
if (!this.session) {
return;
}
Expand All @@ -828,7 +829,7 @@ export class ReplayContainer implements ReplayContainerInterface {
/**
* Tasks to run when we consider a page to be visible (via focus and/or visibility)
*/
private _doChangeToForegroundTasks(breadcrumb?: Breadcrumb): void {
private _doChangeToForegroundTasks(breadcrumb?: BreadcrumbFrame): void {
if (!this.session) {
return;
}
Expand Down Expand Up @@ -881,7 +882,7 @@ export class ReplayContainer implements ReplayContainerInterface {
/**
* Helper to create (and buffer) a replay breadcrumb from a core SDK breadcrumb
*/
private _createCustomBreadcrumb(breadcrumb: Breadcrumb): void {
private _createCustomBreadcrumb(breadcrumb: BreadcrumbFrame): void {
this.addUpdate(() => {
void this.throttledAddEvent({
type: EventType.Custom,
Expand Down
4 changes: 4 additions & 0 deletions packages/replay/src/types/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export * from './performance';
export * from './replay';
export * from './replayFrame';
export * from './rrweb';
160 changes: 160 additions & 0 deletions packages/replay/src/types/performance.ts
Loading