opticore-webapp 1.0.88 → 1.0.89
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.cjs +11 -0
- package/dist/index.d.cts +11 -2
- package/dist/index.d.ts +11 -2
- package/dist/index.js +11 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -630,10 +630,18 @@ var WebServerCore = class {
|
|
|
630
630
|
}
|
|
631
631
|
}
|
|
632
632
|
/**
|
|
633
|
+
* No-ops when `serverWeb` is undefined: under the HMR supervisor
|
|
634
|
+
* (see `resolveHotReloadConfig()`/`startHmrSupervisor()`), `onStartServer()`
|
|
635
|
+
* returns early with no server in the parent process — the child process
|
|
636
|
+
* it spawns is the one that actually listens — so callers following the
|
|
637
|
+
* documented `onStartServer()` → `onListeningOnServerEvent(server!)` /
|
|
638
|
+
* `onRequestOnServerEvent(server!)` pattern would otherwise crash in the
|
|
639
|
+
* parent with "Cannot read properties of undefined (reading 'on')".
|
|
633
640
|
*
|
|
634
641
|
* @param serverWeb
|
|
635
642
|
*/
|
|
636
643
|
onListeningOnServerEvent(serverWeb) {
|
|
644
|
+
if (!serverWeb) return;
|
|
637
645
|
this.loadTranslationFiles();
|
|
638
646
|
serverWeb.on(import_opticore_catch_exception_error3.CEventNameError.error, (err) => {
|
|
639
647
|
this.serverListenEvent.onEventError(err);
|
|
@@ -646,10 +654,13 @@ var WebServerCore = class {
|
|
|
646
654
|
});
|
|
647
655
|
}
|
|
648
656
|
/**
|
|
657
|
+
* No-ops when `serverWeb` is undefined — same HMR-supervisor-parent
|
|
658
|
+
* case documented on `onListeningOnServerEvent()`.
|
|
649
659
|
*
|
|
650
660
|
* @param serverWeb
|
|
651
661
|
*/
|
|
652
662
|
onRequestOnServerEvent(serverWeb) {
|
|
663
|
+
if (!serverWeb) return;
|
|
653
664
|
this.loadTranslationFiles();
|
|
654
665
|
serverWeb.on(import_opticore_catch_exception_error3.CEventNameError.request, (req, res) => {
|
|
655
666
|
(0, import_opticore_request_call_event.requestCallsEvent)(
|
package/dist/index.d.cts
CHANGED
|
@@ -55,15 +55,24 @@ declare class WebServerCore {
|
|
|
55
55
|
*/
|
|
56
56
|
onStartServer(routers: TFeatureRoutes[], databaseCallback: (env: any) => void, dependenciesProvider?: TDependency[]): Server<typeof http.IncomingMessage, typeof http.ServerResponse> | undefined;
|
|
57
57
|
/**
|
|
58
|
+
* No-ops when `serverWeb` is undefined: under the HMR supervisor
|
|
59
|
+
* (see `resolveHotReloadConfig()`/`startHmrSupervisor()`), `onStartServer()`
|
|
60
|
+
* returns early with no server in the parent process — the child process
|
|
61
|
+
* it spawns is the one that actually listens — so callers following the
|
|
62
|
+
* documented `onStartServer()` → `onListeningOnServerEvent(server!)` /
|
|
63
|
+
* `onRequestOnServerEvent(server!)` pattern would otherwise crash in the
|
|
64
|
+
* parent with "Cannot read properties of undefined (reading 'on')".
|
|
58
65
|
*
|
|
59
66
|
* @param serverWeb
|
|
60
67
|
*/
|
|
61
|
-
onListeningOnServerEvent(serverWeb: Server): void;
|
|
68
|
+
onListeningOnServerEvent(serverWeb: Server | undefined): void;
|
|
62
69
|
/**
|
|
70
|
+
* No-ops when `serverWeb` is undefined — same HMR-supervisor-parent
|
|
71
|
+
* case documented on `onListeningOnServerEvent()`.
|
|
63
72
|
*
|
|
64
73
|
* @param serverWeb
|
|
65
74
|
*/
|
|
66
|
-
onRequestOnServerEvent(serverWeb: Server): void;
|
|
75
|
+
onRequestOnServerEvent(serverWeb: Server | undefined): void;
|
|
67
76
|
/**
|
|
68
77
|
*
|
|
69
78
|
* @private
|
package/dist/index.d.ts
CHANGED
|
@@ -55,15 +55,24 @@ declare class WebServerCore {
|
|
|
55
55
|
*/
|
|
56
56
|
onStartServer(routers: TFeatureRoutes[], databaseCallback: (env: any) => void, dependenciesProvider?: TDependency[]): Server<typeof http.IncomingMessage, typeof http.ServerResponse> | undefined;
|
|
57
57
|
/**
|
|
58
|
+
* No-ops when `serverWeb` is undefined: under the HMR supervisor
|
|
59
|
+
* (see `resolveHotReloadConfig()`/`startHmrSupervisor()`), `onStartServer()`
|
|
60
|
+
* returns early with no server in the parent process — the child process
|
|
61
|
+
* it spawns is the one that actually listens — so callers following the
|
|
62
|
+
* documented `onStartServer()` → `onListeningOnServerEvent(server!)` /
|
|
63
|
+
* `onRequestOnServerEvent(server!)` pattern would otherwise crash in the
|
|
64
|
+
* parent with "Cannot read properties of undefined (reading 'on')".
|
|
58
65
|
*
|
|
59
66
|
* @param serverWeb
|
|
60
67
|
*/
|
|
61
|
-
onListeningOnServerEvent(serverWeb: Server): void;
|
|
68
|
+
onListeningOnServerEvent(serverWeb: Server | undefined): void;
|
|
62
69
|
/**
|
|
70
|
+
* No-ops when `serverWeb` is undefined — same HMR-supervisor-parent
|
|
71
|
+
* case documented on `onListeningOnServerEvent()`.
|
|
63
72
|
*
|
|
64
73
|
* @param serverWeb
|
|
65
74
|
*/
|
|
66
|
-
onRequestOnServerEvent(serverWeb: Server): void;
|
|
75
|
+
onRequestOnServerEvent(serverWeb: Server | undefined): void;
|
|
67
76
|
/**
|
|
68
77
|
*
|
|
69
78
|
* @private
|
package/dist/index.js
CHANGED
|
@@ -596,10 +596,18 @@ var WebServerCore = class {
|
|
|
596
596
|
}
|
|
597
597
|
}
|
|
598
598
|
/**
|
|
599
|
+
* No-ops when `serverWeb` is undefined: under the HMR supervisor
|
|
600
|
+
* (see `resolveHotReloadConfig()`/`startHmrSupervisor()`), `onStartServer()`
|
|
601
|
+
* returns early with no server in the parent process — the child process
|
|
602
|
+
* it spawns is the one that actually listens — so callers following the
|
|
603
|
+
* documented `onStartServer()` → `onListeningOnServerEvent(server!)` /
|
|
604
|
+
* `onRequestOnServerEvent(server!)` pattern would otherwise crash in the
|
|
605
|
+
* parent with "Cannot read properties of undefined (reading 'on')".
|
|
599
606
|
*
|
|
600
607
|
* @param serverWeb
|
|
601
608
|
*/
|
|
602
609
|
onListeningOnServerEvent(serverWeb) {
|
|
610
|
+
if (!serverWeb) return;
|
|
603
611
|
this.loadTranslationFiles();
|
|
604
612
|
serverWeb.on(eventName2.error, (err) => {
|
|
605
613
|
this.serverListenEvent.onEventError(err);
|
|
@@ -612,10 +620,13 @@ var WebServerCore = class {
|
|
|
612
620
|
});
|
|
613
621
|
}
|
|
614
622
|
/**
|
|
623
|
+
* No-ops when `serverWeb` is undefined — same HMR-supervisor-parent
|
|
624
|
+
* case documented on `onListeningOnServerEvent()`.
|
|
615
625
|
*
|
|
616
626
|
* @param serverWeb
|
|
617
627
|
*/
|
|
618
628
|
onRequestOnServerEvent(serverWeb) {
|
|
629
|
+
if (!serverWeb) return;
|
|
619
630
|
this.loadTranslationFiles();
|
|
620
631
|
serverWeb.on(eventName2.request, (req, res) => {
|
|
621
632
|
requestCallsEvent(
|