@camera.ui/transport 0.0.8 → 0.0.9
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/index.js +7 -4
- package/package.json +8 -8
package/dist/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { i as isTokenOnlyChange, n as isEndpointChange, r as isSameTarget, t as TransportEmitter } from "./contract-d-0gfY8v.js";
|
|
2
|
+
import { Logger } from "@camera.ui/logger";
|
|
2
3
|
//#region src/core/reducer.ts
|
|
3
4
|
var EMPTY_TRANSPORTS = /* @__PURE__ */ new Map();
|
|
4
5
|
var DEFAULT_BACKOFF_MS = 5e3;
|
|
@@ -186,6 +187,7 @@ function tokensEqual(a, b) {
|
|
|
186
187
|
}
|
|
187
188
|
//#endregion
|
|
188
189
|
//#region src/core/kernel.ts
|
|
190
|
+
var log$1 = new Logger("kernel");
|
|
189
191
|
function createKernel(options) {
|
|
190
192
|
let current = options.initial ?? { kind: "idle" };
|
|
191
193
|
const listeners = /* @__PURE__ */ new Set();
|
|
@@ -209,7 +211,7 @@ function createKernel(options) {
|
|
|
209
211
|
for (const listener of [...listeners]) try {
|
|
210
212
|
listener(after, prev, next);
|
|
211
213
|
} catch (err) {
|
|
212
|
-
|
|
214
|
+
log$1.warn("listener threw on", next.type, err);
|
|
213
215
|
}
|
|
214
216
|
}
|
|
215
217
|
next = queue.shift();
|
|
@@ -1053,6 +1055,7 @@ function attachTransportWatchdog(options) {
|
|
|
1053
1055
|
}
|
|
1054
1056
|
//#endregion
|
|
1055
1057
|
//#region src/effects/workerBridge.ts
|
|
1058
|
+
var log = new Logger("workerBridge");
|
|
1056
1059
|
function attachWorkerBridge(options) {
|
|
1057
1060
|
let generation = 0;
|
|
1058
1061
|
let detached = false;
|
|
@@ -1074,7 +1077,7 @@ function attachWorkerBridge(options) {
|
|
|
1074
1077
|
count++;
|
|
1075
1078
|
maybeAttachHostListener(host);
|
|
1076
1079
|
} catch (err) {
|
|
1077
|
-
|
|
1080
|
+
log.warn("broadcast postMessage failed", {
|
|
1078
1081
|
gen: msg.generation,
|
|
1079
1082
|
phase: phase.kind,
|
|
1080
1083
|
err
|
|
@@ -1090,7 +1093,7 @@ function attachWorkerBridge(options) {
|
|
|
1090
1093
|
maybeAttachHostListener(host);
|
|
1091
1094
|
options.onSyncHost?.(generation);
|
|
1092
1095
|
} catch (err) {
|
|
1093
|
-
|
|
1096
|
+
log.warn("syncOne postMessage failed", {
|
|
1094
1097
|
gen: msg.generation,
|
|
1095
1098
|
err
|
|
1096
1099
|
});
|
|
@@ -1131,7 +1134,7 @@ function attachWorkerBridge(options) {
|
|
|
1131
1134
|
host.postMessage({ type: "kernel-revalidate" });
|
|
1132
1135
|
maybeAttachHostListener(host);
|
|
1133
1136
|
} catch (err) {
|
|
1134
|
-
|
|
1137
|
+
log.warn("revalidate postMessage failed", err);
|
|
1135
1138
|
}
|
|
1136
1139
|
}
|
|
1137
1140
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camera.ui/transport",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.9",
|
|
4
4
|
"description": "camera.ui transport layer — framework-agnostic connection kernel, reducer state, pluggable transports (HTTP/WS/Socket.IO/NATS), lifecycle effects and worker bridge",
|
|
5
5
|
"author": "seydx (https://github.com/cameraui/clients)",
|
|
6
6
|
"type": "module",
|
|
@@ -46,16 +46,16 @@
|
|
|
46
46
|
"scripts": {
|
|
47
47
|
"build": "rimraf dist && vite build",
|
|
48
48
|
"format": "prettier --write 'src/' --ignore-unknown --no-error-on-unmatched-pattern",
|
|
49
|
-
"lint": "eslint .",
|
|
50
|
-
"lint:fix": "eslint --fix .",
|
|
49
|
+
"lint": "eslint --fix .",
|
|
51
50
|
"install-updates": "npm i --save",
|
|
52
|
-
"prepublishOnly": "npm i --package-lock-only && npm run lint
|
|
51
|
+
"prepublishOnly": "npm i --package-lock-only && npm run lint && npm run format && npm run build",
|
|
53
52
|
"test": "vitest run",
|
|
54
53
|
"test:watch": "vitest",
|
|
55
54
|
"type-check": "tsc --noEmit",
|
|
56
55
|
"update": "updates --update ./"
|
|
57
56
|
},
|
|
58
57
|
"dependencies": {
|
|
58
|
+
"@camera.ui/logger": ">=0.0.1",
|
|
59
59
|
"@camera.ui/rpc": ">=1.0.4",
|
|
60
60
|
"axios": ">=1.18.1",
|
|
61
61
|
"socket.io-client": ">=4.8.3"
|
|
@@ -63,17 +63,17 @@
|
|
|
63
63
|
"devDependencies": {
|
|
64
64
|
"@eslint/js": "9.39.4",
|
|
65
65
|
"@stylistic/eslint-plugin": "^5.10.0",
|
|
66
|
-
"@typescript-eslint/parser": "^8.62.
|
|
66
|
+
"@typescript-eslint/parser": "^8.62.1",
|
|
67
67
|
"@vue/language-core": "^3.3.5",
|
|
68
68
|
"eslint": "9.39.2",
|
|
69
69
|
"globals": "^17.7.0",
|
|
70
70
|
"jiti": "^2.7.0",
|
|
71
|
-
"prettier": "^3.
|
|
71
|
+
"prettier": "^3.9.3",
|
|
72
72
|
"rimraf": "^6.1.3",
|
|
73
73
|
"typescript": "5.9.3",
|
|
74
|
-
"typescript-eslint": "^8.62.
|
|
74
|
+
"typescript-eslint": "^8.62.1",
|
|
75
75
|
"unplugin-dts": "^1.0.3",
|
|
76
|
-
"updates": "^17.18.
|
|
76
|
+
"updates": "^17.18.1",
|
|
77
77
|
"vite": "^8.1.0",
|
|
78
78
|
"vitest": "^4.1.9"
|
|
79
79
|
},
|