@atlaskit/react-ufo 3.5.2 → 3.6.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 CHANGED
@@ -1,5 +1,21 @@
1
1
  # @atlaskit/ufo-interaction-ignore
2
2
 
3
+ ## 3.6.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#142786](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/142786)
8
+ [`056a68c075470`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/056a68c075470) -
9
+ Added check before applying filter to postInteractionFinshVCUpdates
10
+
11
+ ## 3.5.3
12
+
13
+ ### Patch Changes
14
+
15
+ - [#141178](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/141178)
16
+ [`c85827a02e305`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c85827a02e305) -
17
+ clean up fg platform_ufo_vc_filter_ignored_items
18
+
3
19
  ## 3.5.2
4
20
 
5
21
  ### Patch Changes
@@ -162,7 +162,7 @@ var createPostInteractionLogPayload = (0, _selfMeasurements.withProfiling)(funct
162
162
  revisedVC90 = (_postInteractionFinis = postInteractionFinishVCMetrics[90]) !== null && _postInteractionFinis !== void 0 ? _postInteractionFinis : null;
163
163
  }
164
164
  }
165
- var lateMutations = postInteractionFinishVCUpdates.filter(function (entry) {
165
+ var lateMutations = postInteractionFinishVCUpdates ? postInteractionFinishVCUpdates.filter(function (entry) {
166
166
  return entry.time > lastInteractionFinish.end;
167
167
  }).flatMap(function (_ref3) {
168
168
  var time = _ref3.time,
@@ -174,7 +174,7 @@ var createPostInteractionLogPayload = (0, _selfMeasurements.withProfiling)(funct
174
174
  viewportHeatmapPercentage: postInteractionFinishVCRatios[element]
175
175
  };
176
176
  });
177
- });
177
+ }) : [];
178
178
  return {
179
179
  actionSubject: 'experience',
180
180
  action: 'measured',
@@ -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, _componentsLog$time2;
723
+ var _componentsLog$time;
725
724
  VC[key] = time;
726
- VCBox[key] = isFilterIgnoredItemsEnabled ? (0, _toConsumableArray2.default)(new Set((_componentsLog$time = componentsLog[time]) === null || _componentsLog$time === void 0 ? void 0 : _componentsLog$time.filter(function (v) {
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, _componentsLog$timest2, _acc$rel$vc, _acc$rel;
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 = isFilterIgnoredItemsEnabled ? (0, _toConsumableArray2.default)(new Set((_componentsLog$timest = componentsLog[timestamp]) === null || _componentsLog$timest === void 0 ? void 0 : _componentsLog$timest.filter(function (v) {
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) {
@@ -147,14 +147,14 @@ const createPostInteractionLogPayload = withProfiling(function createPostInterac
147
147
  revisedVC90 = (_postInteractionFinis = postInteractionFinishVCMetrics[90]) !== null && _postInteractionFinis !== void 0 ? _postInteractionFinis : null;
148
148
  }
149
149
  }
150
- const lateMutations = postInteractionFinishVCUpdates.filter(entry => entry.time > lastInteractionFinish.end).flatMap(({
150
+ const lateMutations = postInteractionFinishVCUpdates ? postInteractionFinishVCUpdates.filter(entry => entry.time > lastInteractionFinish.end).flatMap(({
151
151
  time,
152
152
  elements
153
153
  }) => Array.from(new Set(elements)).map(element => ({
154
154
  time,
155
155
  element,
156
156
  viewportHeatmapPercentage: postInteractionFinishVCRatios[element]
157
- })));
157
+ }))) : [];
158
158
  return {
159
159
  actionSubject: 'experience',
160
160
  action: 'measured',
@@ -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, _componentsLog$time2;
706
+ var _componentsLog$time;
708
707
  VC[key] = time;
709
- VCBox[key] = isFilterIgnoredItemsEnabled ? [...new Set((_componentsLog$time = componentsLog[time]) === null || _componentsLog$time === void 0 ? void 0 : _componentsLog$time.filter(v => !v.ignoreReason).map(v => v.targetName))] : [...new Set((_componentsLog$time2 = componentsLog[time]) === null || _componentsLog$time2 === void 0 ? void 0 : _componentsLog$time2.map(v => v.targetName))];
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, _componentsLog$timest2, _acc$rel$vc, _acc$rel;
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 = isFilterIgnoredItemsEnabled ? [...new Set((_componentsLog$timest = componentsLog[timestamp]) === null || _componentsLog$timest === void 0 ? void 0 : _componentsLog$timest.filter(v => !v.ignoreReason).map(v => v.targetName))] : [...new Set((_componentsLog$timest2 = componentsLog[timestamp]) === null || _componentsLog$timest2 === void 0 ? void 0 : _componentsLog$timest2.map(v => v.targetName))];
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;
@@ -155,7 +155,7 @@ var createPostInteractionLogPayload = withProfiling(function createPostInteracti
155
155
  revisedVC90 = (_postInteractionFinis = postInteractionFinishVCMetrics[90]) !== null && _postInteractionFinis !== void 0 ? _postInteractionFinis : null;
156
156
  }
157
157
  }
158
- var lateMutations = postInteractionFinishVCUpdates.filter(function (entry) {
158
+ var lateMutations = postInteractionFinishVCUpdates ? postInteractionFinishVCUpdates.filter(function (entry) {
159
159
  return entry.time > lastInteractionFinish.end;
160
160
  }).flatMap(function (_ref3) {
161
161
  var time = _ref3.time,
@@ -167,7 +167,7 @@ var createPostInteractionLogPayload = withProfiling(function createPostInteracti
167
167
  viewportHeatmapPercentage: postInteractionFinishVCRatios[element]
168
168
  };
169
169
  });
170
- });
170
+ }) : [];
171
171
  return {
172
172
  actionSubject: 'experience',
173
173
  action: 'measured',
@@ -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, _componentsLog$time2;
716
+ var _componentsLog$time;
718
717
  VC[key] = time;
719
- VCBox[key] = isFilterIgnoredItemsEnabled ? _toConsumableArray(new Set((_componentsLog$time = componentsLog[time]) === null || _componentsLog$time === void 0 ? void 0 : _componentsLog$time.filter(function (v) {
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, _componentsLog$timest2, _acc$rel$vc, _acc$rel;
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 = isFilterIgnoredItemsEnabled ? _toConsumableArray(new Set((_componentsLog$timest = componentsLog[timestamp]) === null || _componentsLog$timest === void 0 ? void 0 : _componentsLog$timest.filter(function (v) {
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.2",
3
+ "version": "3.6.0",
4
4
  "description": "Parts of React UFO that are publicly available",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -178,9 +178,6 @@
178
178
  "platform_ufo_disable_ttvc_v1": {
179
179
  "type": "boolean"
180
180
  },
181
- "platform_ufo_vc_filter_ignored_items": {
182
- "type": "boolean"
183
- },
184
181
  "platform_ufo_vc_fix_ignore_image_mutation": {
185
182
  "type": "boolean"
186
183
  },