@appsignal/react
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -15,2 +15,13 @@ "use strict"; | ||
})(); | ||
var __assign = (this && this.__assign) || function () { | ||
__assign = Object.assign || function(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) | ||
t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
return __assign.apply(this, arguments); | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
@@ -33,8 +44,7 @@ return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
ErrorBoundary.prototype.componentDidCatch = function (error) { | ||
var _a = this.props, appsignal = _a.instance, action = _a.action; | ||
var _a = this.props, appsignal = _a.instance, action = _a.action, _b = _a.tags, tags = _b === void 0 ? {} : _b; | ||
var span = appsignal.createSpan(); | ||
span | ||
.setAction(action !== "" ? action : undefined) | ||
.setError(error) | ||
.setTags({ framework: "React" }); | ||
span.setError(error).setTags(__assign({ framework: "React" }, tags)); | ||
if (action && action !== "") | ||
span.setAction(action); | ||
appsignal.send(span); | ||
@@ -41,0 +51,0 @@ if (!this.state.error) |
@@ -15,2 +15,13 @@ "use strict"; | ||
})(); | ||
var __assign = (this && this.__assign) || function () { | ||
__assign = Object.assign || function(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) | ||
t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
return __assign.apply(this, arguments); | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
@@ -30,7 +41,6 @@ return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
LegacyBoundary.prototype.unstable_handleError = function (error) { | ||
var _a = this.props, appsignal = _a.instance, action = _a.action; | ||
var _a = this.props, appsignal = _a.instance, action = _a.action, _b = _a.tags, tags = _b === void 0 ? {} : _b; | ||
var name = error.name, message = error.message, stack = error.stack; | ||
var span = appsignal.createSpan(); | ||
span | ||
.setAction(action !== "" ? action : undefined) | ||
.setError({ | ||
@@ -41,3 +51,5 @@ name: name, | ||
}) | ||
.setTags({ framework: "Legacy React" }); | ||
.setTags(__assign({ framework: "Legacy React" }, tags)); | ||
if (action && action !== "") | ||
span.setAction(action); | ||
appsignal.send(span); | ||
@@ -44,0 +56,0 @@ this.setState({ error: error }); |
/// <reference types="react" /> | ||
import { JSClient } from "@appsignal/types"; | ||
export declare type Props = { | ||
instance: any; | ||
instance: JSClient; | ||
action?: string; | ||
@@ -5,0 +6,0 @@ children: React.ReactNode; |
@@ -14,2 +14,13 @@ var __extends = (this && this.__extends) || (function () { | ||
})(); | ||
var __assign = (this && this.__assign) || function () { | ||
__assign = Object.assign || function(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) | ||
t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
return __assign.apply(this, arguments); | ||
}; | ||
import React from "react"; | ||
@@ -27,8 +38,7 @@ var ErrorBoundary = (function (_super) { | ||
ErrorBoundary.prototype.componentDidCatch = function (error) { | ||
var _a = this.props, appsignal = _a.instance, action = _a.action; | ||
var _a = this.props, appsignal = _a.instance, action = _a.action, _b = _a.tags, tags = _b === void 0 ? {} : _b; | ||
var span = appsignal.createSpan(); | ||
span | ||
.setAction(action !== "" ? action : undefined) | ||
.setError(error) | ||
.setTags({ framework: "React" }); | ||
span.setError(error).setTags(__assign({ framework: "React" }, tags)); | ||
if (action && action !== "") | ||
span.setAction(action); | ||
appsignal.send(span); | ||
@@ -35,0 +45,0 @@ if (!this.state.error) |
@@ -14,2 +14,13 @@ var __extends = (this && this.__extends) || (function () { | ||
})(); | ||
var __assign = (this && this.__assign) || function () { | ||
__assign = Object.assign || function(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) | ||
t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
return __assign.apply(this, arguments); | ||
}; | ||
import React from "react"; | ||
@@ -24,7 +35,6 @@ var LegacyBoundary = (function (_super) { | ||
LegacyBoundary.prototype.unstable_handleError = function (error) { | ||
var _a = this.props, appsignal = _a.instance, action = _a.action; | ||
var _a = this.props, appsignal = _a.instance, action = _a.action, _b = _a.tags, tags = _b === void 0 ? {} : _b; | ||
var name = error.name, message = error.message, stack = error.stack; | ||
var span = appsignal.createSpan(); | ||
span | ||
.setAction(action !== "" ? action : undefined) | ||
.setError({ | ||
@@ -35,3 +45,5 @@ name: name, | ||
}) | ||
.setTags({ framework: "Legacy React" }); | ||
.setTags(__assign({ framework: "Legacy React" }, tags)); | ||
if (action && action !== "") | ||
span.setAction(action); | ||
appsignal.send(span); | ||
@@ -38,0 +50,0 @@ this.setState({ error: error }); |
/// <reference types="react" /> | ||
import { JSClient } from "@appsignal/types"; | ||
export declare type Props = { | ||
instance: any; | ||
instance: JSClient; | ||
action?: string; | ||
@@ -5,0 +6,0 @@ children: React.ReactNode; |
{ | ||
"name": "@appsignal/react", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"main": "dist/cjs/index.js", | ||
@@ -21,2 +21,5 @@ "module": "dist/esm/index.js", | ||
}, | ||
"dependencies": { | ||
"@appsignal/types": "^2.0.0" | ||
}, | ||
"peerDependencies": { | ||
@@ -28,3 +31,3 @@ "react": "^16.8.6" | ||
}, | ||
"gitHead": "f2c246685d6f01420d6d10a40a31322cdc08f293" | ||
"gitHead": "f6c4f76fa18eae685f8f5690060793627b8a319e" | ||
} |
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
28064
342
2
+ Added@appsignal/types@^2.0.0
+ Added@appsignal/types@2.1.7(transitive)