@khanacademy/perseus 17.3.1 → 17.3.2
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/CHANGELOG.md +6 -0
- package/dist/es/index.js +14 -5
- package/dist/es/index.js.map +1 -1
- package/dist/index.js +14 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/__tests__/error-boundary.test.tsx +76 -0
- package/src/error-boundary.tsx +22 -7
- package/tsconfig-build.tsbuildinfo +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @khanacademy/perseus
|
|
2
2
|
|
|
3
|
+
## 17.3.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#850](https://github.com/Khan/perseus/pull/850) [`f4cd2a76`](https://github.com/Khan/perseus/commit/f4cd2a7639556312af75b9ba9c6a97c41c94beac) Thanks [@jeremywiebe](https://github.com/jeremywiebe)! - Widget rendering errors are now reported as distinct errors to the Perseus logging infrastructure.
|
|
8
|
+
|
|
3
9
|
## 17.3.1
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/dist/es/index.js
CHANGED
|
@@ -17373,10 +17373,18 @@ class ErrorBoundary extends React.Component {
|
|
|
17373
17373
|
error: error.toString()
|
|
17374
17374
|
});
|
|
17375
17375
|
(_this$props$onError = (_this$props = this.props).onError) == null || _this$props$onError.call(_this$props, error, info);
|
|
17376
|
-
Log.error(
|
|
17376
|
+
Log.error(
|
|
17377
|
+
// NOTE(jeremy): We concatenate the error messsage here. Typical
|
|
17378
|
+
// Khan Academy error handling guidance says that you should never
|
|
17379
|
+
// "build" the error message that might be sent to our error
|
|
17380
|
+
// reporting tool (currently Sentry). However, if we don't
|
|
17381
|
+
// differentiate between the different errors that are thrown, they
|
|
17382
|
+
// all end up being grouped as a single Sentry event, which is very
|
|
17383
|
+
// unhelpful.
|
|
17384
|
+
"Unhandled Perseus error: " + error.message, Errors.Internal, {
|
|
17377
17385
|
cause: error,
|
|
17378
17386
|
loggedMetadata: _extends({
|
|
17379
|
-
componentStack: info.componentStack
|
|
17387
|
+
componentStack: !!info && "componentStack" in info ? info.componentStack : "componentStack not provided"
|
|
17380
17388
|
}, this.props.metadata)
|
|
17381
17389
|
});
|
|
17382
17390
|
}
|
|
@@ -17390,8 +17398,9 @@ class ErrorBoundary extends React.Component {
|
|
|
17390
17398
|
return /*#__PURE__*/React.createElement("svg", {
|
|
17391
17399
|
height: "16",
|
|
17392
17400
|
width: "16",
|
|
17393
|
-
viewBox: "0 0 16 16"
|
|
17394
|
-
|
|
17401
|
+
viewBox: "0 0 16 16",
|
|
17402
|
+
role: "img"
|
|
17403
|
+
}, /*#__PURE__*/React.createElement("title", null, "Rendering Error!"), /*#__PURE__*/React.createElement("path", {
|
|
17395
17404
|
d: "m8 16c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8zm0-3c0.55 0 1-0.45 1-1s-0.45-1-1-1-1 0.45-1 1 0.45 1 1 1zm0-9c-0.55 0-1 0.45-1 1v4c0 0.55.45 1 1 1s1-0.45 1-1v-4c0-0.55-0.45-1-1-1z",
|
|
17396
17405
|
fill: "#d92916",
|
|
17397
17406
|
fillRule: "evenodd"
|
|
@@ -44193,7 +44202,7 @@ const init = function init(options) {
|
|
|
44193
44202
|
|
|
44194
44203
|
// This file is processed by a Rollup plugin (replace) to inject the production
|
|
44195
44204
|
const libName = "@khanacademy/perseus";
|
|
44196
|
-
const libVersion = "17.3.
|
|
44205
|
+
const libVersion = "17.3.2";
|
|
44197
44206
|
addLibraryVersionToPerseusDebug(libName, libVersion);
|
|
44198
44207
|
|
|
44199
44208
|
const apiVersion = {
|