Socket
Socket
Sign inDemoInstall

@sentry/browser

Package Overview
Dependencies
Maintainers
11
Versions
529
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sentry/browser - npm Package Compare versions

Comparing version 8.0.0-beta.2 to 8.0.0-beta.3

26

cjs/tracing/browserTracingIntegration.js

@@ -143,20 +143,8 @@ Object.defineProperty(exports, '__esModule', { value: true });

// Continue trace updates the scope in the callback only, but we want to break out of it again...
// This is a bit hacky, because we want to get the span to use both the correct scope _and_ the correct propagation context
// but afterwards, we want to reset it to avoid this also applying to other spans
const scope = core.getCurrentScope();
const propagationContext = utils.propagationContextFromHeaders(sentryTrace, baggage);
core.getCurrentScope().setPropagationContext(propagationContext);
activeSpan = core.continueTrace({ sentryTrace, baggage }, () => {
// We update the outer current scope to have the correct propagation context
// this means, the scope active when the pageload span is created will continue to hold the
// propagationContext from the incoming trace, even after the pageload span ended.
scope.setPropagationContext(core.getCurrentScope().getPropagationContext());
// Ensure we are on the original current scope again, so the span is set as active on it
return core.withScope(scope, () => {
return _createRouteSpan(client, {
op: 'pageload',
...startSpanOptions,
});
});
activeSpan = _createRouteSpan(client, {
op: 'pageload',
...startSpanOptions,
});

@@ -166,5 +154,5 @@ });

// A trace should to stay the consistent over the entire time span of one route.
// Therefore, when the initial pageload or navigation transaction ends, we update the
// Therefore, when the initial pageload or navigation root span ends, we update the
// scope's propagation context to keep span-specific attributes like the `sampled` decision and
// the dynamic sampling context valid, even after the transaction has ended.
// the dynamic sampling context valid, even after the root span has ended.
// This ensures that the trace data is consistent for the entire duration of the route.

@@ -171,0 +159,0 @@ client.on('spanEnd', span => {

import { startTrackingWebVitals, startTrackingLongTasks, startTrackingInteractions, addHistoryInstrumentationHandler, addPerformanceEntries } from '@sentry-internal/browser-utils';
import { TRACING_DEFAULTS, registerSpanErrorInstrumentation, getClient, spanToJSON, getCurrentScope, continueTrace, withScope, 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, browserPerformanceTimeOrigin, uuid4, getDomElement } from '@sentry/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 { DEBUG_BUILD } from '../debug-build.js';

@@ -141,20 +141,8 @@ import { WINDOW } from '../helpers.js';

// Continue trace updates the scope in the callback only, but we want to break out of it again...
// This is a bit hacky, because we want to get the span to use both the correct scope _and_ the correct propagation context
// but afterwards, we want to reset it to avoid this also applying to other spans
const scope = getCurrentScope();
const propagationContext = propagationContextFromHeaders(sentryTrace, baggage);
getCurrentScope().setPropagationContext(propagationContext);
activeSpan = continueTrace({ sentryTrace, baggage }, () => {
// We update the outer current scope to have the correct propagation context
// this means, the scope active when the pageload span is created will continue to hold the
// propagationContext from the incoming trace, even after the pageload span ended.
scope.setPropagationContext(getCurrentScope().getPropagationContext());
// Ensure we are on the original current scope again, so the span is set as active on it
return withScope(scope, () => {
return _createRouteSpan(client, {
op: 'pageload',
...startSpanOptions,
});
});
activeSpan = _createRouteSpan(client, {
op: 'pageload',
...startSpanOptions,
});

@@ -164,5 +152,5 @@ });

// A trace should to stay the consistent over the entire time span of one route.
// Therefore, when the initial pageload or navigation transaction ends, we update the
// Therefore, when the initial pageload or navigation root span ends, we update the
// scope's propagation context to keep span-specific attributes like the `sampled` decision and
// the dynamic sampling context valid, even after the transaction has ended.
// the dynamic sampling context valid, even after the root span has ended.
// This ensures that the trace data is consistent for the entire duration of the route.

@@ -169,0 +157,0 @@ client.on('spanEnd', span => {

{
"name": "@sentry/browser",
"version": "8.0.0-beta.2",
"version": "8.0.0-beta.3",
"description": "Official Sentry SDK for browsers",

@@ -45,12 +45,12 @@ "repository": "git://github.com/getsentry/sentry-javascript.git",

"dependencies": {
"@sentry-internal/browser-utils": "8.0.0-beta.2",
"@sentry-internal/feedback": "8.0.0-beta.2",
"@sentry-internal/replay": "8.0.0-beta.2",
"@sentry-internal/replay-canvas": "8.0.0-beta.2",
"@sentry/core": "8.0.0-beta.2",
"@sentry/types": "8.0.0-beta.2",
"@sentry/utils": "8.0.0-beta.2"
"@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"
},
"devDependencies": {
"@sentry-internal/integration-shims": "8.0.0-beta.2",
"@sentry-internal/integration-shims": "8.0.0-beta.3",
"@types/md5": "2.1.33",

@@ -57,0 +57,0 @@ "btoa": "^1.2.1",

@@ -1,2 +0,2 @@

export { Breadcrumb, BreadcrumbHint, Request, SdkInfo, Event, EventHint, Exception, SeverityLevel, StackFrame, Stacktrace, Thread, User, Session, } from '@sentry/types';
export { Breadcrumb, BreadcrumbHint, Request, SdkInfo, Event, EventHint, ErrorEvent, Exception, SeverityLevel, StackFrame, Stacktrace, Thread, User, Session, } from '@sentry/types';
export { BrowserOptions } from './client';

@@ -3,0 +3,0 @@ export { ReportDialogOptions } from './sdk';

@@ -1,2 +0,2 @@

export type { Breadcrumb, BreadcrumbHint, Request, SdkInfo, Event, EventHint, Exception, SeverityLevel, StackFrame, Stacktrace, Thread, User, Session, } from '@sentry/types';
export type { Breadcrumb, BreadcrumbHint, Request, SdkInfo, Event, EventHint, ErrorEvent, Exception, SeverityLevel, StackFrame, Stacktrace, Thread, User, Session, } from '@sentry/types';
export type { BrowserOptions } from './client';

@@ -3,0 +3,0 @@ export type { ReportDialogOptions } 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc