@arms/rum-uniapp 0.1.1 → 0.1.3
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/dist/uniapp-sdk.js +1 -1
- package/es/collector/action/index.js +61 -3
- package/es/collector/exception/index.d.ts +1 -0
- package/es/collector/exception/index.js +3 -2
- package/es/collector/resource/api.js +1 -1
- package/es/collector/view/perf.js +74 -1
- package/es/collector/view/pv.d.ts +2 -12
- package/es/collector/view/pv.js +1 -1
- package/es/reporter/index.js +2 -2
- package/es/shell.js +5 -5
- package/es/types/client.d.ts +5 -2
- package/es/utils/mixin.d.ts +5 -1
- package/es/utils/mixin.js +2 -1
- package/es/utils/platform.d.ts +3 -0
- package/es/utils/platform.js +2 -2
- package/es/utils/session.js +2 -1
- package/es/utils/view.d.ts +12 -11
- package/es/utils/view.js +6 -24
- package/lib/collector/action/index.js +62 -2
- package/lib/collector/exception/index.d.ts +1 -0
- package/lib/collector/exception/index.js +3 -2
- package/lib/collector/resource/api.js +1 -1
- package/lib/collector/view/perf.js +75 -1
- package/lib/collector/view/pv.d.ts +2 -12
- package/lib/collector/view/pv.js +1 -1
- package/lib/index.js +1 -1
- package/lib/reporter/index.js +1 -1
- package/lib/shell.js +5 -5
- package/lib/types/client.d.ts +5 -2
- package/lib/utils/mixin.d.ts +5 -1
- package/lib/utils/mixin.js +2 -1
- package/lib/utils/platform.d.ts +3 -0
- package/lib/utils/platform.js +2 -2
- package/lib/utils/session.js +2 -1
- package/lib/utils/view.d.ts +12 -11
- package/lib/utils/view.js +6 -24
- package/package.json +2 -2
- package/es/collector/action/index.d.ts +0 -14
- package/es/collector/view/perf.d.ts +0 -10
- package/lib/collector/action/index.d.ts +0 -14
- package/lib/collector/view/perf.d.ts +0 -10
package/lib/utils/view.d.ts
CHANGED
|
@@ -1,28 +1,29 @@
|
|
|
1
|
-
import { IContext,
|
|
1
|
+
import { IContext, IViewData } from '@arms/rum-core';
|
|
2
2
|
export interface Page {
|
|
3
3
|
route: string;
|
|
4
4
|
is: string;
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
__rum_view?: IViewData;
|
|
6
|
+
$page: {
|
|
7
|
+
id?: number;
|
|
8
|
+
fullPath?: string;
|
|
9
|
+
route?: string;
|
|
10
|
+
openType?: string;
|
|
11
|
+
};
|
|
7
12
|
}
|
|
8
|
-
export declare const PAGE_ID = "__rum_view_id";
|
|
9
13
|
/**
|
|
10
|
-
*
|
|
11
|
-
* @param page
|
|
12
|
-
* @param session
|
|
14
|
+
* 获取当前 page
|
|
13
15
|
* @returns
|
|
14
16
|
*/
|
|
15
|
-
export declare function
|
|
17
|
+
export declare function getCurrentPage(): any;
|
|
16
18
|
/**
|
|
17
19
|
* 获取当前 view
|
|
18
|
-
* @param viewId
|
|
19
20
|
* @param ctx
|
|
20
21
|
* @returns
|
|
21
22
|
*/
|
|
22
|
-
export declare function
|
|
23
|
+
export declare function getCurView(ctx: IContext): IViewData;
|
|
23
24
|
/**
|
|
24
25
|
* 获取当前 view
|
|
25
26
|
* @param ctx
|
|
26
27
|
* @returns
|
|
27
28
|
*/
|
|
28
|
-
export declare function
|
|
29
|
+
export declare function getCurViews(): IViewData[];
|
package/lib/utils/view.js
CHANGED
|
@@ -1,31 +1,13 @@
|
|
|
1
|
-
"use strict";exports.__esModule=!0,exports.
|
|
2
|
-
|
|
3
|
-
// * 获取当前 page
|
|
4
|
-
// * @returns
|
|
5
|
-
// */
|
|
6
|
-
// export function getCurPage() {
|
|
7
|
-
// // TODO: 改成从config里获取
|
|
8
|
-
// if (typeof getCurrentPages === 'function') {
|
|
9
|
-
// try {
|
|
10
|
-
// const pages = getCurrentPages() || [];
|
|
11
|
-
// return pages[pages.length - 1];
|
|
12
|
-
// } catch (error) {
|
|
13
|
-
// console.warn('[arms] error in getCurView', error);
|
|
14
|
-
// }
|
|
15
|
-
// }
|
|
16
|
-
// }
|
|
17
|
-
/**
|
|
18
|
-
* 获取 RUM 内置的view_id标识
|
|
19
|
-
* @param page
|
|
20
|
-
* @param session
|
|
1
|
+
"use strict";exports.__esModule=!0,exports.getCurView=getCurView,exports.getCurViews=getCurViews,exports.getCurrentPage=getCurrentPage;var _rumCore=require("@arms/rum-core"),PAGE_KEY="__rum_view";/**
|
|
2
|
+
* 获取当前 page
|
|
21
3
|
* @returns
|
|
22
|
-
*/function
|
|
4
|
+
*/function getCurrentPage(){if("function"==typeof getCurrentPages)try{var a=getCurrentPages()||[];return a[a.length-1]}catch(a){// console.warn('[arms] error in getCurView', error);
|
|
5
|
+
}}/**
|
|
23
6
|
* 获取当前 view
|
|
24
|
-
* @param viewId
|
|
25
7
|
* @param ctx
|
|
26
8
|
* @returns
|
|
27
|
-
*/function
|
|
9
|
+
*/function getCurView(a){if(a){var b=getCurrentPage();if(b){if(PAGE_KEY in b)return b[PAGE_KEY];var c=b.$page||{},d=c.fullPath,e=c.route,f=c.openType,g=a.session.getViewId(),h=d||e||b.route,i=e||b.route,j=a.getConfig(),k=j.parseViewName;return(0,_rumCore.isFunction)(k)&&(i=k(h)),b[PAGE_KEY]={id:g,name:i,url:h,loading_type:f,_noReport:!0}}}}/**
|
|
28
10
|
* 获取当前 view
|
|
29
11
|
* @param ctx
|
|
30
12
|
* @returns
|
|
31
|
-
*/function
|
|
13
|
+
*/function getCurViews(){var a=[];if("function"==typeof getCurrentPages)try{(getCurrentPages()||[]).forEach(function(b){PAGE_KEY in b&&a.push(b[PAGE_KEY])})}catch(a){}return a}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arms/rum-uniapp",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "arms rum javascript sdk for uniapp native",
|
|
5
5
|
"author": "guangli.fj <guangli.fj@alibaba-inc.com>",
|
|
6
6
|
"license": "ISC",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"prepublishOnly": "npm run build"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@arms/rum-core": "0.1.
|
|
28
|
+
"@arms/rum-core": "0.1.5"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"typescript": "^4.9.4"
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { ICollector, IContext, RumActionEvent, RumEvent } from '@arms/rum-core';
|
|
2
|
-
export default class ActionCollector implements ICollector {
|
|
3
|
-
name: string;
|
|
4
|
-
private DELAY_TIME;
|
|
5
|
-
ctx: IContext;
|
|
6
|
-
sendEvent: (payload: RumEvent) => void;
|
|
7
|
-
events: string[];
|
|
8
|
-
lastEvent: RumActionEvent;
|
|
9
|
-
timer: any;
|
|
10
|
-
setup(ctx: IContext, sendEvent: (payload: RumEvent) => void): void;
|
|
11
|
-
onEvent: (e: any) => void;
|
|
12
|
-
sendAction: () => void;
|
|
13
|
-
destroy(): void;
|
|
14
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ICollector, IContext, RumEvent } from '@arms/rum-core';
|
|
2
|
-
export default class PerfCollector implements ICollector {
|
|
3
|
-
name: string;
|
|
4
|
-
ctx: IContext;
|
|
5
|
-
sendEvent: (payload: RumEvent) => void;
|
|
6
|
-
perfObserver: any;
|
|
7
|
-
setup(ctx: IContext, sendEvent: (payload: RumEvent) => void): void;
|
|
8
|
-
observerHandler: (ev: any) => void;
|
|
9
|
-
destroy(): void;
|
|
10
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { ICollector, IContext, RumActionEvent, RumEvent } from '@arms/rum-core';
|
|
2
|
-
export default class ActionCollector implements ICollector {
|
|
3
|
-
name: string;
|
|
4
|
-
private DELAY_TIME;
|
|
5
|
-
ctx: IContext;
|
|
6
|
-
sendEvent: (payload: RumEvent) => void;
|
|
7
|
-
events: string[];
|
|
8
|
-
lastEvent: RumActionEvent;
|
|
9
|
-
timer: any;
|
|
10
|
-
setup(ctx: IContext, sendEvent: (payload: RumEvent) => void): void;
|
|
11
|
-
onEvent: (e: any) => void;
|
|
12
|
-
sendAction: () => void;
|
|
13
|
-
destroy(): void;
|
|
14
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { ICollector, IContext, RumEvent } from '@arms/rum-core';
|
|
2
|
-
export default class PerfCollector implements ICollector {
|
|
3
|
-
name: string;
|
|
4
|
-
ctx: IContext;
|
|
5
|
-
sendEvent: (payload: RumEvent) => void;
|
|
6
|
-
perfObserver: any;
|
|
7
|
-
setup(ctx: IContext, sendEvent: (payload: RumEvent) => void): void;
|
|
8
|
-
observerHandler: (ev: any) => void;
|
|
9
|
-
destroy(): void;
|
|
10
|
-
}
|