@atlaskit/insm 0.1.3 → 0.2.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 +11 -0
- package/README.md +3 -0
- package/dist/cjs/insm-period.js +20 -2
- package/dist/cjs/insm-session.js +26 -9
- package/dist/cjs/insm.js +26 -12
- package/dist/cjs/session-measurers/LongAnimationFrameMeasurer.js +76 -34
- package/dist/es2019/insm-period.js +19 -1
- package/dist/es2019/insm-session.js +21 -6
- package/dist/es2019/insm.js +26 -12
- package/dist/es2019/session-measurers/LongAnimationFrameMeasurer.js +61 -34
- package/dist/esm/insm-period.js +19 -1
- package/dist/esm/insm-session.js +26 -9
- package/dist/esm/insm.js +26 -12
- package/dist/esm/session-measurers/LongAnimationFrameMeasurer.js +77 -34
- package/dist/types/insm-period.d.ts +21 -2
- package/dist/types/insm-session.d.ts +8 -0
- package/dist/types/insm.d.ts +11 -4
- package/dist/types/session-measurers/LongAnimationFrameMeasurer.d.ts +26 -24
- package/dist/types/types.d.ts +25 -25
- package/dist/types-ts4.5/insm-period.d.ts +21 -2
- package/dist/types-ts4.5/insm-session.d.ts +8 -0
- package/dist/types-ts4.5/insm.d.ts +11 -4
- package/dist/types-ts4.5/session-measurers/LongAnimationFrameMeasurer.d.ts +26 -24
- package/dist/types-ts4.5/types.d.ts +25 -25
- package/package.json +8 -3
|
@@ -1,19 +1,32 @@
|
|
|
1
1
|
import type { INSMSession } from '../insm-session';
|
|
2
2
|
type LongAnimationFrameMeasurerOptions = {
|
|
3
3
|
initial: boolean;
|
|
4
|
-
limit: number;
|
|
5
4
|
insmSession: INSMSession;
|
|
5
|
+
limit: number;
|
|
6
6
|
reportingThreshold: number;
|
|
7
7
|
};
|
|
8
|
+
interface TrackedScriptTiming {
|
|
9
|
+
afDuration: number;
|
|
10
|
+
duration: number;
|
|
11
|
+
features: string[];
|
|
12
|
+
forcedStyleAndLayoutDuration: number;
|
|
13
|
+
invoker: string;
|
|
14
|
+
invokerType: string;
|
|
15
|
+
sourceCharPosition: number;
|
|
16
|
+
sourceFunctionName: string;
|
|
17
|
+
sourceURL: string;
|
|
18
|
+
}
|
|
8
19
|
export declare class LongAnimationFrameMeasurer {
|
|
9
20
|
private observer?;
|
|
10
|
-
private
|
|
21
|
+
private longestScriptTimings;
|
|
11
22
|
private options;
|
|
12
23
|
private paused;
|
|
13
24
|
private minimumIndex;
|
|
14
25
|
private minimumDuration;
|
|
15
26
|
constructor(options: LongAnimationFrameMeasurerOptions);
|
|
16
27
|
private handleBatch;
|
|
28
|
+
private createScriptTiming;
|
|
29
|
+
private processScript;
|
|
17
30
|
/**
|
|
18
31
|
* Pauses tracking
|
|
19
32
|
*/
|
|
@@ -23,39 +36,28 @@ export declare class LongAnimationFrameMeasurer {
|
|
|
23
36
|
*/
|
|
24
37
|
resume(): void;
|
|
25
38
|
/**
|
|
26
|
-
* Returns the current tracked longest
|
|
39
|
+
* Returns the current tracked longest script timings sorted by duration
|
|
27
40
|
*/
|
|
28
|
-
get current():
|
|
41
|
+
get current(): TrackedScriptTiming[];
|
|
29
42
|
/**
|
|
30
43
|
* Cleans up the performance tracking (tracking cannot be resumed following this).
|
|
31
44
|
*/
|
|
32
45
|
cleanup(): void;
|
|
33
46
|
}
|
|
34
|
-
interface
|
|
35
|
-
readonly startTime: DOMHighResTimeStamp;
|
|
47
|
+
export interface _PerformanceScriptTiming extends PerformanceEntry {
|
|
36
48
|
readonly duration: DOMHighResTimeStamp;
|
|
37
|
-
readonly name: string;
|
|
38
49
|
readonly entryType: string;
|
|
39
|
-
readonly invokerType: 'classic-script' | 'module-script' | 'event-listener' | 'user-callback' | 'resolve-promise' | 'reject-promise';
|
|
40
|
-
readonly invoker: string;
|
|
41
50
|
readonly executionStart: DOMHighResTimeStamp;
|
|
42
|
-
readonly sourceURL: string;
|
|
43
|
-
readonly sourceFunctionName: string;
|
|
44
|
-
readonly sourceCharPosition: number;
|
|
45
|
-
readonly pauseDuration: DOMHighResTimeStamp;
|
|
46
51
|
readonly forcedStyleAndLayoutDuration: DOMHighResTimeStamp;
|
|
52
|
+
readonly invoker: string;
|
|
53
|
+
readonly invokerType: 'classic-script' | 'module-script' | 'event-listener' | 'user-callback' | 'resolve-promise' | 'reject-promise';
|
|
54
|
+
readonly name: string;
|
|
55
|
+
readonly pauseDuration: DOMHighResTimeStamp;
|
|
56
|
+
readonly sourceCharPosition: number;
|
|
57
|
+
readonly sourceFunctionName: string;
|
|
58
|
+
readonly sourceURL: string;
|
|
59
|
+
readonly startTime: DOMHighResTimeStamp;
|
|
47
60
|
readonly window?: Window;
|
|
48
61
|
readonly windowAttribution: 'self' | 'descendant' | 'ancestor' | 'same-page' | 'other';
|
|
49
62
|
}
|
|
50
|
-
interface PerformanceLongAnimationFrameTiming extends PerformanceEntry {
|
|
51
|
-
readonly startTime: DOMHighResTimeStamp;
|
|
52
|
-
readonly duration: DOMHighResTimeStamp;
|
|
53
|
-
readonly name: string;
|
|
54
|
-
readonly entryType: string;
|
|
55
|
-
readonly renderStart: DOMHighResTimeStamp;
|
|
56
|
-
readonly styleAndLayoutStart: DOMHighResTimeStamp;
|
|
57
|
-
readonly blockingDuration: DOMHighResTimeStamp;
|
|
58
|
-
readonly firstUIEventTimestamp: DOMHighResTimeStamp;
|
|
59
|
-
readonly scripts: PerformanceScriptTiming[];
|
|
60
|
-
}
|
|
61
63
|
export {};
|
package/dist/types/types.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { AnalyticsWebClient } from '@atlaskit/analytics-listeners';
|
|
2
2
|
export type INSMOptions = {
|
|
3
|
-
getAnalyticsWebClient: Promise<AnalyticsWebClient>;
|
|
4
3
|
/**
|
|
5
4
|
* If an experience is missing or not enabled - no session event will be fired
|
|
6
5
|
*/
|
|
@@ -9,12 +8,9 @@ export type INSMOptions = {
|
|
|
9
8
|
enabled: boolean;
|
|
10
9
|
} | undefined;
|
|
11
10
|
};
|
|
11
|
+
getAnalyticsWebClient: Promise<AnalyticsWebClient>;
|
|
12
12
|
};
|
|
13
13
|
export type ExperienceProperties = {
|
|
14
|
-
/**
|
|
15
|
-
* Whether this represents the initial page the user is visiting
|
|
16
|
-
*/
|
|
17
|
-
initial: boolean;
|
|
18
14
|
/**
|
|
19
15
|
* An optional content id (ie. for a Confluence page - the page id)
|
|
20
16
|
*
|
|
@@ -22,24 +18,44 @@ export type ExperienceProperties = {
|
|
|
22
18
|
* not expected to provide this property.
|
|
23
19
|
*/
|
|
24
20
|
contentId?: string | null;
|
|
21
|
+
/**
|
|
22
|
+
* Whether this represents the initial page the user is visiting
|
|
23
|
+
*/
|
|
24
|
+
initial: boolean;
|
|
25
25
|
};
|
|
26
26
|
export type AddedProperties = {
|
|
27
|
-
[key: string]: string | number | boolean;
|
|
27
|
+
[key: string]: string | number | boolean | undefined;
|
|
28
28
|
} | (() => {
|
|
29
|
-
[key: string]: string | number | boolean;
|
|
29
|
+
[key: string]: string | number | boolean | undefined;
|
|
30
30
|
});
|
|
31
31
|
export type Measure = {
|
|
32
|
-
|
|
32
|
+
average: number;
|
|
33
33
|
denominator: number;
|
|
34
34
|
max: number;
|
|
35
35
|
min: number;
|
|
36
|
-
|
|
36
|
+
numerator: number;
|
|
37
37
|
};
|
|
38
38
|
export interface PeriodMeasurer {
|
|
39
|
+
/**
|
|
40
|
+
* Run any cleanup, and report the last periods interactivity.
|
|
41
|
+
*
|
|
42
|
+
* Important note: A new period can start after the end has been reached
|
|
43
|
+
* in cases where the measurement was ended due to a scenario such as an
|
|
44
|
+
* error boundary being hit (via `insm.stopEarly`).
|
|
45
|
+
*/
|
|
46
|
+
end: () => Measure;
|
|
39
47
|
/**
|
|
40
48
|
* Name of the interactivity measurement (measures in the resulting insm event will be under this key)
|
|
41
49
|
*/
|
|
42
50
|
name: string;
|
|
51
|
+
/**
|
|
52
|
+
* Pauses measurement (ie. when heavy work is triggered)
|
|
53
|
+
*/
|
|
54
|
+
pause: () => void;
|
|
55
|
+
/**
|
|
56
|
+
* Pauses measurement (ie. when heavy work completes)
|
|
57
|
+
*/
|
|
58
|
+
resume: () => void;
|
|
43
59
|
/**
|
|
44
60
|
* Called when an the state changes, and/or a new experience session starts.
|
|
45
61
|
*
|
|
@@ -62,20 +78,4 @@ export interface PeriodMeasurer {
|
|
|
62
78
|
* When started with paused = true. it indicates a heavy task is running at startup time.
|
|
63
79
|
*/
|
|
64
80
|
paused: boolean) => Measure | undefined;
|
|
65
|
-
/**
|
|
66
|
-
* Run any cleanup, and report the last periods interactivity.
|
|
67
|
-
*
|
|
68
|
-
* Important note: A new period can start after the end has been reached
|
|
69
|
-
* in cases where the measurement was ended due to a scenario such as an
|
|
70
|
-
* error boundary being hit (via `insm.stopEarly`).
|
|
71
|
-
*/
|
|
72
|
-
end: () => Measure;
|
|
73
|
-
/**
|
|
74
|
-
* Pauses measurement (ie. when heavy work is triggered)
|
|
75
|
-
*/
|
|
76
|
-
pause: () => void;
|
|
77
|
-
/**
|
|
78
|
-
* Pauses measurement (ie. when heavy work completes)
|
|
79
|
-
*/
|
|
80
|
-
resume: () => void;
|
|
81
81
|
}
|
|
@@ -35,20 +35,39 @@ export declare class PeriodTracking {
|
|
|
35
35
|
resume(pauseName: string): void;
|
|
36
36
|
get endResults(): {
|
|
37
37
|
active: {
|
|
38
|
+
count: number;
|
|
39
|
+
duration: number;
|
|
38
40
|
features: Set<string>;
|
|
39
41
|
heavyTasks: Set<string>;
|
|
40
42
|
measurements: {
|
|
41
43
|
[key: string]: Measure;
|
|
42
44
|
};
|
|
43
|
-
duration: number;
|
|
44
|
-
count: number;
|
|
45
45
|
};
|
|
46
46
|
inactive: {
|
|
47
|
+
count: number;
|
|
48
|
+
duration: number;
|
|
47
49
|
features: Set<string>;
|
|
48
50
|
heavyTasks: Set<string>;
|
|
49
51
|
measurements: {
|
|
50
52
|
[key: string]: Measure;
|
|
51
53
|
};
|
|
54
|
+
};
|
|
55
|
+
} | {
|
|
56
|
+
active: {
|
|
57
|
+
features: string[];
|
|
58
|
+
heavyTasks: string[];
|
|
59
|
+
measurements: {
|
|
60
|
+
[key: string]: Measure;
|
|
61
|
+
};
|
|
62
|
+
duration: number;
|
|
63
|
+
count: number;
|
|
64
|
+
};
|
|
65
|
+
inactive: {
|
|
66
|
+
features: string[];
|
|
67
|
+
heavyTasks: string[];
|
|
68
|
+
measurements: {
|
|
69
|
+
[key: string]: Measure;
|
|
70
|
+
};
|
|
52
71
|
duration: number;
|
|
53
72
|
count: number;
|
|
54
73
|
};
|
|
@@ -6,11 +6,14 @@ import { LongAnimationFrameMeasurer } from './session-measurers/LongAnimationFra
|
|
|
6
6
|
* Only intended for internal use.
|
|
7
7
|
*
|
|
8
8
|
* Exported for consumers who may require the type.
|
|
9
|
+
*
|
|
10
|
+
* Note: Events are not reliably fired from mobile browsers (ie. when a browser is closed when not in use)
|
|
9
11
|
*/
|
|
10
12
|
export declare class INSMSession {
|
|
11
13
|
private experienceKey;
|
|
12
14
|
private experienceProperties;
|
|
13
15
|
private startedAt;
|
|
16
|
+
private pageLoadTime;
|
|
14
17
|
insm: INSM;
|
|
15
18
|
private running;
|
|
16
19
|
private addedProperties;
|
|
@@ -18,6 +21,11 @@ export declare class INSMSession {
|
|
|
18
21
|
periodTracking: PeriodTracking;
|
|
19
22
|
longAnimationFrameMeasurer: LongAnimationFrameMeasurer;
|
|
20
23
|
constructor(experienceKey: string, experienceProperties: ExperienceProperties, insm: INSM);
|
|
24
|
+
/**
|
|
25
|
+
* Completes the page load timing. This is called automatically when ending a heavy task
|
|
26
|
+
* with the key 'PageLoad'.
|
|
27
|
+
*/
|
|
28
|
+
completePageLoad(): void;
|
|
21
29
|
updateExperienceKey(experienceKey: string): void;
|
|
22
30
|
/**
|
|
23
31
|
* Adds a feature to the currently running session
|
|
@@ -22,6 +22,9 @@ export declare class INSM {
|
|
|
22
22
|
* Starts a heavy task in the currently running session.
|
|
23
23
|
*
|
|
24
24
|
* This also pauses measurement.
|
|
25
|
+
*
|
|
26
|
+
* For PageLoads using the key 'PageLoad' will mean the heavy task duration
|
|
27
|
+
* is added to the insm session event as pageLoadTime.
|
|
25
28
|
*/
|
|
26
29
|
startHeavyTask(heavyTaskName: string): void;
|
|
27
30
|
/**
|
|
@@ -32,15 +35,19 @@ export declare class INSM {
|
|
|
32
35
|
* Call this when starting a new experience. This is expected to be wired to the product
|
|
33
36
|
* routing solution.
|
|
34
37
|
*
|
|
35
|
-
* It's expected this call will be paired with a `insm.session.startHeavyTask('
|
|
36
|
-
* so that performance degradations linked
|
|
38
|
+
* It's expected this call will be paired with a `insm.session.startHeavyTask('PageLoad')` and
|
|
39
|
+
* subsequent `insm.session.endHeavyTask('PageLoad')` so that performance degradations linked
|
|
40
|
+
* to the page initialisation are excluded from the active interactivity monitoring.
|
|
41
|
+
*
|
|
42
|
+
* Using the key 'PageLoad' is special and will result in the heavy task duration being added to the
|
|
43
|
+
* insm session event as pageLoadTime.
|
|
37
44
|
*
|
|
38
45
|
*
|
|
39
46
|
* ```ts
|
|
40
47
|
* insm.start('edit-page', { initial: true, contentId: '9001' })
|
|
41
|
-
* insm.session.startHeavyTask(''
|
|
48
|
+
* insm.session.startHeavyTask('PageLoad')
|
|
42
49
|
* // ... heavy initialisation work
|
|
43
|
-
* insm.session.endHeavyTask(''
|
|
50
|
+
* insm.session.endHeavyTask('PageLoad')
|
|
44
51
|
* ```
|
|
45
52
|
*/
|
|
46
53
|
start(experienceKey: string, experienceProperties: ExperienceProperties): void;
|
|
@@ -1,19 +1,32 @@
|
|
|
1
1
|
import type { INSMSession } from '../insm-session';
|
|
2
2
|
type LongAnimationFrameMeasurerOptions = {
|
|
3
3
|
initial: boolean;
|
|
4
|
-
limit: number;
|
|
5
4
|
insmSession: INSMSession;
|
|
5
|
+
limit: number;
|
|
6
6
|
reportingThreshold: number;
|
|
7
7
|
};
|
|
8
|
+
interface TrackedScriptTiming {
|
|
9
|
+
afDuration: number;
|
|
10
|
+
duration: number;
|
|
11
|
+
features: string[];
|
|
12
|
+
forcedStyleAndLayoutDuration: number;
|
|
13
|
+
invoker: string;
|
|
14
|
+
invokerType: string;
|
|
15
|
+
sourceCharPosition: number;
|
|
16
|
+
sourceFunctionName: string;
|
|
17
|
+
sourceURL: string;
|
|
18
|
+
}
|
|
8
19
|
export declare class LongAnimationFrameMeasurer {
|
|
9
20
|
private observer?;
|
|
10
|
-
private
|
|
21
|
+
private longestScriptTimings;
|
|
11
22
|
private options;
|
|
12
23
|
private paused;
|
|
13
24
|
private minimumIndex;
|
|
14
25
|
private minimumDuration;
|
|
15
26
|
constructor(options: LongAnimationFrameMeasurerOptions);
|
|
16
27
|
private handleBatch;
|
|
28
|
+
private createScriptTiming;
|
|
29
|
+
private processScript;
|
|
17
30
|
/**
|
|
18
31
|
* Pauses tracking
|
|
19
32
|
*/
|
|
@@ -23,39 +36,28 @@ export declare class LongAnimationFrameMeasurer {
|
|
|
23
36
|
*/
|
|
24
37
|
resume(): void;
|
|
25
38
|
/**
|
|
26
|
-
* Returns the current tracked longest
|
|
39
|
+
* Returns the current tracked longest script timings sorted by duration
|
|
27
40
|
*/
|
|
28
|
-
get current():
|
|
41
|
+
get current(): TrackedScriptTiming[];
|
|
29
42
|
/**
|
|
30
43
|
* Cleans up the performance tracking (tracking cannot be resumed following this).
|
|
31
44
|
*/
|
|
32
45
|
cleanup(): void;
|
|
33
46
|
}
|
|
34
|
-
interface
|
|
35
|
-
readonly startTime: DOMHighResTimeStamp;
|
|
47
|
+
export interface _PerformanceScriptTiming extends PerformanceEntry {
|
|
36
48
|
readonly duration: DOMHighResTimeStamp;
|
|
37
|
-
readonly name: string;
|
|
38
49
|
readonly entryType: string;
|
|
39
|
-
readonly invokerType: 'classic-script' | 'module-script' | 'event-listener' | 'user-callback' | 'resolve-promise' | 'reject-promise';
|
|
40
|
-
readonly invoker: string;
|
|
41
50
|
readonly executionStart: DOMHighResTimeStamp;
|
|
42
|
-
readonly sourceURL: string;
|
|
43
|
-
readonly sourceFunctionName: string;
|
|
44
|
-
readonly sourceCharPosition: number;
|
|
45
|
-
readonly pauseDuration: DOMHighResTimeStamp;
|
|
46
51
|
readonly forcedStyleAndLayoutDuration: DOMHighResTimeStamp;
|
|
52
|
+
readonly invoker: string;
|
|
53
|
+
readonly invokerType: 'classic-script' | 'module-script' | 'event-listener' | 'user-callback' | 'resolve-promise' | 'reject-promise';
|
|
54
|
+
readonly name: string;
|
|
55
|
+
readonly pauseDuration: DOMHighResTimeStamp;
|
|
56
|
+
readonly sourceCharPosition: number;
|
|
57
|
+
readonly sourceFunctionName: string;
|
|
58
|
+
readonly sourceURL: string;
|
|
59
|
+
readonly startTime: DOMHighResTimeStamp;
|
|
47
60
|
readonly window?: Window;
|
|
48
61
|
readonly windowAttribution: 'self' | 'descendant' | 'ancestor' | 'same-page' | 'other';
|
|
49
62
|
}
|
|
50
|
-
interface PerformanceLongAnimationFrameTiming extends PerformanceEntry {
|
|
51
|
-
readonly startTime: DOMHighResTimeStamp;
|
|
52
|
-
readonly duration: DOMHighResTimeStamp;
|
|
53
|
-
readonly name: string;
|
|
54
|
-
readonly entryType: string;
|
|
55
|
-
readonly renderStart: DOMHighResTimeStamp;
|
|
56
|
-
readonly styleAndLayoutStart: DOMHighResTimeStamp;
|
|
57
|
-
readonly blockingDuration: DOMHighResTimeStamp;
|
|
58
|
-
readonly firstUIEventTimestamp: DOMHighResTimeStamp;
|
|
59
|
-
readonly scripts: PerformanceScriptTiming[];
|
|
60
|
-
}
|
|
61
63
|
export {};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { AnalyticsWebClient } from '@atlaskit/analytics-listeners';
|
|
2
2
|
export type INSMOptions = {
|
|
3
|
-
getAnalyticsWebClient: Promise<AnalyticsWebClient>;
|
|
4
3
|
/**
|
|
5
4
|
* If an experience is missing or not enabled - no session event will be fired
|
|
6
5
|
*/
|
|
@@ -9,12 +8,9 @@ export type INSMOptions = {
|
|
|
9
8
|
enabled: boolean;
|
|
10
9
|
} | undefined;
|
|
11
10
|
};
|
|
11
|
+
getAnalyticsWebClient: Promise<AnalyticsWebClient>;
|
|
12
12
|
};
|
|
13
13
|
export type ExperienceProperties = {
|
|
14
|
-
/**
|
|
15
|
-
* Whether this represents the initial page the user is visiting
|
|
16
|
-
*/
|
|
17
|
-
initial: boolean;
|
|
18
14
|
/**
|
|
19
15
|
* An optional content id (ie. for a Confluence page - the page id)
|
|
20
16
|
*
|
|
@@ -22,24 +18,44 @@ export type ExperienceProperties = {
|
|
|
22
18
|
* not expected to provide this property.
|
|
23
19
|
*/
|
|
24
20
|
contentId?: string | null;
|
|
21
|
+
/**
|
|
22
|
+
* Whether this represents the initial page the user is visiting
|
|
23
|
+
*/
|
|
24
|
+
initial: boolean;
|
|
25
25
|
};
|
|
26
26
|
export type AddedProperties = {
|
|
27
|
-
[key: string]: string | number | boolean;
|
|
27
|
+
[key: string]: string | number | boolean | undefined;
|
|
28
28
|
} | (() => {
|
|
29
|
-
[key: string]: string | number | boolean;
|
|
29
|
+
[key: string]: string | number | boolean | undefined;
|
|
30
30
|
});
|
|
31
31
|
export type Measure = {
|
|
32
|
-
|
|
32
|
+
average: number;
|
|
33
33
|
denominator: number;
|
|
34
34
|
max: number;
|
|
35
35
|
min: number;
|
|
36
|
-
|
|
36
|
+
numerator: number;
|
|
37
37
|
};
|
|
38
38
|
export interface PeriodMeasurer {
|
|
39
|
+
/**
|
|
40
|
+
* Run any cleanup, and report the last periods interactivity.
|
|
41
|
+
*
|
|
42
|
+
* Important note: A new period can start after the end has been reached
|
|
43
|
+
* in cases where the measurement was ended due to a scenario such as an
|
|
44
|
+
* error boundary being hit (via `insm.stopEarly`).
|
|
45
|
+
*/
|
|
46
|
+
end: () => Measure;
|
|
39
47
|
/**
|
|
40
48
|
* Name of the interactivity measurement (measures in the resulting insm event will be under this key)
|
|
41
49
|
*/
|
|
42
50
|
name: string;
|
|
51
|
+
/**
|
|
52
|
+
* Pauses measurement (ie. when heavy work is triggered)
|
|
53
|
+
*/
|
|
54
|
+
pause: () => void;
|
|
55
|
+
/**
|
|
56
|
+
* Pauses measurement (ie. when heavy work completes)
|
|
57
|
+
*/
|
|
58
|
+
resume: () => void;
|
|
43
59
|
/**
|
|
44
60
|
* Called when an the state changes, and/or a new experience session starts.
|
|
45
61
|
*
|
|
@@ -62,20 +78,4 @@ export interface PeriodMeasurer {
|
|
|
62
78
|
* When started with paused = true. it indicates a heavy task is running at startup time.
|
|
63
79
|
*/
|
|
64
80
|
paused: boolean) => Measure | undefined;
|
|
65
|
-
/**
|
|
66
|
-
* Run any cleanup, and report the last periods interactivity.
|
|
67
|
-
*
|
|
68
|
-
* Important note: A new period can start after the end has been reached
|
|
69
|
-
* in cases where the measurement was ended due to a scenario such as an
|
|
70
|
-
* error boundary being hit (via `insm.stopEarly`).
|
|
71
|
-
*/
|
|
72
|
-
end: () => Measure;
|
|
73
|
-
/**
|
|
74
|
-
* Pauses measurement (ie. when heavy work is triggered)
|
|
75
|
-
*/
|
|
76
|
-
pause: () => void;
|
|
77
|
-
/**
|
|
78
|
-
* Pauses measurement (ie. when heavy work completes)
|
|
79
|
-
*/
|
|
80
|
-
resume: () => void;
|
|
81
81
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/insm",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.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",
|
|
@@ -26,12 +26,17 @@
|
|
|
26
26
|
"atlaskit:src": "src/index.ts",
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@atlaskit/analytics-listeners": "^9.1.0",
|
|
29
|
-
"@atlaskit/
|
|
29
|
+
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
30
|
+
"@atlaskit/tmp-editor-statsig": "^13.23.0",
|
|
30
31
|
"@babel/runtime": "^7.0.0",
|
|
31
32
|
"bowser-ultralight": "^1.0.6"
|
|
32
33
|
},
|
|
33
34
|
"peerDependencies": {
|
|
34
35
|
"react": "^18.2.0"
|
|
35
36
|
},
|
|
36
|
-
"platform-feature-flags": {
|
|
37
|
+
"platform-feature-flags": {
|
|
38
|
+
"cc_editor_insm_fix_attributes": {
|
|
39
|
+
"type": "boolean"
|
|
40
|
+
}
|
|
41
|
+
}
|
|
37
42
|
}
|