@atlaskit/renderer 119.0.4 → 119.0.6
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 +21 -0
- package/dist/cjs/react/nodes/tableRow.js +1 -1
- package/dist/cjs/render-document.js +1 -1
- package/dist/cjs/ui/Renderer/index.js +1 -3
- package/dist/cjs/ui/Renderer/useMemoFromPropsDerivative.js +17 -21
- package/dist/es2019/react/nodes/tableRow.js +1 -1
- package/dist/es2019/render-document.js +1 -1
- package/dist/es2019/ui/Renderer/index.js +1 -3
- package/dist/es2019/ui/Renderer/useMemoFromPropsDerivative.js +12 -16
- package/dist/esm/react/nodes/tableRow.js +1 -1
- package/dist/esm/render-document.js +1 -1
- package/dist/esm/ui/Renderer/index.js +1 -3
- package/dist/esm/ui/Renderer/useMemoFromPropsDerivative.js +17 -21
- package/package.json +6 -12
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# @atlaskit/renderer
|
|
2
2
|
|
|
3
|
+
## 119.0.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#176864](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/176864)
|
|
8
|
+
[`96f166a864047`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/96f166a864047) -
|
|
9
|
+
EDM-11898 removing all false snapshots for platform-linking-visual-refresh-v1 and renaming files
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
12
|
+
## 119.0.5
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- [#175776](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/175776)
|
|
17
|
+
[`43362c25c7806`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/43362c25c7806) -
|
|
18
|
+
Tidy up feature gate platform_editor_table_column_group_width_check_3
|
|
19
|
+
- [#175844](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/175844)
|
|
20
|
+
[`4b7a1f7498119`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/4b7a1f7498119) -
|
|
21
|
+
Tidy up feature gate cc_complexit_fe_reduce_fragment_serialization
|
|
22
|
+
- Updated dependencies
|
|
23
|
+
|
|
3
24
|
## 119.0.4
|
|
4
25
|
|
|
5
26
|
### Patch Changes
|
|
@@ -57,7 +57,7 @@ var TableRow = exports.default = /*#__PURE__*/function (_React$Component) {
|
|
|
57
57
|
});
|
|
58
58
|
(0, _defineProperty2.default)(_this, "addColGroupWidth", function (childrenArray) {
|
|
59
59
|
var _this$state$colGroupW;
|
|
60
|
-
if ((
|
|
60
|
+
if ((_this$state$colGroupW = _this.state.colGroupWidths) !== null && _this$state$colGroupW !== void 0 && _this$state$colGroupW.length) {
|
|
61
61
|
childrenArray = childrenArray.map(function (child, index) {
|
|
62
62
|
if ( /*#__PURE__*/_react.default.isValidElement(child)) {
|
|
63
63
|
return /*#__PURE__*/_react.default.cloneElement(child, {
|
|
@@ -99,7 +99,7 @@ var _validation = function _validation(doc, schema, adfStage, useSpecBasedValida
|
|
|
99
99
|
};
|
|
100
100
|
var memoValidation = (0, _memoizeOne.default)(_validation, function (newArgs, lastArgs) {
|
|
101
101
|
var result = false;
|
|
102
|
-
if ((0, _platformFeatureFlags.fg)('
|
|
102
|
+
if ((0, _platformFeatureFlags.fg)('cc_complexit_fe_memovalidation_redundant_calls_2')) {
|
|
103
103
|
var _newArgs = (0, _slicedToArray2.default)(newArgs, 7),
|
|
104
104
|
newDoc = _newArgs[0],
|
|
105
105
|
newSchema = _newArgs[1],
|
|
@@ -62,7 +62,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
62
62
|
var NORMAL_SEVERITY_THRESHOLD = exports.NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
63
63
|
var DEGRADED_SEVERITY_THRESHOLD = exports.DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
64
64
|
var packageName = "@atlaskit/renderer";
|
|
65
|
-
var packageVersion = "119.0.
|
|
65
|
+
var packageVersion = "119.0.5";
|
|
66
66
|
var setAsQueryContainerStyles = (0, _react2.css)({
|
|
67
67
|
containerName: 'ak-renderer-wrapper',
|
|
68
68
|
containerType: 'inline-size'
|
|
@@ -254,8 +254,6 @@ var RendererFunctionalComponent = exports.RendererFunctionalComponent = function
|
|
|
254
254
|
allowTableResizing: props.UNSTABLE_allowTableResizing
|
|
255
255
|
};
|
|
256
256
|
}, [createRendererContext, providerFactory, _fireAnalyticsEvent]);
|
|
257
|
-
|
|
258
|
-
// Abstract out the logic into its own function
|
|
259
257
|
var serializer = (0, _useMemoFromPropsDerivative.useMemoFromPropsDerivative)(function (serializerProps) {
|
|
260
258
|
// If progressive rendering is enabled, create a new serializer
|
|
261
259
|
if ((0, _platformFeatureFlags.fg)('cc_complexit_fe_progressive_adf_rendering')) {
|
|
@@ -7,33 +7,29 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.useMemoFromPropsDerivative = useMemoFromPropsDerivative;
|
|
8
8
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
9
9
|
var _react = require("react");
|
|
10
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
11
10
|
function useMemoFromPropsDerivative(factory, propsDerivator, props) {
|
|
12
11
|
// cache the last set of props
|
|
13
12
|
var prev = (0, _react.useRef)(props);
|
|
14
13
|
var prevFactory = (0, _react.useRef)(null);
|
|
15
14
|
return (0, _react.useMemo)(function () {
|
|
16
|
-
if
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
prev.current = props;
|
|
30
|
-
// If first time or any prop value has changed, create a new serializer
|
|
31
|
-
if (shouldCreate) {
|
|
32
|
-
prevFactory.current = factory(propsDerivator(props));
|
|
33
|
-
}
|
|
34
|
-
return prevFactory.current;
|
|
15
|
+
// check if the serializer is already created
|
|
16
|
+
var shouldCreate = !prevFactory.current;
|
|
17
|
+
// check each prop to see if value has changed and also check if the number of props has changed
|
|
18
|
+
if (prev.current !== props) {
|
|
19
|
+
var propsEntries = Object.entries(props);
|
|
20
|
+
shouldCreate = propsEntries.length !== Object.keys(prev.current).length || propsEntries.some(function (_ref) {
|
|
21
|
+
var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
|
|
22
|
+
key = _ref2[0],
|
|
23
|
+
prop = _ref2[1];
|
|
24
|
+
return prev.current[key] !== prop;
|
|
25
|
+
});
|
|
35
26
|
}
|
|
36
|
-
|
|
27
|
+
prev.current = props;
|
|
28
|
+
// If first time or any prop value has changed, create a new serializer
|
|
29
|
+
if (shouldCreate) {
|
|
30
|
+
prevFactory.current = factory(propsDerivator(props));
|
|
31
|
+
}
|
|
32
|
+
return prevFactory.current;
|
|
37
33
|
},
|
|
38
34
|
// To keep deps consistent, here disable the exhaustive-deps rule to drop factory from the deps array
|
|
39
35
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -41,7 +41,7 @@ export default class TableRow extends React.Component {
|
|
|
41
41
|
});
|
|
42
42
|
_defineProperty(this, "addColGroupWidth", childrenArray => {
|
|
43
43
|
var _this$state$colGroupW;
|
|
44
|
-
if (
|
|
44
|
+
if ((_this$state$colGroupW = this.state.colGroupWidths) !== null && _this$state$colGroupW !== void 0 && _this$state$colGroupW.length) {
|
|
45
45
|
childrenArray = childrenArray.map((child, index) => {
|
|
46
46
|
if ( /*#__PURE__*/React.isValidElement(child)) {
|
|
47
47
|
return /*#__PURE__*/React.cloneElement(child, {
|
|
@@ -93,7 +93,7 @@ const _validation = (doc, schema, adfStage, useSpecBasedValidator, dispatchAnaly
|
|
|
93
93
|
};
|
|
94
94
|
const memoValidation = memoizeOne(_validation, (newArgs, lastArgs) => {
|
|
95
95
|
let result = false;
|
|
96
|
-
if (fg('
|
|
96
|
+
if (fg('cc_complexit_fe_memovalidation_redundant_calls_2')) {
|
|
97
97
|
const [newDoc, newSchema, newADFStage, newUseSpecValidator,,
|
|
98
98
|
// ignoring dispatchAnalyticsEvent
|
|
99
99
|
newSkipValidation, newValidationOverrides] = newArgs;
|
|
@@ -48,7 +48,7 @@ import { PortalContext } from './PortalContext';
|
|
|
48
48
|
export const NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
49
49
|
export const DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
50
50
|
const packageName = "@atlaskit/renderer";
|
|
51
|
-
const packageVersion = "119.0.
|
|
51
|
+
const packageVersion = "119.0.5";
|
|
52
52
|
const setAsQueryContainerStyles = css({
|
|
53
53
|
containerName: 'ak-renderer-wrapper',
|
|
54
54
|
containerType: 'inline-size'
|
|
@@ -246,8 +246,6 @@ export const RendererFunctionalComponent = props => {
|
|
|
246
246
|
allowTableResizing: props.UNSTABLE_allowTableResizing
|
|
247
247
|
};
|
|
248
248
|
}, [createRendererContext, providerFactory, fireAnalyticsEvent]);
|
|
249
|
-
|
|
250
|
-
// Abstract out the logic into its own function
|
|
251
249
|
const serializer = useMemoFromPropsDerivative(serializerProps => {
|
|
252
250
|
// If progressive rendering is enabled, create a new serializer
|
|
253
251
|
if (fg('cc_complexit_fe_progressive_adf_rendering')) {
|
|
@@ -1,26 +1,22 @@
|
|
|
1
1
|
import { useMemo, useRef } from 'react';
|
|
2
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
2
|
export function useMemoFromPropsDerivative(factory, propsDerivator, props) {
|
|
4
3
|
// cache the last set of props
|
|
5
4
|
const prev = useRef(props);
|
|
6
5
|
const prevFactory = useRef(null);
|
|
7
6
|
return useMemo(() => {
|
|
8
|
-
if
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
shouldCreate = propsEntries.length !== Object.keys(prev.current).length || propsEntries.some(([key, prop]) => prev.current[key] !== prop);
|
|
15
|
-
}
|
|
16
|
-
prev.current = props;
|
|
17
|
-
// If first time or any prop value has changed, create a new serializer
|
|
18
|
-
if (shouldCreate) {
|
|
19
|
-
prevFactory.current = factory(propsDerivator(props));
|
|
20
|
-
}
|
|
21
|
-
return prevFactory.current;
|
|
7
|
+
// check if the serializer is already created
|
|
8
|
+
let shouldCreate = !prevFactory.current;
|
|
9
|
+
// check each prop to see if value has changed and also check if the number of props has changed
|
|
10
|
+
if (prev.current !== props) {
|
|
11
|
+
const propsEntries = Object.entries(props);
|
|
12
|
+
shouldCreate = propsEntries.length !== Object.keys(prev.current).length || propsEntries.some(([key, prop]) => prev.current[key] !== prop);
|
|
22
13
|
}
|
|
23
|
-
|
|
14
|
+
prev.current = props;
|
|
15
|
+
// If first time or any prop value has changed, create a new serializer
|
|
16
|
+
if (shouldCreate) {
|
|
17
|
+
prevFactory.current = factory(propsDerivator(props));
|
|
18
|
+
}
|
|
19
|
+
return prevFactory.current;
|
|
24
20
|
},
|
|
25
21
|
// To keep deps consistent, here disable the exhaustive-deps rule to drop factory from the deps array
|
|
26
22
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -50,7 +50,7 @@ var TableRow = /*#__PURE__*/function (_React$Component) {
|
|
|
50
50
|
});
|
|
51
51
|
_defineProperty(_this, "addColGroupWidth", function (childrenArray) {
|
|
52
52
|
var _this$state$colGroupW;
|
|
53
|
-
if (
|
|
53
|
+
if ((_this$state$colGroupW = _this.state.colGroupWidths) !== null && _this$state$colGroupW !== void 0 && _this$state$colGroupW.length) {
|
|
54
54
|
childrenArray = childrenArray.map(function (child, index) {
|
|
55
55
|
if ( /*#__PURE__*/React.isValidElement(child)) {
|
|
56
56
|
return /*#__PURE__*/React.cloneElement(child, {
|
|
@@ -92,7 +92,7 @@ var _validation = function _validation(doc, schema, adfStage, useSpecBasedValida
|
|
|
92
92
|
};
|
|
93
93
|
var memoValidation = memoizeOne(_validation, function (newArgs, lastArgs) {
|
|
94
94
|
var result = false;
|
|
95
|
-
if (fg('
|
|
95
|
+
if (fg('cc_complexit_fe_memovalidation_redundant_calls_2')) {
|
|
96
96
|
var _newArgs = _slicedToArray(newArgs, 7),
|
|
97
97
|
newDoc = _newArgs[0],
|
|
98
98
|
newSchema = _newArgs[1],
|
|
@@ -53,7 +53,7 @@ import { PortalContext } from './PortalContext';
|
|
|
53
53
|
export var NORMAL_SEVERITY_THRESHOLD = 2000;
|
|
54
54
|
export var DEGRADED_SEVERITY_THRESHOLD = 3000;
|
|
55
55
|
var packageName = "@atlaskit/renderer";
|
|
56
|
-
var packageVersion = "119.0.
|
|
56
|
+
var packageVersion = "119.0.5";
|
|
57
57
|
var setAsQueryContainerStyles = css({
|
|
58
58
|
containerName: 'ak-renderer-wrapper',
|
|
59
59
|
containerType: 'inline-size'
|
|
@@ -245,8 +245,6 @@ export var RendererFunctionalComponent = function RendererFunctionalComponent(pr
|
|
|
245
245
|
allowTableResizing: props.UNSTABLE_allowTableResizing
|
|
246
246
|
};
|
|
247
247
|
}, [createRendererContext, providerFactory, _fireAnalyticsEvent]);
|
|
248
|
-
|
|
249
|
-
// Abstract out the logic into its own function
|
|
250
248
|
var serializer = useMemoFromPropsDerivative(function (serializerProps) {
|
|
251
249
|
// If progressive rendering is enabled, create a new serializer
|
|
252
250
|
if (fg('cc_complexit_fe_progressive_adf_rendering')) {
|
|
@@ -1,32 +1,28 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
2
|
import { useMemo, useRef } from 'react';
|
|
3
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
3
|
export function useMemoFromPropsDerivative(factory, propsDerivator, props) {
|
|
5
4
|
// cache the last set of props
|
|
6
5
|
var prev = useRef(props);
|
|
7
6
|
var prevFactory = useRef(null);
|
|
8
7
|
return useMemo(function () {
|
|
9
|
-
if
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
prev.current = props;
|
|
23
|
-
// If first time or any prop value has changed, create a new serializer
|
|
24
|
-
if (shouldCreate) {
|
|
25
|
-
prevFactory.current = factory(propsDerivator(props));
|
|
26
|
-
}
|
|
27
|
-
return prevFactory.current;
|
|
8
|
+
// check if the serializer is already created
|
|
9
|
+
var shouldCreate = !prevFactory.current;
|
|
10
|
+
// check each prop to see if value has changed and also check if the number of props has changed
|
|
11
|
+
if (prev.current !== props) {
|
|
12
|
+
var propsEntries = Object.entries(props);
|
|
13
|
+
shouldCreate = propsEntries.length !== Object.keys(prev.current).length || propsEntries.some(function (_ref) {
|
|
14
|
+
var _ref2 = _slicedToArray(_ref, 2),
|
|
15
|
+
key = _ref2[0],
|
|
16
|
+
prop = _ref2[1];
|
|
17
|
+
return prev.current[key] !== prop;
|
|
18
|
+
});
|
|
28
19
|
}
|
|
29
|
-
|
|
20
|
+
prev.current = props;
|
|
21
|
+
// If first time or any prop value has changed, create a new serializer
|
|
22
|
+
if (shouldCreate) {
|
|
23
|
+
prevFactory.current = factory(propsDerivator(props));
|
|
24
|
+
}
|
|
25
|
+
return prevFactory.current;
|
|
30
26
|
},
|
|
31
27
|
// To keep deps consistent, here disable the exhaustive-deps rule to drop factory from the deps array
|
|
32
28
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/renderer",
|
|
3
|
-
"version": "119.0.
|
|
3
|
+
"version": "119.0.6",
|
|
4
4
|
"description": "Renderer component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -47,16 +47,16 @@
|
|
|
47
47
|
"@atlaskit/media-client-react": "^4.1.0",
|
|
48
48
|
"@atlaskit/media-common": "^12.2.0",
|
|
49
49
|
"@atlaskit/media-filmstrip": "^51.0.0",
|
|
50
|
-
"@atlaskit/media-ui": "^28.
|
|
50
|
+
"@atlaskit/media-ui": "^28.5.0",
|
|
51
51
|
"@atlaskit/media-viewer": "^52.3.0",
|
|
52
52
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
53
53
|
"@atlaskit/platform-feature-flags-react": "^0.2.0",
|
|
54
54
|
"@atlaskit/react-ufo": "^3.14.0",
|
|
55
|
-
"@atlaskit/smart-card": "^38.
|
|
55
|
+
"@atlaskit/smart-card": "^38.16.0",
|
|
56
56
|
"@atlaskit/status": "^3.0.0",
|
|
57
57
|
"@atlaskit/task-decision": "^19.2.0",
|
|
58
58
|
"@atlaskit/theme": "^18.0.0",
|
|
59
|
-
"@atlaskit/tmp-editor-statsig": "^8.
|
|
59
|
+
"@atlaskit/tmp-editor-statsig": "^8.3.0",
|
|
60
60
|
"@atlaskit/tokens": "^5.4.0",
|
|
61
61
|
"@atlaskit/tooltip": "^20.3.0",
|
|
62
62
|
"@atlaskit/visually-hidden": "^3.0.0",
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"@atlaskit/checkbox": "^17.1.0",
|
|
83
83
|
"@atlaskit/css-reset": "^7.3.0",
|
|
84
84
|
"@atlaskit/link-provider": "^3.3.0",
|
|
85
|
-
"@atlaskit/link-test-helpers": "^8.
|
|
85
|
+
"@atlaskit/link-test-helpers": "^8.1.0",
|
|
86
86
|
"@atlaskit/linking-common": "^9.1.0",
|
|
87
87
|
"@atlaskit/media-core": "^37.0.0",
|
|
88
88
|
"@atlaskit/media-integration-test-helpers": "workspace:^",
|
|
@@ -142,9 +142,6 @@
|
|
|
142
142
|
"cc_complexit_reduce_portal_rerenders": {
|
|
143
143
|
"type": "boolean"
|
|
144
144
|
},
|
|
145
|
-
"cc_complexit_fe_reduce_fragment_serialization": {
|
|
146
|
-
"type": "boolean"
|
|
147
|
-
},
|
|
148
145
|
"cc_complexit_fe_reduce_rerender_2": {
|
|
149
146
|
"type": "boolean"
|
|
150
147
|
},
|
|
@@ -215,10 +212,7 @@
|
|
|
215
212
|
"platform_renderer_triple_click_selects_paragraph": {
|
|
216
213
|
"type": "boolean"
|
|
217
214
|
},
|
|
218
|
-
"
|
|
219
|
-
"type": "boolean"
|
|
220
|
-
},
|
|
221
|
-
"cc_complexit_fe_memoValidation_redundant_calls": {
|
|
215
|
+
"cc_complexit_fe_memovalidation_redundant_calls_2": {
|
|
222
216
|
"type": "boolean"
|
|
223
217
|
},
|
|
224
218
|
"cc_complexit_fe_progressive_adf_rendering": {
|