@sentry-internal/browser-utils
Advanced tools
Comparing version
@@ -81,7 +81,6 @@ var { | ||
const startTime = utils$1.msToSec(utils.browserPerformanceTimeOrigin ) + (_optionalChain([entry, 'optionalAccess', _3 => _3.startTime]) || 0); | ||
const duration = utils$1.msToSec(_optionalChain([entry, 'optionalAccess', _4 => _4.duration]) || 0); | ||
const startTime = utils$1.msToSec((utils.browserPerformanceTimeOrigin || 0) + (_optionalChain([entry, 'optionalAccess', _3 => _3.startTime]) || 0)); | ||
const routeName = core.getCurrentScope().getScopeData().transactionName; | ||
const name = entry ? utils.htmlTreeAsString(_optionalChain([entry, 'access', _5 => _5.sources, 'access', _6 => _6[0], 'optionalAccess', _7 => _7.node])) : 'Layout shift'; | ||
const name = entry ? utils.htmlTreeAsString(_optionalChain([entry, 'access', _4 => _4.sources, 'access', _5 => _5[0], 'optionalAccess', _6 => _6.node])) : 'Layout shift'; | ||
@@ -91,3 +90,3 @@ const attributes = utils.dropUndefinedKeys({ | ||
[core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'ui.webvital.cls', | ||
[core.SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME]: _optionalChain([entry, 'optionalAccess', _8 => _8.duration]) || 0, | ||
[core.SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME]: _optionalChain([entry, 'optionalAccess', _7 => _7.duration]) || 0, | ||
// attach the pageload span id to the CLS span so that we can link them in the UI | ||
@@ -104,3 +103,3 @@ 'sentry.pageload.span_id': pageloadSpanId, | ||
_optionalChain([span, 'optionalAccess', _9 => _9.addEvent, 'call', _10 => _10('cls', { | ||
_optionalChain([span, 'optionalAccess', _8 => _8.addEvent, 'call', _9 => _9('cls', { | ||
[core.SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT]: '', | ||
@@ -110,3 +109,5 @@ [core.SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE]: clsValue, | ||
_optionalChain([span, 'optionalAccess', _11 => _11.end, 'call', _12 => _12(startTime + duration)]); | ||
// LayoutShift performance entries always have a duration of 0, so we don't need to add `entry.duration` here | ||
// see: https://developer.mozilla.org/en-US/docs/Web/API/PerformanceEntry/duration | ||
_optionalChain([span, 'optionalAccess', _10 => _10.end, 'call', _11 => _11(startTime)]); | ||
} | ||
@@ -116,3 +117,3 @@ | ||
try { | ||
return _optionalChain([PerformanceObserver, 'access', _13 => _13.supportedEntryTypes, 'optionalAccess', _14 => _14.includes, 'call', _15 => _15('layout-shift')]); | ||
return _optionalChain([PerformanceObserver, 'access', _12 => _12.supportedEntryTypes, 'optionalAccess', _13 => _13.includes, 'call', _14 => _14('layout-shift')]); | ||
} catch (e) { | ||
@@ -119,0 +120,0 @@ return false; |
@@ -82,3 +82,3 @@ Object.defineProperty(exports, '__esModule', { value: true }); | ||
let profileId = undefined; | ||
let profileId; | ||
try { | ||
@@ -85,0 +85,0 @@ // @ts-expect-error skip optional chaining to save bundle size with try catch |
@@ -76,7 +76,6 @@ import { _optionalChain } from '@sentry/utils'; | ||
const startTime = msToSec(browserPerformanceTimeOrigin ) + (_optionalChain([entry, 'optionalAccess', _3 => _3.startTime]) || 0); | ||
const duration = msToSec(_optionalChain([entry, 'optionalAccess', _4 => _4.duration]) || 0); | ||
const startTime = msToSec((browserPerformanceTimeOrigin || 0) + (_optionalChain([entry, 'optionalAccess', _3 => _3.startTime]) || 0)); | ||
const routeName = getCurrentScope().getScopeData().transactionName; | ||
const name = entry ? htmlTreeAsString(_optionalChain([entry, 'access', _5 => _5.sources, 'access', _6 => _6[0], 'optionalAccess', _7 => _7.node])) : 'Layout shift'; | ||
const name = entry ? htmlTreeAsString(_optionalChain([entry, 'access', _4 => _4.sources, 'access', _5 => _5[0], 'optionalAccess', _6 => _6.node])) : 'Layout shift'; | ||
@@ -86,3 +85,3 @@ const attributes = dropUndefinedKeys({ | ||
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'ui.webvital.cls', | ||
[SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME]: _optionalChain([entry, 'optionalAccess', _8 => _8.duration]) || 0, | ||
[SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME]: _optionalChain([entry, 'optionalAccess', _7 => _7.duration]) || 0, | ||
// attach the pageload span id to the CLS span so that we can link them in the UI | ||
@@ -99,3 +98,3 @@ 'sentry.pageload.span_id': pageloadSpanId, | ||
_optionalChain([span, 'optionalAccess', _9 => _9.addEvent, 'call', _10 => _10('cls', { | ||
_optionalChain([span, 'optionalAccess', _8 => _8.addEvent, 'call', _9 => _9('cls', { | ||
[SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_UNIT]: '', | ||
@@ -105,3 +104,5 @@ [SEMANTIC_ATTRIBUTE_SENTRY_MEASUREMENT_VALUE]: clsValue, | ||
_optionalChain([span, 'optionalAccess', _11 => _11.end, 'call', _12 => _12(startTime + duration)]); | ||
// LayoutShift performance entries always have a duration of 0, so we don't need to add `entry.duration` here | ||
// see: https://developer.mozilla.org/en-US/docs/Web/API/PerformanceEntry/duration | ||
_optionalChain([span, 'optionalAccess', _10 => _10.end, 'call', _11 => _11(startTime)]); | ||
} | ||
@@ -111,3 +112,3 @@ | ||
try { | ||
return _optionalChain([PerformanceObserver, 'access', _13 => _13.supportedEntryTypes, 'optionalAccess', _14 => _14.includes, 'call', _15 => _15('layout-shift')]); | ||
return _optionalChain([PerformanceObserver, 'access', _12 => _12.supportedEntryTypes, 'optionalAccess', _13 => _13.includes, 'call', _14 => _14('layout-shift')]); | ||
} catch (e) { | ||
@@ -114,0 +115,0 @@ return false; |
@@ -80,3 +80,3 @@ import { spanToJSON, withActiveSpan, startInactiveSpan, getClient, getCurrentScope } from '@sentry/core'; | ||
let profileId = undefined; | ||
let profileId; | ||
try { | ||
@@ -83,0 +83,0 @@ // @ts-expect-error skip optional chaining to save bundle size with try catch |
{ | ||
"name": "@sentry-internal/browser-utils", | ||
"version": "8.29.0", | ||
"version": "8.30.0", | ||
"description": "Browser Utilities for all Sentry JavaScript SDKs", | ||
@@ -42,5 +42,5 @@ "repository": "git://github.com/getsentry/sentry-javascript.git", | ||
"dependencies": { | ||
"@sentry/core": "8.29.0", | ||
"@sentry/types": "8.29.0", | ||
"@sentry/utils": "8.29.0" | ||
"@sentry/core": "8.30.0", | ||
"@sentry/types": "8.30.0", | ||
"@sentry/utils": "8.30.0" | ||
}, | ||
@@ -47,0 +47,0 @@ "scripts": { |
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
743344
0.18%7427
0.03%+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
Updated
Updated
Updated