Skip to content

Commit

Permalink
add replaycanvas to replay bundles
Browse files Browse the repository at this point in the history
  • Loading branch information
billyvg committed Jan 11, 2024
1 parent f9d9dc3 commit ab2d746
Show file tree
Hide file tree
Showing 13 changed files with 39 additions and 12 deletions.
4 changes: 2 additions & 2 deletions packages/browser/src/index.bundle.feedback.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This is exported so the loader does not fail when switching off Replay/Tracing
import { Feedback } from '@sentry-internal/feedback';
import { BrowserTracing, Replay, addTracingExtensions } from '@sentry-internal/integration-shims';
import { BrowserTracing, Replay, ReplayCanvas, addTracingExtensions } from '@sentry-internal/integration-shims';

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

Expand All @@ -10,5 +10,5 @@ Sentry.Integrations.Replay = Replay;
Sentry.Integrations.BrowserTracing = BrowserTracing;

export * from './index.bundle.base';
export { BrowserTracing, addTracingExtensions, Replay, Feedback };
export { BrowserTracing, addTracingExtensions, Replay, ReplayCanvas, Feedback };
// Note: We do not export a shim for `Span` here, as that is quite complex and would blow up the bundle
3 changes: 2 additions & 1 deletion packages/browser/src/index.bundle.replay.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// This is exported so the loader does not fail when switching off Replay/Tracing
import { BrowserTracing, Feedback, addTracingExtensions } from '@sentry-internal/integration-shims';
import { ReplayCanvas } from '@sentry-internal/replay-canvas';
import { Replay } from '@sentry/replay';

import * as Sentry from './index.bundle.base';
Expand All @@ -10,5 +11,5 @@ Sentry.Integrations.Replay = Replay;
Sentry.Integrations.BrowserTracing = BrowserTracing;

export * from './index.bundle.base';
export { BrowserTracing, addTracingExtensions, Replay, Feedback };
export { BrowserTracing, addTracingExtensions, Replay, ReplayCanvas, Feedback };
// Note: We do not export a shim for `Span` here, as that is quite complex and would blow up the bundle
3 changes: 2 additions & 1 deletion packages/browser/src/index.bundle.tracing.replay.feedback.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Feedback } from '@sentry-internal/feedback';
import { ReplayCanvas } from '@sentry-internal/replay-canvas';
import { BrowserTracing, Span, addExtensionMethods } from '@sentry-internal/tracing';
import { Replay } from '@sentry/replay';

Expand All @@ -14,5 +15,5 @@ Sentry.Integrations.BrowserTracing = BrowserTracing;
// We are patching the global object with our hub extension methods
addExtensionMethods();

export { Feedback, Replay, BrowserTracing, Span, addExtensionMethods };
export { Feedback, Replay, ReplayCanvas, BrowserTracing, Span, addExtensionMethods };
export * from './index.bundle.base';
3 changes: 2 additions & 1 deletion packages/browser/src/index.bundle.tracing.replay.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Feedback } from '@sentry-internal/integration-shims';
import { ReplayCanvas } from '@sentry-internal/replay-canvas';
import { BrowserTracing, Span, addExtensionMethods } from '@sentry-internal/tracing';
import { Replay } from '@sentry/replay';

Expand All @@ -14,5 +15,5 @@ Sentry.Integrations.BrowserTracing = BrowserTracing;
// We are patching the global object with our hub extension methods
addExtensionMethods();

export { Feedback, Replay, BrowserTracing, Span, addExtensionMethods };
export { Feedback, Replay, ReplayCanvas, BrowserTracing, Span, addExtensionMethods };
export * from './index.bundle.base';
4 changes: 2 additions & 2 deletions packages/browser/src/index.bundle.tracing.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// This is exported so the loader does not fail when switching off Replay
import { Feedback, Replay } from '@sentry-internal/integration-shims';
import { Feedback, Replay, ReplayCanvas } from '@sentry-internal/integration-shims';
import { BrowserTracing, Span, addExtensionMethods } from '@sentry-internal/tracing';

import * as Sentry from './index.bundle.base';
Expand All @@ -14,5 +14,5 @@ Sentry.Integrations.BrowserTracing = BrowserTracing;
// We are patching the global object with our hub extension methods
addExtensionMethods();

export { Feedback, Replay, BrowserTracing, Span, addExtensionMethods };
export { Feedback, Replay, ReplayCanvas, BrowserTracing, Span, addExtensionMethods };
export * from './index.bundle.base';
10 changes: 8 additions & 2 deletions packages/browser/src/index.bundle.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
// This is exported so the loader does not fail when switching off Replay/Tracing
import { BrowserTracing, Feedback, Replay, addTracingExtensions } from '@sentry-internal/integration-shims';
import {
BrowserTracing,
Feedback,
Replay,
ReplayCanvas,
addTracingExtensions,
} from '@sentry-internal/integration-shims';

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

Expand All @@ -9,5 +15,5 @@ Sentry.Integrations.Replay = Replay;
Sentry.Integrations.BrowserTracing = BrowserTracing;

export * from './index.bundle.base';
export { BrowserTracing, addTracingExtensions, Replay, Feedback };
export { BrowserTracing, addTracingExtensions, Replay, ReplayCanvas, Feedback };
// Note: We do not export a shim for `Span` here, as that is quite complex and would blow up the bundle
7 changes: 6 additions & 1 deletion packages/browser/test/unit/index.bundle.feedback.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import { BrowserTracing as BrowserTracingShim, Replay as ReplayShim } from '@sentry-internal/integration-shims';
import {
BrowserTracing as BrowserTracingShim,
Replay as ReplayShim,
ReplayCanvas as ReplayCanvasShim,
} from '@sentry-internal/integration-shims';
import { Feedback } from '@sentry/browser';

