@hypen-space/core 0.4.23 → 0.4.25
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/app.js +1 -16
- package/dist/app.js.map +2 -2
- package/dist/components/builtin.js +1 -16
- package/dist/components/builtin.js.map +2 -2
- package/dist/context.js +1 -16
- package/dist/context.js.map +2 -2
- package/dist/discovery.js +1 -16
- package/dist/discovery.js.map +2 -2
- package/dist/disposable.js +1 -16
- package/dist/disposable.js.map +2 -2
- package/dist/engine.browser.js +1 -16
- package/dist/engine.browser.js.map +2 -2
- package/dist/engine.js +1 -16
- package/dist/engine.js.map +2 -2
- package/dist/events.js +1 -16
- package/dist/events.js.map +2 -2
- package/dist/index.browser.js +1 -16
- package/dist/index.browser.js.map +2 -2
- package/dist/index.js +1 -16
- package/dist/index.js.map +2 -2
- package/dist/loader.js +1 -16
- package/dist/loader.js.map +2 -2
- package/dist/logger.js +1 -16
- package/dist/logger.js.map +2 -2
- package/dist/plugin.js +4 -19
- package/dist/plugin.js.map +3 -3
- package/dist/remote/client.js +1 -16
- package/dist/remote/client.js.map +2 -2
- package/dist/remote/index.js +25 -19
- package/dist/remote/index.js.map +4 -4
- package/dist/remote/server.d.ts +8 -0
- package/dist/remote/server.js +25 -19
- package/dist/remote/server.js.map +4 -4
- package/dist/renderer.js +1 -16
- package/dist/renderer.js.map +2 -2
- package/dist/resolver.js +4 -19
- package/dist/resolver.js.map +3 -3
- package/dist/router.js +1 -16
- package/dist/router.js.map +2 -2
- package/dist/state.js +1 -16
- package/dist/state.js.map +2 -2
- package/package.json +1 -1
- package/src/remote/server.ts +35 -0
- package/wasm-browser/hypen_engine_bg.wasm +0 -0
- package/wasm-browser/package.json +1 -1
- package/wasm-node/hypen_engine_bg.wasm +0 -0
- package/wasm-node/package.json +1 -1
package/dist/remote/server.d.ts
CHANGED
|
@@ -140,6 +140,14 @@ export declare class RemoteServer {
|
|
|
140
140
|
* Handle WebSocket close - suspend session instead of destroying
|
|
141
141
|
*/
|
|
142
142
|
private handleClose;
|
|
143
|
+
/**
|
|
144
|
+
* Reload components from the source directory and re-render all connected clients.
|
|
145
|
+
* Call this when source files change to implement hot reload.
|
|
146
|
+
*
|
|
147
|
+
* The engine's reconciler diffs the old tree against the new one, producing
|
|
148
|
+
* minimal patches (Create/Remove/SetProp) that are streamed to clients.
|
|
149
|
+
*/
|
|
150
|
+
reload(): Promise<void>;
|
|
143
151
|
/**
|
|
144
152
|
* Get current client count
|
|
145
153
|
*/
|
package/dist/remote/server.js
CHANGED
|
@@ -1,19 +1,4 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
3
1
|
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __toESM = (mod, isNodeMode, target) => {
|
|
7
|
-
target = mod != null ? __create(__getProtoOf(mod)) : {};
|
|
8
|
-
const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
|
|
9
|
-
for (let key of __getOwnPropNames(mod))
|
|
10
|
-
if (!__hasOwnProp.call(to, key))
|
|
11
|
-
__defProp(to, key, {
|
|
12
|
-
get: () => mod[key],
|
|
13
|
-
enumerable: true
|
|
14
|
-
});
|
|
15
|
-
return to;
|
|
16
|
-
};
|
|
17
2
|
var __export = (target, all) => {
|
|
18
3
|
for (var name in all)
|
|
19
4
|
__defProp(target, name, {
|
|
@@ -891,7 +876,7 @@ __export(exports_path, {
|
|
|
891
876
|
});
|
|
892
877
|
function assertPath(path) {
|
|
893
878
|
if (typeof path !== "string")
|
|
894
|
-
throw
|
|
879
|
+
throw TypeError("Path must be a string. Received " + JSON.stringify(path));
|
|
895
880
|
}
|
|
896
881
|
function normalizeStringPosix(path, allowAboveRoot) {
|
|
897
882
|
var res = "", lastSegmentLength = 0, lastSlash = -1, dots = 0, code;
|
|
@@ -1081,7 +1066,7 @@ function dirname(path) {
|
|
|
1081
1066
|
}
|
|
1082
1067
|
function basename(path, ext) {
|
|
1083
1068
|
if (ext !== undefined && typeof ext !== "string")
|
|
1084
|
-
throw
|
|
1069
|
+
throw TypeError('"ext" argument must be a string');
|
|
1085
1070
|
assertPath(path);
|
|
1086
1071
|
var start = 0, end = -1, matchedSlash = true, i;
|
|
1087
1072
|
if (ext !== undefined && ext.length > 0 && ext.length <= path.length) {
|
|
@@ -1153,7 +1138,7 @@ function extname(path) {
|
|
|
1153
1138
|
}
|
|
1154
1139
|
function format(pathObject) {
|
|
1155
1140
|
if (pathObject === null || typeof pathObject !== "object")
|
|
1156
|
-
throw
|
|
1141
|
+
throw TypeError('The "pathObject" argument must be of type Object. Received type ' + typeof pathObject);
|
|
1157
1142
|
return _format("/", pathObject);
|
|
1158
1143
|
}
|
|
1159
1144
|
function parse(path) {
|
|
@@ -2023,6 +2008,27 @@ class RemoteServer {
|
|
|
2023
2008
|
};
|
|
2024
2009
|
this._onDisconnectionCallbacks.forEach((cb) => cb(client));
|
|
2025
2010
|
}
|
|
2011
|
+
async reload() {
|
|
2012
|
+
if (this._sourceDir) {
|
|
2013
|
+
this._ui = "";
|
|
2014
|
+
await this.discoverFromSource();
|
|
2015
|
+
}
|
|
2016
|
+
if (!this._ui) {
|
|
2017
|
+
log4.warn("Reload skipped: no UI template available");
|
|
2018
|
+
return;
|
|
2019
|
+
}
|
|
2020
|
+
for (const [ws, clientData] of this.clients) {
|
|
2021
|
+
if (!clientData.helloReceived)
|
|
2022
|
+
continue;
|
|
2023
|
+
this.setupComponentResolver(clientData.engine);
|
|
2024
|
+
try {
|
|
2025
|
+
clientData.engine.renderSource(this._ui);
|
|
2026
|
+
log4.info(`Hot-reloaded client ${clientData.id}`);
|
|
2027
|
+
} catch (e) {
|
|
2028
|
+
log4.error(`Failed to hot-reload client ${clientData.id}:`, e);
|
|
2029
|
+
}
|
|
2030
|
+
}
|
|
2031
|
+
}
|
|
2026
2032
|
getClientCount() {
|
|
2027
2033
|
return this.clients.size;
|
|
2028
2034
|
}
|
|
@@ -2070,4 +2076,4 @@ export {
|
|
|
2070
2076
|
RemoteServer
|
|
2071
2077
|
};
|
|
2072
2078
|
|
|
2073
|
-
//# debugId=
|
|
2079
|
+
//# debugId=204F87CAD3EAB92064756E2164756E21
|