@atlaskit/react-ufo 4.2.6 → 4.3.1

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.
Files changed (69) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/additional-payload/package.json +1 -1
  3. package/bundle-eval-timing/package.json +1 -1
  4. package/coinflip/package.json +1 -1
  5. package/common/package.json +1 -1
  6. package/config/package.json +1 -1
  7. package/create-experimental-interaction-metrics-payload/package.json +1 -1
  8. package/create-payload/package.json +1 -1
  9. package/create-post-interaction-log-payload/package.json +1 -1
  10. package/custom-cohort-data/package.json +1 -1
  11. package/custom-data/package.json +1 -1
  12. package/custom-mark/package.json +1 -1
  13. package/custom-spans/package.json +1 -1
  14. package/custom-timings/package.json +1 -1
  15. package/dist/cjs/config/index.js +39 -24
  16. package/dist/cjs/create-payload/index.js +13 -5
  17. package/dist/cjs/interaction-metrics/index.js +1 -0
  18. package/dist/cjs/resource-timing/main.js +1 -2
  19. package/dist/cjs/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.js +26 -22
  20. package/dist/es2019/config/index.js +14 -0
  21. package/dist/es2019/create-payload/index.js +11 -1
  22. package/dist/es2019/interaction-metrics/index.js +2 -1
  23. package/dist/es2019/resource-timing/main.js +1 -2
  24. package/dist/es2019/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.js +4 -0
  25. package/dist/esm/config/index.js +38 -24
  26. package/dist/esm/create-payload/index.js +13 -5
  27. package/dist/esm/interaction-metrics/index.js +2 -1
  28. package/dist/esm/resource-timing/main.js +1 -2
  29. package/dist/esm/vc/vc-observer-new/metric-calculator/abstract-base-vc-calculator.js +26 -22
  30. package/dist/types/common/common/types.d.ts +2 -0
  31. package/dist/types/config/index.d.ts +24 -0
  32. package/dist/types/create-payload/index.d.ts +25346 -146
  33. package/dist/types-ts4.5/common/common/types.d.ts +2 -0
  34. package/dist/types-ts4.5/config/index.d.ts +24 -0
  35. package/dist/types-ts4.5/create-payload/index.d.ts +25346 -146
  36. package/experience-trace-id-context/package.json +1 -1
  37. package/feature-flags-accessed/package.json +1 -1
  38. package/generate-id/package.json +1 -1
  39. package/global-error-handler/package.json +1 -1
  40. package/hidden-timing/package.json +1 -1
  41. package/initial-page-load-extra-timing/package.json +1 -1
  42. package/interaction-context/package.json +1 -1
  43. package/interaction-id-context/package.json +1 -1
  44. package/interaction-ignore/package.json +1 -1
  45. package/interaction-metrics/package.json +1 -1
  46. package/interaction-metrics-init/package.json +1 -1
  47. package/label/package.json +1 -1
  48. package/load-hold/package.json +1 -1
  49. package/package.json +4 -4
  50. package/placeholder/package.json +1 -1
  51. package/resource-timing/package.json +1 -1
  52. package/round-number/package.json +1 -1
  53. package/route-name/package.json +1 -1
  54. package/route-name-context/package.json +1 -1
  55. package/segment/package.json +1 -1
  56. package/set-interaction-error/package.json +1 -1
  57. package/short-id/package.json +1 -1
  58. package/ssr/package.json +1 -1
  59. package/ssr-scripts/package.json +1 -1
  60. package/suspense/package.json +1 -1
  61. package/trace-interaction/package.json +1 -1
  62. package/trace-pageload/package.json +1 -1
  63. package/trace-press/package.json +1 -1
  64. package/trace-redirect/package.json +1 -1
  65. package/trace-transition/package.json +1 -1
  66. package/typing-performance-tracing/package.json +1 -1
  67. package/use-press-tracing/package.json +1 -1
  68. package/vc/package.json +1 -1
  69. package/vc-media/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @atlaskit/ufo-interaction-ignore
2
2
 
3
+ ## 4.3.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`3f6614a936a5e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/3f6614a936a5e) -
8
+ Send vc100
9
+
10
+ ## 4.3.0
11
+
12
+ ### Minor Changes
13
+
14
+ - [`45299e3f3ebab`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/45299e3f3ebab) -
15
+ Add React hydration property to UFO metrics for initial page load
16
+
3
17
  ## 4.2.6
4
18
 
5
19
  ### Patch Changes
@@ -6,7 +6,7 @@
6
6
  "sideEffects": false,
