@honeybadger-io/react 2.0.1 → 2.1.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 +11 -0
- package/dist/honeybadger-react.cjs.js +10 -12
- package/dist/honeybadger-react.cjs.js.map +1 -1
- package/dist/honeybadger-react.esm.js +3 -3
- package/dist/honeybadger-react.esm.js.map +1 -1
- package/dist/honeybadger-react.js +11 -13
- package/dist/honeybadger-react.js.map +1 -1
- package/package.json +22 -17
package/README.md
CHANGED
|
@@ -59,6 +59,7 @@ For a detailed explanation on how hot reloading works, check out the [documentat
|
|
|
59
59
|
## Changelog
|
|
60
60
|
|
|
61
61
|
See https://github.com/honeybadger-io/honeybadger-react/blob/master/CHANGELOG.md
|
|
62
|
+
Changelog is automatically generated with [our release automation process](#release-automation).
|
|
62
63
|
|
|
63
64
|
## Contributing
|
|
64
65
|
|
|
@@ -92,6 +93,16 @@ npm run start
|
|
|
92
93
|
2. To publish the release, use `npm publish`. See `npm help publish` for
|
|
93
94
|
documentation.
|
|
94
95
|
|
|
96
|
+
### Release Automation
|
|
97
|
+
|
|
98
|
+
We use [Ship.js](https://github.com/algolia/shipjs) to automate releasing.
|
|
99
|
+
|
|
100
|
+
Ship.js creates a PR once per week when unreleased changes are present. You can also trigger a release PR by saying "@shipjs prepare" in any issue or pull request comment on GitHub.
|
|
101
|
+
|
|
102
|
+
#### Troubleshooting a failed Ship.js release
|
|
103
|
+
|
|
104
|
+
If a ship.js release fails, you need to revert the release commit and delete the release branch (e.g `releases/v1.1.0`)
|
|
105
|
+
Then, you can debug the issue by simulating the release process locally (`npm run release -- --dry-run --yes --no-browse`).
|
|
95
106
|
|
|
96
107
|
### License
|
|
97
108
|
|
|
@@ -15,12 +15,12 @@ var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
|
15
15
|
|
|
16
16
|
class DefaultErrorComponent extends React.Component {
|
|
17
17
|
render() {
|
|
18
|
-
return (jsxRuntime.jsxs("div",
|
|
18
|
+
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
19
|
}
|
|
20
20
|
}
|
|
21
21
|
DefaultErrorComponent.propTypes = {
|
|
22
|
-
error: PropTypes__default[
|
|
23
|
-
info: PropTypes__default[
|
|
22
|
+
error: PropTypes__default["default"].object,
|
|
23
|
+
info: PropTypes__default["default"].object
|
|
24
24
|
};
|
|
25
25
|
|
|
26
26
|
class HoneybadgerErrorBoundary extends React.Component {
|
|
@@ -41,26 +41,24 @@ class HoneybadgerErrorBoundary extends React.Component {
|
|
|
41
41
|
}
|
|
42
42
|
getErrorComponent() {
|
|
43
43
|
return this.props.ErrorComponent
|
|
44
|
-
? React__default[
|
|
45
|
-
: jsxRuntime.jsx(DefaultErrorComponent,
|
|
44
|
+
? React__default["default"].createElement(this.props.ErrorComponent, this.state)
|
|
45
|
+
: jsxRuntime.jsx(DefaultErrorComponent, { ...this.state });
|
|
46
46
|
}
|
|
47
47
|
render() {
|
|
48
48
|
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: this.state.errorOccurred
|
|
49
49
|
? this.getErrorComponent()
|
|
50
|
-
: this.props.children }
|
|
50
|
+
: this.props.children }));
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
HoneybadgerErrorBoundary.propTypes = {
|
|
54
|
-
honeybadger: PropTypes__default[
|
|
55
|
-
children: PropTypes__default[
|
|
56
|
-
ErrorComponent: PropTypes__default[
|
|
54
|
+
honeybadger: PropTypes__default["default"].object.isRequired,
|
|
55
|
+
children: PropTypes__default["default"].element,
|
|
56
|
+
ErrorComponent: PropTypes__default["default"].oneOfType([PropTypes__default["default"].element, PropTypes__default["default"].func])
|
|
57
57
|
};
|
|
58
58
|
|
|
59
59
|
Object.defineProperty(exports, 'Honeybadger', {
|
|
60
60
|
enumerable: true,
|
|
61
|
-
get: function () {
|
|
62
|
-
return js__default['default'];
|
|
63
|
-
}
|
|
61
|
+
get: function () { return js__default["default"]; }
|
|
64
62
|
});
|
|
65
63
|
exports.HoneybadgerErrorBoundary = HoneybadgerErrorBoundary;
|
|
66
64
|
//# sourceMappingURL=honeybadger-react.cjs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"honeybadger-react.cjs.js","sources":["../../src/DefaultErrorComponent.tsx","../../src/HoneybadgerErrorBoundary.tsx"],"sourcesContent":["import React, {Component} from \"react\"\nimport PropTypes from \"prop-types\";\n\nexport interface DefaultErrorComponentProps {\n error: Error | null\n info: React.ErrorInfo | null\n}\n\nexport default class DefaultErrorComponent extends Component<DefaultErrorComponentProps, {}> {\n\n static propTypes = {\n error: PropTypes.object,\n info: PropTypes.object\n }\n\n render() {\n return (\n <div className='error'>\n <div>\n An Error Occurred\n </div>\n <div>\n {JSON.stringify(this.props.error, null, 2)}\n </div>\n <div>\n {this.props.info ? JSON.stringify(this.props.info, null, 2) : ''}\n </div>\n </div>\n )\n }\n}\n","import React, {Component, ReactNode} from 'react'\nimport HoneybadgerClient from '@honeybadger-io/js/dist/browser/types/core/client'\nimport DefaultErrorComponent, {DefaultErrorComponentProps} from \"./DefaultErrorComponent\"\nimport PropTypes from \"prop-types\";\n\ninterface HoneybadgerErrorBoundaryProps {\n honeybadger: HoneybadgerClient\n ErrorComponent?: ReactNode\n}\n\ninterface HoneybadgerErrorBoundaryState extends DefaultErrorComponentProps {\n errorOccurred: boolean\n}\n\nexport default class HoneybadgerErrorBoundary extends Component<HoneybadgerErrorBoundaryProps, HoneybadgerErrorBoundaryState> {\n\n static propTypes = {\n honeybadger: PropTypes.object.isRequired,\n children: PropTypes.element,\n ErrorComponent: PropTypes.oneOfType([PropTypes.element, PropTypes.func])\n }\n\n constructor(props: HoneybadgerErrorBoundaryProps) {\n super(props)\n this.state = {\n error: null,\n info: null,\n errorOccurred: false\n }\n }\n\n public static getDerivedStateFromError(error: Error): HoneybadgerErrorBoundaryState {\n return {error: error, errorOccurred: true, info: null}\n }\n\n componentDidCatch(error: Error, errorInfo: React.ErrorInfo) {\n this.setState({errorOccurred: true, error: error, info: errorInfo})\n this.props.honeybadger.notify(error, {context: errorInfo as any})\n }\n\n private getErrorComponent(): ReactNode {\n return this.props.ErrorComponent\n ? React.createElement(this.props.ErrorComponent as any, this.state)\n : <DefaultErrorComponent {...this.state} />\n }\n\n render() {\n return (\n <>\n {this.state.errorOccurred\n ? this.getErrorComponent()\n : this.props.children\n }\n </>\n )\n }\n}\n"],"names":["Component","_jsxs","_jsx","PropTypes","React"],"mappings":";;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"honeybadger-react.cjs.js","sources":["../../src/DefaultErrorComponent.tsx","../../src/HoneybadgerErrorBoundary.tsx"],"sourcesContent":["import React, {Component} from \"react\"\nimport PropTypes from \"prop-types\";\n\nexport interface DefaultErrorComponentProps {\n error: Error | null\n info: React.ErrorInfo | null\n}\n\nexport default class DefaultErrorComponent extends Component<DefaultErrorComponentProps, {}> {\n\n static propTypes = {\n error: PropTypes.object,\n info: PropTypes.object\n }\n\n render() {\n return (\n <div className='error'>\n <div>\n An Error Occurred\n </div>\n <div>\n {JSON.stringify(this.props.error, null, 2)}\n </div>\n <div>\n {this.props.info ? JSON.stringify(this.props.info, null, 2) : ''}\n </div>\n </div>\n )\n }\n}\n","import React, {Component, ReactNode} from 'react'\nimport HoneybadgerClient from '@honeybadger-io/js/dist/browser/types/core/client'\nimport DefaultErrorComponent, {DefaultErrorComponentProps} from \"./DefaultErrorComponent\"\nimport PropTypes from \"prop-types\";\n\ninterface HoneybadgerErrorBoundaryProps {\n honeybadger: HoneybadgerClient\n ErrorComponent?: ReactNode\n}\n\ninterface HoneybadgerErrorBoundaryState extends DefaultErrorComponentProps {\n errorOccurred: boolean\n}\n\nexport default class HoneybadgerErrorBoundary extends Component<HoneybadgerErrorBoundaryProps, HoneybadgerErrorBoundaryState> {\n\n static propTypes = {\n honeybadger: PropTypes.object.isRequired,\n children: PropTypes.element,\n ErrorComponent: PropTypes.oneOfType([PropTypes.element, PropTypes.func])\n }\n\n constructor(props: HoneybadgerErrorBoundaryProps) {\n super(props)\n this.state = {\n error: null,\n info: null,\n errorOccurred: false\n }\n }\n\n public static getDerivedStateFromError(error: Error): HoneybadgerErrorBoundaryState {\n return {error: error, errorOccurred: true, info: null}\n }\n\n componentDidCatch(error: Error, errorInfo: React.ErrorInfo) {\n this.setState({errorOccurred: true, error: error, info: errorInfo})\n this.props.honeybadger.notify(error, {context: errorInfo as any})\n }\n\n private getErrorComponent(): ReactNode {\n return this.props.ErrorComponent\n ? React.createElement(this.props.ErrorComponent as any, this.state)\n : <DefaultErrorComponent {...this.state} />\n }\n\n render() {\n return (\n <>\n {this.state.errorOccurred\n ? this.getErrorComponent()\n : this.props.children\n }\n </>\n )\n }\n}\n"],"names":["Component","_jsxs","_jsx","PropTypes","React","_Fragment"],"mappings":";;;;;;;;;;;;;;;AAQqB,MAAA,qBAAsB,SAAQA,eAAyC,CAAA;IAO1F,MAAM,GAAA;QACJ,QACEC,eAAK,CAAA,KAAA,EAAA,EAAA,SAAS,EAAC,OAAO,aACpBC,cAEM,CAAA,KAAA,EAAA,EAAA,QAAA,EAAA,mBAAA,EAAA,CAAA,EACNA,cACG,CAAA,KAAA,EAAA,EAAA,QAAA,EAAA,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,EACtC,CAAA,EACNA,cACG,CAAA,KAAA,EAAA,EAAA,QAAA,EAAA,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,EAAE,EAAA,CAC5D,CACF,EAAA,CAAA,EACP;KACF;;AAnBM,qBAAA,C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,CAEtB,EACJ;KACF;;AAvCM,wBAAA,CAAA,SAAS,GAAG;AACjB,IAAA,WAAW,EAAEF,6BAAS,CAAC,MAAM,CAAC,UAAU;IACxC,QAAQ,EAAEA,6BAAS,CAAC,OAAO;AAC3B,IAAA,cAAc,EAAEA,6BAAS,CAAC,SAAS,CAAC,CAACA,6BAAS,CAAC,OAAO,EAAEA,6BAAS,CAAC,IAAI,CAAC,CAAC;CACzE;;;;;;;;"}
|
|
@@ -5,7 +5,7 @@ import PropTypes from 'prop-types';
|
|
|
5
5
|
|
|
6
6
|
class DefaultErrorComponent extends Component {
|
|
7
7
|
render() {
|
|
8
|
-
return (jsxs("div",
|
|
8
|
+
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
9
|
}
|
|
10
10
|
}
|
|
11
11
|
DefaultErrorComponent.propTypes = {
|
|
@@ -32,12 +32,12 @@ class HoneybadgerErrorBoundary extends Component {
|
|
|
32
32
|
getErrorComponent() {
|
|
33
33
|
return this.props.ErrorComponent
|
|
34
34
|
? React.createElement(this.props.ErrorComponent, this.state)
|
|
35
|
-
: jsx(DefaultErrorComponent,
|
|
35
|
+
: jsx(DefaultErrorComponent, { ...this.state });
|
|
36
36
|
}
|
|
37
37
|
render() {
|
|
38
38
|
return (jsx(Fragment, { children: this.state.errorOccurred
|
|
39
39
|
? this.getErrorComponent()
|
|
40
|
-
: this.props.children }
|
|
40
|
+
: this.props.children }));
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
HoneybadgerErrorBoundary.propTypes = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"honeybadger-react.esm.js","sources":["../../src/DefaultErrorComponent.tsx","../../src/HoneybadgerErrorBoundary.tsx"],"sourcesContent":["import React, {Component} from \"react\"\nimport PropTypes from \"prop-types\";\n\nexport interface DefaultErrorComponentProps {\n error: Error | null\n info: React.ErrorInfo | null\n}\n\nexport default class DefaultErrorComponent extends Component<DefaultErrorComponentProps, {}> {\n\n static propTypes = {\n error: PropTypes.object,\n info: PropTypes.object\n }\n\n render() {\n return (\n <div className='error'>\n <div>\n An Error Occurred\n </div>\n <div>\n {JSON.stringify(this.props.error, null, 2)}\n </div>\n <div>\n {this.props.info ? JSON.stringify(this.props.info, null, 2) : ''}\n </div>\n </div>\n )\n }\n}\n","import React, {Component, ReactNode} from 'react'\nimport HoneybadgerClient from '@honeybadger-io/js/dist/browser/types/core/client'\nimport DefaultErrorComponent, {DefaultErrorComponentProps} from \"./DefaultErrorComponent\"\nimport PropTypes from \"prop-types\";\n\ninterface HoneybadgerErrorBoundaryProps {\n honeybadger: HoneybadgerClient\n ErrorComponent?: ReactNode\n}\n\ninterface HoneybadgerErrorBoundaryState extends DefaultErrorComponentProps {\n errorOccurred: boolean\n}\n\nexport default class HoneybadgerErrorBoundary extends Component<HoneybadgerErrorBoundaryProps, HoneybadgerErrorBoundaryState> {\n\n static propTypes = {\n honeybadger: PropTypes.object.isRequired,\n children: PropTypes.element,\n ErrorComponent: PropTypes.oneOfType([PropTypes.element, PropTypes.func])\n }\n\n constructor(props: HoneybadgerErrorBoundaryProps) {\n super(props)\n this.state = {\n error: null,\n info: null,\n errorOccurred: false\n }\n }\n\n public static getDerivedStateFromError(error: Error): HoneybadgerErrorBoundaryState {\n return {error: error, errorOccurred: true, info: null}\n }\n\n componentDidCatch(error: Error, errorInfo: React.ErrorInfo) {\n this.setState({errorOccurred: true, error: error, info: errorInfo})\n this.props.honeybadger.notify(error, {context: errorInfo as any})\n }\n\n private getErrorComponent(): ReactNode {\n return this.props.ErrorComponent\n ? React.createElement(this.props.ErrorComponent as any, this.state)\n : <DefaultErrorComponent {...this.state} />\n }\n\n render() {\n return (\n <>\n {this.state.errorOccurred\n ? this.getErrorComponent()\n : this.props.children\n }\n </>\n )\n }\n}\n"],"names":["_jsxs","_jsx"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"honeybadger-react.esm.js","sources":["../../src/DefaultErrorComponent.tsx","../../src/HoneybadgerErrorBoundary.tsx"],"sourcesContent":["import React, {Component} from \"react\"\nimport PropTypes from \"prop-types\";\n\nexport interface DefaultErrorComponentProps {\n error: Error | null\n info: React.ErrorInfo | null\n}\n\nexport default class DefaultErrorComponent extends Component<DefaultErrorComponentProps, {}> {\n\n static propTypes = {\n error: PropTypes.object,\n info: PropTypes.object\n }\n\n render() {\n return (\n <div className='error'>\n <div>\n An Error Occurred\n </div>\n <div>\n {JSON.stringify(this.props.error, null, 2)}\n </div>\n <div>\n {this.props.info ? JSON.stringify(this.props.info, null, 2) : ''}\n </div>\n </div>\n )\n }\n}\n","import React, {Component, ReactNode} from 'react'\nimport HoneybadgerClient from '@honeybadger-io/js/dist/browser/types/core/client'\nimport DefaultErrorComponent, {DefaultErrorComponentProps} from \"./DefaultErrorComponent\"\nimport PropTypes from \"prop-types\";\n\ninterface HoneybadgerErrorBoundaryProps {\n honeybadger: HoneybadgerClient\n ErrorComponent?: ReactNode\n}\n\ninterface HoneybadgerErrorBoundaryState extends DefaultErrorComponentProps {\n errorOccurred: boolean\n}\n\nexport default class HoneybadgerErrorBoundary extends Component<HoneybadgerErrorBoundaryProps, HoneybadgerErrorBoundaryState> {\n\n static propTypes = {\n honeybadger: PropTypes.object.isRequired,\n children: PropTypes.element,\n ErrorComponent: PropTypes.oneOfType([PropTypes.element, PropTypes.func])\n }\n\n constructor(props: HoneybadgerErrorBoundaryProps) {\n super(props)\n this.state = {\n error: null,\n info: null,\n errorOccurred: false\n }\n }\n\n public static getDerivedStateFromError(error: Error): HoneybadgerErrorBoundaryState {\n return {error: error, errorOccurred: true, info: null}\n }\n\n componentDidCatch(error: Error, errorInfo: React.ErrorInfo) {\n this.setState({errorOccurred: true, error: error, info: errorInfo})\n this.props.honeybadger.notify(error, {context: errorInfo as any})\n }\n\n private getErrorComponent(): ReactNode {\n return this.props.ErrorComponent\n ? React.createElement(this.props.ErrorComponent as any, this.state)\n : <DefaultErrorComponent {...this.state} />\n }\n\n render() {\n return (\n <>\n {this.state.errorOccurred\n ? this.getErrorComponent()\n : this.props.children\n }\n </>\n )\n }\n}\n"],"names":["_jsxs","_jsx","_Fragment"],"mappings":";;;;;AAQqB,MAAA,qBAAsB,SAAQ,SAAyC,CAAA;IAO1F,MAAM,GAAA;QACJ,QACEA,IAAK,CAAA,KAAA,EAAA,EAAA,SAAS,EAAC,OAAO,aACpBC,GAEM,CAAA,KAAA,EAAA,EAAA,QAAA,EAAA,mBAAA,EAAA,CAAA,EACNA,GACG,CAAA,KAAA,EAAA,EAAA,QAAA,EAAA,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,EACtC,CAAA,EACNA,GACG,CAAA,KAAA,EAAA,EAAA,QAAA,EAAA,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,EAAE,EAAA,CAC5D,CACF,EAAA,CAAA,EACP;KACF;;AAnBM,qBAAA,CAAA,SAAS,GAAG;IACjB,KAAK,EAAE,SAAS,CAAC,MAAM;IACvB,IAAI,EAAE,SAAS,CAAC,MAAM;CACvB;;ACCkB,MAAA,wBAAyB,SAAQ,SAAuE,CAAA;AAQ3H,IAAA,WAAA,CAAY,KAAoC,EAAA;QAC9C,KAAK,CAAC,KAAK,CAAC,CAAA;QACZ,IAAI,CAAC,KAAK,GAAG;AACX,YAAA,KAAK,EAAE,IAAI;AACX,YAAA,IAAI,EAAE,IAAI;AACV,YAAA,aAAa,EAAE,KAAK;SACrB,CAAA;KACF;IAEM,OAAO,wBAAwB,CAAC,KAAY,EAAA;AACjD,QAAA,OAAO,EAAC,KAAK,EAAE,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAC,CAAA;KACvD;IAED,iBAAiB,CAAC,KAAY,EAAE,SAA0B,EAAA;AACxD,QAAA,IAAI,CAAC,QAAQ,CAAC,EAAC,aAAa,EAAE,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAC,CAAC,CAAA;AACnE,QAAA,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,MAAM,CAAC,KAAK,EAAE,EAAC,OAAO,EAAE,SAAgB,EAAC,CAAC,CAAA;KAClE;IAEO,iBAAiB,GAAA;AACvB,QAAA,OAAO,IAAI,CAAC,KAAK,CAAC,cAAc;AAC9B,cAAE,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,cAAqB,EAAE,IAAI,CAAC,KAAK,CAAC;cACjEA,IAAC,qBAAqB,EAAA,EAAA,GAAK,IAAI,CAAC,KAAK,GAAI,CAAA;KAC9C;IAED,MAAM,GAAA;AACJ,QAAA,QACEA,GACG,CAAAC,QAAA,EAAA,EAAA,QAAA,EAAA,IAAI,CAAC,KAAK,CAAC,aAAa;AACvB,kBAAE,IAAI,CAAC,iBAAiB,EAAE;kBACxB,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAA,CAEtB,EACJ;KACF;;AAvCM,wBAAA,CAAA,SAAS,GAAG;AACjB,IAAA,WAAW,EAAE,SAAS,CAAC,MAAM,CAAC,UAAU;IACxC,QAAQ,EAAE,SAAS,CAAC,OAAO;AAC3B,IAAA,cAAc,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,OAAO,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC;CACzE;;;;"}
|
|
@@ -9,12 +9,12 @@ var HoneybadgerReact = (function (exports, js, jsxRuntime, React, PropTypes) {
|
|
|
9
9
|
|
|
10
10
|
class DefaultErrorComponent extends React.Component {
|
|
11
11
|
render() {
|
|
12
|
-
return (jsxRuntime.jsxs("div",
|
|
12
|
+
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
13
|
}
|
|
14
14
|
}
|
|
15
15
|
DefaultErrorComponent.propTypes = {
|
|
16
|
-
error: PropTypes__default[
|
|
17
|
-
info: PropTypes__default[
|
|
16
|
+
error: PropTypes__default["default"].object,
|
|
17
|
+
info: PropTypes__default["default"].object
|
|
18
18
|
};
|
|
19
19
|
|
|
20
20
|
class HoneybadgerErrorBoundary extends React.Component {
|
|
@@ -35,26 +35,24 @@ var HoneybadgerReact = (function (exports, js, jsxRuntime, React, PropTypes) {
|
|
|
35
35
|
}
|
|
36
36
|
getErrorComponent() {
|
|
37
37
|
return this.props.ErrorComponent
|
|
38
|
-
? React__default[
|
|
39
|
-
: jsxRuntime.jsx(DefaultErrorComponent,
|
|
38
|
+
? React__default["default"].createElement(this.props.ErrorComponent, this.state)
|
|
39
|
+
: jsxRuntime.jsx(DefaultErrorComponent, { ...this.state });
|
|
40
40
|
}
|
|
41
41
|
render() {
|
|
42
42
|
return (jsxRuntime.jsx(jsxRuntime.Fragment, { children: this.state.errorOccurred
|
|
43
43
|
? this.getErrorComponent()
|
|
44
|
-
: this.props.children }
|
|
44
|
+
: this.props.children }));
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
HoneybadgerErrorBoundary.propTypes = {
|
|
48
|
-
honeybadger: PropTypes__default[
|
|
49
|
-
children: PropTypes__default[
|
|
50
|
-
ErrorComponent: PropTypes__default[
|
|
48
|
+
honeybadger: PropTypes__default["default"].object.isRequired,
|
|
49
|
+
children: PropTypes__default["default"].element,
|
|
50
|
+
ErrorComponent: PropTypes__default["default"].oneOfType([PropTypes__default["default"].element, PropTypes__default["default"].func])
|
|
51
51
|
};
|
|
52
52
|
|
|
53
53
|
Object.defineProperty(exports, 'Honeybadger', {
|
|
54
54
|
enumerable: true,
|
|
55
|
-
get: function () {
|
|
56
|
-
return js__default['default'];
|
|
57
|
-
}
|
|
55
|
+
get: function () { return js__default["default"]; }
|
|
58
56
|
});
|
|
59
57
|
exports.HoneybadgerErrorBoundary = HoneybadgerErrorBoundary;
|
|
60
58
|
|
|
@@ -62,5 +60,5 @@ var HoneybadgerReact = (function (exports, js, jsxRuntime, React, PropTypes) {
|
|
|
62
60
|
|
|
63
61
|
return exports;
|
|
64
62
|
|
|
65
|
-
}({}, Honeybadger, jsxRuntime, React, PropTypes)
|
|
63
|
+
})({}, Honeybadger, jsxRuntime, React, PropTypes);
|
|
66
64
|
//# sourceMappingURL=honeybadger-react.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"honeybadger-react.js","sources":["../../src/DefaultErrorComponent.tsx","../../src/HoneybadgerErrorBoundary.tsx"],"sourcesContent":["import React, {Component} from \"react\"\nimport PropTypes from \"prop-types\";\n\nexport interface DefaultErrorComponentProps {\n error: Error | null\n info: React.ErrorInfo | null\n}\n\nexport default class DefaultErrorComponent extends Component<DefaultErrorComponentProps, {}> {\n\n static propTypes = {\n error: PropTypes.object,\n info: PropTypes.object\n }\n\n render() {\n return (\n <div className='error'>\n <div>\n An Error Occurred\n </div>\n <div>\n {JSON.stringify(this.props.error, null, 2)}\n </div>\n <div>\n {this.props.info ? JSON.stringify(this.props.info, null, 2) : ''}\n </div>\n </div>\n )\n }\n}\n","import React, {Component, ReactNode} from 'react'\nimport HoneybadgerClient from '@honeybadger-io/js/dist/browser/types/core/client'\nimport DefaultErrorComponent, {DefaultErrorComponentProps} from \"./DefaultErrorComponent\"\nimport PropTypes from \"prop-types\";\n\ninterface HoneybadgerErrorBoundaryProps {\n honeybadger: HoneybadgerClient\n ErrorComponent?: ReactNode\n}\n\ninterface HoneybadgerErrorBoundaryState extends DefaultErrorComponentProps {\n errorOccurred: boolean\n}\n\nexport default class HoneybadgerErrorBoundary extends Component<HoneybadgerErrorBoundaryProps, HoneybadgerErrorBoundaryState> {\n\n static propTypes = {\n honeybadger: PropTypes.object.isRequired,\n children: PropTypes.element,\n ErrorComponent: PropTypes.oneOfType([PropTypes.element, PropTypes.func])\n }\n\n constructor(props: HoneybadgerErrorBoundaryProps) {\n super(props)\n this.state = {\n error: null,\n info: null,\n errorOccurred: false\n }\n }\n\n public static getDerivedStateFromError(error: Error): HoneybadgerErrorBoundaryState {\n return {error: error, errorOccurred: true, info: null}\n }\n\n componentDidCatch(error: Error, errorInfo: React.ErrorInfo) {\n this.setState({errorOccurred: true, error: error, info: errorInfo})\n this.props.honeybadger.notify(error, {context: errorInfo as any})\n }\n\n private getErrorComponent(): ReactNode {\n return this.props.ErrorComponent\n ? React.createElement(this.props.ErrorComponent as any, this.state)\n : <DefaultErrorComponent {...this.state} />\n }\n\n render() {\n return (\n <>\n {this.state.errorOccurred\n ? this.getErrorComponent()\n : this.props.children\n }\n </>\n )\n }\n}\n"],"names":["Component","_jsxs","_jsx","PropTypes","React"],"mappings":";;;;;;;;;
|
|
1
|
+
{"version":3,"file":"honeybadger-react.js","sources":["../../src/DefaultErrorComponent.tsx","../../src/HoneybadgerErrorBoundary.tsx"],"sourcesContent":["import React, {Component} from \"react\"\nimport PropTypes from \"prop-types\";\n\nexport interface DefaultErrorComponentProps {\n error: Error | null\n info: React.ErrorInfo | null\n}\n\nexport default class DefaultErrorComponent extends Component<DefaultErrorComponentProps, {}> {\n\n static propTypes = {\n error: PropTypes.object,\n info: PropTypes.object\n }\n\n render() {\n return (\n <div className='error'>\n <div>\n An Error Occurred\n </div>\n <div>\n {JSON.stringify(this.props.error, null, 2)}\n </div>\n <div>\n {this.props.info ? JSON.stringify(this.props.info, null, 2) : ''}\n </div>\n </div>\n )\n }\n}\n","import React, {Component, ReactNode} from 'react'\nimport HoneybadgerClient from '@honeybadger-io/js/dist/browser/types/core/client'\nimport DefaultErrorComponent, {DefaultErrorComponentProps} from \"./DefaultErrorComponent\"\nimport PropTypes from \"prop-types\";\n\ninterface HoneybadgerErrorBoundaryProps {\n honeybadger: HoneybadgerClient\n ErrorComponent?: ReactNode\n}\n\ninterface HoneybadgerErrorBoundaryState extends DefaultErrorComponentProps {\n errorOccurred: boolean\n}\n\nexport default class HoneybadgerErrorBoundary extends Component<HoneybadgerErrorBoundaryProps, HoneybadgerErrorBoundaryState> {\n\n static propTypes = {\n honeybadger: PropTypes.object.isRequired,\n children: PropTypes.element,\n ErrorComponent: PropTypes.oneOfType([PropTypes.element, PropTypes.func])\n }\n\n constructor(props: HoneybadgerErrorBoundaryProps) {\n super(props)\n this.state = {\n error: null,\n info: null,\n errorOccurred: false\n }\n }\n\n public static getDerivedStateFromError(error: Error): HoneybadgerErrorBoundaryState {\n return {error: error, errorOccurred: true, info: null}\n }\n\n componentDidCatch(error: Error, errorInfo: React.ErrorInfo) {\n this.setState({errorOccurred: true, error: error, info: errorInfo})\n this.props.honeybadger.notify(error, {context: errorInfo as any})\n }\n\n private getErrorComponent(): ReactNode {\n return this.props.ErrorComponent\n ? React.createElement(this.props.ErrorComponent as any, this.state)\n : <DefaultErrorComponent {...this.state} />\n }\n\n render() {\n return (\n <>\n {this.state.errorOccurred\n ? this.getErrorComponent()\n : this.props.children\n }\n </>\n )\n }\n}\n"],"names":["Component","_jsxs","_jsx","PropTypes","React","_Fragment"],"mappings":";;;;;;;;;IAQqB,MAAA,qBAAsB,SAAQA,eAAyC,CAAA;QAO1F,MAAM,GAAA;YACJ,QACEC,eAAK,CAAA,KAAA,EAAA,EAAA,SAAS,EAAC,OAAO,aACpBC,cAEM,CAAA,KAAA,EAAA,EAAA,QAAA,EAAA,mBAAA,EAAA,CAAA,EACNA,cACG,CAAA,KAAA,EAAA,EAAA,QAAA,EAAA,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,EACtC,CAAA,EACNA,cACG,CAAA,KAAA,EAAA,EAAA,QAAA,EAAA,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,IAAI,CA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,mBAAA,EAAA,EAAA,QAAA,EAAA,IAAI,CAAC,KAAK,CAAC,aAAa;IACvB,kBAAE,IAAI,CAAC,iBAAiB,EAAE;sBACxB,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAA,CAEtB,EACJ;SACF;;IAvCM,wBAAA,CAAA,SAAS,GAAG;IACjB,IAAA,WAAW,EAAEF,6BAAS,CAAC,MAAM,CAAC,UAAU;QACxC,QAAQ,EAAEA,6BAAS,CAAC,OAAO;IAC3B,IAAA,cAAc,EAAEA,6BAAS,CAAC,SAAS,CAAC,CAACA,6BAAS,CAAC,OAAO,EAAEA,6BAAS,CAAC,IAAI,CAAC,CAAC;KACzE;;;;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@honeybadger-io/react",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.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",
|
|
@@ -22,39 +22,44 @@
|
|
|
22
22
|
"test:watch": "react-scripts test --env=jsdom",
|
|
23
23
|
"build": "tsc --emitDeclarationOnly --noEmit false && rollup -c",
|
|
24
24
|
"start": "rollup -c -w",
|
|
25
|
-
"prepare": "npm run build",
|
|
25
|
+
"prepare": "npm run build && husky install",
|
|
26
26
|
"predeploy": "cd example && npm install && npm run build",
|
|
27
27
|
"deploy": "gh-pages -d example/build",
|
|
28
28
|
"preversion": "npm test",
|
|
29
29
|
"version": "scripts/update-versions.sh",
|
|
30
30
|
"postversion": "git push && git push --tags",
|
|
31
|
-
"prepublishOnly": "npm run build && npm test"
|
|
31
|
+
"prepublishOnly": "npm run build && npm test",
|
|
32
|
+
"release": "shipjs prepare"
|
|
32
33
|
},
|
|
33
34
|
"peerDependencies": {
|
|
34
35
|
"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"
|
|
36
|
+
"react": "^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0",
|
|
37
|
+
"react-dom": "^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0"
|
|
37
38
|
},
|
|
38
39
|
"devDependencies": {
|
|
39
|
-
"@
|
|
40
|
-
"@
|
|
40
|
+
"@commitlint/cli": "^17.0.0",
|
|
41
|
+
"@commitlint/config-conventional": "^17.0.0",
|
|
42
|
+
"@rollup/plugin-commonjs": "^22.0.0",
|
|
43
|
+
"@rollup/plugin-typescript": "^8.3.2",
|
|
41
44
|
"@types/jest": "^27.4.1",
|
|
42
|
-
"@types/react": "^17.0.
|
|
43
|
-
"@types/react-test-renderer": "^
|
|
45
|
+
"@types/react": "^17.0.44",
|
|
46
|
+
"@types/react-test-renderer": "^18.0.0",
|
|
44
47
|
"@types/sinon": "^10.0.11",
|
|
45
48
|
"cross-env": "^7.0.0",
|
|
46
|
-
"gh-pages": "^
|
|
47
|
-
"
|
|
48
|
-
"react
|
|
49
|
-
"react-
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
49
|
+
"gh-pages": "^4.0.0",
|
|
50
|
+
"husky": "^8.0.0",
|
|
51
|
+
"react": "^18.1.0",
|
|
52
|
+
"react-scripts": "^5.0.1",
|
|
53
|
+
"react-test-renderer": "^18.1.0",
|
|
54
|
+
"rollup": "^2.70.2",
|
|
55
|
+
"shipjs": "0.24.4",
|
|
56
|
+
"sinon": "^14.0.0",
|
|
57
|
+
"typescript": "^4.6.3"
|
|
53
58
|
},
|
|
54
59
|
"files": [
|
|
55
60
|
"dist"
|
|
56
61
|
],
|
|
57
62
|
"dependencies": {
|
|
58
|
-
"@honeybadger-io/js": "^
|
|
63
|
+
"@honeybadger-io/js": "^4.0.3"
|
|
59
64
|
}
|
|
60
65
|
}
|