Skip to content

Commit 108688c

Browse files
committed
ref: Make setupOnce optional in integrations
1 parent 4f92ff0 commit 108688c

35 files changed

+3
-42
lines changed

packages/browser/src/integrations/breadcrumbs.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ const _breadcrumbsIntegration = ((options: Partial<BreadcrumbsOptions> = {}) =>
7171
return {
7272
name: INTEGRATION_NAME,
7373
// TODO v8: Remove this
74-
setupOnce() {}, // eslint-disable-line @typescript-eslint/no-empty-function
7574
setup(client) {
7675
if (_options.console) {
7776
addConsoleInstrumentationHandler(_getConsoleBreadcrumbHandler(client));

packages/browser/src/integrations/dedupe.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ const _dedupeIntegration = (() => {
1212
return {
1313
name: INTEGRATION_NAME,
1414
// TODO v8: Remove this
15-
setupOnce() {}, // eslint-disable-line @typescript-eslint/no-empty-function
1615
processEvent(currentEvent) {
1716
// We want to ignore any non-error type events, e.g. transactions or replays
1817
// These should never be deduped, and also not be compared against as _previousEvent.

packages/browser/src/integrations/httpcontext.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ const _httpContextIntegration = (() => {
99
return {
1010
name: INTEGRATION_NAME,
1111
// TODO v8: Remove this
12-
setupOnce() {}, // eslint-disable-line @typescript-eslint/no-empty-function
1312
preprocessEvent(event) {
1413
// if none of the information we want exists, don't bother
1514
if (!WINDOW.navigator && !WINDOW.location && !WINDOW.document) {

packages/browser/src/integrations/linkederrors.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ const _linkedErrorsIntegration = ((options: LinkedErrorsOptions = {}) => {
2020
return {
2121
name: INTEGRATION_NAME,
2222
// TODO v8: Remove this
23-
setupOnce() {}, // eslint-disable-line @typescript-eslint/no-empty-function
2423
preprocessEvent(event, hint, client) {
2524
const options = client.getOptions();
2625

packages/browser/src/profiling/integration.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ const _browserProfilingIntegration = (() => {
2222
return {
2323
name: INTEGRATION_NAME,
2424
// TODO v8: Remove this
25-
setupOnce() {}, // eslint-disable-line @typescript-eslint/no-empty-function
2625
setup(client) {
2726
const scope = getCurrentScope();
2827

packages/core/src/integration.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ export function setupIntegration(client: Client, integration: Integration, integ
129129
integrationIndex[integration.name] = integration;
130130

131131
// `setupOnce` is only called the first time
132-
if (installedIntegrations.indexOf(integration.name) === -1) {
132+
if (installedIntegrations.indexOf(integration.name) === -1 && typeof integration.setupOnce === 'function') {
133133
// eslint-disable-next-line deprecation/deprecation
134134
integration.setupOnce(addGlobalEventProcessor, getCurrentHub);
135135
installedIntegrations.push(integration.name);

packages/core/src/integrations/inboundfilters.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ const _inboundFiltersIntegration = ((options: Partial<InboundFiltersOptions> = {
3434
return {
3535
name: INTEGRATION_NAME,
3636
// TODO v8: Remove this
37-
setupOnce() {}, // eslint-disable-line @typescript-eslint/no-empty-function
3837
processEvent(event, _hint, client) {
3938
const clientOptions = client.getOptions();
4039
const mergedOptions = _mergeOptions(options, clientOptions);

packages/core/src/integrations/linkederrors.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ const _linkedErrorsIntegration = ((options: LinkedErrorsOptions = {}) => {
1919
return {
2020
name: INTEGRATION_NAME,
2121
// TODO v8: Remove this
22-
setupOnce() {}, // eslint-disable-line @typescript-eslint/no-empty-function
2322
preprocessEvent(event, hint, client) {
2423
const options = client.getOptions();
2524

packages/core/src/integrations/metadata.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ const _moduleMetadataIntegration = (() => {
1010
return {
1111
name: INTEGRATION_NAME,
1212
// TODO v8: Remove this
13-
setupOnce() {}, // eslint-disable-line @typescript-eslint/no-empty-function
1413
setup(client) {
1514
// We need to strip metadata from stack frames before sending them to Sentry since these are client side only.
1615
client.on('beforeEnvelope', envelope => {

packages/core/src/integrations/requestdata.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ const _requestDataIntegration = ((options: RequestDataIntegrationOptions = {}) =
7676
return {
7777
name: INTEGRATION_NAME,
7878
// TODO v8: Remove this
79-
setupOnce() {}, // eslint-disable-line @typescript-eslint/no-empty-function
8079
processEvent(event, _hint, client) {
8180
// Note: In the long run, most of the logic here should probably move into the request data utility functions. For
8281
// the moment it lives here, though, until https://github.com/getsentry/sentry-javascript/issues/5718 is addressed.

0 commit comments

Comments
 (0)