7
7
  "types": "../dist/types/additional-payload/index.d.ts",
8
8
  "typesVersions": {
9
- ">=4.5 <5.4": {
9
+ ">=4.5 <5.9": {
10
10
  "*": [
11
11
  "../dist/types-ts4.5/additional-payload/index.d.ts"
12
12
  ]
@@ -6,7 +6,7 @@
6
6
  "sideEffects": false,
7
7
  "types": "../dist/types/bundle-eval-timing/index.d.ts",
8
8
  "typesVersions": {
9
- ">=4.5 <5.4": {
9
+ ">=4.5 <5.9": {
10
10
  "*": [
11
11
  "../dist/types-ts4.5/bundle-eval-timing/index.d.ts"
12
12
  ]
@@ -6,7 +6,7 @@
6
6
  "sideEffects": false,
7
7
  "types": "../dist/types/coinflip/index.d.ts",
8
8
  "typesVersions": {
9
- ">=4.5 <5.4": {
9
+ ">=4.5 <5.9": {
10
10
  "*": [
11
11
  "../dist/types-ts4.5/coinflip/index.d.ts"
12
12
  ]
@@ -6,7 +6,7 @@
6
6
  "sideEffects": false,
7
7
  "types": "../dist/types/common/index.d.ts",
8
8
  "typesVersions": {
9
- ">=4.5 <5.4": {
9
+ ">=4.5 <5.9": {
10
10
  "*": [
11
11
  "../dist/types-ts4.5/common/index.d.ts"
12
12
  ]
@@ -6,7 +6,7 @@
6
6
  "sideEffects": false,
7
7
  "types": "../dist/types/config/index.d.ts",
8
8
  "typesVersions": {
9
- ">=4.5 <5.4": {
9
+ ">=4.5 <5.9": {
10
10
  "*": [
11
11
  "../dist/types-ts4.5/config/index.d.ts"
12
12
  ]
@@ -6,7 +6,7 @@
6
6
  "sideEffects": false,
7
7
  "types": "../dist/types/create-experimental-interaction-metrics-payload/index.d.ts",
8
8
  "typesVersions": {
9
- ">=4.5 <5.4": {
9
+ ">=4.5 <5.9": {
10
10
  "*": [
11
11
  "../dist/types-ts4.5/create-experimental-interaction-metrics-payload/index.d.ts"
12
12
  ]
@@ -6,7 +6,7 @@
6
6
  "sideEffects": false,
7
7
  "types": "../dist/types/create-payload/index.d.ts",
8
8
  "typesVersions": {
9
- ">=4.5 <5.4": {
9
+ ">=4.5 <5.9": {
10
10
  "*": [
11
11
  "../dist/types-ts4.5/create-payload/index.d.ts"
12
12
  ]
@@ -6,7 +6,7 @@
6
6
  "sideEffects": false,
7
7
  "types": "../dist/types/create-post-interaction-log-payload/index.d.ts",
8
8
  "typesVersions": {
9
- ">=4.5 <5.4": {
9
+ ">=4.5 <5.9": {
10
10
  "*": [
11
11
  "../dist/types-ts4.5/create-post-interaction-log-payload/index.d.ts"
12
12
  ]
@@ -6,7 +6,7 @@
6
6
  "sideEffects": false,
7
7
  "types": "../dist/types/custom-cohort-data/index.d.ts",
8
8
  "typesVersions": {
9
- ">=4.5 <5.4": {
9
+ ">=4.5 <5.9": {
10
10
  "*": [
11
11
  "../dist/types-ts4.5/custom-cohort-data/index.d.ts"
12
12
  ]
@@ -6,7 +6,7 @@
6
6
  "sideEffects": false,
7
7
  "types": "../dist/types/custom-data/index.d.ts",
8
8
  "typesVersions": {
9
- ">=4.5 <5.4": {
9
+ ">=4.5 <5.9": {
10
10
  "*": [
11
11
  "../dist/types-ts4.5/custom-data/index.d.ts"
12
12
  ]
@@ -6,7 +6,7 @@
6
6
  "sideEffects": false,
7
7
  "types": "../dist/types/custom-mark/index.d.ts",
8
8
  "typesVersions": {
9
- ">=4.5 <5.4": {
9
+ ">=4.5 <5.9": {
10
10
  "*": [
11
11
  "../dist/types-ts4.5/custom-mark/index.d.ts"
12
12
  ]
@@ -6,7 +6,7 @@
6
6
  "sideEffects": false,
7
7
  "types": "../dist/types/custom-spans/index.d.ts",
8
8
  "typesVersions": {
9
- ">=4.5 <5.4": {
9
+ ">=4.5 <5.9": {
10
10
  "*": [
11
11
  "../dist/types-ts4.5/custom-spans/index.d.ts"
12
12
  ]
@@ -6,7 +6,7 @@
6
6
  "sideEffects": false,
7
7
  "types": "../dist/types/custom-timings/index.d.ts",
8
8
  "typesVersions": {
9
- ">=4.5 <5.4": {
9
+ ">=4.5 <5.9": {
10
10
  "*": [
11
11
  "../dist/types-ts4.5/custom-timings/index.d.ts"
12
12
  ]
@@ -16,6 +16,7 @@ exports.getInteractionRate = getInteractionRate;
16
16
  exports.getInteractionTimeout = getInteractionTimeout;
17
17
  exports.getMostRecentVCRevision = getMostRecentVCRevision;
18
18
  exports.getPostInteractionRate = getPostInteractionRate;
19
+ exports.getReactHydrationStats = getReactHydrationStats;
19
20
  exports.getTypingPerformanceTracingMethod = getTypingPerformanceTracingMethod;
20
21
  exports.getUfoNameOverrides = getUfoNameOverrides;
21
22
  exports.isVCRevisionEnabled = isVCRevisionEnabled;
@@ -90,17 +91,31 @@ function getMostRecentVCRevision() {
90
91
  var enabledVCRevisions = getEnabledVCRevisions(experienceKey);
91
92
  return enabledVCRevisions[enabledVCRevisions.length - 1];
92
93
  }
94
+ function getReactHydrationStats() {
95
+ if (!config) {
96
+ return undefined;
97
+ }
98
+ try {
99
+ var _config, _config$getReactHydra;
100
+ var stats = (_config = config) === null || _config === void 0 || (_config$getReactHydra = _config.getReactHydrationStats) === null || _config$getReactHydra === void 0 ? void 0 : _config$getReactHydra.call(_config);
101
+ return stats !== null && stats !== void 0 ? stats : undefined;
102
+ } catch (e) {
103
+ // eslint-disable-next-line no-console
104
+ console.error('getReactHydrationStats threw an error: ', e);
105
+ return undefined;
106
+ }
107
+ }
93
108
  function getInteractionRate(name, interactionKind) {
94
109
  try {
95
110
  if (!config) {
96
111
  return 0;
97
112
  }
98
- var _config = config,
99
- killswitch = _config.killswitch,
100
- rates = _config.rates,
101
- rules = _config.rules,
102
- kind = _config.kind,
103
- autoGeneratedRate = _config.autoGeneratedRate;
113
+ var _config2 = config,
114
+ killswitch = _config2.killswitch,
115
+ rates = _config2.rates,
116
+ rules = _config2.rules,
117
+ kind = _config2.kind,
118
+ autoGeneratedRate = _config2.autoGeneratedRate;
104
119
  if (killswitch != null) {
105
120
  // Specifically kill certain events
106
121
  if (killswitch.includes(name)) {
@@ -150,8 +165,8 @@ function getExperimentalInteractionRate(name, interactionType) {
150
165
  if (!config) {
151
166
  return 0;
152
167
  }
153
- var _config2 = config,
154
- experimentalInteractionMetrics = _config2.experimentalInteractionMetrics;
168
+ var _config3 = config,
169
+ experimentalInteractionMetrics = _config3.experimentalInteractionMetrics;
155
170
  if (!(experimentalInteractionMetrics !== null && experimentalInteractionMetrics !== void 0 && experimentalInteractionMetrics.enabled)) {
156
171
  return 0;
157
172
  }
@@ -171,8 +186,8 @@ function getPostInteractionRate(name, interactionType) {
171
186
  if (!config) {
172
187
  return 0;
173
188
  }
174
- var _config3 = config,
175
- postInteractionLog = _config3.postInteractionLog;
189
+ var _config4 = config,
190
+ postInteractionLog = _config4.postInteractionLog;
176
191
  if (!(postInteractionLog !== null && postInteractionLog !== void 0 && postInteractionLog.enabled)) {
177
192
  return 0;
178
193
  }
@@ -198,8 +213,8 @@ function getCapabilityRate(capability) {
198
213
  if (!config) {
199
214
  return 0;
200
215
  }
201
- var _config4 = config,
202
- capabilityRate = _config4.capability;
216
+ var _config5 = config,
217
+ capabilityRate = _config5.capability;
203
218
  if (capabilityRate != null) {
204
219
  var rate = capabilityRate[capability];
205
220
  if (rate != null) {
@@ -218,8 +233,8 @@ function getTypingPerformanceTracingMethod() {
218
233
  if (!config) {
219
234
  return defaultMethod;
220
235
  }
221
- var _config5 = config,
222
- typingMethod = _config5.typingMethod;
236
+ var _config6 = config,
237
+ typingMethod = _config6.typingMethod;
223
238
  if (typingMethod != null && validTypingMethods.find(function (m) {
224
239
  return m === typingMethod;
225
240
  })) {
@@ -238,8 +253,8 @@ function getAwaitBM3TTIList() {
238
253
  if (!config) {
239
254
  return [];
240
255
  }
241
- var _config6 = config,
242
- awaitBM3TTI = _config6.awaitBM3TTI;
256
+ var _config7 = config,
257
+ awaitBM3TTI = _config7.awaitBM3TTI;
243
258
  if (awaitBM3TTI != null) {
244
259
  return awaitBM3TTI;
245
260
  } else {
@@ -259,8 +274,8 @@ function getUfoNameOverrides() {
259
274
  if (!config) {
260
275
  return undefined;
261
276
  }
262
- var _config7 = config,
263
- ufoNameOverrides = _config7.ufoNameOverrides;
277
+ var _config8 = config,
278
+ ufoNameOverrides = _config8.ufoNameOverrides;
264
279
  if (ufoNameOverrides != null) {
265
280
  return ufoNameOverrides;
266
281
  }
@@ -276,8 +291,8 @@ function getDoNotAbortActivePressInteraction() {
276
291
  if (!config) {
277
292
  return undefined;
278
293
  }
279
- var _config8 = config,
280
- doNotAbortActivePressInteraction = _config8.doNotAbortActivePressInteraction;
294
+ var _config9 = config,
295
+ doNotAbortActivePressInteraction = _config9.doNotAbortActivePressInteraction;
281
296
  return doNotAbortActivePressInteraction;
282
297
  } catch (e) {
283
298
  return undefined;
@@ -290,8 +305,8 @@ function getDoNotAbortActivePressInteractionOnTransition() {
290
305
  if (!config) {
291
306
  return undefined;
292
307
  }
293
- var _config9 = config,
294
- doNotAbortActivePressInteractionOnTransition = _config9.doNotAbortActivePressInteractionOnTransition;
308
+ var _config0 = config,
309
+ doNotAbortActivePressInteractionOnTransition = _config0.doNotAbortActivePressInteractionOnTransition;
295
310
  return doNotAbortActivePressInteractionOnTransition;
296
311
  } catch (e) {
297
312
  return undefined;
@@ -303,8 +318,8 @@ function getInteractionTimeout(ufoName) {
303
318
  if (!config) {
304
319
  return CLEANUP_TIMEOUT;
305
320
  }
306
- var _config0 = config,
307
- interactionTimeout = _config0.interactionTimeout;
321
+ var _config1 = config,
322
+ interactionTimeout = _config1.interactionTimeout;
308
323
  if (interactionTimeout != null && interactionTimeout[ufoName] != null) {
309
324
  return interactionTimeout[ufoName];
310
325
  }
@@ -582,7 +582,7 @@ function createInteractionMetricsPayload(_x, _x2, _x3, _x4, _x5) {
582
582
  function _createInteractionMetricsPayload() {
583
583
  _createInteractionMetricsPayload = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(interaction, interactionId, experimental, criticalPayloadCount, vcMetrics) {
584
584
  var _window$location, _config$additionalPay;
585
- var interactionPayloadStart, config, end, start, ufoName, knownSegments, rate, type, abortReason, routeName, featureFlags, previousInteractionName, isPreviousInteractionAborted, abortedByInteractionName, responsiveness, unknownElementName, unknownElementHierarchy, pageVisibilityAtTTI, pageVisibilityAtTTAI, segments, segmentTree, isDetailedPayload, isPageLoad, calculatePageVisibilityFromTheStartOfPageLoad, moreAccuratePageVisibilityAtTTI, moreAccuratePageVisibilityAtTTAI, labelStack, getInitialPageLoadSSRMetrics, pageLoadInteractionMetrics, getDetailedInteractionMetrics, getPageLoadDetailedInteractionMetrics, newUFOName, resourceTimings, _yield$Promise$all, _yield$Promise$all2, finalVCMetrics, experimentalMetrics, paintMetrics, payload;
585
+ var interactionPayloadStart, config, end, start, ufoName, knownSegments, rate, type, abortReason, routeName, featureFlags, previousInteractionName, isPreviousInteractionAborted, abortedByInteractionName, responsiveness, unknownElementName, unknownElementHierarchy, hydration, pageVisibilityAtTTI, pageVisibilityAtTTAI, segments, segmentTree, isDetailedPayload, isPageLoad, calculatePageVisibilityFromTheStartOfPageLoad, moreAccuratePageVisibilityAtTTI, moreAccuratePageVisibilityAtTTAI, labelStack, getInitialPageLoadSSRMetrics, pageLoadInteractionMetrics, getDetailedInteractionMetrics, getPageLoadDetailedInteractionMetrics, newUFOName, resourceTimings, _yield$Promise$all, _yield$Promise$all2, finalVCMetrics, experimentalMetrics, paintMetrics, getReactHydrationStats, payload;
586
586
  return _regenerator.default.wrap(function _callee$(_context) {
587
587
  while (1) switch (_context.prev = _context.next) {
588
588
  case 0:
@@ -594,7 +594,7 @@ function _createInteractionMetricsPayload() {
594
594
  }
595
595
  throw Error('UFO Configuration not provided');
596
596
  case 4:
597
- end = interaction.end, start = interaction.start, ufoName = interaction.ufoName, knownSegments = interaction.knownSegments, rate = interaction.rate, type = interaction.type, abortReason = interaction.abortReason, routeName = interaction.routeName, featureFlags = interaction.featureFlags, previousInteractionName = interaction.previousInteractionName, isPreviousInteractionAborted = interaction.isPreviousInteractionAborted, abortedByInteractionName = interaction.abortedByInteractionName, responsiveness = interaction.responsiveness, unknownElementName = interaction.unknownElementName, unknownElementHierarchy = interaction.unknownElementHierarchy;
597
+ end = interaction.end, start = interaction.start, ufoName = interaction.ufoName, knownSegments = interaction.knownSegments, rate = interaction.rate, type = interaction.type, abortReason = interaction.abortReason, routeName = interaction.routeName, featureFlags = interaction.featureFlags, previousInteractionName = interaction.previousInteractionName, isPreviousInteractionAborted = interaction.isPreviousInteractionAborted, abortedByInteractionName = interaction.abortedByInteractionName, responsiveness = interaction.responsiveness, unknownElementName = interaction.unknownElementName, unknownElementHierarchy = interaction.unknownElementHierarchy, hydration = interaction.hydration;
598
598
  pageVisibilityAtTTI = getPageVisibilityUpToTTI(interaction);
599
599
  pageVisibilityAtTTAI = (0, _getPageVisibilityUpToTtai.default)(interaction);
600
600
  segments = !(0, _platformFeatureFlags.fg)('platform_ufo_remove_deprecated_config_fields') && config.killswitchNestedSegments ? [] : knownSegments;
@@ -707,6 +707,14 @@ function _createInteractionMetricsPayload() {
707
707
  if (!experimental) {
708
708
  (0, _platformFeatureFlags.fg)('ufo_chrome_devtools_uplift') && (0, _addPerformanceMeasures.addPerformanceMeasures)(interaction.start, (0, _toConsumableArray2.default)((finalVCMetrics === null || finalVCMetrics === void 0 ? void 0 : finalVCMetrics['ufo:vc:rev']) || []));
709
709
  }
710
+ getReactHydrationStats = function getReactHydrationStats() {
711
+ if (!isPageLoad || !hydration) {
712
+ return {};
713
+ }
714
+ return {
715
+ hydration: hydration
716
+ };
717
+ };
710
718
  payload = {
711
719
  actionSubject: 'experience',
712
720
  action: 'measured',
@@ -714,7 +722,7 @@ function _createInteractionMetricsPayload() {
714
722
  source: 'measured',
715
723
  tags: ['observability'],
716
724
  attributes: {
717
- properties: _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
725
+ properties: _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
718
726
  // basic
719
727
  'event:hostname': ((_window$location = window.location) === null || _window$location === void 0 ? void 0 : _window$location.hostname) || 'unknown',
720
728
  'event:product': config.product,
@@ -733,7 +741,7 @@ function _createInteractionMetricsPayload() {
733
741
  }, criticalPayloadCount !== undefined ? {
734
742
  'ufo:multipayload': true,
735
743
  'ufo:criticalPayloadCount': criticalPayloadCount
736
- } : {}), (0, _getBrowserMetadata.getBrowserMetadataToLegacyFormat)()), getSSRProperties(type)), getAssetsMetrics(interaction, pageLoadInteractionMetrics === null || pageLoadInteractionMetrics === void 0 ? void 0 : pageLoadInteractionMetrics.SSRDoneTime)), getPPSMetrics(interaction)), paintMetrics), (0, _getNavigationMetrics.getNavigationMetricsToLegacyFormat)(type)), finalVCMetrics), experimentalMetrics), (_config$additionalPay = config.additionalPayloadData) === null || _config$additionalPay === void 0 ? void 0 : _config$additionalPay.call(config, interaction)), getTracingContextData(interaction)), getStylesheetMetrics()), getErrorCounts(interaction)), {}, {
744
+ } : {}), (0, _getBrowserMetadata.getBrowserMetadataToLegacyFormat)()), getSSRProperties(type)), getAssetsMetrics(interaction, pageLoadInteractionMetrics === null || pageLoadInteractionMetrics === void 0 ? void 0 : pageLoadInteractionMetrics.SSRDoneTime)), getPPSMetrics(interaction)), paintMetrics), (0, _getNavigationMetrics.getNavigationMetricsToLegacyFormat)(type)), finalVCMetrics), experimentalMetrics), (_config$additionalPay = config.additionalPayloadData) === null || _config$additionalPay === void 0 ? void 0 : _config$additionalPay.call(config, interaction)), getTracingContextData(interaction)), getStylesheetMetrics()), getErrorCounts(interaction)), getReactHydrationStats()), {}, {
737
745
  interactionMetrics: _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
738
746
  namePrefix: config.namePrefix || '',
739
747
  segmentPrefix: config.segmentPrefix || '',
@@ -779,7 +787,7 @@ function _createInteractionMetricsPayload() {
779
787
  }
780
788
  payload.attributes.properties['event:sizeInKb'] = (0, _getPayloadSize.default)(payload.attributes.properties);
781
789
  return _context.abrupt("return", payload);
782
- case 44:
790
+ case 45:
783
791
  case "end":
784
792
  return _context.stop();
785
793
  }
@@ -663,6 +663,7 @@ function finishInteraction(id, data) {
663
663
  data.vc = observer.getVCRawData();
664
664
  }
665
665
  }
666
+ data.hydration = (0, _config.getReactHydrationStats)();
666
667
 
667
668
  // By this time, stop the post interaction log observer if coinflip rate is 0
668
669
  if ((0, _platformFeatureFlags.fg)('platform_ufo_post_interaction_check_name')) {
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.getResourceTimings = getResourceTimings;
8
8
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
10
9
  var _config = require("../config");
11
10
  var _roundNumber = require("../round-number");
12
11
  var _config2 = require("./common/utils/config");
@@ -102,7 +101,7 @@ function getNetworkData(item, eventStart) {
102
101
  ttfb: ttfb,
103
102
  serverTime: serverTime,
104
103
  networkTime: networkTime,
105
- requestStart: (0, _platformFeatureFlags.fg)('ufo_return_relative_request_start') ? requestStartRelative : requestStart
104
+ requestStart: requestStartRelative
106
105
  }, getSizeObject(transferSize));
107
106
  }
108
107
  function getResourceTimings(interactionStart, interactionEnd) {
@@ -12,6 +12,7 @@ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/
12
12
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
13
13
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
14
14
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
15
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
15
16
  var _percentileCalc = require("./percentile-calc");
16
17
  var _getViewportHeight = _interopRequireDefault(require("./utils/get-viewport-height"));
17
18
  var _getViewportWidth = _interopRequireDefault(require("./utils/get-viewport-width"));
@@ -90,8 +91,11 @@ var AbstractVCCalculatorBase = exports.default = /*#__PURE__*/function () {
90
91
  while (1) switch (_context.prev = _context.next) {
91
92
  case 0:
92
93
  percentiles = [25, 50, 75, 80, 85, 90, 95, 98, 99];
94
+ if ((0, _platformFeatureFlags.fg)('platform_ufo_send_vc_100')) {
95
+ percentiles.push(100);
96
+ }
93
97
  viewportEntries = this.filterViewportEntries(filteredEntries);
94
- _context.next = 4;
98
+ _context.next = 5;
95
99
  return (0, _percentileCalc.calculateTTVCPercentilesWithDebugInfo)({
96
100
  viewport: {
97
101
  width: (0, _getViewportWidth.default)(),
@@ -101,31 +105,31 @@ var AbstractVCCalculatorBase = exports.default = /*#__PURE__*/function () {
101
105
  stopTime: stopTime,
102
106
  orderedEntries: viewportEntries
103
107
  });
104
- case 4:
108
+ case 5:
105
109
  vcLogs = _context.sent;
106
110
  vcDetails = {};
107
111
  percentileIndex = 0;
108
112
  entryDataBuffer = new Set();
109
113
  if (!vcLogs) {
110
- _context.next = 28;
114
+ _context.next = 29;
111
115
  break;
112
116
  }
113
117
  _iterator3 = _createForOfIteratorHelper(vcLogs);
114
- _context.prev = 10;
118
+ _context.prev = 11;
115
119
  _iterator3.s();
116
- case 12:
120
+ case 13:
117
121
  if ((_step3 = _iterator3.n()).done) {
118
- _context.next = 20;
122
+ _context.next = 21;
119
123
  break;
120
124
  }
121
125
  _entry2 = _step3.value;
122
126
  time = _entry2.time, viewportPercentage = _entry2.viewportPercentage, entries = _entry2.entries; // Only process entries if we haven't reached all percentiles
123
127
  if (!(percentileIndex >= percentiles.length)) {
124
- _context.next = 17;
128
+ _context.next = 18;
125
129
  break;
126
130
  }
127
- return _context.abrupt("break", 20);
128
- case 17:
131
+ return _context.abrupt("break", 21);
132
+ case 18:
129
133
  // Check if this entry matches any checkpoint percentiles
130
134
  if (viewportPercentage >= percentiles[percentileIndex]) {
131
135
  elementNames = entries.map(function (e) {
@@ -147,21 +151,21 @@ var AbstractVCCalculatorBase = exports.default = /*#__PURE__*/function () {
147
151
  return entryDataBuffer.add(e);
148
152
  });
149
153
  }
150
- case 18:
151
- _context.next = 12;
154
+ case 19:
155
+ _context.next = 13;
152
156
  break;
153
- case 20:
154
- _context.next = 25;
157
+ case 21:
158
+ _context.next = 26;
155
159
  break;
156
- case 22:
157
- _context.prev = 22;
158
- _context.t0 = _context["catch"](10);
160
+ case 23:
161
+ _context.prev = 23;
162
+ _context.t0 = _context["catch"](11);
159
163
  _iterator3.e(_context.t0);
160
- case 25:
161
- _context.prev = 25;
164
+ case 26:
165
+ _context.prev = 26;
162
166
  _iterator3.f();
163
- return _context.finish(25);
164
- case 28:
167
+ return _context.finish(26);
168
+ case 29:
165
169
  // Fill in any missing percentiles with the last known values
166
170
  previousResult = {
167
171
  t: 0,
@@ -300,11 +304,11 @@ var AbstractVCCalculatorBase = exports.default = /*#__PURE__*/function () {
300
304
  }
301
305
  }
302
306
  return _context.abrupt("return", vcDetails);
303
- case 38:
307
+ case 39:
304
308
  case "end":
305
309
  return _context.stop();
306
310
  }
307
- }, _callee, this, [[10, 22, 25, 28]]);
311
+ }, _callee, this, [[11, 23, 26, 29]]);
308
312
  }));
309
313
  function calculateWithDebugInfo(_x, _x2, _x3, _x4, _x5, _x6, _x7, _x8) {
310
314
  return _calculateWithDebugInfo.apply(this, arguments);
@@ -67,6 +67,20 @@ export function getMostRecentVCRevision(experienceKey = '') {
67
67
  const enabledVCRevisions = getEnabledVCRevisions(experienceKey);
68
68
  return enabledVCRevisions[enabledVCRevisions.length - 1];
69
69
  }
70
+ export function getReactHydrationStats() {
71
+ if (!config) {
72
+ return undefined;
73
+ }
74
+ try {
75
+ var _config, _config$getReactHydra;
76
+ const stats = (_config = config) === null || _config === void 0 ? void 0 : (_config$getReactHydra = _config.getReactHydrationStats) === null || _config$getReactHydra === void 0 ? void 0 : _config$getReactHydra.call(_config);
77
+ return stats !== null && stats !== void 0 ? stats : undefined;
78
+ } catch (e) {
79
+ // eslint-disable-next-line no-console
80
+ console.error('getReactHydrationStats threw an error: ', e);
81
+ return undefined;
82
+ }
83
+ }
70
84
  export function getInteractionRate(name, interactionKind) {
71
85
  try {
72
86
  if (!config) {
@@ -598,7 +598,8 @@ async function createInteractionMetricsPayload(interaction, interactionId, exper
598
598
  abortedByInteractionName,
599
599
  responsiveness,
600
600
  unknownElementName,
601
- unknownElementHierarchy
601
+ unknownElementHierarchy,
602
+ hydration
602
603
  } = interaction;
603
604
  const pageVisibilityAtTTI = getPageVisibilityUpToTTI(interaction);
604
605
  const pageVisibilityAtTTAI = getPageVisibilityUpToTTAI(interaction);
@@ -693,6 +694,14 @@ async function createInteractionMetricsPayload(interaction, interactionId, exper
693
694
  if (!experimental) {
694
695
  fg('ufo_chrome_devtools_uplift') && addPerformanceMeasures(interaction.start, [...((finalVCMetrics === null || finalVCMetrics === void 0 ? void 0 : finalVCMetrics['ufo:vc:rev']) || [])]);
695
696
  }
697
+ const getReactHydrationStats = () => {
698
+ if (!isPageLoad || !hydration) {
699
+ return {};
700
+ }
701
+ return {
702
+ hydration
703
+ };
704
+ };
696
705
  const payload = {
697
706
  actionSubject: 'experience',
698
707
  action: 'measured',
@@ -733,6 +742,7 @@ async function createInteractionMetricsPayload(interaction, interactionId, exper
733
742
  ...getTracingContextData(interaction),
734
743
  ...getStylesheetMetrics(),
735
744
  ...getErrorCounts(interaction),
745
+ ...getReactHydrationStats(),
736
746
  interactionMetrics: {
737
747
  namePrefix: config.namePrefix || '',
738
748
  segmentPrefix: config.segmentPrefix || '',
@@ -1,7 +1,7 @@
1
1
  import { v4 as createUUID } from 'uuid';
2
2
  import { fg } from '@atlaskit/platform-feature-flags';
3
3
  import coinflip from '../coinflip';
4
- import { getAwaitBM3TTIList, getCapabilityRate, getConfig, getExperimentalInteractionRate, getInteractionTimeout, getPostInteractionRate } from '../config';
4
+ import { getAwaitBM3TTIList, getCapabilityRate, getConfig, getExperimentalInteractionRate, getInteractionTimeout, getPostInteractionRate, getReactHydrationStats } from '../config';
5
5
  import { experimentalVC, getExperimentalVCMetrics, onExperimentalInteractionComplete } from '../create-experimental-interaction-metrics-payload';
6
6
  import { sanitizeUfoName } from '../create-payload/common/utils';
7
7
  import { clearActiveTrace } from '../experience-trace-id-context';
@@ -581,6 +581,7 @@ function finishInteraction(id, data, endTime = performance.now()) {
581
581
  data.vc = observer.getVCRawData();
582
582
  }
583
583
  }
584
+ data.hydration = getReactHydrationStats();
584
585
 
585
586
  // By this time, stop the post interaction log observer if coinflip rate is 0
586
587
  if (fg('platform_ufo_post_interaction_check_name')) {
@@ -1,4 +1,3 @@
1
- import { fg } from '@atlaskit/platform-feature-flags';
2
1
  import { getConfig as getConfigUFO } from '../config';
3
2
  import { roundEpsilon } from '../round-number';
4
3
  import { getConfig } from './common/utils/config';
@@ -94,7 +93,7 @@ function getNetworkData(item, eventStart, hasTimingHeaders = evaluateAccessToRes
94
93
  ttfb,
95
94
  serverTime,
96
95
  networkTime,
97
- requestStart: fg('ufo_return_relative_request_start') ? requestStartRelative : requestStart,
96
+ requestStart: requestStartRelative,
98
97
  ...getSizeObject(transferSize)
99
98
  };
100
99
  }
@@ -1,3 +1,4 @@
1
+ import { fg } from '@atlaskit/platform-feature-flags';
1
2
  import { calculateTTVCPercentilesWithDebugInfo } from './percentile-calc';
2
3
  import getViewportHeight from './utils/get-viewport-height';
3
4
  import getViewportWidth from './utils/get-viewport-width';
@@ -41,6 +42,9 @@ export default class AbstractVCCalculatorBase {
41
42
  async calculateWithDebugInfo(filteredEntries, startTime, stopTime, isPostInteraction, isVCClean, interactionId, dirtyReason, allEntries) {
42
43
  var _window, _window2, _window3, _window5;
43
44
  const percentiles = [25, 50, 75, 80, 85, 90, 95, 98, 99];
45
+ if (fg('platform_ufo_send_vc_100')) {
46
+ percentiles.push(100);
47
+ }
44
48
  const viewportEntries = this.filterViewportEntries(filteredEntries);
45
49
  const vcLogs = await calculateTTVCPercentilesWithDebugInfo({
46
50
  viewport: {