Skip to content

Commit

Permalink
forgot shims
Browse files Browse the repository at this point in the history
  • Loading branch information
billyvg committed Jan 11, 2024
1 parent ab2d746 commit 9dd8758
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions packages/integration-shims/src/ReplayCanvas.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import type { Integration } from '@sentry/types';
import { consoleSandbox } from '@sentry/utils';

/**
* This is a shim for the Replay integration.
* It is needed in order for the CDN bundles to continue working when users add/remove replay
* from it, without changing their config. This is necessary for the loader mechanism.
*/
class ReplayCanvasShim implements Integration {
/**
* @inheritDoc
*/
public static id: string = 'ReplayCanvas';

/**
* @inheritDoc
*/
public name: string;

// eslint-disable-next-line @typescript-eslint/no-explicit-any
public constructor(_options: any) {
this.name = ReplayCanvasShim.id;

consoleSandbox(() => {
// eslint-disable-next-line no-console
console.error('You are using new ReplayCanvas() even though this bundle does not include replay canvas.');
});
}

/** jsdoc */
public setupOnce(): void {
// noop
}

/** jsdoc */
public getOptions(): void {
// noop
}
}

export { ReplayCanvasShim as ReplayCanvas };

0 comments on commit 9dd8758

Please sign in to comment.