zova-module-a-ssrhmr 5.1.22 → 5.1.24
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/.metadata/index.d.ts +3 -3
- package/dist/.metadata/this.d.ts +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/.metadata/index.ts +7 -7
- package/src/.metadata/this.ts +1 -1
- package/src/index.ts +2 -2
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/** config: begin */
|
|
2
|
-
export * from '../config/config.
|
|
3
|
-
import { config } from '../config/config.
|
|
2
|
+
export * from '../config/config.ts';
|
|
3
|
+
import { config } from '../config/config.ts';
|
|
4
4
|
/** config: end */
|
|
5
5
|
/** monkeySys: begin */
|
|
6
|
-
export * from '../monkeySys.
|
|
6
|
+
export * from '../monkeySys.ts';
|
|
7
7
|
/** monkeySys: end */
|
|
8
8
|
/** scope: begin */
|
|
9
9
|
import { BeanScopeBase, type BeanScopeUtil, TypeModuleConfig } from 'zova';
|
package/dist/.metadata/this.d.ts
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './.metadata/index.
|
|
2
|
-
export * from './types/index.
|
|
1
|
+
export * from './.metadata/index.ts';
|
|
2
|
+
export * from './types/index.ts';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -50,9 +50,9 @@ var MonkeySys = class extends BeanSimple {
|
|
|
50
50
|
};
|
|
51
51
|
//#endregion
|
|
52
52
|
//#region src/.metadata/index.ts
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
var
|
|
53
|
+
var _dec;
|
|
54
|
+
var _dec2;
|
|
55
|
+
var _class;
|
|
56
56
|
var ScopeModuleASsrhmr = (_dec = Scope(), _dec2 = BeanInfo({ module: "a-ssrhmr" }), _dec(_class = _dec2(_class = class ScopeModuleASsrhmr extends BeanScopeBase {}) || _class) || _class);
|
|
57
57
|
/** scope: end */
|
|
58
58
|
//#endregion
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../src/config/config.ts","../src/monkeySys.ts","../src/.metadata/index.ts"],"sourcesContent":["export const config = _sys => {\n return {\n change: {\n debounce: 100\n }\n };\n};","import { WebSocketClient } from '@cabloy/socket';\nimport debounce from 'debounce';\nimport { BeanSimple } from 'zova';\nexport class MonkeySys extends BeanSimple {\n constructor(...args) {\n super(...args);\n this._ws = void 0;\n this._reload = void 0;\n }\n async sysReady() {\n if (!this.sys.config.ssr.hmr) return;\n const scopeConfig = this.sys.util.getModuleConfigSafe('a-ssrhmr');\n this._reload = debounce(() => {\n this._reloadInner();\n }, scopeConfig.change.debounce);\n this._startWs();\n }\n sysClose() {\n if (!this.sys.config.ssr.hmr) return;\n this._closeWs();\n }\n _closeWs() {\n if (this._ws) {\n this._ws.disconnect();\n this._ws = undefined;\n }\n }\n _startWs() {\n const ws = this._ws = new WebSocketClient({\n reconnectDelayMax: 1000\n });\n ws.onEvent = (eventName, _data) => {\n if (eventName === 'reload') {\n this._reload?.();\n }\n };\n ws.onOpen = (_event, reconnectAttempts) => {\n this.sys.meta.logger.get().log('silly', '[ssr hmr] ready');\n if (reconnectAttempts > 0) {\n this._reloadInner();\n }\n };\n // connect\n const url = `${this.sys.config.ws.baseURL}${this.sys.config.ws.prefix}/ssrhmr`;\n ws.connect(url);\n }\n async _reloadInner() {\n await this.sys.meta.event.emit('a-ssrhmr:reload');\n }\n}","var _dec, _dec2, _class;\nimport { \"BeanInfo\" as __z_BeanInfo } from \"zova\";\n// eslint-disable\n/** config: begin */\nexport * from '../config/config.
|
|
1
|
+
{"version":3,"file":"index.js","names":["__z_BeanInfo"],"sources":["../src/config/config.ts","../src/monkeySys.ts","../src/.metadata/index.ts"],"sourcesContent":["export const config = _sys => {\n return {\n change: {\n debounce: 100\n }\n };\n};","import { WebSocketClient } from '@cabloy/socket';\nimport debounce from 'debounce';\nimport { BeanSimple } from 'zova';\nexport class MonkeySys extends BeanSimple {\n constructor(...args) {\n super(...args);\n this._ws = void 0;\n this._reload = void 0;\n }\n async sysReady() {\n if (!this.sys.config.ssr.hmr) return;\n const scopeConfig = this.sys.util.getModuleConfigSafe('a-ssrhmr');\n this._reload = debounce(() => {\n this._reloadInner();\n }, scopeConfig.change.debounce);\n this._startWs();\n }\n sysClose() {\n if (!this.sys.config.ssr.hmr) return;\n this._closeWs();\n }\n _closeWs() {\n if (this._ws) {\n this._ws.disconnect();\n this._ws = undefined;\n }\n }\n _startWs() {\n const ws = this._ws = new WebSocketClient({\n reconnectDelayMax: 1000\n });\n ws.onEvent = (eventName, _data) => {\n if (eventName === 'reload') {\n this._reload?.();\n }\n };\n ws.onOpen = (_event, reconnectAttempts) => {\n this.sys.meta.logger.get().log('silly', '[ssr hmr] ready');\n if (reconnectAttempts > 0) {\n this._reloadInner();\n }\n };\n // connect\n const url = `${this.sys.config.ws.baseURL}${this.sys.config.ws.prefix}/ssrhmr`;\n ws.connect(url);\n }\n async _reloadInner() {\n await this.sys.meta.event.emit('a-ssrhmr:reload');\n }\n}","var _dec, _dec2, _class;\nimport { \"BeanInfo\" as __z_BeanInfo } from \"zova\";\n// eslint-disable\n/** config: begin */\nexport * from '../config/config.ts';\n/** config: end */\n/** monkeySys: begin */\nexport * from '../monkeySys.ts';\n/** monkeySys: end */\n/** scope: begin */\nimport { BeanScopeBase } from 'zova';\nimport { Scope } from 'zova-module-a-bean';\nexport let ScopeModuleASsrhmr = (_dec = Scope(), _dec2 = __z_BeanInfo({\n module: \"a-ssrhmr\"\n}), _dec(_class = _dec2(_class = class ScopeModuleASsrhmr extends BeanScopeBase {}) || _class) || _class);\nimport 'zova';\n\n/** scope: end */"],"mappings":";;;;;AAAA,IAAa,UAAS,SAAQ;CAC5B,OAAO,EACL,QAAQ,EACN,UAAU,IACZ,EACF;AACF;;;ACHA,IA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ata/index.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// eslint-disable
|
|
2
2
|
/** config: begin */
|
|
3
|
-
export * from '../config/config.
|
|
4
|
-
import { config } from '../config/config.
|
|
3
|
+
export * from '../config/config.ts';
|
|
4
|
+
import { config } from '../config/config.ts';
|
|
5
5
|
/** config: end */
|
|
6
6
|
/** monkeySys: begin */
|
|
7
|
-
export * from '../monkeySys.
|
|
7
|
+
export * from '../monkeySys.ts';
|
|
8
8
|
/** monkeySys: end */
|
|
9
9
|
/** scope: begin */
|
|
10
10
|
import { BeanScopeBase, type BeanScopeUtil, TypeModuleConfig } from 'zova';
|
|
@@ -23,14 +23,14 @@ declare module 'zova' {
|
|
|
23
23
|
export interface IBeanScopeRecord {
|
|
24
24
|
'a-ssrhmr': ScopeModuleASsrhmr;
|
|
25
25
|
}
|
|
26
|
-
|
|
26
|
+
|
|
27
27
|
export interface IBeanScopeConfig {
|
|
28
28
|
'a-ssrhmr': ReturnType<typeof config>;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
|
|
32
31
|
|
|
33
|
-
|
|
32
|
+
|
|
33
|
+
|
|
34
34
|
}
|
|
35
|
-
|
|
35
|
+
|
|
36
36
|
/** scope: end */
|
package/src/.metadata/this.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const __ThisModule__ = 'a-ssrhmr';
|
|
2
|
-
export { ScopeModuleASsrhmr as ScopeModule } from './index.
|
|
2
|
+
export { ScopeModuleASsrhmr as ScopeModule } from './index.ts';
|
package/src/index.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './.metadata/index.
|
|
2
|
-
export * from './types/index.
|
|
1
|
+
export * from './.metadata/index.ts';
|
|
2
|
+
export * from './types/index.ts';
|