import * as TracingReplayBundle from '../../src/index.bundle.feedback';
Expand All @@ -16,6 +20,7 @@ describe('index.bundle.feedback', () => {

expect(TracingReplayBundle.Integrations.Replay).toBe(ReplayShim);
expect(TracingReplayBundle.Replay).toBe(ReplayShim);
expect(TracingReplayBundle.ReplayCanvas).toBe(ReplayCanvasShim);

expect(TracingReplayBundle.Integrations.BrowserTracing).toBe(BrowserTracingShim);
expect(TracingReplayBundle.BrowserTracing).toBe(BrowserTracingShim);
Expand Down
2 changes: 2 additions & 0 deletions packages/browser/test/unit/index.bundle.replay.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { BrowserTracing as BrowserTracingShim, Feedback as FeedbackShim } from '@sentry-internal/integration-shims';
import { Replay } from '@sentry/browser';
import { ReplayCanvas } from '@sentry/browser';

import * as TracingReplayBundle from '../../src/index.bundle.replay';

Expand All @@ -16,6 +17,7 @@ describe('index.bundle.replay', () => {

expect(TracingReplayBundle.Integrations.Replay).toBe(Replay);
expect(TracingReplayBundle.Replay).toBe(Replay);
expect(TracingReplayBundle.ReplayCanvas).toBe(ReplayCanvas);

expect(TracingReplayBundle.Integrations.BrowserTracing).toBe(BrowserTracingShim);
expect(TracingReplayBundle.BrowserTracing).toBe(BrowserTracingShim);
Expand Down
2 changes: 2 additions & 0 deletions packages/browser/test/unit/index.bundle.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {
BrowserTracing as BrowserTracingShim,
Feedback as FeedbackShim,
Replay as ReplayShim,
ReplayCanvas as ReplayCanvasShim,
} from '@sentry-internal/integration-shims';

import * as TracingBundle from '../../src/index.bundle';
Expand All @@ -19,6 +20,7 @@ describe('index.bundle', () => {

expect(TracingBundle.Integrations.Replay).toBe(ReplayShim);
expect(TracingBundle.Replay).toBe(ReplayShim);
expect(TracingBundle.ReplayCanvas).toBe(ReplayCanvasShim);

expect(TracingBundle.Integrations.BrowserTracing).toBe(BrowserTracingShim);
expect(TracingBundle.BrowserTracing).toBe(BrowserTracingShim);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { BrowserTracing } from '@sentry-internal/tracing';
import { Feedback, Replay } from '@sentry/browser';
import { Feedback, Replay, ReplayCanvas } from '@sentry/browser';

import * as TracingReplayFeedbackBundle from '../../src/index.bundle.tracing.replay.feedback';

Expand All @@ -16,6 +16,7 @@ describe('index.bundle.tracing.replay.feedback', () => {

expect(TracingReplayFeedbackBundle.Integrations.Replay).toBe(Replay);
expect(TracingReplayFeedbackBundle.Replay).toBe(Replay);
expect(TracingReplayFeedbackBundle.ReplayCanvas).toBe(ReplayCanvas);

expect(TracingReplayFeedbackBundle.Integrations.BrowserTracing).toBe(BrowserTracing);
expect(TracingReplayFeedbackBundle.BrowserTracing).toBe(BrowserTracing);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Feedback as FeedbackShim } from '@sentry-internal/integration-shims';
import { BrowserTracing } from '@sentry-internal/tracing';
import { Replay } from '@sentry/browser';
import { ReplayCanvas } from '@sentry/browser';

import * as TracingReplayBundle from '../../src/index.bundle.tracing.replay';

Expand All @@ -17,6 +18,7 @@ describe('index.bundle.tracing.replay', () => {

expect(TracingReplayBundle.Integrations.Replay).toBe(Replay);
expect(TracingReplayBundle.Replay).toBe(Replay);
expect(TracingReplayBundle.ReplayCanvas).toBe(ReplayCanvas);

expect(TracingReplayBundle.Integrations.BrowserTracing).toBe(BrowserTracing);
expect(TracingReplayBundle.BrowserTracing).toBe(BrowserTracing);
Expand Down
7 changes: 6 additions & 1 deletion packages/browser/test/unit/index.bundle.tracing.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import { Feedback as FeedbackShim, Replay as ReplayShim } from '@sentry-internal/integration-shims';
import {
Feedback as FeedbackShim,
Replay as ReplayShim,
ReplayCanvas as ReplayCanvasShim,
} from '@sentry-internal/integration-shims';
import { BrowserTracing } from '@sentry-internal/tracing';

import * as TracingBundle from '../../src/index.bundle.tracing';
Expand All @@ -16,6 +20,7 @@ describe('index.bundle.tracing', () => {

expect(TracingBundle.Integrations.Replay).toBe(ReplayShim);
expect(TracingBundle.Replay).toBe(ReplayShim);
expect(TracingBundle.ReplayCanvas).toBe(ReplayCanvasShim);

expect(TracingBundle.Integrations.BrowserTracing).toBe(BrowserTracing);
expect(TracingBundle.BrowserTracing).toBe(BrowserTracing);
Expand Down
1 change: 1 addition & 0 deletions packages/integration-shims/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export { Feedback } from './Feedback';
export { Replay } from './Replay';
export { ReplayCanvas } from './ReplayCanvas';
export { BrowserTracing, addTracingExtensions } from './BrowserTracing';

0 comments on commit ab2d746

Please sign in to comment.