-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }; |