@atlaskit/editor-common 111.16.2 → 111.16.4
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 +17 -0
- package/afm-cc/tsconfig.json +0 -1
- package/afm-jira/tsconfig.json +0 -1
- package/afm-products/tsconfig.json +0 -1
- package/dist/cjs/messages/syncBlock.js +10 -0
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/performance-ssr-measures/RenderMarker.js +16 -0
- package/dist/cjs/performance-ssr-measures/SSRRenderMeasure.js +90 -0
- package/dist/cjs/performance-ssr-measures/index.js +19 -0
- package/dist/cjs/performance-ssr-measures/profileSSROperation.js +65 -0
- package/dist/cjs/provider-helpers/combine-providers.js +10 -1
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/utils/index.js +6 -0
- package/dist/cjs/utils/performance/navigation.js +11 -0
- package/dist/es2019/messages/syncBlock.js +10 -0
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/performance-ssr-measures/RenderMarker.js +11 -0
- package/dist/es2019/performance-ssr-measures/SSRRenderMeasure.js +85 -0
- package/dist/es2019/performance-ssr-measures/index.js +5 -0
- package/dist/es2019/performance-ssr-measures/profileSSROperation.js +59 -0
- package/dist/es2019/provider-helpers/combine-providers.js +6 -1
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/utils/index.js +1 -1
- package/dist/es2019/utils/performance/navigation.js +10 -0
- package/dist/esm/messages/syncBlock.js +10 -0
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/performance-ssr-measures/RenderMarker.js +10 -0
- package/dist/esm/performance-ssr-measures/SSRRenderMeasure.js +83 -0
- package/dist/esm/performance-ssr-measures/index.js +5 -0
- package/dist/esm/performance-ssr-measures/profileSSROperation.js +59 -0
- package/dist/esm/provider-helpers/combine-providers.js +10 -1
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/utils/index.js +1 -1
- package/dist/esm/utils/performance/navigation.js +10 -0
- package/dist/types/analytics/types/block-menu-events.d.ts +1 -2
- package/dist/types/messages/syncBlock.d.ts +10 -0
- package/dist/types/performance-ssr-measures/RenderMarker.d.ts +5 -0
- package/dist/types/performance-ssr-measures/SSRRenderMeasure.d.ts +114 -0
- package/dist/types/performance-ssr-measures/index.d.ts +2 -0
- package/dist/types/performance-ssr-measures/profileSSROperation.d.ts +43 -0
- package/dist/types/utils/index.d.ts +1 -1
- package/dist/types/utils/performance/navigation.d.ts +1 -0
- package/dist/types-ts4.5/analytics/types/block-menu-events.d.ts +1 -2
- package/dist/types-ts4.5/messages/syncBlock.d.ts +10 -0
- package/dist/types-ts4.5/performance-ssr-measures/RenderMarker.d.ts +5 -0
- package/dist/types-ts4.5/performance-ssr-measures/SSRRenderMeasure.d.ts +114 -0
- package/dist/types-ts4.5/performance-ssr-measures/index.d.ts +2 -0
- package/dist/types-ts4.5/performance-ssr-measures/profileSSROperation.d.ts +43 -0
- package/dist/types-ts4.5/utils/index.d.ts +1 -1
- package/dist/types-ts4.5/utils/performance/navigation.d.ts +1 -0
- package/package.json +6 -3
- package/performance/ssr-measures/package.json +17 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 111.16.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`3a0ebffbfb871`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/3a0ebffbfb871) -
|
|
8
|
+
[ux] Add flag message for when inline extensions added to synced block
|
|
9
|
+
- [`bc0a0c36fcc31`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/bc0a0c36fcc31) -
|
|
10
|
+
Add transform error tracking for block menu
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
|
|
13
|
+
## 111.16.3
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- [`615e2dfcd1dae`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/615e2dfcd1dae) -
|
|
18
|
+
Editor-5506: Fix getAutoConverter null error in ssr
|
|
19
|
+
|
|
3
20
|
## 111.16.2
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
package/afm-cc/tsconfig.json
CHANGED
package/afm-jira/tsconfig.json
CHANGED
|
@@ -390,5 +390,15 @@ var syncBlockMessages = exports.syncBlockMessages = (0, _reactIntlNext.defineMes
|
|
|
390
390
|
id: 'fabric.editor.cannotCreateSyncBlockDescription',
|
|
391
391
|
defaultMessage: 'An error occurred while trying to create this synced block. ',
|
|
392
392
|
description: 'Description in flag which appears when a synced block cannot be created'
|
|
393
|
+
},
|
|
394
|
+
inlineExtensionInSyncBlockTitle: {
|
|
395
|
+
id: 'fabric.editor.inlineExtensionInSyncBlockTitle',
|
|
396
|
+
defaultMessage: 'Some macros may not work when adding synced blocks to new locations',
|
|
397
|
+
description: 'Title in flag which appears when an inline extension is inserted into a synced block'
|
|
398
|
+
},
|
|
399
|
+
inlineExtensionInSyncBlockDescription: {
|
|
400
|
+
id: 'fabric.editor.inlineExtensionInSyncBlockDescription',
|
|
401
|
+
defaultMessage: 'This may happen if your synced block is used in places that don\'t support certain macros.',
|
|
402
|
+
description: 'Description in flag which appears when an inline extension is inserted into a synced block'
|
|
393
403
|
}
|
|
394
404
|
});
|
|
@@ -19,7 +19,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
19
19
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
20
20
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
21
21
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
22
|
-
var packageVersion = "
|
|
22
|
+
var packageVersion = "111.16.4";
|
|
23
23
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
24
24
|
// Remove URL as it has UGC
|
|
25
25
|
// Ignored via go/ees007
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.RenderMarker = RenderMarker;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
function RenderMarker(_ref) {
|
|
9
|
+
var onRender = _ref.onRender;
|
|
10
|
+
(0, _react.useLayoutEffect)(function () {
|
|
11
|
+
if (onRender) {
|
|
12
|
+
onRender();
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.SSRRenderMeasure = void 0;
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _isSsr = require("../core-utils/is-ssr");
|
|
10
|
+
var _RenderMarker = require("./RenderMarker");
|
|
11
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
12
|
+
/**
|
|
13
|
+
* Props for SSRRenderMeasure component
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
function SSRRenderMeasureImpl(_ref) {
|
|
17
|
+
var onSSRMeasure = _ref.onSSRMeasure,
|
|
18
|
+
segmentName = _ref.segmentName,
|
|
19
|
+
startTimestampRef = _ref.startTimestampRef,
|
|
20
|
+
children = _ref.children;
|
|
21
|
+
var wasMeasured = (0, _react.useRef)(false);
|
|
22
|
+
var handleOnRender = (0, _react.useCallback)(function () {
|
|
23
|
+
if (wasMeasured.current) {
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
onSSRMeasure === null || onSSRMeasure === void 0 || onSSRMeasure({
|
|
27
|
+
segmentName: segmentName,
|
|
28
|
+
startTimestamp: startTimestampRef.current,
|
|
29
|
+
endTimestamp: performance.now()
|
|
30
|
+
});
|
|
31
|
+
wasMeasured.current = true;
|
|
32
|
+
}, [onSSRMeasure, segmentName, startTimestampRef]);
|
|
33
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, children, /*#__PURE__*/_react.default.createElement(_RenderMarker.RenderMarker, {
|
|
34
|
+
onRender: handleOnRender
|
|
35
|
+
}));
|
|
36
|
+
}
|
|
37
|
+
var SSRRenderMeasureNoOp = /*#__PURE__*/(0, _react.memo)(function (_ref2) {
|
|
38
|
+
var children = _ref2.children;
|
|
39
|
+
return children;
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Component for measuring render performance during Server-Side Rendering (SSR).
|
|
44
|
+
*
|
|
45
|
+
* This component wraps content to measure its render duration in SSR mode.
|
|
46
|
+
* On client builds, it's optimized to a no-op component with zero performance overhead.
|
|
47
|
+
* On SSR builds, it captures timing data and reports it via the `onSSRMeasure` callback.
|
|
48
|
+
*
|
|
49
|
+
* **How it works:**
|
|
50
|
+
* - Measures from `startTimestampRef.current` (component start) to when `RenderMarker` is rendered
|
|
51
|
+
* - Uses `RenderMarker` to detect when the render completes successfully
|
|
52
|
+
* - Only reports the measurement once (protected by `wasMeasured` ref)
|
|
53
|
+
* - If child components throw errors during render, the measurement will not be reported
|
|
54
|
+
*
|
|
55
|
+
* **Usage pattern:**
|
|
56
|
+
* 1. Create `startTimestampRef` as the **first line** in your component using `useRef(performance.now())`
|
|
57
|
+
* 2. Wrap your content with `SSRRenderMeasure` at the end of your component
|
|
58
|
+
* 3. Provide the `onSSRMeasure` callback to receive timing data
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* ```tsx
|
|
62
|
+
* function FullPageEditor({ onSSRMeasure }) {
|
|
63
|
+
* // CRITICAL: Must be the first line for accurate timing
|
|
64
|
+
* const startTimestampRef = useRef(performance.now());
|
|
65
|
+
*
|
|
66
|
+
* // ...component logic, hooks, etc.
|
|
67
|
+
*
|
|
68
|
+
* return (
|
|
69
|
+
* <SSRRenderMeasure
|
|
70
|
+
* segmentName="ssr-app/render/fullPageEditor"
|
|
71
|
+
* startTimestampRef={startTimestampRef}
|
|
72
|
+
* onSSRMeasure={onSSRMeasure}
|
|
73
|
+
* >
|
|
74
|
+
* <EditorContent />
|
|
75
|
+
* </SSRRenderMeasure>
|
|
76
|
+
* );
|
|
77
|
+
* }
|
|
78
|
+
* ```
|
|
79
|
+
*
|
|
80
|
+
* @example
|
|
81
|
+
* ```tsx
|
|
82
|
+
* // Handling the measurement callback
|
|
83
|
+
* const handleSSRMeasure = (measure) => {
|
|
84
|
+
* const duration = measure.endTimestamp - measure.startTimestamp;
|
|
85
|
+
* console.log(`${measure.segmentName} rendered in ${duration}ms`);
|
|
86
|
+
* // Send to analytics, logging, etc.
|
|
87
|
+
* };
|
|
88
|
+
* ```
|
|
89
|
+
*/
|
|
90
|
+
var SSRRenderMeasure = exports.SSRRenderMeasure = (0, _isSsr.isSSR)() ? SSRRenderMeasureImpl : SSRRenderMeasureNoOp;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "SSRRenderMeasure", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function get() {
|
|
9
|
+
return _SSRRenderMeasure.SSRRenderMeasure;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "profileSSROperation", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function get() {
|
|
15
|
+
return _profileSSROperation.profileSSROperation;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
var _SSRRenderMeasure = require("./SSRRenderMeasure");
|
|
19
|
+
var _profileSSROperation = require("./profileSSROperation");
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.profileSSROperation = void 0;
|
|
7
|
+
var _isSsr = require("../core-utils/is-ssr");
|
|
8
|
+
var profileSSROperationImpl = function profileSSROperationImpl(segmentName, fn, onSSRMeasure) {
|
|
9
|
+
if (!onSSRMeasure) {
|
|
10
|
+
return fn();
|
|
11
|
+
}
|
|
12
|
+
var startTimestamp = performance.now();
|
|
13
|
+
try {
|
|
14
|
+
return fn();
|
|
15
|
+
} finally {
|
|
16
|
+
onSSRMeasure({
|
|
17
|
+
segmentName: segmentName,
|
|
18
|
+
startTimestamp: startTimestamp,
|
|
19
|
+
endTimestamp: performance.now()
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
var profileSSROperationNoOp = function profileSSROperationNoOp(_segmentName, fn, _onSSRMeasure) {
|
|
24
|
+
return fn();
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Profiles a synchronous operation during Server-Side Rendering (SSR).
|
|
29
|
+
*
|
|
30
|
+
* This function wraps an operation to measure its execution time in SSR mode.
|
|
31
|
+
* On client builds, the profiling is optimized away and the function executes normally.
|
|
32
|
+
* On SSR builds, it captures timing data using `performance.now()` and reports it via the callback.
|
|
33
|
+
*
|
|
34
|
+
* **Important notes:**
|
|
35
|
+
* - Profiling only occurs in SSR mode when `onSSRMeasure` is provided
|
|
36
|
+
* - Both `startTimestamp` and `endTimestamp` are absolute values from `performance.now()`, not relative times
|
|
37
|
+
* - Calculate duration as: `endTimestamp - startTimestamp`
|
|
38
|
+
* - The measurement is guaranteed to be reported even if the function throws an error (via `finally` block)
|
|
39
|
+
* - On client builds, this function has zero performance overhead
|
|
40
|
+
*
|
|
41
|
+
* @param segmentName - Identifier for the operation being measured (e.g., 'ssr-app/render/editor/createSchema')
|
|
42
|
+
* @param fn - The synchronous function to execute and profile
|
|
43
|
+
* @param onSSRMeasure - Optional callback to receive performance measurements
|
|
44
|
+
* @param onSSRMeasure.segmentName - Name of the measured segment
|
|
45
|
+
* @param onSSRMeasure.startTimestamp - Absolute timestamp when the operation started (from `performance.now()`)
|
|
46
|
+
* @param onSSRMeasure.endTimestamp - Absolute timestamp when the operation completed (from `performance.now()`)
|
|
47
|
+
*
|
|
48
|
+
* @returns The result of the executed function
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* // Profile schema creation during SSR
|
|
52
|
+
* const schema = profileSSROperation(
|
|
53
|
+
* 'ssr-app/render/editor/createSchema',
|
|
54
|
+
* () => createSchema(config),
|
|
55
|
+
* (measure) => {
|
|
56
|
+
* const duration = measure.endTimestamp - measure.startTimestamp;
|
|
57
|
+
* console.log(`${measure.segmentName}: ${duration}ms`);
|
|
58
|
+
* }
|
|
59
|
+
* );
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* // Without callback, executes normally
|
|
63
|
+
* const result = profileSSROperation('operation', () => expensiveCalculation());
|
|
64
|
+
*/
|
|
65
|
+
var profileSSROperation = exports.profileSSROperation = (0, _isSsr.isSSR)() ? profileSSROperationImpl : profileSSROperationNoOp;
|
|
@@ -8,6 +8,7 @@ exports.default = void 0;
|
|
|
8
8
|
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
9
|
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
10
10
|
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
11
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
11
12
|
var _promiseHelpers = require("./promise-helpers");
|
|
12
13
|
var flatten = function flatten(arr) {
|
|
13
14
|
var _ref;
|
|
@@ -34,8 +35,16 @@ var _default = exports.default = function _default(providers) {
|
|
|
34
35
|
}));
|
|
35
36
|
case 2:
|
|
36
37
|
results = _context.sent;
|
|
38
|
+
if ((0, _platformFeatureFlags.fg)('platform_editor_fix_getautoconverter_null_error')) {
|
|
39
|
+
_context.next = 5;
|
|
40
|
+
break;
|
|
41
|
+
}
|
|
37
42
|
return _context.abrupt("return", (0, _promiseHelpers.getOnlyFulfilled)(results));
|
|
38
|
-
case
|
|
43
|
+
case 5:
|
|
44
|
+
return _context.abrupt("return", (0, _promiseHelpers.getOnlyFulfilled)(results).filter(function (provider) {
|
|
45
|
+
return provider != null;
|
|
46
|
+
}));
|
|
47
|
+
case 6:
|
|
39
48
|
case "end":
|
|
40
49
|
return _context.stop();
|
|
41
50
|
}
|
|
@@ -24,7 +24,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
24
24
|
* @jsx jsx
|
|
25
25
|
*/ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
26
26
|
var packageName = "@atlaskit/editor-common";
|
|
27
|
-
var packageVersion = "
|
|
27
|
+
var packageVersion = "111.16.4";
|
|
28
28
|
var halfFocusRing = 1;
|
|
29
29
|
var dropOffset = '0, 8';
|
|
30
30
|
var fadeIn = (0, _react2.keyframes)({
|
package/dist/cjs/utils/index.js
CHANGED
|
@@ -558,6 +558,12 @@ Object.defineProperty(exports, "getRangeInlineNodeNames", {
|
|
|
558
558
|
return _annotation.getRangeInlineNodeNames;
|
|
559
559
|
}
|
|
560
560
|
});
|
|
561
|
+
Object.defineProperty(exports, "getRequestToResponseTime", {
|
|
562
|
+
enumerable: true,
|
|
563
|
+
get: function get() {
|
|
564
|
+
return _navigation.getRequestToResponseTime;
|
|
565
|
+
}
|
|
566
|
+
});
|
|
561
567
|
Object.defineProperty(exports, "getResponseEndTime", {
|
|
562
568
|
enumerable: true,
|
|
563
569
|
get: function get() {
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
exports.getRequestToResponseTime = getRequestToResponseTime;
|
|
6
7
|
exports.getResponseEndTime = getResponseEndTime;
|
|
7
8
|
var _isPerformanceApiAvailable = require("./is-performance-api-available");
|
|
8
9
|
function getResponseEndTime() {
|
|
@@ -14,4 +15,14 @@ function getResponseEndTime() {
|
|
|
14
15
|
return nav.responseEnd;
|
|
15
16
|
}
|
|
16
17
|
return;
|
|
18
|
+
}
|
|
19
|
+
function getRequestToResponseTime() {
|
|
20
|
+
if (!(0, _isPerformanceApiAvailable.isPerformanceAPIAvailable)()) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
var nav = performance.getEntriesByType('navigation')[0];
|
|
24
|
+
if (nav) {
|
|
25
|
+
return nav.responseEnd - nav.requestStart;
|
|
26
|
+
}
|
|
27
|
+
return;
|
|
17
28
|
}
|
|
@@ -384,5 +384,15 @@ export const syncBlockMessages = defineMessages({
|
|
|
384
384
|
id: 'fabric.editor.cannotCreateSyncBlockDescription',
|
|
385
385
|
defaultMessage: 'An error occurred while trying to create this synced block. ',
|
|
386
386
|
description: 'Description in flag which appears when a synced block cannot be created'
|
|
387
|
+
},
|
|
388
|
+
inlineExtensionInSyncBlockTitle: {
|
|
389
|
+
id: 'fabric.editor.inlineExtensionInSyncBlockTitle',
|
|
390
|
+
defaultMessage: 'Some macros may not work when adding synced blocks to new locations',
|
|
391
|
+
description: 'Title in flag which appears when an inline extension is inserted into a synced block'
|
|
392
|
+
},
|
|
393
|
+
inlineExtensionInSyncBlockDescription: {
|
|
394
|
+
id: 'fabric.editor.inlineExtensionInSyncBlockDescription',
|
|
395
|
+
defaultMessage: 'This may happen if your synced block is used in places that don\'t support certain macros.',
|
|
396
|
+
description: 'Description in flag which appears when an inline extension is inserted into a synced block'
|
|
387
397
|
}
|
|
388
398
|
});
|
|
@@ -4,7 +4,7 @@ import { isFedRamp } from './environment';
|
|
|
4
4
|
import { normaliseSentryBreadcrumbs, SERIALIZABLE_ATTRIBUTES } from './normalise-sentry-breadcrumbs';
|
|
5
5
|
const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
6
6
|
const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
7
|
-
const packageVersion = "
|
|
7
|
+
const packageVersion = "111.16.4";
|
|
8
8
|
const sanitiseSentryEvents = (data, _hint) => {
|
|
9
9
|
// Remove URL as it has UGC
|
|
10
10
|
// Ignored via go/ees007
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import React, { useCallback, memo, useRef } from 'react';
|
|
2
|
+
import { isSSR } from '../core-utils/is-ssr';
|
|
3
|
+
import { RenderMarker } from './RenderMarker';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Props for SSRRenderMeasure component
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
function SSRRenderMeasureImpl({
|
|
10
|
+
onSSRMeasure,
|
|
11
|
+
segmentName,
|
|
12
|
+
startTimestampRef,
|
|
13
|
+
children
|
|
14
|
+
}) {
|
|
15
|
+
const wasMeasured = useRef(false);
|
|
16
|
+
const handleOnRender = useCallback(() => {
|
|
17
|
+
if (wasMeasured.current) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
onSSRMeasure === null || onSSRMeasure === void 0 ? void 0 : onSSRMeasure({
|
|
21
|
+
segmentName,
|
|
22
|
+
startTimestamp: startTimestampRef.current,
|
|
23
|
+
endTimestamp: performance.now()
|
|
24
|
+
});
|
|
25
|
+
wasMeasured.current = true;
|
|
26
|
+
}, [onSSRMeasure, segmentName, startTimestampRef]);
|
|
27
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, children, /*#__PURE__*/React.createElement(RenderMarker, {
|
|
28
|
+
onRender: handleOnRender
|
|
29
|
+
}));
|
|
30
|
+
}
|
|
31
|
+
const SSRRenderMeasureNoOp = /*#__PURE__*/memo(({
|
|
32
|
+
children
|
|
33
|
+
}) => {
|
|
34
|
+
return children;
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Component for measuring render performance during Server-Side Rendering (SSR).
|
|
39
|
+
*
|
|
40
|
+
* This component wraps content to measure its render duration in SSR mode.
|
|
41
|
+
* On client builds, it's optimized to a no-op component with zero performance overhead.
|
|
42
|
+
* On SSR builds, it captures timing data and reports it via the `onSSRMeasure` callback.
|
|
43
|
+
*
|
|
44
|
+
* **How it works:**
|
|
45
|
+
* - Measures from `startTimestampRef.current` (component start) to when `RenderMarker` is rendered
|
|
46
|
+
* - Uses `RenderMarker` to detect when the render completes successfully
|
|
47
|
+
* - Only reports the measurement once (protected by `wasMeasured` ref)
|
|
48
|
+
* - If child components throw errors during render, the measurement will not be reported
|
|
49
|
+
*
|
|
50
|
+
* **Usage pattern:**
|
|
51
|
+
* 1. Create `startTimestampRef` as the **first line** in your component using `useRef(performance.now())`
|
|
52
|
+
* 2. Wrap your content with `SSRRenderMeasure` at the end of your component
|
|
53
|
+
* 3. Provide the `onSSRMeasure` callback to receive timing data
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* ```tsx
|
|
57
|
+
* function FullPageEditor({ onSSRMeasure }) {
|
|
58
|
+
* // CRITICAL: Must be the first line for accurate timing
|
|
59
|
+
* const startTimestampRef = useRef(performance.now());
|
|
60
|
+
*
|
|
61
|
+
* // ...component logic, hooks, etc.
|
|
62
|
+
*
|
|
63
|
+
* return (
|
|
64
|
+
* <SSRRenderMeasure
|
|
65
|
+
* segmentName="ssr-app/render/fullPageEditor"
|
|
66
|
+
* startTimestampRef={startTimestampRef}
|
|
67
|
+
* onSSRMeasure={onSSRMeasure}
|
|
68
|
+
* >
|
|
69
|
+
* <EditorContent />
|
|
70
|
+
* </SSRRenderMeasure>
|
|
71
|
+
* );
|
|
72
|
+
* }
|
|
73
|
+
* ```
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* ```tsx
|
|
77
|
+
* // Handling the measurement callback
|
|
78
|
+
* const handleSSRMeasure = (measure) => {
|
|
79
|
+
* const duration = measure.endTimestamp - measure.startTimestamp;
|
|
80
|
+
* console.log(`${measure.segmentName} rendered in ${duration}ms`);
|
|
81
|
+
* // Send to analytics, logging, etc.
|
|
82
|
+
* };
|
|
83
|
+
* ```
|
|
84
|
+
*/
|
|
85
|
+
export const SSRRenderMeasure = isSSR() ? SSRRenderMeasureImpl : SSRRenderMeasureNoOp;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { isSSR } from '../core-utils/is-ssr';
|
|
2
|
+
const profileSSROperationImpl = (segmentName, fn, onSSRMeasure) => {
|
|
3
|
+
if (!onSSRMeasure) {
|
|
4
|
+
return fn();
|
|
5
|
+
}
|
|
6
|
+
const startTimestamp = performance.now();
|
|
7
|
+
try {
|
|
8
|
+
return fn();
|
|
9
|
+
} finally {
|
|
10
|
+
onSSRMeasure({
|
|
11
|
+
segmentName,
|
|
12
|
+
startTimestamp,
|
|
13
|
+
endTimestamp: performance.now()
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
const profileSSROperationNoOp = (_segmentName, fn, _onSSRMeasure) => {
|
|
18
|
+
return fn();
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Profiles a synchronous operation during Server-Side Rendering (SSR).
|
|
23
|
+
*
|
|
24
|
+
* This function wraps an operation to measure its execution time in SSR mode.
|
|
25
|
+
* On client builds, the profiling is optimized away and the function executes normally.
|
|
26
|
+
* On SSR builds, it captures timing data using `performance.now()` and reports it via the callback.
|
|
27
|
+
*
|
|
28
|
+
* **Important notes:**
|
|
29
|
+
* - Profiling only occurs in SSR mode when `onSSRMeasure` is provided
|
|
30
|
+
* - Both `startTimestamp` and `endTimestamp` are absolute values from `performance.now()`, not relative times
|
|
31
|
+
* - Calculate duration as: `endTimestamp - startTimestamp`
|
|
32
|
+
* - The measurement is guaranteed to be reported even if the function throws an error (via `finally` block)
|
|
33
|
+
* - On client builds, this function has zero performance overhead
|
|
34
|
+
*
|
|
35
|
+
* @param segmentName - Identifier for the operation being measured (e.g., 'ssr-app/render/editor/createSchema')
|
|
36
|
+
* @param fn - The synchronous function to execute and profile
|
|
37
|
+
* @param onSSRMeasure - Optional callback to receive performance measurements
|
|
38
|
+
* @param onSSRMeasure.segmentName - Name of the measured segment
|
|
39
|
+
* @param onSSRMeasure.startTimestamp - Absolute timestamp when the operation started (from `performance.now()`)
|
|
40
|
+
* @param onSSRMeasure.endTimestamp - Absolute timestamp when the operation completed (from `performance.now()`)
|
|
41
|
+
*
|
|
42
|
+
* @returns The result of the executed function
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* // Profile schema creation during SSR
|
|
46
|
+
* const schema = profileSSROperation(
|
|
47
|
+
* 'ssr-app/render/editor/createSchema',
|
|
48
|
+
* () => createSchema(config),
|
|
49
|
+
* (measure) => {
|
|
50
|
+
* const duration = measure.endTimestamp - measure.startTimestamp;
|
|
51
|
+
* console.log(`${measure.segmentName}: ${duration}ms`);
|
|
52
|
+
* }
|
|
53
|
+
* );
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* // Without callback, executes normally
|
|
57
|
+
* const result = profileSSROperation('operation', () => expensiveCalculation());
|
|
58
|
+
*/
|
|
59
|
+
export const profileSSROperation = isSSR() ? profileSSROperationImpl : profileSSROperationNoOp;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
1
2
|
import { getOnlyFulfilled, waitForAllPromises, waitForFirstFulfilledPromise } from './promise-helpers';
|
|
2
3
|
const flatten = arr => [].concat(...arr);
|
|
3
4
|
|
|
@@ -11,7 +12,11 @@ export default (providers => {
|
|
|
11
12
|
}
|
|
12
13
|
const getFulfilledProviders = async () => {
|
|
13
14
|
const results = await waitForAllPromises(providers.map(result => Promise.resolve(result)));
|
|
14
|
-
|
|
15
|
+
if (!fg('platform_editor_fix_getautoconverter_null_error')) {
|
|
16
|
+
return getOnlyFulfilled(results);
|
|
17
|
+
}
|
|
18
|
+
// Filter out null/undefined providers to prevent errors when calling methods on them
|
|
19
|
+
return getOnlyFulfilled(results).filter(provider => provider != null);
|
|
15
20
|
};
|
|
16
21
|
const runInAllProviders = async mapFunction => {
|
|
17
22
|
return (await getFulfilledProviders()).map(provider => mapFunction(provider));
|
|
@@ -14,7 +14,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
|
14
14
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
15
15
|
import Layer from '../Layer';
|
|
16
16
|
const packageName = "@atlaskit/editor-common";
|
|
17
|
-
const packageVersion = "
|
|
17
|
+
const packageVersion = "111.16.4";
|
|
18
18
|
const halfFocusRing = 1;
|
|
19
19
|
const dropOffset = '0, 8';
|
|
20
20
|
const fadeIn = keyframes({
|
|
@@ -120,7 +120,7 @@ export { isPerformanceAPIAvailable, isPerformanceObserverAvailable } from './per
|
|
|
120
120
|
*
|
|
121
121
|
* Private API - should not be used. Use `@atlaskit/editor-common/performance/navigation` if required.
|
|
122
122
|
*/
|
|
123
|
-
export { getResponseEndTime } from './performance/navigation';
|
|
123
|
+
export { getRequestToResponseTime, getResponseEndTime } from './performance/navigation';
|
|
124
124
|
export { getExtensionRenderer } from './extension-handler';
|
|
125
125
|
export { hasMergedCell, getColumnWidths, calcTableColumnWidths, convertProsemirrorTableNodeToArrayOfRows, isPositionNearTableRow } from './table';
|
|
126
126
|
export { createCompareNodes } from './compareNodes';
|
|
@@ -8,4 +8,14 @@ export function getResponseEndTime() {
|
|
|
8
8
|
return nav.responseEnd;
|
|
9
9
|
}
|
|
10
10
|
return;
|
|
11
|
+
}
|
|
12
|
+
export function getRequestToResponseTime() {
|
|
13
|
+
if (!isPerformanceAPIAvailable()) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
const nav = performance.getEntriesByType('navigation')[0];
|
|
17
|
+
if (nav) {
|
|
18
|
+
return nav.responseEnd - nav.requestStart;
|
|
19
|
+
}
|
|
20
|
+
return;
|
|
11
21
|
}
|
|
@@ -384,5 +384,15 @@ export var syncBlockMessages = defineMessages({
|
|
|
384
384
|
id: 'fabric.editor.cannotCreateSyncBlockDescription',
|
|
385
385
|
defaultMessage: 'An error occurred while trying to create this synced block. ',
|
|
386
386
|
description: 'Description in flag which appears when a synced block cannot be created'
|
|
387
|
+
},
|
|
388
|
+
inlineExtensionInSyncBlockTitle: {
|
|
389
|
+
id: 'fabric.editor.inlineExtensionInSyncBlockTitle',
|
|
390
|
+
defaultMessage: 'Some macros may not work when adding synced blocks to new locations',
|
|
391
|
+
description: 'Title in flag which appears when an inline extension is inserted into a synced block'
|
|
392
|
+
},
|
|
393
|
+
inlineExtensionInSyncBlockDescription: {
|
|
394
|
+
id: 'fabric.editor.inlineExtensionInSyncBlockDescription',
|
|
395
|
+
defaultMessage: 'This may happen if your synced block is used in places that don\'t support certain macros.',
|
|
396
|
+
description: 'Description in flag which appears when an inline extension is inserted into a synced block'
|
|
387
397
|
}
|
|
388
398
|
});
|
|
@@ -10,7 +10,7 @@ import { isFedRamp } from './environment';
|
|
|
10
10
|
import { normaliseSentryBreadcrumbs, SERIALIZABLE_ATTRIBUTES } from './normalise-sentry-breadcrumbs';
|
|
11
11
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
12
12
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
13
|
-
var packageVersion = "
|
|
13
|
+
var packageVersion = "111.16.4";
|
|
14
14
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
15
15
|
// Remove URL as it has UGC
|
|
16
16
|
// Ignored via go/ees007
|