@honeybadger-io/react 2.0.1 → 4.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -24
- package/dist/DefaultErrorComponent.d.ts +2 -2
- package/dist/HoneybadgerErrorBoundary.d.ts +5 -5
- package/dist/honeybadger-react.cjs.js +11 -12
- package/dist/honeybadger-react.cjs.js.map +1 -1
- package/dist/honeybadger-react.esm.js +4 -3
- package/dist/honeybadger-react.esm.js.map +1 -1
- package/dist/honeybadger-react.js +12 -13
- package/dist/honeybadger-react.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/package.json +23 -26
- package/LICENSE +0 -21
package/README.md
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
# Honeybadger React.js Integration
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+

|
|
4
4
|
[](https://badge.fury.io/js/%40honeybadger-io%2Freact)
|
|
5
|
-
|
|
5
|
+
[](https://www.npmjs.com/package/@honeybadger-io/react)
|
|
6
|
+
[](https://www.npmjs.com/package/@honeybadger-io/react)
|
|
7
|
+
|
|
8
|
+
> [React.js Integration for Honeybadger.io](https://www.honeybadger.io/for/javascript/?utm_source=github&utm_medium=readme&utm_campaign=react&utm_content=React.js+integration+for+Honeybadger.io)
|
|
6
9
|
|
|
7
10
|
## Documentation and Support
|
|
8
11
|
|
|
@@ -56,18 +59,6 @@ This will serve the demo app with hot reload at localhost:3000
|
|
|
56
59
|
|
|
57
60
|
For a detailed explanation on how hot reloading works, check out the [documentation](https://webpack.js.org/concepts/hot-module-replacement/).
|
|
58
61
|
|
|
59
|
-
## Changelog
|
|
60
|
-
|
|
61
|
-
See https://github.com/honeybadger-io/honeybadger-react/blob/master/CHANGELOG.md
|
|
62
|
-
|
|
63
|
-
## Contributing
|
|
64
|
-
|
|
65
|
-
1. Fork it.
|
|
66
|
-
2. Create a topic branch `git checkout -b my_branch`
|
|
67
|
-
3. Commit your changes `git commit -am "Boom"`
|
|
68
|
-
3. Push to your branch `git push origin my_branch`
|
|
69
|
-
4. Send a [pull request](https://github.com/honeybadger-io/honeybadger-react/pulls)
|
|
70
|
-
|
|
71
62
|
## Development
|
|
72
63
|
|
|
73
64
|
``` bash
|
|
@@ -84,15 +75,6 @@ npm test
|
|
|
84
75
|
npm run start
|
|
85
76
|
```
|
|
86
77
|
|
|
87
|
-
## Releasing
|
|
88
|
-
|
|
89
|
-
1. With a clean working tree, use `npm version [new version]` to bump the version,
|
|
90
|
-
commit the changes, tag the release, and push to GitHub. See `npm help version`
|
|
91
|
-
for documentation.
|
|
92
|
-
2. To publish the release, use `npm publish`. See `npm help publish` for
|
|
93
|
-
documentation.
|
|
94
|
-
|
|
95
|
-
|
|
96
78
|
### License
|
|
97
79
|
|
|
98
|
-
|
|
80
|
+
This package is MIT licensed. See the [MIT-LICENSE](./MIT-LICENSE) file in this folder for details.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React, { Component, ReactNode } from 'react';
|
|
2
|
-
import
|
|
3
|
-
import { DefaultErrorComponentProps } from
|
|
4
|
-
import PropTypes from
|
|
2
|
+
import Honeybadger from '@honeybadger-io/js/dist/browser/honeybadger';
|
|
3
|
+
import { DefaultErrorComponentProps } from './DefaultErrorComponent';
|
|
4
|
+
import PropTypes from 'prop-types';
|
|
5
5
|
interface HoneybadgerErrorBoundaryProps {
|
|
6
|
-
honeybadger:
|
|
6
|
+
honeybadger: typeof Honeybadger;
|
|
7
7
|
ErrorComponent?: ReactNode;
|
|
8
8
|
}
|
|
9
9
|
interface HoneybadgerErrorBoundaryState extends DefaultErrorComponentProps {
|
|
@@ -13,7 +13,7 @@ export default class HoneybadgerErrorBoundary extends Component<HoneybadgerError
|
|
|
13
13
|
static propTypes: {
|
|
14
14
|
honeybadger: PropTypes.Validator<object>;
|
|
15
15
|
children: PropTypes.Requireable<PropTypes.ReactElementLike>;
|
|
16
|
-
ErrorComponent: PropTypes.Requireable<PropTypes.ReactElementLike | ((...args: any[]) => any)
|
|
16
|
+
ErrorComponent: PropTypes.Requireable<NonNullable<PropTypes.ReactElementLike | ((...args: any[]) => any) | null | undefined>>;
|
|
17
17
|
};
|
|
18
18
|
constructor(props: HoneybadgerErrorBoundaryProps);
|
|
19
19
|
static getDerivedStateFromError(error: Error): HoneybadgerErrorBoundaryState;
|
|
@@ -13,14 +13,15 @@ var js__default = /*#__PURE__*/_interopDefaultLegacy(js);
|
|
|
13
13
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
14
14
|
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
15
15
|
|
|
16
|
+
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
16
17
|
class DefaultErrorComponent extends React.Component {
|
|
17
18
|
render() {
|
|
18
|
-
return (jsxRuntime.jsxs("div",
|
|
19
|
+
return (jsxRuntime.jsxs("div", { className: 'error', children: [jsxRuntime.jsx("div", { children: "An Error Occurred" }), jsxRuntime.jsx("div", { children: JSON.stringify(this.props.error, null, 2) }), jsxRuntime.jsx("div", { children: this.props.info ? JSON.stringify(this.props.info, null, 2) : '' })] }));
|
|
19
20
|
}
|
|
20
21
|
}
|
|
21
22
|
DefaultErrorComponent.propTypes = {
|
|
22
|
-
error: PropTypes__default[
|
|
23
|
-
info: PropTypes__default[
|
|
23
|
+
error: PropTypes__default["default"].object,
|
|
24
|
+
info: PropTypes__default["default"].object
|
|
24
25
|
};
|
|
25
26
|
|
|
26
27
|
class HoneybadgerErrorBoundary extends React.Component {
|
|
@@ -41,26 +42,24 @@ class HoneybadgerErrorBoundary extends React.Component {
|
|
|
41
42
|
}
|
|
42
43
|
getErrorComponent() {
|
|
43
44
|
return this.props.ErrorComponent
|
|
44
|
-
? React__default[
|
|
45
|
-
: jsxRuntime.jsx(DefaultErrorComponent,
|
|
45
|
+
? React__default["default"].createElement(this.props.ErrorComponent, this.state)
|
|
46
|
+
: jsxRuntime.jsx(DefaultErrorComponent, { ...this.state });
|
|
46
47
|
}
|
|
47
48
|
render() {
|
|
48
49
|
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: this.state.errorOccurred
|
|
49
50
|
? this.getErrorComponent()
|
|
50
|
-
: this.props.children }
|
|
51
|
+
: this.props.children }));
|
|
51
52
|
}
|
|
52
53
|
}
|
|
53
54
|
HoneybadgerErrorBoundary.propTypes = {
|
|
54
|
-
honeybadger: PropTypes__default[
|
|
55
|
-
children: PropTypes__default[
|
|
56
|
-
ErrorComponent: PropTypes__default[
|
|
55
|
+
honeybadger: PropTypes__default["default"].object.isRequired,
|
|
56
|
+
children: PropTypes__default["default"].element,
|
|
57
|
+
ErrorComponent: PropTypes__default["default"].oneOfType([PropTypes__default["default"].element, PropTypes__default["default"].func])
|
|
57
58
|
};
|
|
58
59
|
|
|
59
60
|
Object.defineProperty(exports, 'Honeybadger', {
|
|
60
61
|
enumerable: true,
|
|
61
|
-
get: function () {
|
|
62
|
-
return js__default['default'];
|
|
63
|
-
}
|
|
62
|
+
get: function () { return js__default["default"]; }
|
|
64
63
|
});
|
|
65
64
|
exports.HoneybadgerErrorBoundary = HoneybadgerErrorBoundary;
|
|
66
65
|
//# sourceMappingURL=honeybadger-react.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"honeybadger-react.cjs.js","sources":["../../
|
|
1
|
+
{"version":3,"file":"honeybadger-react.cjs.js","sources":["../../build/DefaultErrorComponent.js","../../build/HoneybadgerErrorBoundary.js"],"sourcesContent":["import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { Component } from 'react';\nimport PropTypes from 'prop-types';\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport default class DefaultErrorComponent extends Component {\n render() {\n return (_jsxs(\"div\", { className: 'error', children: [_jsx(\"div\", { children: \"An Error Occurred\" }), _jsx(\"div\", { children: JSON.stringify(this.props.error, null, 2) }), _jsx(\"div\", { children: this.props.info ? JSON.stringify(this.props.info, null, 2) : '' })] }));\n }\n}\nDefaultErrorComponent.propTypes = {\n error: PropTypes.object,\n info: PropTypes.object\n};\n//# sourceMappingURL=DefaultErrorComponent.js.map","import { jsx as _jsx, Fragment as _Fragment } from \"react/jsx-runtime\";\nimport React, { Component } from 'react';\nimport DefaultErrorComponent from './DefaultErrorComponent';\nimport PropTypes from 'prop-types';\nexport default class HoneybadgerErrorBoundary extends Component {\n constructor(props) {\n super(props);\n this.state = {\n error: null,\n info: null,\n errorOccurred: false\n };\n }\n static getDerivedStateFromError(error) {\n return { error: error, errorOccurred: true, info: null };\n }\n componentDidCatch(error, errorInfo) {\n this.setState({ errorOccurred: true, error: error, info: errorInfo });\n this.props.honeybadger.notify(error, { context: errorInfo });\n }\n getErrorComponent() {\n return this.props.ErrorComponent\n ? React.createElement(this.props.ErrorComponent, this.state)\n : _jsx(DefaultErrorComponent, { ...this.state });\n }\n render() {\n return (_jsx(_Fragment, { children: this.state.errorOccurred\n ? this.getErrorComponent()\n : this.props.children }));\n }\n}\nHoneybadgerErrorBoundary.propTypes = {\n honeybadger: PropTypes.object.isRequired,\n children: PropTypes.element,\n ErrorComponent: PropTypes.oneOfType([PropTypes.element, PropTypes.func])\n};\n//# sourceMappingURL=HoneybadgerErrorBoundary.js.map"],"names":["Component","_jsxs","_jsx","PropTypes","React","_Fragment"],"mappings":";;;;;;;;;;;;;;;AAGA;AACe,MAAM,qBAAqB,SAASA,eAAS,CAAC;AAC7D,IAAI,MAAM,GAAG;AACb,QAAQ,QAAQC,eAAK,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,CAACC,cAAI,CAAC,KAAK,EAAE,EAAE,QAAQ,EAAE,mBAAmB,EAAE,CAAC,EAAEA,cAAI,CAAC,KAAK,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAEA,cAAI,CAAC,KAAK,EAAE,EAAE,QAAQ,EAA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KAAK,CAAC;AACxE,cAAcF,cAAI,CAAC,qBAAqB,EAAE,EAAE,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;AAC7D,KAAK;AACL,IAAI,MAAM,GAAG;AACb,QAAQ,QAAQA,cAAI,CAACG,mBAAS,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,aAAa;AACpE,kBAAkB,IAAI,CAAC,iBAAiB,EAAE;AAC1C,kBAAkB,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,EAAE;AAC1C,KAAK;AACL,CAAC;AACD,wBAAwB,CAAC,SAAS,GAAG;AACrC,IAAI,WAAW,EAAEF,6BAAS,CAAC,MAAM,CAAC,UAAU;AAC5C,IAAI,QAAQ,EAAEA,6BAAS,CAAC,OAAO;AAC/B,IAAI,cAAc,EAAEA,6BAAS,CAAC,SAAS,CAAC,CAACA,6BAAS,CAAC,OAAO,EAAEA,6BAAS,CAAC,IAAI,CAAC,CAAC;AAC5E,CAAC;;;;;;;;"}
|
|
@@ -3,9 +3,10 @@ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
|
3
3
|
import React, { Component } from 'react';
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
|
|
6
|
+
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
6
7
|
class DefaultErrorComponent extends Component {
|
|
7
8
|
render() {
|
|
8
|
-
return (jsxs("div",
|
|
9
|
+
return (jsxs("div", { className: 'error', children: [jsx("div", { children: "An Error Occurred" }), jsx("div", { children: JSON.stringify(this.props.error, null, 2) }), jsx("div", { children: this.props.info ? JSON.stringify(this.props.info, null, 2) : '' })] }));
|
|
9
10
|
}
|
|
10
11
|
}
|
|
11
12
|
DefaultErrorComponent.propTypes = {
|
|
@@ -32,12 +33,12 @@ class HoneybadgerErrorBoundary extends Component {
|
|
|
32
33
|
getErrorComponent() {
|
|
33
34
|
return this.props.ErrorComponent
|
|
34
35
|
? React.createElement(this.props.ErrorComponent, this.state)
|
|
35
|
-
: jsx(DefaultErrorComponent,
|
|
36
|
+
: jsx(DefaultErrorComponent, { ...this.state });
|
|
36
37
|
}
|
|
37
38
|
render() {
|
|
38
39
|
return (jsx(Fragment, { children: this.state.errorOccurred
|
|
39
40
|
? this.getErrorComponent()
|
|
40
|
-
: this.props.children }
|
|
41
|
+
: this.props.children }));
|
|
41
42
|
}
|
|
42
43
|
}
|
|
43
44
|
HoneybadgerErrorBoundary.propTypes = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"honeybadger-react.esm.js","sources":["../../
|
|
1
|
+
{"version":3,"file":"honeybadger-react.esm.js","sources":["../../build/DefaultErrorComponent.js","../../build/HoneybadgerErrorBoundary.js"],"sourcesContent":["import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { Component } from 'react';\nimport PropTypes from 'prop-types';\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport default class DefaultErrorComponent extends Component {\n render() {\n return (_jsxs(\"div\", { className: 'error', children: [_jsx(\"div\", { children: \"An Error Occurred\" }), _jsx(\"div\", { children: JSON.stringify(this.props.error, null, 2) }), _jsx(\"div\", { children: this.props.info ? JSON.stringify(this.props.info, null, 2) : '' })] }));\n }\n}\nDefaultErrorComponent.propTypes = {\n error: PropTypes.object,\n info: PropTypes.object\n};\n//# sourceMappingURL=DefaultErrorComponent.js.map","import { jsx as _jsx, Fragment as _Fragment } from \"react/jsx-runtime\";\nimport React, { Component } from 'react';\nimport DefaultErrorComponent from './DefaultErrorComponent';\nimport PropTypes from 'prop-types';\nexport default class HoneybadgerErrorBoundary extends Component {\n constructor(props) {\n super(props);\n this.state = {\n error: null,\n info: null,\n errorOccurred: false\n };\n }\n static getDerivedStateFromError(error) {\n return { error: error, errorOccurred: true, info: null };\n }\n componentDidCatch(error, errorInfo) {\n this.setState({ errorOccurred: true, error: error, info: errorInfo });\n this.props.honeybadger.notify(error, { context: errorInfo });\n }\n getErrorComponent() {\n return this.props.ErrorComponent\n ? React.createElement(this.props.ErrorComponent, this.state)\n : _jsx(DefaultErrorComponent, { ...this.state });\n }\n render() {\n return (_jsx(_Fragment, { children: this.state.errorOccurred\n ? this.getErrorComponent()\n : this.props.children }));\n }\n}\nHoneybadgerErrorBoundary.propTypes = {\n honeybadger: PropTypes.object.isRequired,\n children: PropTypes.element,\n ErrorComponent: PropTypes.oneOfType([PropTypes.element, PropTypes.func])\n};\n//# sourceMappingURL=HoneybadgerErrorBoundary.js.map"],"names":["_jsxs","_jsx","_Fragment"],"mappings":";;;;;AAGA;AACe,MAAM,qBAAqB,SAAS,SAAS,CAAC;AAC7D,IAAI,MAAM,GAAG;AACb,QAAQ,QAAQA,IAAK,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,CAACC,GAAI,CAAC,KAAK,EAAE,EAAE,QAAQ,EAAE,mBAAmB,EAAE,CAAC,EAAEA,GAAI,CAAC,KAAK,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAEA,GAAI,CAAC,KAAK,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE;AACpR,KAAK;AACL,CAAC;AACD,qBAAqB,CAAC,SAAS,GAAG;AAClC,IAAI,KAAK,EAAE,SAAS,CAAC,MAAM;AAC3B,IAAI,IAAI,EAAE,SAAS,CAAC,MAAM;AAC1B,CAAC;;ACRc,MAAM,wBAAwB,SAAS,SAAS,CAAC;AAChE,IAAI,WAAW,CAAC,KAAK,EAAE;AACvB,QAAQ,KAAK,CAAC,KAAK,CAAC,CAAC;AACrB,QAAQ,IAAI,CAAC,KAAK,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,OAAO;AAC/B,IAAI,cAAc,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,OAAO,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC;AAC5E,CAAC;;;;"}
|
|
@@ -7,14 +7,15 @@ var HoneybadgerReact = (function (exports, js, jsxRuntime, React, PropTypes) {
|
|
|
7
7
|
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
8
8
|
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
9
9
|
|
|
10
|
+
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
10
11
|
class DefaultErrorComponent extends React.Component {
|
|
11
12
|
render() {
|
|
12
|
-
return (jsxRuntime.jsxs("div",
|
|
13
|
+
return (jsxRuntime.jsxs("div", { className: 'error', children: [jsxRuntime.jsx("div", { children: "An Error Occurred" }), jsxRuntime.jsx("div", { children: JSON.stringify(this.props.error, null, 2) }), jsxRuntime.jsx("div", { children: this.props.info ? JSON.stringify(this.props.info, null, 2) : '' })] }));
|
|
13
14
|
}
|
|
14
15
|
}
|
|
15
16
|
DefaultErrorComponent.propTypes = {
|
|
16
|
-
error: PropTypes__default[
|
|
17
|
-
info: PropTypes__default[
|
|
17
|
+
error: PropTypes__default["default"].object,
|
|
18
|
+
info: PropTypes__default["default"].object
|
|
18
19
|
};
|
|
19
20
|
|
|
20
21
|
class HoneybadgerErrorBoundary extends React.Component {
|
|
@@ -35,26 +36,24 @@ var HoneybadgerReact = (function (exports, js, jsxRuntime, React, PropTypes) {
|
|
|
35
36
|
}
|
|
36
37
|
getErrorComponent() {
|
|
37
38
|
return this.props.ErrorComponent
|
|
38
|
-
? React__default[
|
|
39
|
-
: jsxRuntime.jsx(DefaultErrorComponent,
|
|
39
|
+
? React__default["default"].createElement(this.props.ErrorComponent, this.state)
|
|
40
|
+
: jsxRuntime.jsx(DefaultErrorComponent, { ...this.state });
|
|
40
41
|
}
|
|
41
42
|
render() {
|
|
42
43
|
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: this.state.errorOccurred
|
|
43
44
|
? this.getErrorComponent()
|
|
44
|
-
: this.props.children }
|
|
45
|
+
: this.props.children }));
|
|
45
46
|
}
|
|
46
47
|
}
|
|
47
48
|
HoneybadgerErrorBoundary.propTypes = {
|
|
48
|
-
honeybadger: PropTypes__default[
|
|
49
|
-
children: PropTypes__default[
|
|
50
|
-
ErrorComponent: PropTypes__default[
|
|
49
|
+
honeybadger: PropTypes__default["default"].object.isRequired,
|
|
50
|
+
children: PropTypes__default["default"].element,
|
|
51
|
+
ErrorComponent: PropTypes__default["default"].oneOfType([PropTypes__default["default"].element, PropTypes__default["default"].func])
|
|
51
52
|
};
|
|
52
53
|
|
|
53
54
|
Object.defineProperty(exports, 'Honeybadger', {
|
|
54
55
|
enumerable: true,
|
|
55
|
-
get: function () {
|
|
56
|
-
return js__default['default'];
|
|
57
|
-
}
|
|
56
|
+
get: function () { return js__default["default"]; }
|
|
58
57
|
});
|
|
59
58
|
exports.HoneybadgerErrorBoundary = HoneybadgerErrorBoundary;
|
|
60
59
|
|
|
@@ -62,5 +61,5 @@ var HoneybadgerReact = (function (exports, js, jsxRuntime, React, PropTypes) {
|
|
|
62
61
|
|
|
63
62
|
return exports;
|
|
64
63
|
|
|
65
|
-
}({}, Honeybadger, jsxRuntime, React, PropTypes)
|
|
64
|
+
})({}, Honeybadger, jsxRuntime, React, PropTypes);
|
|
66
65
|
//# sourceMappingURL=honeybadger-react.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"honeybadger-react.js","sources":["../../
|
|
1
|
+
{"version":3,"file":"honeybadger-react.js","sources":["../../build/DefaultErrorComponent.js","../../build/HoneybadgerErrorBoundary.js"],"sourcesContent":["import { jsx as _jsx, jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { Component } from 'react';\nimport PropTypes from 'prop-types';\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport default class DefaultErrorComponent extends Component {\n render() {\n return (_jsxs(\"div\", { className: 'error', children: [_jsx(\"div\", { children: \"An Error Occurred\" }), _jsx(\"div\", { children: JSON.stringify(this.props.error, null, 2) }), _jsx(\"div\", { children: this.props.info ? JSON.stringify(this.props.info, null, 2) : '' })] }));\n }\n}\nDefaultErrorComponent.propTypes = {\n error: PropTypes.object,\n info: PropTypes.object\n};\n//# sourceMappingURL=DefaultErrorComponent.js.map","import { jsx as _jsx, Fragment as _Fragment } from \"react/jsx-runtime\";\nimport React, { Component } from 'react';\nimport DefaultErrorComponent from './DefaultErrorComponent';\nimport PropTypes from 'prop-types';\nexport default class HoneybadgerErrorBoundary extends Component {\n constructor(props) {\n super(props);\n this.state = {\n error: null,\n info: null,\n errorOccurred: false\n };\n }\n static getDerivedStateFromError(error) {\n return { error: error, errorOccurred: true, info: null };\n }\n componentDidCatch(error, errorInfo) {\n this.setState({ errorOccurred: true, error: error, info: errorInfo });\n this.props.honeybadger.notify(error, { context: errorInfo });\n }\n getErrorComponent() {\n return this.props.ErrorComponent\n ? React.createElement(this.props.ErrorComponent, this.state)\n : _jsx(DefaultErrorComponent, { ...this.state });\n }\n render() {\n return (_jsx(_Fragment, { children: this.state.errorOccurred\n ? this.getErrorComponent()\n : this.props.children }));\n }\n}\nHoneybadgerErrorBoundary.propTypes = {\n honeybadger: PropTypes.object.isRequired,\n children: PropTypes.element,\n ErrorComponent: PropTypes.oneOfType([PropTypes.element, PropTypes.func])\n};\n//# sourceMappingURL=HoneybadgerErrorBoundary.js.map"],"names":["Component","_jsxs","_jsx","PropTypes","React","_Fragment"],"mappings":";;;;;;;;;IAGA;IACe,MAAM,qBAAqB,SAASA,eAAS,CAAC;IAC7D,IAAI,MAAM,GAAG;IACb,QAAQ,QAAQC,eAAK,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,CAACC,cAAI,CAAC,KAAK,EAAE,EAAE,QAAQ,EAAE,mBAAmB,EAAE,CAAC,EAAEA,cAAI,CAAC,KAAK,EAAE,EAAE,Q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IAAI,iBAAiB,GAAG;IACxB,QAAQ,OAAO,IAAI,CAAC,KAAK,CAAC,cAAc;IACxC,cAAcI,yBAAK,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,cAAc,EAAE,IAAI,CAAC,KAAK,CAAC;IACxE,cAAcF,cAAI,CAAC,qBAAqB,EAAE,EAAE,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;IAC7D,KAAK;IACL,IAAI,MAAM,GAAG;IACb,QAAQ,QAAQA,cAAI,CAACG,mBAAS,EAAE,EAAE,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,aAAa;IACpE,kBAAkB,IAAI,CAAC,iBAAiB,EAAE;IAC1C,kBAAkB,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,EAAE;IAC1C,KAAK;IACL,CAAC;IACD,wBAAwB,CAAC,SAAS,GAAG;IACrC,IAAI,WAAW,EAAEF,6BAAS,CAAC,MAAM,CAAC,UAAU;IAC5C,IAAI,QAAQ,EAAEA,6BAAS,CAAC,OAAO;IAC/B,IAAI,cAAc,EAAEA,6BAAS,CAAC,SAAS,CAAC,CAACA,6BAAS,CAAC,OAAO,EAAEA,6BAAS,CAAC,IAAI,CAAC,CAAC;IAC5E,CAAC;;;;;;;;;;;;;;;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import Honeybadger from
|
|
2
|
-
import HoneybadgerErrorBoundary from
|
|
1
|
+
import Honeybadger from '@honeybadger-io/js';
|
|
2
|
+
import HoneybadgerErrorBoundary from './HoneybadgerErrorBoundary';
|
|
3
3
|
export { Honeybadger, HoneybadgerErrorBoundary };
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@honeybadger-io/react",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.4.0",
|
|
4
4
|
"description": "React.js integration for honeybadger",
|
|
5
5
|
"author": "Jason Truesdell <jason@yuzuten.com> (https://github.com/JasonTrue)",
|
|
6
6
|
"license": "MIT",
|
|
7
|
+
"homepage": "https://github.com/honeybadger-io/honeybadger-js/tree/master/packages/react",
|
|
7
8
|
"repository": {
|
|
8
9
|
"type": "git",
|
|
9
|
-
"url": "git
|
|
10
|
+
"url": "git@github.com:honeybadger-io/honeybadger-js.git"
|
|
10
11
|
},
|
|
11
12
|
"main": "dist/honeybadger-react.cjs.js",
|
|
12
13
|
"types": "./dist/index.d.ts",
|
|
@@ -20,41 +21,37 @@
|
|
|
20
21
|
"scripts": {
|
|
21
22
|
"test": "cross-env CI=1 react-scripts test --env=jsdom",
|
|
22
23
|
"test:watch": "react-scripts test --env=jsdom",
|
|
23
|
-
"build": "tsc --
|
|
24
|
+
"build": "tsc --build tsconfig.json && rollup -c && tsc --build tsconfig.types.json",
|
|
24
25
|
"start": "rollup -c -w",
|
|
25
|
-
"prepare": "npm run build",
|
|
26
26
|
"predeploy": "cd example && npm install && npm run build",
|
|
27
|
-
"deploy": "gh-pages -d example/build"
|
|
28
|
-
"preversion": "npm test",
|
|
29
|
-
"version": "scripts/update-versions.sh",
|
|
30
|
-
"postversion": "git push && git push --tags",
|
|
31
|
-
"prepublishOnly": "npm run build && npm test"
|
|
27
|
+
"deploy": "gh-pages -d example/build"
|
|
32
28
|
},
|
|
33
29
|
"peerDependencies": {
|
|
30
|
+
"@honeybadger-io/js": "^4.3.0",
|
|
34
31
|
"prop-types": "^15.5.4",
|
|
35
|
-
"react": "^15.0.0 || ^16.0.0 || ^17.0.0",
|
|
36
|
-
"react-dom": "^15.0.0 || ^16.0.0 || ^17.0.0"
|
|
32
|
+
"react": "^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0",
|
|
33
|
+
"react-dom": "^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0"
|
|
37
34
|
},
|
|
38
35
|
"devDependencies": {
|
|
39
|
-
"@
|
|
40
|
-
"@rollup/plugin-
|
|
41
|
-
"@types/jest": "^
|
|
42
|
-
"@types/react": "^17.0.
|
|
43
|
-
"@types/react-test-renderer": "^
|
|
36
|
+
"@honeybadger-io/js": "^4.3.0",
|
|
37
|
+
"@rollup/plugin-commonjs": "^22.0.0",
|
|
38
|
+
"@types/jest": "^29.0.0",
|
|
39
|
+
"@types/react": "^17.0.44",
|
|
40
|
+
"@types/react-test-renderer": "^18.0.0",
|
|
44
41
|
"@types/sinon": "^10.0.11",
|
|
45
42
|
"cross-env": "^7.0.0",
|
|
46
|
-
"gh-pages": "^
|
|
47
|
-
"
|
|
48
|
-
"react
|
|
49
|
-
"react-
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
43
|
+
"gh-pages": "^4.0.0",
|
|
44
|
+
"husky": "^8.0.0",
|
|
45
|
+
"react": "^18.1.0",
|
|
46
|
+
"react-scripts": "^5.0.1",
|
|
47
|
+
"react-test-renderer": "^18.1.0",
|
|
48
|
+
"rollup": "^2.70.2",
|
|
49
|
+
"shipjs": "0.24.4",
|
|
50
|
+
"sinon": "^14.0.0",
|
|
51
|
+
"typescript": "^4.6.3"
|
|
53
52
|
},
|
|
54
53
|
"files": [
|
|
55
54
|
"dist"
|
|
56
55
|
],
|
|
57
|
-
"
|
|
58
|
-
"@honeybadger-io/js": "^3.2.8"
|
|
59
|
-
}
|
|
56
|
+
"gitHead": "95d98691d52f599d14fc24c386dd76cefad5a99c"
|
|
60
57
|
}
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2018 Honeybadger Industries LLC
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|