File tree 4 files changed +13
-4
lines changed
4 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -473,10 +473,13 @@ export function getCurrentHub(): Hub {
473
473
474
474
/**
475
475
* Returns the active domain, if one exists
476
- *
476
+ * @deprecated No longer used; remove in v7
477
477
* @returns The domain, or undefined if there is no active domain
478
478
*/
479
+ // eslint-disable-next-line deprecation/deprecation
479
480
export function getActiveDomain ( ) : DomainAsCarrier | undefined {
481
+ logger . warn ( 'Function `getActiveDomain` is deprecated and will be removed in a future version.' ) ;
482
+
480
483
const sentry = getMainCarrier ( ) . __SENTRY__ ;
481
484
482
485
return sentry && sentry . extensions && sentry . extensions . domain && sentry . extensions . domain . active ;
@@ -488,7 +491,7 @@ export function getActiveDomain(): DomainAsCarrier | undefined {
488
491
*/
489
492
function getHubFromActiveDomain ( registry : Carrier ) : Hub {
490
493
try {
491
- const activeDomain = getActiveDomain ( ) ;
494
+ const activeDomain = getMainCarrier ( ) . __SENTRY__ ?. extensions ?. domain ?. active ;
492
495
493
496
// If there's no active domain, just return global hub
494
497
if ( ! activeDomain ) {
Original file line number Diff line number Diff line change
1
+ // eslint-disable-next-line deprecation/deprecation
1
2
export { Carrier , DomainAsCarrier , Layer } from './interfaces' ;
2
3
export { addGlobalEventProcessor , Scope } from './scope' ;
3
4
export { Session } from './session' ;
4
5
export {
6
+ // eslint-disable-next-line deprecation/deprecation
5
7
getActiveDomain ,
6
8
getCurrentHub ,
7
9
getHubFromCarrier ,
Original file line number Diff line number Diff line change @@ -34,6 +34,10 @@ export interface Carrier {
34
34
} ;
35
35
}
36
36
37
+ /**
38
+ * @hidden
39
+ * @deprecated Can be removed once `Hub.getActiveDomain` is removed.
40
+ */
37
41
export interface DomainAsCarrier extends Carrier {
38
42
// eslint-disable-next-line @typescript-eslint/no-explicit-any
39
43
members : { [ key : string ] : any } [ ] ;
Original file line number Diff line number Diff line change @@ -94,8 +94,8 @@ export interface SamplingContext extends CustomSamplingContext {
94
94
parentSampled ?: boolean ;
95
95
96
96
/**
97
- * Object representing the URL of the current page or worker script. Passed by default in a browser or service worker
98
- * context .
97
+ * Object representing the URL of the current page or worker script. Passed by default when using the `BrowserTracing`
98
+ * integration .
99
99
*/
100
100
location ?: WorkerLocation ;
101
101
You can’t perform that action at this time.
0 commit comments