@khanacademy/perseus 11.2.1 → 11.3.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/CHANGELOG.md +11 -0
- package/dist/error-boundary.d.ts +1 -0
- package/dist/es/index.js +8 -4
- package/dist/es/index.js.map +1 -1
- package/dist/index.js +7 -2
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/error-boundary.tsx +5 -1
- package/src/renderer.tsx +4 -1
- package/tsconfig-build.tsbuildinfo +1 -1
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "Core Perseus API (includes renderers and widgets)",
|
|
4
4
|
"author": "Khan Academy",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"version": "11.
|
|
6
|
+
"version": "11.3.0",
|
|
7
7
|
"publishConfig": {
|
|
8
8
|
"access": "public"
|
|
9
9
|
},
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@khanacademy/kas": "^0.3.1",
|
|
26
26
|
"@khanacademy/kmath": "^0.1.2",
|
|
27
|
-
"@khanacademy/math-input": "^12.0
|
|
27
|
+
"@khanacademy/math-input": "^12.1.0",
|
|
28
28
|
"@khanacademy/perseus-core": "1.0.0",
|
|
29
29
|
"@khanacademy/perseus-linter": "^0.3.3",
|
|
30
30
|
"@khanacademy/pure-markdown": "^0.2.5",
|
package/src/error-boundary.tsx
CHANGED
|
@@ -4,6 +4,7 @@ import {Errors, Log} from "./logging/log";
|
|
|
4
4
|
|
|
5
5
|
type Props = {
|
|
6
6
|
children: React.ReactNode;
|
|
7
|
+
metadata?: Record<string, string>;
|
|
7
8
|
};
|
|
8
9
|
type State = {
|
|
9
10
|
error: string;
|
|
@@ -19,7 +20,10 @@ class ErrorBoundary extends React.Component<Props, State> {
|
|
|
19
20
|
this.setState({error: error.toString()});
|
|
20
21
|
Log.error("Perseus error boundary caught error", Errors.Internal, {
|
|
21
22
|
cause: error,
|
|
22
|
-
loggedMetadata: {
|
|
23
|
+
loggedMetadata: {
|
|
24
|
+
componentStack: info.componentStack,
|
|
25
|
+
...this.props.metadata,
|
|
26
|
+
},
|
|
23
27
|
});
|
|
24
28
|
}
|
|
25
29
|
|
package/src/renderer.tsx
CHANGED
|
@@ -550,7 +550,10 @@ class Renderer extends React.Component<Props, State> {
|
|
|
550
550
|
// filtered out in this.render(), so we shouldn't have to
|
|
551
551
|
// worry about using this widget key and ref:
|
|
552
552
|
return (
|
|
553
|
-
<ErrorBoundary
|
|
553
|
+
<ErrorBoundary
|
|
554
|
+
key={"container:" + id}
|
|
555
|
+
metadata={{widget_type: type, widget_id: id}}
|
|
556
|
+
>
|
|
554
557
|
<WidgetContainer
|
|
555
558
|
ref={"container:" + id}
|
|
556
559
|
type={type}
|