File tree Expand file tree Collapse file tree 1 file changed +41
-0
lines changed
packages/integration-shims/src Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Original file line number Diff line number Diff line change 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 } ;
You can’t perform that action at this time.
0 commit comments