@atlaskit/react-ufo 3.5.1 → 3.5.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 +16 -0
- package/dist/cjs/assets/index.js +4 -2
- package/dist/cjs/vc/vc-observer/index.js +4 -9
- package/dist/es2019/assets/index.js +4 -2
- package/dist/es2019/vc/vc-observer/index.js +4 -5
- package/dist/esm/assets/index.js +4 -2
- package/dist/esm/vc/vc-observer/index.js +4 -9
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/ufo-interaction-ignore
|
|
2
2
|
|
|
3
|
+
## 3.5.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#141178](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/141178)
|
|
8
|
+
[`c85827a02e305`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c85827a02e305) -
|
|
9
|
+
clean up fg platform_ufo_vc_filter_ignored_items
|
|
10
|
+
|
|
11
|
+
## 3.5.2
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#140777](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/140777)
|
|
16
|
+
[`8fa57c7e71b24`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/8fa57c7e71b24) -
|
|
17
|
+
Filtering out assets with NaN values reported as file size
|
|
18
|
+
|
|
3
19
|
## 3.5.1
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/dist/cjs/assets/index.js
CHANGED
|
@@ -8,6 +8,7 @@ exports.CHRSummary = exports.CHRReporter = void 0;
|
|
|
8
8
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
9
9
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
10
|
var _defineProperty4 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
11
12
|
var _selfMeasurements = require("../self-measurements");
|
|
12
13
|
var _utils = require("./utils");
|
|
13
14
|
var _CHRSummary;
|
|
@@ -69,8 +70,9 @@ var CHRReporter = exports.CHRReporter = /*#__PURE__*/function () {
|
|
|
69
70
|
if (!(0, _utils.checkIfTimingsAvailable)(entry)) {
|
|
70
71
|
return;
|
|
71
72
|
}
|
|
72
|
-
|
|
73
|
-
|
|
73
|
+
var hasNanValues = (0, _platformFeatureFlags.fg)('platform_ufo_assets_check_for_nan') ? entry.encodedSize === undefined || entry.encodedSize === null : false;
|
|
74
|
+
if (entry.encodedSize === entry.decodedSize || hasNanValues) {
|
|
75
|
+
// incorrectly reported or lack of size
|
|
74
76
|
return;
|
|
75
77
|
}
|
|
76
78
|
var type = (0, _utils.getTypeOfRequest)(entry);
|
|
@@ -708,7 +708,6 @@ _VCObserver = VCObserver;
|
|
|
708
708
|
|
|
709
709
|
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
710
710
|
var isCalcSpeedIndexEnabled = (0, _platformFeatureFlags.fg)('ufo-calc-speed-index');
|
|
711
|
-
var isFilterIgnoredItemsEnabled = (0, _platformFeatureFlags.fg)('platform_ufo_vc_filter_ignored_items');
|
|
712
711
|
entries.reduce(function () {
|
|
713
712
|
var acc = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
714
713
|
var v = arguments.length > 1 ? arguments[1] : undefined;
|
|
@@ -721,32 +720,28 @@ _VCObserver = VCObserver;
|
|
|
721
720
|
_VCObserver.VCParts.forEach(function (key) {
|
|
722
721
|
var value = parseInt(key, 10);
|
|
723
722
|
if ((VC[key] === null || VC[key] === undefined) && VCRatio >= value / 100) {
|
|
724
|
-
var _componentsLog$time
|
|
723
|
+
var _componentsLog$time;
|
|
725
724
|
VC[key] = time;
|
|
726
|
-
VCBox[key] =
|
|
725
|
+
VCBox[key] = (0, _toConsumableArray2.default)(new Set((_componentsLog$time = componentsLog[time]) === null || _componentsLog$time === void 0 ? void 0 : _componentsLog$time.filter(function (v) {
|
|
727
726
|
return !v.ignoreReason;
|
|
728
727
|
}).map(function (v) {
|
|
729
728
|
return v.targetName;
|
|
730
|
-
}))) : (0, _toConsumableArray2.default)(new Set((_componentsLog$time2 = componentsLog[time]) === null || _componentsLog$time2 === void 0 ? void 0 : _componentsLog$time2.map(function (v) {
|
|
731
|
-
return v.targetName;
|
|
732
729
|
})));
|
|
733
730
|
}
|
|
734
731
|
});
|
|
735
732
|
return VCRatio;
|
|
736
733
|
}, 0);
|
|
737
734
|
var VCEntries = entries.reduce(function (acc, _ref16, i) {
|
|
738
|
-
var _acc$abs, _componentsLog$timest,
|
|
735
|
+
var _acc$abs, _componentsLog$timest, _acc$rel$vc, _acc$rel;
|
|
739
736
|
var _ref17 = (0, _slicedToArray2.default)(_ref16, 2),
|
|
740
737
|
timestamp = _ref17[0],
|
|
741
738
|
entryPainted = _ref17[1];
|
|
742
739
|
var currentlyPainted = entryPainted + (((_acc$abs = acc.abs[i - 1]) === null || _acc$abs === void 0 ? void 0 : _acc$abs[1]) || 0);
|
|
743
740
|
var currentlyPaintedRatio = Math.round(currentlyPainted / totalPainted * 1000) / 10;
|
|
744
|
-
var logEntry =
|
|
741
|
+
var logEntry = (0, _toConsumableArray2.default)(new Set((_componentsLog$timest = componentsLog[timestamp]) === null || _componentsLog$timest === void 0 ? void 0 : _componentsLog$timest.filter(function (v) {
|
|
745
742
|
return !v.ignoreReason;
|
|
746
743
|
}).map(function (v) {
|
|
747
744
|
return v.targetName;
|
|
748
|
-
}))) : (0, _toConsumableArray2.default)(new Set((_componentsLog$timest2 = componentsLog[timestamp]) === null || _componentsLog$timest2 === void 0 ? void 0 : _componentsLog$timest2.map(function (v) {
|
|
749
|
-
return v.targetName;
|
|
750
745
|
})));
|
|
751
746
|
var ratioDelta = (currentlyPaintedRatio - ((_acc$rel$vc = (_acc$rel = acc.rel[i - 1]) === null || _acc$rel === void 0 ? void 0 : _acc$rel.vc) !== null && _acc$rel$vc !== void 0 ? _acc$rel$vc : 0)) / 100;
|
|
752
747
|
if (isCalcSpeedIndexEnabled) {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
var _CHRSummary;
|
|
3
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
4
|
import { withProfiling } from '../self-measurements';
|
|
4
5
|
import { calculateTransferType, checkIfTimingsAvailable, DISK_KEY, getTypeOfRequest, MEMORY_KEY, NETWORK_KEY, round } from './utils';
|
|
5
6
|
export class CHRSummary {
|
|
@@ -62,8 +63,9 @@ export class CHRReporter {
|
|
|
62
63
|
if (!checkIfTimingsAvailable(entry)) {
|
|
63
64
|
return;
|
|
64
65
|
}
|
|
65
|
-
|
|
66
|
-
|
|
66
|
+
const hasNanValues = fg('platform_ufo_assets_check_for_nan') ? entry.encodedSize === undefined || entry.encodedSize === null : false;
|
|
67
|
+
if (entry.encodedSize === entry.decodedSize || hasNanValues) {
|
|
68
|
+
// incorrectly reported or lack of size
|
|
67
69
|
return;
|
|
68
70
|
}
|
|
69
71
|
const type = getTypeOfRequest(entry);
|
|
@@ -693,7 +693,6 @@ _defineProperty(VCObserver, "calculateVC", withProfiling(function calculateVC({
|
|
|
693
693
|
|
|
694
694
|
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
695
695
|
const isCalcSpeedIndexEnabled = fg('ufo-calc-speed-index');
|
|
696
|
-
const isFilterIgnoredItemsEnabled = fg('platform_ufo_vc_filter_ignored_items');
|
|
697
696
|
entries.reduce((acc = 0, v) => {
|
|
698
697
|
const currRatio = v[1] / totalPainted;
|
|
699
698
|
let VCRatio = currRatio + acc;
|
|
@@ -704,18 +703,18 @@ _defineProperty(VCObserver, "calculateVC", withProfiling(function calculateVC({
|
|
|
704
703
|
_VCObserver.VCParts.forEach(key => {
|
|
705
704
|
const value = parseInt(key, 10);
|
|
706
705
|
if ((VC[key] === null || VC[key] === undefined) && VCRatio >= value / 100) {
|
|
707
|
-
var _componentsLog$time
|
|
706
|
+
var _componentsLog$time;
|
|
708
707
|
VC[key] = time;
|
|
709
|
-
VCBox[key] =
|
|
708
|
+
VCBox[key] = [...new Set((_componentsLog$time = componentsLog[time]) === null || _componentsLog$time === void 0 ? void 0 : _componentsLog$time.filter(v => !v.ignoreReason).map(v => v.targetName))];
|
|
710
709
|
}
|
|
711
710
|
});
|
|
712
711
|
return VCRatio;
|
|
713
712
|
}, 0);
|
|
714
713
|
const VCEntries = entries.reduce((acc, [timestamp, entryPainted], i) => {
|
|
715
|
-
var _acc$abs, _componentsLog$timest,
|
|
714
|
+
var _acc$abs, _componentsLog$timest, _acc$rel$vc, _acc$rel;
|
|
716
715
|
const currentlyPainted = entryPainted + (((_acc$abs = acc.abs[i - 1]) === null || _acc$abs === void 0 ? void 0 : _acc$abs[1]) || 0);
|
|
717
716
|
const currentlyPaintedRatio = Math.round(currentlyPainted / totalPainted * 1000) / 10;
|
|
718
|
-
const logEntry =
|
|
717
|
+
const logEntry = [...new Set((_componentsLog$timest = componentsLog[timestamp]) === null || _componentsLog$timest === void 0 ? void 0 : _componentsLog$timest.filter(v => !v.ignoreReason).map(v => v.targetName))];
|
|
719
718
|
const ratioDelta = (currentlyPaintedRatio - ((_acc$rel$vc = (_acc$rel = acc.rel[i - 1]) === null || _acc$rel === void 0 ? void 0 : _acc$rel.vc) !== null && _acc$rel$vc !== void 0 ? _acc$rel$vc : 0)) / 100;
|
|
720
719
|
if (isCalcSpeedIndexEnabled) {
|
|
721
720
|
const speedIndex = timestamp * ratioDelta;
|
package/dist/esm/assets/index.js
CHANGED
|
@@ -2,6 +2,7 @@ import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
|
2
2
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
3
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
4
4
|
var _CHRSummary;
|
|
5
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
5
6
|
import { withProfiling } from '../self-measurements';
|
|
6
7
|
import { calculateTransferType, checkIfTimingsAvailable, DISK_KEY, getTypeOfRequest, MEMORY_KEY, NETWORK_KEY, round } from './utils';
|
|
7
8
|
export var CHRSummary = /*#__PURE__*/function () {
|
|
@@ -62,8 +63,9 @@ export var CHRReporter = /*#__PURE__*/function () {
|
|
|
62
63
|
if (!checkIfTimingsAvailable(entry)) {
|
|
63
64
|
return;
|
|
64
65
|
}
|
|
65
|
-
|
|
66
|
-
|
|
66
|
+
var hasNanValues = fg('platform_ufo_assets_check_for_nan') ? entry.encodedSize === undefined || entry.encodedSize === null : false;
|
|
67
|
+
if (entry.encodedSize === entry.decodedSize || hasNanValues) {
|
|
68
|
+
// incorrectly reported or lack of size
|
|
67
69
|
return;
|
|
68
70
|
}
|
|
69
71
|
var type = getTypeOfRequest(entry);
|
|
@@ -701,7 +701,6 @@ _defineProperty(VCObserver, "calculateVC", withProfiling(function calculateVC(_r
|
|
|
701
701
|
|
|
702
702
|
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
703
703
|
var isCalcSpeedIndexEnabled = fg('ufo-calc-speed-index');
|
|
704
|
-
var isFilterIgnoredItemsEnabled = fg('platform_ufo_vc_filter_ignored_items');
|
|
705
704
|
entries.reduce(function () {
|
|
706
705
|
var acc = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
707
706
|
var v = arguments.length > 1 ? arguments[1] : undefined;
|
|
@@ -714,32 +713,28 @@ _defineProperty(VCObserver, "calculateVC", withProfiling(function calculateVC(_r
|
|
|
714
713
|
_VCObserver.VCParts.forEach(function (key) {
|
|
715
714
|
var value = parseInt(key, 10);
|
|
716
715
|
if ((VC[key] === null || VC[key] === undefined) && VCRatio >= value / 100) {
|
|
717
|
-
var _componentsLog$time
|
|
716
|
+
var _componentsLog$time;
|
|
718
717
|
VC[key] = time;
|
|
719
|
-
VCBox[key] =
|
|
718
|
+
VCBox[key] = _toConsumableArray(new Set((_componentsLog$time = componentsLog[time]) === null || _componentsLog$time === void 0 ? void 0 : _componentsLog$time.filter(function (v) {
|
|
720
719
|
return !v.ignoreReason;
|
|
721
720
|
}).map(function (v) {
|
|
722
721
|
return v.targetName;
|
|
723
|
-
}))) : _toConsumableArray(new Set((_componentsLog$time2 = componentsLog[time]) === null || _componentsLog$time2 === void 0 ? void 0 : _componentsLog$time2.map(function (v) {
|
|
724
|
-
return v.targetName;
|
|
725
722
|
})));
|
|
726
723
|
}
|
|
727
724
|
});
|
|
728
725
|
return VCRatio;
|
|
729
726
|
}, 0);
|
|
730
727
|
var VCEntries = entries.reduce(function (acc, _ref16, i) {
|
|
731
|
-
var _acc$abs, _componentsLog$timest,
|
|
728
|
+
var _acc$abs, _componentsLog$timest, _acc$rel$vc, _acc$rel;
|
|
732
729
|
var _ref17 = _slicedToArray(_ref16, 2),
|
|
733
730
|
timestamp = _ref17[0],
|
|
734
731
|
entryPainted = _ref17[1];
|
|
735
732
|
var currentlyPainted = entryPainted + (((_acc$abs = acc.abs[i - 1]) === null || _acc$abs === void 0 ? void 0 : _acc$abs[1]) || 0);
|
|
736
733
|
var currentlyPaintedRatio = Math.round(currentlyPainted / totalPainted * 1000) / 10;
|
|
737
|
-
var logEntry =
|
|
734
|
+
var logEntry = _toConsumableArray(new Set((_componentsLog$timest = componentsLog[timestamp]) === null || _componentsLog$timest === void 0 ? void 0 : _componentsLog$timest.filter(function (v) {
|
|
738
735
|
return !v.ignoreReason;
|
|
739
736
|
}).map(function (v) {
|
|
740
737
|
return v.targetName;
|
|
741
|
-
}))) : _toConsumableArray(new Set((_componentsLog$timest2 = componentsLog[timestamp]) === null || _componentsLog$timest2 === void 0 ? void 0 : _componentsLog$timest2.map(function (v) {
|
|
742
|
-
return v.targetName;
|
|
743
738
|
})));
|
|
744
739
|
var ratioDelta = (currentlyPaintedRatio - ((_acc$rel$vc = (_acc$rel = acc.rel[i - 1]) === null || _acc$rel === void 0 ? void 0 : _acc$rel.vc) !== null && _acc$rel$vc !== void 0 ? _acc$rel$vc : 0)) / 100;
|
|
745
740
|
if (isCalcSpeedIndexEnabled) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/react-ufo",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.3",
|
|
4
4
|
"description": "Parts of React UFO that are publicly available",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -178,10 +178,10 @@
|
|
|
178
178
|
"platform_ufo_disable_ttvc_v1": {
|
|
179
179
|
"type": "boolean"
|
|
180
180
|
},
|
|
181
|
-
"
|
|
181
|
+
"platform_ufo_vc_fix_ignore_image_mutation": {
|
|
182
182
|
"type": "boolean"
|
|
183
183
|
},
|
|
184
|
-
"
|
|
184
|
+
"platform_ufo_assets_check_for_nan": {
|
|
185
185
|
"type": "boolean"
|
|
186
186
|
},
|
|
187
187
|
"platform_ufo_log_attr_mutation_values": {
|