@webjsdev/core 0.7.47 → 0.7.49
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/README.md +3 -2
- package/dist/webjs-core-browser.js +5 -5
- package/dist/webjs-core-browser.js.map +3 -3
- package/dist/webjs-core-testing.js +21 -21
- package/dist/webjs-core-testing.js.map +2 -2
- package/dist/webjs-core.js +7 -7
- package/dist/webjs-core.js.map +3 -3
- package/index-browser.js +13 -5
- package/index.d.ts +2 -2
- package/index.js +2 -2
- package/package.json +1 -1
- package/src/action-seed-client.d.ts +23 -1
- package/src/action-seed-client.js +359 -17
- package/src/component.d.ts +7 -3
- package/src/component.js +94 -2
- package/src/form-action.js +204 -203
- package/src/render-client.js +94 -96
- package/src/render-server.js +100 -118
- package/src/router-client.js +644 -21
- package/src/websocket-client.js +5 -2
package/src/websocket-client.js
CHANGED
|
@@ -81,7 +81,8 @@ export function connectWS(url, opts = {}) {
|
|
|
81
81
|
|
|
82
82
|
return {
|
|
83
83
|
/** Send a message. Objects are JSON-stringified; strings and binary pass through.
|
|
84
|
-
* If the socket isn't open yet, the message is queued until it is.
|
|
84
|
+
* If the socket isn't open yet, the message is queued until it is.
|
|
85
|
+
* @param {string | ArrayBuffer | ArrayBufferView | object} data */
|
|
85
86
|
send(data) {
|
|
86
87
|
const payload =
|
|
87
88
|
typeof data === 'string' || data instanceof ArrayBuffer || ArrayBuffer.isView(data)
|
|
@@ -90,7 +91,9 @@ export function connectWS(url, opts = {}) {
|
|
|
90
91
|
if (ws && ws.readyState === WebSocket.OPEN) ws.send(/** @type any */ (payload));
|
|
91
92
|
else queue.push(payload);
|
|
92
93
|
},
|
|
93
|
-
/** Permanently close the socket. Disables reconnect.
|
|
94
|
+
/** Permanently close the socket. Disables reconnect.
|
|
95
|
+
* @param {number} [code]
|
|
96
|
+
* @param {string} [reason] */
|
|
94
97
|
close(code, reason) {
|
|
95
98
|
stopped = true;
|
|
96
99
|
try { ws?.close(code, reason); } catch {}
|