zova-module-a-ssr 5.1.38 → 5.1.40
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 +114 -20
- package/dist/index.js.map +1 -1
- package/dist/lib/bodyReadyObserver.d.ts.map +1 -1
- package/dist/lib/ssr.d.ts +2 -0
- package/dist/lib/ssr.d.ts.map +1 -1
- package/dist/monkey.d.ts +2 -1
- package/dist/monkey.d.ts.map +1 -1
- package/dist/types/ssr.d.ts +12 -0
- package/dist/types/ssr.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/lib/bodyReadyObserver.ts +13 -11
- package/src/lib/ssr.ts +85 -1
- package/src/monkey.ts +25 -1
- package/src/types/ssr.ts +15 -1
package/dist/index.js
CHANGED
|
@@ -7,7 +7,9 @@ import { defu } from "defu";
|
|
|
7
7
|
import { extend } from "@cabloy/extend";
|
|
8
8
|
import * as devalue from "devalue";
|
|
9
9
|
//#region src/bean/sys.ssrState.ts
|
|
10
|
-
var _dec$1
|
|
10
|
+
var _dec$1;
|
|
11
|
+
var _dec2$1;
|
|
12
|
+
var _class$1;
|
|
11
13
|
var SymbolSSRState$1 = Symbol("SymbolSSRState");
|
|
12
14
|
var SymbolSSRStateDefer = Symbol("SymbolSSRStateDefer");
|
|
13
15
|
var SysSsrState = (_dec$1 = Sys(), _dec2$1 = BeanInfo({ module: "a-ssr" }), _dec$1(_class$1 = _dec2$1(_class$1 = class SysSsrState extends BeanBase {
|
|
@@ -102,8 +104,14 @@ function useMeta(ctx, metaOptions) {
|
|
|
102
104
|
var Monkey = class extends BeanSimple {
|
|
103
105
|
appContextInitialize(ctx) {
|
|
104
106
|
ctx.meta.$ssr = ctx.app.ctx.meta.$ssr;
|
|
107
|
+
if (process.env.CLIENT) ctx.meta.$ssr.handleDirectOrOnHydrated(() => {
|
|
108
|
+
if (!ctx.disposed) ctx.meta.hooks.invokeHook("hydrated");
|
|
109
|
+
});
|
|
105
110
|
if (process.env.SERVER) ctx.meta.$ssr._registerServerContext(ctx);
|
|
106
111
|
}
|
|
112
|
+
controllerLoad(event) {
|
|
113
|
+
event.ctx.meta.$ssr.controllerLoad(event);
|
|
114
|
+
}
|
|
107
115
|
async appInitialize() {
|
|
108
116
|
this.app.meta.event.on("a-router:routerGuards", async (router, next) => {
|
|
109
117
|
if (process.env.CLIENT) {
|
|
@@ -164,8 +172,16 @@ var Monkey = class extends BeanSimple {
|
|
|
164
172
|
}
|
|
165
173
|
_ssrErrorHandler() {
|
|
166
174
|
if (!process.env.SERVER) return;
|
|
167
|
-
const _eventErrorHandler = this.app.meta.event.on("app:errorHandler", (
|
|
175
|
+
const _eventErrorHandler = this.app.meta.event.on("app:errorHandler", (data, next) => {
|
|
168
176
|
const err = next();
|
|
177
|
+
if (data.load?.kind === "controller-load") {
|
|
178
|
+
if (_isLoadErrorHandledServer(data.err)) {
|
|
179
|
+
data.load.disposition = "handled";
|
|
180
|
+
if (!err || !(err instanceof Error)) return err;
|
|
181
|
+
return this._errorHandlerDefaultServer(err);
|
|
182
|
+
}
|
|
183
|
+
return err;
|
|
184
|
+
}
|
|
169
185
|
if (!err || !(err instanceof Error)) return err;
|
|
170
186
|
return this._errorHandlerDefaultServer(err);
|
|
171
187
|
});
|
|
@@ -186,6 +202,13 @@ var Monkey = class extends BeanSimple {
|
|
|
186
202
|
else this.ctx.meta.$ssr.renderSSRError = err;
|
|
187
203
|
}
|
|
188
204
|
};
|
|
205
|
+
function _isLoadErrorHandledServer(err) {
|
|
206
|
+
return isNavigationFailure(err) || [
|
|
207
|
+
301,
|
|
208
|
+
302,
|
|
209
|
+
401
|
|
210
|
+
].includes(Number(err.code));
|
|
211
|
+
}
|
|
189
212
|
//#endregion
|
|
190
213
|
//#region src/lib/utils.ts
|
|
191
214
|
function unevalPatch(value) {
|
|
@@ -339,10 +362,12 @@ function normalize(meta) {
|
|
|
339
362
|
const metaProp = type[1];
|
|
340
363
|
for (const name in metaType) {
|
|
341
364
|
const metaLink = metaType[name];
|
|
342
|
-
if (metaLink.template)
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
365
|
+
if (metaLink.template) {
|
|
366
|
+
if (Object.keys(metaLink).length === 1) delete metaType[name];
|
|
367
|
+
else {
|
|
368
|
+
metaLink[metaProp] = metaLink.template(metaLink[metaProp] || "");
|
|
369
|
+
delete metaLink.template;
|
|
370
|
+
}
|
|
346
371
|
}
|
|
347
372
|
}
|
|
348
373
|
});
|
|
@@ -492,6 +517,7 @@ var CtxSSR = class extends BeanSimple {
|
|
|
492
517
|
this[SymbolInstanceUpdates] = [];
|
|
493
518
|
this[SymbolHydratingCounter] = 0;
|
|
494
519
|
this[SymbolServerContexts] = /* @__PURE__ */ new Set();
|
|
520
|
+
this._controllerLoadSequence = {};
|
|
495
521
|
this.metaStore = void 0;
|
|
496
522
|
}
|
|
497
523
|
/** @internal */
|
|
@@ -549,6 +575,44 @@ var CtxSSR = class extends BeanSimple {
|
|
|
549
575
|
if (process.env.SERVER) return this.context.stateDefer;
|
|
550
576
|
else return this[SymbolSSRState].stateDefer;
|
|
551
577
|
}
|
|
578
|
+
/** @internal */
|
|
579
|
+
controllerLoad(event) {
|
|
580
|
+
if (event.phase === "prepare") {
|
|
581
|
+
if (process.env.SERVER) {
|
|
582
|
+
event.ctx.meta.state.controllerLoadKey = this._allocateControllerLoadKey(event);
|
|
583
|
+
return;
|
|
584
|
+
}
|
|
585
|
+
if (!process.env.CLIENT || !this.isRuntimeSsrPreHydration) return;
|
|
586
|
+
const key = this._allocateControllerLoadKey(event);
|
|
587
|
+
const snapshot = this.stateDefer.controllerLoad?.[key];
|
|
588
|
+
if (!snapshot || snapshot.version !== 1 || snapshot.controllerBeanName !== event.controllerBeanName) return;
|
|
589
|
+
delete this.stateDefer.controllerLoad[key];
|
|
590
|
+
event.replayError = _createControllerLoadError(snapshot);
|
|
591
|
+
event.replayControllerRecorded = snapshot.controllerRecorded;
|
|
592
|
+
return;
|
|
593
|
+
}
|
|
594
|
+
if (event.phase !== "fallback" || !process.env.SERVER || !event.error) return;
|
|
595
|
+
const key = event.ctx.meta.state.controllerLoadKey;
|
|
596
|
+
if (!key) return;
|
|
597
|
+
const controllerLoad = this.stateDefer.controllerLoad ??= {};
|
|
598
|
+
controllerLoad[key] = _createControllerLoadErrorSnapshot(event);
|
|
599
|
+
}
|
|
600
|
+
_allocateControllerLoadKey(event) {
|
|
601
|
+
const instance = event.ctx.instance;
|
|
602
|
+
const parts = [];
|
|
603
|
+
let current = instance;
|
|
604
|
+
while (current) {
|
|
605
|
+
const componentType = current.type;
|
|
606
|
+
const name = componentType.__file ?? componentType.name ?? componentType.__name ?? "anonymous";
|
|
607
|
+
const key = current.vnode.key ?? "";
|
|
608
|
+
parts.unshift(`${name}:${String(key)}`);
|
|
609
|
+
current = current.parent;
|
|
610
|
+
}
|
|
611
|
+
const structuralKey = parts.join("/");
|
|
612
|
+
const occurrence = this._controllerLoadSequence[structuralKey] ?? 0;
|
|
613
|
+
this._controllerLoadSequence[structuralKey] = occurrence + 1;
|
|
614
|
+
return `${structuralKey}#${occurrence}:${event.controllerBeanName ?? ""}`;
|
|
615
|
+
}
|
|
552
616
|
get profile() {
|
|
553
617
|
return resolveSsrProfile(this.state.ssrProfile, this.sys.env.SSR_PROFILE);
|
|
554
618
|
}
|
|
@@ -647,8 +711,10 @@ var CtxSSR = class extends BeanSimple {
|
|
|
647
711
|
}
|
|
648
712
|
} else if (isBooleanAttr(key)) {
|
|
649
713
|
ignore = true;
|
|
650
|
-
if (clientValue !== void 0)
|
|
651
|
-
|
|
714
|
+
if (clientValue !== void 0) {
|
|
715
|
+
if (includeBooleanAttr(clientValue)) el.setAttribute(key, "");
|
|
716
|
+
else el.removeAttribute(key);
|
|
717
|
+
}
|
|
652
718
|
} else if (el.getAttribute(`data-hydrate-ignore-${key}`) !== null) {
|
|
653
719
|
ignore = true;
|
|
654
720
|
if (clientValue !== void 0) {
|
|
@@ -719,6 +785,30 @@ var CtxSSR = class extends BeanSimple {
|
|
|
719
785
|
this._serverContextsDispose();
|
|
720
786
|
}
|
|
721
787
|
};
|
|
788
|
+
function _createControllerLoadErrorSnapshot(event) {
|
|
789
|
+
const error = event.error;
|
|
790
|
+
const snapshot = {
|
|
791
|
+
version: 1,
|
|
792
|
+
controllerBeanName: event.controllerBeanName,
|
|
793
|
+
name: error.name || "Error",
|
|
794
|
+
message: error.message || String(error),
|
|
795
|
+
controllerRecorded: event.controllerRecorded === true
|
|
796
|
+
};
|
|
797
|
+
for (const key of ["code", "status"]) if (typeof error[key] === "number" || typeof error[key] === "string") snapshot[key] = error[key];
|
|
798
|
+
for (const key of ["pagePath", "url"]) if (typeof error[key] === "string") snapshot[key] = error[key];
|
|
799
|
+
return snapshot;
|
|
800
|
+
}
|
|
801
|
+
function _createControllerLoadError(snapshot) {
|
|
802
|
+
const error = new Error(snapshot.message);
|
|
803
|
+
error.name = snapshot.name;
|
|
804
|
+
for (const key of [
|
|
805
|
+
"code",
|
|
806
|
+
"status",
|
|
807
|
+
"pagePath",
|
|
808
|
+
"url"
|
|
809
|
+
]) if (snapshot[key] !== void 0) error[key] = snapshot[key];
|
|
810
|
+
return error;
|
|
811
|
+
}
|
|
722
812
|
//#endregion
|
|
723
813
|
//#region src/monkeySys.ts
|
|
724
814
|
var MonkeySys = class extends BeanSimple {
|
|
@@ -747,7 +837,9 @@ var MonkeySys = class extends BeanSimple {
|
|
|
747
837
|
//#region src/.metadata/index.ts
|
|
748
838
|
/** monkeySys: end */
|
|
749
839
|
/** scope: begin */
|
|
750
|
-
var _dec
|
|
840
|
+
var _dec;
|
|
841
|
+
var _dec2;
|
|
842
|
+
var _class;
|
|
751
843
|
var ScopeModuleASsr = (_dec = Scope(), _dec2 = BeanInfo({ module: "a-ssr" }), _dec(_class = _dec2(_class = class ScopeModuleASsr extends BeanScopeBase {}) || _class) || _class);
|
|
752
844
|
/** scope: end */
|
|
753
845
|
//#endregion
|
|
@@ -755,19 +847,21 @@ var ScopeModuleASsr = (_dec = Scope(), _dec2 = BeanInfo({ module: "a-ssr" }), _d
|
|
|
755
847
|
function getBodyReadyObserverScript() {
|
|
756
848
|
return `<script id="ssr-body-ready-observer">
|
|
757
849
|
window.ssr_bodyReadyObserverClear=()=>{
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
document.querySelector('#ssr-body-ready-observer').remove();
|
|
765
|
-
}
|
|
850
|
+
window.ssr_body_ready_condition=undefined;
|
|
851
|
+
window.ssr_body_ready_callback=undefined;
|
|
852
|
+
window.ssr_bodyReadyObserver?.disconnect();
|
|
853
|
+
window.ssr_bodyReadyObserver=undefined;
|
|
854
|
+
document.body.style.display='block';
|
|
855
|
+
document.querySelector('#ssr-body-ready-observer')?.remove();
|
|
766
856
|
};
|
|
767
857
|
window.ssr_bodyReadyObserver = new MutationObserver(() => {
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
858
|
+
const __targets=window.ssr_body_ready_condition?.();
|
|
859
|
+
if(__targets){
|
|
860
|
+
try{
|
|
861
|
+
window.ssr_body_ready_callback?.(__targets);
|
|
862
|
+
}finally{
|
|
863
|
+
window.ssr_bodyReadyObserverClear();
|
|
864
|
+
}
|
|
771
865
|
}
|
|
772
866
|
});
|
|
773
867
|
window.ssr_bodyReadyObserver.observe(document.body, {
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../src/bean/sys.ssrState.ts","../src/config/config.ts","../src/lib/ssrNavigation.ts","../src/lib/useMeta.ts","../src/monkey.ts","../src/lib/utils.ts","../src/lib/ssrMetaStore.ts","../src/lib/ssrProfile.ts","../src/lib/ssr.ts","../src/monkeySys.ts","../src/.metadata/index.ts","../src/lib/bodyReadyObserver.ts"],"sourcesContent":["var _dec, _dec2, _class;\nimport { \"BeanInfo\" as __z_BeanInfo } from \"zova\";\nimport { BeanBase, cast } from 'zova';\nimport { Sys } from 'zova-module-a-bean';\nconst SymbolSSRState = Symbol('SymbolSSRState');\nconst SymbolSSRStateDefer = Symbol('SymbolSSRStateDefer');\nexport let SysSsrState = (_dec = Sys(), _dec2 = __z_BeanInfo({\n module: \"a-ssr\"\n}), _dec(_class = _dec2(_class = class SysSsrState extends BeanBase {\n constructor(...args) {\n super(...args);\n this[SymbolSSRState] = void 0;\n this[SymbolSSRStateDefer] = void 0;\n }\n async __init__() {\n if (process.env.CLIENT) {\n if (cast(window).__INITIAL_STATE__) {\n this[SymbolSSRState] = cast(window).__INITIAL_STATE__;\n delete cast(window).__INITIAL_STATE__;\n document.getElementById('ssr-state-init')?.remove();\n } else {\n this[SymbolSSRState] = {};\n }\n if (cast(window).__INITIAL_STATE_DEFER__) {\n this[SymbolSSRStateDefer] = cast(window).__INITIAL_STATE_DEFER__;\n delete cast(window).__INITIAL_STATE_DEFER__;\n document.getElementById('ssr-state-defer-init')?.remove();\n } else {\n this[SymbolSSRStateDefer] = {};\n }\n }\n }\n get state() {\n return this[SymbolSSRState];\n }\n get stateDefer() {\n return this[SymbolSSRStateDefer];\n }\n}) || _class) || _class);","export const config = sys => {\n const ssrConfig = {\n cookieThemeDarkDefault: sys.env.SSR_COOKIE_THEMEDARK_DEFAULT === 'true'\n };\n return ssrConfig;\n};","export function createSsrNavigationSync(options) {\n const navigationLocales = new WeakMap();\n return {\n beforeEach(to) {\n navigationLocales.set(to, options.getLocale());\n options.setProfile(to);\n options.setRouteLocale(to);\n },\n afterEach(to, from, failure) {\n const locale = navigationLocales.get(to);\n navigationLocales.delete(to);\n if (!failure) return;\n options.setProfile(from);\n if (locale !== undefined) {\n options.setLocale(locale);\n }\n }\n };\n}","// from: quasar/ui/src/composables/use-meta.js\nimport { computed, onActivated, onDeactivated, onUnmounted, watch } from 'vue';\nexport function useMeta(ctx, metaOptions) {\n if (process.env.SERVER) {\n ctx.meta.$ssr.context.__qMetaList.push(typeof metaOptions === 'function' ? metaOptions() : metaOptions);\n } else {\n const meta = {\n active: true\n };\n if (typeof metaOptions === 'function') {\n const content = computed(metaOptions);\n meta.val = content.value;\n watch(content, val => {\n meta.val = val;\n meta.active === true && ctx.meta.$ssr.metaStore.planClientUpdate();\n });\n } else {\n meta.val = metaOptions;\n }\n ctx.meta.$ssr.metaStore.addMetaOptions(meta);\n ctx.meta.$ssr.metaStore.planClientUpdate();\n onActivated(() => {\n try {\n meta.active = true;\n ctx.meta.$ssr.metaStore.planClientUpdate();\n } catch (_err) {}\n });\n onDeactivated(() => {\n try {\n meta.active = false;\n ctx.meta.$ssr.metaStore.planClientUpdate();\n } catch (_err) {}\n });\n onUnmounted(() => {\n try {\n ctx.meta.$ssr.metaStore.removeMetaOptions(meta);\n ctx.meta.$ssr.metaStore.planClientUpdate();\n } catch (_err) {}\n });\n }\n}","import { isNavigationFailure } from '@cabloy/vue-router';\nimport { BeanSimple, cast } from 'zova';\nimport { createSsrNavigationSync } from './lib/ssrNavigation.js';\nimport { useMeta } from './lib/useMeta.js';\nexport class Monkey extends BeanSimple {\n appContextInitialize(ctx) {\n ctx.meta.$ssr = ctx.app.ctx.meta.$ssr;\n if (process.env.SERVER) {\n ctx.meta.$ssr._registerServerContext(ctx);\n }\n }\n async appInitialize() {\n this.app.meta.event.on('a-router:routerGuards', async (router, next) => {\n if (process.env.CLIENT) {\n const navigationSync = createSsrNavigationSync({\n getLocale: () => this.app.meta.locale.current,\n setLocale: locale => {\n this.app.meta.locale.current = locale;\n },\n setProfile: route => {\n this.ctx.meta.$ssr._setProfile(route.meta.ssrProfile, route.meta.ssrProfileOptions, route.meta.locale);\n },\n setRouteLocale: route => {\n this.ctx.meta.$ssr._setLocale(route);\n }\n });\n router.beforeEach(to => {\n navigationSync.beforeEach(to);\n });\n router.afterEach((to, from, failure) => {\n navigationSync.afterEach(to, from, failure);\n });\n }\n return await next();\n });\n if (process.env.CLIENT && this.ctx.meta.$ssr.isRuntimeSsrPreHydration) {\n this.ctx.meta.$ssr.onHydrated(() => {\n document.documentElement.setAttribute('data-zova-hydrated', this.sys.env.SITE_ID);\n });\n }\n // ssr errorHandler\n if (process.env.SERVER) {\n this._ssrErrorHandler();\n }\n }\n async moduleLoading(_module) {}\n async moduleLoaded(module) {\n // ssrContext.modules\n if (process.env.SERVER && process.env.PROD) {\n if (!this.ctx.meta.$ssr.context.modules) this.ctx.meta.$ssr.context.modules = new Set();\n this.ctx.meta.$ssr.context.modules.add(`@@${module.info.relativeName}`);\n }\n }\n async beanInit(bean, beanInstance) {\n // eslint-disable-next-line\n const self = this;\n // $ssr\n bean.defineProperty(beanInstance, '$ssr', {\n enumerable: false,\n configurable: true,\n get() {\n return self.app.ctx.meta.$ssr;\n }\n });\n // $useMeta\n bean.defineProperty(beanInstance, '$useMeta', {\n enumerable: false,\n configurable: true,\n get() {\n return function (options) {\n const ctx = cast(this).ctx;\n ctx.util.instanceScope(() => {\n useMeta(ctx, options);\n });\n };\n }\n });\n }\n _ssrErrorHandler() {\n if (!process.env.SERVER) return;\n const _eventErrorHandler = this.app.meta.event.on('app:errorHandler', (_data, next) => {\n const err = next();\n if (!err || !(err instanceof Error)) return err;\n return this._errorHandlerDefaultServer(err);\n });\n this.ctx.meta.$ssr.context.onRendered(_err => {\n _eventErrorHandler();\n });\n }\n _errorHandlerDefaultServer(err) {\n if (!process.env.SERVER) return err;\n if (isNavigationFailure(err)) {\n if (!this.ctx.meta.$ssr.renderSSRError) {\n this.ctx.meta.$ssr.renderSSRError = err;\n }\n return undefined;\n } else if (err.code === 401) {\n try {\n this.app.$gotoLogin();\n } catch (err) {\n this.ctx.meta.$ssr.renderSSRError = err;\n }\n } else {\n this.ctx.meta.$ssr.renderSSRError = err;\n }\n return undefined;\n }\n}","import * as devalue from 'devalue';\nexport function unevalPatch(value) {\n return devalue.uneval(value);\n // return devalue.uneval(value, value => {\n // if (value && typeof value === 'object' && value.toJSON) {\n // return value.toJSON();\n // }\n // });\n}","// from: quasar/ui/src/plugins/Meta.js\nimport { extend } from '@cabloy/extend';\nimport { BeanSimple, cast } from 'zova';\nimport { unevalPatch } from './utils.js';\nexport class CtxSSRMetaStore extends BeanSimple {\n constructor(...args) {\n super(...args);\n this._updateId = 0;\n this._currentClientMeta = void 0;\n this._clientList = [];\n }\n __init__() {\n if (process.env.SERVER) {\n const ssrContext = this.ctx.meta.$ssr.context;\n ssrContext.__qMetaList = [];\n ssrContext.rendered = () => {\n this._onRenderedLast();\n ssrContext.rendered = () => {};\n };\n }\n if (process.env.CLIENT && this.ctx.meta.$ssr.isRuntimeSsrPreHydration) {\n this._currentClientMeta = cast(window).__Q_META__;\n document.getElementById('ssr-meta-init')?.remove();\n }\n }\n _onRenderedLast(err) {\n const app = this.app;\n try {\n if (err) return;\n const ssrContext = this.ctx.meta.$ssr.context;\n this._injectContextState(ssrContext);\n this._injectContextStateDefer(ssrContext);\n this._injectServerMeta(ssrContext);\n } finally {\n this.ctx.meta.$ssr._disposeServerContexts();\n app?.close();\n }\n }\n addMetaOptions(metaOptionsWrapper) {\n this._clientList.push(metaOptionsWrapper);\n }\n removeMetaOptions(metaOptionsWrapper) {\n this._clientList.splice(this._clientList.indexOf(metaOptionsWrapper), 1);\n }\n planClientUpdate() {\n if (this._updateId !== 0) {\n clearTimeout(this._updateId);\n }\n this._updateId = window.setTimeout(() => {\n this._updateId = 0;\n this._updateClientMeta();\n }, 50);\n }\n _updateClientMeta() {\n const data = {\n title: '',\n titleTemplate: undefined,\n meta: {},\n link: {},\n script: {},\n htmlAttr: {},\n bodyAttr: {}\n };\n for (let i = 0; i < this._clientList.length; i++) {\n const {\n active,\n val\n } = this._clientList[i];\n if (active === true) {\n extend(true, data, val);\n }\n }\n normalize(data);\n apply(diff(this._currentClientMeta, data));\n this._currentClientMeta = data;\n }\n _injectServerMeta(ssrContext) {\n const data = {\n title: '',\n titleTemplate: undefined,\n meta: {},\n link: {},\n htmlAttr: {},\n bodyAttr: {},\n bodyStyle: {},\n bodyClass: {},\n noscript: {}\n };\n const list = ssrContext.__qMetaList;\n for (let i = 0; i < list.length; i++) {\n extend(true, data, list[i]);\n }\n normalize(data);\n const nonce = ssrContext.nonce !== void 0 ? ` nonce=\"${ssrContext.nonce}\"` : '';\n const ctx = ssrContext._meta;\n const htmlAttr = Object.keys(data.htmlAttr).filter(htmlFilter);\n if (htmlAttr.length !== 0) {\n ctx.htmlAttrs += (ctx.htmlAttrs.length !== 0 ? ' ' : '') + htmlAttr.map(getAttr(data.htmlAttr)).join(' ');\n }\n ctx.headTags += getHead(data);\n const bodyAttr = Object.keys(data.bodyAttr).filter(bodyFilter);\n if (bodyAttr.length !== 0) {\n ctx.bodyAttrs += (ctx.bodyAttrs.length !== 0 ? ' ' : '') + bodyAttr.map(getAttr(data.bodyAttr)).join(' ');\n }\n const bodyStyle = Object.keys(data.bodyStyle).filter(name => !!data.bodyStyle[name]).map(name => `${name}:${data.bodyStyle[name]};`).join('');\n if (bodyStyle) {\n ctx.bodyAttrs += `${ctx.bodyAttrs.length !== 0 ? ' ' : ''}style=\"${bodyStyle}\"`;\n }\n const _bodyClass = ctx.bodyClasses.split(' ').filter(item => !!item);\n const bodyClass = {};\n _bodyClass.forEach(item => bodyClass[item] = true);\n extend(true, bodyClass, data.bodyClass);\n ctx.bodyClasses = Object.keys(bodyClass).filter(name => bodyClass[name]).map(name => name).join(' ');\n data.title = '\\'\"`';\n ctx.endingHeadTags += `${Object.keys(data.noscript).map(name => `<noscript data-qmeta=\"${name}\">${data.noscript[name]}</noscript>`).join('')}<script${nonce} id=\"ssr-meta-init\">window.__Q_META__=${delete data.bodyStyle && delete data.bodyClass && delete data.noscript && unevalPatch(data)}</script>`;\n const cookieTheme = this.ctx.meta.$ssr.profileOptions.useCookie;\n let ssr_local_themedark = cookieTheme ? `let ssr_cookie_themedark=document.cookie.split('; ')?.find(item=>item.indexOf('themedark=')>-1)?.split('=')[1];\n ssr_cookie_themedark=ssr_cookie_themedark==='true'?true:ssr_cookie_themedark==='false'?false:${this.sys.env.SSR_COOKIE_THEMEDARK_DEFAULT};\n window.ssr_themedark=window.ssr_cookie_themedark=ssr_cookie_themedark;` : `let ssr_local_themedark=window.ssr_load_local('themedark');\n if(ssr_local_themedark===undefined || ssr_local_themedark==='auto'){\n ssr_local_themedark=window.matchMedia('(prefers-color-scheme: dark)').matches;\n }\n window.ssr_themedark=window.ssr_local_themedark=ssr_local_themedark;`;\n // Resolve the final browser theme from the SSR dual markers emitted before page render.\n ssr_local_themedark += `Object.defineProperty(window, 'ssr_themedark_data', {\n get: () => {\n let _data=document.body.getAttribute('data-ssr-theme-dark-'+window.ssr_themedark);\n if(_data===undefined || _data===null){\n _data=window.__INITIAL_STATE__ && window.__INITIAL_STATE__['data-ssr-theme-dark-'+window.ssr_themedark];\n }\n return _data;\n },\n });`;\n const ssr_local_themename = cookieTheme ? '' : `window.ssr_local_themename=window.ssr_load_local('themename','${this.sys.env.STYLE_DEFAULT_THEME}');`;\n ctx.endingHeadTags += `<script id=\"ssr-prefers-color-schema-dark\">\n window.ssr_load_local=function(key,defaultValue){\n const __ssr_local=localStorage.getItem(key);\n const value=__ssr_local?JSON.parse(__ssr_local):undefined;\n return value??defaultValue;\n };\n ${ssr_local_themedark}\n ${ssr_local_themename}\n document.querySelector('#ssr-prefers-color-schema-dark').remove();\n </script>`.replaceAll('\\n', '');\n }\n _injectContextState(ssrContext) {\n const ctx = ssrContext._meta;\n const nonce = ssrContext.nonce !== void 0 ? ` nonce=\"${ssrContext.nonce}\"` : '';\n ctx.endingHeadTags += `<script${nonce} id=\"ssr-state-init\">window.__INITIAL_STATE__=${unevalPatch(ssrContext.state)}</script>`;\n }\n _injectContextStateDefer(ssrContext) {\n const ctx = ssrContext._meta;\n const nonce = ssrContext.nonce !== void 0 ? ` nonce=\"${ssrContext.nonce}\"` : '';\n ctx.endingBodyTags += `<script${nonce} id=\"ssr-state-defer-init\">window.__INITIAL_STATE_DEFER__=${unevalPatch(ssrContext.stateDefer)}</script>`;\n }\n}\nfunction normalize(meta) {\n if (meta.title) {\n meta.title = meta.titleTemplate ? meta.titleTemplate(meta.title) : meta.title;\n delete meta.titleTemplate;\n }\n [['meta', 'content'], ['link', 'href']].forEach(type => {\n const metaType = meta[type[0]];\n const metaProp = type[1];\n for (const name in metaType) {\n const metaLink = metaType[name];\n if (metaLink.template) {\n if (Object.keys(metaLink).length === 1) {\n delete metaType[name];\n } else {\n metaLink[metaProp] = metaLink.template(metaLink[metaProp] || '');\n delete metaLink.template;\n }\n }\n }\n });\n}\nfunction changed(old, def) {\n if (Object.keys(old).length !== Object.keys(def).length) {\n return true;\n }\n for (const key in old) {\n if (old[key] !== def[key]) {\n return true;\n }\n }\n}\nfunction bodyFilter(name) {\n return ['class', 'style'].includes(name) === false;\n}\nfunction htmlFilter(_name) {\n return true;\n // return ['lang', 'dir'].includes(name) === false;\n}\nfunction diff(meta, other) {\n const add = {};\n const remove = {};\n if (meta === void 0) {\n return {\n add: other,\n remove\n };\n }\n if (meta.title !== other.title) {\n add.title = other.title;\n }\n ['meta', 'link', 'script', 'htmlAttr', 'bodyAttr'].forEach(type => {\n const old = meta[type];\n const cur = other[type];\n remove[type] = [];\n if (old === void 0 || old === null) {\n add[type] = cur;\n return;\n }\n add[type] = {};\n for (const key in old) {\n if (Object.prototype.hasOwnProperty.call(cur, key) === false) {\n remove[type].push(key);\n }\n }\n for (const key in cur) {\n if (Object.prototype.hasOwnProperty.call(old, key) === false) {\n add[type][key] = cur[key];\n } else if (changed(old[key], cur[key]) === true) {\n remove[type].push(key);\n add[type][key] = cur[key];\n }\n }\n });\n return {\n add,\n remove\n };\n}\nfunction apply({\n add,\n remove\n}) {\n if (add.title) {\n document.title = add.title;\n }\n if (Object.keys(remove).length !== 0) {\n ['meta', 'link', 'script'].forEach(type => {\n remove[type].forEach(name => {\n document.head.querySelector(`${type}[data-qmeta=\"${name}\"]`)?.remove();\n });\n });\n remove.htmlAttr.filter(htmlFilter).forEach(name => {\n document.documentElement.removeAttribute(name);\n });\n remove.bodyAttr.filter(bodyFilter).forEach(name => {\n document.body.removeAttribute(name);\n });\n }\n ['meta', 'link', 'script'].forEach(type => {\n const metaType = add[type];\n for (const name in metaType) {\n const tag = document.createElement(type);\n for (const att in metaType[name]) {\n if (att !== 'innerHTML') {\n tag.setAttribute(att, metaType[name][att]);\n }\n }\n tag.setAttribute('data-qmeta', name);\n if (type === 'script') {\n tag.innerHTML = metaType[name].innerHTML || '';\n }\n document.head.appendChild(tag);\n }\n });\n Object.keys(add.htmlAttr).filter(htmlFilter).forEach(name => {\n document.documentElement.setAttribute(name, add.htmlAttr[name] || '');\n });\n Object.keys(add.bodyAttr).filter(bodyFilter).forEach(name => {\n document.body.setAttribute(name, add.bodyAttr[name] || '');\n });\n}\nfunction getAttr(seed) {\n return att => {\n const val = seed[att];\n return att + (val !== true && val !== void 0 ? `=\"${val}\"` : '');\n };\n}\nfunction getHead(meta) {\n let output = '';\n if (meta.title) {\n output += `<title>${meta.title}</title>`;\n }\n ['meta', 'link', 'script'].forEach(type => {\n const metaType = meta[type];\n for (const att in metaType) {\n const attrs = Object.keys(metaType[att]).filter(att => att !== 'innerHTML').map(getAttr(metaType[att]));\n output += `<${type} ${attrs.join(' ')} data-qmeta=\"${att}\">`;\n if (type === 'script') {\n output += `${metaType[att].innerHTML || ''}</script>`;\n }\n }\n });\n return output;\n}","export function resolveSsrProfile(routeProfile, defaultProfile) {\n const ssrProfile = routeProfile ?? defaultProfile ?? 'public';\n if (ssrProfile !== 'public' && ssrProfile !== 'session') {\n throw new Error(`invalid SSR profile: ${ssrProfile}`);\n }\n return ssrProfile;\n}\nexport function resolveSsrProfileOptions(ssrProfile, profiles, routeProfileOptions, metaLocale) {\n const profileOptions = profiles[ssrProfile];\n if (!profileOptions) {\n throw new Error(`invalid SSR profile: ${ssrProfile}`);\n }\n const responseCache = routeProfileOptions?.responseCache ?? (ssrProfile === 'public' && metaLocale !== true ? {\n expires: 0\n } : profileOptions.responseCache);\n return Object.freeze({\n useCookie: ssrProfile === 'session' && profileOptions.useCookie,\n responseCache: responseCache === false ? false : Object.freeze({\n ...responseCache\n })\n });\n}","import { includeBooleanAttr, isBooleanAttr, isString, stringifyStyle } from '@vue/shared';\nimport { defu } from 'defu';\nimport { normalizeClass, normalizeStyle, ref, useSSRContext } from 'vue';\nimport { BeanSimple } from 'zova';\nimport { CtxSSRMetaStore } from './ssrMetaStore.js';\nimport { resolveSsrProfile, resolveSsrProfileOptions } from './ssrProfile.js';\nconst SymbolIsRuntimeSsrPreHydration = Symbol('SymbolIsRuntimeSsrPreHydration');\nconst SymbolSSRContext = Symbol('SymbolSSRContext');\nconst SymbolSSRState = Symbol('SymbolSSRState');\nconst SymbolOnHydrateds = Symbol('SymbolOnHydrateds');\nconst SymbolOnHydratePropHasMismatches = Symbol('SymbolOnHydratePropHasMismatches');\nconst SymbolInstanceUpdates = Symbol('SymbolInstanceUpdates');\nconst SymbolHydratingCounter = Symbol('SymbolHydratingCounter');\nconst SymbolServerContexts = Symbol('SymbolServerContexts');\nexport class CtxSSR extends BeanSimple {\n constructor(...args) {\n super(...args);\n this[SymbolIsRuntimeSsrPreHydration] = ref(false);\n this[SymbolSSRContext] = void 0;\n this[SymbolSSRState] = void 0;\n this[SymbolOnHydrateds] = [];\n this[SymbolOnHydratePropHasMismatches] = [];\n this[SymbolInstanceUpdates] = [];\n this[SymbolHydratingCounter] = 0;\n this[SymbolServerContexts] = new Set();\n this.metaStore = void 0;\n }\n /** @internal */\n initialize() {\n if (process.env.SERVER) {\n this._serverContextRegister();\n }\n // ssr state\n this[SymbolSSRState] = this.sys.bean._getBeanSyncOnly('a-ssr.sys.ssrState');\n // SymbolIsRuntimeSsrPreHydration\n if (process.env.SERVER) {\n this[SymbolIsRuntimeSsrPreHydration].value = true;\n } else if (process.env.CLIENT && document.body.getAttribute('data-server-rendered') !== null) {\n this[SymbolIsRuntimeSsrPreHydration].value = true;\n }\n // onHydratePropHasMismatch\n if (process.env.CLIENT && this.isRuntimeSsrPreHydration) {\n this.onHydratePropHasMismatch((el, key, clientValue, vnode, instance) => {\n return this._onHydratePropHasMismatchDefault(el, key, clientValue, vnode, instance);\n });\n }\n // metaStore\n this.metaStore = this.bean._newBeanSimple(CtxSSRMetaStore, false);\n // fix: flash on page load\n // need not check process.env.DEV, because maybe need remove vite-css-module-id on prod\n if (process.env.CLIENT && this.isRuntimeSsrPreHydration) {\n this.onHydrated(() => {\n document.querySelectorAll('style[vite-css-module-id]').forEach(node => node.remove());\n });\n }\n }\n _serverContextRegister(currentContext = this.ctx) {\n const serverContexts = this[SymbolServerContexts];\n serverContexts.add(currentContext);\n this.context.onRendered(() => {\n serverContexts.delete(currentContext);\n });\n }\n _serverContextsDispose() {\n const serverContexts = this[SymbolServerContexts];\n for (const serverContext of serverContexts) {\n if (serverContext.disposed) continue;\n if (serverContext.bean && serverContext.bean !== serverContext.app?.bean) {\n serverContext.bean.dispose();\n }\n serverContext.dispose();\n }\n serverContexts.clear();\n }\n get isRuntimeSsrPreHydration() {\n return this[SymbolIsRuntimeSsrPreHydration].value;\n }\n get isRuntimeSsrHydrated() {\n return process.env.CLIENT && !this.isRuntimeSsrPreHydration;\n }\n set isRuntimeSsrPreHydration(value) {\n this[SymbolIsRuntimeSsrPreHydration].value = value;\n }\n get context() {\n if (process.env.CLIENT) throw new Error('cannot called in client');\n if (!this[SymbolSSRContext]) {\n this.ctx.util.instanceScope(() => {\n this[SymbolSSRContext] = useSSRContext();\n this._initContext();\n });\n }\n return this[SymbolSSRContext];\n }\n get state() {\n if (process.env.SERVER) {\n return this.context.state;\n } else {\n return this[SymbolSSRState].state;\n }\n }\n get stateDefer() {\n if (process.env.SERVER) {\n return this.context.stateDefer;\n } else {\n return this[SymbolSSRState].stateDefer;\n }\n }\n get profile() {\n return resolveSsrProfile(this.state.ssrProfile, this.sys.env.SSR_PROFILE);\n }\n get profileOptions() {\n const profileOptions = this.state.ssrProfileOptions;\n if (profileOptions) return profileOptions;\n return resolveSsrProfileOptions(this.profile, this.sys.config.ssr.profiles);\n }\n\n /** @internal */\n _setProfile(routeProfile, routeProfileOptions, metaLocale) {\n const ssrProfile = resolveSsrProfile(routeProfile, this.sys.env.SSR_PROFILE);\n const ssrProfileOptions = resolveSsrProfileOptions(ssrProfile, this.sys.config.ssr.profiles, routeProfileOptions, metaLocale);\n this.state.ssrProfile = ssrProfile;\n this.state.ssrProfileOptions = ssrProfileOptions;\n }\n\n /** @internal */\n _setLocale(route) {\n if (route.meta.locale) {\n this.app.meta.locale.current = route.params?.locale;\n }\n }\n get cookieDisabledOnServer() {\n return process.env.SERVER && !this.profileOptions.useCookie;\n }\n get renderSSRError() {\n return this.context._meta.renderError;\n }\n set renderSSRError(err) {\n this.context._meta.renderError = err;\n }\n getPerformAction(baseURL) {\n if (process.env.SERVER && baseURL === this.sys.env.SSR_API_BASE_URL) return this.context.performAction;\n return undefined;\n }\n _initContext() {\n const ssrContext = this[SymbolSSRContext];\n ssrContext._meta = defu(ssrContext._meta, {\n htmlAttrs: '',\n headTags: '',\n endingHeadTags: '',\n bodyClasses: '',\n bodyAttrs: 'data-server-rendered',\n bodyTags: '',\n endingBodyTags: '',\n baseUrl: this.sys.util.getAbsoluteUrlFromPagePath(undefined, false, true) // not include publicPath\n });\n ssrContext.state = ssrContext.state || {};\n ssrContext.stateDefer = ssrContext.stateDefer || {};\n }\n\n /**\n * Registers a callback that runs after initial client SSR hydration completes.\n * It does not run for SPA startup or later client navigation.\n */\n onHydrated(fn) {\n this[SymbolOnHydrateds].push(fn);\n }\n onHydratePropHasMismatch(fn) {\n this[SymbolOnHydratePropHasMismatches].push(fn);\n }\n handleDirectOrOnHydrated(fn) {\n if (!process.env.CLIENT) return;\n if (this.isRuntimeSsrPreHydration) {\n this.onHydrated(fn);\n } else {\n return fn();\n }\n }\n _onHydratePropHasMismatchDefault(el, key, clientValue, _vnode, _instance) {\n // expected\n let ignore = false;\n let expected;\n if (key === 'class') {\n ignore = true;\n if (clientValue !== undefined) {\n expected = normalizeClass(clientValue);\n el.setAttribute(key, expected);\n }\n } else if (key === 'style') {\n ignore = true;\n if (clientValue !== undefined) {\n expected = isString(clientValue) ? clientValue : stringifyStyle(normalizeStyle(clientValue));\n el.setAttribute(key, expected);\n }\n } else if (['id', 'name', 'for', 'd', 'aria-labelledby', 'aria-controls'].includes(key)) {\n ignore = true;\n if (clientValue !== undefined) {\n expected = String(clientValue);\n el.setAttribute(key, expected);\n }\n } else if (key === 'value') {\n ignore = true;\n if (clientValue !== undefined) {\n expected = String(clientValue);\n if (el.tagName === 'TEXTAREA') {\n el.value = expected;\n } else {\n el.setAttribute(key, expected);\n }\n }\n } else if (isBooleanAttr(key)) {\n ignore = true;\n if (clientValue !== undefined) {\n const expected = includeBooleanAttr(clientValue);\n if (expected) {\n el.setAttribute(key, '');\n } else {\n el.removeAttribute(key);\n }\n }\n } else if (el.getAttribute(`data-hydrate-ignore-${key}`) !== null) {\n ignore = true;\n if (clientValue !== undefined) {\n expected = String(clientValue);\n el.setAttribute(key, expected);\n }\n }\n if (!ignore) return {\n clientValue\n };\n return {\n ignore: true\n };\n }\n _hydrated() {\n if (!this.isRuntimeSsrPreHydration) return;\n // should be first\n this.isRuntimeSsrPreHydration = false;\n //\n this[SymbolInstanceUpdates].forEach(instance => {\n if (!instance.isUnmounted && instance.zova) {\n try {\n instance.update();\n } catch (err) {\n if (!err.message.includes(\"'insertBefore'\")) {\n throw err;\n }\n }\n }\n });\n this[SymbolInstanceUpdates] = [];\n //\n this[SymbolOnHydrateds].forEach(fn => fn());\n this[SymbolOnHydrateds] = [];\n //\n this[SymbolOnHydratePropHasMismatches] = [];\n }\n\n /** @internal */\n _hydratePropHasMismatch(el, key, clientValue, vnode, instance) {\n for (const fn of this[SymbolOnHydratePropHasMismatches]) {\n const res = fn(el, key, clientValue, vnode, instance);\n if (res.ignore) return res;\n clientValue = res.clientValue;\n }\n return {\n ignore: false,\n clientValue\n };\n }\n\n /** @internal */\n _hydratingRootInc() {\n if (process.env.CLIENT && this.isRuntimeSsrPreHydration) {\n this._hydratingInc();\n }\n }\n\n /** @internal */\n _hydratingRootDec() {\n if (process.env.CLIENT && this.isRuntimeSsrPreHydration) {\n this._hydratingDec();\n }\n }\n\n /** @internal */\n _hydratingInc() {\n ++this[SymbolHydratingCounter];\n }\n\n /** @internal */\n _hydratingDec() {\n if (--this[SymbolHydratingCounter] === 0) {\n this._hydrated();\n }\n }\n\n /** @internal */\n _hydratingInstanceRecord(instance) {\n if (!this[SymbolInstanceUpdates].includes(instance)) {\n this[SymbolInstanceUpdates].push(instance);\n return true;\n }\n return false;\n }\n\n /** @internal */\n _registerServerContext(currentContext) {\n this._serverContextRegister(currentContext);\n }\n\n /** @internal */\n _disposeServerContexts() {\n this._serverContextsDispose();\n }\n}","import { BeanSimple } from 'zova';\nimport { CtxSSR } from './lib/ssr.js';\nexport class MonkeySys extends BeanSimple {\n constructor(moduleSelf) {\n super();\n this._moduleSelf = void 0;\n this._sysSsrState = void 0;\n this._moduleSelf = moduleSelf;\n }\n async getSysSsrState() {\n if (!this._sysSsrState) {\n this._sysSsrState = await this.bean._getBean('a-ssr.sys.ssrState', false);\n }\n return this._sysSsrState;\n }\n async moduleLoading(module) {\n if (this._moduleSelf === module) return;\n await this.getSysSsrState();\n }\n async moduleLoaded(_module) {}\n async configLoaded(_module, _config) {}\n sysContextInitialize(ctx) {\n ctx.meta.$ssr = ctx.bean._newBeanSimple(CtxSSR, false);\n ctx.meta.$ssr.initialize();\n }\n}","var _dec, _dec2, _class;\nimport { \"BeanInfo\" as __z_BeanInfo } from \"zova\";\n// eslint-disable\n/** sys: begin */\nexport * from '../bean/sys.ssrState.js';\nimport 'zova';\n/** sys: end */\n/** sys: begin */\nimport { SysSsrState } from '../bean/sys.ssrState.js';\nimport 'zova';\n/** sys: end */\n/** config: begin */\nexport * from '../config/config.js';\n/** config: end */\n/** monkey: begin */\nexport * from '../monkey.js';\n/** monkey: end */\n/** monkeySys: begin */\nexport * from '../monkeySys.js';\n/** monkeySys: end */\n/** scope: begin */\nimport { BeanScopeBase } from 'zova';\nimport { Scope } from 'zova-module-a-bean';\nexport let ScopeModuleASsr = (_dec = Scope(), _dec2 = __z_BeanInfo({\n module: \"a-ssr\"\n}), _dec(_class = _dec2(_class = class ScopeModuleASsr extends BeanScopeBase {}) || _class) || _class);\nimport 'zova';\n\n/** scope: end */","export function getBodyReadyObserverScript() {\n return `<script id=\"ssr-body-ready-observer\">\n window.ssr_bodyReadyObserverClear=()=>{\n if(window.ssr_bodyReadyObserver){\n window.ssr_body_ready_condition=undefined;\n window.ssr_body_ready_callback=undefined;\n window.ssr_bodyReadyObserver.disconnect();\n window.ssr_bodyReadyObserver=undefined;\n document.body.style.display='block';\n document.querySelector('#ssr-body-ready-observer').remove();\n }\n };\n window.ssr_bodyReadyObserver = new MutationObserver(() => {\n if(window.ssr_body_ready_condition && window.ssr_body_ready_condition()){\n window.ssr_body_ready_callback();\n window.ssr_bodyReadyObserverClear();\n }\n });\n window.ssr_bodyReadyObserver.observe(document.body, {\n subtree: true,\n childList: true,\n });\n document.addEventListener(\"DOMContentLoaded\", () => {\n window.ssr_bodyReadyObserverClear();\n });\n </script>`.replaceAll('\\\\n', '');\n}"],"mappings":";;;;;;;;;AAAA,IAAI,QAAM,SAAO;AAIjB,IAAM,mBAAiB,OAAO,gBAAgB;AAC9C,IAAM,sBAAsB,OAAO,qBAAqB;AACxD,IAAW,eAAe,SAAO,IAAI,GAAG,UAAQ,SAAa,EAC3D,QAAQ,QACV,CAAC,GAAG,OAAK,WAAS,QAAM,WAAS,MAAM,oBAAoB,SAAS;CAClE,YAAY,GAAG,MAAM;EACnB,MAAM,GAAG,IAAI;EACb,KAAK,oBAAkB,KAAK;EAC5B,KAAK,uBAAuB,KAAK;CACnC;CACA,MAAM,WAAW;EACf,IAAI,QAAQ,IAAI,QAAQ;GACtB,IAAI,KAAK,MAAM,CAAC,CAAC,mBAAmB;IAClC,KAAK,oBAAkB,KAAK,MAAM,CAAC,CAAC;IACpC,OAAO,KAAK,MAAM,CAAC,CAAC;IACpB,SAAS,eAAe,gBAAgB,CAAC,EAAE,OAAO;GACpD,OACE,KAAK,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CACA,MAAM,aAAa,SAAS,CAAC;CAC7B,MAAM,aAAa,SAAS,SAAS,CAAC;CACtC,qBAAqB,KAAK;EACxB,IAAI,KAAK,OAAO,IAAI,KAAK,eAAe,QAAQ,KAAK;EACrD,IAAI,KAAK,KAAK,WAAW;CAC3B;AACF;;;;;ACzBA,IAAI,MAAM,OAAO;AAuBjB,IAAW,mBAAmB,OAAO,MAAM,GAAG,QAAQ,SAAa,EACjE,QAAQ,QACV,CAAC,GAAG,KAAK,SAAS,MAAM,SAAS,MAAM,wBAAwB,cAAc,CAAC,CAAC,KAAK,MAAM,KAAK;;;;ACzB/F,SAAgB,6BAA6B;CAC3C,OAAO;;;;;;;;;;;;;;;;;;;;;;;;kBAwBQ,WAAW,OAAO,EAAE;AACrC"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/bean/sys.ssrState.ts","../src/config/config.ts","../src/lib/ssrNavigation.ts","../src/lib/useMeta.ts","../src/monkey.ts","../src/lib/utils.ts","../src/lib/ssrMetaStore.ts","../src/lib/ssrProfile.ts","../src/lib/ssr.ts","../src/monkeySys.ts","../src/.metadata/index.ts","../src/lib/bodyReadyObserver.ts"],"sourcesContent":["var _dec, _dec2, _class;\nimport { \"BeanInfo\" as __z_BeanInfo } from \"zova\";\nimport { BeanBase, cast } from 'zova';\nimport { Sys } from 'zova-module-a-bean';\nconst SymbolSSRState = Symbol('SymbolSSRState');\nconst SymbolSSRStateDefer = Symbol('SymbolSSRStateDefer');\nexport let SysSsrState = (_dec = Sys(), _dec2 = __z_BeanInfo({\n module: \"a-ssr\"\n}), _dec(_class = _dec2(_class = class SysSsrState extends BeanBase {\n constructor(...args) {\n super(...args);\n this[SymbolSSRState] = void 0;\n this[SymbolSSRStateDefer] = void 0;\n }\n async __init__() {\n if (process.env.CLIENT) {\n if (cast(window).__INITIAL_STATE__) {\n this[SymbolSSRState] = cast(window).__INITIAL_STATE__;\n delete cast(window).__INITIAL_STATE__;\n document.getElementById('ssr-state-init')?.remove();\n } else {\n this[SymbolSSRState] = {};\n }\n if (cast(window).__INITIAL_STATE_DEFER__) {\n this[SymbolSSRStateDefer] = cast(window).__INITIAL_STATE_DEFER__;\n delete cast(window).__INITIAL_STATE_DEFER__;\n document.getElementById('ssr-state-defer-init')?.remove();\n } else {\n this[SymbolSSRStateDefer] = {};\n }\n }\n }\n get state() {\n return this[SymbolSSRState];\n }\n get stateDefer() {\n return this[SymbolSSRStateDefer];\n }\n}) || _class) || _class);","export const config = sys => {\n const ssrConfig = {\n cookieThemeDarkDefault: sys.env.SSR_COOKIE_THEMEDARK_DEFAULT === 'true'\n };\n return ssrConfig;\n};","export function createSsrNavigationSync(options) {\n const navigationLocales = new WeakMap();\n return {\n beforeEach(to) {\n navigationLocales.set(to, options.getLocale());\n options.setProfile(to);\n options.setRouteLocale(to);\n },\n afterEach(to, from, failure) {\n const locale = navigationLocales.get(to);\n navigationLocales.delete(to);\n if (!failure) return;\n options.setProfile(from);\n if (locale !== undefined) {\n options.setLocale(locale);\n }\n }\n };\n}","// from: quasar/ui/src/composables/use-meta.js\nimport { computed, onActivated, onDeactivated, onUnmounted, watch } from 'vue';\nexport function useMeta(ctx, metaOptions) {\n if (process.env.SERVER) {\n ctx.meta.$ssr.context.__qMetaList.push(typeof metaOptions === 'function' ? metaOptions() : metaOptions);\n } else {\n const meta = {\n active: true\n };\n if (typeof metaOptions === 'function') {\n const content = computed(metaOptions);\n meta.val = content.value;\n watch(content, val => {\n meta.val = val;\n meta.active === true && ctx.meta.$ssr.metaStore.planClientUpdate();\n });\n } else {\n meta.val = metaOptions;\n }\n ctx.meta.$ssr.metaStore.addMetaOptions(meta);\n ctx.meta.$ssr.metaStore.planClientUpdate();\n onActivated(() => {\n try {\n meta.active = true;\n ctx.meta.$ssr.metaStore.planClientUpdate();\n } catch (_err) {}\n });\n onDeactivated(() => {\n try {\n meta.active = false;\n ctx.meta.$ssr.metaStore.planClientUpdate();\n } catch (_err) {}\n });\n onUnmounted(() => {\n try {\n ctx.meta.$ssr.metaStore.removeMetaOptions(meta);\n ctx.meta.$ssr.metaStore.planClientUpdate();\n } catch (_err) {}\n });\n }\n}","import { isNavigationFailure } from '@cabloy/vue-router';\nimport { BeanSimple, cast } from 'zova';\nimport { createSsrNavigationSync } from './lib/ssrNavigation.js';\nimport { useMeta } from './lib/useMeta.js';\nexport class Monkey extends BeanSimple {\n appContextInitialize(ctx) {\n ctx.meta.$ssr = ctx.app.ctx.meta.$ssr;\n if (process.env.CLIENT) {\n ctx.meta.$ssr.handleDirectOrOnHydrated(() => {\n if (!ctx.disposed) {\n ctx.meta.hooks.invokeHook('hydrated');\n }\n });\n }\n if (process.env.SERVER) {\n ctx.meta.$ssr._registerServerContext(ctx);\n }\n }\n controllerLoad(event) {\n event.ctx.meta.$ssr.controllerLoad(event);\n }\n async appInitialize() {\n this.app.meta.event.on('a-router:routerGuards', async (router, next) => {\n if (process.env.CLIENT) {\n const navigationSync = createSsrNavigationSync({\n getLocale: () => this.app.meta.locale.current,\n setLocale: locale => {\n this.app.meta.locale.current = locale;\n },\n setProfile: route => {\n this.ctx.meta.$ssr._setProfile(route.meta.ssrProfile, route.meta.ssrProfileOptions, route.meta.locale);\n },\n setRouteLocale: route => {\n this.ctx.meta.$ssr._setLocale(route);\n }\n });\n router.beforeEach(to => {\n navigationSync.beforeEach(to);\n });\n router.afterEach((to, from, failure) => {\n navigationSync.afterEach(to, from, failure);\n });\n }\n return await next();\n });\n if (process.env.CLIENT && this.ctx.meta.$ssr.isRuntimeSsrPreHydration) {\n this.ctx.meta.$ssr.onHydrated(() => {\n document.documentElement.setAttribute('data-zova-hydrated', this.sys.env.SITE_ID);\n });\n }\n // ssr errorHandler\n if (process.env.SERVER) {\n this._ssrErrorHandler();\n }\n }\n async moduleLoading(_module) {}\n async moduleLoaded(module) {\n // ssrContext.modules\n if (process.env.SERVER && process.env.PROD) {\n if (!this.ctx.meta.$ssr.context.modules) this.ctx.meta.$ssr.context.modules = new Set();\n this.ctx.meta.$ssr.context.modules.add(`@@${module.info.relativeName}`);\n }\n }\n async beanInit(bean, beanInstance) {\n // eslint-disable-next-line\n const self = this;\n // $ssr\n bean.defineProperty(beanInstance, '$ssr', {\n enumerable: false,\n configurable: true,\n get() {\n return self.app.ctx.meta.$ssr;\n }\n });\n // $useMeta\n bean.defineProperty(beanInstance, '$useMeta', {\n enumerable: false,\n configurable: true,\n get() {\n return function (options) {\n const ctx = cast(this).ctx;\n ctx.util.instanceScope(() => {\n useMeta(ctx, options);\n });\n };\n }\n });\n }\n _ssrErrorHandler() {\n if (!process.env.SERVER) return;\n const _eventErrorHandler = this.app.meta.event.on('app:errorHandler', (data, next) => {\n const err = next();\n if (data.load?.kind === 'controller-load') {\n if (_isLoadErrorHandledServer(data.err)) {\n data.load.disposition = 'handled';\n if (!err || !(err instanceof Error)) return err;\n return this._errorHandlerDefaultServer(err);\n }\n return err;\n }\n if (!err || !(err instanceof Error)) return err;\n return this._errorHandlerDefaultServer(err);\n });\n this.ctx.meta.$ssr.context.onRendered(_err => {\n _eventErrorHandler();\n });\n }\n _errorHandlerDefaultServer(err) {\n if (!process.env.SERVER) return err;\n if (isNavigationFailure(err)) {\n if (!this.ctx.meta.$ssr.renderSSRError) {\n this.ctx.meta.$ssr.renderSSRError = err;\n }\n return undefined;\n } else if (err.code === 401) {\n try {\n this.app.$gotoLogin();\n } catch (err) {\n this.ctx.meta.$ssr.renderSSRError = err;\n }\n } else {\n this.ctx.meta.$ssr.renderSSRError = err;\n }\n return undefined;\n }\n}\nfunction _isLoadErrorHandledServer(err) {\n return isNavigationFailure(err) || [301, 302, 401].includes(Number(err.code));\n}","import * as devalue from 'devalue';\nexport function unevalPatch(value) {\n return devalue.uneval(value);\n // return devalue.uneval(value, value => {\n // if (value && typeof value === 'object' && value.toJSON) {\n // return value.toJSON();\n // }\n // });\n}","// from: quasar/ui/src/plugins/Meta.js\nimport { extend } from '@cabloy/extend';\nimport { BeanSimple, cast } from 'zova';\nimport { unevalPatch } from './utils.js';\nexport class CtxSSRMetaStore extends BeanSimple {\n constructor(...args) {\n super(...args);\n this._updateId = 0;\n this._currentClientMeta = void 0;\n this._clientList = [];\n }\n __init__() {\n if (process.env.SERVER) {\n const ssrContext = this.ctx.meta.$ssr.context;\n ssrContext.__qMetaList = [];\n ssrContext.rendered = () => {\n this._onRenderedLast();\n ssrContext.rendered = () => {};\n };\n }\n if (process.env.CLIENT && this.ctx.meta.$ssr.isRuntimeSsrPreHydration) {\n this._currentClientMeta = cast(window).__Q_META__;\n document.getElementById('ssr-meta-init')?.remove();\n }\n }\n _onRenderedLast(err) {\n const app = this.app;\n try {\n if (err) return;\n const ssrContext = this.ctx.meta.$ssr.context;\n this._injectContextState(ssrContext);\n this._injectContextStateDefer(ssrContext);\n this._injectServerMeta(ssrContext);\n } finally {\n this.ctx.meta.$ssr._disposeServerContexts();\n app?.close();\n }\n }\n addMetaOptions(metaOptionsWrapper) {\n this._clientList.push(metaOptionsWrapper);\n }\n removeMetaOptions(metaOptionsWrapper) {\n this._clientList.splice(this._clientList.indexOf(metaOptionsWrapper), 1);\n }\n planClientUpdate() {\n if (this._updateId !== 0) {\n clearTimeout(this._updateId);\n }\n this._updateId = window.setTimeout(() => {\n this._updateId = 0;\n this._updateClientMeta();\n }, 50);\n }\n _updateClientMeta() {\n const data = {\n title: '',\n titleTemplate: undefined,\n meta: {},\n link: {},\n script: {},\n htmlAttr: {},\n bodyAttr: {}\n };\n for (let i = 0; i < this._clientList.length; i++) {\n const {\n active,\n val\n } = this._clientList[i];\n if (active === true) {\n extend(true, data, val);\n }\n }\n normalize(data);\n apply(diff(this._currentClientMeta, data));\n this._currentClientMeta = data;\n }\n _injectServerMeta(ssrContext) {\n const data = {\n title: '',\n titleTemplate: undefined,\n meta: {},\n link: {},\n htmlAttr: {},\n bodyAttr: {},\n bodyStyle: {},\n bodyClass: {},\n noscript: {}\n };\n const list = ssrContext.__qMetaList;\n for (let i = 0; i < list.length; i++) {\n extend(true, data, list[i]);\n }\n normalize(data);\n const nonce = ssrContext.nonce !== void 0 ? ` nonce=\"${ssrContext.nonce}\"` : '';\n const ctx = ssrContext._meta;\n const htmlAttr = Object.keys(data.htmlAttr).filter(htmlFilter);\n if (htmlAttr.length !== 0) {\n ctx.htmlAttrs += (ctx.htmlAttrs.length !== 0 ? ' ' : '') + htmlAttr.map(getAttr(data.htmlAttr)).join(' ');\n }\n ctx.headTags += getHead(data);\n const bodyAttr = Object.keys(data.bodyAttr).filter(bodyFilter);\n if (bodyAttr.length !== 0) {\n ctx.bodyAttrs += (ctx.bodyAttrs.length !== 0 ? ' ' : '') + bodyAttr.map(getAttr(data.bodyAttr)).join(' ');\n }\n const bodyStyle = Object.keys(data.bodyStyle).filter(name => !!data.bodyStyle[name]).map(name => `${name}:${data.bodyStyle[name]};`).join('');\n if (bodyStyle) {\n ctx.bodyAttrs += `${ctx.bodyAttrs.length !== 0 ? ' ' : ''}style=\"${bodyStyle}\"`;\n }\n const _bodyClass = ctx.bodyClasses.split(' ').filter(item => !!item);\n const bodyClass = {};\n _bodyClass.forEach(item => bodyClass[item] = true);\n extend(true, bodyClass, data.bodyClass);\n ctx.bodyClasses = Object.keys(bodyClass).filter(name => bodyClass[name]).map(name => name).join(' ');\n data.title = '\\'\"`';\n ctx.endingHeadTags += `${Object.keys(data.noscript).map(name => `<noscript data-qmeta=\"${name}\">${data.noscript[name]}</noscript>`).join('')}<script${nonce} id=\"ssr-meta-init\">window.__Q_META__=${delete data.bodyStyle && delete data.bodyClass && delete data.noscript && unevalPatch(data)}</script>`;\n const cookieTheme = this.ctx.meta.$ssr.profileOptions.useCookie;\n let ssr_local_themedark = cookieTheme ? `let ssr_cookie_themedark=document.cookie.split('; ')?.find(item=>item.indexOf('themedark=')>-1)?.split('=')[1];\n ssr_cookie_themedark=ssr_cookie_themedark==='true'?true:ssr_cookie_themedark==='false'?false:${this.sys.env.SSR_COOKIE_THEMEDARK_DEFAULT};\n window.ssr_themedark=window.ssr_cookie_themedark=ssr_cookie_themedark;` : `let ssr_local_themedark=window.ssr_load_local('themedark');\n if(ssr_local_themedark===undefined || ssr_local_themedark==='auto'){\n ssr_local_themedark=window.matchMedia('(prefers-color-scheme: dark)').matches;\n }\n window.ssr_themedark=window.ssr_local_themedark=ssr_local_themedark;`;\n // Resolve the final browser theme from the SSR dual markers emitted before page render.\n ssr_local_themedark += `Object.defineProperty(window, 'ssr_themedark_data', {\n get: () => {\n let _data=document.body.getAttribute('data-ssr-theme-dark-'+window.ssr_themedark);\n if(_data===undefined || _data===null){\n _data=window.__INITIAL_STATE__ && window.__INITIAL_STATE__['data-ssr-theme-dark-'+window.ssr_themedark];\n }\n return _data;\n },\n });`;\n const ssr_local_themename = cookieTheme ? '' : `window.ssr_local_themename=window.ssr_load_local('themename','${this.sys.env.STYLE_DEFAULT_THEME}');`;\n ctx.endingHeadTags += `<script id=\"ssr-prefers-color-schema-dark\">\n window.ssr_load_local=function(key,defaultValue){\n const __ssr_local=localStorage.getItem(key);\n const value=__ssr_local?JSON.parse(__ssr_local):undefined;\n return value??defaultValue;\n };\n ${ssr_local_themedark}\n ${ssr_local_themename}\n document.querySelector('#ssr-prefers-color-schema-dark').remove();\n </script>`.replaceAll('\\n', '');\n }\n _injectContextState(ssrContext) {\n const ctx = ssrContext._meta;\n const nonce = ssrContext.nonce !== void 0 ? ` nonce=\"${ssrContext.nonce}\"` : '';\n ctx.endingHeadTags += `<script${nonce} id=\"ssr-state-init\">window.__INITIAL_STATE__=${unevalPatch(ssrContext.state)}</script>`;\n }\n _injectContextStateDefer(ssrContext) {\n const ctx = ssrContext._meta;\n const nonce = ssrContext.nonce !== void 0 ? ` nonce=\"${ssrContext.nonce}\"` : '';\n ctx.endingBodyTags += `<script${nonce} id=\"ssr-state-defer-init\">window.__INITIAL_STATE_DEFER__=${unevalPatch(ssrContext.stateDefer)}</script>`;\n }\n}\nfunction normalize(meta) {\n if (meta.title) {\n meta.title = meta.titleTemplate ? meta.titleTemplate(meta.title) : meta.title;\n delete meta.titleTemplate;\n }\n [['meta', 'content'], ['link', 'href']].forEach(type => {\n const metaType = meta[type[0]];\n const metaProp = type[1];\n for (const name in metaType) {\n const metaLink = metaType[name];\n if (metaLink.template) {\n if (Object.keys(metaLink).length === 1) {\n delete metaType[name];\n } else {\n metaLink[metaProp] = metaLink.template(metaLink[metaProp] || '');\n delete metaLink.template;\n }\n }\n }\n });\n}\nfunction changed(old, def) {\n if (Object.keys(old).length !== Object.keys(def).length) {\n return true;\n }\n for (const key in old) {\n if (old[key] !== def[key]) {\n return true;\n }\n }\n}\nfunction bodyFilter(name) {\n return ['class', 'style'].includes(name) === false;\n}\nfunction htmlFilter(_name) {\n return true;\n // return ['lang', 'dir'].includes(name) === false;\n}\nfunction diff(meta, other) {\n const add = {};\n const remove = {};\n if (meta === void 0) {\n return {\n add: other,\n remove\n };\n }\n if (meta.title !== other.title) {\n add.title = other.title;\n }\n ['meta', 'link', 'script', 'htmlAttr', 'bodyAttr'].forEach(type => {\n const old = meta[type];\n const cur = other[type];\n remove[type] = [];\n if (old === void 0 || old === null) {\n add[type] = cur;\n return;\n }\n add[type] = {};\n for (const key in old) {\n if (Object.prototype.hasOwnProperty.call(cur, key) === false) {\n remove[type].push(key);\n }\n }\n for (const key in cur) {\n if (Object.prototype.hasOwnProperty.call(old, key) === false) {\n add[type][key] = cur[key];\n } else if (changed(old[key], cur[key]) === true) {\n remove[type].push(key);\n add[type][key] = cur[key];\n }\n }\n });\n return {\n add,\n remove\n };\n}\nfunction apply({\n add,\n remove\n}) {\n if (add.title) {\n document.title = add.title;\n }\n if (Object.keys(remove).length !== 0) {\n ['meta', 'link', 'script'].forEach(type => {\n remove[type].forEach(name => {\n document.head.querySelector(`${type}[data-qmeta=\"${name}\"]`)?.remove();\n });\n });\n remove.htmlAttr.filter(htmlFilter).forEach(name => {\n document.documentElement.removeAttribute(name);\n });\n remove.bodyAttr.filter(bodyFilter).forEach(name => {\n document.body.removeAttribute(name);\n });\n }\n ['meta', 'link', 'script'].forEach(type => {\n const metaType = add[type];\n for (const name in metaType) {\n const tag = document.createElement(type);\n for (const att in metaType[name]) {\n if (att !== 'innerHTML') {\n tag.setAttribute(att, metaType[name][att]);\n }\n }\n tag.setAttribute('data-qmeta', name);\n if (type === 'script') {\n tag.innerHTML = metaType[name].innerHTML || '';\n }\n document.head.appendChild(tag);\n }\n });\n Object.keys(add.htmlAttr).filter(htmlFilter).forEach(name => {\n document.documentElement.setAttribute(name, add.htmlAttr[name] || '');\n });\n Object.keys(add.bodyAttr).filter(bodyFilter).forEach(name => {\n document.body.setAttribute(name, add.bodyAttr[name] || '');\n });\n}\nfunction getAttr(seed) {\n return att => {\n const val = seed[att];\n return att + (val !== true && val !== void 0 ? `=\"${val}\"` : '');\n };\n}\nfunction getHead(meta) {\n let output = '';\n if (meta.title) {\n output += `<title>${meta.title}</title>`;\n }\n ['meta', 'link', 'script'].forEach(type => {\n const metaType = meta[type];\n for (const att in metaType) {\n const attrs = Object.keys(metaType[att]).filter(att => att !== 'innerHTML').map(getAttr(metaType[att]));\n output += `<${type} ${attrs.join(' ')} data-qmeta=\"${att}\">`;\n if (type === 'script') {\n output += `${metaType[att].innerHTML || ''}</script>`;\n }\n }\n });\n return output;\n}","export function resolveSsrProfile(routeProfile, defaultProfile) {\n const ssrProfile = routeProfile ?? defaultProfile ?? 'public';\n if (ssrProfile !== 'public' && ssrProfile !== 'session') {\n throw new Error(`invalid SSR profile: ${ssrProfile}`);\n }\n return ssrProfile;\n}\nexport function resolveSsrProfileOptions(ssrProfile, profiles, routeProfileOptions, metaLocale) {\n const profileOptions = profiles[ssrProfile];\n if (!profileOptions) {\n throw new Error(`invalid SSR profile: ${ssrProfile}`);\n }\n const responseCache = routeProfileOptions?.responseCache ?? (ssrProfile === 'public' && metaLocale !== true ? {\n expires: 0\n } : profileOptions.responseCache);\n return Object.freeze({\n useCookie: ssrProfile === 'session' && profileOptions.useCookie,\n responseCache: responseCache === false ? false : Object.freeze({\n ...responseCache\n })\n });\n}","import { includeBooleanAttr, isBooleanAttr, isString, stringifyStyle } from '@vue/shared';\nimport { defu } from 'defu';\nimport { normalizeClass, normalizeStyle, ref, useSSRContext } from 'vue';\nimport { BeanSimple } from 'zova';\nimport { CtxSSRMetaStore } from './ssrMetaStore.js';\nimport { resolveSsrProfile, resolveSsrProfileOptions } from './ssrProfile.js';\nconst SymbolIsRuntimeSsrPreHydration = Symbol('SymbolIsRuntimeSsrPreHydration');\nconst SymbolSSRContext = Symbol('SymbolSSRContext');\nconst SymbolSSRState = Symbol('SymbolSSRState');\nconst SymbolOnHydrateds = Symbol('SymbolOnHydrateds');\nconst SymbolOnHydratePropHasMismatches = Symbol('SymbolOnHydratePropHasMismatches');\nconst SymbolInstanceUpdates = Symbol('SymbolInstanceUpdates');\nconst SymbolHydratingCounter = Symbol('SymbolHydratingCounter');\nconst SymbolServerContexts = Symbol('SymbolServerContexts');\nexport class CtxSSR extends BeanSimple {\n constructor(...args) {\n super(...args);\n this[SymbolIsRuntimeSsrPreHydration] = ref(false);\n this[SymbolSSRContext] = void 0;\n this[SymbolSSRState] = void 0;\n this[SymbolOnHydrateds] = [];\n this[SymbolOnHydratePropHasMismatches] = [];\n this[SymbolInstanceUpdates] = [];\n this[SymbolHydratingCounter] = 0;\n this[SymbolServerContexts] = new Set();\n this._controllerLoadSequence = {};\n this.metaStore = void 0;\n }\n /** @internal */\n initialize() {\n if (process.env.SERVER) {\n this._serverContextRegister();\n }\n // ssr state\n this[SymbolSSRState] = this.sys.bean._getBeanSyncOnly('a-ssr.sys.ssrState');\n // SymbolIsRuntimeSsrPreHydration\n if (process.env.SERVER) {\n this[SymbolIsRuntimeSsrPreHydration].value = true;\n } else if (process.env.CLIENT && document.body.getAttribute('data-server-rendered') !== null) {\n this[SymbolIsRuntimeSsrPreHydration].value = true;\n }\n // onHydratePropHasMismatch\n if (process.env.CLIENT && this.isRuntimeSsrPreHydration) {\n this.onHydratePropHasMismatch((el, key, clientValue, vnode, instance) => {\n return this._onHydratePropHasMismatchDefault(el, key, clientValue, vnode, instance);\n });\n }\n // metaStore\n this.metaStore = this.bean._newBeanSimple(CtxSSRMetaStore, false);\n // fix: flash on page load\n // need not check process.env.DEV, because maybe need remove vite-css-module-id on prod\n if (process.env.CLIENT && this.isRuntimeSsrPreHydration) {\n this.onHydrated(() => {\n document.querySelectorAll('style[vite-css-module-id]').forEach(node => node.remove());\n });\n }\n }\n _serverContextRegister(currentContext = this.ctx) {\n const serverContexts = this[SymbolServerContexts];\n serverContexts.add(currentContext);\n this.context.onRendered(() => {\n serverContexts.delete(currentContext);\n });\n }\n _serverContextsDispose() {\n const serverContexts = this[SymbolServerContexts];\n for (const serverContext of serverContexts) {\n if (serverContext.disposed) continue;\n if (serverContext.bean && serverContext.bean !== serverContext.app?.bean) {\n serverContext.bean.dispose();\n }\n serverContext.dispose();\n }\n serverContexts.clear();\n }\n get isRuntimeSsrPreHydration() {\n return this[SymbolIsRuntimeSsrPreHydration].value;\n }\n get isRuntimeSsrHydrated() {\n return process.env.CLIENT && !this.isRuntimeSsrPreHydration;\n }\n set isRuntimeSsrPreHydration(value) {\n this[SymbolIsRuntimeSsrPreHydration].value = value;\n }\n get context() {\n if (process.env.CLIENT) throw new Error('cannot called in client');\n if (!this[SymbolSSRContext]) {\n this.ctx.util.instanceScope(() => {\n this[SymbolSSRContext] = useSSRContext();\n this._initContext();\n });\n }\n return this[SymbolSSRContext];\n }\n get state() {\n if (process.env.SERVER) {\n return this.context.state;\n } else {\n return this[SymbolSSRState].state;\n }\n }\n get stateDefer() {\n if (process.env.SERVER) {\n return this.context.stateDefer;\n } else {\n return this[SymbolSSRState].stateDefer;\n }\n }\n\n /** @internal */\n controllerLoad(event) {\n if (event.phase === 'prepare') {\n if (process.env.SERVER) {\n event.ctx.meta.state.controllerLoadKey = this._allocateControllerLoadKey(event);\n return;\n }\n if (!process.env.CLIENT || !this.isRuntimeSsrPreHydration) return;\n const key = this._allocateControllerLoadKey(event);\n const snapshot = this.stateDefer.controllerLoad?.[key];\n if (!snapshot || snapshot.version !== 1 || snapshot.controllerBeanName !== event.controllerBeanName) {\n return;\n }\n delete this.stateDefer.controllerLoad[key];\n event.replayError = _createControllerLoadError(snapshot);\n event.replayControllerRecorded = snapshot.controllerRecorded;\n return;\n }\n if (event.phase !== 'fallback' || !process.env.SERVER || !event.error) return;\n const key = event.ctx.meta.state.controllerLoadKey;\n if (!key) return;\n const controllerLoad = this.stateDefer.controllerLoad ??= {};\n controllerLoad[key] = _createControllerLoadErrorSnapshot(event);\n }\n _allocateControllerLoadKey(event) {\n const instance = event.ctx.instance;\n const parts = [];\n let current = instance;\n while (current) {\n const componentType = current.type;\n const name = componentType.__file ?? componentType.name ?? componentType.__name ?? 'anonymous';\n const key = current.vnode.key ?? '';\n parts.unshift(`${name}:${String(key)}`);\n current = current.parent;\n }\n const structuralKey = parts.join('/');\n const occurrence = this._controllerLoadSequence[structuralKey] ?? 0;\n this._controllerLoadSequence[structuralKey] = occurrence + 1;\n return `${structuralKey}#${occurrence}:${event.controllerBeanName ?? ''}`;\n }\n get profile() {\n return resolveSsrProfile(this.state.ssrProfile, this.sys.env.SSR_PROFILE);\n }\n get profileOptions() {\n const profileOptions = this.state.ssrProfileOptions;\n if (profileOptions) return profileOptions;\n return resolveSsrProfileOptions(this.profile, this.sys.config.ssr.profiles);\n }\n\n /** @internal */\n _setProfile(routeProfile, routeProfileOptions, metaLocale) {\n const ssrProfile = resolveSsrProfile(routeProfile, this.sys.env.SSR_PROFILE);\n const ssrProfileOptions = resolveSsrProfileOptions(ssrProfile, this.sys.config.ssr.profiles, routeProfileOptions, metaLocale);\n this.state.ssrProfile = ssrProfile;\n this.state.ssrProfileOptions = ssrProfileOptions;\n }\n\n /** @internal */\n _setLocale(route) {\n if (route.meta.locale) {\n this.app.meta.locale.current = route.params?.locale;\n }\n }\n get cookieDisabledOnServer() {\n return process.env.SERVER && !this.profileOptions.useCookie;\n }\n get renderSSRError() {\n return this.context._meta.renderError;\n }\n set renderSSRError(err) {\n this.context._meta.renderError = err;\n }\n getPerformAction(baseURL) {\n if (process.env.SERVER && baseURL === this.sys.env.SSR_API_BASE_URL) return this.context.performAction;\n return undefined;\n }\n _initContext() {\n const ssrContext = this[SymbolSSRContext];\n ssrContext._meta = defu(ssrContext._meta, {\n htmlAttrs: '',\n headTags: '',\n endingHeadTags: '',\n bodyClasses: '',\n bodyAttrs: 'data-server-rendered',\n bodyTags: '',\n endingBodyTags: '',\n baseUrl: this.sys.util.getAbsoluteUrlFromPagePath(undefined, false, true) // not include publicPath\n });\n ssrContext.state = ssrContext.state || {};\n ssrContext.stateDefer = ssrContext.stateDefer || {};\n }\n\n /**\n * Registers a callback that runs after initial client SSR hydration completes.\n * It does not run for SPA startup or later client navigation.\n */\n onHydrated(fn) {\n this[SymbolOnHydrateds].push(fn);\n }\n onHydratePropHasMismatch(fn) {\n this[SymbolOnHydratePropHasMismatches].push(fn);\n }\n handleDirectOrOnHydrated(fn) {\n if (!process.env.CLIENT) return;\n if (this.isRuntimeSsrPreHydration) {\n this.onHydrated(fn);\n } else {\n return fn();\n }\n }\n _onHydratePropHasMismatchDefault(el, key, clientValue, _vnode, _instance) {\n // expected\n let ignore = false;\n let expected;\n if (key === 'class') {\n ignore = true;\n if (clientValue !== undefined) {\n expected = normalizeClass(clientValue);\n el.setAttribute(key, expected);\n }\n } else if (key === 'style') {\n ignore = true;\n if (clientValue !== undefined) {\n expected = isString(clientValue) ? clientValue : stringifyStyle(normalizeStyle(clientValue));\n el.setAttribute(key, expected);\n }\n } else if (['id', 'name', 'for', 'd', 'aria-labelledby', 'aria-controls'].includes(key)) {\n ignore = true;\n if (clientValue !== undefined) {\n expected = String(clientValue);\n el.setAttribute(key, expected);\n }\n } else if (key === 'value') {\n ignore = true;\n if (clientValue !== undefined) {\n expected = String(clientValue);\n if (el.tagName === 'TEXTAREA') {\n el.value = expected;\n } else {\n el.setAttribute(key, expected);\n }\n }\n } else if (isBooleanAttr(key)) {\n ignore = true;\n if (clientValue !== undefined) {\n const expected = includeBooleanAttr(clientValue);\n if (expected) {\n el.setAttribute(key, '');\n } else {\n el.removeAttribute(key);\n }\n }\n } else if (el.getAttribute(`data-hydrate-ignore-${key}`) !== null) {\n ignore = true;\n if (clientValue !== undefined) {\n expected = String(clientValue);\n el.setAttribute(key, expected);\n }\n }\n if (!ignore) return {\n clientValue\n };\n return {\n ignore: true\n };\n }\n _hydrated() {\n if (!this.isRuntimeSsrPreHydration) return;\n // should be first\n this.isRuntimeSsrPreHydration = false;\n //\n this[SymbolInstanceUpdates].forEach(instance => {\n if (!instance.isUnmounted && instance.zova) {\n try {\n instance.update();\n } catch (err) {\n if (!err.message.includes(\"'insertBefore'\")) {\n throw err;\n }\n }\n }\n });\n this[SymbolInstanceUpdates] = [];\n //\n this[SymbolOnHydrateds].forEach(fn => fn());\n this[SymbolOnHydrateds] = [];\n //\n this[SymbolOnHydratePropHasMismatches] = [];\n }\n\n /** @internal */\n _hydratePropHasMismatch(el, key, clientValue, vnode, instance) {\n for (const fn of this[SymbolOnHydratePropHasMismatches]) {\n const res = fn(el, key, clientValue, vnode, instance);\n if (res.ignore) return res;\n clientValue = res.clientValue;\n }\n return {\n ignore: false,\n clientValue\n };\n }\n\n /** @internal */\n _hydratingRootInc() {\n if (process.env.CLIENT && this.isRuntimeSsrPreHydration) {\n this._hydratingInc();\n }\n }\n\n /** @internal */\n _hydratingRootDec() {\n if (process.env.CLIENT && this.isRuntimeSsrPreHydration) {\n this._hydratingDec();\n }\n }\n\n /** @internal */\n _hydratingInc() {\n ++this[SymbolHydratingCounter];\n }\n\n /** @internal */\n _hydratingDec() {\n if (--this[SymbolHydratingCounter] === 0) {\n this._hydrated();\n }\n }\n\n /** @internal */\n _hydratingInstanceRecord(instance) {\n if (!this[SymbolInstanceUpdates].includes(instance)) {\n this[SymbolInstanceUpdates].push(instance);\n return true;\n }\n return false;\n }\n\n /** @internal */\n _registerServerContext(currentContext) {\n this._serverContextRegister(currentContext);\n }\n\n /** @internal */\n _disposeServerContexts() {\n this._serverContextsDispose();\n }\n}\nfunction _createControllerLoadErrorSnapshot(event) {\n const error = event.error;\n const snapshot = {\n version: 1,\n controllerBeanName: event.controllerBeanName,\n name: error.name || 'Error',\n message: error.message || String(error),\n controllerRecorded: event.controllerRecorded === true\n };\n for (const key of ['code', 'status']) {\n if (typeof error[key] === 'number' || typeof error[key] === 'string') {\n snapshot[key] = error[key];\n }\n }\n for (const key of ['pagePath', 'url']) {\n if (typeof error[key] === 'string') {\n snapshot[key] = error[key];\n }\n }\n return snapshot;\n}\nfunction _createControllerLoadError(snapshot) {\n const error = new Error(snapshot.message);\n error.name = snapshot.name;\n for (const key of ['code', 'status', 'pagePath', 'url']) {\n if (snapshot[key] !== undefined) {\n error[key] = snapshot[key];\n }\n }\n return error;\n}","import { BeanSimple } from 'zova';\nimport { CtxSSR } from './lib/ssr.js';\nexport class MonkeySys extends BeanSimple {\n constructor(moduleSelf) {\n super();\n this._moduleSelf = void 0;\n this._sysSsrState = void 0;\n this._moduleSelf = moduleSelf;\n }\n async getSysSsrState() {\n if (!this._sysSsrState) {\n this._sysSsrState = await this.bean._getBean('a-ssr.sys.ssrState', false);\n }\n return this._sysSsrState;\n }\n async moduleLoading(module) {\n if (this._moduleSelf === module) return;\n await this.getSysSsrState();\n }\n async moduleLoaded(_module) {}\n async configLoaded(_module, _config) {}\n sysContextInitialize(ctx) {\n ctx.meta.$ssr = ctx.bean._newBeanSimple(CtxSSR, false);\n ctx.meta.$ssr.initialize();\n }\n}","var _dec, _dec2, _class;\nimport { \"BeanInfo\" as __z_BeanInfo } from \"zova\";\n// eslint-disable\n/** sys: begin */\nexport * from '../bean/sys.ssrState.js';\nimport 'zova';\n/** sys: end */\n/** sys: begin */\nimport { SysSsrState } from '../bean/sys.ssrState.js';\nimport 'zova';\n/** sys: end */\n/** config: begin */\nexport * from '../config/config.js';\n/** config: end */\n/** monkey: begin */\nexport * from '../monkey.js';\n/** monkey: end */\n/** monkeySys: begin */\nexport * from '../monkeySys.js';\n/** monkeySys: end */\n/** scope: begin */\nimport { BeanScopeBase } from 'zova';\nimport { Scope } from 'zova-module-a-bean';\nexport let ScopeModuleASsr = (_dec = Scope(), _dec2 = __z_BeanInfo({\n module: \"a-ssr\"\n}), _dec(_class = _dec2(_class = class ScopeModuleASsr extends BeanScopeBase {}) || _class) || _class);\nimport 'zova';\n\n/** scope: end */","export function getBodyReadyObserverScript() {\n return `<script id=\"ssr-body-ready-observer\">\n window.ssr_bodyReadyObserverClear=()=>{\n window.ssr_body_ready_condition=undefined;\n window.ssr_body_ready_callback=undefined;\n window.ssr_bodyReadyObserver?.disconnect();\n window.ssr_bodyReadyObserver=undefined;\n document.body.style.display='block';\n document.querySelector('#ssr-body-ready-observer')?.remove();\n };\n window.ssr_bodyReadyObserver = new MutationObserver(() => {\n const __targets=window.ssr_body_ready_condition?.();\n if(__targets){\n try{\n window.ssr_body_ready_callback?.(__targets);\n }finally{\n window.ssr_bodyReadyObserverClear();\n }\n }\n });\n window.ssr_bodyReadyObserver.observe(document.body, {\n subtree: true,\n childList: true,\n });\n document.addEventListener(\"DOMContentLoaded\", () => {\n window.ssr_bodyReadyObserverClear();\n });\n </script>`.replaceAll('\\\\n', '');\n}"],"mappings":";;;;;;;;;AAAA,IAAI;AAAM,IAAA;AAAO,IAAA;AAIjB,IAAM,mBAAiB,OAAO,gBAAgB;AAC9C,IAAM,sBAAsB,OAAO,qBAAqB;AACxD,IAAW,eAAe,SAAO,IAAI,GAAG,UAAQ,SAAa,EAC3D,QAAQ,QACV,CAAC,GAAG,OAAK,WAAS,QAAM,WAAS,MAAM,oBAAoB,SAAS;CAClE,YAAY,GAAG,MAAM;EACnB,MAAM,GAAG,IAAI;EACb,KAAK,oBAAkB,KAAK;EAC5B,KAAK,uBAAuB,KAAK;CACnC;CACA,MAAM,WAAW;EACf,IAAI,QAAQ,IAAI,QAAQ;GACtB,IAAI,KAAK,MAAM,CAAC,CAAC,mBAAmB;IAClC,KAAK,oBAAkB,KAAK,MAAM,CAAC,CAAC;IACpC,OAAO,KA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C,MAAM,KAAK,eAAe;CAC5B;CACA,MAAM,aAAa,SAAS,CAAC;CAC7B,MAAM,aAAa,SAAS,SAAS,CAAC;CACtC,qBAAqB,KAAK;EACxB,IAAI,KAAK,OAAO,IAAI,KAAK,eAAe,QAAQ,KAAK;EACrD,IAAI,KAAK,KAAK,WAAW;CAC3B;AACF;;;;;ACzBA,IAAI;AAAM,IAAA;AAAO,IAAA;AAuBjB,IAAW,mBAAmB,OAAO,MAAM,GAAG,QAAQ,SAAa,EACjE,QAAQ,QACV,CAAC,GAAG,KAAK,SAAS,MAAM,SAAS,MAAM,wBAAwB,cAAc,CAAC,CAAC,KAAK,MAAM,KAAK;;;;ACzB/F,SAAgB,6BAA6B;CAC3C,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;kBA0BQ,WAAW,OAAO,EAAE;AACrC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bodyReadyObserver.d.ts","sourceRoot":"","sources":["../../src/lib/bodyReadyObserver.ts"],"names":[],"mappings":"AAAA,wBAAgB,0BAA0B,
|
|
1
|
+
{"version":3,"file":"bodyReadyObserver.d.ts","sourceRoot":"","sources":["../../src/lib/bodyReadyObserver.ts"],"names":[],"mappings":"AAAA,wBAAgB,0BAA0B,WA4BzC"}
|
package/dist/lib/ssr.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ export declare class CtxSSR extends BeanSimple {
|
|
|
19
19
|
private [SymbolInstanceUpdates];
|
|
20
20
|
private [SymbolHydratingCounter];
|
|
21
21
|
private [SymbolServerContexts];
|
|
22
|
+
private _controllerLoadSequence;
|
|
22
23
|
metaStore: CtxSSRMetaStore;
|
|
23
24
|
private _serverContextRegister;
|
|
24
25
|
private _serverContextsDispose;
|
|
@@ -28,6 +29,7 @@ export declare class CtxSSR extends BeanSimple {
|
|
|
28
29
|
get context(): SSRContext;
|
|
29
30
|
get state(): import("zova-module-a-ssr").SSRContextState;
|
|
30
31
|
get stateDefer(): import("zova-module-a-ssr").SSRContextStateDefer;
|
|
32
|
+
private _allocateControllerLoadKey;
|
|
31
33
|
get profile(): TypeSsrProfile;
|
|
32
34
|
get profileOptions(): Readonly<ISsrProfileOptions>;
|
|
33
35
|
get cookieDisabledOnServer(): boolean;
|
package/dist/lib/ssr.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ssr.d.ts","sourceRoot":"","sources":["../../src/lib/ssr.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"ssr.d.ts","sourceRoot":"","sources":["../../src/lib/ssr.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAoD,MAAM,MAAM,CAAC;AAM3F,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAGlC,OAAO,KAAK,EACV,kBAAkB,EAElB,wBAAwB,EAExB,UAAU,EAEV,cAAc,EACd,wBAAwB,EACzB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAGpD,QAAA,MAAM,8BAA8B,eAA2C,CAAC;AAChF,QAAA,MAAM,gBAAgB,eAA6B,CAAC;AACpD,QAAA,MAAM,cAAc,eAA2B,CAAC;AAChD,QAAA,MAAM,iBAAiB,eAA8B,CAAC;AACtD,QAAA,MAAM,gCAAgC,eAA6C,CAAC;AACpF,QAAA,MAAM,qBAAqB,eAAkC,CAAC;AAC9D,QAAA,MAAM,sBAAsB,eAAmC,CAAC;AAChE,QAAA,MAAM,oBAAoB,eAAiC,CAAC;AAE5D,qBAAa,MAAO,SAAQ,UAAU;IACpC,OAAO,CAAC,CAAC,8BAA8B,CAAC,CAA4B;IACpE,OAAO,CAAC,CAAC,gBAAgB,CAAC,CAAa;IACvC,OAAO,CAAC,CAAC,cAAc,CAAC,CAAc;IACtC,OAAO,CAAC,CAAC,iBAAiB,CAAC,CAAsB;IACjD,OAAO,CAAC,CAAC,gCAAgC,CAAC,CAAkC;IAC5E,OAAO,CAAC,CAAC,qBAAqB,CAAC,CAAmC;IAElE,OAAO,CAAC,CAAC,sBAAsB,CAAC,CAAa;IAC7C,OAAO,CAAC,CAAC,oBAAoB,CAAC,CAA+B;IAC7D,OAAO,CAAC,uBAAuB,CAA8B;IAEtD,SAAS,EAAE,eAAe,CAAC;IAgClC,OAAO,CAAC,sBAAsB;IAQ9B,OAAO,CAAC,sBAAsB;IAY9B,IAAI,wBAAwB,YAE3B;IAED,IAAI,oBAAoB,YAEvB;IAED,IAAI,wBAAwB,CAAC,KAAK,SAAA,EAEjC;IAED,IAAI,OAAO,eASV;IAED,IAAI,KAAK,gDAMR;IAED,IAAI,UAAU,qDAMb;IA+BD,OAAO,CAAC,0BAA0B;IAkBlC,IAAI,OAAO,IAAI,cAAc,CAE5B;IAED,IAAI,cAAc,IAAI,QAAQ,CAAC,kBAAkB,CAAC,CAIjD;IA0BD,IAAI,sBAAsB,IAAI,OAAO,CAEpC;IAED,IAAI,cAAc,IAIM,GAAG,CAF1B;IAED,IAAI,cAAc,CAAC,GAAG,EAAE,GAAG,EAE1B;IAED,gBAAgB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,wBAAwB,GAAG,SAAS;IAMxE,OAAO,CAAC,YAAY;IAgBpB;;;OAGG;IACH,UAAU,CAAC,EAAE,EAAE,YAAY;IAI3B,wBAAwB,CAAC,EAAE,EAAE,wBAAwB;IAIrD,wBAAwB,CAAC,EAAE,EAAE,YAAY;IASzC,OAAO,CAAC,gCAAgC;IA6DxC,OAAO,CAAC,SAAS;CAoFlB"}
|
package/dist/monkey.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { IModule } from '@cabloy/module-info';
|
|
2
|
-
import type { BeanBase, BeanContainer, IMonkeyAppContextInitialize, IMonkeyAppInitialize, IMonkeyBeanInit, IMonkeyModule, ZovaContext } from 'zova';
|
|
2
|
+
import type { BeanBase, BeanContainer, IControllerLoadEvent, IMonkeyAppContextInitialize, IMonkeyAppInitialize, IMonkeyBeanInit, IMonkeyModule, ZovaContext } from 'zova';
|
|
3
3
|
import { BeanSimple } from 'zova';
|
|
4
4
|
export declare class Monkey extends BeanSimple implements IMonkeyAppContextInitialize, IMonkeyAppInitialize, IMonkeyBeanInit, IMonkeyModule {
|
|
5
5
|
appContextInitialize(ctx: ZovaContext): void;
|
|
6
|
+
controllerLoad(event: IControllerLoadEvent): void;
|
|
6
7
|
appInitialize(): Promise<void>;
|
|
7
8
|
moduleLoading(_module: IModule): Promise<void>;
|
|
8
9
|
moduleLoaded(module: IModule): Promise<void>;
|
package/dist/monkey.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"monkey.d.ts","sourceRoot":"","sources":["../src/monkey.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,KAAK,EACV,QAAQ,EACR,aAAa,EACb,2BAA2B,EAC3B,oBAAoB,EACpB,eAAe,EACf,aAAa,EACb,WAAW,EACZ,MAAM,MAAM,CAAC;AAGd,OAAO,EAAE,UAAU,EAAQ,MAAM,MAAM,CAAC;AAOxC,qBAAa,MACX,SAAQ,UACR,YAAW,2BAA2B,EAAE,oBAAoB,EAAE,eAAe,EAAE,aAAa;IAE5F,oBAAoB,CAAC,GAAG,EAAE,WAAW,GAAG,IAAI;
|
|
1
|
+
{"version":3,"file":"monkey.d.ts","sourceRoot":"","sources":["../src/monkey.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,KAAK,EACV,QAAQ,EACR,aAAa,EACb,oBAAoB,EACpB,2BAA2B,EAC3B,oBAAoB,EACpB,eAAe,EACf,aAAa,EACb,WAAW,EACZ,MAAM,MAAM,CAAC;AAGd,OAAO,EAAE,UAAU,EAAQ,MAAM,MAAM,CAAC;AAOxC,qBAAa,MACX,SAAQ,UACR,YAAW,2BAA2B,EAAE,oBAAoB,EAAE,eAAe,EAAE,aAAa;IAE5F,oBAAoB,CAAC,GAAG,EAAE,WAAW,GAAG,IAAI;IAc5C,cAAc,CAAC,KAAK,EAAE,oBAAoB;IAIpC,aAAa;IAuCb,aAAa,CAAC,OAAO,EAAE,OAAO;IAC9B,YAAY,CAAC,MAAM,EAAE,OAAO;IAQ5B,QAAQ,CAAC,IAAI,EAAE,aAAa,EAAE,YAAY,EAAE,QAAQ;IA0B1D,OAAO,CAAC,gBAAgB;IAoBxB,OAAO,CAAC,0BAA0B;CAkBnC"}
|
package/dist/types/ssr.d.ts
CHANGED
|
@@ -55,7 +55,19 @@ export interface SSRContextState {
|
|
|
55
55
|
ssrProfile?: TypeSsrProfile;
|
|
56
56
|
ssrProfileOptions?: Readonly<ISsrProfileOptions>;
|
|
57
57
|
}
|
|
58
|
+
export interface SSRControllerLoadErrorSnapshot {
|
|
59
|
+
version: 1;
|
|
60
|
+
controllerBeanName?: string;
|
|
61
|
+
name: string;
|
|
62
|
+
message: string;
|
|
63
|
+
code?: number | string;
|
|
64
|
+
status?: number | string;
|
|
65
|
+
pagePath?: string;
|
|
66
|
+
url?: string;
|
|
67
|
+
controllerRecorded: boolean;
|
|
68
|
+
}
|
|
58
69
|
export interface SSRContextStateDefer {
|
|
70
|
+
controllerLoad?: Record<string, SSRControllerLoadErrorSnapshot>;
|
|
59
71
|
}
|
|
60
72
|
type SSRMetaTagOptions = Record<string, any> & {
|
|
61
73
|
template?: (attributeValue: string) => string;
|
package/dist/types/ssr.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ssr.d.ts","sourceRoot":"","sources":["../../src/types/ssr.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,KAAK,EAAE,MAAM,KAAK,CAAC;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,oBAAoB,EAAE,gCAAgC,EAAE,MAAM,MAAM,CAAC;AAElG,OAAO,KAA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,MAAM,CAAC;IACpB,UAAiB,OAAO;QACtB,IAAI,EAAE,MAAM,CAAC;KACd;IAED,UAAiB,QAAQ;QACvB,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,CAAC,OAAO,EAAE,cAAc,GAAG,CAAC,MAAM,cAAc,CAAC,GAAG,IAAI,CAAC;KAClE;CACF;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,cAAc,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,CAAC,GAAG,SAAS,CAAC;QAC9C,aAAa,EAAE,OAAO,CAAC;QACvB,oBAAoB,EAAE,OAAO,CAAC;QAC9B,mBAAmB,EAAE,OAAO,CAAC;QAC7B,mBAAmB,CAAC,EAAE,MAAM,CAAC;KAC9B;CACF"}
|
package/package.json
CHANGED
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
export function getBodyReadyObserverScript() {
|
|
2
2
|
return `<script id="ssr-body-ready-observer">
|
|
3
3
|
window.ssr_bodyReadyObserverClear=()=>{
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
document.querySelector('#ssr-body-ready-observer').remove();
|
|
11
|
-
}
|
|
4
|
+
window.ssr_body_ready_condition=undefined;
|
|
5
|
+
window.ssr_body_ready_callback=undefined;
|
|
6
|
+
window.ssr_bodyReadyObserver?.disconnect();
|
|
7
|
+
window.ssr_bodyReadyObserver=undefined;
|
|
8
|
+
document.body.style.display='block';
|
|
9
|
+
document.querySelector('#ssr-body-ready-observer')?.remove();
|
|
12
10
|
};
|
|
13
11
|
window.ssr_bodyReadyObserver = new MutationObserver(() => {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
const __targets=window.ssr_body_ready_condition?.();
|
|
13
|
+
if(__targets){
|
|
14
|
+
try{
|
|
15
|
+
window.ssr_body_ready_callback?.(__targets);
|
|
16
|
+
}finally{
|
|
17
|
+
window.ssr_bodyReadyObserverClear();
|
|
18
|
+
}
|
|
17
19
|
}
|
|
18
20
|
});
|
|
19
21
|
window.ssr_bodyReadyObserver.observe(document.body, {
|
package/src/lib/ssr.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ComponentInternalInstance, Ref, VNode } from 'vue';
|
|
2
|
-
import type { Functionable, ILocaleRecord, ZovaContext } from 'zova';
|
|
2
|
+
import type { Functionable, IControllerLoadEvent, ILocaleRecord, ZovaContext } from 'zova';
|
|
3
3
|
|
|
4
4
|
import { RouteLocationNormalizedGeneric, RouteLocationResolvedGeneric } from '@cabloy/vue-router';
|
|
5
5
|
import { includeBooleanAttr, isBooleanAttr, isString, stringifyStyle } from '@vue/shared';
|
|
@@ -14,6 +14,7 @@ import type {
|
|
|
14
14
|
OnHydratePropHasMismatch,
|
|
15
15
|
OnHydratePropHasMismatchResult,
|
|
16
16
|
SSRContext,
|
|
17
|
+
SSRControllerLoadErrorSnapshot,
|
|
17
18
|
TypeSsrProfile,
|
|
18
19
|
TypeSsrSitePerformAction,
|
|
19
20
|
} from '../types/ssr.js';
|
|
@@ -40,6 +41,7 @@ export class CtxSSR extends BeanSimple {
|
|
|
40
41
|
|
|
41
42
|
private [SymbolHydratingCounter]: number = 0;
|
|
42
43
|
private [SymbolServerContexts]: Set<ZovaContext> = new Set();
|
|
44
|
+
private _controllerLoadSequence: Record<string, number> = {};
|
|
43
45
|
|
|
44
46
|
public metaStore: CtxSSRMetaStore;
|
|
45
47
|
|
|
@@ -132,6 +134,53 @@ export class CtxSSR extends BeanSimple {
|
|
|
132
134
|
}
|
|
133
135
|
}
|
|
134
136
|
|
|
137
|
+
/** @internal */
|
|
138
|
+
public controllerLoad(event: IControllerLoadEvent) {
|
|
139
|
+
if (event.phase === 'prepare') {
|
|
140
|
+
if (process.env.SERVER) {
|
|
141
|
+
event.ctx.meta.state.controllerLoadKey = this._allocateControllerLoadKey(event);
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
if (!process.env.CLIENT || !this.isRuntimeSsrPreHydration) return;
|
|
145
|
+
const key = this._allocateControllerLoadKey(event);
|
|
146
|
+
const snapshot = this.stateDefer.controllerLoad?.[key];
|
|
147
|
+
if (
|
|
148
|
+
!snapshot ||
|
|
149
|
+
snapshot.version !== 1 ||
|
|
150
|
+
snapshot.controllerBeanName !== event.controllerBeanName
|
|
151
|
+
) {
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
delete this.stateDefer.controllerLoad![key];
|
|
155
|
+
event.replayError = _createControllerLoadError(snapshot);
|
|
156
|
+
event.replayControllerRecorded = snapshot.controllerRecorded;
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
if (event.phase !== 'fallback' || !process.env.SERVER || !event.error) return;
|
|
160
|
+
const key = event.ctx.meta.state.controllerLoadKey;
|
|
161
|
+
if (!key) return;
|
|
162
|
+
const controllerLoad = (this.stateDefer.controllerLoad ??= {});
|
|
163
|
+
controllerLoad[key] = _createControllerLoadErrorSnapshot(event);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
private _allocateControllerLoadKey(event: IControllerLoadEvent) {
|
|
167
|
+
const instance = event.ctx.instance;
|
|
168
|
+
const parts: string[] = [];
|
|
169
|
+
let current: ComponentInternalInstance | null = instance;
|
|
170
|
+
while (current) {
|
|
171
|
+
const componentType = current.type as any;
|
|
172
|
+
const name =
|
|
173
|
+
componentType.__file ?? componentType.name ?? componentType.__name ?? 'anonymous';
|
|
174
|
+
const key = current.vnode.key ?? '';
|
|
175
|
+
parts.unshift(`${name}:${String(key)}`);
|
|
176
|
+
current = current.parent;
|
|
177
|
+
}
|
|
178
|
+
const structuralKey = parts.join('/');
|
|
179
|
+
const occurrence = this._controllerLoadSequence[structuralKey] ?? 0;
|
|
180
|
+
this._controllerLoadSequence[structuralKey] = occurrence + 1;
|
|
181
|
+
return `${structuralKey}#${occurrence}:${event.controllerBeanName ?? ''}`;
|
|
182
|
+
}
|
|
183
|
+
|
|
135
184
|
get profile(): TypeSsrProfile {
|
|
136
185
|
return resolveSsrProfile(this.state.ssrProfile, this.sys.env.SSR_PROFILE);
|
|
137
186
|
}
|
|
@@ -367,3 +416,38 @@ export class CtxSSR extends BeanSimple {
|
|
|
367
416
|
this._serverContextsDispose();
|
|
368
417
|
}
|
|
369
418
|
}
|
|
419
|
+
|
|
420
|
+
function _createControllerLoadErrorSnapshot(
|
|
421
|
+
event: IControllerLoadEvent,
|
|
422
|
+
): SSRControllerLoadErrorSnapshot {
|
|
423
|
+
const error = event.error! as any;
|
|
424
|
+
const snapshot: SSRControllerLoadErrorSnapshot = {
|
|
425
|
+
version: 1,
|
|
426
|
+
controllerBeanName: event.controllerBeanName,
|
|
427
|
+
name: error.name || 'Error',
|
|
428
|
+
message: error.message || String(error),
|
|
429
|
+
controllerRecorded: event.controllerRecorded === true,
|
|
430
|
+
};
|
|
431
|
+
for (const key of ['code', 'status']) {
|
|
432
|
+
if (typeof error[key] === 'number' || typeof error[key] === 'string') {
|
|
433
|
+
snapshot[key] = error[key];
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
for (const key of ['pagePath', 'url']) {
|
|
437
|
+
if (typeof error[key] === 'string') {
|
|
438
|
+
snapshot[key] = error[key];
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
return snapshot;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
function _createControllerLoadError(snapshot: SSRControllerLoadErrorSnapshot) {
|
|
445
|
+
const error = new Error(snapshot.message);
|
|
446
|
+
error.name = snapshot.name;
|
|
447
|
+
for (const key of ['code', 'status', 'pagePath', 'url']) {
|
|
448
|
+
if (snapshot[key] !== undefined) {
|
|
449
|
+
(error as any)[key] = snapshot[key];
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
return error;
|
|
453
|
+
}
|
package/src/monkey.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type { IModule } from '@cabloy/module-info';
|
|
|
2
2
|
import type {
|
|
3
3
|
BeanBase,
|
|
4
4
|
BeanContainer,
|
|
5
|
+
IControllerLoadEvent,
|
|
5
6
|
IMonkeyAppContextInitialize,
|
|
6
7
|
IMonkeyAppInitialize,
|
|
7
8
|
IMonkeyBeanInit,
|
|
@@ -23,11 +24,22 @@ export class Monkey
|
|
|
23
24
|
{
|
|
24
25
|
appContextInitialize(ctx: ZovaContext): void {
|
|
25
26
|
ctx.meta.$ssr = ctx.app.ctx.meta.$ssr;
|
|
27
|
+
if (process.env.CLIENT) {
|
|
28
|
+
ctx.meta.$ssr.handleDirectOrOnHydrated(() => {
|
|
29
|
+
if (!ctx.disposed) {
|
|
30
|
+
ctx.meta.hooks.invokeHook('hydrated');
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
}
|
|
26
34
|
if (process.env.SERVER) {
|
|
27
35
|
ctx.meta.$ssr._registerServerContext(ctx);
|
|
28
36
|
}
|
|
29
37
|
}
|
|
30
38
|
|
|
39
|
+
controllerLoad(event: IControllerLoadEvent) {
|
|
40
|
+
event.ctx.meta.$ssr.controllerLoad(event);
|
|
41
|
+
}
|
|
42
|
+
|
|
31
43
|
async appInitialize() {
|
|
32
44
|
this.app.meta.event.on('a-router:routerGuards', async (router, next) => {
|
|
33
45
|
if (process.env.CLIENT) {
|
|
@@ -104,8 +116,16 @@ export class Monkey
|
|
|
104
116
|
|
|
105
117
|
private _ssrErrorHandler() {
|
|
106
118
|
if (!process.env.SERVER) return;
|
|
107
|
-
const _eventErrorHandler = this.app.meta.event.on('app:errorHandler', (
|
|
119
|
+
const _eventErrorHandler = this.app.meta.event.on('app:errorHandler', (data, next) => {
|
|
108
120
|
const err = next();
|
|
121
|
+
if (data.load?.kind === 'controller-load') {
|
|
122
|
+
if (_isLoadErrorHandledServer(data.err)) {
|
|
123
|
+
data.load.disposition = 'handled';
|
|
124
|
+
if (!err || !(err instanceof Error)) return err;
|
|
125
|
+
return this._errorHandlerDefaultServer(err);
|
|
126
|
+
}
|
|
127
|
+
return err;
|
|
128
|
+
}
|
|
109
129
|
if (!err || !(err instanceof Error)) return err;
|
|
110
130
|
return this._errorHandlerDefaultServer(err);
|
|
111
131
|
});
|
|
@@ -133,3 +153,7 @@ export class Monkey
|
|
|
133
153
|
return undefined;
|
|
134
154
|
}
|
|
135
155
|
}
|
|
156
|
+
|
|
157
|
+
function _isLoadErrorHandledServer(err: Error) {
|
|
158
|
+
return isNavigationFailure(err) || [301, 302, 401].includes(Number((err as any).code));
|
|
159
|
+
}
|
package/src/types/ssr.ts
CHANGED
|
@@ -66,7 +66,21 @@ export interface SSRContextState {
|
|
|
66
66
|
ssrProfile?: TypeSsrProfile;
|
|
67
67
|
ssrProfileOptions?: Readonly<ISsrProfileOptions>;
|
|
68
68
|
}
|
|
69
|
-
export interface
|
|
69
|
+
export interface SSRControllerLoadErrorSnapshot {
|
|
70
|
+
version: 1;
|
|
71
|
+
controllerBeanName?: string;
|
|
72
|
+
name: string;
|
|
73
|
+
message: string;
|
|
74
|
+
code?: number | string;
|
|
75
|
+
status?: number | string;
|
|
76
|
+
pagePath?: string;
|
|
77
|
+
url?: string;
|
|
78
|
+
controllerRecorded: boolean;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export interface SSRContextStateDefer {
|
|
82
|
+
controllerLoad?: Record<string, SSRControllerLoadErrorSnapshot>;
|
|
83
|
+
}
|
|
70
84
|
|
|
71
85
|
// from: quasar/dist/types/meta.d.ts
|
|
72
86
|
// Cannot use `Record<string, string>` as TS would error out about `template` signature
|