@atlaskit/insm 1.0.30 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/dist/cjs/insm-period.js +4 -2
- package/dist/cjs/insm.js +1 -1
- package/dist/es2019/insm-period.js +4 -2
- package/dist/es2019/insm.js +1 -1
- package/dist/esm/insm-period.js +4 -2
- package/dist/esm/insm.js +1 -1
- package/dist/types/insm-period.d.ts +4 -4
- package/dist/types/insm.d.ts +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/insm
|
|
2
2
|
|
|
3
|
+
## 1.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`f442eef602ce7`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f442eef602ce7) -
|
|
8
|
+
Disabling AFPs metric
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- Updated dependencies
|
|
13
|
+
|
|
14
|
+
## 1.0.31
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- Updated dependencies
|
|
19
|
+
|
|
3
20
|
## 1.0.30
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
package/dist/cjs/insm-period.js
CHANGED
|
@@ -60,6 +60,7 @@ var PeriodTracking = exports.PeriodTracking = /*#__PURE__*/function () {
|
|
|
60
60
|
try {
|
|
61
61
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
62
62
|
var periodMeasurer = _step.value;
|
|
63
|
+
if (!periodMeasurer) continue;
|
|
63
64
|
periodMeasurer.start(startInteractivityMeasuresPaused);
|
|
64
65
|
this.periodMeasurements.active.measurements[periodMeasurer.name] = {
|
|
65
66
|
numerator: 0,
|
|
@@ -116,7 +117,7 @@ var PeriodTracking = exports.PeriodTracking = /*#__PURE__*/function () {
|
|
|
116
117
|
try {
|
|
117
118
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
118
119
|
var periodMeasurer = _step2.value;
|
|
119
|
-
periodMeasurer.pause();
|
|
120
|
+
periodMeasurer === null || periodMeasurer === void 0 || periodMeasurer.pause();
|
|
120
121
|
}
|
|
121
122
|
} catch (err) {
|
|
122
123
|
_iterator2.e(err);
|
|
@@ -144,7 +145,7 @@ var PeriodTracking = exports.PeriodTracking = /*#__PURE__*/function () {
|
|
|
144
145
|
try {
|
|
145
146
|
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
146
147
|
var periodMeasurer = _step3.value;
|
|
147
|
-
periodMeasurer.resume();
|
|
148
|
+
periodMeasurer === null || periodMeasurer === void 0 || periodMeasurer.resume();
|
|
148
149
|
}
|
|
149
150
|
} catch (err) {
|
|
150
151
|
_iterator3.e(err);
|
|
@@ -253,6 +254,7 @@ var PeriodTracking = exports.PeriodTracking = /*#__PURE__*/function () {
|
|
|
253
254
|
try {
|
|
254
255
|
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
|
255
256
|
var interactivityMeasure = _step5.value;
|
|
257
|
+
if (!interactivityMeasure) continue;
|
|
256
258
|
var finalResult = newPeriod ? interactivityMeasure.start(interactivityMeasuresPaused) : interactivityMeasure.end();
|
|
257
259
|
var tracked = this.periodMeasurements[lastPeriod].measurements[interactivityMeasure.name];
|
|
258
260
|
if (finalResult.average === 0) {
|
package/dist/cjs/insm.js
CHANGED
|
@@ -22,7 +22,7 @@ var INSM = exports.INSM = /*#__PURE__*/function () {
|
|
|
22
22
|
* page session.
|
|
23
23
|
*/
|
|
24
24
|
(0, _defineProperty2.default)(this, "runningHeavyTasks", new Set());
|
|
25
|
-
this.periodMeasurers = [new _afps.AnimationFPSIM(), new _inp.INPTracker()];
|
|
25
|
+
this.periodMeasurers = [(0, _expValEquals.expValEquals)('platform_editor_disable_afps', 'isEnabled', true) ? undefined : new _afps.AnimationFPSIM(), new _inp.INPTracker()];
|
|
26
26
|
this.options = options;
|
|
27
27
|
|
|
28
28
|
// If this does throw -- we do want an unhandledRejection rejection to be passed to the window
|
|
@@ -44,6 +44,7 @@ export class PeriodTracking {
|
|
|
44
44
|
this.pauses = new Set(session.insm.runningHeavyTasks);
|
|
45
45
|
const startInteractivityMeasuresPaused = this.latestHeavyTasks.size !== 0;
|
|
46
46
|
for (const periodMeasurer of session.insm.periodMeasurers) {
|
|
47
|
+
if (!periodMeasurer) continue;
|
|
47
48
|
periodMeasurer.start(startInteractivityMeasuresPaused);
|
|
48
49
|
this.periodMeasurements.active.measurements[periodMeasurer.name] = {
|
|
49
50
|
numerator: 0,
|
|
@@ -83,7 +84,7 @@ export class PeriodTracking {
|
|
|
83
84
|
if (this.pauses.size === 0) {
|
|
84
85
|
this.periodMeasurements[this.state].duration = this.periodMeasurements[this.state].duration + (performance.now() - this.currentPeriodStart);
|
|
85
86
|
for (const periodMeasurer of this.session.insm.periodMeasurers) {
|
|
86
|
-
periodMeasurer.pause();
|
|
87
|
+
periodMeasurer === null || periodMeasurer === void 0 ? void 0 : periodMeasurer.pause();
|
|
87
88
|
}
|
|
88
89
|
}
|
|
89
90
|
this.pauses.add(pauseName);
|
|
@@ -100,7 +101,7 @@ export class PeriodTracking {
|
|
|
100
101
|
if (this.pauses.size === 0) {
|
|
101
102
|
this.currentPeriodStart = performance.now();
|
|
102
103
|
for (const periodMeasurer of this.session.insm.periodMeasurers) {
|
|
103
|
-
periodMeasurer.resume();
|
|
104
|
+
periodMeasurer === null || periodMeasurer === void 0 ? void 0 : periodMeasurer.resume();
|
|
104
105
|
}
|
|
105
106
|
}
|
|
106
107
|
}
|
|
@@ -178,6 +179,7 @@ export class PeriodTracking {
|
|
|
178
179
|
this.periodMeasurements[lastPeriod].count++;
|
|
179
180
|
const interactivityMeasuresPaused = this.latestHeavyTasks.size !== 0;
|
|
180
181
|
for (const interactivityMeasure of this.session.insm.periodMeasurers) {
|
|
182
|
+
if (!interactivityMeasure) continue;
|
|
181
183
|
const finalResult = newPeriod ? interactivityMeasure.start(interactivityMeasuresPaused) : interactivityMeasure.end();
|
|
182
184
|
const tracked = this.periodMeasurements[lastPeriod].measurements[interactivityMeasure.name];
|
|
183
185
|
if (finalResult.average === 0) {
|
package/dist/es2019/insm.js
CHANGED
|
@@ -11,7 +11,7 @@ export class INSM {
|
|
|
11
11
|
* page session.
|
|
12
12
|
*/
|
|
13
13
|
_defineProperty(this, "runningHeavyTasks", new Set());
|
|
14
|
-
this.periodMeasurers = [new AnimationFPSIM(), new INPTracker()];
|
|
14
|
+
this.periodMeasurers = [expValEquals('platform_editor_disable_afps', 'isEnabled', true) ? undefined : new AnimationFPSIM(), new INPTracker()];
|
|
15
15
|
this.options = options;
|
|
16
16
|
|
|
17
17
|
// If this does throw -- we do want an unhandledRejection rejection to be passed to the window
|
package/dist/esm/insm-period.js
CHANGED
|
@@ -54,6 +54,7 @@ export var PeriodTracking = /*#__PURE__*/function () {
|
|
|
54
54
|
try {
|
|
55
55
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
56
56
|
var periodMeasurer = _step.value;
|
|
57
|
+
if (!periodMeasurer) continue;
|
|
57
58
|
periodMeasurer.start(startInteractivityMeasuresPaused);
|
|
58
59
|
this.periodMeasurements.active.measurements[periodMeasurer.name] = {
|
|
59
60
|
numerator: 0,
|
|
@@ -110,7 +111,7 @@ export var PeriodTracking = /*#__PURE__*/function () {
|
|
|
110
111
|
try {
|
|
111
112
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
112
113
|
var periodMeasurer = _step2.value;
|
|
113
|
-
periodMeasurer.pause();
|
|
114
|
+
periodMeasurer === null || periodMeasurer === void 0 || periodMeasurer.pause();
|
|
114
115
|
}
|
|
115
116
|
} catch (err) {
|
|
116
117
|
_iterator2.e(err);
|
|
@@ -138,7 +139,7 @@ export var PeriodTracking = /*#__PURE__*/function () {
|
|
|
138
139
|
try {
|
|
139
140
|
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
|
140
141
|
var periodMeasurer = _step3.value;
|
|
141
|
-
periodMeasurer.resume();
|
|
142
|
+
periodMeasurer === null || periodMeasurer === void 0 || periodMeasurer.resume();
|
|
142
143
|
}
|
|
143
144
|
} catch (err) {
|
|
144
145
|
_iterator3.e(err);
|
|
@@ -247,6 +248,7 @@ export var PeriodTracking = /*#__PURE__*/function () {
|
|
|
247
248
|
try {
|
|
248
249
|
for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
|
|
249
250
|
var interactivityMeasure = _step5.value;
|
|
251
|
+
if (!interactivityMeasure) continue;
|
|
250
252
|
var finalResult = newPeriod ? interactivityMeasure.start(interactivityMeasuresPaused) : interactivityMeasure.end();
|
|
251
253
|
var tracked = this.periodMeasurements[lastPeriod].measurements[interactivityMeasure.name];
|
|
252
254
|
if (finalResult.average === 0) {
|
package/dist/esm/insm.js
CHANGED
|
@@ -15,7 +15,7 @@ export var INSM = /*#__PURE__*/function () {
|
|
|
15
15
|
* page session.
|
|
16
16
|
*/
|
|
17
17
|
_defineProperty(this, "runningHeavyTasks", new Set());
|
|
18
|
-
this.periodMeasurers = [new AnimationFPSIM(), new INPTracker()];
|
|
18
|
+
this.periodMeasurers = [expValEquals('platform_editor_disable_afps', 'isEnabled', true) ? undefined : new AnimationFPSIM(), new INPTracker()];
|
|
19
19
|
this.options = options;
|
|
20
20
|
|
|
21
21
|
// If this does throw -- we do want an unhandledRejection rejection to be passed to the window
|
|
@@ -54,22 +54,22 @@ export declare class PeriodTracking {
|
|
|
54
54
|
};
|
|
55
55
|
} | {
|
|
56
56
|
active: {
|
|
57
|
+
count: number;
|
|
58
|
+
duration: number;
|
|
57
59
|
features: string[];
|
|
58
60
|
heavyTasks: string[];
|
|
59
61
|
measurements: {
|
|
60
62
|
[key: string]: Measure;
|
|
61
63
|
};
|
|
62
|
-
duration: number;
|
|
63
|
-
count: number;
|
|
64
64
|
};
|
|
65
65
|
inactive: {
|
|
66
|
+
count: number;
|
|
67
|
+
duration: number;
|
|
66
68
|
features: string[];
|
|
67
69
|
heavyTasks: string[];
|
|
68
70
|
measurements: {
|
|
69
71
|
[key: string]: Measure;
|
|
70
72
|
};
|
|
71
|
-
duration: number;
|
|
72
|
-
count: number;
|
|
73
73
|
};
|
|
74
74
|
};
|
|
75
75
|
private activeStartListeners;
|
package/dist/types/insm.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export declare class INSM {
|
|
|
7
7
|
analyticsWebClient?: AnalyticsWebClient;
|
|
8
8
|
runningSession?: INSMSession;
|
|
9
9
|
options: INSMOptions;
|
|
10
|
-
periodMeasurers: [AnimationFPSIM, INPTracker];
|
|
10
|
+
periodMeasurers: [AnimationFPSIM | undefined, INPTracker];
|
|
11
11
|
/**
|
|
12
12
|
* Heavy tasks are tracked at the insm layer as heavy tasks
|
|
13
13
|
* are expected at times to be unrelated to the current
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/insm",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "INSM tooling measures user-perceived interactivity of a page",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"atlaskit:src": "src/index.ts",
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@atlaskit/analytics-listeners": "^11.1.0",
|
|
21
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
21
|
+
"@atlaskit/tmp-editor-statsig": "^135.0.0",
|
|
22
22
|
"@babel/runtime": "^7.0.0",
|
|
23
23
|
"bowser-ultralight": "^1.0.6"
|
|
24
24
|
},
|