Skip to content

Commit 540f3a7

Browse files
committed
fix circular dependency check
1 parent e0d1131 commit 540f3a7

File tree

3 files changed

+16
-18
lines changed

3 files changed

+16
-18
lines changed

packages/core/src/baseclient.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ import {
4646
import { getEnvelopeEndpointWithUrlEncodedAuth } from './api';
4747
import { DEBUG_BUILD } from './debug-build';
4848
import { createEventEnvelope, createSessionEnvelope } from './envelope';
49+
import { getCurrentHub } from './hub';
4950
import type { IntegrationIndex } from './integration';
5051
import { setupIntegration, setupIntegrations } from './integration';
5152
import type { Scope } from './scope';
@@ -834,3 +835,17 @@ function isErrorEvent(event: Event): event is ErrorEvent {
834835
function isTransactionEvent(event: Event): event is TransactionEvent {
835836
return event.type === 'transaction';
836837
}
838+
839+
/**
840+
* Add an event processor to the current client.
841+
* This event processor will run for all events processed by this client.
842+
*/
843+
export function addEventProcessor(callback: EventProcessor): void {
844+
const client = getCurrentHub().getClient();
845+
846+
if (!client || !client.addEventProcessor) {
847+
return;
848+
}
849+
850+
client.addEventProcessor(callback);
851+
}

packages/core/src/eventProcessors.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ import { SyncPromise, getGlobalSingleton, isThenable, logger } from '@sentry/uti
33

44
import { DEBUG_BUILD } from './debug-build';
55

6-
import { getCurrentHub } from './hub';
7-
86
/**
97
* Returns the global event processors.
108
* @deprecated Global event processors will be removed in v8.
@@ -22,20 +20,6 @@ export function addGlobalEventProcessor(callback: EventProcessor): void {
2220
getGlobalEventProcessors().push(callback);
2321
}
2422

25-
/**
26-
* Add an event processor to the current client.
27-
* This event processor will run for all events processed by this client.
28-
*/
29-
export function addEventProcessor(callback: EventProcessor): void {
30-
const client = getCurrentHub().getClient();
31-
32-
if (!client || !client.addEventProcessor) {
33-
return;
34-
}
35-
36-
client.addEventProcessor(callback);
37-
}
38-
3923
/**
4024
* Process an array of event processors, returning the processed event (or `null` if the event was dropped).
4125
*/

packages/core/src/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,9 @@ export { Scope } from './scope';
4444
export {
4545
// eslint-disable-next-line deprecation/deprecation
4646
addGlobalEventProcessor,
47-
addEventProcessor,
4847
} from './eventProcessors';
4948
export { getEnvelopeEndpointWithUrlEncodedAuth, getReportDialogEndpoint } from './api';
50-
export { BaseClient } from './baseclient';
49+
export { BaseClient, addEventProcessor } from './baseclient';
5150
export { ServerRuntimeClient } from './server-runtime-client';
5251
export { initAndBind } from './sdk';
5352
export { createTransport } from './transports/base';

0 commit comments

Comments
 (0)