Skip to content

Commit b0ae26d

Browse files
committed
fix circular deps in core
1 parent 5c9a354 commit b0ae26d

File tree

4 files changed

+17
-23
lines changed

4 files changed

+17
-23
lines changed

packages/core/src/getCurrentHubShim.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,18 @@ export function getCurrentHubShim(): Hub {
7070
};
7171
}
7272

73+
/**
74+
* Returns the default hub instance.
75+
*
76+
* If a hub is already registered in the global carrier but this module
77+
* contains a more recent version, it replaces the registered version.
78+
* Otherwise, the currently registered hub will be returned.
79+
*
80+
* @deprecated Use the respective replacement method directly instead.
81+
*/
82+
// eslint-disable-next-line deprecation/deprecation
83+
export const getCurrentHub = getCurrentHubShim;
84+
7385
/**
7486
* Sends the current Session on the scope
7587
*/

packages/core/src/hub.ts

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import type { AsyncContextStrategy, Carrier } from './asyncContext';
2424
import { getMainCarrier, getSentryCarrier } from './asyncContext';
2525
import { DEFAULT_ENVIRONMENT } from './constants';
2626
import { DEBUG_BUILD } from './debug-build';
27-
import { getCurrentHubShim } from './getCurrentHubShim';
2827
import { Scope } from './scope';
2928
import { closeSession, makeSession, updateSession } from './session';
3029
import { SDK_VERSION } from './version';
@@ -497,18 +496,6 @@ export class Hub implements HubInterface {
497496
}
498497
}
499498

500-
/**
501-
* Returns the default hub instance.
502-
*
503-
* If a hub is already registered in the global carrier but this module
504-
* contains a more recent version, it replaces the registered version.
505-
* Otherwise, the currently registered hub will be returned.
506-
*
507-
* @deprecated Use the respective replacement method directly instead.
508-
*/
509-
// eslint-disable-next-line deprecation/deprecation
510-
export const getCurrentHub = getCurrentHubShim;
511-
512499
/** Get the default current scope. */
513500
export function getDefaultCurrentScope(): Scope {
514501
return getGlobalSingleton('defaultCurrentScope', () => new Scope());

packages/core/src/index.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ export {
3030
addEventProcessor,
3131
} from './exports';
3232
export {
33-
// eslint-disable-next-line deprecation/deprecation
34-
getCurrentHub,
3533
getDefaultCurrentScope,
3634
getDefaultIsolationScope,
3735
} from './hub';
@@ -107,4 +105,4 @@ export { addTracingHeadersToFetchRequest, instrumentFetchRequest } from './fetch
107105
export { trpcMiddleware } from './trpc';
108106

109107
// eslint-disable-next-line deprecation/deprecation
110-
export { getCurrentHubShim } from './getCurrentHubShim';
108+
export { getCurrentHubShim, getCurrentHub } from './getCurrentHubShim';

packages/core/src/trpc.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
import { isThenable, normalize } from '@sentry/utils';
2-
import {
3-
SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,
4-
SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,
5-
captureException,
6-
setContext,
7-
startSpanManual,
8-
} from '.';
2+
93
import { getClient } from './currentScopes';
4+
import { captureException, setContext } from './exports';
5+
import { SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE } from './semanticAttributes';
6+
import { startSpanManual } from './tracing';
107

118
interface SentryTrpcMiddlewareOptions {
129
/** Whether to include procedure inputs in reported events. Defaults to `false`. */

0 commit comments

Comments
 (0)