Skip to content

Commit cd9b896

Browse files
authored
feat(v8): Remove deprecated Replay, Feedback, ReplayCanvas exports (#10814)
On the road to deleting `Sentry.Integrations` exports - we remove all exports for `Sentry.Replay`, `Sentry.Feedback`, and `Sentry.ReplayCanvas`.
1 parent b5f820b commit cd9b896

File tree

104 files changed

+238
-449
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+238
-449
lines changed

.size-limit.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,28 @@ module.exports = [
33
{
44
name: '@sentry/browser (incl. Tracing, Replay, Feedback) - Webpack (gzipped)',
55
path: 'packages/browser/build/npm/esm/index.js',
6-
import: '{ init, Replay, browserTracingIntegration, Feedback }',
6+
import: '{ init, replayIntegration, browserTracingIntegration, feedbackIntegration }',
77
gzip: true,
88
limit: '90 KB',
99
},
1010
{
1111
name: '@sentry/browser (incl. Tracing, Replay) - Webpack (gzipped)',
1212
path: 'packages/browser/build/npm/esm/index.js',
13-
import: '{ init, Replay, browserTracingIntegration }',
13+
import: '{ init, replayIntegration, browserTracingIntegration }',
1414
gzip: true,
1515
limit: '75 KB',
1616
},
1717
{
1818
name: '@sentry/browser (incl. Tracing, Replay with Canvas) - Webpack (gzipped)',
1919
path: 'packages/browser/build/npm/esm/index.js',
20-
import: '{ init, Replay, browserTracingIntegration, ReplayCanvas }',
20+
import: '{ init, replayIntegration, browserTracingIntegration, replayCanvasIntegration }',
2121
gzip: true,
2222
limit: '90 KB',
2323
},
2424
{
2525
name: '@sentry/browser (incl. Tracing, Replay) - Webpack with treeshaking flags (gzipped)',
2626
path: 'packages/browser/build/npm/esm/index.js',
27-
import: '{ init, Replay, browserTracingIntegration }',
27+
import: '{ init, replayIntegration, browserTracingIntegration }',
2828
gzip: true,
2929
limit: '75 KB',
3030
modifyWebpackConfig: function (config) {
@@ -57,7 +57,7 @@ module.exports = [
5757
{
5858
name: '@sentry/browser (incl. Feedback) - Webpack (gzipped)',
5959
path: 'packages/browser/build/npm/esm/index.js',
60-
import: '{ init, Feedback }',
60+
import: '{ init, feedbackIntegration }',
6161
gzip: true,
6262
limit: '50 KB',
6363
},
@@ -138,7 +138,7 @@ module.exports = [
138138
{
139139
name: '@sentry/react (incl. Tracing, Replay) - Webpack (gzipped)',
140140
path: 'packages/react/build/esm/index.js',
141-
import: '{ init, browserTracingIntegration, Replay }',
141+
import: '{ init, browserTracingIntegration, replayIntegration }',
142142
gzip: true,
143143
limit: '75 KB',
144144
},
@@ -154,7 +154,7 @@ module.exports = [
154154
{
155155
name: '@sentry/nextjs Client (incl. Tracing, Replay) - Webpack (gzipped)',
156156
path: 'packages/nextjs/build/esm/client/index.js',
157-
import: '{ init, browserTracingIntegration, Replay }',
157+
import: '{ init, browserTracingIntegration, replayIntegration }',
158158
gzip: true,
159159
limit: '110 KB',
160160
},
@@ -168,7 +168,7 @@ module.exports = [
168168
{
169169
name: '@sentry-internal/feedback - Webpack (gzipped)',
170170
path: 'packages/feedback/build/npm/esm/index.js',
171-
import: '{ Feedback }',
171+
import: '{ feedbackIntegration }',
172172
gzip: true,
173173
limit: '25 KB',
174174
},

dev-packages/browser-integration-tests/loader-suites/loader/onLoad/customReplay/init.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Sentry.onLoad(function () {
22
Sentry.init({
33
integrations: [
44
// Without this syntax, this will be re-written by the test framework
5-
new window['Sentry'].Replay({
5+
window['Sentry'].replayIntegration({
66
useCompression: false,
77
}),
88
],
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
import { Feedback } from '@sentry-internal/feedback';
21
import * as Sentry from '@sentry/browser';
32

43
window.Sentry = Sentry;
54

65
Sentry.init({
76
dsn: 'https://[email protected]/1337',
8-
integrations: [new Feedback()],
7+
integrations: [Sentry.feedbackIntegration()],
98
});
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { Feedback } from '@sentry-internal/feedback';
21
import * as Sentry from '@sentry/browser';
32

43
window.Sentry = Sentry;
@@ -8,11 +7,11 @@ Sentry.init({
87
replaysOnErrorSampleRate: 1.0,
98
replaysSessionSampleRate: 0,
109
integrations: [
11-
new Sentry.Replay({
10+
Sentry.replayIntegration({
1211
flushMinDelay: 200,
1312
flushMaxDelay: 200,
1413
minReplayDuration: 0,
1514
}),
16-
new Feedback(),
15+
Sentry.feedbackIntegration(),
1716
],
1817
});

dev-packages/browser-integration-tests/suites/replay/bufferMode/init.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as Sentry from '@sentry/browser';
22

33
window.Sentry = Sentry;
4-
window.Replay = new Sentry.Replay({
4+
window.Replay = Sentry.replayIntegration({
55
flushMinDelay: 200,
66
flushMaxDelay: 200,
77
minReplayDuration: 0,

dev-packages/browser-integration-tests/suites/replay/bufferMode/test.ts

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { expect } from '@playwright/test';
2-
import type { Replay } from '@sentry/replay';
2+
import type { replayIntegration as actualReplayIntegration } from '@sentry/replay';
33
import type { ReplayContainer } from '@sentry/replay/build/npm/types/types';
44

55
import { sentryTest } from '../../../utils/fixtures';
@@ -58,19 +58,19 @@ sentryTest(
5858

5959
expect(
6060
await page.evaluate(() => {
61-
const replayIntegration = (window as unknown as Window & { Replay: { _replay: ReplayContainer } }).Replay;
62-
const replay = replayIntegration._replay;
61+
const replayIntegration = (window as unknown as Window & { Replay: ReturnType<typeof actualReplayIntegration> })
62+
.Replay;
63+
const replay = replayIntegration['_replay'];
6364
return replay.isEnabled();
6465
}),
6566
).toBe(false);
6667

6768
// Start buffering and assert that it is enabled
6869
expect(
6970
await page.evaluate(() => {
70-
// eslint-disable-next-line deprecation/deprecation
71-
const replayIntegration = (window as unknown as Window & { Replay: InstanceType<typeof Replay> }).Replay;
72-
// @ts-expect-error private
73-
const replay = replayIntegration._replay;
71+
const replayIntegration = (window as unknown as Window & { Replay: ReturnType<typeof actualReplayIntegration> })
72+
.Replay;
73+
const replay = replayIntegration['_replay'];
7474
replayIntegration.startBuffering();
7575
return replay.isEnabled();
7676
}),
@@ -88,8 +88,8 @@ sentryTest(
8888
const [req0] = await Promise.all([
8989
reqPromise0,
9090
page.evaluate(async () => {
91-
// eslint-disable-next-line deprecation/deprecation
92-
const replayIntegration = (window as unknown as Window & { Replay: Replay }).Replay;
91+
const replayIntegration = (window as unknown as Window & { Replay: ReturnType<typeof actualReplayIntegration> })
92+
.Replay;
9393
await replayIntegration.flush();
9494
}),
9595
]);
@@ -212,10 +212,9 @@ sentryTest(
212212
// Start buffering and assert that it is enabled
213213
expect(
214214
await page.evaluate(() => {
215-
// eslint-disable-next-line deprecation/deprecation
216-
const replayIntegration = (window as unknown as Window & { Replay: InstanceType<typeof Replay> }).Replay;
217-
// @ts-expect-error private
218-
const replay = replayIntegration._replay;
215+
const replayIntegration = (window as unknown as Window & { Replay: ReturnType<typeof actualReplayIntegration> })
216+
.Replay;
217+
const replay = replayIntegration['_replay'];
219218
replayIntegration.startBuffering();
220219
return replay.isEnabled();
221220
}),
@@ -233,8 +232,8 @@ sentryTest(
233232
const [req0] = await Promise.all([
234233
reqPromise0,
235234
page.evaluate(async () => {
236-
// eslint-disable-next-line deprecation/deprecation
237-
const replayIntegration = (window as unknown as Window & { Replay: Replay }).Replay;
235+
const replayIntegration = (window as unknown as Window & { Replay: ReturnType<typeof actualReplayIntegration> })
236+
.Replay;
238237
await replayIntegration.flush({ continueRecording: false });
239238
}),
240239
]);
@@ -328,8 +327,8 @@ sentryTest(
328327
// Start buffering and assert that it is enabled
329328
expect(
330329
await page.evaluate(() => {
331-
// eslint-disable-next-line deprecation/deprecation
332-
const replayIntegration = (window as unknown as Window & { Replay: InstanceType<typeof Replay> }).Replay;
330+
const replayIntegration = (window as unknown as Window & { Replay: ReturnType<typeof actualReplayIntegration> })
331+
.Replay;
333332
const replay = replayIntegration['_replay'];
334333
replayIntegration.startBuffering();
335334
return replay.isEnabled();
@@ -347,8 +346,8 @@ sentryTest(
347346
expect(errorEvent0.tags?.replayId).toBeUndefined();
348347

349348
await page.evaluate(async () => {
350-
// eslint-disable-next-line deprecation/deprecation
351-
const replayIntegration = (window as unknown as Window & { Replay: Replay }).Replay;
349+
const replayIntegration = (window as unknown as Window & { Replay: ReturnType<typeof actualReplayIntegration> })
350+
.Replay;
352351
replayIntegration['_replay'].getOptions().errorSampleRate = 1.0;
353352
});
354353

dev-packages/browser-integration-tests/suites/replay/bufferModeReload/init.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as Sentry from '@sentry/browser';
22

33
window.Sentry = Sentry;
4-
window.Replay = new Sentry.Replay({
4+
window.Replay = Sentry.replayIntegration({
55
flushMinDelay: 200,
66
flushMaxDelay: 200,
77
minReplayDuration: 0,

dev-packages/browser-integration-tests/suites/replay/canvas/manualSnapshot/init.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as Sentry from '@sentry/browser';
22

33
window.Sentry = Sentry;
4-
window.Replay = new Sentry.Replay({
4+
window.Replay = Sentry.replayIntegration({
55
flushMinDelay: 50,
66
flushMaxDelay: 50,
77
minReplayDuration: 0,
@@ -14,5 +14,5 @@ Sentry.init({
1414
replaysOnErrorSampleRate: 0.0,
1515
debug: true,
1616

17-
integrations: [window.Replay, new Sentry.ReplayCanvas({ enableManualSnapshot: true })],
17+
integrations: [window.Replay, Sentry.replayCanvasIntegration({ enableManualSnapshot: true })],
1818
});

dev-packages/browser-integration-tests/suites/replay/canvas/records/init.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as Sentry from '@sentry/browser';
22

33
window.Sentry = Sentry;
4-
window.Replay = new Sentry.Replay({
4+
window.Replay = Sentry.replayIntegration({
55
flushMinDelay: 50,
66
flushMaxDelay: 50,
77
minReplayDuration: 0,
@@ -14,5 +14,5 @@ Sentry.init({
1414
replaysOnErrorSampleRate: 0.0,
1515
debug: true,
1616

17-
integrations: [window.Replay, new Sentry.ReplayCanvas()],
17+
integrations: [window.Replay, Sentry.replayCanvasIntegration()],
1818
});

dev-packages/browser-integration-tests/suites/replay/canvas/withCanvasIntegrationFirst/init.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as Sentry from '@sentry/browser';
22

33
window.Sentry = Sentry;
4-
window.Replay = new Sentry.Replay({
4+
window.Replay = Sentry.replayIntegration({
55
flushMinDelay: 200,
66
flushMaxDelay: 200,
77
minReplayDuration: 0,
@@ -14,5 +14,5 @@ Sentry.init({
1414
replaysOnErrorSampleRate: 0.0,
1515
debug: true,
1616

17-
integrations: [new Sentry.ReplayCanvas(), window.Replay],
17+
integrations: [Sentry.replayCanvasIntegration(), window.Replay],
1818
});

dev-packages/browser-integration-tests/suites/replay/canvas/withCanvasIntegrationSecond/init.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as Sentry from '@sentry/browser';
22

33
window.Sentry = Sentry;
4-
window.Replay = new Sentry.Replay({
4+
window.Replay = Sentry.replayIntegration({
55
flushMinDelay: 200,
66
flushMaxDelay: 200,
77
minReplayDuration: 0,
@@ -14,5 +14,5 @@ Sentry.init({
1414
replaysOnErrorSampleRate: 0.0,
1515
debug: true,
1616

17-
integrations: [window.Replay, new Sentry.ReplayCanvas()],
17+
integrations: [window.Replay, Sentry.replayCanvasIntegration()],
1818
});

dev-packages/browser-integration-tests/suites/replay/canvas/withoutCanvasIntegration/init.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as Sentry from '@sentry/browser';
22

33
window.Sentry = Sentry;
4-
window.Replay = new Sentry.Replay({
4+
window.Replay = Sentry.replayIntegration({
55
flushMinDelay: 200,
66
flushMaxDelay: 200,
77
minReplayDuration: 0,

dev-packages/browser-integration-tests/suites/replay/captureComponentName/init.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as Sentry from '@sentry/browser';
22

33
window.Sentry = Sentry;
4-
window.Replay = new Sentry.Replay({
4+
window.Replay = Sentry.replayIntegration({
55
flushMinDelay: 200,
66
flushMaxDelay: 200,
77
minReplayDuration: 0,

dev-packages/browser-integration-tests/suites/replay/captureReplayFromReplayPackage/init.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import * as Sentry from '@sentry/browser';
2-
import { Replay } from '@sentry/replay';
2+
import { replayIntegration } from '@sentry/replay';
33

44
window.Sentry = Sentry;
5-
window.Replay = new Replay({
5+
window.Replay = replayIntegration({
66
flushMinDelay: 200,
77
flushMaxDelay: 200,
88
minReplayDuration: 0,

dev-packages/browser-integration-tests/suites/replay/compressionDisabled/init.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as Sentry from '@sentry/browser';
22

33
window.Sentry = Sentry;
4-
window.Replay = new Sentry.Replay({
4+
window.Replay = Sentry.replayIntegration({
55
flushMinDelay: 200,
66
flushMaxDelay: 200,
77
minReplayDuration: 0,

dev-packages/browser-integration-tests/suites/replay/compressionEnabled/init.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as Sentry from '@sentry/browser';
22

33
window.Sentry = Sentry;
4-
window.Replay = new Sentry.Replay({
4+
window.Replay = Sentry.replayIntegration({
55
flushMinDelay: 200,
66
flushMaxDelay: 200,
77
minReplayDuration: 0,

dev-packages/browser-integration-tests/suites/replay/compressionWorkerUrl/init.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as Sentry from '@sentry/browser';
22

33
window.Sentry = Sentry;
4-
window.Replay = new Sentry.Replay({
4+
window.Replay = Sentry.replayIntegration({
55
flushMinDelay: 200,
66
flushMaxDelay: 200,
77
minReplayDuration: 0,

dev-packages/browser-integration-tests/suites/replay/customEvents/init.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as Sentry from '@sentry/browser';
22

33
window.Sentry = Sentry;
4-
window.Replay = new Sentry.Replay({
4+
window.Replay = Sentry.replayIntegration({
55
flushMinDelay: 200,
66
flushMaxDelay: 200,
77
minReplayDuration: 0,

dev-packages/browser-integration-tests/suites/replay/dsc/init.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as Sentry from '@sentry/browser';
22

33
window.Sentry = Sentry;
4-
window.Replay = new Sentry.Replay({
4+
window.Replay = Sentry.replayIntegration({
55
flushMinDelay: 200,
66
flushMaxDelay: 200,
77
minReplayDuration: 0,

dev-packages/browser-integration-tests/suites/replay/dsc/test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ import { getReplaySnapshot, shouldSkipReplayTest, waitForReplayRunning } from '.
88

99
type TestWindow = Window & {
1010
Sentry: typeof Sentry;
11-
// eslint-disable-next-line deprecation/deprecation
12-
Replay: Sentry.Replay;
11+
Replay: ReturnType<typeof Sentry.replayIntegration>;
1312
};
1413

1514
sentryTest(

dev-packages/browser-integration-tests/suites/replay/errors/beforeErrorSampling/init.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as Sentry from '@sentry/browser';
22

33
window.Sentry = Sentry;
4-
window.Replay = new Sentry.Replay({
4+
window.Replay = Sentry.replayIntegration({
55
flushMinDelay: 200,
66
flushMaxDelay: 200,
77
minReplayDuration: 0,

dev-packages/browser-integration-tests/suites/replay/errors/droppedError/init.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as Sentry from '@sentry/browser';
22

33
window.Sentry = Sentry;
4-
window.Replay = new Sentry.Replay({
4+
window.Replay = Sentry.replayIntegration({
55
flushMinDelay: 200,
66
flushMaxDelay: 200,
77
minReplayDuration: 0,

0 commit comments

Comments
 (0)