@atlaskit/react-ufo 2.0.2 → 2.0.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 CHANGED
@@ -1,5 +1,21 @@
1
1
  # @atlaskit/ufo-interaction-ignore
2
2
 
3
+ ## 2.0.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [#157826](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/157826)
8
+ [`cd0465f950cb6`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/cd0465f950cb6) -
9
+ Added count of network calls
10
+
11
+ ## 2.0.3
12
+
13
+ ### Patch Changes
14
+
15
+ - [#157758](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/157758)
16
+ [`0a582096048e6`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/0a582096048e6) -
17
+ add vc clean field to post interaction log
18
+
3
19
  ## 2.0.2
4
20
 
5
21
  ### Patch Changes
@@ -138,15 +138,19 @@ function createPostInteractionLogPayload(_ref2) {
138
138
  var lastInteractionFinishEnd = Math.round(lastInteractionFinish.end);
139
139
  var lastInteractionFinishTTAI = Math.round(lastInteractionFinish.end - lastInteractionFinish.start);
140
140
  var lastInteractionFinishVC90 = null;
141
+ var lastInteractionFinishVCClean = false;
141
142
  if (lastInteractionFinishVCResult !== null && lastInteractionFinishVCResult !== void 0 && lastInteractionFinishVCResult['ufo:vc:state']) {
142
143
  var _lastInteractionFinis;
144
+ lastInteractionFinishVCClean = true;
143
145
  var lastInteractionFinishVCMetrics = lastInteractionFinishVCResult === null || lastInteractionFinishVCResult === void 0 ? void 0 : lastInteractionFinishVCResult['metrics:vc'];
144
146
  lastInteractionFinishVC90 = (_lastInteractionFinis = lastInteractionFinishVCMetrics[90]) !== null && _lastInteractionFinis !== void 0 ? _lastInteractionFinis : null;
145
147
  }
146
148
  var postInteractionFinishVCRatios = {};
147
149
  var revisedVC90 = null;
148
150
  var postInteractionFinishVCUpdates = [];
151
+ var postInteractionFinishVCClean = false;
149
152
  if (postInteractionFinishVCResult !== null && postInteractionFinishVCResult !== void 0 && postInteractionFinishVCResult['ufo:vc:state']) {
153
+ postInteractionFinishVCClean = true;
150
154
  postInteractionFinishVCRatios = postInteractionFinishVCResult === null || postInteractionFinishVCResult === void 0 ? void 0 : postInteractionFinishVCResult['ufo:vc:ratios'];
151
155
  postInteractionFinishVCUpdates = postInteractionFinishVCResult === null || postInteractionFinishVCResult === void 0 ? void 0 : postInteractionFinishVCResult['ufo:vc:updates'];
152
156
  var postInteractionFinishVCMetrics = postInteractionFinishVCResult === null || postInteractionFinishVCResult === void 0 ? void 0 : postInteractionFinishVCResult['metrics:vc'];
@@ -193,11 +197,13 @@ function createPostInteractionLogPayload(_ref2) {
193
197
  start: lastInteractionFinishStart,
194
198
  end: lastInteractionFinishEnd,
195
199
  ttai: lastInteractionFinishTTAI,
196
- vc90: lastInteractionFinishVC90
200
+ vc90: lastInteractionFinishVC90,
201
+ vcClean: lastInteractionFinishVCClean
197
202
  }),
198
203
  revisedEndTime: revisedEndTime,
199
204
  revisedTtai: revisedTtai,
200
205
  revisedVC90: revisedVC90,
206
+ vcClean: postInteractionFinishVCClean,
201
207
  lateMutations: lateMutations,
202
208
  reactProfilerTimings: transformReactProfilerTimings(reactProfilerTimings)
203
209
  }
@@ -126,7 +126,11 @@ var getResourceTimings = exports.getResourceTimings = function getResourceTiming
126
126
  return;
127
127
  }
128
128
  var url = resourceTypes.includes(initiatorType) ? sanitiseEndpoints(name) : mapResources(name);
