@sentry/vercel-edge
Advanced tools
Comparing version 8.0.0-alpha.9 to 8.0.0-beta.1
@@ -7,5 +7,2 @@ Object.defineProperty(exports, '__esModule', { value: true }); | ||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any | ||
const MaybeGlobalAsyncLocalStorage = (utils.GLOBAL_OBJ ).AsyncLocalStorage; | ||
let asyncStorage; | ||
@@ -17,2 +14,5 @@ | ||
function setAsyncLocalStorageAsyncContextStrategy() { | ||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any | ||
const MaybeGlobalAsyncLocalStorage = (utils.GLOBAL_OBJ ).AsyncLocalStorage; | ||
if (!MaybeGlobalAsyncLocalStorage) { | ||
@@ -30,21 +30,21 @@ debugBuild.DEBUG_BUILD && | ||
function getCurrentAsyncStorageHub() { | ||
return asyncStorage.getStore(); | ||
} | ||
function getScopes() { | ||
const scopes = asyncStorage.getStore(); | ||
function getCurrentHub() { | ||
return getCurrentAsyncStorageHub() || core.getGlobalHub(); | ||
if (scopes) { | ||
return scopes; | ||
} | ||
// fallback behavior: | ||
// if, for whatever reason, we can't find scopes on the context here, we have to fix this somehow | ||
return { | ||
scope: core.getDefaultCurrentScope(), | ||
isolationScope: core.getDefaultIsolationScope(), | ||
}; | ||
} | ||
function withScope(callback) { | ||
const parentHub = getCurrentHub(); | ||
/* eslint-disable deprecation/deprecation */ | ||
const client = parentHub.getClient(); | ||
const scope = parentHub.getScope().clone(); | ||
const isolationScope = parentHub.getIsolationScope(); | ||
const newHub = new core.Hub(client, scope, isolationScope); | ||
/* eslint-enable deprecation/deprecation */ | ||
return asyncStorage.run(newHub, () => { | ||
const scope = getScopes().scope.clone(); | ||
const isolationScope = getScopes().isolationScope; | ||
return asyncStorage.run({ scope, isolationScope }, () => { | ||
return callback(scope); | ||
@@ -55,11 +55,4 @@ }); | ||
function withSetScope(scope, callback) { | ||
const parentHub = getCurrentHub(); | ||
/* eslint-disable deprecation/deprecation */ | ||
const client = parentHub.getClient(); | ||
const isolationScope = parentHub.getIsolationScope(); | ||
const newHub = new core.Hub(client, scope, isolationScope); | ||
/* eslint-enable deprecation/deprecation */ | ||
return asyncStorage.run(newHub, () => { | ||
const isolationScope = getScopes().isolationScope.clone(); | ||
return asyncStorage.run({ scope, isolationScope }, () => { | ||
return callback(scope); | ||
@@ -70,12 +63,5 @@ }); | ||
function withIsolationScope(callback) { | ||
const parentHub = getCurrentHub(); | ||
/* eslint-disable deprecation/deprecation */ | ||
const client = parentHub.getClient(); | ||
const scope = parentHub.getScope().clone(); | ||
const isolationScope = parentHub.getIsolationScope().clone(); | ||
const newHub = new core.Hub(client, scope, isolationScope); | ||
/* eslint-enable deprecation/deprecation */ | ||
return asyncStorage.run(newHub, () => { | ||
const scope = getScopes().scope; | ||
const isolationScope = getScopes().isolationScope.clone(); | ||
return asyncStorage.run({ scope, isolationScope }, () => { | ||
return callback(isolationScope); | ||
@@ -86,11 +72,4 @@ }); | ||
function withSetIsolationScope(isolationScope, callback) { | ||
const parentHub = getCurrentHub(); | ||
/* eslint-disable deprecation/deprecation */ | ||
const client = parentHub.getClient(); | ||
const scope = parentHub.getScope().clone(); | ||
const newHub = new core.Hub(client, scope, isolationScope); | ||
/* eslint-enable deprecation/deprecation */ | ||
return asyncStorage.run(newHub, () => { | ||
const scope = getScopes().scope; | ||
return asyncStorage.run({ scope, isolationScope }, () => { | ||
return callback(isolationScope); | ||
@@ -101,3 +80,2 @@ }); | ||
core.setAsyncContextStrategy({ | ||
getCurrentHub, | ||
withScope, | ||
@@ -107,6 +85,4 @@ withSetScope, | ||
withSetIsolationScope, | ||
// eslint-disable-next-line deprecation/deprecation | ||
getCurrentScope: () => getCurrentHub().getScope(), | ||
// eslint-disable-next-line deprecation/deprecation | ||
getIsolationScope: () => getCurrentHub().getIsolationScope(), | ||
getCurrentScope: () => getScopes().scope, | ||
getIsolationScope: () => getScopes().isolationScope, | ||
}); | ||
@@ -113,0 +89,0 @@ } |
@@ -10,3 +10,2 @@ Object.defineProperty(exports, '__esModule', { value: true }); | ||
exports.Hub = core.Hub; | ||
exports.SDK_VERSION = core.SDK_VERSION; | ||
@@ -52,2 +51,4 @@ exports.SEMANTIC_ATTRIBUTE_SENTRY_OP = core.SEMANTIC_ATTRIBUTE_SENTRY_OP; | ||
exports.setUser = core.setUser; | ||
exports.spanToJSON = core.spanToJSON; | ||
exports.spanToTraceHeader = core.spanToTraceHeader; | ||
exports.startInactiveSpan = core.startInactiveSpan; | ||
@@ -54,0 +55,0 @@ exports.startSpan = core.startSpan; |
@@ -1,8 +0,5 @@ | ||
import { setAsyncContextStrategy, getGlobalHub, Hub } from '@sentry/core'; | ||
import { setAsyncContextStrategy, getDefaultCurrentScope, getDefaultIsolationScope } from '@sentry/core'; | ||
import { GLOBAL_OBJ, logger } from '@sentry/utils'; | ||
import { DEBUG_BUILD } from './debug-build.js'; | ||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any | ||
const MaybeGlobalAsyncLocalStorage = (GLOBAL_OBJ ).AsyncLocalStorage; | ||
let asyncStorage; | ||
@@ -14,2 +11,5 @@ | ||
function setAsyncLocalStorageAsyncContextStrategy() { | ||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any | ||
const MaybeGlobalAsyncLocalStorage = (GLOBAL_OBJ ).AsyncLocalStorage; | ||
if (!MaybeGlobalAsyncLocalStorage) { | ||
@@ -27,21 +27,21 @@ DEBUG_BUILD && | ||
function getCurrentAsyncStorageHub() { | ||
return asyncStorage.getStore(); | ||
} | ||
function getScopes() { | ||
const scopes = asyncStorage.getStore(); | ||
function getCurrentHub() { | ||
return getCurrentAsyncStorageHub() || getGlobalHub(); | ||
if (scopes) { | ||
return scopes; | ||
} | ||
// fallback behavior: | ||
// if, for whatever reason, we can't find scopes on the context here, we have to fix this somehow | ||
return { | ||
scope: getDefaultCurrentScope(), | ||
isolationScope: getDefaultIsolationScope(), | ||
}; | ||
} | ||
function withScope(callback) { | ||
const parentHub = getCurrentHub(); | ||
/* eslint-disable deprecation/deprecation */ | ||
const client = parentHub.getClient(); | ||
const scope = parentHub.getScope().clone(); | ||
const isolationScope = parentHub.getIsolationScope(); | ||
const newHub = new Hub(client, scope, isolationScope); | ||
/* eslint-enable deprecation/deprecation */ | ||
return asyncStorage.run(newHub, () => { | ||
const scope = getScopes().scope.clone(); | ||
const isolationScope = getScopes().isolationScope; | ||
return asyncStorage.run({ scope, isolationScope }, () => { | ||
return callback(scope); | ||
@@ -52,11 +52,4 @@ }); | ||
function withSetScope(scope, callback) { | ||
const parentHub = getCurrentHub(); | ||
/* eslint-disable deprecation/deprecation */ | ||
const client = parentHub.getClient(); | ||
const isolationScope = parentHub.getIsolationScope(); | ||
const newHub = new Hub(client, scope, isolationScope); | ||
/* eslint-enable deprecation/deprecation */ | ||
return asyncStorage.run(newHub, () => { | ||
const isolationScope = getScopes().isolationScope.clone(); | ||
return asyncStorage.run({ scope, isolationScope }, () => { | ||
return callback(scope); | ||
@@ -67,12 +60,5 @@ }); | ||
function withIsolationScope(callback) { | ||
const parentHub = getCurrentHub(); | ||
/* eslint-disable deprecation/deprecation */ | ||
const client = parentHub.getClient(); | ||
const scope = parentHub.getScope().clone(); | ||
const isolationScope = parentHub.getIsolationScope().clone(); | ||
const newHub = new Hub(client, scope, isolationScope); | ||
/* eslint-enable deprecation/deprecation */ | ||
return asyncStorage.run(newHub, () => { | ||
const scope = getScopes().scope; | ||
const isolationScope = getScopes().isolationScope.clone(); | ||
return asyncStorage.run({ scope, isolationScope }, () => { | ||
return callback(isolationScope); | ||
@@ -83,11 +69,4 @@ }); | ||
function withSetIsolationScope(isolationScope, callback) { | ||
const parentHub = getCurrentHub(); | ||
/* eslint-disable deprecation/deprecation */ | ||
const client = parentHub.getClient(); | ||
const scope = parentHub.getScope().clone(); | ||
const newHub = new Hub(client, scope, isolationScope); | ||
/* eslint-enable deprecation/deprecation */ | ||
return asyncStorage.run(newHub, () => { | ||
const scope = getScopes().scope; | ||
return asyncStorage.run({ scope, isolationScope }, () => { | ||
return callback(isolationScope); | ||
@@ -98,3 +77,2 @@ }); | ||
setAsyncContextStrategy({ | ||
getCurrentHub, | ||
withScope, | ||
@@ -104,6 +82,4 @@ withSetScope, | ||
withSetIsolationScope, | ||
// eslint-disable-next-line deprecation/deprecation | ||
getCurrentScope: () => getCurrentHub().getScope(), | ||
// eslint-disable-next-line deprecation/deprecation | ||
getIsolationScope: () => getCurrentHub().getIsolationScope(), | ||
getCurrentScope: () => getScopes().scope, | ||
getIsolationScope: () => getScopes().isolationScope, | ||
}); | ||
@@ -110,0 +86,0 @@ } |
@@ -1,2 +0,2 @@ | ||
export { Hub, SDK_VERSION, SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, Scope, addBreadcrumb, addEventProcessor, addIntegration, captureCheckIn, captureEvent, captureException, captureMessage, close, continueTrace, createTransport, flush, functionToStringIntegration, getActiveSpan, getClient, getCurrentScope, getGlobalScope, getIsolationScope, getRootSpan, getSpanDescendants, getSpanStatusFromHttpCode, inboundFiltersIntegration, isInitialized, linkedErrorsIntegration, metrics, requestDataIntegration, setContext, setCurrentClient, setExtra, setExtras, setHttpStatus, setMeasurement, setTag, setTags, setUser, startInactiveSpan, startSpan, startSpanManual, trpcMiddleware, withActiveSpan, withIsolationScope, withMonitor, withScope } from '@sentry/core'; | ||
export { SDK_VERSION, SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, Scope, addBreadcrumb, addEventProcessor, addIntegration, captureCheckIn, captureEvent, captureException, captureMessage, close, continueTrace, createTransport, flush, functionToStringIntegration, getActiveSpan, getClient, getCurrentScope, getGlobalScope, getIsolationScope, getRootSpan, getSpanDescendants, getSpanStatusFromHttpCode, inboundFiltersIntegration, isInitialized, linkedErrorsIntegration, metrics, requestDataIntegration, setContext, setCurrentClient, setExtra, setExtras, setHttpStatus, setMeasurement, setTag, setTags, setUser, spanToJSON, spanToTraceHeader, startInactiveSpan, startSpan, startSpanManual, trpcMiddleware, withActiveSpan, withIsolationScope, withMonitor, withScope } from '@sentry/core'; | ||
export { VercelEdgeClient } from './client.js'; | ||
@@ -3,0 +3,0 @@ export { getDefaultIntegrations, init } from './sdk.js'; |
{ | ||
"name": "@sentry/vercel-edge", | ||
"version": "8.0.0-alpha.9", | ||
"version": "8.0.0-beta.1", | ||
"description": "Offical Sentry SDK for the Vercel Edge Runtime", | ||
@@ -45,5 +45,5 @@ "repository": "git://github.com/getsentry/sentry-javascript.git", | ||
"dependencies": { | ||
"@sentry/core": "8.0.0-alpha.9", | ||
"@sentry/types": "8.0.0-alpha.9", | ||
"@sentry/utils": "8.0.0-alpha.9" | ||
"@sentry/core": "8.0.0-beta.1", | ||
"@sentry/types": "8.0.0-beta.1", | ||
"@sentry/utils": "8.0.0-beta.1" | ||
}, | ||
@@ -50,0 +50,0 @@ "devDependencies": { |
export { Breadcrumb, BreadcrumbHint, PolymorphicRequest, Request, SdkInfo, Event, EventHint, Exception, Session, SeverityLevel, Span, StackFrame, Stacktrace, Thread, User, } from '@sentry/types'; | ||
export { AddRequestDataToEventOptions } from '@sentry/utils'; | ||
export { VercelEdgeOptions } from './types'; | ||
export { addEventProcessor, addBreadcrumb, addIntegration, captureException, captureEvent, captureMessage, close, createTransport, flush, getClient, isInitialized, getCurrentScope, getGlobalScope, getIsolationScope, Hub, setCurrentClient, Scope, SDK_VERSION, setContext, setExtra, setExtras, setTag, setTags, setUser, getSpanStatusFromHttpCode, setHttpStatus, withScope, withIsolationScope, captureCheckIn, withMonitor, setMeasurement, getActiveSpan, getRootSpan, startSpan, startInactiveSpan, startSpanManual, withActiveSpan, getSpanDescendants, continueTrace, metrics, functionToStringIntegration, inboundFiltersIntegration, linkedErrorsIntegration, requestDataIntegration, SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, trpcMiddleware, } from '@sentry/core'; | ||
export { addEventProcessor, addBreadcrumb, addIntegration, captureException, captureEvent, captureMessage, close, createTransport, flush, getClient, isInitialized, getCurrentScope, getGlobalScope, getIsolationScope, setCurrentClient, Scope, SDK_VERSION, setContext, setExtra, setExtras, setTag, setTags, setUser, getSpanStatusFromHttpCode, setHttpStatus, withScope, withIsolationScope, captureCheckIn, withMonitor, setMeasurement, getActiveSpan, getRootSpan, startSpan, startInactiveSpan, startSpanManual, withActiveSpan, getSpanDescendants, continueTrace, metrics, functionToStringIntegration, inboundFiltersIntegration, linkedErrorsIntegration, requestDataIntegration, SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, trpcMiddleware, spanToJSON, spanToTraceHeader, } from '@sentry/core'; | ||
export { VercelEdgeClient } from './client'; | ||
@@ -6,0 +6,0 @@ export { getDefaultIntegrations, init, } from './sdk'; |
export type { Breadcrumb, BreadcrumbHint, PolymorphicRequest, Request, SdkInfo, Event, EventHint, Exception, Session, SeverityLevel, Span, StackFrame, Stacktrace, Thread, User, } from '@sentry/types'; | ||
export type { AddRequestDataToEventOptions } from '@sentry/utils'; | ||
export type { VercelEdgeOptions } from './types'; | ||
export { addEventProcessor, addBreadcrumb, addIntegration, captureException, captureEvent, captureMessage, close, createTransport, flush, getClient, isInitialized, getCurrentScope, getGlobalScope, getIsolationScope, Hub, setCurrentClient, Scope, SDK_VERSION, setContext, setExtra, setExtras, setTag, setTags, setUser, getSpanStatusFromHttpCode, setHttpStatus, withScope, withIsolationScope, captureCheckIn, withMonitor, setMeasurement, getActiveSpan, getRootSpan, startSpan, startInactiveSpan, startSpanManual, withActiveSpan, getSpanDescendants, continueTrace, metrics, functionToStringIntegration, inboundFiltersIntegration, linkedErrorsIntegration, requestDataIntegration, SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, trpcMiddleware, } from '@sentry/core'; | ||
export { addEventProcessor, addBreadcrumb, addIntegration, captureException, captureEvent, captureMessage, close, createTransport, flush, getClient, isInitialized, getCurrentScope, getGlobalScope, getIsolationScope, setCurrentClient, Scope, SDK_VERSION, setContext, setExtra, setExtras, setTag, setTags, setUser, getSpanStatusFromHttpCode, setHttpStatus, withScope, withIsolationScope, captureCheckIn, withMonitor, setMeasurement, getActiveSpan, getRootSpan, startSpan, startInactiveSpan, startSpanManual, withActiveSpan, getSpanDescendants, continueTrace, metrics, functionToStringIntegration, inboundFiltersIntegration, linkedErrorsIntegration, requestDataIntegration, SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, trpcMiddleware, spanToJSON, spanToTraceHeader, } from '@sentry/core'; | ||
export { VercelEdgeClient } from './client'; | ||
@@ -6,0 +6,0 @@ export { getDefaultIntegrations, init, } from './sdk'; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
114952
1200
+ Added@sentry/core@8.0.0-beta.1(transitive)
+ Added@sentry/types@8.0.0-beta.1(transitive)
+ Added@sentry/utils@8.0.0-beta.1(transitive)
- Removed@sentry/core@8.0.0-alpha.9(transitive)
- Removed@sentry/types@8.0.0-alpha.9(transitive)
- Removed@sentry/utils@8.0.0-alpha.9(transitive)
Updated@sentry/core@8.0.0-beta.1
Updated@sentry/types@8.0.0-beta.1
Updated@sentry/utils@8.0.0-beta.1