Skip to content

Commit 9dd8758

Browse files
committed
forgot shims
1 parent ab2d746 commit 9dd8758

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import type { Integration } from '@sentry/types';
2+
import { consoleSandbox } from '@sentry/utils';
3+
4+
/**
5+
* This is a shim for the Replay integration.
6+
* It is needed in order for the CDN bundles to continue working when users add/remove replay
7+
* from it, without changing their config. This is necessary for the loader mechanism.
8+
*/
9+
class ReplayCanvasShim implements Integration {
10+
/**
11+
* @inheritDoc
12+
*/
13+
public static id: string = 'ReplayCanvas';
14+
15+
/**
16+
* @inheritDoc
17+
*/
18+
public name: string;
19+
20+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
21+
public constructor(_options: any) {
22+
this.name = ReplayCanvasShim.id;
23+
24+
consoleSandbox(() => {
25+
// eslint-disable-next-line no-console
26+
console.error('You are using new ReplayCanvas() even though this bundle does not include replay canvas.');
27+
});
28+
}
29+
30+
/** jsdoc */
31+
public setupOnce(): void {
32+
// noop
33+
}
34+
35+
/** jsdoc */
36+
public getOptions(): void {
37+
// noop
38+
}
39+
}
40+
41+
export { ReplayCanvasShim as ReplayCanvas };

0 commit comments

Comments
 (0)