Skip to content

Commit 7d4f791

Browse files
authored
ref(astro): Remove deprecated Replay and BrowserTracing (#10768)
Swaps the class implementation with the new function
1 parent a60391a commit 7d4f791

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

packages/astro/src/integration/snippets.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ const buildClientIntegrations = (options: SentryOptions): string => {
5757
const integrations: string[] = [];
5858

5959
if (options.tracesSampleRate == null || options.tracesSampleRate) {
60-
integrations.push('new Sentry.BrowserTracing()');
60+
integrations.push('Sentry.browserTracingIntegration()');
6161
}
6262

6363
if (
@@ -66,7 +66,7 @@ const buildClientIntegrations = (options: SentryOptions): string => {
6666
options.replaysOnErrorSampleRate == null ||
6767
options.replaysOnErrorSampleRate
6868
) {
69-
integrations.push('new Sentry.Replay()');
69+
integrations.push('Sentry.replayIntegration()');
7070
}
7171

7272
return integrations.join(', ');

packages/astro/test/integration/snippets.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ describe('buildClientSnippet', () => {
2323
environment: import.meta.env.PUBLIC_VERCEL_ENV,
2424
release: import.meta.env.PUBLIC_VERCEL_GIT_COMMIT_SHA,
2525
tracesSampleRate: 1,
26-
integrations: [new Sentry.BrowserTracing(), new Sentry.Replay()],
26+
integrations: [Sentry.browserTracingIntegration(), Sentry.replayIntegration()],
2727
replaysSessionSampleRate: 0.1,
2828
replaysOnErrorSampleRate: 1,
2929
});"
@@ -43,7 +43,7 @@ describe('buildClientSnippet', () => {
4343
release: \\"1.0.0\\",
4444
tracesSampleRate: 0.3,
4545
sampleRate: 0.2,
46-
integrations: [new Sentry.BrowserTracing(), new Sentry.Replay()],
46+
integrations: [Sentry.browserTracingIntegration(), Sentry.replayIntegration()],
4747
replaysSessionSampleRate: 0.5,
4848
replaysOnErrorSampleRate: 0.4,
4949
});"
@@ -61,7 +61,7 @@ describe('buildClientSnippet', () => {
6161
environment: import.meta.env.PUBLIC_VERCEL_ENV,
6262
release: import.meta.env.PUBLIC_VERCEL_GIT_COMMIT_SHA,
6363
tracesSampleRate: 0,
64-
integrations: [new Sentry.Replay()],
64+
integrations: [Sentry.replayIntegration()],
6565
replaysSessionSampleRate: 0.1,
6666
replaysOnErrorSampleRate: 1,
6767
});"
@@ -80,7 +80,7 @@ it('does not include Replay if replay sample ratest are 0', () => {
8080
environment: import.meta.env.PUBLIC_VERCEL_ENV,
8181
release: import.meta.env.PUBLIC_VERCEL_GIT_COMMIT_SHA,
8282
tracesSampleRate: 1,
83-
integrations: [new Sentry.BrowserTracing()],
83+
integrations: [Sentry.browserTracingIntegration()],
8484
replaysSessionSampleRate: 0,
8585
replaysOnErrorSampleRate: 0,
8686
});"

0 commit comments

Comments
 (0)