@atlaskit/renderer 109.17.2 → 109.17.3

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 CHANGED
@@ -1,5 +1,11 @@
1
1
  # @atlaskit/renderer
2
2
 
3
+ ## 109.17.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [#89790](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/89790) [`38cbee5b6ee4`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/38cbee5b6ee4) - Adds errorboundary around bodiedExtension to try to get more error info
8
+
3
9
  ## 109.17.2
4
10
 
5
11
  ### Patch Changes
@@ -7,18 +7,31 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.default = void 0;
8
8
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
9
  var _react = _interopRequireDefault(require("react"));
10
+ var _analyticsNext = require("@atlaskit/analytics-next");
10
11
  var _extension = require("./extension");
12
+ var _ErrorBoundary = require("../../ui/Renderer/ErrorBoundary");
11
13
  var _ExtensionRenderer = _interopRequireDefault(require("../../ui/ExtensionRenderer"));
14
+ var _enums = require("../../analytics/enums");
15
+ var _analytics = require("@atlaskit/editor-common/analytics");
12
16
  var BodiedExtension = function BodiedExtension(props) {
13
17
  var children = props.children,
14
18
  _props$layout = props.layout,
15
19
  layout = _props$layout === void 0 ? 'default' : _props$layout,
16
20
  _props$path = props.path,
17
- path = _props$path === void 0 ? [] : _props$path;
21
+ path = _props$path === void 0 ? [] : _props$path,
22
+ extensionKey = props.extensionKey,
23
+ extensionType = props.extensionType;
24
+ var _useAnalyticsEvents = (0, _analyticsNext.useAnalyticsEvents)(),
25
+ createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
18
26
  var removeOverflow = _react.default.Children.toArray(children).map(function (child) {
19
27
  return /*#__PURE__*/_react.default.isValidElement(child) ? child.props.nodeType === 'table' : false;
20
28
  }).every(Boolean);
21
- return /*#__PURE__*/_react.default.createElement(_ExtensionRenderer.default, (0, _extends2.default)({}, props, {
29
+ return /*#__PURE__*/_react.default.createElement(_ErrorBoundary.ErrorBoundary, {
30
+ component: _enums.ACTION_SUBJECT.RENDERER,
31
+ componentId: _analytics.ACTION_SUBJECT_ID.EXTENSION_BODIED,
32
+ createAnalyticsEvent: createAnalyticsEvent,
33
+ additionalInfo: "".concat(extensionType, ": ").concat(extensionKey, " ")
34
+ }, /*#__PURE__*/_react.default.createElement(_ExtensionRenderer.default, (0, _extends2.default)({}, props, {
22
35
  type: "bodiedExtension"
23
36
  }), function (_ref) {
24
37
  var result = _ref.result;
@@ -38,6 +51,6 @@ var BodiedExtension = function BodiedExtension(props) {
38
51
  return (0, _extension.renderExtension)(children, layout, {
39
52
  isTopLevel: path.length < 1
40
53
  }, removeOverflow);
41
- });
54
+ }));
42
55
  };
43
56
  var _default = exports.default = BodiedExtension;
@@ -59,7 +59,9 @@ var ErrorBoundary = exports.ErrorBoundary = /*#__PURE__*/function (_React$Compon
59
59
  }, {
60
60
  key: "componentDidCatch",
61
61
  value: function componentDidCatch(error, errorInfo) {
62
- var _this2 = this;
62
+ var _this$props$additiona,
63
+ _this2 = this;
64
+ var additionalInfo = (_this$props$additiona = this.props.additionalInfo) !== null && _this$props$additiona !== void 0 ? _this$props$additiona : '';
63
65
  this.fireAnalyticsEvent({
64
66
  action: _analytics.ACTION.CRASHED,
65
67
  actionSubject: this.props.component,
@@ -67,7 +69,7 @@ var ErrorBoundary = exports.ErrorBoundary = /*#__PURE__*/function (_React$Compon
67
69
  eventType: _analytics.EVENT_TYPE.OPERATIONAL,
68
70
  attributes: {
69
71
  platform: _events.PLATFORM.WEB,
70
- errorMessage: error === null || error === void 0 ? void 0 : error.message,
72
+ errorMessage: "".concat(additionalInfo).concat(error === null || error === void 0 ? void 0 : error.message),
71
73
  componentStack: errorInfo === null || errorInfo === void 0 ? void 0 : errorInfo.componentStack,
72
74
  errorRethrown: Boolean(this.props.rethrowError)
73
75
  }
@@ -86,7 +88,7 @@ var ErrorBoundary = exports.ErrorBoundary = /*#__PURE__*/function (_React$Compon
86
88
  eventType: _analytics.EVENT_TYPE.OPERATIONAL,
87
89
  attributes: {
88
90
  platform: _events.PLATFORM.WEB,
89
- errorMessage: error === null || error === void 0 ? void 0 : error.message
91
+ errorMessage: "".concat(additionalInfo).concat(error === null || error === void 0 ? void 0 : error.message)
90
92
  }
91
93
  });
92
94
  this.setState(function () {
@@ -55,7 +55,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
55
55
  var NORMAL_SEVERITY_THRESHOLD = exports.NORMAL_SEVERITY_THRESHOLD = 2000;
56
56
  var DEGRADED_SEVERITY_THRESHOLD = exports.DEGRADED_SEVERITY_THRESHOLD = 3000;
57
57
  var packageName = "@atlaskit/renderer";
58
- var packageVersion = "109.17.2";
58
+ var packageVersion = "109.17.3";
59
59
  var Renderer = exports.Renderer = /*#__PURE__*/function (_PureComponent) {
60
60
  (0, _inherits2.default)(Renderer, _PureComponent);
61
61
  var _super = _createSuper(Renderer);
@@ -1,15 +1,29 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import React from 'react';
3
+ import { useAnalyticsEvents } from '@atlaskit/analytics-next';
3
4
  import { renderExtension } from './extension';
5
+ import { ErrorBoundary } from '../../ui/Renderer/ErrorBoundary';
4
6
  import ExtensionRenderer from '../../ui/ExtensionRenderer';
7
+ import { ACTION_SUBJECT } from '../../analytics/enums';
8
+ import { ACTION_SUBJECT_ID } from '@atlaskit/editor-common/analytics';
5
9
  const BodiedExtension = props => {
6
10
  const {
7
11
  children,
8
12
  layout = 'default',
9
- path = []
13
+ path = [],
14
+ extensionKey,
15
+ extensionType
10
16
  } = props;
17
+ const {
18
+ createAnalyticsEvent
19
+ } = useAnalyticsEvents();
11
20
  const removeOverflow = React.Children.toArray(children).map(child => /*#__PURE__*/React.isValidElement(child) ? child.props.nodeType === 'table' : false).every(Boolean);
12
- return /*#__PURE__*/React.createElement(ExtensionRenderer, _extends({}, props, {
21
+ return /*#__PURE__*/React.createElement(ErrorBoundary, {
22
+ component: ACTION_SUBJECT.RENDERER,
23
+ componentId: ACTION_SUBJECT_ID.EXTENSION_BODIED,
24
+ createAnalyticsEvent: createAnalyticsEvent,
25
+ additionalInfo: `${extensionType}: ${extensionKey} `
26
+ }, /*#__PURE__*/React.createElement(ExtensionRenderer, _extends({}, props, {
13
27
  type: "bodiedExtension"
14
28
  }), ({
15
29
  result
@@ -30,6 +44,6 @@ const BodiedExtension = props => {
30
44
  return renderExtension(children, layout, {
31
45
  isTopLevel: path.length < 1
32
46
  }, removeOverflow);
33
- });
47
+ }));
34
48
  };
35
49
  export default BodiedExtension;
@@ -30,6 +30,8 @@ export class ErrorBoundary extends React.Component {
30
30
  return this.hasFallback() && this.state.errorCaptured;
31
31
  }
32
32
  componentDidCatch(error, errorInfo) {
33
+ var _this$props$additiona;
34
+ const additionalInfo = (_this$props$additiona = this.props.additionalInfo) !== null && _this$props$additiona !== void 0 ? _this$props$additiona : '';
33
35
  this.fireAnalyticsEvent({
34
36
  action: ACTION.CRASHED,
35
37
  actionSubject: this.props.component,
@@ -37,7 +39,7 @@ export class ErrorBoundary extends React.Component {
37
39
  eventType: EVENT_TYPE.OPERATIONAL,
38
40
  attributes: {
39
41
  platform: PLATFORM.WEB,
40
- errorMessage: error === null || error === void 0 ? void 0 : error.message,
42
+ errorMessage: `${additionalInfo}${error === null || error === void 0 ? void 0 : error.message}`,
41
43
  componentStack: errorInfo === null || errorInfo === void 0 ? void 0 : errorInfo.componentStack,
42
44
  errorRethrown: Boolean(this.props.rethrowError)
43
45
  }
@@ -56,7 +58,7 @@ export class ErrorBoundary extends React.Component {
56
58
  eventType: EVENT_TYPE.OPERATIONAL,
57
59
  attributes: {
58
60
  platform: PLATFORM.WEB,
59
- errorMessage: error === null || error === void 0 ? void 0 : error.message
61
+ errorMessage: `${additionalInfo}${error === null || error === void 0 ? void 0 : error.message}`
60
62
  }
61
63
  });
62
64
  this.setState(() => ({
@@ -36,7 +36,7 @@ import { EditorMediaClientProvider } from '../../react/utils/EditorMediaClientPr
36
36
  export const NORMAL_SEVERITY_THRESHOLD = 2000;
37
37
  export const DEGRADED_SEVERITY_THRESHOLD = 3000;
38
38
  const packageName = "@atlaskit/renderer";
39
- const packageVersion = "109.17.2";
39
+ const packageVersion = "109.17.3";
40
40
  export class Renderer extends PureComponent {
41
41
  constructor(props) {
42
42
  super(props);
@@ -1,17 +1,30 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import React from 'react';
3
+ import { useAnalyticsEvents } from '@atlaskit/analytics-next';
3
4
  import { renderExtension } from './extension';
5
+ import { ErrorBoundary } from '../../ui/Renderer/ErrorBoundary';
4
6
  import ExtensionRenderer from '../../ui/ExtensionRenderer';
7
+ import { ACTION_SUBJECT } from '../../analytics/enums';
8
+ import { ACTION_SUBJECT_ID } from '@atlaskit/editor-common/analytics';
5
9
  var BodiedExtension = function BodiedExtension(props) {
6
10
  var children = props.children,
7
11
  _props$layout = props.layout,
8
12
  layout = _props$layout === void 0 ? 'default' : _props$layout,
9
13
  _props$path = props.path,
10
- path = _props$path === void 0 ? [] : _props$path;
14
+ path = _props$path === void 0 ? [] : _props$path,
15
+ extensionKey = props.extensionKey,
16
+ extensionType = props.extensionType;
17
+ var _useAnalyticsEvents = useAnalyticsEvents(),
18
+ createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
11
19
  var removeOverflow = React.Children.toArray(children).map(function (child) {
12
20
  return /*#__PURE__*/React.isValidElement(child) ? child.props.nodeType === 'table' : false;
13
21
  }).every(Boolean);
14
- return /*#__PURE__*/React.createElement(ExtensionRenderer, _extends({}, props, {
22
+ return /*#__PURE__*/React.createElement(ErrorBoundary, {
23
+ component: ACTION_SUBJECT.RENDERER,
24
+ componentId: ACTION_SUBJECT_ID.EXTENSION_BODIED,
25
+ createAnalyticsEvent: createAnalyticsEvent,
26
+ additionalInfo: "".concat(extensionType, ": ").concat(extensionKey, " ")
27
+ }, /*#__PURE__*/React.createElement(ExtensionRenderer, _extends({}, props, {
15
28
  type: "bodiedExtension"
16
29
  }), function (_ref) {
17
30
  var result = _ref.result;
@@ -31,6 +44,6 @@ var BodiedExtension = function BodiedExtension(props) {
31
44
  return renderExtension(children, layout, {
32
45
  isTopLevel: path.length < 1
33
46
  }, removeOverflow);
34
- });
47
+ }));
35
48
  };
36
49
  export default BodiedExtension;
@@ -52,7 +52,9 @@ export var ErrorBoundary = /*#__PURE__*/function (_React$Component) {
52
52
  }, {
53
53
  key: "componentDidCatch",
54
54
  value: function componentDidCatch(error, errorInfo) {
55
- var _this2 = this;
55
+ var _this$props$additiona,
56
+ _this2 = this;
57
+ var additionalInfo = (_this$props$additiona = this.props.additionalInfo) !== null && _this$props$additiona !== void 0 ? _this$props$additiona : '';
56
58
  this.fireAnalyticsEvent({
57
59
  action: ACTION.CRASHED,
58
60
  actionSubject: this.props.component,
@@ -60,7 +62,7 @@ export var ErrorBoundary = /*#__PURE__*/function (_React$Component) {
60
62
  eventType: EVENT_TYPE.OPERATIONAL,
61
63
  attributes: {
62
64
  platform: PLATFORM.WEB,
63
- errorMessage: error === null || error === void 0 ? void 0 : error.message,
65
+ errorMessage: "".concat(additionalInfo).concat(error === null || error === void 0 ? void 0 : error.message),
64
66
  componentStack: errorInfo === null || errorInfo === void 0 ? void 0 : errorInfo.componentStack,
65
67
  errorRethrown: Boolean(this.props.rethrowError)
66
68
  }
@@ -79,7 +81,7 @@ export var ErrorBoundary = /*#__PURE__*/function (_React$Component) {
79
81
  eventType: EVENT_TYPE.OPERATIONAL,
80
82
  attributes: {
81
83
  platform: PLATFORM.WEB,
82
- errorMessage: error === null || error === void 0 ? void 0 : error.message
84
+ errorMessage: "".concat(additionalInfo).concat(error === null || error === void 0 ? void 0 : error.message)
83
85
  }
84
86
  });
85
87
  this.setState(function () {
@@ -46,7 +46,7 @@ import { EditorMediaClientProvider } from '../../react/utils/EditorMediaClientPr
46
46
  export var NORMAL_SEVERITY_THRESHOLD = 2000;
47
47
  export var DEGRADED_SEVERITY_THRESHOLD = 3000;
48
48
  var packageName = "@atlaskit/renderer";
49
- var packageVersion = "109.17.2";
49
+ var packageVersion = "109.17.3";
50
50
  export var Renderer = /*#__PURE__*/function (_PureComponent) {
51
51
  _inherits(Renderer, _PureComponent);
52
52
  var _super = _createSuper(Renderer);
@@ -8,6 +8,7 @@ interface ErrorBoundaryProps {
8
8
  fallbackComponent?: React.ReactNode;
9
9
  createAnalyticsEvent?: CreateUIAnalyticsEvent;
10
10
  rethrowError?: boolean;
11
+ additionalInfo?: string;
11
12
  }
12
13
  interface ErrorBoundaryState {
13
14
  errorCaptured: boolean;
@@ -8,6 +8,7 @@ interface ErrorBoundaryProps {
8
8
  fallbackComponent?: React.ReactNode;
9
9
  createAnalyticsEvent?: CreateUIAnalyticsEvent;
10
10
  rethrowError?: boolean;
11
+ additionalInfo?: string;
11
12
  }
12
13
  interface ErrorBoundaryState {
13
14
  errorCaptured: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/renderer",
3
- "version": "109.17.2",
3
+ "version": "109.17.3",
4
4
  "description": "Renderer component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -47,7 +47,7 @@
47
47
  "@atlaskit/media-ui": "^25.7.0",
48
48
  "@atlaskit/media-viewer": "^48.4.0",
49
49
  "@atlaskit/platform-feature-flags": "^0.2.0",
50
- "@atlaskit/smart-card": "^26.54.0",
50
+ "@atlaskit/smart-card": "^26.55.0",
51
51
  "@atlaskit/status": "^1.4.0",
52
52
  "@atlaskit/task-decision": "^17.9.0",
53
53
  "@atlaskit/theme": "^12.7.0",