@sentry/react
Advanced tools
Comparing version 7.105.0 to 8.0.0-alpha.2
@@ -61,3 +61,3 @@ Object.defineProperty(exports, '__esModule', { value: true }); | ||
/** | ||
* A ErrorBoundary component that logs errors to Sentry. Requires React >= 16. | ||
* A ErrorBoundary component that logs errors to Sentry. | ||
* NOTE: If you are a Sentry user, and you are seeing this stack frame, it means the | ||
@@ -75,7 +75,6 @@ * Sentry React SDK ErrorBoundary caught an error invoking your application code. This | ||
const client = browser.getClient(); | ||
if (client && client.on && props.showDialog) { | ||
if (client && props.showDialog) { | ||
this._openFallbackReportDialog = false; | ||
client.on('afterSendEvent', event => { | ||
if (!event.type && event.event_id === this._lastEventId) { | ||
// eslint-disable-next-line deprecation/deprecation | ||
if (!event.type && this._lastEventId && event.event_id === this._lastEventId) { | ||
browser.showReportDialog({ ...props.dialogOptions, eventId: this._lastEventId }); | ||
@@ -203,4 +202,4 @@ } | ||
const Wrapped = (props) => ( | ||
React__namespace.createElement(ErrorBoundary, { ...errorBoundaryOptions, __self: this, __source: {fileName: _jsxFileName, lineNumber: 238}} | ||
, React__namespace.createElement(WrappedComponent, { ...props, __self: this, __source: {fileName: _jsxFileName, lineNumber: 239}} ) | ||
React__namespace.createElement(ErrorBoundary, { ...errorBoundaryOptions, __self: this, __source: {fileName: _jsxFileName, lineNumber: 237}} | ||
, React__namespace.createElement(WrappedComponent, { ...props, __self: this, __source: {fileName: _jsxFileName, lineNumber: 238}} ) | ||
) | ||
@@ -207,0 +206,0 @@ ); |
@@ -22,10 +22,6 @@ Object.defineProperty(exports, '__esModule', { value: true }); | ||
exports.reactRouterV3BrowserTracingIntegration = reactrouterv3.reactRouterV3BrowserTracingIntegration; | ||
exports.reactRouterV3Instrumentation = reactrouterv3.reactRouterV3Instrumentation; | ||
exports.reactRouterV4BrowserTracingIntegration = reactrouter.reactRouterV4BrowserTracingIntegration; | ||
exports.reactRouterV4Instrumentation = reactrouter.reactRouterV4Instrumentation; | ||
exports.reactRouterV5BrowserTracingIntegration = reactrouter.reactRouterV5BrowserTracingIntegration; | ||
exports.reactRouterV5Instrumentation = reactrouter.reactRouterV5Instrumentation; | ||
exports.withSentryRouting = reactrouter.withSentryRouting; | ||
exports.reactRouterV6BrowserTracingIntegration = reactrouterv6.reactRouterV6BrowserTracingIntegration; | ||
exports.reactRouterV6Instrumentation = reactrouterv6.reactRouterV6Instrumentation; | ||
exports.withSentryReactRouterV6Routing = reactrouterv6.withSentryReactRouterV6Routing; | ||
@@ -32,0 +28,0 @@ exports.wrapCreateBrowserRouter = reactrouterv6.wrapCreateBrowserRouter; |
@@ -63,4 +63,6 @@ Object.defineProperty(exports, '__esModule', { value: true }); | ||
op: constants.REACT_MOUNT_OP, | ||
origin: 'auto.ui.react.profiler', | ||
attributes: { 'ui.component_name': name }, | ||
attributes: { | ||
[core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.react.profiler', | ||
'ui.component_name': name, | ||
}, | ||
}); | ||
@@ -91,5 +93,5 @@ } | ||
op: constants.REACT_UPDATE_OP, | ||
origin: 'auto.ui.react.profiler', | ||
startTimestamp: now, | ||
startTime: now, | ||
attributes: { | ||
[core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.react.profiler', | ||
'ui.component_name': this.props.name, | ||
@@ -120,3 +122,3 @@ 'ui.react.changed_props': changedProps, | ||
if (this._mountSpan && includeRender) { | ||
const startTimestamp = core.spanToJSON(this._mountSpan).timestamp; | ||
const startTime = core.spanToJSON(this._mountSpan).timestamp; | ||
core.withActiveSpan(this._mountSpan, () => { | ||
@@ -127,5 +129,7 @@ const renderSpan = browser.startInactiveSpan({ | ||
op: constants.REACT_RENDER_OP, | ||
origin: 'auto.ui.react.profiler', | ||
startTimestamp, | ||
attributes: { 'ui.component_name': name }, | ||
startTime, | ||
attributes: { | ||
[core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.react.profiler', | ||
'ui.component_name': name, | ||
}, | ||
}); | ||
@@ -164,4 +168,4 @@ if (renderSpan) { | ||
const Wrapped = (props) => ( | ||
React__namespace.createElement(Profiler, { ...options, name: componentDisplayName, updateProps: props, __self: this, __source: {fileName: _jsxFileName, lineNumber: 159}} | ||
, React__namespace.createElement(WrappedComponent, { ...props, __self: this, __source: {fileName: _jsxFileName, lineNumber: 160}} ) | ||
React__namespace.createElement(Profiler, { ...options, name: componentDisplayName, updateProps: props, __self: this, __source: {fileName: _jsxFileName, lineNumber: 163}} | ||
, React__namespace.createElement(WrappedComponent, { ...props, __self: this, __source: {fileName: _jsxFileName, lineNumber: 164}} ) | ||
) | ||
@@ -201,4 +205,6 @@ ); | ||
op: constants.REACT_MOUNT_OP, | ||
origin: 'auto.ui.react.profiler', | ||
attributes: { 'ui.component_name': name }, | ||
attributes: { | ||
[core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.react.profiler', | ||
'ui.component_name': name, | ||
}, | ||
}); | ||
@@ -214,3 +220,3 @@ }); | ||
if (mountSpan && options.hasRenderSpan) { | ||
const startTimestamp = core.spanToJSON(mountSpan).timestamp; | ||
const startTime = core.spanToJSON(mountSpan).timestamp; | ||
const endTimestamp = utils.timestampInSeconds(); | ||
@@ -222,5 +228,7 @@ | ||
op: constants.REACT_RENDER_OP, | ||
origin: 'auto.ui.react.profiler', | ||
startTimestamp, | ||
attributes: { 'ui.component_name': name }, | ||
startTime, | ||
attributes: { | ||
[core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.react.profiler', | ||
'ui.component_name': name, | ||
}, | ||
}); | ||
@@ -227,0 +235,0 @@ if (renderSpan) { |
@@ -61,4 +61,3 @@ Object.defineProperty(exports, '__esModule', { value: true }); | ||
// eslint-disable-next-line deprecation/deprecation | ||
const instrumentation = reactRouterV4Instrumentation(history, routes, matchPath); | ||
const instrumentation = createReactRouterInstrumentation(history, 'reactrouter_v4', routes, matchPath); | ||
@@ -102,4 +101,3 @@ // Now instrument page load & navigation with correct settings | ||
// eslint-disable-next-line deprecation/deprecation | ||
const instrumentation = reactRouterV5Instrumentation(history, routes, matchPath); | ||
const instrumentation = createReactRouterInstrumentation(history, 'reactrouter_v5', routes, matchPath); | ||
@@ -113,24 +111,2 @@ // Now instrument page load & navigation with correct settings | ||
/** | ||
* @deprecated Use `browserTracingReactRouterV4()` instead. | ||
*/ | ||
function reactRouterV4Instrumentation( | ||
history, | ||
routes, | ||
matchPath, | ||
) { | ||
return createReactRouterInstrumentation(history, 'reactrouter_v4', routes, matchPath); | ||
} | ||
/** | ||
* @deprecated Use `browserTracingReactRouterV5()` instead. | ||
*/ | ||
function reactRouterV5Instrumentation( | ||
history, | ||
routes, | ||
matchPath, | ||
) { | ||
return createReactRouterInstrumentation(history, 'reactrouter_v5', routes, matchPath); | ||
} | ||
function createReactRouterInstrumentation( | ||
@@ -263,3 +239,3 @@ history, | ||
// https://github.com/DefinitelyTyped/DefinitelyTyped/blob/13dc4235c069e25fe7ee16e11f529d909f9f3ff8/types/react-router/index.d.ts#L154-L164 | ||
return React__namespace.createElement(Route, { ...props, __self: this, __source: {fileName: _jsxFileName, lineNumber: 277}} ); | ||
return React__namespace.createElement(Route, { ...props, __self: this, __source: {fileName: _jsxFileName, lineNumber: 253}} ); | ||
}; | ||
@@ -296,6 +272,4 @@ | ||
exports.reactRouterV4BrowserTracingIntegration = reactRouterV4BrowserTracingIntegration; | ||
exports.reactRouterV4Instrumentation = reactRouterV4Instrumentation; | ||
exports.reactRouterV5BrowserTracingIntegration = reactRouterV5BrowserTracingIntegration; | ||
exports.reactRouterV5Instrumentation = reactRouterV5Instrumentation; | ||
exports.withSentryRouting = withSentryRouting; | ||
//# sourceMappingURL=reactrouter.js.map |
@@ -39,3 +39,2 @@ Object.defineProperty(exports, '__esModule', { value: true }); | ||
// eslint-disable-next-line deprecation/deprecation | ||
const instrumentation = reactRouterV3Instrumentation(history, routes, match); | ||
@@ -57,10 +56,4 @@ | ||
* @param match `Router.match` utility | ||
* | ||
* @deprecated Use `reactRouterV3BrowserTracingIntegration()` instead | ||
*/ | ||
function reactRouterV3Instrumentation( | ||
history, | ||
routes, | ||
match, | ||
) { | ||
function reactRouterV3Instrumentation(history, routes, match) { | ||
return ( | ||
@@ -178,3 +171,2 @@ startTransaction, | ||
exports.reactRouterV3BrowserTracingIntegration = reactRouterV3BrowserTracingIntegration; | ||
exports.reactRouterV3Instrumentation = reactRouterV3Instrumentation; | ||
//# sourceMappingURL=reactrouterv3.js.map |
@@ -100,42 +100,2 @@ Object.defineProperty(exports, '__esModule', { value: true }); | ||
/** | ||
* @deprecated Use `reactRouterV6BrowserTracingIntegration()` instead. | ||
*/ | ||
function reactRouterV6Instrumentation( | ||
useEffect, | ||
useLocation, | ||
useNavigationType, | ||
createRoutesFromChildren, | ||
matchRoutes, | ||
stripBasename, | ||
) { | ||
return ( | ||
customStartTransaction, | ||
startTransactionOnPageLoad = true, | ||
startTransactionOnLocationChange = true, | ||
) => { | ||
const initPathName = browser.WINDOW && browser.WINDOW.location && browser.WINDOW.location.pathname; | ||
if (startTransactionOnPageLoad && initPathName) { | ||
activeTransaction = customStartTransaction({ | ||
name: initPathName, | ||
attributes: { | ||
[core.SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'url', | ||
[core.SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'pageload', | ||
[core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.pageload.react.reactrouter_v6', | ||
}, | ||
}); | ||
} | ||
_useEffect = useEffect; | ||
_useLocation = useLocation; | ||
_useNavigationType = useNavigationType; | ||
_matchRoutes = matchRoutes; | ||
_createRoutesFromChildren = createRoutesFromChildren; | ||
_stripBasename = stripBasename || false; | ||
_customStartTransaction = customStartTransaction; | ||
_startTransactionOnLocationChange = startTransactionOnLocationChange; | ||
}; | ||
} | ||
/** | ||
* Strip the basename from a pathname if exists. | ||
@@ -410,3 +370,2 @@ * | ||
exports.reactRouterV6BrowserTracingIntegration = reactRouterV6BrowserTracingIntegration; | ||
exports.reactRouterV6Instrumentation = reactRouterV6Instrumentation; | ||
exports.withSentryReactRouterV6Routing = withSentryReactRouterV6Routing; | ||
@@ -413,0 +372,0 @@ exports.wrapCreateBrowserRouter = wrapCreateBrowserRouter; |
@@ -56,3 +56,3 @@ Object.defineProperty(exports, '__esModule', { value: true }); | ||
if (typeof transformedAction !== 'undefined' && transformedAction !== null) { | ||
scope.addBreadcrumb({ | ||
core.addBreadcrumb({ | ||
category: ACTION_BREADCRUMB_CATEGORY, | ||
@@ -59,0 +59,0 @@ data: transformedAction, |
@@ -42,3 +42,3 @@ import { getClient, showReportDialog, withScope, captureException } from '@sentry/browser'; | ||
/** | ||
* A ErrorBoundary component that logs errors to Sentry. Requires React >= 16. | ||
* A ErrorBoundary component that logs errors to Sentry. | ||
* NOTE: If you are a Sentry user, and you are seeing this stack frame, it means the | ||
@@ -56,7 +56,6 @@ * Sentry React SDK ErrorBoundary caught an error invoking your application code. This | ||
const client = getClient(); | ||
if (client && client.on && props.showDialog) { | ||
if (client && props.showDialog) { | ||
this._openFallbackReportDialog = false; | ||
client.on('afterSendEvent', event => { | ||
if (!event.type && event.event_id === this._lastEventId) { | ||
// eslint-disable-next-line deprecation/deprecation | ||
if (!event.type && this._lastEventId && event.event_id === this._lastEventId) { | ||
showReportDialog({ ...props.dialogOptions, eventId: this._lastEventId }); | ||
@@ -184,4 +183,4 @@ } | ||
const Wrapped = (props) => ( | ||
React.createElement(ErrorBoundary, { ...errorBoundaryOptions, __self: this, __source: {fileName: _jsxFileName, lineNumber: 238}} | ||
, React.createElement(WrappedComponent, { ...props, __self: this, __source: {fileName: _jsxFileName, lineNumber: 239}} ) | ||
React.createElement(ErrorBoundary, { ...errorBoundaryOptions, __self: this, __source: {fileName: _jsxFileName, lineNumber: 237}} | ||
, React.createElement(WrappedComponent, { ...props, __self: this, __source: {fileName: _jsxFileName, lineNumber: 238}} ) | ||
) | ||
@@ -188,0 +187,0 @@ ); |
@@ -6,5 +6,5 @@ export * from '@sentry/browser'; | ||
export { createReduxEnhancer } from './redux.js'; | ||
export { reactRouterV3BrowserTracingIntegration, reactRouterV3Instrumentation } from './reactrouterv3.js'; | ||
export { reactRouterV4BrowserTracingIntegration, reactRouterV4Instrumentation, reactRouterV5BrowserTracingIntegration, reactRouterV5Instrumentation, withSentryRouting } from './reactrouter.js'; | ||
export { reactRouterV6BrowserTracingIntegration, reactRouterV6Instrumentation, withSentryReactRouterV6Routing, wrapCreateBrowserRouter, wrapUseRoutes } from './reactrouterv6.js'; | ||
export { reactRouterV3BrowserTracingIntegration } from './reactrouterv3.js'; | ||
export { reactRouterV4BrowserTracingIntegration, reactRouterV5BrowserTracingIntegration, withSentryRouting } from './reactrouter.js'; | ||
export { reactRouterV6BrowserTracingIntegration, withSentryReactRouterV6Routing, wrapCreateBrowserRouter, wrapUseRoutes } from './reactrouterv6.js'; | ||
//# sourceMappingURL=index.js.map |
import { startInactiveSpan } from '@sentry/browser'; | ||
import { withActiveSpan, spanToJSON } from '@sentry/core'; | ||
import { SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, withActiveSpan, spanToJSON } from '@sentry/core'; | ||
import { timestampInSeconds } from '@sentry/utils'; | ||
@@ -44,4 +44,6 @@ import hoistNonReactStatics from 'hoist-non-react-statics'; | ||
op: REACT_MOUNT_OP, | ||
origin: 'auto.ui.react.profiler', | ||
attributes: { 'ui.component_name': name }, | ||
attributes: { | ||
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.react.profiler', | ||
'ui.component_name': name, | ||
}, | ||
}); | ||
@@ -72,5 +74,5 @@ } | ||
op: REACT_UPDATE_OP, | ||
origin: 'auto.ui.react.profiler', | ||
startTimestamp: now, | ||
startTime: now, | ||
attributes: { | ||
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.react.profiler', | ||
'ui.component_name': this.props.name, | ||
@@ -101,3 +103,3 @@ 'ui.react.changed_props': changedProps, | ||
if (this._mountSpan && includeRender) { | ||
const startTimestamp = spanToJSON(this._mountSpan).timestamp; | ||
const startTime = spanToJSON(this._mountSpan).timestamp; | ||
withActiveSpan(this._mountSpan, () => { | ||
@@ -108,5 +110,7 @@ const renderSpan = startInactiveSpan({ | ||
op: REACT_RENDER_OP, | ||
origin: 'auto.ui.react.profiler', | ||
startTimestamp, | ||
attributes: { 'ui.component_name': name }, | ||
startTime, | ||
attributes: { | ||
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.react.profiler', | ||
'ui.component_name': name, | ||
}, | ||
}); | ||
@@ -145,4 +149,4 @@ if (renderSpan) { | ||
const Wrapped = (props) => ( | ||
React.createElement(Profiler, { ...options, name: componentDisplayName, updateProps: props, __self: this, __source: {fileName: _jsxFileName, lineNumber: 159}} | ||
, React.createElement(WrappedComponent, { ...props, __self: this, __source: {fileName: _jsxFileName, lineNumber: 160}} ) | ||
React.createElement(Profiler, { ...options, name: componentDisplayName, updateProps: props, __self: this, __source: {fileName: _jsxFileName, lineNumber: 163}} | ||
, React.createElement(WrappedComponent, { ...props, __self: this, __source: {fileName: _jsxFileName, lineNumber: 164}} ) | ||
) | ||
@@ -182,4 +186,6 @@ ); | ||
op: REACT_MOUNT_OP, | ||
origin: 'auto.ui.react.profiler', | ||
attributes: { 'ui.component_name': name }, | ||
attributes: { | ||
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.react.profiler', | ||
'ui.component_name': name, | ||
}, | ||
}); | ||
@@ -195,3 +201,3 @@ }); | ||
if (mountSpan && options.hasRenderSpan) { | ||
const startTimestamp = spanToJSON(mountSpan).timestamp; | ||
const startTime = spanToJSON(mountSpan).timestamp; | ||
const endTimestamp = timestampInSeconds(); | ||
@@ -203,5 +209,7 @@ | ||
op: REACT_RENDER_OP, | ||
origin: 'auto.ui.react.profiler', | ||
startTimestamp, | ||
attributes: { 'ui.component_name': name }, | ||
startTime, | ||
attributes: { | ||
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.ui.react.profiler', | ||
'ui.component_name': name, | ||
}, | ||
}); | ||
@@ -208,0 +216,0 @@ if (renderSpan) { |
import { browserTracingIntegration, startBrowserTracingPageLoadSpan, startBrowserTracingNavigationSpan, WINDOW } from '@sentry/browser'; | ||
import { SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, getActiveSpan, getRootSpan, spanToJSON } from '@sentry/core'; | ||
import { getActiveSpan, getRootSpan, spanToJSON, SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE } from '@sentry/core'; | ||
import hoistNonReactStatics from 'hoist-non-react-statics'; | ||
@@ -42,4 +42,3 @@ import * as React from 'react'; | ||
// eslint-disable-next-line deprecation/deprecation | ||
const instrumentation = reactRouterV4Instrumentation(history, routes, matchPath); | ||
const instrumentation = createReactRouterInstrumentation(history, 'reactrouter_v4', routes, matchPath); | ||
@@ -83,4 +82,3 @@ // Now instrument page load & navigation with correct settings | ||
// eslint-disable-next-line deprecation/deprecation | ||
const instrumentation = reactRouterV5Instrumentation(history, routes, matchPath); | ||
const instrumentation = createReactRouterInstrumentation(history, 'reactrouter_v5', routes, matchPath); | ||
@@ -94,24 +92,2 @@ // Now instrument page load & navigation with correct settings | ||
/** | ||
* @deprecated Use `browserTracingReactRouterV4()` instead. | ||
*/ | ||
function reactRouterV4Instrumentation( | ||
history, | ||
routes, | ||
matchPath, | ||
) { | ||
return createReactRouterInstrumentation(history, 'reactrouter_v4', routes, matchPath); | ||
} | ||
/** | ||
* @deprecated Use `browserTracingReactRouterV5()` instead. | ||
*/ | ||
function reactRouterV5Instrumentation( | ||
history, | ||
routes, | ||
matchPath, | ||
) { | ||
return createReactRouterInstrumentation(history, 'reactrouter_v5', routes, matchPath); | ||
} | ||
function createReactRouterInstrumentation( | ||
@@ -244,3 +220,3 @@ history, | ||
// https://github.com/DefinitelyTyped/DefinitelyTyped/blob/13dc4235c069e25fe7ee16e11f529d909f9f3ff8/types/react-router/index.d.ts#L154-L164 | ||
return React.createElement(Route, { ...props, __self: this, __source: {fileName: _jsxFileName, lineNumber: 277}} ); | ||
return React.createElement(Route, { ...props, __self: this, __source: {fileName: _jsxFileName, lineNumber: 253}} ); | ||
}; | ||
@@ -276,3 +252,3 @@ | ||
export { reactRouterV4BrowserTracingIntegration, reactRouterV4Instrumentation, reactRouterV5BrowserTracingIntegration, reactRouterV5Instrumentation, withSentryRouting }; | ||
export { reactRouterV4BrowserTracingIntegration, reactRouterV5BrowserTracingIntegration, withSentryRouting }; | ||
//# sourceMappingURL=reactrouter.js.map |
@@ -1,2 +0,2 @@ | ||
import { browserTracingIntegration, WINDOW, startBrowserTracingPageLoadSpan, startBrowserTracingNavigationSpan } from '@sentry/browser'; | ||
import { browserTracingIntegration, startBrowserTracingPageLoadSpan, startBrowserTracingNavigationSpan, WINDOW } from '@sentry/browser'; | ||
import { SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE } from '@sentry/core'; | ||
@@ -37,3 +37,2 @@ | ||
// eslint-disable-next-line deprecation/deprecation | ||
const instrumentation = reactRouterV3Instrumentation(history, routes, match); | ||
@@ -55,10 +54,4 @@ | ||
* @param match `Router.match` utility | ||
* | ||
* @deprecated Use `reactRouterV3BrowserTracingIntegration()` instead | ||
*/ | ||
function reactRouterV3Instrumentation( | ||
history, | ||
routes, | ||
match, | ||
) { | ||
function reactRouterV3Instrumentation(history, routes, match) { | ||
return ( | ||
@@ -175,3 +168,3 @@ startTransaction, | ||
export { reactRouterV3BrowserTracingIntegration, reactRouterV3Instrumentation }; | ||
export { reactRouterV3BrowserTracingIntegration }; | ||
//# sourceMappingURL=reactrouterv3.js.map |
@@ -81,42 +81,2 @@ import { browserTracingIntegration, WINDOW, startBrowserTracingPageLoadSpan, startBrowserTracingNavigationSpan } from '@sentry/browser'; | ||
/** | ||
* @deprecated Use `reactRouterV6BrowserTracingIntegration()` instead. | ||
*/ | ||
function reactRouterV6Instrumentation( | ||
useEffect, | ||
useLocation, | ||
useNavigationType, | ||
createRoutesFromChildren, | ||
matchRoutes, | ||
stripBasename, | ||
) { | ||
return ( | ||
customStartTransaction, | ||
startTransactionOnPageLoad = true, | ||
startTransactionOnLocationChange = true, | ||
) => { | ||
const initPathName = WINDOW && WINDOW.location && WINDOW.location.pathname; | ||
if (startTransactionOnPageLoad && initPathName) { | ||
activeTransaction = customStartTransaction({ | ||
name: initPathName, | ||
attributes: { | ||
[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'url', | ||
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'pageload', | ||
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.pageload.react.reactrouter_v6', | ||
}, | ||
}); | ||
} | ||
_useEffect = useEffect; | ||
_useLocation = useLocation; | ||
_useNavigationType = useNavigationType; | ||
_matchRoutes = matchRoutes; | ||
_createRoutesFromChildren = createRoutesFromChildren; | ||
_stripBasename = stripBasename || false; | ||
_customStartTransaction = customStartTransaction; | ||
_startTransactionOnLocationChange = startTransactionOnLocationChange; | ||
}; | ||
} | ||
/** | ||
* Strip the basename from a pathname if exists. | ||
@@ -390,3 +350,3 @@ * | ||
export { reactRouterV6BrowserTracingIntegration, reactRouterV6Instrumentation, withSentryReactRouterV6Routing, wrapCreateBrowserRouter, wrapUseRoutes }; | ||
export { reactRouterV6BrowserTracingIntegration, withSentryReactRouterV6Routing, wrapCreateBrowserRouter, wrapUseRoutes }; | ||
//# sourceMappingURL=reactrouterv6.js.map |
@@ -1,2 +0,2 @@ | ||
import { getGlobalScope, getCurrentScope, getClient } from '@sentry/core'; | ||
import { getGlobalScope, getCurrentScope, addBreadcrumb, getClient } from '@sentry/core'; | ||
import { addNonEnumerableProperty } from '@sentry/utils'; | ||
@@ -54,3 +54,3 @@ | ||
if (typeof transformedAction !== 'undefined' && transformedAction !== null) { | ||
scope.addBreadcrumb({ | ||
addBreadcrumb({ | ||
category: ACTION_BREADCRUMB_CATEGORY, | ||
@@ -57,0 +57,0 @@ data: transformedAction, |
{ | ||
"name": "@sentry/react", | ||
"version": "7.105.0", | ||
"version": "8.0.0-alpha.2", | ||
"description": "Official Sentry SDK for React.js", | ||
@@ -10,3 +10,3 @@ "repository": "git://github.com/getsentry/sentry-javascript.git", | ||
"engines": { | ||
"node": ">=8" | ||
"node": ">=14.8" | ||
}, | ||
@@ -33,10 +33,10 @@ "files": [ | ||
"dependencies": { | ||
"@sentry/browser": "7.105.0", | ||
"@sentry/core": "7.105.0", | ||
"@sentry/types": "7.105.0", | ||
"@sentry/utils": "7.105.0", | ||
"@sentry/browser": "8.0.0-alpha.2", | ||
"@sentry/core": "8.0.0-alpha.2", | ||
"@sentry/types": "8.0.0-alpha.2", | ||
"@sentry/utils": "8.0.0-alpha.2", | ||
"hoist-non-react-statics": "^3.3.2" | ||
}, | ||
"peerDependencies": { | ||
"react": "15.x || 16.x || 17.x || 18.x" | ||
"react": "16.x || 17.x || 18.x" | ||
}, | ||
@@ -43,0 +43,0 @@ "devDependencies": { |
@@ -23,3 +23,3 @@ <p align="center"> | ||
import React from 'react'; | ||
import ReactDOM from "react-dom"; | ||
import ReactDOM from 'react-dom'; | ||
import * as Sentry from '@sentry/react'; | ||
@@ -43,5 +43,6 @@ | ||
`@sentry/react` exports an ErrorBoundary component that will automatically send Javascript errors from inside a | ||
component tree to Sentry, and set a fallback UI. Requires React version >= 16. | ||
component tree to Sentry, and set a fallback UI. | ||
> app.js | ||
```javascript | ||
@@ -52,5 +53,3 @@ import React from 'react'; | ||
function FallbackComponent() { | ||
return ( | ||
<div>An error has occured</div> | ||
) | ||
return <div>An error has occured</div>; | ||
} | ||
@@ -64,3 +63,3 @@ | ||
</Sentry.ErrorBoundary> | ||
) | ||
); | ||
} | ||
@@ -74,7 +73,8 @@ } | ||
`@sentry/react` exports a Profiler component that leverages the tracing features to add React-related | ||
spans to transactions. If tracing is not enabled, the Profiler component will not work. The Profiler | ||
tracks component mount, render duration and updates. Requires React version >= 15. | ||
`@sentry/react` exports a Profiler component that leverages the tracing features to add React-related spans to | ||
transactions. If tracing is not enabled, the Profiler component will not work. The Profiler tracks component mount, | ||
render duration and updates. | ||
> app.js | ||
```javascript | ||
@@ -91,3 +91,3 @@ import React from 'react'; | ||
</FancyComponent> | ||
) | ||
); | ||
} | ||
@@ -94,0 +94,0 @@ } |
@@ -1,2 +0,3 @@ | ||
import { ReportDialogOptions, Scope } from '@sentry/browser'; | ||
import { ReportDialogOptions } from '@sentry/browser'; | ||
import { Scope } from '@sentry/types'; | ||
import * as React from 'react'; | ||
@@ -50,3 +51,3 @@ export declare function isAtLeastReact17(version: string): boolean; | ||
/** | ||
* A ErrorBoundary component that logs errors to Sentry. Requires React >= 16. | ||
* A ErrorBoundary component that logs errors to Sentry. | ||
* NOTE: If you are a Sentry user, and you are seeing this stack frame, it means the | ||
@@ -53,0 +54,0 @@ * Sentry React SDK ErrorBoundary caught an error invoking your application code. This |
@@ -7,5 +7,5 @@ export * from '@sentry/browser'; | ||
export { createReduxEnhancer } from './redux'; | ||
export { reactRouterV3Instrumentation, reactRouterV3BrowserTracingIntegration, } from './reactrouterv3'; | ||
export { reactRouterV4Instrumentation, reactRouterV5Instrumentation, withSentryRouting, reactRouterV4BrowserTracingIntegration, reactRouterV5BrowserTracingIntegration, } from './reactrouter'; | ||
export { reactRouterV6Instrumentation, reactRouterV6BrowserTracingIntegration, withSentryReactRouterV6Routing, wrapUseRoutes, wrapCreateBrowserRouter, } from './reactrouterv6'; | ||
export { reactRouterV3BrowserTracingIntegration } from './reactrouterv3'; | ||
export { withSentryRouting, reactRouterV4BrowserTracingIntegration, reactRouterV5BrowserTracingIntegration, } from './reactrouter'; | ||
export { reactRouterV6BrowserTracingIntegration, withSentryReactRouterV6Routing, wrapUseRoutes, wrapCreateBrowserRouter, } from './reactrouterv6'; | ||
//# sourceMappingURL=index.d.ts.map |
import { browserTracingIntegration } from '@sentry/browser'; | ||
import { Integration } from '@sentry/types'; | ||
import * as React from 'react'; | ||
import { Action, Location, ReactRouterInstrumentation } from './types'; | ||
import { Action, Location } from './types'; | ||
type Match = { | ||
@@ -38,12 +38,4 @@ path: string; | ||
export declare function reactRouterV5BrowserTracingIntegration(options: Parameters<typeof browserTracingIntegration>[0] & ReactRouterOptions): Integration; | ||
/** | ||
* @deprecated Use `browserTracingReactRouterV4()` instead. | ||
*/ | ||
export declare function reactRouterV4Instrumentation(history: RouterHistory, routes?: RouteConfig[], matchPath?: MatchPath): ReactRouterInstrumentation; | ||
/** | ||
* @deprecated Use `browserTracingReactRouterV5()` instead. | ||
*/ | ||
export declare function reactRouterV5Instrumentation(history: RouterHistory, routes?: RouteConfig[], matchPath?: MatchPath): ReactRouterInstrumentation; | ||
export declare function withSentryRouting<P extends Record<string, any>, R extends React.ComponentType<P>>(Route: R): R; | ||
export {}; | ||
//# sourceMappingURL=reactrouter.d.ts.map |
import { browserTracingIntegration } from '@sentry/browser'; | ||
import { Integration } from '@sentry/types'; | ||
import { Location, ReactRouterInstrumentation } from './types'; | ||
import { Location } from './types'; | ||
type HistoryV3 = { | ||
@@ -28,14 +28,3 @@ location?: Location; | ||
export declare function reactRouterV3BrowserTracingIntegration(options: Parameters<typeof browserTracingIntegration>[0] & ReactRouterOptions): Integration; | ||
/** | ||
* Creates routing instrumentation for React Router v3 | ||
* Works for React Router >= 3.2.0 and < 4.0.0 | ||
* | ||
* @param history object from the `history` library | ||
* @param routes a list of all routes, should be | ||
* @param match `Router.match` utility | ||
* | ||
* @deprecated Use `reactRouterV3BrowserTracingIntegration()` instead | ||
*/ | ||
export declare function reactRouterV3Instrumentation(history: HistoryV3, routes: Route[], match: Match): ReactRouterInstrumentation; | ||
export {}; | ||
//# sourceMappingURL=reactrouterv3.d.ts.map |
@@ -1,2 +0,3 @@ | ||
import type { ReportDialogOptions, Scope } from '@sentry/browser'; | ||
import type { ReportDialogOptions } from '@sentry/browser'; | ||
import type { Scope } from '@sentry/types'; | ||
import * as React from 'react'; | ||
@@ -50,3 +51,3 @@ export declare function isAtLeastReact17(version: string): boolean; | ||
/** | ||
* A ErrorBoundary component that logs errors to Sentry. Requires React >= 16. | ||
* A ErrorBoundary component that logs errors to Sentry. | ||
* NOTE: If you are a Sentry user, and you are seeing this stack frame, it means the | ||
@@ -53,0 +54,0 @@ * Sentry React SDK ErrorBoundary caught an error invoking your application code. This |
@@ -7,5 +7,5 @@ export * from '@sentry/browser'; | ||
export { createReduxEnhancer } from './redux'; | ||
export { reactRouterV3Instrumentation, reactRouterV3BrowserTracingIntegration, } from './reactrouterv3'; | ||
export { reactRouterV4Instrumentation, reactRouterV5Instrumentation, withSentryRouting, reactRouterV4BrowserTracingIntegration, reactRouterV5BrowserTracingIntegration, } from './reactrouter'; | ||
export { reactRouterV6Instrumentation, reactRouterV6BrowserTracingIntegration, withSentryReactRouterV6Routing, wrapUseRoutes, wrapCreateBrowserRouter, } from './reactrouterv6'; | ||
export { reactRouterV3BrowserTracingIntegration } from './reactrouterv3'; | ||
export { withSentryRouting, reactRouterV4BrowserTracingIntegration, reactRouterV5BrowserTracingIntegration, } from './reactrouter'; | ||
export { reactRouterV6BrowserTracingIntegration, withSentryReactRouterV6Routing, wrapUseRoutes, wrapCreateBrowserRouter, } from './reactrouterv6'; | ||
//# sourceMappingURL=index.d.ts.map |
import { browserTracingIntegration } from '@sentry/browser'; | ||
import type { Integration } from '@sentry/types'; | ||
import * as React from 'react'; | ||
import type { Action, Location, ReactRouterInstrumentation } from './types'; | ||
import type { Action, Location } from './types'; | ||
type Match = { | ||
@@ -38,12 +38,4 @@ path: string; | ||
export declare function reactRouterV5BrowserTracingIntegration(options: Parameters<typeof browserTracingIntegration>[0] & ReactRouterOptions): Integration; | ||
/** | ||
* @deprecated Use `browserTracingReactRouterV4()` instead. | ||
*/ | ||
export declare function reactRouterV4Instrumentation(history: RouterHistory, routes?: RouteConfig[], matchPath?: MatchPath): ReactRouterInstrumentation; | ||
/** | ||
* @deprecated Use `browserTracingReactRouterV5()` instead. | ||
*/ | ||
export declare function reactRouterV5Instrumentation(history: RouterHistory, routes?: RouteConfig[], matchPath?: MatchPath): ReactRouterInstrumentation; | ||
export declare function withSentryRouting<P extends Record<string, any>, R extends React.ComponentType<P>>(Route: R): R; | ||
export {}; | ||
//# sourceMappingURL=reactrouter.d.ts.map |
import { browserTracingIntegration } from '@sentry/browser'; | ||
import type { Integration } from '@sentry/types'; | ||
import type { Location, ReactRouterInstrumentation } from './types'; | ||
import type { Location } from './types'; | ||
type HistoryV3 = { | ||
@@ -28,14 +28,3 @@ location?: Location; | ||
export declare function reactRouterV3BrowserTracingIntegration(options: Parameters<typeof browserTracingIntegration>[0] & ReactRouterOptions): Integration; | ||
/** | ||
* Creates routing instrumentation for React Router v3 | ||
* Works for React Router >= 3.2.0 and < 4.0.0 | ||
* | ||
* @param history object from the `history` library | ||
* @param routes a list of all routes, should be | ||
* @param match `Router.match` utility | ||
* | ||
* @deprecated Use `reactRouterV3BrowserTracingIntegration()` instead | ||
*/ | ||
export declare function reactRouterV3Instrumentation(history: HistoryV3, routes: Route[], match: Match): ReactRouterInstrumentation; | ||
export {}; | ||
//# sourceMappingURL=reactrouterv3.d.ts.map |
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
328734
3240
1
+ Added@sentry-internal/feedback@8.0.0-alpha.2(transitive)
+ Added@sentry-internal/replay-canvas@8.0.0-alpha.2(transitive)
+ Added@sentry-internal/tracing@8.0.0-alpha.2(transitive)
+ Added@sentry/browser@8.0.0-alpha.2(transitive)
+ Added@sentry/core@8.0.0-alpha.2(transitive)
+ Added@sentry/replay@8.0.0-alpha.2(transitive)
+ Added@sentry/types@8.0.0-alpha.2(transitive)
+ Added@sentry/utils@8.0.0-alpha.2(transitive)
- Removed@sentry-internal/feedback@7.105.0(transitive)
- Removed@sentry-internal/replay-canvas@7.105.0(transitive)
- Removed@sentry-internal/tracing@7.105.0(transitive)
- Removed@sentry/browser@7.105.0(transitive)
- Removed@sentry/core@7.105.0(transitive)
- Removed@sentry/replay@7.105.0(transitive)
- Removed@sentry/types@7.105.0(transitive)
- Removed@sentry/utils@7.105.0(transitive)
Updated@sentry/core@8.0.0-alpha.2
Updated@sentry/types@8.0.0-alpha.2
Updated@sentry/utils@8.0.0-alpha.2