@sentry/browser
Advanced tools
Comparing version 8.0.0-beta.3 to 8.0.0-beta.4
@@ -23,3 +23,5 @@ Object.defineProperty(exports, '__esModule', { value: true }); | ||
const replayCanvas = require('@sentry-internal/replay-canvas'); | ||
const feedback = require('@sentry-internal/feedback'); | ||
const feedback = require('./feedback.js'); | ||
const feedbackAsync = require('./feedbackAsync.js'); | ||
const feedback$1 = require('@sentry-internal/feedback'); | ||
const request = require('./tracing/request.js'); | ||
@@ -125,6 +127,5 @@ const browserTracingIntegration = require('./tracing/browserTracingIntegration.js'); | ||
exports.feedbackIntegration = feedback.feedbackIntegration; | ||
exports.feedbackModalIntegration = feedback.feedbackModalIntegration; | ||
exports.feedbackScreenshotIntegration = feedback.feedbackScreenshotIntegration; | ||
exports.getFeedback = feedback.getFeedback; | ||
exports.sendFeedback = feedback.sendFeedback; | ||
exports.feedbackAsyncIntegration = feedbackAsync.feedbackAsyncIntegration; | ||
exports.getFeedback = feedback$1.getFeedback; | ||
exports.sendFeedback = feedback$1.sendFeedback; | ||
exports.defaultRequestInstrumentationOptions = request.defaultRequestInstrumentationOptions; | ||
@@ -131,0 +132,0 @@ exports.instrumentOutgoingRequests = request.instrumentOutgoingRequests; |
@@ -558,2 +558,5 @@ Object.defineProperty(exports, '__esModule', { value: true }); | ||
// TODO (v8): We need to obtain profile ids in @sentry-internal/tracing, | ||
// but we don't have access to this map because importing this map would | ||
// cause a circular dependancy. We need to resolve this in v8. | ||
const PROFILE_MAP = new Map(); | ||
@@ -560,0 +563,0 @@ /** |
@@ -11,2 +11,4 @@ Object.defineProperty(exports, '__esModule', { value: true }); | ||
/* eslint-disable max-lines */ | ||
const BROWSER_TRACING_INTEGRATION_ID = 'BrowserTracing'; | ||
@@ -22,2 +24,3 @@ | ||
enableLongTask: true, | ||
enableInp: true, | ||
_experiments: {}, | ||
@@ -39,3 +42,18 @@ ...request.defaultRequestInstrumentationOptions, | ||
const options = { | ||
const { | ||
enableInp, | ||
enableLongTask, | ||
_experiments: { enableInteractions }, | ||
beforeStartSpan, | ||
idleTimeout, | ||
finalTimeout, | ||
childSpanTimeout, | ||
markBackgroundSpan, | ||
traceFetch, | ||
traceXHR, | ||
shouldCreateSpanForRequest, | ||
enableHTTPTimings, | ||
instrumentPageLoad, | ||
instrumentNavigation, | ||
} = { | ||
...DEFAULT_BROWSER_TRACING_OPTIONS, | ||
@@ -47,6 +65,10 @@ ..._options, | ||
if (options.enableLongTask) { | ||
if (enableInp) { | ||
browserUtils.startTrackingINP(); | ||
} | ||
if (enableLongTask) { | ||
browserUtils.startTrackingLongTasks(); | ||
} | ||
if (options._experiments.enableInteractions) { | ||
if (enableInteractions) { | ||
browserUtils.startTrackingInteractions(); | ||
@@ -62,4 +84,2 @@ } | ||
function _createRouteSpan(client, startSpanOptions) { | ||
const { beforeStartSpan, idleTimeout, finalTimeout, childSpanTimeout } = options; | ||
const isPageloadTransaction = startSpanOptions.op === 'pageload'; | ||
@@ -71,6 +91,7 @@ | ||
// If `beforeStartSpan` set a custom name, record that fact | ||
const attributes = finalStartSpanOptions.attributes || {}; | ||
if (finalStartSpanOptions.name !== finalStartSpanOptions.name) { | ||
// If `finalStartSpanOptions.name` is different than `startSpanOptions.name` | ||
// it is because `beforeStartSpan` set a custom name. Therefore we set the source to 'custom'. | ||
if (startSpanOptions.name !== finalStartSpanOptions.name) { | ||
attributes[core.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE] = 'custom'; | ||
@@ -95,12 +116,14 @@ finalStartSpanOptions.attributes = attributes; | ||
function emitFinish() { | ||
if (['interactive', 'complete'].includes(helpers.WINDOW.document.readyState)) { | ||
client.emit('idleSpanEnableAutoFinish', idleSpan); | ||
} | ||
} | ||
if (isPageloadTransaction && helpers.WINDOW.document) { | ||
helpers.WINDOW.document.addEventListener('readystatechange', () => { | ||
if (['interactive', 'complete'].includes(helpers.WINDOW.document.readyState)) { | ||
client.emit('idleSpanEnableAutoFinish', idleSpan); | ||
} | ||
emitFinish(); | ||
}); | ||
if (['interactive', 'complete'].includes(helpers.WINDOW.document.readyState)) { | ||
client.emit('idleSpanEnableAutoFinish', idleSpan); | ||
} | ||
emitFinish(); | ||
} | ||
@@ -114,5 +137,2 @@ | ||
afterAllSetup(client) { | ||
const { markBackgroundSpan, traceFetch, traceXHR, shouldCreateSpanForRequest, enableHTTPTimings, _experiments } = | ||
options; | ||
let activeSpan; | ||
@@ -174,53 +194,50 @@ let startingUrl = helpers.WINDOW.location && helpers.WINDOW.location.href; | ||
const newPropagationContext = { | ||
scope.setPropagationContext({ | ||
...oldPropagationContext, | ||
sampled: oldPropagationContext.sampled !== undefined ? oldPropagationContext.sampled : core.spanIsSampled(span), | ||
dsc: oldPropagationContext.dsc || core.getDynamicSamplingContextFromSpan(span), | ||
}; | ||
scope.setPropagationContext(newPropagationContext); | ||
}); | ||
}); | ||
if (options.instrumentPageLoad && helpers.WINDOW.location) { | ||
const startSpanOptions = { | ||
name: helpers.WINDOW.location.pathname, | ||
// pageload should always start at timeOrigin (and needs to be in s, not ms) | ||
startTime: utils.browserPerformanceTimeOrigin ? utils.browserPerformanceTimeOrigin / 1000 : undefined, | ||
attributes: { | ||
[core.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'url', | ||
[core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.pageload.browser', | ||
}, | ||
}; | ||
startBrowserTracingPageLoadSpan(client, startSpanOptions); | ||
} | ||
if (helpers.WINDOW.location) { | ||
if (instrumentPageLoad) { | ||
startBrowserTracingPageLoadSpan(client, { | ||
name: helpers.WINDOW.location.pathname, | ||
// pageload should always start at timeOrigin (and needs to be in s, not ms) | ||
startTime: utils.browserPerformanceTimeOrigin ? utils.browserPerformanceTimeOrigin / 1000 : undefined, | ||
attributes: { | ||
[core.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'url', | ||
[core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.pageload.browser', | ||
}, | ||
}); | ||
} | ||
if (options.instrumentNavigation && helpers.WINDOW.location) { | ||
browserUtils.addHistoryInstrumentationHandler(({ to, from }) => { | ||
/** | ||
* This early return is there to account for some cases where a navigation transaction starts right after | ||
* long-running pageload. We make sure that if `from` is undefined and a valid `startingURL` exists, we don't | ||
* create an uneccessary navigation transaction. | ||
* | ||
* This was hard to duplicate, but this behavior stopped as soon as this fix was applied. This issue might also | ||
* only be caused in certain development environments where the usage of a hot module reloader is causing | ||
* errors. | ||
*/ | ||
if (from === undefined && startingUrl && startingUrl.indexOf(to) !== -1) { | ||
startingUrl = undefined; | ||
return; | ||
} | ||
if (instrumentNavigation) { | ||
browserUtils.addHistoryInstrumentationHandler(({ to, from }) => { | ||
/** | ||
* This early return is there to account for some cases where a navigation transaction starts right after | ||
* long-running pageload. We make sure that if `from` is undefined and a valid `startingURL` exists, we don't | ||
* create an uneccessary navigation transaction. | ||
* | ||
* This was hard to duplicate, but this behavior stopped as soon as this fix was applied. This issue might also | ||
* only be caused in certain development environments where the usage of a hot module reloader is causing | ||
* errors. | ||
*/ | ||
if (from === undefined && startingUrl && startingUrl.indexOf(to) !== -1) { | ||
startingUrl = undefined; | ||
return; | ||
} | ||
if (from !== to) { | ||
startingUrl = undefined; | ||
const startSpanOptions = { | ||
name: helpers.WINDOW.location.pathname, | ||
attributes: { | ||
[core.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'url', | ||
[core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.navigation.browser', | ||
}, | ||
}; | ||
startBrowserTracingNavigationSpan(client, startSpanOptions); | ||
} | ||
}); | ||
if (from !== to) { | ||
startingUrl = undefined; | ||
startBrowserTracingNavigationSpan(client, { | ||
name: helpers.WINDOW.location.pathname, | ||
attributes: { | ||
[core.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'url', | ||
[core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.navigation.browser', | ||
}, | ||
}); | ||
} | ||
}); | ||
} | ||
} | ||
@@ -232,4 +249,4 @@ | ||
if (_experiments.enableInteractions) { | ||
registerInteractionListener(options, latestRoute); | ||
if (enableInteractions) { | ||
registerInteractionListener(idleTimeout, finalTimeout, childSpanTimeout, latestRoute); | ||
} | ||
@@ -274,10 +291,4 @@ | ||
function startBrowserTracingNavigationSpan(client, spanOptions) { | ||
core.getCurrentScope().setPropagationContext({ | ||
traceId: utils.uuid4(), | ||
spanId: utils.uuid4().substring(16), | ||
}); | ||
core.getIsolationScope().setPropagationContext({ | ||
traceId: utils.uuid4(), | ||
spanId: utils.uuid4().substring(16), | ||
}); | ||
core.getCurrentScope().setPropagationContext(generatePropagationContext()); | ||
core.getIsolationScope().setPropagationContext(generatePropagationContext()); | ||
@@ -305,3 +316,5 @@ client.emit('startNavigationSpan', spanOptions); | ||
function registerInteractionListener( | ||
options, | ||
idleTimeout, | ||
finalTimeout, | ||
childSpanTimeout, | ||
latestRoute, | ||
@@ -311,3 +324,2 @@ ) { | ||
const registerInteractionTransaction = () => { | ||
const { idleTimeout, finalTimeout, childSpanTimeout } = options; | ||
const op = 'ui.action.click'; | ||
@@ -353,9 +365,14 @@ | ||
['click'].forEach(type => { | ||
if (helpers.WINDOW.document) { | ||
addEventListener(type, registerInteractionTransaction, { once: false, capture: true }); | ||
} | ||
}); | ||
if (helpers.WINDOW.document) { | ||
addEventListener('click', registerInteractionTransaction, { once: false, capture: true }); | ||
} | ||
} | ||
function generatePropagationContext() { | ||
return { | ||
traceId: utils.uuid4(), | ||
spanId: utils.uuid4().substring(16), | ||
}; | ||
} | ||
exports.BROWSER_TRACING_INTEGRATION_ID = BROWSER_TRACING_INTEGRATION_ID; | ||
@@ -362,0 +379,0 @@ exports.browserTracingIntegration = browserTracingIntegration; |
@@ -36,3 +36,6 @@ Object.defineProperty(exports, '__esModule', { value: true }); | ||
if (!bundle || !WindowWithMaybeIntegration.Sentry) { | ||
// `window.Sentry` is only set when using a CDN bundle, but this method can also be used via the NPM package | ||
const sentryOnWindow = (WindowWithMaybeIntegration.Sentry = WindowWithMaybeIntegration.Sentry || {}); | ||
if (!bundle) { | ||
throw new Error(`Cannot lazy load integration: ${name}`); | ||
@@ -42,3 +45,3 @@ } | ||
// Bail if the integration already exists | ||
const existing = WindowWithMaybeIntegration.Sentry[name]; | ||
const existing = sentryOnWindow[name]; | ||
if (typeof existing === 'function') { | ||
@@ -66,3 +69,3 @@ return existing; | ||
const integrationFn = WindowWithMaybeIntegration.Sentry[name]; | ||
const integrationFn = sentryOnWindow[name]; | ||
@@ -69,0 +72,0 @@ if (typeof integrationFn !== 'function') { |
@@ -21,3 +21,5 @@ export { SDK_VERSION, SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, Scope, addBreadcrumb, addEventProcessor, addIntegration, addTracingExtensions, captureConsoleIntegration, captureEvent, captureException, captureMessage, captureSession, close, continueTrace, createTransport, debugIntegration, dedupeIntegration, endSession, extraErrorDataIntegration, flush, functionToStringIntegration, getActiveSpan, getClient, getCurrentHub, getCurrentScope, getGlobalScope, getIsolationScope, getRootSpan, getSpanDescendants, getSpanStatusFromHttpCode, inboundFiltersIntegration, isInitialized, makeMultiplexedTransport, moduleMetadataIntegration, parameterize, registerSpanErrorInstrumentation, rewriteFramesIntegration, sessionTimingIntegration, setContext, setCurrentClient, setExtra, setExtras, setHttpStatus, setMeasurement, setTag, setTags, setUser, spanToJSON, spanToTraceHeader, startInactiveSpan, startSession, startSpan, startSpanManual, withActiveSpan, withIsolationScope, withScope } from '@sentry/core'; | ||
export { replayCanvasIntegration } from '@sentry-internal/replay-canvas'; | ||
export { feedbackIntegration, feedbackModalIntegration, feedbackScreenshotIntegration, getFeedback, sendFeedback } from '@sentry-internal/feedback'; | ||
export { feedbackIntegration } from './feedback.js'; | ||
export { feedbackAsyncIntegration } from './feedbackAsync.js'; | ||
export { getFeedback, sendFeedback } from '@sentry-internal/feedback'; | ||
export { defaultRequestInstrumentationOptions, instrumentOutgoingRequests } from './tracing/request.js'; | ||
@@ -24,0 +26,0 @@ export { browserTracingIntegration, startBrowserTracingNavigationSpan, startBrowserTracingPageLoadSpan } from './tracing/browserTracingIntegration.js'; |
@@ -556,2 +556,5 @@ import { spanToJSON, getClient, DEFAULT_ENVIRONMENT } from '@sentry/core'; | ||
// TODO (v8): We need to obtain profile ids in @sentry-internal/tracing, | ||
// but we don't have access to this map because importing this map would | ||
// cause a circular dependancy. We need to resolve this in v8. | ||
const PROFILE_MAP = new Map(); | ||
@@ -558,0 +561,0 @@ /** |
@@ -1,4 +0,4 @@ | ||
import { startTrackingWebVitals, startTrackingLongTasks, startTrackingInteractions, addHistoryInstrumentationHandler, addPerformanceEntries } from '@sentry-internal/browser-utils'; | ||
import { startTrackingWebVitals, startTrackingINP, startTrackingLongTasks, startTrackingInteractions, addHistoryInstrumentationHandler, addPerformanceEntries } from '@sentry-internal/browser-utils'; | ||
import { TRACING_DEFAULTS, registerSpanErrorInstrumentation, getClient, spanToJSON, getCurrentScope, getRootSpan, spanIsSampled, getDynamicSamplingContextFromSpan, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, getActiveSpan, getIsolationScope, startIdleSpan, SEMANTIC_ATTRIBUTE_SENTRY_IDLE_SPAN_FINISH_REASON } from '@sentry/core'; | ||
import { logger, propagationContextFromHeaders, browserPerformanceTimeOrigin, uuid4, getDomElement } from '@sentry/utils'; | ||
import { logger, propagationContextFromHeaders, browserPerformanceTimeOrigin, getDomElement, uuid4 } from '@sentry/utils'; | ||
import { DEBUG_BUILD } from '../debug-build.js'; | ||
@@ -9,2 +9,4 @@ import { WINDOW } from '../helpers.js'; | ||
/* eslint-disable max-lines */ | ||
const BROWSER_TRACING_INTEGRATION_ID = 'BrowserTracing'; | ||
@@ -20,2 +22,3 @@ | ||
enableLongTask: true, | ||
enableInp: true, | ||
_experiments: {}, | ||
@@ -37,3 +40,18 @@ ...defaultRequestInstrumentationOptions, | ||
const options = { | ||
const { | ||
enableInp, | ||
enableLongTask, | ||
_experiments: { enableInteractions }, | ||
beforeStartSpan, | ||
idleTimeout, | ||
finalTimeout, | ||
childSpanTimeout, | ||
markBackgroundSpan, | ||
traceFetch, | ||
traceXHR, | ||
shouldCreateSpanForRequest, | ||
enableHTTPTimings, | ||
instrumentPageLoad, | ||
instrumentNavigation, | ||
} = { | ||
...DEFAULT_BROWSER_TRACING_OPTIONS, | ||
@@ -45,6 +63,10 @@ ..._options, | ||
if (options.enableLongTask) { | ||
if (enableInp) { | ||
startTrackingINP(); | ||
} | ||
if (enableLongTask) { | ||
startTrackingLongTasks(); | ||
} | ||
if (options._experiments.enableInteractions) { | ||
if (enableInteractions) { | ||
startTrackingInteractions(); | ||
@@ -60,4 +82,2 @@ } | ||
function _createRouteSpan(client, startSpanOptions) { | ||
const { beforeStartSpan, idleTimeout, finalTimeout, childSpanTimeout } = options; | ||
const isPageloadTransaction = startSpanOptions.op === 'pageload'; | ||
@@ -69,6 +89,7 @@ | ||
// If `beforeStartSpan` set a custom name, record that fact | ||
const attributes = finalStartSpanOptions.attributes || {}; | ||
if (finalStartSpanOptions.name !== finalStartSpanOptions.name) { | ||
// If `finalStartSpanOptions.name` is different than `startSpanOptions.name` | ||
// it is because `beforeStartSpan` set a custom name. Therefore we set the source to 'custom'. | ||
if (startSpanOptions.name !== finalStartSpanOptions.name) { | ||
attributes[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE] = 'custom'; | ||
@@ -93,12 +114,14 @@ finalStartSpanOptions.attributes = attributes; | ||
function emitFinish() { | ||
if (['interactive', 'complete'].includes(WINDOW.document.readyState)) { | ||
client.emit('idleSpanEnableAutoFinish', idleSpan); | ||
} | ||
} | ||
if (isPageloadTransaction && WINDOW.document) { | ||
WINDOW.document.addEventListener('readystatechange', () => { | ||
if (['interactive', 'complete'].includes(WINDOW.document.readyState)) { | ||
client.emit('idleSpanEnableAutoFinish', idleSpan); | ||
} | ||
emitFinish(); | ||
}); | ||
if (['interactive', 'complete'].includes(WINDOW.document.readyState)) { | ||
client.emit('idleSpanEnableAutoFinish', idleSpan); | ||
} | ||
emitFinish(); | ||
} | ||
@@ -112,5 +135,2 @@ | ||
afterAllSetup(client) { | ||
const { markBackgroundSpan, traceFetch, traceXHR, shouldCreateSpanForRequest, enableHTTPTimings, _experiments } = | ||
options; | ||
let activeSpan; | ||
@@ -172,53 +192,50 @@ let startingUrl = WINDOW.location && WINDOW.location.href; | ||
const newPropagationContext = { | ||
scope.setPropagationContext({ | ||
...oldPropagationContext, | ||
sampled: oldPropagationContext.sampled !== undefined ? oldPropagationContext.sampled : spanIsSampled(span), | ||
dsc: oldPropagationContext.dsc || getDynamicSamplingContextFromSpan(span), | ||
}; | ||
scope.setPropagationContext(newPropagationContext); | ||
}); | ||
}); | ||
if (options.instrumentPageLoad && WINDOW.location) { | ||
const startSpanOptions = { | ||
name: WINDOW.location.pathname, | ||
// pageload should always start at timeOrigin (and needs to be in s, not ms) | ||
startTime: browserPerformanceTimeOrigin ? browserPerformanceTimeOrigin / 1000 : undefined, | ||
attributes: { | ||
[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'url', | ||
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.pageload.browser', | ||
}, | ||
}; | ||
startBrowserTracingPageLoadSpan(client, startSpanOptions); | ||
} | ||
if (WINDOW.location) { | ||
if (instrumentPageLoad) { | ||
startBrowserTracingPageLoadSpan(client, { | ||
name: WINDOW.location.pathname, | ||
// pageload should always start at timeOrigin (and needs to be in s, not ms) | ||
startTime: browserPerformanceTimeOrigin ? browserPerformanceTimeOrigin / 1000 : undefined, | ||
attributes: { | ||
[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'url', | ||
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.pageload.browser', | ||
}, | ||
}); | ||
} | ||
if (options.instrumentNavigation && WINDOW.location) { | ||
addHistoryInstrumentationHandler(({ to, from }) => { | ||
/** | ||
* This early return is there to account for some cases where a navigation transaction starts right after | ||
* long-running pageload. We make sure that if `from` is undefined and a valid `startingURL` exists, we don't | ||
* create an uneccessary navigation transaction. | ||
* | ||
* This was hard to duplicate, but this behavior stopped as soon as this fix was applied. This issue might also | ||
* only be caused in certain development environments where the usage of a hot module reloader is causing | ||
* errors. | ||
*/ | ||
if (from === undefined && startingUrl && startingUrl.indexOf(to) !== -1) { | ||
startingUrl = undefined; | ||
return; | ||
} | ||
if (instrumentNavigation) { | ||
addHistoryInstrumentationHandler(({ to, from }) => { | ||
/** | ||
* This early return is there to account for some cases where a navigation transaction starts right after | ||
* long-running pageload. We make sure that if `from` is undefined and a valid `startingURL` exists, we don't | ||
* create an uneccessary navigation transaction. | ||
* | ||
* This was hard to duplicate, but this behavior stopped as soon as this fix was applied. This issue might also | ||
* only be caused in certain development environments where the usage of a hot module reloader is causing | ||
* errors. | ||
*/ | ||
if (from === undefined && startingUrl && startingUrl.indexOf(to) !== -1) { | ||
startingUrl = undefined; | ||
return; | ||
} | ||
if (from !== to) { | ||
startingUrl = undefined; | ||
const startSpanOptions = { | ||
name: WINDOW.location.pathname, | ||
attributes: { | ||
[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'url', | ||
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.navigation.browser', | ||
}, | ||
}; | ||
startBrowserTracingNavigationSpan(client, startSpanOptions); | ||
} | ||
}); | ||
if (from !== to) { | ||
startingUrl = undefined; | ||
startBrowserTracingNavigationSpan(client, { | ||
name: WINDOW.location.pathname, | ||
attributes: { | ||
[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'url', | ||
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.navigation.browser', | ||
}, | ||
}); | ||
} | ||
}); | ||
} | ||
} | ||
@@ -230,4 +247,4 @@ | ||
if (_experiments.enableInteractions) { | ||
registerInteractionListener(options, latestRoute); | ||
if (enableInteractions) { | ||
registerInteractionListener(idleTimeout, finalTimeout, childSpanTimeout, latestRoute); | ||
} | ||
@@ -272,10 +289,4 @@ | ||
function startBrowserTracingNavigationSpan(client, spanOptions) { | ||
getCurrentScope().setPropagationContext({ | ||
traceId: uuid4(), | ||
spanId: uuid4().substring(16), | ||
}); | ||
getIsolationScope().setPropagationContext({ | ||
traceId: uuid4(), | ||
spanId: uuid4().substring(16), | ||
}); | ||
getCurrentScope().setPropagationContext(generatePropagationContext()); | ||
getIsolationScope().setPropagationContext(generatePropagationContext()); | ||
@@ -303,3 +314,5 @@ client.emit('startNavigationSpan', spanOptions); | ||
function registerInteractionListener( | ||
options, | ||
idleTimeout, | ||
finalTimeout, | ||
childSpanTimeout, | ||
latestRoute, | ||
@@ -309,3 +322,2 @@ ) { | ||
const registerInteractionTransaction = () => { | ||
const { idleTimeout, finalTimeout, childSpanTimeout } = options; | ||
const op = 'ui.action.click'; | ||
@@ -351,10 +363,15 @@ | ||
['click'].forEach(type => { | ||
if (WINDOW.document) { | ||
addEventListener(type, registerInteractionTransaction, { once: false, capture: true }); | ||
} | ||
}); | ||
if (WINDOW.document) { | ||
addEventListener('click', registerInteractionTransaction, { once: false, capture: true }); | ||
} | ||
} | ||
function generatePropagationContext() { | ||
return { | ||
traceId: uuid4(), | ||
spanId: uuid4().substring(16), | ||
}; | ||
} | ||
export { BROWSER_TRACING_INTEGRATION_ID, browserTracingIntegration, getMetaContent, startBrowserTracingNavigationSpan, startBrowserTracingPageLoadSpan }; | ||
//# sourceMappingURL=browserTracingIntegration.js.map |
@@ -34,3 +34,6 @@ import { getClient, SDK_VERSION } from '@sentry/core'; | ||
if (!bundle || !WindowWithMaybeIntegration.Sentry) { | ||
// `window.Sentry` is only set when using a CDN bundle, but this method can also be used via the NPM package | ||
const sentryOnWindow = (WindowWithMaybeIntegration.Sentry = WindowWithMaybeIntegration.Sentry || {}); | ||
if (!bundle) { | ||
throw new Error(`Cannot lazy load integration: ${name}`); | ||
@@ -40,3 +43,3 @@ } | ||
// Bail if the integration already exists | ||
const existing = WindowWithMaybeIntegration.Sentry[name]; | ||
const existing = sentryOnWindow[name]; | ||
if (typeof existing === 'function') { | ||
@@ -64,3 +67,3 @@ return existing; | ||
const integrationFn = WindowWithMaybeIntegration.Sentry[name]; | ||
const integrationFn = sentryOnWindow[name]; | ||
@@ -67,0 +70,0 @@ if (typeof integrationFn !== 'function') { |
{ | ||
"name": "@sentry/browser", | ||
"version": "8.0.0-beta.3", | ||
"version": "8.0.0-beta.4", | ||
"description": "Official Sentry SDK for browsers", | ||
@@ -45,32 +45,17 @@ "repository": "git://github.com/getsentry/sentry-javascript.git", | ||
"dependencies": { | ||
"@sentry-internal/browser-utils": "8.0.0-beta.3", | ||
"@sentry-internal/feedback": "8.0.0-beta.3", | ||
"@sentry-internal/replay": "8.0.0-beta.3", | ||
"@sentry-internal/replay-canvas": "8.0.0-beta.3", | ||
"@sentry/core": "8.0.0-beta.3", | ||
"@sentry/types": "8.0.0-beta.3", | ||
"@sentry/utils": "8.0.0-beta.3" | ||
"@sentry-internal/browser-utils": "8.0.0-beta.4", | ||
"@sentry-internal/feedback": "8.0.0-beta.4", | ||
"@sentry-internal/replay": "8.0.0-beta.4", | ||
"@sentry-internal/replay-canvas": "8.0.0-beta.4", | ||
"@sentry/core": "8.0.0-beta.4", | ||
"@sentry/types": "8.0.0-beta.4", | ||
"@sentry/utils": "8.0.0-beta.4" | ||
}, | ||
"devDependencies": { | ||
"@sentry-internal/integration-shims": "8.0.0-beta.3", | ||
"@sentry-internal/integration-shims": "8.0.0-beta.4", | ||
"@types/md5": "2.1.33", | ||
"btoa": "^1.2.1", | ||
"chai": "^4.1.2", | ||
"chokidar": "^3.0.2", | ||
"fake-indexeddb": "^4.0.1", | ||
"karma": "^6.3.16", | ||
"karma-chai": "^0.1.0", | ||
"karma-chrome-launcher": "^2.2.0", | ||
"karma-firefox-launcher": "^2.1.2", | ||
"karma-mocha": "^1.3.0", | ||
"karma-mocha-reporter": "^2.2.5", | ||
"karma-rollup-preprocessor": "^7.0.0", | ||
"karma-sinon": "^1.0.5", | ||
"karma-typescript": "^4.0.0", | ||
"karma-typescript-es6-transform": "^4.0.0", | ||
"karma-webkit-launcher": "^1.0.2", | ||
"mocha": "^6.1.4", | ||
"node-fetch": "^2.6.0", | ||
"playwright": "^1.31.1", | ||
"sinon": "^7.3.2", | ||
"webpack": "^4.47.0" | ||
@@ -77,0 +62,0 @@ }, |
@@ -1,4 +0,4 @@ | ||
import { browserTracingIntegrationShim, feedbackIntegrationShim, feedbackModalIntegrationShim, feedbackScreenshotIntegrationShim, replayIntegrationShim } from '@sentry-internal/integration-shims'; | ||
import { browserTracingIntegrationShim, feedbackIntegrationShim, replayIntegrationShim } from '@sentry-internal/integration-shims'; | ||
export * from './index.bundle.base'; | ||
export { browserTracingIntegrationShim as browserTracingIntegration, feedbackIntegrationShim as feedbackIntegration, feedbackModalIntegrationShim as feedbackModalIntegration, feedbackScreenshotIntegrationShim as feedbackScreenshotIntegration, replayIntegrationShim as replayIntegration, }; | ||
export { browserTracingIntegrationShim as browserTracingIntegration, feedbackIntegrationShim as feedbackIntegration, replayIntegrationShim as replayIntegration, }; | ||
//# sourceMappingURL=index.bundle.d.ts.map |
import { browserTracingIntegrationShim, replayIntegrationShim } from '@sentry-internal/integration-shims'; | ||
export * from './index.bundle.base'; | ||
export { feedbackIntegration, feedbackModalIntegration, feedbackScreenshotIntegration, getFeedback, } from '@sentry-internal/feedback'; | ||
export { feedbackIntegration } from './feedback'; | ||
export { getFeedback } from '@sentry-internal/feedback'; | ||
export { browserTracingIntegrationShim as browserTracingIntegration, replayIntegrationShim as replayIntegration }; | ||
//# sourceMappingURL=index.bundle.feedback.d.ts.map |
@@ -1,5 +0,5 @@ | ||
import { browserTracingIntegrationShim, feedbackIntegrationShim, feedbackModalIntegrationShim, feedbackScreenshotIntegrationShim } from '@sentry-internal/integration-shims'; | ||
import { browserTracingIntegrationShim, feedbackIntegrationShim } from '@sentry-internal/integration-shims'; | ||
export * from './index.bundle.base'; | ||
export { replayIntegration } from '@sentry-internal/replay'; | ||
export { browserTracingIntegrationShim as browserTracingIntegration, feedbackIntegrationShim as feedbackIntegration, feedbackModalIntegrationShim as feedbackModalIntegration, feedbackScreenshotIntegrationShim as feedbackScreenshotIntegration, }; | ||
export { browserTracingIntegrationShim as browserTracingIntegration, feedbackIntegrationShim as feedbackIntegration }; | ||
//# sourceMappingURL=index.bundle.replay.d.ts.map |
@@ -1,6 +0,6 @@ | ||
import { feedbackIntegrationShim, feedbackModalIntegrationShim, feedbackScreenshotIntegrationShim, replayIntegrationShim } from '@sentry-internal/integration-shims'; | ||
import { feedbackIntegrationShim, replayIntegrationShim } from '@sentry-internal/integration-shims'; | ||
export * from './index.bundle.base'; | ||
export { getActiveSpan, getRootSpan, startSpan, startInactiveSpan, startSpanManual, withActiveSpan, getSpanDescendants, setMeasurement, } from '@sentry/core'; | ||
export { browserTracingIntegration, startBrowserTracingNavigationSpan, startBrowserTracingPageLoadSpan, } from './tracing/browserTracingIntegration'; | ||
export { feedbackIntegrationShim as feedbackIntegration, feedbackModalIntegrationShim as feedbackModalIntegration, feedbackScreenshotIntegrationShim as feedbackScreenshotIntegration, replayIntegrationShim as replayIntegration, }; | ||
export { feedbackIntegrationShim as feedbackIntegration, replayIntegrationShim as replayIntegration }; | ||
//# sourceMappingURL=index.bundle.tracing.d.ts.map |
@@ -1,7 +0,7 @@ | ||
import { feedbackIntegrationShim, feedbackModalIntegrationShim, feedbackScreenshotIntegrationShim } from '@sentry-internal/integration-shims'; | ||
import { feedbackIntegrationShim } from '@sentry-internal/integration-shims'; | ||
export * from './index.bundle.base'; | ||
export { getActiveSpan, getRootSpan, startSpan, startInactiveSpan, startSpanManual, withActiveSpan, getSpanDescendants, setMeasurement, } from '@sentry/core'; | ||
export { browserTracingIntegration, startBrowserTracingNavigationSpan, startBrowserTracingPageLoadSpan, } from './tracing/browserTracingIntegration'; | ||
export { feedbackIntegrationShim as feedbackIntegration, feedbackModalIntegrationShim as feedbackModalIntegration, feedbackScreenshotIntegrationShim as feedbackScreenshotIntegration, }; | ||
export { feedbackIntegrationShim as feedbackIntegration }; | ||
export { replayIntegration } from '@sentry-internal/replay'; | ||
//# sourceMappingURL=index.bundle.tracing.replay.d.ts.map |
export * from './index.bundle.base'; | ||
export { getActiveSpan, getRootSpan, startSpan, startInactiveSpan, startSpanManual, withActiveSpan, getSpanDescendants, setMeasurement, } from '@sentry/core'; | ||
export { feedbackIntegration, feedbackModalIntegration, feedbackScreenshotIntegration, getFeedback, } from '@sentry-internal/feedback'; | ||
export { feedbackIntegration } from './feedback'; | ||
export { getFeedback } from '@sentry-internal/feedback'; | ||
export { browserTracingIntegration, startBrowserTracingNavigationSpan, startBrowserTracingPageLoadSpan, } from './tracing/browserTracingIntegration'; | ||
export { replayIntegration } from '@sentry-internal/replay'; | ||
//# sourceMappingURL=index.bundle.tracing.replay.feedback.d.ts.map |
@@ -9,3 +9,5 @@ export * from './exports'; | ||
export { replayCanvasIntegration } from '@sentry-internal/replay-canvas'; | ||
export { feedbackIntegration, feedbackModalIntegration, feedbackScreenshotIntegration, getFeedback, sendFeedback, } from '@sentry-internal/feedback'; | ||
export { feedbackIntegration } from './feedback'; | ||
export { feedbackAsyncIntegration } from './feedbackAsync'; | ||
export { getFeedback, sendFeedback, } from '@sentry-internal/feedback'; | ||
export { defaultRequestInstrumentationOptions, instrumentOutgoingRequests, } from './tracing/request'; | ||
@@ -12,0 +14,0 @@ export { browserTracingIntegration, startBrowserTracingNavigationSpan, startBrowserTracingPageLoadSpan, } from './tracing/browserTracingIntegration'; |
@@ -54,2 +54,8 @@ import { Client, StartSpanOptions } from '@sentry/types'; | ||
/** | ||
* If true, Sentry will capture first input delay and add it to the corresponding transaction. | ||
* | ||
* Default: true | ||
*/ | ||
enableInp: boolean; | ||
/** | ||
* Flag to disable patching all together for fetch requests. | ||
@@ -56,0 +62,0 @@ * |
@@ -1,4 +0,4 @@ | ||
import { browserTracingIntegrationShim, feedbackIntegrationShim, feedbackModalIntegrationShim, feedbackScreenshotIntegrationShim, replayIntegrationShim } from '@sentry-internal/integration-shims'; | ||
import { browserTracingIntegrationShim, feedbackIntegrationShim, replayIntegrationShim } from '@sentry-internal/integration-shims'; | ||
export * from './index.bundle.base'; | ||
export { browserTracingIntegrationShim as browserTracingIntegration, feedbackIntegrationShim as feedbackIntegration, feedbackModalIntegrationShim as feedbackModalIntegration, feedbackScreenshotIntegrationShim as feedbackScreenshotIntegration, replayIntegrationShim as replayIntegration, }; | ||
export { browserTracingIntegrationShim as browserTracingIntegration, feedbackIntegrationShim as feedbackIntegration, replayIntegrationShim as replayIntegration, }; | ||
//# sourceMappingURL=index.bundle.d.ts.map |
import { browserTracingIntegrationShim, replayIntegrationShim } from '@sentry-internal/integration-shims'; | ||
export * from './index.bundle.base'; | ||
export { feedbackIntegration, feedbackModalIntegration, feedbackScreenshotIntegration, getFeedback, } from '@sentry-internal/feedback'; | ||
export { feedbackIntegration } from './feedback'; | ||
export { getFeedback } from '@sentry-internal/feedback'; | ||
export { browserTracingIntegrationShim as browserTracingIntegration, replayIntegrationShim as replayIntegration }; | ||
//# sourceMappingURL=index.bundle.feedback.d.ts.map |
@@ -1,5 +0,5 @@ | ||
import { browserTracingIntegrationShim, feedbackIntegrationShim, feedbackModalIntegrationShim, feedbackScreenshotIntegrationShim } from '@sentry-internal/integration-shims'; | ||
import { browserTracingIntegrationShim, feedbackIntegrationShim } from '@sentry-internal/integration-shims'; | ||
export * from './index.bundle.base'; | ||
export { replayIntegration } from '@sentry-internal/replay'; | ||
export { browserTracingIntegrationShim as browserTracingIntegration, feedbackIntegrationShim as feedbackIntegration, feedbackModalIntegrationShim as feedbackModalIntegration, feedbackScreenshotIntegrationShim as feedbackScreenshotIntegration, }; | ||
export { browserTracingIntegrationShim as browserTracingIntegration, feedbackIntegrationShim as feedbackIntegration }; | ||
//# sourceMappingURL=index.bundle.replay.d.ts.map |
@@ -1,6 +0,6 @@ | ||
import { feedbackIntegrationShim, feedbackModalIntegrationShim, feedbackScreenshotIntegrationShim, replayIntegrationShim } from '@sentry-internal/integration-shims'; | ||
import { feedbackIntegrationShim, replayIntegrationShim } from '@sentry-internal/integration-shims'; | ||
export * from './index.bundle.base'; | ||
export { getActiveSpan, getRootSpan, startSpan, startInactiveSpan, startSpanManual, withActiveSpan, getSpanDescendants, setMeasurement, } from '@sentry/core'; | ||
export { browserTracingIntegration, startBrowserTracingNavigationSpan, startBrowserTracingPageLoadSpan, } from './tracing/browserTracingIntegration'; | ||
export { feedbackIntegrationShim as feedbackIntegration, feedbackModalIntegrationShim as feedbackModalIntegration, feedbackScreenshotIntegrationShim as feedbackScreenshotIntegration, replayIntegrationShim as replayIntegration, }; | ||
export { feedbackIntegrationShim as feedbackIntegration, replayIntegrationShim as replayIntegration }; | ||
//# sourceMappingURL=index.bundle.tracing.d.ts.map |
@@ -1,7 +0,7 @@ | ||
import { feedbackIntegrationShim, feedbackModalIntegrationShim, feedbackScreenshotIntegrationShim } from '@sentry-internal/integration-shims'; | ||
import { feedbackIntegrationShim } from '@sentry-internal/integration-shims'; | ||
export * from './index.bundle.base'; | ||
export { getActiveSpan, getRootSpan, startSpan, startInactiveSpan, startSpanManual, withActiveSpan, getSpanDescendants, setMeasurement, } from '@sentry/core'; | ||
export { browserTracingIntegration, startBrowserTracingNavigationSpan, startBrowserTracingPageLoadSpan, } from './tracing/browserTracingIntegration'; | ||
export { feedbackIntegrationShim as feedbackIntegration, feedbackModalIntegrationShim as feedbackModalIntegration, feedbackScreenshotIntegrationShim as feedbackScreenshotIntegration, }; | ||
export { feedbackIntegrationShim as feedbackIntegration }; | ||
export { replayIntegration } from '@sentry-internal/replay'; | ||
//# sourceMappingURL=index.bundle.tracing.replay.d.ts.map |
export * from './index.bundle.base'; | ||
export { getActiveSpan, getRootSpan, startSpan, startInactiveSpan, startSpanManual, withActiveSpan, getSpanDescendants, setMeasurement, } from '@sentry/core'; | ||
export { feedbackIntegration, feedbackModalIntegration, feedbackScreenshotIntegration, getFeedback, } from '@sentry-internal/feedback'; | ||
export { feedbackIntegration } from './feedback'; | ||
export { getFeedback } from '@sentry-internal/feedback'; | ||
export { browserTracingIntegration, startBrowserTracingNavigationSpan, startBrowserTracingPageLoadSpan, } from './tracing/browserTracingIntegration'; | ||
export { replayIntegration } from '@sentry-internal/replay'; | ||
//# sourceMappingURL=index.bundle.tracing.replay.feedback.d.ts.map |
@@ -9,3 +9,5 @@ export * from './exports'; | ||
export { replayCanvasIntegration } from '@sentry-internal/replay-canvas'; | ||
export { feedbackIntegration, feedbackModalIntegration, feedbackScreenshotIntegration, getFeedback, sendFeedback, } from '@sentry-internal/feedback'; | ||
export { feedbackIntegration } from './feedback'; | ||
export { feedbackAsyncIntegration } from './feedbackAsync'; | ||
export { getFeedback, sendFeedback, } from '@sentry-internal/feedback'; | ||
export { defaultRequestInstrumentationOptions, instrumentOutgoingRequests, } from './tracing/request'; | ||
@@ -12,0 +14,0 @@ export { browserTracingIntegration, startBrowserTracingNavigationSpan, startBrowserTracingPageLoadSpan, } from './tracing/browserTracingIntegration'; |
@@ -54,2 +54,8 @@ import type { Client, StartSpanOptions } from '@sentry/types'; | ||
/** | ||
* If true, Sentry will capture first input delay and add it to the corresponding transaction. | ||
* | ||
* Default: true | ||
*/ | ||
enableInp: boolean; | ||
/** | ||
* Flag to disable patching all together for fetch requests. | ||
@@ -56,0 +62,0 @@ * |
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
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
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
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
953178
7
255
9794
+ Added@sentry-internal/browser-utils@8.0.0-beta.4(transitive)
+ Added@sentry-internal/feedback@8.0.0-beta.4(transitive)
+ Added@sentry-internal/replay@8.0.0-beta.4(transitive)
+ Added@sentry-internal/replay-canvas@8.0.0-beta.4(transitive)
+ Added@sentry/core@8.0.0-beta.4(transitive)
+ Added@sentry/types@8.0.0-beta.4(transitive)
+ Added@sentry/utils@8.0.0-beta.4(transitive)
- Removed@sentry-internal/browser-utils@8.0.0-beta.3(transitive)
- Removed@sentry-internal/feedback@8.0.0-beta.3(transitive)
- Removed@sentry-internal/replay@8.0.0-beta.3(transitive)
- Removed@sentry-internal/replay-canvas@8.0.0-beta.3(transitive)
- Removed@sentry/core@8.0.0-beta.3(transitive)
- Removed@sentry/types@8.0.0-beta.3(transitive)
- Removed@sentry/utils@8.0.0-beta.3(transitive)
Updated@sentry/core@8.0.0-beta.4
Updated@sentry/types@8.0.0-beta.4
Updated@sentry/utils@8.0.0-beta.4