@lark-apaas/client-toolkit 1.0.11 → 1.0.12

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.
@@ -23,6 +23,22 @@ function handleDevServerMessage(msg) {
23
23
  },
24
24
  data: null
25
25
  });
26
+ else if ('hmr-timing' === msg.type) {
27
+ const { duration, fileCount, fileTotalSize } = msg.data;
28
+ const slardar = window['KSlardarWeb'];
29
+ if (slardar && 'function' == typeof slardar) slardar('sendEvent', {
30
+ name: 'runTiming',
31
+ metrics: {
32
+ duration
33
+ },
34
+ categories: {
35
+ type: 'sandbox-hmr-timing',
36
+ fileCount,
37
+ fileTotalSize
38
+ }
39
+ });
40
+ else console.warn('hmr listen function not found');
41
+ }
26
42
  }
27
43
  function connectDevServer() {
28
44
  const sockUrl = getWsPath();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lark-apaas/client-toolkit",
3
- "version": "1.0.11",
3
+ "version": "1.0.12",
4
4
  "types": "./lib/index.d.ts",
5
5
  "main": "./lib/index.js",
6
6
  "files": [