monitor-track 1.12.0 → 1.13.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 +37 -0
- package/README.md +3 -1
- package/cjs/index.js +5 -4
- package/cjs/types/config.d.ts +5 -1
- package/esm/config/index.js +1 -0
- package/esm/index.js +4 -4
- package/esm/package.json.js +1 -1
- package/esm/types/config.d.ts +5 -1
- package/index.js +5 -4
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,43 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [1.13.0](https://gitlab.seazonmotor.com/panda/CSD_UserBehaviorTracking/compare/monitor-track@1.12.1...monitor-track@1.13.0) (2026-05-22)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### ✨ Features
|
|
10
|
+
|
|
11
|
+
* 增加对页面卡顿的启用配置 ([28cd08c](https://gitlab.seazonmotor.com/panda/CSD_UserBehaviorTracking/commit/28cd08c975b003f791e02283cbee59167b054afa))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### [1.12.1](https://gitlab.seazonmotor.com/panda/CSD_UserBehaviorTracking/compare/monitor-track@1.12.0...monitor-track@1.12.1) (2026-05-22)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### 🐛 Bug Fixes
|
|
19
|
+
|
|
20
|
+
* 修复类型报错 ([460be3e](https://gitlab.seazonmotor.com/panda/CSD_UserBehaviorTracking/commit/460be3e82a782964e056693862ded6a25c8220a5))
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
## 1.12.0 (2026-05-06)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
### 🐛 Bug Fixes
|
|
28
|
+
|
|
29
|
+
* 修复数据查询错误 ([fd60648](https://gitlab.seazonmotor.com/panda/CSD_UserBehaviorTracking/commit/fd60648607a122a6147d2e37171b98c52185eeb1))
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
### ✨ Features
|
|
33
|
+
|
|
34
|
+
* lag相关 ([c2e4054](https://gitlab.seazonmotor.com/panda/CSD_UserBehaviorTracking/commit/c2e405499a500e046d3b8b1ff770d66df6d5c8a5))
|
|
35
|
+
* 升级eslint9 ([279c252](https://gitlab.seazonmotor.com/panda/CSD_UserBehaviorTracking/commit/279c2526626aec9ae79d41e595041f69fce5ae44))
|
|
36
|
+
* 新增lag和api页面的详情页 ([c8c7163](https://gitlab.seazonmotor.com/panda/CSD_UserBehaviorTracking/commit/c8c7163eb2a45edc9762f4e03f6a3fff2f9c932f))
|
|
37
|
+
* 新增检测web页面卡顿 ([fad84b1](https://gitlab.seazonmotor.com/panda/CSD_UserBehaviorTracking/commit/fad84b1813beaba778e30330dff133e86d432c1b))
|
|
38
|
+
* 更新lock文件 ([348911b](https://gitlab.seazonmotor.com/panda/CSD_UserBehaviorTracking/commit/348911bef37a478ed0c60470bdb4cd9159a8ce7e))
|
|
39
|
+
* 预留上报请求参数和请求方法字段 ([0123172](https://gitlab.seazonmotor.com/panda/CSD_UserBehaviorTracking/commit/0123172677749328a51f3a9a0db6630b4d9a531d))
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
6
43
|
## 1.11.0 (2024-10-21)
|
|
7
44
|
|
|
8
45
|
|
package/README.md
CHANGED
|
@@ -44,7 +44,9 @@ track.init({
|
|
|
44
44
|
| enableBehavior | boolean | 否 | true | 启用用户行为上报 |
|
|
45
45
|
| enableError | boolean | 否 | true | 启用异常信息上报 |
|
|
46
46
|
| enableVisualTrack | boolean | 否 | false | 启用可视化埋点上报 |
|
|
47
|
-
|
|
|
47
|
+
| enableLagTrack | boolean | 否 | false | 启用页面卡顿信息上报 |
|
|
48
|
+
| lagTimeout | number | 否 | 400 | 页面卡顿上报的阈值时间(毫秒) |
|
|
49
|
+
| ignore | 见下方 ignore | 否 | false | 忽略上报的信息 |
|
|
48
50
|
| customPayload | string | 否 | false | 自定义 payload |
|
|
49
51
|
| enable | boolean | 否 | false | 是否开启日志收集,默认关闭 |
|
|
50
52
|
| maxLength | number | 否 | 1000 | 最长上报数据长度 |
|
package/cjs/index.js
CHANGED
|
@@ -45,6 +45,7 @@ const Config = {
|
|
|
45
45
|
enableBehavior: true,
|
|
46
46
|
enableError: true,
|
|
47
47
|
enableVisualTrack: false,
|
|
48
|
+
enableLagTrack: false,
|
|
48
49
|
ignore: {
|
|
49
50
|
urls: [],
|
|
50
51
|
errors: [],
|
|
@@ -59,7 +60,7 @@ function setConfig(config) {
|
|
|
59
60
|
Object.assign(Config, config);
|
|
60
61
|
}
|
|
61
62
|
|
|
62
|
-
var version = "1.
|
|
63
|
+
var version = "1.13.0";
|
|
63
64
|
|
|
64
65
|
const eventsMatrix = [[]];
|
|
65
66
|
rrweb__namespace.record({
|
|
@@ -1397,7 +1398,7 @@ class Track {
|
|
|
1397
1398
|
this.listenPageLag = () => {
|
|
1398
1399
|
this.observer = new PerformanceObserver((list) => {
|
|
1399
1400
|
list.getEntries().forEach((entry) => {
|
|
1400
|
-
if (entry.duration > 400) {
|
|
1401
|
+
if (entry.duration > (Config.lagTimeout || 400)) {
|
|
1401
1402
|
handlePageLag(entry.duration);
|
|
1402
1403
|
}
|
|
1403
1404
|
});
|
|
@@ -1433,8 +1434,8 @@ class Track {
|
|
|
1433
1434
|
Config.spa && this.addListenRouterChange();
|
|
1434
1435
|
Config.enableBehavior && this.addListenUserActivity();
|
|
1435
1436
|
Config.enableError && this.addListenJSUncaught();
|
|
1436
|
-
this.visualTrack();
|
|
1437
|
-
this.listenPageLag();
|
|
1437
|
+
Config.enableVisualTrack && this.visualTrack();
|
|
1438
|
+
Config.enableLagTrack && this.listenPageLag();
|
|
1438
1439
|
this.addListenUnload();
|
|
1439
1440
|
initWindowObjectFunction();
|
|
1440
1441
|
}
|
package/cjs/types/config.d.ts
CHANGED
|
@@ -31,10 +31,14 @@ export interface IConfig {
|
|
|
31
31
|
};
|
|
32
32
|
/** 自定义payload */
|
|
33
33
|
customPayload?: string;
|
|
34
|
-
/** 上报 xhr
|
|
34
|
+
/** 上报 xhr 请求超过指定时间 */
|
|
35
35
|
XMLHttpRequestTimeout?: number;
|
|
36
36
|
/** 启用可视化埋点 */
|
|
37
37
|
enableVisualTrack?: boolean;
|
|
38
|
+
/** 启用页面卡顿上报 */
|
|
39
|
+
enableLagTrack?: boolean;
|
|
40
|
+
/** 上报 页面卡顿的超时时间 */
|
|
41
|
+
lagTimeout?: number;
|
|
38
42
|
}
|
|
39
43
|
type IParams = {
|
|
40
44
|
name: string;
|
package/esm/config/index.js
CHANGED
package/esm/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Config, setConfig } from './config/index.js';
|
|
2
2
|
import { initReport, recordXMLHttpRequestLog, hackFetch } from './config/global.js';
|
|
3
3
|
import { monitorTrackSessionId } from './constant.js';
|
|
4
4
|
import { handlePageLag, _history, handleHistoryChange } from './handlers/pv.js';
|
|
@@ -18,7 +18,7 @@ class Track {
|
|
|
18
18
|
this.listenPageLag = () => {
|
|
19
19
|
this.observer = new PerformanceObserver((list) => {
|
|
20
20
|
list.getEntries().forEach((entry) => {
|
|
21
|
-
if (entry.duration > 400) {
|
|
21
|
+
if (entry.duration > (Config.lagTimeout || 400)) {
|
|
22
22
|
handlePageLag(entry.duration);
|
|
23
23
|
}
|
|
24
24
|
});
|
|
@@ -54,8 +54,8 @@ class Track {
|
|
|
54
54
|
Config.spa && this.addListenRouterChange();
|
|
55
55
|
Config.enableBehavior && this.addListenUserActivity();
|
|
56
56
|
Config.enableError && this.addListenJSUncaught();
|
|
57
|
-
this.visualTrack();
|
|
58
|
-
this.listenPageLag();
|
|
57
|
+
Config.enableVisualTrack && this.visualTrack();
|
|
58
|
+
Config.enableLagTrack && this.listenPageLag();
|
|
59
59
|
this.addListenUnload();
|
|
60
60
|
initWindowObjectFunction();
|
|
61
61
|
}
|
package/esm/package.json.js
CHANGED
package/esm/types/config.d.ts
CHANGED
|
@@ -31,10 +31,14 @@ export interface IConfig {
|
|
|
31
31
|
};
|
|
32
32
|
/** 自定义payload */
|
|
33
33
|
customPayload?: string;
|
|
34
|
-
/** 上报 xhr
|
|
34
|
+
/** 上报 xhr 请求超过指定时间 */
|
|
35
35
|
XMLHttpRequestTimeout?: number;
|
|
36
36
|
/** 启用可视化埋点 */
|
|
37
37
|
enableVisualTrack?: boolean;
|
|
38
|
+
/** 启用页面卡顿上报 */
|
|
39
|
+
enableLagTrack?: boolean;
|
|
40
|
+
/** 上报 页面卡顿的超时时间 */
|
|
41
|
+
lagTimeout?: number;
|
|
38
42
|
}
|
|
39
43
|
type IParams = {
|
|
40
44
|
name: string;
|
package/index.js
CHANGED
|
@@ -39,6 +39,7 @@ var MonitorTrack = (function (uuid, ErrorStackParser, html2canvas, rrweb, axios,
|
|
|
39
39
|
enableBehavior: true,
|
|
40
40
|
enableError: true,
|
|
41
41
|
enableVisualTrack: false,
|
|
42
|
+
enableLagTrack: false,
|
|
42
43
|
ignore: {
|
|
43
44
|
urls: [],
|
|
44
45
|
errors: [],
|
|
@@ -122,7 +123,7 @@ var MonitorTrack = (function (uuid, ErrorStackParser, html2canvas, rrweb, axios,
|
|
|
122
123
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
123
124
|
};
|
|
124
125
|
|
|
125
|
-
var version = "1.
|
|
126
|
+
var version = "1.13.0";
|
|
126
127
|
|
|
127
128
|
var eventsMatrix = [[]];
|
|
128
129
|
rrweb__namespace.record({
|
|
@@ -1449,7 +1450,7 @@ var MonitorTrack = (function (uuid, ErrorStackParser, html2canvas, rrweb, axios,
|
|
|
1449
1450
|
this.listenPageLag = function () {
|
|
1450
1451
|
_this.observer = new PerformanceObserver(function (list) {
|
|
1451
1452
|
list.getEntries().forEach(function (entry) {
|
|
1452
|
-
if (entry.duration > 400) {
|
|
1453
|
+
if (entry.duration > (Config.lagTimeout || 400)) {
|
|
1453
1454
|
handlePageLag(entry.duration);
|
|
1454
1455
|
}
|
|
1455
1456
|
});
|
|
@@ -1485,8 +1486,8 @@ var MonitorTrack = (function (uuid, ErrorStackParser, html2canvas, rrweb, axios,
|
|
|
1485
1486
|
Config.spa && this.addListenRouterChange();
|
|
1486
1487
|
Config.enableBehavior && this.addListenUserActivity();
|
|
1487
1488
|
Config.enableError && this.addListenJSUncaught();
|
|
1488
|
-
this.visualTrack();
|
|
1489
|
-
this.listenPageLag();
|
|
1489
|
+
Config.enableVisualTrack && this.visualTrack();
|
|
1490
|
+
Config.enableLagTrack && this.listenPageLag();
|
|
1490
1491
|
this.addListenUnload();
|
|
1491
1492
|
initWindowObjectFunction();
|
|
1492
1493
|
};
|