Skip to content

Commit

Permalink
use internal imports
Browse files Browse the repository at this point in the history
  • Loading branch information
s1gr1d committed Mar 22, 2024
1 parent 2745add commit d993582
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 22 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect } from '@playwright/test';
import type { Replay } from '@sentry/replay';
import type { InternalReplay } from '@sentry/replay';
import type { ReplayContainer } from '@sentry/replay/build/npm/types/types';

import { sentryTest } from '../../../utils/fixtures';
Expand Down Expand Up @@ -68,7 +68,8 @@ sentryTest(
expect(
await page.evaluate(() => {
// eslint-disable-next-line deprecation/deprecation
const replayIntegration = (window as unknown as Window & { Replay: InstanceType<typeof Replay> }).Replay;
const replayIntegration = (window as unknown as Window & { Replay: InstanceType<typeof InternalReplay> })
.Replay;
// @ts-expect-error private
const replay = replayIntegration._replay;
replayIntegration.startBuffering();
Expand All @@ -89,7 +90,7 @@ sentryTest(
reqPromise0,
page.evaluate(async () => {
// eslint-disable-next-line deprecation/deprecation
const replayIntegration = (window as unknown as Window & { Replay: Replay }).Replay;
const replayIntegration = (window as unknown as Window & { Replay: InternalReplay }).Replay;
await replayIntegration.flush();
}),
]);
Expand Down Expand Up @@ -213,7 +214,8 @@ sentryTest(
expect(
await page.evaluate(() => {
// eslint-disable-next-line deprecation/deprecation
const replayIntegration = (window as unknown as Window & { Replay: InstanceType<typeof Replay> }).Replay;
const replayIntegration = (window as unknown as Window & { Replay: InstanceType<typeof InternalReplay> })
.Replay;
// @ts-expect-error private
const replay = replayIntegration._replay;
replayIntegration.startBuffering();
Expand All @@ -234,7 +236,7 @@ sentryTest(
reqPromise0,
page.evaluate(async () => {
// eslint-disable-next-line deprecation/deprecation
const replayIntegration = (window as unknown as Window & { Replay: Replay }).Replay;
const replayIntegration = (window as unknown as Window & { Replay: InternalReplay }).Replay;
await replayIntegration.flush({ continueRecording: false });
}),
]);
Expand Down Expand Up @@ -329,7 +331,8 @@ sentryTest(
expect(
await page.evaluate(() => {
// eslint-disable-next-line deprecation/deprecation
const replayIntegration = (window as unknown as Window & { Replay: InstanceType<typeof Replay> }).Replay;
const replayIntegration = (window as unknown as Window & { Replay: InstanceType<typeof InternalReplay> })
.Replay;
const replay = replayIntegration['_replay'];
replayIntegration.startBuffering();
return replay.isEnabled();
Expand All @@ -348,7 +351,7 @@ sentryTest(

await page.evaluate(async () => {
// eslint-disable-next-line deprecation/deprecation
const replayIntegration = (window as unknown as Window & { Replay: Replay }).Replay;
const replayIntegration = (window as unknown as Window & { Replay: InternalReplay }).Replay;
replayIntegration['_replay'].getOptions().errorSampleRate = 1.0;
});

Expand Down
8 changes: 4 additions & 4 deletions packages/browser/src/index.bundle.replay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ import {
browserTracingIntegration,
feedbackIntegration,
} from '@sentry-internal/integration-shims';
import { Replay, replayIntegration } from '@sentry/replay';
import { InternalReplay, internalReplayIntegration } from '@sentry/replay';

import * as Sentry from './index.bundle.base';

// TODO (v8): Remove this as it was only needed for backwards compatibility
// eslint-disable-next-line deprecation/deprecation
Sentry.Integrations.Replay = Replay;
Sentry.Integrations.Replay = InternalReplay;

// eslint-disable-next-line deprecation/deprecation
Sentry.Integrations.BrowserTracing = BrowserTracing;
Expand All @@ -24,8 +24,8 @@ export {
browserTracingIntegration,
addTracingExtensions,
// eslint-disable-next-line deprecation/deprecation
Replay,
replayIntegration,
InternalReplay as Replay,
internalReplayIntegration as replayIntegration,
// eslint-disable-next-line deprecation/deprecation
Feedback,
feedbackIntegration,
Expand Down
8 changes: 4 additions & 4 deletions packages/browser/src/index.bundle.tracing.replay.feedback.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Feedback, feedbackIntegration } from '@sentry-internal/feedback';
import { BrowserTracing, Span, addExtensionMethods } from '@sentry-internal/tracing';
import { Replay, replayIntegration } from '@sentry/replay';
import { InternalReplay, internalReplayIntegration } from '@sentry/replay';
import { bundleBrowserTracingIntegration as browserTracingIntegration } from './helpers';

import * as Sentry from './index.bundle.base';
Expand All @@ -9,7 +9,7 @@ import * as Sentry from './index.bundle.base';
// We want replay to be available under Sentry.Replay, to be consistent
// with the NPM package version.
// eslint-disable-next-line deprecation/deprecation
Sentry.Integrations.Replay = Replay;
Sentry.Integrations.Replay = InternalReplay;

// eslint-disable-next-line deprecation/deprecation
Sentry.Integrations.BrowserTracing = BrowserTracing;
Expand All @@ -21,9 +21,9 @@ export {
// eslint-disable-next-line deprecation/deprecation
Feedback,
// eslint-disable-next-line deprecation/deprecation
Replay,
InternalReplay as Replay,
feedbackIntegration,
replayIntegration,
internalReplayIntegration as replayIntegration,
// eslint-disable-next-line deprecation/deprecation
BrowserTracing,
browserTracingIntegration,
Expand Down
8 changes: 4 additions & 4 deletions packages/browser/src/index.bundle.tracing.replay.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Feedback, feedbackIntegration } from '@sentry-internal/integration-shims';
import { BrowserTracing, Span, addExtensionMethods } from '@sentry-internal/tracing';
import { Replay, replayIntegration } from '@sentry/replay';
import { InternalReplay, internalReplayIntegration } from '@sentry/replay';
import { bundleBrowserTracingIntegration as browserTracingIntegration } from './helpers';

import * as Sentry from './index.bundle.base';
Expand All @@ -9,7 +9,7 @@ import * as Sentry from './index.bundle.base';
// We want replay to be available under Sentry.Replay, to be consistent
// with the NPM package version.
// eslint-disable-next-line deprecation/deprecation
Sentry.Integrations.Replay = Replay;
Sentry.Integrations.Replay = InternalReplay;

// eslint-disable-next-line deprecation/deprecation
Sentry.Integrations.BrowserTracing = BrowserTracing;
Expand All @@ -21,8 +21,8 @@ export {
// eslint-disable-next-line deprecation/deprecation
Feedback,
// eslint-disable-next-line deprecation/deprecation
Replay,
replayIntegration,
InternalReplay as Replay,
internalReplayIntegration as replayIntegration,
feedbackIntegration,
// eslint-disable-next-line deprecation/deprecation
BrowserTracing,
Expand Down
6 changes: 3 additions & 3 deletions packages/replay-canvas/src/canvas.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { CanvasManager } from '@sentry-internal/rrweb';
import { convertIntegrationFnToClass, defineIntegration } from '@sentry/core';
import type { CanvasManagerInterface, CanvasManagerOptions } from '@sentry/replay';
import type { InternalCanvasManagerInterface, InternalCanvasManagerOptions } from '@sentry/replay';
import type { Integration, IntegrationClass, IntegrationFn } from '@sentry/types';

interface ReplayCanvasOptions {
enableManualSnapshot?: boolean;
quality: 'low' | 'medium' | 'high';
}

type GetCanvasManager = (options: CanvasManagerOptions) => CanvasManagerInterface;
type GetCanvasManager = (options: InternalCanvasManagerOptions) => InternalCanvasManagerInterface;
export interface ReplayCanvasIntegrationOptions {
enableManualSnapshot?: boolean;
recordCanvas: true;
Expand Down Expand Up @@ -74,7 +74,7 @@ export const _replayCanvasIntegration = ((options: Partial<ReplayCanvasOptions>
return {
enableManualSnapshot,
recordCanvas: true,
getCanvasManager: (options: CanvasManagerOptions) => {
getCanvasManager: (options: InternalCanvasManagerOptions) => {
const manager = new CanvasManager({
...options,
enableManualSnapshot,
Expand Down

0 comments on commit d993582

Please sign in to comment.