@atlaskit/react-ufo 4.1.8 → 4.1.10
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/create-payload/utils/get-vc-metrics.js +16 -16
- package/dist/cjs/interaction-metrics/index.js +28 -24
- package/dist/cjs/interaction-metrics-init/index.js +4 -16
- package/dist/cjs/vc/vc-observer-new/viewport-observer/index.js +14 -20
- package/dist/es2019/create-payload/utils/get-vc-metrics.js +6 -9
- package/dist/es2019/interaction-metrics/index.js +29 -25
- package/dist/es2019/interaction-metrics-init/index.js +4 -16
- package/dist/es2019/vc/vc-observer-new/viewport-observer/index.js +6 -14
- package/dist/esm/create-payload/utils/get-vc-metrics.js +16 -16
- package/dist/esm/interaction-metrics/index.js +29 -25
- package/dist/esm/interaction-metrics-init/index.js +4 -16
- package/dist/esm/vc/vc-observer-new/viewport-observer/index.js +14 -20
- package/dist/types/create-post-interaction-log-payload/index.d.ts +3 -3
- package/dist/types-ts4.5/create-post-interaction-log-payload/index.d.ts +3 -3
- package/package.json +1 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @atlaskit/ufo-interaction-ignore
|
|
2
2
|
|
|
3
|
+
## 4.1.10
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#193091](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/193091)
|
|
8
|
+
[`7e879ace28cec`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/7e879ace28cec) -
|
|
9
|
+
AFO-4081 cleanup ttvc v3 ff
|
|
10
|
+
|
|
11
|
+
## 4.1.9
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#192603](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/192603)
|
|
16
|
+
[`75c6397ec21b6`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/75c6397ec21b6) -
|
|
17
|
+
Clean fg observer per interaction
|
|
18
|
+
|
|
3
19
|
## 4.1.8
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -11,7 +11,6 @@ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/
|
|
|
11
11
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
12
12
|
var _config = require("../../config");
|
|
13
13
|
var _interactionMetrics = require("../../interaction-metrics");
|
|
14
|
-
var _vc = require("../../vc");
|
|
15
14
|
var _getInteractionStatus = _interopRequireDefault(require("./get-interaction-status"));
|
|
16
15
|
var _getPageVisibilityUpToTtai = _interopRequireDefault(require("./get-page-visibility-up-to-ttai"));
|
|
17
16
|
var _getSsrDoneTimeValue = _interopRequireDefault(require("./get-ssr-done-time-value"));
|
|
@@ -22,7 +21,7 @@ function getVCMetrics(_x) {
|
|
|
22
21
|
}
|
|
23
22
|
function _getVCMetrics() {
|
|
24
23
|
_getVCMetrics = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(interaction) {
|
|
25
|
-
var _config$vc, _config$vc$ssrWhiteli, _interaction$apdex, _config$vc2, _config$vc3,
|
|
24
|
+
var _config$vc, _config$vc$ssrWhiteli, _interaction$apdex, _config$vc2, _config$vc3, _result$ufoVcRev;
|
|
26
25
|
var config, interactionStatus, pageVisibilityUpToTTAI, shouldReportVCMetrics, observer, isSSREnabled, ssr, tti, prefix, result, mostRecentVCRevision, mostRecentVCRevisionPayload;
|
|
27
26
|
return _regenerator.default.wrap(function _callee$(_context) {
|
|
28
27
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -56,14 +55,20 @@ function _getVCMetrics() {
|
|
|
56
55
|
interactionStatus = (0, _getInteractionStatus.default)(interaction);
|
|
57
56
|
pageVisibilityUpToTTAI = (0, _getPageVisibilityUpToTtai.default)(interaction);
|
|
58
57
|
shouldReportVCMetrics = interactionStatus.originalInteractionStatus === 'SUCCEEDED' && pageVisibilityUpToTTAI === 'visible'; // Use per-interaction VC observer if available, otherwise fall back to global
|
|
59
|
-
observer = interaction.vcObserver
|
|
58
|
+
observer = interaction.vcObserver;
|
|
59
|
+
if (observer) {
|
|
60
|
+
_context.next = 16;
|
|
61
|
+
break;
|
|
62
|
+
}
|
|
63
|
+
return _context.abrupt("return", {});
|
|
64
|
+
case 16:
|
|
60
65
|
if (!(!shouldReportVCMetrics && (0, _platformFeatureFlags.fg)('platform_ufo_no_vc_on_aborted'))) {
|
|
61
|
-
_context.next =
|
|
66
|
+
_context.next = 19;
|
|
62
67
|
break;
|
|
63
68
|
}
|
|
64
69
|
observer.stop(interaction.ufoName);
|
|
65
70
|
return _context.abrupt("return", {});
|
|
66
|
-
case
|
|
71
|
+
case 19:
|
|
67
72
|
isSSREnabled = interaction.type === 'page_load' && ((config === null || config === void 0 ? void 0 : config.ssr) || (config === null || config === void 0 || (_config$vc$ssrWhiteli = config.vc.ssrWhitelist) === null || _config$vc$ssrWhiteli === void 0 ? void 0 : _config$vc$ssrWhiteli.includes(interaction.ufoName)));
|
|
68
73
|
ssr = interaction.type === 'page_load' && isSSREnabled ? {
|
|
69
74
|
ssr: (0, _getSsrDoneTimeValue.default)(config)
|
|
@@ -71,7 +76,7 @@ function _getVCMetrics() {
|
|
|
71
76
|
_interactionMetrics.postInteractionLog.setVCObserverSSRConfig(ssr);
|
|
72
77
|
tti = (_interaction$apdex = interaction.apdex) === null || _interaction$apdex === void 0 || (_interaction$apdex = _interaction$apdex[0]) === null || _interaction$apdex === void 0 ? void 0 : _interaction$apdex.stopTime;
|
|
73
78
|
prefix = 'ufo';
|
|
74
|
-
_context.next =
|
|
79
|
+
_context.next = 26;
|
|
75
80
|
return observer.getVCResult(_objectSpread({
|
|
76
81
|
start: interaction.start,
|
|
77
82
|
stop: interaction.end,
|
|
@@ -84,14 +89,9 @@ function _getVCMetrics() {
|
|
|
84
89
|
interactionId: interaction.id,
|
|
85
90
|
includeSSRRatio: (_config$vc3 = config.vc) === null || _config$vc3 === void 0 ? void 0 : _config$vc3.includeSSRRatio
|
|
86
91
|
}, ssr));
|
|
87
|
-
case
|
|
92
|
+
case 26:
|
|
88
93
|
result = _context.sent;
|
|
89
|
-
|
|
90
|
-
observer.stop(interaction.ufoName);
|
|
91
|
-
}
|
|
92
|
-
if ((_config$experimentalI = config.experimentalInteractionMetrics) !== null && _config$experimentalI !== void 0 && _config$experimentalI.enabled) {
|
|
93
|
-
observer.stop(interaction.ufoName);
|
|
94
|
-
}
|
|
94
|
+
observer.stop(interaction.ufoName);
|
|
95
95
|
_interactionMetrics.postInteractionLog.setLastInteractionFinishVCResult(result);
|
|
96
96
|
mostRecentVCRevision = (0, _config.getMostRecentVCRevision)(interaction.ufoName);
|
|
97
97
|
mostRecentVCRevisionPayload = result === null || result === void 0 || (_result$ufoVcRev = result['ufo:vc:rev']) === null || _result$ufoVcRev === void 0 ? void 0 : _result$ufoVcRev.find(function (_ref) {
|
|
@@ -99,15 +99,15 @@ function _getVCMetrics() {
|
|
|
99
99
|
return revision === mostRecentVCRevision;
|
|
100
100
|
});
|
|
101
101
|
if (!(!shouldReportVCMetrics || !(mostRecentVCRevisionPayload !== null && mostRecentVCRevisionPayload !== void 0 && mostRecentVCRevisionPayload.clean))) {
|
|
102
|
-
_context.next =
|
|
102
|
+
_context.next = 33;
|
|
103
103
|
break;
|
|
104
104
|
}
|
|
105
105
|
return _context.abrupt("return", result);
|
|
106
|
-
case
|
|
106
|
+
case 33:
|
|
107
107
|
return _context.abrupt("return", _objectSpread(_objectSpread({}, result), {}, {
|
|
108
108
|
'metric:vc90': mostRecentVCRevisionPayload['metric:vc90']
|
|
109
109
|
}));
|
|
110
|
-
case
|
|
110
|
+
case 34:
|
|
111
111
|
case "end":
|
|
112
112
|
return _context.stop();
|
|
113
113
|
}
|
|
@@ -569,8 +569,10 @@ function finishInteraction(id, data) {
|
|
|
569
569
|
callCleanUpCallbacks(data);
|
|
570
570
|
if ((_getConfig4 = (0, _config.getConfig)()) !== null && _getConfig4 !== void 0 && (_getConfig4 = _getConfig4.vc) !== null && _getConfig4 !== void 0 && _getConfig4.stopVCAtInteractionFinish) {
|
|
571
571
|
// Use per-interaction VC observer if available, otherwise fall back to global
|
|
572
|
-
var observer = data.vcObserver
|
|
573
|
-
|
|
572
|
+
var observer = data.vcObserver;
|
|
573
|
+
if (observer) {
|
|
574
|
+
data.vc = observer.getVCRawData();
|
|
575
|
+
}
|
|
574
576
|
}
|
|
575
577
|
if (!((_getConfig5 = (0, _config.getConfig)()) !== null && _getConfig5 !== void 0 && (_getConfig5 = _getConfig5.experimentalInteractionMetrics) !== null && _getConfig5 !== void 0 && _getConfig5.enabled)) {
|
|
576
578
|
remove(id);
|
|
@@ -817,7 +819,7 @@ function addNewInteraction(interactionId, ufoName, type, startTime, rate, labelS
|
|
|
817
819
|
ssrEnablePageLayoutPlaceholder: config.vc.ssrEnablePageLayoutPlaceholder,
|
|
818
820
|
disableSizeAndPositionCheck: config.vc.disableSizeAndPositionCheck
|
|
819
821
|
};
|
|
820
|
-
vcObserver = (0,
|
|
822
|
+
vcObserver = (0, _vc.newVCObserver)(vcOptions);
|
|
821
823
|
}
|
|
822
824
|
|
|
823
825
|
// Create per-interaction VC observer when feature flag is enabled
|
|
@@ -894,31 +896,33 @@ function addNewInteraction(interactionId, ufoName, type, startTime, rate, labelS
|
|
|
894
896
|
}
|
|
895
897
|
if (type === 'transition' || type === 'page_load') {
|
|
896
898
|
// Use per-interaction VC observer if available, otherwise fall back to global
|
|
897
|
-
var observer = vcObserver
|
|
898
|
-
observer
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
}
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
}
|
|
899
|
+
var observer = vcObserver;
|
|
900
|
+
if (observer) {
|
|
901
|
+
observer.start({
|
|
902
|
+
startTime: startTime,
|
|
903
|
+
experienceKey: ufoName
|
|
904
|
+
});
|
|
905
|
+
}
|
|
906
|
+
if ((0, _coinflip.default)((0, _config.getPostInteractionRate)(routeName || ufoName, type))) {
|
|
907
|
+
postInteractionLog.startVCObserver({
|
|
908
|
+
startTime: startTime
|
|
909
|
+
});
|
|
910
|
+
}
|
|
911
|
+
if ((0, _coinflip.default)((0, _config.getExperimentalInteractionRate)(ufoName, type))) {
|
|
912
|
+
_createExperimentalInteractionMetricsPayload.experimentalVC.start({
|
|
913
|
+
startTime: startTime
|
|
914
|
+
});
|
|
913
915
|
}
|
|
914
916
|
}
|
|
915
917
|
if (type === 'press' && (0, _platformFeatureFlags.fg)('platform_ufo_enable_vc_press_interactions')) {
|
|
916
918
|
// Use per-interaction VC observer if available, otherwise fall back to global
|
|
917
|
-
var _observer = vcObserver
|
|
918
|
-
_observer
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
919
|
+
var _observer = vcObserver;
|
|
920
|
+
if (_observer) {
|
|
921
|
+
_observer.start({
|
|
922
|
+
startTime: startTime,
|
|
923
|
+
experienceKey: ufoName
|
|
924
|
+
});
|
|
925
|
+
}
|
|
922
926
|
}
|
|
923
927
|
}
|
|
924
928
|
function addBrowserMetricEvent(event) {
|
|
@@ -15,7 +15,6 @@ var _hiddenTiming = require("../hidden-timing");
|
|
|
15
15
|
var _interactionMetrics = require("../interaction-metrics");
|
|
16
16
|
var _interactionsPerformanceObserver = require("../interactions-performance-observer");
|
|
17
17
|
var _machineUtilisation = require("../machine-utilisation");
|
|
18
|
-
var _vc = require("../vc");
|
|
19
18
|
var _scheduleIdleCallback = _interopRequireDefault(require("./schedule-idle-callback"));
|
|
20
19
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != (0, _typeof2.default)(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
21
20
|
var initialized = false;
|
|
@@ -105,17 +104,6 @@ function init(analyticsWebClientAsync, config) {
|
|
|
105
104
|
startTime: 0
|
|
106
105
|
});
|
|
107
106
|
}
|
|
108
|
-
if (!(0, _platformFeatureFlags.fg)('platform_ufo_enable_vc_observer_per_interaction')) {
|
|
109
|
-
var _config$postInteracti;
|
|
110
|
-
(0, _vc.getVCObserver)(vcOptions).start({
|
|
111
|
-
startTime: 0
|
|
112
|
-
});
|
|
113
|
-
if ((_config$postInteracti = config.postInteractionLog) !== null && _config$postInteracti !== void 0 && _config$postInteracti.enabled) {
|
|
114
|
-
_interactionMetrics.postInteractionLog.startVCObserver({
|
|
115
|
-
startTime: 0
|
|
116
|
-
});
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
107
|
}
|
|
120
108
|
(0, _hiddenTiming.setupHiddenTimingCapture)();
|
|
121
109
|
(0, _additionalPayload.startLighthouseObserver)();
|
|
@@ -141,23 +129,23 @@ function init(analyticsWebClientAsync, config) {
|
|
|
141
129
|
createPostInteractionLogPayloadPackage = _ref2[2];
|
|
142
130
|
if (awc.getAnalyticsWebClientPromise) {
|
|
143
131
|
awc.getAnalyticsWebClientPromise().then(function (client) {
|
|
144
|
-
var _config$experimentalI2, _config$
|
|
132
|
+
var _config$experimentalI2, _config$postInteracti;
|
|
145
133
|
var instance = client.getInstance();
|
|
146
134
|
sinkInteraction(instance, payloadPackage);
|
|
147
135
|
if (config !== null && config !== void 0 && (_config$experimentalI2 = config.experimentalInteractionMetrics) !== null && _config$experimentalI2 !== void 0 && _config$experimentalI2.enabled) {
|
|
148
136
|
sinkExperimentalInteractionMetrics(instance, payloadPackage);
|
|
149
137
|
}
|
|
150
|
-
if ((_config$
|
|
138
|
+
if ((_config$postInteracti = config.postInteractionLog) !== null && _config$postInteracti !== void 0 && _config$postInteracti.enabled) {
|
|
151
139
|
sinkPostInteractionLog(instance, createPostInteractionLogPayloadPackage.default);
|
|
152
140
|
}
|
|
153
141
|
});
|
|
154
142
|
} else if (awc.sendOperationalEvent) {
|
|
155
|
-
var _config$experimentalI3, _config$
|
|
143
|
+
var _config$experimentalI3, _config$postInteracti2;
|
|
156
144
|
sinkInteraction(awc, payloadPackage);
|
|
157
145
|
if (config !== null && config !== void 0 && (_config$experimentalI3 = config.experimentalInteractionMetrics) !== null && _config$experimentalI3 !== void 0 && _config$experimentalI3.enabled) {
|
|
158
146
|
sinkExperimentalInteractionMetrics(awc, payloadPackage);
|
|
159
147
|
}
|
|
160
|
-
if ((_config$
|
|
148
|
+
if ((_config$postInteracti2 = config.postInteractionLog) !== null && _config$postInteracti2 !== void 0 && _config$postInteracti2.enabled) {
|
|
161
149
|
sinkPostInteractionLog(awc, createPostInteractionLogPayloadPackage.default);
|
|
162
150
|
}
|
|
163
151
|
}
|
|
@@ -10,7 +10,6 @@ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/
|
|
|
10
10
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
11
|
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
12
12
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
13
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
14
13
|
var _vcUtils = require("../../vc-observer/media-wrapper/vc-utils");
|
|
15
14
|
var _isNonVisualStyleMutation = _interopRequireDefault(require("../../vc-observer/observers/non-visual-styles/is-non-visual-style-mutation"));
|
|
16
15
|
var _rllPlaceholders = require("../../vc-observer/observers/rll-placeholders");
|
|
@@ -55,21 +54,18 @@ var createElementMutationsWatcher = function createElementMutationsWatcher(remov
|
|
|
55
54
|
return function (_ref) {
|
|
56
55
|
var target = _ref.target,
|
|
57
56
|
rect = _ref.rect;
|
|
58
|
-
var isNoLsMarkerEnabled = (0, _platformFeatureFlags.fg)('platform_vc_ignore_no_ls_mutation_marker');
|
|
59
57
|
var isInIgnoreLsMarker = (0, _isInVcIgnoreIfNoLayoutShiftMarker.default)(target);
|
|
60
|
-
if (!isInIgnoreLsMarker
|
|
58
|
+
if (!isInIgnoreLsMarker) {
|
|
61
59
|
return 'mutation:element';
|
|
62
60
|
}
|
|
63
61
|
var isRLLPlaceholder = _rllPlaceholders.RLLPlaceholderHandlers.getInstance().isRLLPlaceholderHydration(rect);
|
|
64
|
-
if (isRLLPlaceholder &&
|
|
62
|
+
if (isRLLPlaceholder && isInIgnoreLsMarker) {
|
|
65
63
|
return 'mutation:rll-placeholder';
|
|
66
64
|
}
|
|
67
65
|
var wasDeleted = removedNodeRects.some(function (nr) {
|
|
68
66
|
return sameRectDimensions(nr, rect);
|
|
69
67
|
});
|
|
70
|
-
|
|
71
|
-
// no layout shift mutation is excluded as per existing fy25.03 logic
|
|
72
|
-
if (wasDeleted && (!isNoLsMarkerEnabled || isInIgnoreLsMarker)) {
|
|
68
|
+
if (wasDeleted && isInIgnoreLsMarker) {
|
|
73
69
|
return 'mutation:element-replacement';
|
|
74
70
|
}
|
|
75
71
|
return 'mutation:element';
|
|
@@ -125,7 +121,7 @@ var ViewportObserver = exports.default = /*#__PURE__*/function () {
|
|
|
125
121
|
_context2.prev = 4;
|
|
126
122
|
_loop = /*#__PURE__*/_regenerator.default.mark(function _loop() {
|
|
127
123
|
var _this$intersectionObs8;
|
|
128
|
-
var addedNodeRef, addedNode, ssrState, SSRStateEnum, _this$intersectionObs, _this$intersectionObs2, ssrPlaceholderHandler, result, _this$intersectionObs3, _result, _this$intersectionObs4, sameDeletedNode, isInIgnoreLsMarker,
|
|
124
|
+
var addedNodeRef, addedNode, ssrState, SSRStateEnum, _this$intersectionObs, _this$intersectionObs2, ssrPlaceholderHandler, result, _this$intersectionObs3, _result, _this$intersectionObs4, sameDeletedNode, isInIgnoreLsMarker, _this$intersectionObs5, _this$intersectionObs6, _checkWithinComponent, isWithinThirdPartySegment, _this$intersectionObs7;
|
|
129
125
|
return _regenerator.default.wrap(function _loop$(_context) {
|
|
130
126
|
while (1) switch (_context.prev = _context.next) {
|
|
131
127
|
case 0:
|
|
@@ -137,7 +133,7 @@ var ViewportObserver = exports.default = /*#__PURE__*/function () {
|
|
|
137
133
|
}
|
|
138
134
|
return _context.abrupt("return", 0);
|
|
139
135
|
case 4:
|
|
140
|
-
if (!
|
|
136
|
+
if (!_this.getSSRState) {
|
|
141
137
|
_context.next = 19;
|
|
142
138
|
break;
|
|
143
139
|
}
|
|
@@ -172,7 +168,7 @@ var ViewportObserver = exports.default = /*#__PURE__*/function () {
|
|
|
172
168
|
case 18:
|
|
173
169
|
ssrState.state = SSRStateEnum.normal;
|
|
174
170
|
case 19:
|
|
175
|
-
if (!
|
|
171
|
+
if (!_this.getSSRPlaceholderHandler) {
|
|
176
172
|
_context.next = 36;
|
|
177
173
|
break;
|
|
178
174
|
}
|
|
@@ -219,32 +215,30 @@ var ViewportObserver = exports.default = /*#__PURE__*/function () {
|
|
|
219
215
|
return n.isEqualNode(addedNode);
|
|
220
216
|
});
|
|
221
217
|
isInIgnoreLsMarker = (0, _isInVcIgnoreIfNoLayoutShiftMarker.default)(addedNode);
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
if (!(sameDeletedNode && (!isNoLsMarkerEnabled || isInIgnoreLsMarker))) {
|
|
225
|
-
_context.next = 42;
|
|
218
|
+
if (!(sameDeletedNode && isInIgnoreLsMarker)) {
|
|
219
|
+
_context.next = 41;
|
|
226
220
|
break;
|
|
227
221
|
}
|
|
228
222
|
(_this$intersectionObs5 = _this.intersectionObserver) === null || _this$intersectionObs5 === void 0 || _this$intersectionObs5.watchAndTag(addedNode, 'mutation:remount');
|
|
229
223
|
return _context.abrupt("return", 0);
|
|
230
|
-
case
|
|
224
|
+
case 41:
|
|
231
225
|
if (!(0, _vcUtils.isContainedWithinMediaWrapper)(addedNode)) {
|
|
232
|
-
_context.next =
|
|
226
|
+
_context.next = 44;
|
|
233
227
|
break;
|
|
234
228
|
}
|
|
235
229
|
(_this$intersectionObs6 = _this.intersectionObserver) === null || _this$intersectionObs6 === void 0 || _this$intersectionObs6.watchAndTag(addedNode, 'mutation:media');
|
|
236
230
|
return _context.abrupt("return", 0);
|
|
237
|
-
case
|
|
231
|
+
case 44:
|
|
238
232
|
_checkWithinComponent = (0, _checkWithinComponentAndExtractChildProps.default)(addedNode, 'UFOThirdPartySegment'), isWithinThirdPartySegment = _checkWithinComponent.isWithin;
|
|
239
233
|
if (!isWithinThirdPartySegment) {
|
|
240
|
-
_context.next =
|
|
234
|
+
_context.next = 48;
|
|
241
235
|
break;
|
|
242
236
|
}
|
|
243
237
|
(_this$intersectionObs7 = _this.intersectionObserver) === null || _this$intersectionObs7 === void 0 || _this$intersectionObs7.watchAndTag(addedNode, 'mutation:third-party-element');
|
|
244
238
|
return _context.abrupt("return", 0);
|
|
245
|
-
case
|
|
239
|
+
case 48:
|
|
246
240
|
(_this$intersectionObs8 = _this.intersectionObserver) === null || _this$intersectionObs8 === void 0 || _this$intersectionObs8.watchAndTag(addedNode, createElementMutationsWatcher(removedNodeRects));
|
|
247
|
-
case
|
|
241
|
+
case 49:
|
|
248
242
|
case "end":
|
|
249
243
|
return _context.stop();
|
|
250
244
|
}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
2
2
|
import { getConfig, getMostRecentVCRevision } from '../../config';
|
|
3
3
|
import { postInteractionLog } from '../../interaction-metrics';
|
|
4
|
-
import { getVCObserver } from '../../vc';
|
|
5
4
|
import getInteractionStatus from './get-interaction-status';
|
|
6
5
|
import getPageVisibilityUpToTTAI from './get-page-visibility-up-to-ttai';
|
|
7
6
|
import getSSRDoneTimeValue from './get-ssr-done-time-value';
|
|
8
7
|
async function getVCMetrics(interaction) {
|
|
9
|
-
var _config$vc, _config$vc$ssrWhiteli, _interaction$apdex, _interaction$apdex$, _config$vc2, _config$vc3,
|
|
8
|
+
var _config$vc, _config$vc$ssrWhiteli, _interaction$apdex, _interaction$apdex$, _config$vc2, _config$vc3, _result$ufoVcRev;
|
|
10
9
|
const config = getConfig();
|
|
11
10
|
if (!(config !== null && config !== void 0 && (_config$vc = config.vc) !== null && _config$vc !== void 0 && _config$vc.enabled)) {
|
|
12
11
|
return {};
|
|
@@ -25,7 +24,10 @@ async function getVCMetrics(interaction) {
|
|
|
25
24
|
const shouldReportVCMetrics = interactionStatus.originalInteractionStatus === 'SUCCEEDED' && pageVisibilityUpToTTAI === 'visible';
|
|
26
25
|
|
|
27
26
|
// Use per-interaction VC observer if available, otherwise fall back to global
|
|
28
|
-
const observer = interaction.vcObserver
|
|
27
|
+
const observer = interaction.vcObserver;
|
|
28
|
+
if (!observer) {
|
|
29
|
+
return {};
|
|
30
|
+
}
|
|
29
31
|
if (!shouldReportVCMetrics && fg('platform_ufo_no_vc_on_aborted')) {
|
|
30
32
|
observer.stop(interaction.ufoName);
|
|
31
33
|
return {};
|
|
@@ -50,12 +52,7 @@ async function getVCMetrics(interaction) {
|
|
|
50
52
|
includeSSRRatio: (_config$vc3 = config.vc) === null || _config$vc3 === void 0 ? void 0 : _config$vc3.includeSSRRatio,
|
|
51
53
|
...ssr
|
|
52
54
|
});
|
|
53
|
-
|
|
54
|
-
observer.stop(interaction.ufoName);
|
|
55
|
-
}
|
|
56
|
-
if ((_config$experimentalI = config.experimentalInteractionMetrics) !== null && _config$experimentalI !== void 0 && _config$experimentalI.enabled) {
|
|
57
|
-
observer.stop(interaction.ufoName);
|
|
58
|
-
}
|
|
55
|
+
observer.stop(interaction.ufoName);
|
|
59
56
|
postInteractionLog.setLastInteractionFinishVCResult(result);
|
|
60
57
|
const mostRecentVCRevision = getMostRecentVCRevision(interaction.ufoName);
|
|
61
58
|
const mostRecentVCRevisionPayload = result === null || result === void 0 ? void 0 : (_result$ufoVcRev = result['ufo:vc:rev']) === null || _result$ufoVcRev === void 0 ? void 0 : _result$ufoVcRev.find(({
|
|
@@ -6,7 +6,7 @@ import { experimentalVC, getExperimentalVCMetrics, onExperimentalInteractionComp
|
|
|
6
6
|
import { clearActiveTrace } from '../experience-trace-id-context';
|
|
7
7
|
import { allFeatureFlagsAccessed, currentFeatureFlagsAccessed } from '../feature-flags-accessed';
|
|
8
8
|
import { getInteractionId } from '../interaction-id-context';
|
|
9
|
-
import {
|
|
9
|
+
import { newVCObserver } from '../vc';
|
|
10
10
|
import { interactions } from './common/constants';
|
|
11
11
|
import PostInteractionLog from './post-interaction-log';
|
|
12
12
|
const PreviousInteractionLog = {
|
|
@@ -487,8 +487,10 @@ function finishInteraction(id, data, endTime = performance.now()) {
|
|
|
487
487
|
callCleanUpCallbacks(data);
|
|
488
488
|
if ((_getConfig4 = getConfig()) !== null && _getConfig4 !== void 0 && (_getConfig4$vc = _getConfig4.vc) !== null && _getConfig4$vc !== void 0 && _getConfig4$vc.stopVCAtInteractionFinish) {
|
|
489
489
|
// Use per-interaction VC observer if available, otherwise fall back to global
|
|
490
|
-
const observer = data.vcObserver
|
|
491
|
-
|
|
490
|
+
const observer = data.vcObserver;
|
|
491
|
+
if (observer) {
|
|
492
|
+
data.vc = observer.getVCRawData();
|
|
493
|
+
}
|
|
492
494
|
}
|
|
493
495
|
if (!((_getConfig5 = getConfig()) !== null && _getConfig5 !== void 0 && (_getConfig5$experimen = _getConfig5.experimentalInteractionMetrics) !== null && _getConfig5$experimen !== void 0 && _getConfig5$experimen.enabled)) {
|
|
494
496
|
remove(id);
|
|
@@ -692,7 +694,7 @@ export function addNewInteraction(interactionId, ufoName, type, startTime, rate,
|
|
|
692
694
|
ssrEnablePageLayoutPlaceholder: config.vc.ssrEnablePageLayoutPlaceholder,
|
|
693
695
|
disableSizeAndPositionCheck: config.vc.disableSizeAndPositionCheck
|
|
694
696
|
};
|
|
695
|
-
vcObserver =
|
|
697
|
+
vcObserver = newVCObserver(vcOptions);
|
|
696
698
|
}
|
|
697
699
|
|
|
698
700
|
// Create per-interaction VC observer when feature flag is enabled
|
|
@@ -769,31 +771,33 @@ export function addNewInteraction(interactionId, ufoName, type, startTime, rate,
|
|
|
769
771
|
}
|
|
770
772
|
if (type === 'transition' || type === 'page_load') {
|
|
771
773
|
// Use per-interaction VC observer if available, otherwise fall back to global
|
|
772
|
-
const observer = vcObserver
|
|
773
|
-
observer
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
}
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
}
|
|
774
|
+
const observer = vcObserver;
|
|
775
|
+
if (observer) {
|
|
776
|
+
observer.start({
|
|
777
|
+
startTime,
|
|
778
|
+
experienceKey: ufoName
|
|
779
|
+
});
|
|
780
|
+
}
|
|
781
|
+
if (coinflip(getPostInteractionRate(routeName || ufoName, type))) {
|
|
782
|
+
postInteractionLog.startVCObserver({
|
|
783
|
+
startTime
|
|
784
|
+
});
|
|
785
|
+
}
|
|
786
|
+
if (coinflip(getExperimentalInteractionRate(ufoName, type))) {
|
|
787
|
+
experimentalVC.start({
|
|
788
|
+
startTime
|
|
789
|
+
});
|
|
788
790
|
}
|
|
789
791
|
}
|
|
790
792
|
if (type === 'press' && fg('platform_ufo_enable_vc_press_interactions')) {
|
|
791
793
|
// Use per-interaction VC observer if available, otherwise fall back to global
|
|
792
|
-
const observer = vcObserver
|
|
793
|
-
observer
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
794
|
+
const observer = vcObserver;
|
|
795
|
+
if (observer) {
|
|
796
|
+
observer.start({
|
|
797
|
+
startTime,
|
|
798
|
+
experienceKey: ufoName
|
|
799
|
+
});
|
|
800
|
+
}
|
|
797
801
|
}
|
|
798
802
|
}
|
|
799
803
|
export function addBrowserMetricEvent(event) {
|
|
@@ -6,7 +6,6 @@ import { setupHiddenTimingCapture } from '../hidden-timing';
|
|
|
6
6
|
import { postInteractionLog, sinkInteractionHandler, sinkPostInteractionLogHandler } from '../interaction-metrics';
|
|
7
7
|
import { getPerformanceObserver } from '../interactions-performance-observer';
|
|
8
8
|
import { initialiseMemoryObserver, initialisePressureObserver } from '../machine-utilisation';
|
|
9
|
-
import { getVCObserver } from '../vc';
|
|
10
9
|
import scheduleIdleCallback from './schedule-idle-callback';
|
|
11
10
|
let initialized = false;
|
|
12
11
|
function sinkInteraction(instance, payloadPackage) {
|
|
@@ -95,17 +94,6 @@ export function init(analyticsWebClientAsync, config) {
|
|
|
95
94
|
startTime: 0
|
|
96
95
|
});
|
|
97
96
|
}
|
|
98
|
-
if (!fg('platform_ufo_enable_vc_observer_per_interaction')) {
|
|
99
|
-
var _config$postInteracti;
|
|
100
|
-
getVCObserver(vcOptions).start({
|
|
101
|
-
startTime: 0
|
|
102
|
-
});
|
|
103
|
-
if ((_config$postInteracti = config.postInteractionLog) !== null && _config$postInteracti !== void 0 && _config$postInteracti.enabled) {
|
|
104
|
-
postInteractionLog.startVCObserver({
|
|
105
|
-
startTime: 0
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
97
|
}
|
|
110
98
|
setupHiddenTimingCapture();
|
|
111
99
|
startLighthouseObserver();
|
|
@@ -123,23 +111,23 @@ export function init(analyticsWebClientAsync, config) {
|
|
|
123
111
|
Promise.all([analyticsWebClientAsync, import( /* webpackChunkName: "create-payloads" */'../create-payload'), import( /* webpackChunkName: "create-post-interaction-log-payload" */'../create-post-interaction-log-payload')]).then(([awc, payloadPackage, createPostInteractionLogPayloadPackage]) => {
|
|
124
112
|
if (awc.getAnalyticsWebClientPromise) {
|
|
125
113
|
awc.getAnalyticsWebClientPromise().then(client => {
|
|
126
|
-
var _config$experimentalI2, _config$
|
|
114
|
+
var _config$experimentalI2, _config$postInteracti;
|
|
127
115
|
const instance = client.getInstance();
|
|
128
116
|
sinkInteraction(instance, payloadPackage);
|
|
129
117
|
if (config !== null && config !== void 0 && (_config$experimentalI2 = config.experimentalInteractionMetrics) !== null && _config$experimentalI2 !== void 0 && _config$experimentalI2.enabled) {
|
|
130
118
|
sinkExperimentalInteractionMetrics(instance, payloadPackage);
|
|
131
119
|
}
|
|
132
|
-
if ((_config$
|
|
120
|
+
if ((_config$postInteracti = config.postInteractionLog) !== null && _config$postInteracti !== void 0 && _config$postInteracti.enabled) {
|
|
133
121
|
sinkPostInteractionLog(instance, createPostInteractionLogPayloadPackage.default);
|
|
134
122
|
}
|
|
135
123
|
});
|
|
136
124
|
} else if (awc.sendOperationalEvent) {
|
|
137
|
-
var _config$experimentalI3, _config$
|
|
125
|
+
var _config$experimentalI3, _config$postInteracti2;
|
|
138
126
|
sinkInteraction(awc, payloadPackage);
|
|
139
127
|
if (config !== null && config !== void 0 && (_config$experimentalI3 = config.experimentalInteractionMetrics) !== null && _config$experimentalI3 !== void 0 && _config$experimentalI3.enabled) {
|
|
140
128
|
sinkExperimentalInteractionMetrics(awc, payloadPackage);
|
|
141
129
|
}
|
|
142
|
-
if ((_config$
|
|
130
|
+
if ((_config$postInteracti2 = config.postInteractionLog) !== null && _config$postInteracti2 !== void 0 && _config$postInteracti2.enabled) {
|
|
143
131
|
sinkPostInteractionLog(awc, createPostInteractionLogPayloadPackage.default);
|
|
144
132
|
}
|
|
145
133
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
2
|
import { isContainedWithinMediaWrapper } from '../../vc-observer/media-wrapper/vc-utils';
|
|
4
3
|
import isNonVisualStyleMutation from '../../vc-observer/observers/non-visual-styles/is-non-visual-style-mutation';
|
|
5
4
|
import { RLLPlaceholderHandlers } from '../../vc-observer/observers/rll-placeholders';
|
|
@@ -41,19 +40,16 @@ const createElementMutationsWatcher = removedNodeRects => ({
|
|
|
41
40
|
target,
|
|
42
41
|
rect
|
|
43
42
|
}) => {
|
|
44
|
-
const isNoLsMarkerEnabled = fg('platform_vc_ignore_no_ls_mutation_marker');
|
|
45
43
|
const isInIgnoreLsMarker = isInVCIgnoreIfNoLayoutShiftMarker(target);
|
|
46
|
-
if (!isInIgnoreLsMarker
|
|
44
|
+
if (!isInIgnoreLsMarker) {
|
|
47
45
|
return 'mutation:element';
|
|
48
46
|
}
|
|
49
47
|
const isRLLPlaceholder = RLLPlaceholderHandlers.getInstance().isRLLPlaceholderHydration(rect);
|
|
50
|
-
if (isRLLPlaceholder &&
|
|
48
|
+
if (isRLLPlaceholder && isInIgnoreLsMarker) {
|
|
51
49
|
return 'mutation:rll-placeholder';
|
|
52
50
|
}
|
|
53
51
|
const wasDeleted = removedNodeRects.some(nr => sameRectDimensions(nr, rect));
|
|
54
|
-
|
|
55
|
-
// no layout shift mutation is excluded as per existing fy25.03 logic
|
|
56
|
-
if (wasDeleted && (!isNoLsMarkerEnabled || isInIgnoreLsMarker)) {
|
|
52
|
+
if (wasDeleted && isInIgnoreLsMarker) {
|
|
57
53
|
return 'mutation:element-replacement';
|
|
58
54
|
}
|
|
59
55
|
return 'mutation:element';
|
|
@@ -111,7 +107,7 @@ export default class ViewportObserver {
|
|
|
111
107
|
}
|
|
112
108
|
|
|
113
109
|
// SSR hydration logic
|
|
114
|
-
if (this.getSSRState
|
|
110
|
+
if (this.getSSRState) {
|
|
115
111
|
const ssrState = this.getSSRState();
|
|
116
112
|
const SSRStateEnum = {
|
|
117
113
|
normal: 1,
|
|
@@ -140,7 +136,7 @@ export default class ViewportObserver {
|
|
|
140
136
|
}
|
|
141
137
|
|
|
142
138
|
// SSR placeholder logic - check and handle with await
|
|
143
|
-
if (this.getSSRPlaceholderHandler
|
|
139
|
+
if (this.getSSRPlaceholderHandler) {
|
|
144
140
|
const ssrPlaceholderHandler = this.getSSRPlaceholderHandler();
|
|
145
141
|
if (ssrPlaceholderHandler) {
|
|
146
142
|
if (ssrPlaceholderHandler.isPlaceholder(addedNode) || ssrPlaceholderHandler.isPlaceholderIgnored(addedNode)) {
|
|
@@ -171,11 +167,7 @@ export default class ViewportObserver {
|
|
|
171
167
|
return n.isEqualNode(addedNode);
|
|
172
168
|
});
|
|
173
169
|
const isInIgnoreLsMarker = isInVCIgnoreIfNoLayoutShiftMarker(addedNode);
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
// When fg('platform_vc_ignore_no_ls_mutation_marker') is not enabled,
|
|
177
|
-
// no layout shift mutation is excluded as per existing fy25.03 logic
|
|
178
|
-
if (sameDeletedNode && (!isNoLsMarkerEnabled || isInIgnoreLsMarker)) {
|
|
170
|
+
if (sameDeletedNode && isInIgnoreLsMarker) {
|
|
179
171
|
var _this$intersectionObs5;
|
|
180
172
|
(_this$intersectionObs5 = this.intersectionObserver) === null || _this$intersectionObs5 === void 0 ? void 0 : _this$intersectionObs5.watchAndTag(addedNode, 'mutation:remount');
|
|
181
173
|
continue;
|
|
@@ -6,7 +6,6 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
6
6
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
7
|
import { getConfig, getMostRecentVCRevision } from '../../config';
|
|
8
8
|
import { postInteractionLog } from '../../interaction-metrics';
|
|
9
|
-
import { getVCObserver } from '../../vc';
|
|
10
9
|
import getInteractionStatus from './get-interaction-status';
|
|
11
10
|
import getPageVisibilityUpToTTAI from './get-page-visibility-up-to-ttai';
|
|
12
11
|
import getSSRDoneTimeValue from './get-ssr-done-time-value';
|
|
@@ -15,7 +14,7 @@ function getVCMetrics(_x) {
|
|
|
15
14
|
}
|
|
16
15
|
function _getVCMetrics() {
|
|
17
16
|
_getVCMetrics = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(interaction) {
|
|
18
|
-
var _config$vc, _config$vc$ssrWhiteli, _interaction$apdex, _config$vc2, _config$vc3,
|
|
17
|
+
var _config$vc, _config$vc$ssrWhiteli, _interaction$apdex, _config$vc2, _config$vc3, _result$ufoVcRev;
|
|
19
18
|
var config, interactionStatus, pageVisibilityUpToTTAI, shouldReportVCMetrics, observer, isSSREnabled, ssr, tti, prefix, result, mostRecentVCRevision, mostRecentVCRevisionPayload;
|
|
20
19
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
21
20
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -49,14 +48,20 @@ function _getVCMetrics() {
|
|
|
49
48
|
interactionStatus = getInteractionStatus(interaction);
|
|
50
49
|
pageVisibilityUpToTTAI = getPageVisibilityUpToTTAI(interaction);
|
|
51
50
|
shouldReportVCMetrics = interactionStatus.originalInteractionStatus === 'SUCCEEDED' && pageVisibilityUpToTTAI === 'visible'; // Use per-interaction VC observer if available, otherwise fall back to global
|
|
52
|
-
observer = interaction.vcObserver
|
|
51
|
+
observer = interaction.vcObserver;
|
|
52
|
+
if (observer) {
|
|
53
|
+
_context.next = 16;
|
|
54
|
+
break;
|
|
55
|
+
}
|
|
56
|
+
return _context.abrupt("return", {});
|
|
57
|
+
case 16:
|
|
53
58
|
if (!(!shouldReportVCMetrics && fg('platform_ufo_no_vc_on_aborted'))) {
|
|
54
|
-
_context.next =
|
|
59
|
+
_context.next = 19;
|
|
55
60
|
break;
|
|
56
61
|
}
|
|
57
62
|
observer.stop(interaction.ufoName);
|
|
58
63
|
return _context.abrupt("return", {});
|
|
59
|
-
case
|
|
64
|
+
case 19:
|
|
60
65
|
isSSREnabled = interaction.type === 'page_load' && ((config === null || config === void 0 ? void 0 : config.ssr) || (config === null || config === void 0 || (_config$vc$ssrWhiteli = config.vc.ssrWhitelist) === null || _config$vc$ssrWhiteli === void 0 ? void 0 : _config$vc$ssrWhiteli.includes(interaction.ufoName)));
|
|
61
66
|
ssr = interaction.type === 'page_load' && isSSREnabled ? {
|
|
62
67
|
ssr: getSSRDoneTimeValue(config)
|
|
@@ -64,7 +69,7 @@ function _getVCMetrics() {
|
|
|
64
69
|
postInteractionLog.setVCObserverSSRConfig(ssr);
|
|
65
70
|
tti = (_interaction$apdex = interaction.apdex) === null || _interaction$apdex === void 0 || (_interaction$apdex = _interaction$apdex[0]) === null || _interaction$apdex === void 0 ? void 0 : _interaction$apdex.stopTime;
|
|
66
71
|
prefix = 'ufo';
|
|
67
|
-
_context.next =
|
|
72
|
+
_context.next = 26;
|
|
68
73
|
return observer.getVCResult(_objectSpread({
|
|
69
74
|
start: interaction.start,
|
|
70
75
|
stop: interaction.end,
|
|
@@ -77,14 +82,9 @@ function _getVCMetrics() {
|
|
|
77
82
|
interactionId: interaction.id,
|
|
78
83
|
includeSSRRatio: (_config$vc3 = config.vc) === null || _config$vc3 === void 0 ? void 0 : _config$vc3.includeSSRRatio
|
|
79
84
|
}, ssr));
|
|
80
|
-
case
|
|
85
|
+
case 26:
|
|
81
86
|
result = _context.sent;
|
|
82
|
-
|
|
83
|
-
observer.stop(interaction.ufoName);
|
|
84
|
-
}
|
|
85
|
-
if ((_config$experimentalI = config.experimentalInteractionMetrics) !== null && _config$experimentalI !== void 0 && _config$experimentalI.enabled) {
|
|
86
|
-
observer.stop(interaction.ufoName);
|
|
87
|
-
}
|
|
87
|
+
observer.stop(interaction.ufoName);
|
|
88
88
|
postInteractionLog.setLastInteractionFinishVCResult(result);
|
|
89
89
|
mostRecentVCRevision = getMostRecentVCRevision(interaction.ufoName);
|
|
90
90
|
mostRecentVCRevisionPayload = result === null || result === void 0 || (_result$ufoVcRev = result['ufo:vc:rev']) === null || _result$ufoVcRev === void 0 ? void 0 : _result$ufoVcRev.find(function (_ref) {
|
|
@@ -92,15 +92,15 @@ function _getVCMetrics() {
|
|
|
92
92
|
return revision === mostRecentVCRevision;
|
|
93
93
|
});
|
|
94
94
|
if (!(!shouldReportVCMetrics || !(mostRecentVCRevisionPayload !== null && mostRecentVCRevisionPayload !== void 0 && mostRecentVCRevisionPayload.clean))) {
|
|
95
|
-
_context.next =
|
|
95
|
+
_context.next = 33;
|
|
96
96
|
break;
|
|
97
97
|
}
|
|
98
98
|
return _context.abrupt("return", result);
|
|
99
|
-
case
|
|
99
|
+
case 33:
|
|
100
100
|
return _context.abrupt("return", _objectSpread(_objectSpread({}, result), {}, {
|
|
101
101
|
'metric:vc90': mostRecentVCRevisionPayload['metric:vc90']
|
|
102
102
|
}));
|
|
103
|
-
case
|
|
103
|
+
case 34:
|
|
104
104
|
case "end":
|
|
105
105
|
return _context.stop();
|
|
106
106
|
}
|
|
@@ -16,7 +16,7 @@ import { experimentalVC, getExperimentalVCMetrics, onExperimentalInteractionComp
|
|
|
16
16
|
import { clearActiveTrace } from '../experience-trace-id-context';
|
|
17
17
|
import { allFeatureFlagsAccessed, currentFeatureFlagsAccessed } from '../feature-flags-accessed';
|
|
18
18
|
import { getInteractionId } from '../interaction-id-context';
|
|
19
|
-
import {
|
|
19
|
+
import { newVCObserver } from '../vc';
|
|
20
20
|
import { interactions } from './common/constants';
|
|
21
21
|
import PostInteractionLog from './post-interaction-log';
|
|
22
22
|
var PreviousInteractionLog = {
|
|
@@ -523,8 +523,10 @@ function finishInteraction(id, data) {
|
|
|
523
523
|
callCleanUpCallbacks(data);
|
|
524
524
|
if ((_getConfig4 = getConfig()) !== null && _getConfig4 !== void 0 && (_getConfig4 = _getConfig4.vc) !== null && _getConfig4 !== void 0 && _getConfig4.stopVCAtInteractionFinish) {
|
|
525
525
|
// Use per-interaction VC observer if available, otherwise fall back to global
|
|
526
|
-
var observer = data.vcObserver
|
|
527
|
-
|
|
526
|
+
var observer = data.vcObserver;
|
|
527
|
+
if (observer) {
|
|
528
|
+
data.vc = observer.getVCRawData();
|
|
529
|
+
}
|
|
528
530
|
}
|
|
529
531
|
if (!((_getConfig5 = getConfig()) !== null && _getConfig5 !== void 0 && (_getConfig5 = _getConfig5.experimentalInteractionMetrics) !== null && _getConfig5 !== void 0 && _getConfig5.enabled)) {
|
|
530
532
|
remove(id);
|
|
@@ -771,7 +773,7 @@ export function addNewInteraction(interactionId, ufoName, type, startTime, rate,
|
|
|
771
773
|
ssrEnablePageLayoutPlaceholder: config.vc.ssrEnablePageLayoutPlaceholder,
|
|
772
774
|
disableSizeAndPositionCheck: config.vc.disableSizeAndPositionCheck
|
|
773
775
|
};
|
|
774
|
-
vcObserver =
|
|
776
|
+
vcObserver = newVCObserver(vcOptions);
|
|
775
777
|
}
|
|
776
778
|
|
|
777
779
|
// Create per-interaction VC observer when feature flag is enabled
|
|
@@ -848,31 +850,33 @@ export function addNewInteraction(interactionId, ufoName, type, startTime, rate,
|
|
|
848
850
|
}
|
|
849
851
|
if (type === 'transition' || type === 'page_load') {
|
|
850
852
|
// Use per-interaction VC observer if available, otherwise fall back to global
|
|
851
|
-
var observer = vcObserver
|
|
852
|
-
observer
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
}
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
}
|
|
853
|
+
var observer = vcObserver;
|
|
854
|
+
if (observer) {
|
|
855
|
+
observer.start({
|
|
856
|
+
startTime: startTime,
|
|
857
|
+
experienceKey: ufoName
|
|
858
|
+
});
|
|
859
|
+
}
|
|
860
|
+
if (coinflip(getPostInteractionRate(routeName || ufoName, type))) {
|
|
861
|
+
postInteractionLog.startVCObserver({
|
|
862
|
+
startTime: startTime
|
|
863
|
+
});
|
|
864
|
+
}
|
|
865
|
+
if (coinflip(getExperimentalInteractionRate(ufoName, type))) {
|
|
866
|
+
experimentalVC.start({
|
|
867
|
+
startTime: startTime
|
|
868
|
+
});
|
|
867
869
|
}
|
|
868
870
|
}
|
|
869
871
|
if (type === 'press' && fg('platform_ufo_enable_vc_press_interactions')) {
|
|
870
872
|
// Use per-interaction VC observer if available, otherwise fall back to global
|
|
871
|
-
var _observer = vcObserver
|
|
872
|
-
_observer
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
873
|
+
var _observer = vcObserver;
|
|
874
|
+
if (_observer) {
|
|
875
|
+
_observer.start({
|
|
876
|
+
startTime: startTime,
|
|
877
|
+
experienceKey: ufoName
|
|
878
|
+
});
|
|
879
|
+
}
|
|
876
880
|
}
|
|
877
881
|
}
|
|
878
882
|
export function addBrowserMetricEvent(event) {
|
|
@@ -7,7 +7,6 @@ import { setupHiddenTimingCapture } from '../hidden-timing';
|
|
|
7
7
|
import { postInteractionLog, sinkInteractionHandler, sinkPostInteractionLogHandler } from '../interaction-metrics';
|
|
8
8
|
import { getPerformanceObserver } from '../interactions-performance-observer';
|
|
9
9
|
import { initialiseMemoryObserver, initialisePressureObserver } from '../machine-utilisation';
|
|
10
|
-
import { getVCObserver } from '../vc';
|
|
11
10
|
import scheduleIdleCallback from './schedule-idle-callback';
|
|
12
11
|
var initialized = false;
|
|
13
12
|
function sinkInteraction(instance, payloadPackage) {
|
|
@@ -96,17 +95,6 @@ export function init(analyticsWebClientAsync, config) {
|
|
|
96
95
|
startTime: 0
|
|
97
96
|
});
|
|
98
97
|
}
|
|
99
|
-
if (!fg('platform_ufo_enable_vc_observer_per_interaction')) {
|
|
100
|
-
var _config$postInteracti;
|
|
101
|
-
getVCObserver(vcOptions).start({
|
|
102
|
-
startTime: 0
|
|
103
|
-
});
|
|
104
|
-
if ((_config$postInteracti = config.postInteractionLog) !== null && _config$postInteracti !== void 0 && _config$postInteracti.enabled) {
|
|
105
|
-
postInteractionLog.startVCObserver({
|
|
106
|
-
startTime: 0
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
98
|
}
|
|
111
99
|
setupHiddenTimingCapture();
|
|
112
100
|
startLighthouseObserver();
|
|
@@ -128,23 +116,23 @@ export function init(analyticsWebClientAsync, config) {
|
|
|
128
116
|
createPostInteractionLogPayloadPackage = _ref2[2];
|
|
129
117
|
if (awc.getAnalyticsWebClientPromise) {
|
|
130
118
|
awc.getAnalyticsWebClientPromise().then(function (client) {
|
|
131
|
-
var _config$experimentalI2, _config$
|
|
119
|
+
var _config$experimentalI2, _config$postInteracti;
|
|
132
120
|
var instance = client.getInstance();
|
|
133
121
|
sinkInteraction(instance, payloadPackage);
|
|
134
122
|
if (config !== null && config !== void 0 && (_config$experimentalI2 = config.experimentalInteractionMetrics) !== null && _config$experimentalI2 !== void 0 && _config$experimentalI2.enabled) {
|
|
135
123
|
sinkExperimentalInteractionMetrics(instance, payloadPackage);
|
|
136
124
|
}
|
|
137
|
-
if ((_config$
|
|
125
|
+
if ((_config$postInteracti = config.postInteractionLog) !== null && _config$postInteracti !== void 0 && _config$postInteracti.enabled) {
|
|
138
126
|
sinkPostInteractionLog(instance, createPostInteractionLogPayloadPackage.default);
|
|
139
127
|
}
|
|
140
128
|
});
|
|
141
129
|
} else if (awc.sendOperationalEvent) {
|
|
142
|
-
var _config$experimentalI3, _config$
|
|
130
|
+
var _config$experimentalI3, _config$postInteracti2;
|
|
143
131
|
sinkInteraction(awc, payloadPackage);
|
|
144
132
|
if (config !== null && config !== void 0 && (_config$experimentalI3 = config.experimentalInteractionMetrics) !== null && _config$experimentalI3 !== void 0 && _config$experimentalI3.enabled) {
|
|
145
133
|
sinkExperimentalInteractionMetrics(awc, payloadPackage);
|
|
146
134
|
}
|
|
147
|
-
if ((_config$
|
|
135
|
+
if ((_config$postInteracti2 = config.postInteractionLog) !== null && _config$postInteracti2 !== void 0 && _config$postInteracti2.enabled) {
|
|
148
136
|
sinkPostInteractionLog(awc, createPostInteractionLogPayloadPackage.default);
|
|
149
137
|
}
|
|
150
138
|
}
|
|
@@ -6,7 +6,6 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
|
6
6
|
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
7
7
|
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
8
8
|
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
9
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
10
9
|
import { isContainedWithinMediaWrapper } from '../../vc-observer/media-wrapper/vc-utils';
|
|
11
10
|
import isNonVisualStyleMutation from '../../vc-observer/observers/non-visual-styles/is-non-visual-style-mutation';
|
|
12
11
|
import { RLLPlaceholderHandlers } from '../../vc-observer/observers/rll-placeholders';
|
|
@@ -48,21 +47,18 @@ var createElementMutationsWatcher = function createElementMutationsWatcher(remov
|
|
|
48
47
|
return function (_ref) {
|
|
49
48
|
var target = _ref.target,
|
|
50
49
|
rect = _ref.rect;
|
|
51
|
-
var isNoLsMarkerEnabled = fg('platform_vc_ignore_no_ls_mutation_marker');
|
|
52
50
|
var isInIgnoreLsMarker = isInVCIgnoreIfNoLayoutShiftMarker(target);
|
|
53
|
-
if (!isInIgnoreLsMarker
|
|
51
|
+
if (!isInIgnoreLsMarker) {
|
|
54
52
|
return 'mutation:element';
|
|
55
53
|
}
|
|
56
54
|
var isRLLPlaceholder = RLLPlaceholderHandlers.getInstance().isRLLPlaceholderHydration(rect);
|
|
57
|
-
if (isRLLPlaceholder &&
|
|
55
|
+
if (isRLLPlaceholder && isInIgnoreLsMarker) {
|
|
58
56
|
return 'mutation:rll-placeholder';
|
|
59
57
|
}
|
|
60
58
|
var wasDeleted = removedNodeRects.some(function (nr) {
|
|
61
59
|
return sameRectDimensions(nr, rect);
|
|
62
60
|
});
|
|
63
|
-
|
|
64
|
-
// no layout shift mutation is excluded as per existing fy25.03 logic
|
|
65
|
-
if (wasDeleted && (!isNoLsMarkerEnabled || isInIgnoreLsMarker)) {
|
|
61
|
+
if (wasDeleted && isInIgnoreLsMarker) {
|
|
66
62
|
return 'mutation:element-replacement';
|
|
67
63
|
}
|
|
68
64
|
return 'mutation:element';
|
|
@@ -118,7 +114,7 @@ var ViewportObserver = /*#__PURE__*/function () {
|
|
|
118
114
|
_context2.prev = 4;
|
|
119
115
|
_loop = /*#__PURE__*/_regeneratorRuntime.mark(function _loop() {
|
|
120
116
|
var _this$intersectionObs8;
|
|
121
|
-
var addedNodeRef, addedNode, ssrState, SSRStateEnum, _this$intersectionObs, _this$intersectionObs2, ssrPlaceholderHandler, result, _this$intersectionObs3, _result, _this$intersectionObs4, sameDeletedNode, isInIgnoreLsMarker,
|
|
117
|
+
var addedNodeRef, addedNode, ssrState, SSRStateEnum, _this$intersectionObs, _this$intersectionObs2, ssrPlaceholderHandler, result, _this$intersectionObs3, _result, _this$intersectionObs4, sameDeletedNode, isInIgnoreLsMarker, _this$intersectionObs5, _this$intersectionObs6, _checkWithinComponent, isWithinThirdPartySegment, _this$intersectionObs7;
|
|
122
118
|
return _regeneratorRuntime.wrap(function _loop$(_context) {
|
|
123
119
|
while (1) switch (_context.prev = _context.next) {
|
|
124
120
|
case 0:
|
|
@@ -130,7 +126,7 @@ var ViewportObserver = /*#__PURE__*/function () {
|
|
|
130
126
|
}
|
|
131
127
|
return _context.abrupt("return", 0);
|
|
132
128
|
case 4:
|
|
133
|
-
if (!
|
|
129
|
+
if (!_this.getSSRState) {
|
|
134
130
|
_context.next = 19;
|
|
135
131
|
break;
|
|
136
132
|
}
|
|
@@ -165,7 +161,7 @@ var ViewportObserver = /*#__PURE__*/function () {
|
|
|
165
161
|
case 18:
|
|
166
162
|
ssrState.state = SSRStateEnum.normal;
|
|
167
163
|
case 19:
|
|
168
|
-
if (!
|
|
164
|
+
if (!_this.getSSRPlaceholderHandler) {
|
|
169
165
|
_context.next = 36;
|
|
170
166
|
break;
|
|
171
167
|
}
|
|
@@ -212,32 +208,30 @@ var ViewportObserver = /*#__PURE__*/function () {
|
|
|
212
208
|
return n.isEqualNode(addedNode);
|
|
213
209
|
});
|
|
214
210
|
isInIgnoreLsMarker = isInVCIgnoreIfNoLayoutShiftMarker(addedNode);
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
if (!(sameDeletedNode && (!isNoLsMarkerEnabled || isInIgnoreLsMarker))) {
|
|
218
|
-
_context.next = 42;
|
|
211
|
+
if (!(sameDeletedNode && isInIgnoreLsMarker)) {
|
|
212
|
+
_context.next = 41;
|
|
219
213
|
break;
|
|
220
214
|
}
|
|
221
215
|
(_this$intersectionObs5 = _this.intersectionObserver) === null || _this$intersectionObs5 === void 0 || _this$intersectionObs5.watchAndTag(addedNode, 'mutation:remount');
|
|
222
216
|
return _context.abrupt("return", 0);
|
|
223
|
-
case
|
|
217
|
+
case 41:
|
|
224
218
|
if (!isContainedWithinMediaWrapper(addedNode)) {
|
|
225
|
-
_context.next =
|
|
219
|
+
_context.next = 44;
|
|
226
220
|
break;
|
|
227
221
|
}
|
|
228
222
|
(_this$intersectionObs6 = _this.intersectionObserver) === null || _this$intersectionObs6 === void 0 || _this$intersectionObs6.watchAndTag(addedNode, 'mutation:media');
|
|
229
223
|
return _context.abrupt("return", 0);
|
|
230
|
-
case
|
|
224
|
+
case 44:
|
|
231
225
|
_checkWithinComponent = checkWithinComponentAndExtractChildProps(addedNode, 'UFOThirdPartySegment'), isWithinThirdPartySegment = _checkWithinComponent.isWithin;
|
|
232
226
|
if (!isWithinThirdPartySegment) {
|
|
233
|
-
_context.next =
|
|
227
|
+
_context.next = 48;
|
|
234
228
|
break;
|
|
235
229
|
}
|
|
236
230
|
(_this$intersectionObs7 = _this.intersectionObserver) === null || _this$intersectionObs7 === void 0 || _this$intersectionObs7.watchAndTag(addedNode, 'mutation:third-party-element');
|
|
237
231
|
return _context.abrupt("return", 0);
|
|
238
|
-
case
|
|
232
|
+
case 48:
|
|
239
233
|
(_this$intersectionObs8 = _this.intersectionObserver) === null || _this$intersectionObs8 === void 0 || _this$intersectionObs8.watchAndTag(addedNode, createElementMutationsWatcher(removedNodeRects));
|
|
240
|
-
case
|
|
234
|
+
case 49:
|
|
241
235
|
case "end":
|
|
242
236
|
return _context.stop();
|
|
243
237
|
}
|
|
@@ -27,10 +27,10 @@ declare function createPostInteractionLogPayload({ lastInteractionFinish, reactP
|
|
|
27
27
|
vcClean: boolean;
|
|
28
28
|
type: import("../common").InteractionType;
|
|
29
29
|
abortReason?: import("../common").AbortReasonType | undefined;
|
|
30
|
-
id: string;
|
|
31
|
-
errors: import("../common").InteractionError[];
|
|
32
|
-
abortedByInteractionName?: string | undefined;
|
|
33
30
|
routeName: string | null;
|
|
31
|
+
abortedByInteractionName?: string | undefined;
|
|
32
|
+
errors: import("../common").InteractionError[];
|
|
33
|
+
id: string;
|
|
34
34
|
experimentalTTAI?: number | undefined;
|
|
35
35
|
experimentalVC90?: number | undefined;
|
|
36
36
|
};
|
|
@@ -27,10 +27,10 @@ declare function createPostInteractionLogPayload({ lastInteractionFinish, reactP
|
|
|
27
27
|
vcClean: boolean;
|
|
28
28
|
type: import("../common").InteractionType;
|
|
29
29
|
abortReason?: import("../common").AbortReasonType | undefined;
|
|
30
|
-
id: string;
|
|
31
|
-
errors: import("../common").InteractionError[];
|
|
32
|
-
abortedByInteractionName?: string | undefined;
|
|
33
30
|
routeName: string | null;
|
|
31
|
+
abortedByInteractionName?: string | undefined;
|
|
32
|
+
errors: import("../common").InteractionError[];
|
|
33
|
+
id: string;
|
|
34
34
|
experimentalTTAI?: number | undefined;
|
|
35
35
|
experimentalVC90?: number | undefined;
|
|
36
36
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/react-ufo",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.10",
|
|
4
4
|
"description": "Parts of React UFO that are publicly available",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -180,18 +180,9 @@
|
|
|
180
180
|
"platform_ufo_add_type_for_3p_segments": {
|
|
181
181
|
"type": "boolean"
|
|
182
182
|
},
|
|
183
|
-
"platform_vc_ignore_no_ls_mutation_marker": {
|
|
184
|
-
"type": "boolean"
|
|
185
|
-
},
|
|
186
|
-
"platform_ufo_vc_v3_ssr_placeholder": {
|
|
187
|
-
"type": "boolean"
|
|
188
|
-
},
|
|
189
183
|
"platform_ufo_enable_vc_press_interactions": {
|
|
190
184
|
"type": "boolean"
|
|
191
185
|
},
|
|
192
|
-
"platform_ufo_enable_vc_observer_per_interaction": {
|
|
193
|
-
"type": "boolean"
|
|
194
|
-
},
|
|
195
186
|
"platform_ufo_abort_measurement_fix": {
|
|
196
187
|
"type": "boolean"
|
|
197
188
|
},
|