Skip to content

Commit f8ed063

Browse files
committed
fix circular dependency check
1 parent e0a3f1a commit f8ed063

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
@@ -44,6 +44,7 @@ import {
4444

4545
import { getEnvelopeEndpointWithUrlEncodedAuth } from './api';
4646
import { createEventEnvelope, createSessionEnvelope } from './envelope';
47+
import { getCurrentHub } from './hub';
4748
import type { IntegrationIndex } from './integration';
4849
import { setupIntegration, setupIntegrations } from './integration';
4950
import type { Scope } from './scope';
@@ -823,3 +824,17 @@ function isErrorEvent(event: Event): event is ErrorEvent {
823824
function isTransactionEvent(event: Event): event is TransactionEvent {
824825
return event.type === 'transaction';
825826
}
827+
828+
/**
829+
* Add an event processor to the current client.
830+
* This event processor will run for all events processed by this client.
831+
*/
832+
export function addEventProcessor(callback: EventProcessor): void {
833+
const client = getCurrentHub().getClient();
834+
835+
if (!client || !client.addEventProcessor) {
836+
return;
837+
}
838+
839+
client.addEventProcessor(callback);
840+
}

packages/core/src/eventProcessors.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import type { Event, EventHint, EventProcessor } from '@sentry/types';
22
import { getGlobalSingleton, isThenable, logger, SyncPromise } from '@sentry/utils';
33

4-
import { getCurrentHub } from './hub';
5-
64
/**
75
* Returns the global event processors.
86
* @deprecated Global event processors will be removed in v8.
@@ -20,20 +18,6 @@ export function addGlobalEventProcessor(callback: EventProcessor): void {
2018
getGlobalEventProcessors().push(callback);
2119
}
2220

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

packages/core/src/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,9 @@ export { Scope } from './scope';
4242
export {
4343
// eslint-disable-next-line deprecation/deprecation
4444
addGlobalEventProcessor,
45-
addEventProcessor,
4645
} from './eventProcessors';
4746
export { getEnvelopeEndpointWithUrlEncodedAuth, getReportDialogEndpoint } from './api';
48-
export { BaseClient } from './baseclient';
47+
export { BaseClient, addEventProcessor } from './baseclient';
4948
export { ServerRuntimeClient } from './server-runtime-client';
5049
export { initAndBind } from './sdk';
5150
export { createTransport } from './transports/base';

0 commit comments

Comments
 (0)