129
- if (!url || resourceTiming[url]) {
129
+ if (!url) {
130
+ return;
131
+ }
132
+ if (resourceTiming[url]) {
133
+ resourceTiming[url].count = (resourceTiming[url].count || 1) + 1;
130
134
  return;
131
135
  }
132
136
  resourceTiming[url] = _objectSpread({
@@ -8,7 +8,6 @@ exports.SSRPlaceholderHandlers = 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 _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
12
11
  var EQUALITY_THRESHOLD = 0.1;
13
12
  var ANCESTOR_LOOKUP_LIMIT = 10;
14
13
  var SSRPlaceholderHandlers = exports.SSRPlaceholderHandlers = /*#__PURE__*/function () {
@@ -55,9 +54,9 @@ var SSRPlaceholderHandlers = exports.SSRPlaceholderHandlers = /*#__PURE__*/funct
55
54
  }
56
55
  });
57
56
  this.intersectionObserver = new IntersectionObserver(function (entries) {
58
- return (0, _platformFeatureFlags.fg)('no_ssr_placeholder_check_when_not_intersecting') ? entries.filter(function (entry) {
57
+ return entries.filter(function (entry) {
59
58
  return entry.intersectionRatio > 0;
60
- }).forEach(_this.intersectionObserverCallback) : entries.forEach(_this.intersectionObserverCallback);
59
+ }).forEach(_this.intersectionObserverCallback);
61
60
  });
62
61
  if (window.document) {
63
62
  try {
@@ -123,15 +123,19 @@ export default function createPostInteractionLogPayload({
123
123
  const lastInteractionFinishEnd = Math.round(lastInteractionFinish.end);
124
124
  const lastInteractionFinishTTAI = Math.round(lastInteractionFinish.end - lastInteractionFinish.start);
125
125
  let lastInteractionFinishVC90 = null;
126
+ let lastInteractionFinishVCClean = false;
126
127
  if (lastInteractionFinishVCResult !== null && lastInteractionFinishVCResult !== void 0 && lastInteractionFinishVCResult['ufo:vc:state']) {
127
128
  var _lastInteractionFinis;
129
+ lastInteractionFinishVCClean = true;
128
130
  const lastInteractionFinishVCMetrics = lastInteractionFinishVCResult === null || lastInteractionFinishVCResult === void 0 ? void 0 : lastInteractionFinishVCResult['metrics:vc'];
129
131
  lastInteractionFinishVC90 = (_lastInteractionFinis = lastInteractionFinishVCMetrics[90]) !== null && _lastInteractionFinis !== void 0 ? _lastInteractionFinis : null;
130
132
  }
131
133
  let postInteractionFinishVCRatios = {};
132
134
  let revisedVC90 = null;
133
135
  let postInteractionFinishVCUpdates = [];
136
+ let postInteractionFinishVCClean = false;
134
137
  if (postInteractionFinishVCResult !== null && postInteractionFinishVCResult !== void 0 && postInteractionFinishVCResult['ufo:vc:state']) {
138
+ postInteractionFinishVCClean = true;
135
139
  postInteractionFinishVCRatios = postInteractionFinishVCResult === null || postInteractionFinishVCResult === void 0 ? void 0 : postInteractionFinishVCResult['ufo:vc:ratios'];
136
140
  postInteractionFinishVCUpdates = postInteractionFinishVCResult === null || postInteractionFinishVCResult === void 0 ? void 0 : postInteractionFinishVCResult['ufo:vc:updates'];
137
141
  const postInteractionFinishVCMetrics = postInteractionFinishVCResult === null || postInteractionFinishVCResult === void 0 ? void 0 : postInteractionFinishVCResult['metrics:vc'];
@@ -174,11 +178,13 @@ export default function createPostInteractionLogPayload({
174
178
  start: lastInteractionFinishStart,
175
179
  end: lastInteractionFinishEnd,
176
180
  ttai: lastInteractionFinishTTAI,
177
- vc90: lastInteractionFinishVC90
181
+ vc90: lastInteractionFinishVC90,
182
+ vcClean: lastInteractionFinishVCClean
178
183
  },
179
184
  revisedEndTime,
180
185
  revisedTtai,
181
186
  revisedVC90,
187
+ vcClean: postInteractionFinishVCClean,
182
188
  lateMutations,
183
189
  reactProfilerTimings: transformReactProfilerTimings(reactProfilerTimings)
184
190
  }
@@ -114,7 +114,11 @@ export const getResourceTimings = (interactionStart, interactionEnd) => {
114
114
  return;
115
115
  }
116
116
  const url = resourceTypes.includes(initiatorType) ? sanitiseEndpoints(name) : mapResources(name);
117
- if (!url || resourceTiming[url]) {
117
+ if (!url) {
118
+ return;
119
+ }
120
+ if (resourceTiming[url]) {
121
+ resourceTiming[url].count = (resourceTiming[url].count || 1) + 1;
118
122
  return;
119
123
  }
120
124
  resourceTiming[url] = {
@@ -1,5 +1,4 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
- import { fg } from '@atlaskit/platform-feature-flags';
3
2
  const EQUALITY_THRESHOLD = 0.1;
4
3
  const ANCESTOR_LOOKUP_LIMIT = 10;
5
4
  export class SSRPlaceholderHandlers {
@@ -44,7 +43,7 @@ export class SSRPlaceholderHandlers {
44
43
  this.reactValidateCallbacks.delete(staticKey);
45
44
  }
46
45
  });
47
- this.intersectionObserver = new IntersectionObserver(entries => fg('no_ssr_placeholder_check_when_not_intersecting') ? entries.filter(entry => entry.intersectionRatio > 0).forEach(this.intersectionObserverCallback) : entries.forEach(this.intersectionObserverCallback));
46
+ this.intersectionObserver = new IntersectionObserver(entries => entries.filter(entry => entry.intersectionRatio > 0).forEach(this.intersectionObserverCallback));
48
47
  if (window.document) {
49
48
  try {
50
49
  const existingElements = document.querySelectorAll('[data-ssr-placeholder]');
@@ -131,15 +131,19 @@ export default function createPostInteractionLogPayload(_ref2) {
131
131
  var lastInteractionFinishEnd = Math.round(lastInteractionFinish.end);
132
132
  var lastInteractionFinishTTAI = Math.round(lastInteractionFinish.end - lastInteractionFinish.start);
133
133
  var lastInteractionFinishVC90 = null;
134
+ var lastInteractionFinishVCClean = false;
134
135
  if (lastInteractionFinishVCResult !== null && lastInteractionFinishVCResult !== void 0 && lastInteractionFinishVCResult['ufo:vc:state']) {
135
136
  var _lastInteractionFinis;
137
+ lastInteractionFinishVCClean = true;
136
138
  var lastInteractionFinishVCMetrics = lastInteractionFinishVCResult === null || lastInteractionFinishVCResult === void 0 ? void 0 : lastInteractionFinishVCResult['metrics:vc'];
137
139
  lastInteractionFinishVC90 = (_lastInteractionFinis = lastInteractionFinishVCMetrics[90]) !== null && _lastInteractionFinis !== void 0 ? _lastInteractionFinis : null;
138
140
  }
139
141
  var postInteractionFinishVCRatios = {};
140
142
  var revisedVC90 = null;
141
143
  var postInteractionFinishVCUpdates = [];
144
+ var postInteractionFinishVCClean = false;
142
145
  if (postInteractionFinishVCResult !== null && postInteractionFinishVCResult !== void 0 && postInteractionFinishVCResult['ufo:vc:state']) {
146
+ postInteractionFinishVCClean = true;
143
147
  postInteractionFinishVCRatios = postInteractionFinishVCResult === null || postInteractionFinishVCResult === void 0 ? void 0 : postInteractionFinishVCResult['ufo:vc:ratios'];
144
148
  postInteractionFinishVCUpdates = postInteractionFinishVCResult === null || postInteractionFinishVCResult === void 0 ? void 0 : postInteractionFinishVCResult['ufo:vc:updates'];
145
149
  var postInteractionFinishVCMetrics = postInteractionFinishVCResult === null || postInteractionFinishVCResult === void 0 ? void 0 : postInteractionFinishVCResult['metrics:vc'];
@@ -186,11 +190,13 @@ export default function createPostInteractionLogPayload(_ref2) {
186
190
  start: lastInteractionFinishStart,
187
191
  end: lastInteractionFinishEnd,
188
192
  ttai: lastInteractionFinishTTAI,
189
- vc90: lastInteractionFinishVC90
193
+ vc90: lastInteractionFinishVC90,
194
+ vcClean: lastInteractionFinishVCClean
190
195
  }),
191
196
  revisedEndTime: revisedEndTime,
192
197
  revisedTtai: revisedTtai,
193
198
  revisedVC90: revisedVC90,
199
+ vcClean: postInteractionFinishVCClean,
194
200
  lateMutations: lateMutations,
195
201
  reactProfilerTimings: transformReactProfilerTimings(reactProfilerTimings)
196
202
  }
@@ -119,7 +119,11 @@ export var getResourceTimings = function getResourceTimings(interactionStart, in
119
119
  return;
120
120
  }
121
121
  var url = resourceTypes.includes(initiatorType) ? sanitiseEndpoints(name) : mapResources(name);
122
- if (!url || resourceTiming[url]) {
122
+ if (!url) {
123
+ return;
124
+ }
125
+ if (resourceTiming[url]) {
126
+ resourceTiming[url].count = (resourceTiming[url].count || 1) + 1;
123
127
  return;
124
128
  }
125
129
  resourceTiming[url] = _objectSpread({
@@ -1,7 +1,6 @@
1
1
  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
- import { fg } from '@atlaskit/platform-feature-flags';
5
4
  var EQUALITY_THRESHOLD = 0.1;
6
5
  var ANCESTOR_LOOKUP_LIMIT = 10;
7
6
  export var SSRPlaceholderHandlers = /*#__PURE__*/function () {
@@ -48,9 +47,9 @@ export var SSRPlaceholderHandlers = /*#__PURE__*/function () {
48
47
  }
49
48
  });
50
49
  this.intersectionObserver = new IntersectionObserver(function (entries) {
51
- return fg('no_ssr_placeholder_check_when_not_intersecting') ? entries.filter(function (entry) {
50
+ return entries.filter(function (entry) {
52
51
  return entry.intersectionRatio > 0;
53
- }).forEach(_this.intersectionObserverCallback) : entries.forEach(_this.intersectionObserverCallback);
52
+ }).forEach(_this.intersectionObserverCallback);
54
53
  });
55
54
  if (window.document) {
56
55
  try {
@@ -24,6 +24,7 @@ export default function createPostInteractionLogPayload({ lastInteractionFinish,
24
24
  end: number;
25
25
  ttai: number;
26
26
  vc90: number | null;
27
+ vcClean: boolean;
27
28
  type: import("../common").InteractionType;
28
29
  id: string;
29
30
  abortReason?: import("../common").AbortReasonType | undefined;
@@ -33,6 +34,7 @@ export default function createPostInteractionLogPayload({ lastInteractionFinish,
33
34
  revisedEndTime: number;
34
35
  revisedTtai: number;
35
36
  revisedVC90: number | null;
37
+ vcClean: boolean;
36
38
  lateMutations: {
37
39
  time: number;
38
40
  element: string;
@@ -25,6 +25,7 @@ interface BasicResourceTiming {
25
25
  type: string;
26
26
  workerStart: number;
27
27
  fetchStart: number;
28
+ count?: number;
28
29
  }
29
30
  interface CacheableResourceTiming extends BasicResourceTiming {
30
31
  transferType: string;
@@ -24,6 +24,7 @@ export default function createPostInteractionLogPayload({ lastInteractionFinish,
24
24
  end: number;
25
25
  ttai: number;
26
26
  vc90: number | null;
27
+ vcClean: boolean;
27
28
  type: import("../common").InteractionType;
28
29
  id: string;
29
30
  abortReason?: import("../common").AbortReasonType | undefined;
@@ -33,6 +34,7 @@ export default function createPostInteractionLogPayload({ lastInteractionFinish,
33
34
  revisedEndTime: number;
34
35
  revisedTtai: number;
35
36
  revisedVC90: number | null;
37
+ vcClean: boolean;
36
38
  lateMutations: {
37
39
  time: number;
38
40
  element: string;
@@ -25,6 +25,7 @@ interface BasicResourceTiming {
25
25
  type: string;
26
26
  workerStart: number;
27
27
  fetchStart: number;
28
+ count?: number;
28
29
  }
29
30
  interface CacheableResourceTiming extends BasicResourceTiming {
30
31
  transferType: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/react-ufo",
3
- "version": "2.0.2",
3
+ "version": "2.0.4",
4
4
  "description": "Parts of React UFO that are publicly available",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",