Skip to content

feat(v8): Remove deprecated Replay, Feedback, ReplayCanvas exports #10814

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .size-limit.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,28 @@ module.exports = [
{
name: '@sentry/browser (incl. Tracing, Replay, Feedback) - Webpack (gzipped)',
path: 'packages/browser/build/npm/esm/index.js',
import: '{ init, Replay, browserTracingIntegration, Feedback }',
import: '{ init, replayIntegration, browserTracingIntegration, feedbackIntegration }',
gzip: true,
limit: '90 KB',
},
{
name: '@sentry/browser (incl. Tracing, Replay) - Webpack (gzipped)',
path: 'packages/browser/build/npm/esm/index.js',
import: '{ init, Replay, browserTracingIntegration }',
import: '{ init, replayIntegration, browserTracingIntegration }',
gzip: true,
limit: '75 KB',
},
{
name: '@sentry/browser (incl. Tracing, Replay with Canvas) - Webpack (gzipped)',
path: 'packages/browser/build/npm/esm/index.js',
import: '{ init, Replay, browserTracingIntegration, ReplayCanvas }',
import: '{ init, replayIntegration, browserTracingIntegration, replayCanvasIntegration }',
gzip: true,
limit: '90 KB',
},
{
name: '@sentry/browser (incl. Tracing, Replay) - Webpack with treeshaking flags (gzipped)',
path: 'packages/browser/build/npm/esm/index.js',
import: '{ init, Replay, browserTracingIntegration }',
import: '{ init, replayIntegration, browserTracingIntegration }',
gzip: true,
limit: '75 KB',
modifyWebpackConfig: function (config) {
Expand Down Expand Up @@ -57,7 +57,7 @@ module.exports = [
{
name: '@sentry/browser (incl. Feedback) - Webpack (gzipped)',
path: 'packages/browser/build/npm/esm/index.js',
import: '{ init, Feedback }',
import: '{ init, feedbackIntegration }',
gzip: true,
limit: '50 KB',
},
Expand Down Expand Up @@ -138,7 +138,7 @@ module.exports = [
{
name: '@sentry/react (incl. Tracing, Replay) - Webpack (gzipped)',
path: 'packages/react/build/esm/index.js',
import: '{ init, browserTracingIntegration, Replay }',
import: '{ init, browserTracingIntegration, replayIntegration }',
gzip: true,
limit: '75 KB',
},
Expand All @@ -154,7 +154,7 @@ module.exports = [
{
name: '@sentry/nextjs Client (incl. Tracing, Replay) - Webpack (gzipped)',
path: 'packages/nextjs/build/esm/client/index.js',
import: '{ init, browserTracingIntegration, Replay }',
import: '{ init, browserTracingIntegration, replayIntegration }',
gzip: true,
limit: '110 KB',
},
Expand All @@ -168,7 +168,7 @@ module.exports = [
{
name: '@sentry-internal/feedback - Webpack (gzipped)',
path: 'packages/feedback/build/npm/esm/index.js',
import: '{ Feedback }',
import: '{ feedbackIntegration }',
gzip: true,
limit: '25 KB',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Sentry.onLoad(function () {
Sentry.init({
integrations: [
// Without this syntax, this will be re-written by the test framework
new window['Sentry'].Replay({
window['Sentry'].replayIntegration({
useCompression: false,
}),
],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { Feedback } from '@sentry-internal/feedback';
import * as Sentry from '@sentry/browser';

window.Sentry = Sentry;

Sentry.init({
dsn: 'https://[email protected]/1337',
integrations: [new Feedback()],
integrations: [Sentry.feedbackIntegration()],
});
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { Feedback } from '@sentry-internal/feedback';
import * as Sentry from '@sentry/browser';

window.Sentry = Sentry;
Expand All @@ -8,11 +7,11 @@ Sentry.init({
replaysOnErrorSampleRate: 1.0,
replaysSessionSampleRate: 0,
integrations: [
new Sentry.Replay({
Sentry.replayIntegration({
flushMinDelay: 200,
flushMaxDelay: 200,
minReplayDuration: 0,
}),
new Feedback(),
Sentry.feedbackIntegration(),
],
});
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as Sentry from '@sentry/browser';

window.Sentry = Sentry;
window.Replay = new Sentry.Replay({
window.Replay = Sentry.replayIntegration({
flushMinDelay: 200,
flushMaxDelay: 200,
minReplayDuration: 0,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect } from '@playwright/test';
import type { Replay } from '@sentry/replay';
import type { replayIntegration as actualReplayIntegration } from '@sentry/replay';
import type { ReplayContainer } from '@sentry/replay/build/npm/types/types';

import { sentryTest } from '../../../utils/fixtures';
Expand Down Expand Up @@ -58,19 +58,19 @@ sentryTest(

expect(
await page.evaluate(() => {
const replayIntegration = (window as unknown as Window & { Replay: { _replay: ReplayContainer } }).Replay;
const replay = replayIntegration._replay;
const replayIntegration = (window as unknown as Window & { Replay: ReturnType<typeof actualReplayIntegration> })
.Replay;
const replay = replayIntegration['_replay'];
return replay.isEnabled();
}),
).toBe(false);

// Start buffering and assert that it is enabled
expect(
await page.evaluate(() => {
// eslint-disable-next-line deprecation/deprecation
const replayIntegration = (window as unknown as Window & { Replay: InstanceType<typeof Replay> }).Replay;
// @ts-expect-error private
const replay = replayIntegration._replay;
const replayIntegration = (window as unknown as Window & { Replay: ReturnType<typeof actualReplayIntegration> })
.Replay;
const replay = replayIntegration['_replay'];
replayIntegration.startBuffering();
return replay.isEnabled();
}),
Expand All @@ -88,8 +88,8 @@ sentryTest(
const [req0] = await Promise.all([
reqPromise0,
page.evaluate(async () => {
// eslint-disable-next-line deprecation/deprecation
const replayIntegration = (window as unknown as Window & { Replay: Replay }).Replay;
const replayIntegration = (window as unknown as Window & { Replay: ReturnType<typeof actualReplayIntegration> })
.Replay;
await replayIntegration.flush();
}),
]);
Expand Down Expand Up @@ -212,10 +212,9 @@ sentryTest(
// Start buffering and assert that it is enabled
expect(
await page.evaluate(() => {
// eslint-disable-next-line deprecation/deprecation
const replayIntegration = (window as unknown as Window & { Replay: InstanceType<typeof Replay> }).Replay;
// @ts-expect-error private
const replay = replayIntegration._replay;
const replayIntegration = (window as unknown as Window & { Replay: ReturnType<typeof actualReplayIntegration> })
.Replay;
const replay = replayIntegration['_replay'];
replayIntegration.startBuffering();
return replay.isEnabled();
}),
Expand All @@ -233,8 +232,8 @@ sentryTest(
const [req0] = await Promise.all([
reqPromise0,
page.evaluate(async () => {
// eslint-disable-next-line deprecation/deprecation
const replayIntegration = (window as unknown as Window & { Replay: Replay }).Replay;
const replayIntegration = (window as unknown as Window & { Replay: ReturnType<typeof actualReplayIntegration> })
.Replay;
await replayIntegration.flush({ continueRecording: false });
}),
]);
Expand Down Expand Up @@ -328,8 +327,8 @@ sentryTest(
// Start buffering and assert that it is enabled
expect(
await page.evaluate(() => {
// eslint-disable-next-line deprecation/deprecation
const replayIntegration = (window as unknown as Window & { Replay: InstanceType<typeof Replay> }).Replay;
const replayIntegration = (window as unknown as Window & { Replay: ReturnType<typeof actualReplayIntegration> })
.Replay;
const replay = replayIntegration['_replay'];
replayIntegration.startBuffering();
return replay.isEnabled();
Expand All @@ -347,8 +346,8 @@ sentryTest(
expect(errorEvent0.tags?.replayId).toBeUndefined();

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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as Sentry from '@sentry/browser';

window.Sentry = Sentry;
window.Replay = new Sentry.Replay({
window.Replay = Sentry.replayIntegration({
flushMinDelay: 200,
flushMaxDelay: 200,
minReplayDuration: 0,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as Sentry from '@sentry/browser';

window.Sentry = Sentry;
window.Replay = new Sentry.Replay({
window.Replay = Sentry.replayIntegration({
flushMinDelay: 50,
flushMaxDelay: 50,
minReplayDuration: 0,
Expand All @@ -14,5 +14,5 @@ Sentry.init({
replaysOnErrorSampleRate: 0.0,
debug: true,

integrations: [window.Replay, new Sentry.ReplayCanvas({ enableManualSnapshot: true })],
integrations: [window.Replay, Sentry.replayCanvasIntegration({ enableManualSnapshot: true })],
});
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as Sentry from '@sentry/browser';

window.Sentry = Sentry;
window.Replay = new Sentry.Replay({
window.Replay = Sentry.replayIntegration({
flushMinDelay: 50,
flushMaxDelay: 50,
minReplayDuration: 0,
Expand All @@ -14,5 +14,5 @@ Sentry.init({
replaysOnErrorSampleRate: 0.0,
debug: true,

integrations: [window.Replay, new Sentry.ReplayCanvas()],
integrations: [window.Replay, Sentry.replayCanvasIntegration()],
});
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as Sentry from '@sentry/browser';

window.Sentry = Sentry;
window.Replay = new Sentry.Replay({
window.Replay = Sentry.replayIntegration({
flushMinDelay: 200,
flushMaxDelay: 200,
minReplayDuration: 0,
Expand All @@ -14,5 +14,5 @@ Sentry.init({
replaysOnErrorSampleRate: 0.0,
debug: true,

integrations: [new Sentry.ReplayCanvas(), window.Replay],
integrations: [Sentry.replayCanvasIntegration(), window.Replay],
});
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as Sentry from '@sentry/browser';

window.Sentry = Sentry;
window.Replay = new Sentry.Replay({
window.Replay = Sentry.replayIntegration({
flushMinDelay: 200,
flushMaxDelay: 200,
minReplayDuration: 0,
Expand All @@ -14,5 +14,5 @@ Sentry.init({
replaysOnErrorSampleRate: 0.0,
debug: true,

integrations: [window.Replay, new Sentry.ReplayCanvas()],
integrations: [window.Replay, Sentry.replayCanvasIntegration()],
});
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as Sentry from '@sentry/browser';

window.Sentry = Sentry;
window.Replay = new Sentry.Replay({
window.Replay = Sentry.replayIntegration({
flushMinDelay: 200,
flushMaxDelay: 200,
minReplayDuration: 0,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as Sentry from '@sentry/browser';

window.Sentry = Sentry;
window.Replay = new Sentry.Replay({
window.Replay = Sentry.replayIntegration({
flushMinDelay: 200,
flushMaxDelay: 200,
minReplayDuration: 0,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import * as Sentry from '@sentry/browser';
import { Replay } from '@sentry/replay';
import { replayIntegration } from '@sentry/replay';

window.Sentry = Sentry;
window.Replay = new Replay({
window.Replay = replayIntegration({
flushMinDelay: 200,
flushMaxDelay: 200,
minReplayDuration: 0,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as Sentry from '@sentry/browser';

window.Sentry = Sentry;
window.Replay = new Sentry.Replay({
window.Replay = Sentry.replayIntegration({
flushMinDelay: 200,
flushMaxDelay: 200,
minReplayDuration: 0,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as Sentry from '@sentry/browser';

window.Sentry = Sentry;
window.Replay = new Sentry.Replay({
window.Replay = Sentry.replayIntegration({
flushMinDelay: 200,
flushMaxDelay: 200,
minReplayDuration: 0,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as Sentry from '@sentry/browser';

window.Sentry = Sentry;
window.Replay = new Sentry.Replay({
window.Replay = Sentry.replayIntegration({
flushMinDelay: 200,
flushMaxDelay: 200,
minReplayDuration: 0,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as Sentry from '@sentry/browser';

window.Sentry = Sentry;
window.Replay = new Sentry.Replay({
window.Replay = Sentry.replayIntegration({
flushMinDelay: 200,
flushMaxDelay: 200,
minReplayDuration: 0,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as Sentry from '@sentry/browser';

window.Sentry = Sentry;
window.Replay = new Sentry.Replay({
window.Replay = Sentry.replayIntegration({
flushMinDelay: 200,
flushMaxDelay: 200,
minReplayDuration: 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ import { getReplaySnapshot, shouldSkipReplayTest, waitForReplayRunning } from '.

type TestWindow = Window & {
Sentry: typeof Sentry;
// eslint-disable-next-line deprecation/deprecation
Replay: Sentry.Replay;
Replay: ReturnType<typeof Sentry.replayIntegration>;
};

sentryTest(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as Sentry from '@sentry/browser';

window.Sentry = Sentry;
window.Replay = new Sentry.Replay({
window.Replay = Sentry.replayIntegration({
flushMinDelay: 200,
flushMaxDelay: 200,
minReplayDuration: 0,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as Sentry from '@sentry/browser';

window.Sentry = Sentry;
window.Replay = new Sentry.Replay({
window.Replay = Sentry.replayIntegration({
flushMinDelay: 200,
flushMaxDelay: 200,
minReplayDuration: 0,
Expand Down
Loading