monitor-track 1.10.2 → 1.12.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 CHANGED
@@ -3,6 +3,32 @@
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.11.0 (2024-10-21)
7
+
8
+
9
+ ### 🐛 Bug Fixes
10
+
11
+ * 修复eslint检查 ([0bddc71](https://github.com/zhoushoujian/monitor/commit/0bddc711d14663340bebad23f1878daff22385c2))
12
+ * import order ([2b81892](https://github.com/zhoushoujian/monitor/commit/2b81892e974a828895e7c003e19b8fe0499c2a6b))
13
+
14
+
15
+ ### ✨ Features
16
+
17
+ * 5.0.0版本 ([27ed114](https://github.com/zhoushoujian/monitor/commit/27ed11412fe393bde0822cd18ab2ac13c222ea1e))
18
+ * 更新一些依赖 ([3593eac](https://github.com/zhoushoujian/monitor/commit/3593eac70450fbb2d4bf9c745dbc10c09d5d9ca7))
19
+ * monitor ([c4da59b](https://github.com/zhoushoujian/monitor/commit/c4da59bfc6e4ffe38670cb0f3c0f9f76cdecf99a))
20
+
21
+
22
+
23
+ ### 1.10.2 (2023-08-25)
24
+
25
+
26
+ ### ✨ Features
27
+
28
+ * monitor ([c4da59b](https://github.com/zhoushoujian/monitor/commit/c4da59bfc6e4ffe38670cb0f3c0f9f76cdecf99a))
29
+
30
+
31
+
6
32
  ### 1.10.1 (2023-08-25)
7
33
 
8
34
 
package/README.md CHANGED
@@ -14,13 +14,23 @@ import Track from 'monitor-track';
14
14
  const track = new Track();
15
15
 
16
16
  track.init({
17
- // 由监控平台后台管理系统创建项目时生成
18
- projectID: '123',
19
- reportUrl: 'http://localhost:3008/report',
17
+ projectID: 'IuggBOP==', // 由监控平台后台管理系统创建项目时生成
18
+ reportUrl: 'https://api-track.zhoushoujian.com/monitor-service/s/r', //上报地址
20
19
  spa: true,
21
- // 不是hash模式的项目一定要改成false,否则不能统计到pv的类型
22
- hash: true,
20
+ hash: true, // 不是hash模式的项目一定要改成false,否则不能统计到pv的类型
21
+ enable: true,
22
+ customPayload,
23
+ ignore: {
24
+ errors: [
25
+ 'ResizeObserver loop limit exceeded',
26
+ 'ResizeObserver loop completed with undelivered notifications.',
27
+ ],
28
+ },
29
+
23
30
  });
31
+
32
+ // 注意:sdk默认取localStorage.getItem('username')作为uuid,所以如果要将用户名作为用户标识,请将username存到localStorage中
33
+ // 如果localStorage.getItem('username')取不到值,则会使用uuid作为用户标识,这时用户标识是匿名的,有可能会出现一个用户统计为两个或多个用户的情况
24
34
  ```
25
35
 
26
36
  ## 配置项
@@ -23,10 +23,6 @@ export declare function getConfigValue(key: keyof IConfig): string | number | bo
23
23
  urls?: string[] | undefined;
24
24
  errors?: (string | {
25
25
  regExp: boolean;
26
- /**
27
- * @description 设置config配置项
28
- * @param config 配置项
29
- */
30
26
  input: string;
31
27
  })[] | undefined;
32
28
  apis?: string[] | undefined;
package/cjs/constant.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const shuyunTrackId = "shuyun-track-id";
2
- export declare const shuyunTrackSessionId = "shuyun-track-session-id";
1
+ export declare const monitorTrackId = "monitor-track-id";
2
+ export declare const monitorTrackSessionId = "monitor-track-session-id";
@@ -22,3 +22,4 @@ export declare function setRouteStack(page: string | string[]): {
22
22
  originPage: string;
23
23
  page: string;
24
24
  };
25
+ export declare function handlePageLag(lagTime: number): void;
package/cjs/index.d.ts CHANGED
@@ -1,7 +1,11 @@
1
+ /// <reference types="node" />
1
2
  import { IConfig } from './types/config';
2
3
  export default class Track {
4
+ lagTimer: NodeJS.Timeout | null;
5
+ observer: PerformanceObserver | null;
3
6
  init(config: IConfig): void;
4
7
  visualTrack: () => void;
8
+ listenPageLag: () => void;
5
9
  /**
6
10
  * @description 监听错误异常
7
11
  */