@lark-apaas/client-toolkit 1.1.38 → 1.1.39-alpha.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.
|
@@ -6,6 +6,7 @@ import { useUpdatingRef } from "../../hooks/useUpdatingRef.js";
|
|
|
6
6
|
import { submitPostMessage } from "../../utils/postMessage.js";
|
|
7
7
|
import { getPreviewParentOrigin } from "../../utils/getParentOrigin.js";
|
|
8
8
|
import { childApi } from "./utils/childApi.js";
|
|
9
|
+
import { batchLogInfo } from "../../logger/batch-logger.js";
|
|
9
10
|
import "./utils/listenHot.js";
|
|
10
11
|
var IframeBridge_RouteMessageType = /*#__PURE__*/ function(RouteMessageType) {
|
|
11
12
|
RouteMessageType["RouteChange"] = "RouteChange";
|
|
@@ -21,6 +22,11 @@ async function connectParent() {
|
|
|
21
22
|
type: 'PreviewReady',
|
|
22
23
|
data: {}
|
|
23
24
|
});
|
|
25
|
+
batchLogInfo('info', JSON.stringify({
|
|
26
|
+
type: 'PreviewReady',
|
|
27
|
+
timestamp: Date.now(),
|
|
28
|
+
url: window.location.href
|
|
29
|
+
}));
|
|
24
30
|
const connection = connectToParent({
|
|
25
31
|
parentOrigin: getPreviewParentOrigin(),
|
|
26
32
|
methods: {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import sockjs_client from "sockjs-client";
|
|
2
2
|
import { submitPostMessage, submitSlardarEvent } from "../../../utils/postMessage.js";
|
|
3
|
+
import { batchLogInfo } from "../../../logger/batch-logger.js";
|
|
3
4
|
import { getWsPath } from "../../../utils/utils.js";
|
|
4
5
|
let hotInited = false;
|
|
5
6
|
function handleDevServerMessage(msg) {
|
|
@@ -15,15 +16,28 @@ function handleDevServerMessage(msg) {
|
|
|
15
16
|
},
|
|
16
17
|
data: null
|
|
17
18
|
});
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
19
|
+
batchLogInfo('info', JSON.stringify({
|
|
20
|
+
type: 'HmrMessage',
|
|
21
|
+
subType: 'hot',
|
|
22
|
+
timestamp: Date.now(),
|
|
23
|
+
hash: msg.data
|
|
24
|
+
}));
|
|
25
|
+
} else if ('errors' === msg.type) {
|
|
26
|
+
submitPostMessage({
|
|
27
|
+
type: 'HmrMessage',
|
|
28
|
+
msg: {
|
|
29
|
+
type: 'errors',
|
|
30
|
+
data: JSON.stringify(msg.data)
|
|
31
|
+
},
|
|
32
|
+
data: null
|
|
33
|
+
});
|
|
34
|
+
batchLogInfo('info', JSON.stringify({
|
|
35
|
+
type: 'HmrMessage',
|
|
36
|
+
subType: 'errors',
|
|
37
|
+
timestamp: Date.now(),
|
|
38
|
+
errorCount: msg.data?.length
|
|
39
|
+
}));
|
|
40
|
+
} else if ('hmr-timing' === msg.type) {
|
|
27
41
|
const { duration, fileCount, fileTotalSize } = msg.data;
|
|
28
42
|
submitSlardarEvent({
|
|
29
43
|
name: 'runTiming',
|
|
@@ -36,6 +50,14 @@ function handleDevServerMessage(msg) {
|
|
|
36
50
|
fileTotalSize
|
|
37
51
|
}
|
|
38
52
|
});
|
|
53
|
+
batchLogInfo('info', JSON.stringify({
|
|
54
|
+
type: 'HmrMessage',
|
|
55
|
+
subType: 'hmr-timing',
|
|
56
|
+
timestamp: Date.now(),
|
|
57
|
+
duration,
|
|
58
|
+
fileCount,
|
|
59
|
+
fileTotalSize
|
|
60
|
+
}));
|
|
39
61
|
}
|
|
40
62
|
}
|
|
41
63
|
function connectDevServer() {
|