zova-module-a-ssr 5.1.32 → 5.1.34
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/config/config.d.ts +1 -1
- package/dist/config/config.d.ts.map +1 -1
- package/dist/index.js +79 -39
- package/dist/index.js.map +1 -1
- package/dist/lib/bodyReadyObserver.d.ts +2 -0
- package/dist/lib/bodyReadyObserver.d.ts.map +1 -0
- package/dist/lib/index.d.ts +2 -0
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/ssr.d.ts +4 -1
- package/dist/lib/ssr.d.ts.map +1 -1
- package/dist/lib/ssrMetaStore.d.ts.map +1 -1
- package/dist/lib/ssrProfile.d.ts +5 -0
- package/dist/lib/ssrProfile.d.ts.map +1 -0
- package/dist/monkey.d.ts.map +1 -1
- package/dist/types/config.d.ts +3 -9
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/ssr.d.ts +11 -7
- package/dist/types/ssr.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/config/config.ts +1 -17
- package/src/lib/bodyReadyObserver.ts +27 -0
- package/src/lib/index.ts +2 -0
- package/src/lib/ssr.ts +33 -0
- package/src/lib/ssrMetaStore.ts +3 -35
- package/src/lib/ssrProfile.ts +38 -0
- package/src/monkey.ts +14 -0
- package/src/types/config.ts +3 -10
- package/src/types/ssr.ts +17 -8
package/dist/config/config.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config/config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/config/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAEpC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,eAAO,MAAM,MAAM,GAAI,KAAK,OAAO,eAKlC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -40,17 +40,8 @@ var SysSsrState = (_dec$1 = Sys(), _dec2$1 = BeanInfo({ module: "a-ssr" }), _dec
|
|
|
40
40
|
//#endregion
|
|
41
41
|
//#region src/config/config.ts
|
|
42
42
|
var config = (sys) => {
|
|
43
|
-
return {
|
|
44
|
-
cookieThemeDarkDefault: sys.env.SSR_COOKIE_THEMEDARK_DEFAULT === "true",
|
|
45
|
-
optimization: { bodyReadyObserver: sys.env.SSR_BODYREADYOBSERVER === "true" },
|
|
46
|
-
transferCache: sys.env.SSR_TRANSFERCACHE === "false" ? false : { expires: _normalizeExpires(sys.env.SSR_TRANSFERCACHE_EXPIRES) }
|
|
47
|
-
};
|
|
43
|
+
return { cookieThemeDarkDefault: sys.env.SSR_COOKIE_THEMEDARK_DEFAULT === "true" };
|
|
48
44
|
};
|
|
49
|
-
function _normalizeExpires(expires) {
|
|
50
|
-
if (!expires) return 0;
|
|
51
|
-
if (!Number.isNaN(Number(expires))) return Number(expires);
|
|
52
|
-
return expires;
|
|
53
|
-
}
|
|
54
45
|
//#endregion
|
|
55
46
|
//#region src/lib/useMeta.ts
|
|
56
47
|
function useMeta(ctx, metaOptions) {
|
|
@@ -95,6 +86,17 @@ var Monkey = class extends BeanSimple {
|
|
|
95
86
|
if (process.env.SERVER) ctx.meta.$ssr._registerServerContext(ctx);
|
|
96
87
|
}
|
|
97
88
|
async appInitialize() {
|
|
89
|
+
this.app.meta.event.on("a-router:routerGuards", async (router, next) => {
|
|
90
|
+
if (process.env.CLIENT) {
|
|
91
|
+
router.beforeEach((to) => {
|
|
92
|
+
this.ctx.meta.$ssr._setProfile(to.meta.ssrProfile, to.meta.ssrProfileOptions);
|
|
93
|
+
});
|
|
94
|
+
router.afterEach((_to, from, failure) => {
|
|
95
|
+
if (failure) this.ctx.meta.$ssr._setProfile(from.meta.ssrProfile, from.meta.ssrProfileOptions);
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
return await next();
|
|
99
|
+
});
|
|
98
100
|
if (process.env.CLIENT && this.ctx.meta.$ssr.isRuntimeSsrPreHydration) this.ctx.meta.$ssr.onHydrated(() => {
|
|
99
101
|
document.documentElement.setAttribute("data-zova-hydrated", this.sys.env.SITE_ID);
|
|
100
102
|
});
|
|
@@ -171,7 +173,6 @@ var CtxSSRMetaStore = class extends BeanSimple {
|
|
|
171
173
|
if (process.env.SERVER) {
|
|
172
174
|
const ssrContext = this.ctx.meta.$ssr.context;
|
|
173
175
|
ssrContext.__qMetaList = [];
|
|
174
|
-
if (this.sys.env.SSR_BODYREADYOBSERVER === "true") ssrContext.__qMetaList.push({ bodyStyle: { display: "none" } });
|
|
175
176
|
ssrContext.rendered = () => {
|
|
176
177
|
this._onRenderedLast();
|
|
177
178
|
ssrContext.rendered = () => {};
|
|
@@ -257,7 +258,8 @@ var CtxSSRMetaStore = class extends BeanSimple {
|
|
|
257
258
|
ctx.bodyClasses = Object.keys(bodyClass).filter((name) => bodyClass[name]).map((name) => name).join(" ");
|
|
258
259
|
data.title = "'\"`";
|
|
259
260
|
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>`;
|
|
260
|
-
|
|
261
|
+
const cookieTheme = this.ctx.meta.$ssr.profileOptions.useCookie;
|
|
262
|
+
let ssr_local_themedark = cookieTheme ? `let ssr_cookie_themedark=document.cookie.split('; ')?.find(item=>item.indexOf('themedark=')>-1)?.split('=')[1];
|
|
261
263
|
ssr_cookie_themedark=ssr_cookie_themedark==='true'?true:ssr_cookie_themedark==='false'?false:${this.sys.env.SSR_COOKIE_THEMEDARK_DEFAULT};
|
|
262
264
|
window.ssr_themedark=window.ssr_cookie_themedark=ssr_cookie_themedark;` : `let ssr_local_themedark=window.ssr_load_local('themedark');
|
|
263
265
|
if(ssr_local_themedark===undefined || ssr_local_themedark==='auto'){
|
|
@@ -273,7 +275,7 @@ var CtxSSRMetaStore = class extends BeanSimple {
|
|
|
273
275
|
return _data;
|
|
274
276
|
},
|
|
275
277
|
});`;
|
|
276
|
-
const ssr_local_themename =
|
|
278
|
+
const ssr_local_themename = cookieTheme ? "" : `window.ssr_local_themename=window.ssr_load_local('themename','${this.sys.env.STYLE_DEFAULT_THEME}');`;
|
|
277
279
|
ctx.endingHeadTags += `<script id="ssr-prefers-color-schema-dark">
|
|
278
280
|
window.ssr_load_local=function(key,defaultValue){
|
|
279
281
|
const __ssr_local=localStorage.getItem(key);
|
|
@@ -284,31 +286,6 @@ var CtxSSRMetaStore = class extends BeanSimple {
|
|
|
284
286
|
${ssr_local_themename}
|
|
285
287
|
document.querySelector('#ssr-prefers-color-schema-dark').remove();
|
|
286
288
|
<\/script>`.replaceAll("\n", "");
|
|
287
|
-
if (this.sys.env.SSR_BODYREADYOBSERVER === "true") ctx.bodyTags += `<script id="ssr-body-ready-observer">
|
|
288
|
-
window.ssr_bodyReadyObserverClear=()=>{
|
|
289
|
-
if(window.ssr_bodyReadyObserver){
|
|
290
|
-
window.ssr_body_ready_condition=undefined;
|
|
291
|
-
window.ssr_body_ready_callback=undefined;
|
|
292
|
-
window.ssr_bodyReadyObserver.disconnect();
|
|
293
|
-
window.ssr_bodyReadyObserver=undefined;
|
|
294
|
-
document.body.style.display='block';
|
|
295
|
-
document.querySelector('#ssr-body-ready-observer').remove();
|
|
296
|
-
}
|
|
297
|
-
};
|
|
298
|
-
window.ssr_bodyReadyObserver = new MutationObserver(() => {
|
|
299
|
-
if(window.ssr_body_ready_condition && window.ssr_body_ready_condition()){
|
|
300
|
-
window.ssr_body_ready_callback();
|
|
301
|
-
window.ssr_bodyReadyObserverClear();
|
|
302
|
-
}
|
|
303
|
-
});
|
|
304
|
-
window.ssr_bodyReadyObserver.observe(document.body, {
|
|
305
|
-
subtree: true,
|
|
306
|
-
childList: true,
|
|
307
|
-
});
|
|
308
|
-
document.addEventListener("DOMContentLoaded", () => {
|
|
309
|
-
window.ssr_bodyReadyObserverClear();
|
|
310
|
-
});
|
|
311
|
-
<\/script>`.replaceAll("\n", "");
|
|
312
289
|
}
|
|
313
290
|
_injectContextState(ssrContext) {
|
|
314
291
|
const ctx = ssrContext._meta;
|
|
@@ -448,6 +425,22 @@ function getHead(meta) {
|
|
|
448
425
|
return output;
|
|
449
426
|
}
|
|
450
427
|
//#endregion
|
|
428
|
+
//#region src/lib/ssrProfile.ts
|
|
429
|
+
function resolveSsrProfile(routeProfile, defaultProfile) {
|
|
430
|
+
const ssrProfile = routeProfile ?? defaultProfile ?? "public";
|
|
431
|
+
if (ssrProfile !== "public" && ssrProfile !== "session") throw new Error(`invalid SSR profile: ${ssrProfile}`);
|
|
432
|
+
return ssrProfile;
|
|
433
|
+
}
|
|
434
|
+
function resolveSsrProfileOptions(ssrProfile, profiles, routeProfileOptions) {
|
|
435
|
+
const profileOptions = profiles[ssrProfile];
|
|
436
|
+
if (!profileOptions) throw new Error(`invalid SSR profile: ${ssrProfile}`);
|
|
437
|
+
const responseCache = routeProfileOptions?.responseCache ?? profileOptions.responseCache;
|
|
438
|
+
return Object.freeze({
|
|
439
|
+
useCookie: ssrProfile === "session" && profileOptions.useCookie,
|
|
440
|
+
responseCache: responseCache === false ? false : Object.freeze({ ...responseCache })
|
|
441
|
+
});
|
|
442
|
+
}
|
|
443
|
+
//#endregion
|
|
451
444
|
//#region src/lib/ssr.ts
|
|
452
445
|
var SymbolIsRuntimeSsrPreHydration = Symbol("SymbolIsRuntimeSsrPreHydration");
|
|
453
446
|
var SymbolSSRContext = Symbol("SymbolSSRContext");
|
|
@@ -525,6 +518,24 @@ var CtxSSR = class extends BeanSimple {
|
|
|
525
518
|
if (process.env.SERVER) return this.context.stateDefer;
|
|
526
519
|
else return this[SymbolSSRState].stateDefer;
|
|
527
520
|
}
|
|
521
|
+
get profile() {
|
|
522
|
+
return resolveSsrProfile(this.state.ssrProfile, this.sys.env.SSR_PROFILE);
|
|
523
|
+
}
|
|
524
|
+
get profileOptions() {
|
|
525
|
+
const profileOptions = this.state.ssrProfileOptions;
|
|
526
|
+
if (profileOptions) return profileOptions;
|
|
527
|
+
return resolveSsrProfileOptions(this.profile, this.sys.config.ssr.profiles);
|
|
528
|
+
}
|
|
529
|
+
/** @internal */
|
|
530
|
+
_setProfile(routeProfile, routeProfileOptions) {
|
|
531
|
+
const ssrProfile = resolveSsrProfile(routeProfile, this.sys.env.SSR_PROFILE);
|
|
532
|
+
const ssrProfileOptions = resolveSsrProfileOptions(ssrProfile, this.sys.config.ssr.profiles, routeProfileOptions);
|
|
533
|
+
this.state.ssrProfile = ssrProfile;
|
|
534
|
+
this.state.ssrProfileOptions = ssrProfileOptions;
|
|
535
|
+
}
|
|
536
|
+
get cookieDisabledOnServer() {
|
|
537
|
+
return process.env.SERVER && !this.profileOptions.useCookie;
|
|
538
|
+
}
|
|
528
539
|
get renderSSRError() {
|
|
529
540
|
return this.context._meta.renderError;
|
|
530
541
|
}
|
|
@@ -704,6 +715,35 @@ var _dec, _dec2, _class;
|
|
|
704
715
|
var ScopeModuleASsr = (_dec = Scope(), _dec2 = BeanInfo({ module: "a-ssr" }), _dec(_class = _dec2(_class = class ScopeModuleASsr extends BeanScopeBase {}) || _class) || _class);
|
|
705
716
|
/** scope: end */
|
|
706
717
|
//#endregion
|
|
707
|
-
|
|
718
|
+
//#region src/lib/bodyReadyObserver.ts
|
|
719
|
+
function getBodyReadyObserverScript() {
|
|
720
|
+
return `<script id="ssr-body-ready-observer">
|
|
721
|
+
window.ssr_bodyReadyObserverClear=()=>{
|
|
722
|
+
if(window.ssr_bodyReadyObserver){
|
|
723
|
+
window.ssr_body_ready_condition=undefined;
|
|
724
|
+
window.ssr_body_ready_callback=undefined;
|
|
725
|
+
window.ssr_bodyReadyObserver.disconnect();
|
|
726
|
+
window.ssr_bodyReadyObserver=undefined;
|
|
727
|
+
document.body.style.display='block';
|
|
728
|
+
document.querySelector('#ssr-body-ready-observer').remove();
|
|
729
|
+
}
|
|
730
|
+
};
|
|
731
|
+
window.ssr_bodyReadyObserver = new MutationObserver(() => {
|
|
732
|
+
if(window.ssr_body_ready_condition && window.ssr_body_ready_condition()){
|
|
733
|
+
window.ssr_body_ready_callback();
|
|
734
|
+
window.ssr_bodyReadyObserverClear();
|
|
735
|
+
}
|
|
736
|
+
});
|
|
737
|
+
window.ssr_bodyReadyObserver.observe(document.body, {
|
|
738
|
+
subtree: true,
|
|
739
|
+
childList: true,
|
|
740
|
+
});
|
|
741
|
+
document.addEventListener("DOMContentLoaded", () => {
|
|
742
|
+
window.ssr_bodyReadyObserverClear();
|
|
743
|
+
});
|
|
744
|
+
<\/script>`.replaceAll("\\n", "");
|
|
745
|
+
}
|
|
746
|
+
//#endregion
|
|
747
|
+
export { CtxSSR, CtxSSRMetaStore, Monkey, MonkeySys, ScopeModuleASsr, SysSsrState, config, getBodyReadyObserverScript, resolveSsrProfile, resolveSsrProfileOptions, unevalPatch };
|
|
708
748
|
|
|
709
749
|
//# sourceMappingURL=index.js.map
|
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/useMeta.ts","../src/monkey.ts","../src/lib/utils.ts","../src/lib/ssrMetaStore.ts","../src/lib/ssr.ts","../src/monkeySys.ts","../src/.metadata/index.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 optimization: {\n bodyReadyObserver: sys.env.SSR_BODYREADYOBSERVER === 'true'\n },\n transferCache: sys.env.SSR_TRANSFERCACHE === 'false' ? false : {\n expires: _normalizeExpires(sys.env.SSR_TRANSFERCACHE_EXPIRES)\n }\n };\n return ssrConfig;\n};\nfunction _normalizeExpires(expires) {\n if (!expires) return 0;\n if (!Number.isNaN(Number(expires))) return Number(expires);\n return expires;\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 { 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 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 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 if (this.sys.env.SSR_BODYREADYOBSERVER === 'true') {\n ssrContext.__qMetaList.push({\n bodyStyle: {\n display: 'none'\n }\n });\n }\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 let ssr_local_themedark = this.sys.config.ssr.cookie ? `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 = this.sys.config.ssr.cookie ? '' : `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 if (this.sys.env.SSR_BODYREADYOBSERVER === 'true') {\n ctx.bodyTags += `<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 }\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}","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';\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 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 && 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 */"],"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,oBAAkB,CAAC;GAE1B,IAAI,KAAK,MAAM,CAAC,CAAC,yBAAyB;IACxC,KAAK,uBAAuB,KAAK,MAAM,CAAC,CAAC;IACzC,OAAO,KAAK,MAAM,CAAC,CAAC;IACpB,SAAS,eAAe,sBAAsB,CAAC,EAAE,OAAO;GAC1D,OACE,KAAK,uBAAuB,CAAC;EAEjC;CACF;CACA,IAAI,QAAQ;EACV,OAAO,KAAK;CACd;CACA,IAAI,aAAa;EACf,OAAO,KAAK;CACd;AACF,CAAC,KAAK,QAAM,KAAK;;;ACtCjB,IAAa,UAAS,QAAO;CAU3B,OAAO;EARL,wBAAwB,IAAI,IAAI,iCAAiC;EACjE,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AACF;;;AC5RA,IAAa,YAAb,cAA+B,WAAW;CACxC,YAAY,YAAY;EACtB,MAAM;EACN,KAAK,cAAc,KAAK;EACxB,KAAK,eAAe,KAAK;EACzB,KAAK,cAAc;CACrB;CACA,MAAM,iBAAiB;EACrB,IAAI,CAAC,KAAK,cACR,KAAK,eAAe,MAAM,KAAK,KAAK,SAAS,sBAAsB,KAAK;EAE1E,OAAO,KAAK;CACd;CACA,MAAM,cAAc,QAAQ;EAC1B,IAAI,KAAK,gBAAgB,QAAQ;EACjC,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,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"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/bean/sys.ssrState.ts","../src/config/config.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};","// 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 { 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 // Server profile state is prepared before appInitialize; this synchronizes client navigation.\n router.beforeEach(to => {\n this.ctx.meta.$ssr._setProfile(to.meta.ssrProfile, to.meta.ssrProfileOptions);\n });\n router.afterEach((_to, from, failure) => {\n if (failure) {\n this.ctx.meta.$ssr._setProfile(from.meta.ssrProfile, from.meta.ssrProfileOptions);\n }\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 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) {\n const profileOptions = profiles[ssrProfile];\n if (!profileOptions) {\n throw new Error(`invalid SSR profile: ${ssrProfile}`);\n }\n const responseCache = routeProfileOptions?.responseCache ?? 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) {\n const ssrProfile = resolveSsrProfile(routeProfile, this.sys.env.SSR_PROFILE);\n const ssrProfileOptions = resolveSsrProfileOptions(ssrProfile, this.sys.config.ssr.profiles, routeProfileOptions);\n this.state.ssrProfile = ssrProfile;\n this.state.ssrProfileOptions = ssrProfileOptions;\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 && 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,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,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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bodyReadyObserver.d.ts","sourceRoot":"","sources":["../../src/lib/bodyReadyObserver.ts"],"names":[],"mappings":"AAAA,wBAAgB,0BAA0B,WA0BzC"}
|
package/dist/lib/index.d.ts
CHANGED
package/dist/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,mBAAmB,CAAC;AAClC,cAAc,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC"}
|
package/dist/lib/ssr.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Functionable } from 'zova';
|
|
2
2
|
import { BeanSimple } from 'zova';
|
|
3
|
-
import type { OnHydratePropHasMismatch, SSRContext, TypeSsrSitePerformAction } from '../types/ssr.js';
|
|
3
|
+
import type { ISsrProfileOptions, OnHydratePropHasMismatch, SSRContext, TypeSsrProfile, TypeSsrSitePerformAction } from '../types/ssr.js';
|
|
4
4
|
import { CtxSSRMetaStore } from './ssrMetaStore.js';
|
|
5
5
|
declare const SymbolIsRuntimeSsrPreHydration: unique symbol;
|
|
6
6
|
declare const SymbolSSRContext: unique symbol;
|
|
@@ -28,6 +28,9 @@ export declare class CtxSSR extends BeanSimple {
|
|
|
28
28
|
get context(): SSRContext;
|
|
29
29
|
get state(): import("zova-module-a-ssr").SSRContextState;
|
|
30
30
|
get stateDefer(): import("zova-module-a-ssr").SSRContextStateDefer;
|
|
31
|
+
get profile(): TypeSsrProfile;
|
|
32
|
+
get profileOptions(): Readonly<ISsrProfileOptions>;
|
|
33
|
+
get cookieDisabledOnServer(): boolean;
|
|
31
34
|
get renderSSRError(): any;
|
|
32
35
|
set renderSSRError(err: any);
|
|
33
36
|
getPerformAction(baseURL?: string): TypeSsrSitePerformAction | undefined;
|
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,EAAe,MAAM,MAAM,CAAC;AAKtD,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAGlC,OAAO,KAAK,EACV,wBAAwB,EAExB,UAAU,EACV,wBAAwB,EACzB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"ssr.d.ts","sourceRoot":"","sources":["../../src/lib/ssr.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAe,MAAM,MAAM,CAAC;AAKtD,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAGlC,OAAO,KAAK,EACV,kBAAkB,EAElB,wBAAwB,EAExB,UAAU,EACV,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;A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wB,CAAC,EAAE,EAAE,YAAY;IAQzC,OAAO,CAAC,gCAAgC;IA6DxC,OAAO,CAAC,SAAS;CAoFlB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ssrMetaStore.d.ts","sourceRoot":"","sources":["../../src/lib/ssrMetaStore.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAQ,MAAM,MAAM,CAAC;AAExC,OAAO,KAAK,EAA8B,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAIzF,qBAAa,eAAgB,SAAQ,UAAU;IAC7C,OAAO,CAAC,SAAS,CAAa;IAC9B,OAAO,CAAC,kBAAkB,CAAC,CAAiB;IAC5C,OAAO,CAAC,WAAW,CAA+B;IAElD,SAAS,CAAC,QAAQ;
|
|
1
|
+
{"version":3,"file":"ssrMetaStore.d.ts","sourceRoot":"","sources":["../../src/lib/ssrMetaStore.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAQ,MAAM,MAAM,CAAC;AAExC,OAAO,KAAK,EAA8B,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAIzF,qBAAa,eAAgB,SAAQ,UAAU;IAC7C,OAAO,CAAC,SAAS,CAAa;IAC9B,OAAO,CAAC,kBAAkB,CAAC,CAAiB;IAC5C,OAAO,CAAC,WAAW,CAA+B;IAElD,SAAS,CAAC,QAAQ;IAelB,OAAO,CAAC,eAAe;IAevB,cAAc,CAAC,kBAAkB,EAAE,qBAAqB;IAIxD,iBAAiB,CAAC,kBAAkB,EAAE,qBAAqB;IAI3D,gBAAgB;IAUhB,OAAO,CAAC,iBAAiB;IAyBzB,OAAO,CAAC,iBAAiB;IAqGzB,OAAO,CAAC,mBAAmB;IAQ3B,OAAO,CAAC,wBAAwB;CAOjC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ZovaConfigSsrProfile } from 'zova';
|
|
2
|
+
import type { ISsrProfileOptions, ISsrRouteProfileOptions, TypeSsrProfile } from '../types/ssr.js';
|
|
3
|
+
export declare function resolveSsrProfile(routeProfile: TypeSsrProfile | undefined, defaultProfile: string | undefined): TypeSsrProfile;
|
|
4
|
+
export declare function resolveSsrProfileOptions(ssrProfile: TypeSsrProfile, profiles: Readonly<Record<TypeSsrProfile, ZovaConfigSsrProfile>>, routeProfileOptions?: Readonly<ISsrRouteProfileOptions>): Readonly<ISsrProfileOptions>;
|
|
5
|
+
//# sourceMappingURL=ssrProfile.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ssrProfile.d.ts","sourceRoot":"","sources":["../../src/lib/ssrProfile.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,MAAM,CAAC;AAEjD,OAAO,KAAK,EACV,kBAAkB,EAElB,uBAAuB,EACvB,cAAc,EACf,MAAM,iBAAiB,CAAC;AAEzB,wBAAgB,iBAAiB,CAC/B,YAAY,EAAE,cAAc,GAAG,SAAS,EACxC,cAAc,EAAE,MAAM,GAAG,SAAS,GACjC,cAAc,CAMhB;AAED,wBAAgB,wBAAwB,CACtC,UAAU,EAAE,cAAc,EAC1B,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,cAAc,EAAE,oBAAoB,CAAC,CAAC,EAChE,mBAAmB,CAAC,EAAE,QAAQ,CAAC,uBAAuB,CAAC,GACtD,QAAQ,CAAC,kBAAkB,CAAC,CAa9B"}
|
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;AAMxC,qBAAa,MACX,SAAQ,UACR,YAAW,2BAA2B,EAAE,oBAAoB,EAAE,eAAe,EAAE,aAAa;IAE5F,oBAAoB,CAAC,GAAG,EAAE,WAAW,GAAG,IAAI;IAOtC,aAAa;
|
|
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;AAMxC,qBAAa,MACX,SAAQ,UACR,YAAW,2BAA2B,EAAE,oBAAoB,EAAE,eAAe,EAAE,aAAa;IAE5F,oBAAoB,CAAC,GAAG,EAAE,WAAW,GAAG,IAAI;IAOtC,aAAa;IA0Bb,aAAa,CAAC,OAAO,EAAE,OAAO;IAC9B,YAAY,CAAC,MAAM,EAAE,OAAO;IAQ5B,QAAQ,CAAC,IAAI,EAAE,aAAa,EAAE,YAAY,EAAE,QAAQ;IAyB1D,OAAO,CAAC,gBAAgB;IAYxB,OAAO,CAAC,0BAA0B;CAkBnC"}
|
package/dist/types/config.d.ts
CHANGED
|
@@ -1,18 +1,12 @@
|
|
|
1
1
|
import '@cabloy/vue-router';
|
|
2
|
-
import type {
|
|
3
|
-
export interface ISsrConfigTransferCache {
|
|
4
|
-
expires?: number | StringValue;
|
|
5
|
-
}
|
|
2
|
+
import type { ISsrRouteProfileOptions, TypeSsrProfile } from './ssr.js';
|
|
6
3
|
export interface ISsrConfig {
|
|
7
4
|
cookieThemeDarkDefault: boolean;
|
|
8
|
-
optimization: {
|
|
9
|
-
bodyReadyObserver: boolean;
|
|
10
|
-
};
|
|
11
|
-
transferCache: false | ISsrConfigTransferCache;
|
|
12
5
|
}
|
|
13
6
|
declare module '@cabloy/vue-router' {
|
|
14
7
|
interface RouteMeta {
|
|
15
|
-
|
|
8
|
+
ssrProfile?: TypeSsrProfile;
|
|
9
|
+
ssrProfileOptions?: Readonly<ISsrRouteProfileOptions>;
|
|
16
10
|
}
|
|
17
11
|
}
|
|
18
12
|
//# sourceMappingURL=config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/types/config.ts"],"names":[],"mappings":"AAAA,OAAO,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/types/config.ts"],"names":[],"mappings":"AAAA,OAAO,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,uBAAuB,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAExE,MAAM,WAAW,UAAU;IACzB,sBAAsB,EAAE,OAAO,CAAC;CACjC;AAED,OAAO,QAAQ,oBAAoB,CAAC;IAClC,UAAiB,SAAS;QACxB,UAAU,CAAC,EAAE,cAAc,CAAC;QAC5B,iBAAiB,CAAC,EAAE,QAAQ,CAAC,uBAAuB,CAAC,CAAC;KACvD;CACF"}
|
package/dist/types/ssr.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ComponentInternalInstance, VNode } from 'vue';
|
|
2
|
-
import type { ZovaConfigEnv } from 'zova';
|
|
2
|
+
import type { ZovaConfigEnv, ZovaConfigSsrProfile, ZovaConfigSsrResponseCachePolicy } from 'zova';
|
|
3
3
|
import type { CtxSSR } from '../lib/ssr.js';
|
|
4
4
|
import 'zova';
|
|
5
5
|
export interface ErrorSSR extends Error {
|
|
@@ -39,11 +39,21 @@ export interface SSRContextMeta {
|
|
|
39
39
|
baseUrl: string;
|
|
40
40
|
renderError: ErrorSSR | string;
|
|
41
41
|
}
|
|
42
|
+
export type TypeSsrProfile = 'public' | 'session';
|
|
43
|
+
export type ISsrResponseCachePolicy = ZovaConfigSsrResponseCachePolicy;
|
|
44
|
+
export interface ISsrRouteProfileOptions {
|
|
45
|
+
responseCache?: false | Readonly<ISsrResponseCachePolicy>;
|
|
46
|
+
}
|
|
47
|
+
export type ISsrProfileOptions = Readonly<Omit<ZovaConfigSsrProfile, 'responseCache'> & {
|
|
48
|
+
responseCache: false | Readonly<ISsrResponseCachePolicy>;
|
|
49
|
+
}>;
|
|
42
50
|
export interface SSRContextState {
|
|
43
51
|
envClient?: ZovaConfigEnv;
|
|
44
52
|
pagePathFull?: string;
|
|
45
53
|
pagePath?: string;
|
|
46
54
|
pageData?: unknown;
|
|
55
|
+
ssrProfile?: TypeSsrProfile;
|
|
56
|
+
ssrProfileOptions?: Readonly<ISsrProfileOptions>;
|
|
47
57
|
}
|
|
48
58
|
export interface SSRContextStateDefer {
|
|
49
59
|
}
|
|
@@ -109,12 +119,6 @@ declare module 'zova' {
|
|
|
109
119
|
$ssr: CtxSSR;
|
|
110
120
|
$useMeta(options: SSRMetaOptions | (() => SSRMetaOptions)): void;
|
|
111
121
|
}
|
|
112
|
-
interface ZovaConfigEnv {
|
|
113
|
-
SSR_COOKIE_THEMEDARK_DEFAULT: string | undefined;
|
|
114
|
-
SSR_BODYREADYOBSERVER: string | undefined;
|
|
115
|
-
SSR_TRANSFERCACHE: string | undefined;
|
|
116
|
-
SSR_TRANSFERCACHE_EXPIRES: string | undefined;
|
|
117
|
-
}
|
|
118
122
|
}
|
|
119
123
|
declare global {
|
|
120
124
|
interface Window {
|
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,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"ssr.d.ts","sour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G,KAAK,GAAG,OAAO,CAAC;AACzF,MAAM,WAAW,4BAA4B;IAC3C,MAAM,EAAE,8BAA8B,CAAC;IACvC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,OAAO,QAAQ,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
package/src/config/config.ts
CHANGED
|
@@ -1,26 +1,10 @@
|
|
|
1
|
-
import type { StringValue } from 'ms';
|
|
2
1
|
import type { ZovaSys } from 'zova';
|
|
3
2
|
|
|
4
|
-
import { ISsrConfig } from '../types/config.js';
|
|
3
|
+
import type { ISsrConfig } from '../types/config.js';
|
|
5
4
|
|
|
6
5
|
export const config = (sys: ZovaSys) => {
|
|
7
6
|
const ssrConfig: ISsrConfig = {
|
|
8
7
|
cookieThemeDarkDefault: sys.env.SSR_COOKIE_THEMEDARK_DEFAULT === 'true',
|
|
9
|
-
optimization: {
|
|
10
|
-
bodyReadyObserver: sys.env.SSR_BODYREADYOBSERVER === 'true',
|
|
11
|
-
},
|
|
12
|
-
transferCache:
|
|
13
|
-
sys.env.SSR_TRANSFERCACHE === 'false'
|
|
14
|
-
? false
|
|
15
|
-
: {
|
|
16
|
-
expires: _normalizeExpires(sys.env.SSR_TRANSFERCACHE_EXPIRES),
|
|
17
|
-
},
|
|
18
8
|
};
|
|
19
9
|
return ssrConfig;
|
|
20
10
|
};
|
|
21
|
-
|
|
22
|
-
function _normalizeExpires(expires: string | undefined): StringValue | number {
|
|
23
|
-
if (!expires) return 0;
|
|
24
|
-
if (!Number.isNaN(Number(expires))) return Number(expires);
|
|
25
|
-
return expires as StringValue;
|
|
26
|
-
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export function getBodyReadyObserverScript() {
|
|
2
|
+
return `<script id="ssr-body-ready-observer">
|
|
3
|
+
window.ssr_bodyReadyObserverClear=()=>{
|
|
4
|
+
if(window.ssr_bodyReadyObserver){
|
|
5
|
+
window.ssr_body_ready_condition=undefined;
|
|
6
|
+
window.ssr_body_ready_callback=undefined;
|
|
7
|
+
window.ssr_bodyReadyObserver.disconnect();
|
|
8
|
+
window.ssr_bodyReadyObserver=undefined;
|
|
9
|
+
document.body.style.display='block';
|
|
10
|
+
document.querySelector('#ssr-body-ready-observer').remove();
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
window.ssr_bodyReadyObserver = new MutationObserver(() => {
|
|
14
|
+
if(window.ssr_body_ready_condition && window.ssr_body_ready_condition()){
|
|
15
|
+
window.ssr_body_ready_callback();
|
|
16
|
+
window.ssr_bodyReadyObserverClear();
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
window.ssr_bodyReadyObserver.observe(document.body, {
|
|
20
|
+
subtree: true,
|
|
21
|
+
childList: true,
|
|
22
|
+
});
|
|
23
|
+
document.addEventListener("DOMContentLoaded", () => {
|
|
24
|
+
window.ssr_bodyReadyObserverClear();
|
|
25
|
+
});
|
|
26
|
+
</script>`.replaceAll('\\n', '');
|
|
27
|
+
}
|
package/src/lib/index.ts
CHANGED
package/src/lib/ssr.ts
CHANGED
|
@@ -8,13 +8,17 @@ import { BeanSimple } from 'zova';
|
|
|
8
8
|
|
|
9
9
|
import type { SysSsrState } from '../bean/sys.ssrState.js';
|
|
10
10
|
import type {
|
|
11
|
+
ISsrProfileOptions,
|
|
12
|
+
ISsrRouteProfileOptions,
|
|
11
13
|
OnHydratePropHasMismatch,
|
|
12
14
|
OnHydratePropHasMismatchResult,
|
|
13
15
|
SSRContext,
|
|
16
|
+
TypeSsrProfile,
|
|
14
17
|
TypeSsrSitePerformAction,
|
|
15
18
|
} from '../types/ssr.js';
|
|
16
19
|
|
|
17
20
|
import { CtxSSRMetaStore } from './ssrMetaStore.js';
|
|
21
|
+
import { resolveSsrProfile, resolveSsrProfileOptions } from './ssrProfile.js';
|
|
18
22
|
|
|
19
23
|
const SymbolIsRuntimeSsrPreHydration = Symbol('SymbolIsRuntimeSsrPreHydration');
|
|
20
24
|
const SymbolSSRContext = Symbol('SymbolSSRContext');
|
|
@@ -127,6 +131,35 @@ export class CtxSSR extends BeanSimple {
|
|
|
127
131
|
}
|
|
128
132
|
}
|
|
129
133
|
|
|
134
|
+
get profile(): TypeSsrProfile {
|
|
135
|
+
return resolveSsrProfile(this.state.ssrProfile, this.sys.env.SSR_PROFILE);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
get profileOptions(): Readonly<ISsrProfileOptions> {
|
|
139
|
+
const profileOptions = this.state.ssrProfileOptions;
|
|
140
|
+
if (profileOptions) return profileOptions;
|
|
141
|
+
return resolveSsrProfileOptions(this.profile, this.sys.config.ssr.profiles);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/** @internal */
|
|
145
|
+
public _setProfile(
|
|
146
|
+
routeProfile: TypeSsrProfile | undefined,
|
|
147
|
+
routeProfileOptions?: Readonly<ISsrRouteProfileOptions>,
|
|
148
|
+
) {
|
|
149
|
+
const ssrProfile = resolveSsrProfile(routeProfile, this.sys.env.SSR_PROFILE);
|
|
150
|
+
const ssrProfileOptions = resolveSsrProfileOptions(
|
|
151
|
+
ssrProfile,
|
|
152
|
+
this.sys.config.ssr.profiles,
|
|
153
|
+
routeProfileOptions,
|
|
154
|
+
);
|
|
155
|
+
this.state.ssrProfile = ssrProfile;
|
|
156
|
+
this.state.ssrProfileOptions = ssrProfileOptions;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
get cookieDisabledOnServer(): boolean {
|
|
160
|
+
return process.env.SERVER && !this.profileOptions.useCookie;
|
|
161
|
+
}
|
|
162
|
+
|
|
130
163
|
get renderSSRError() {
|
|
131
164
|
return this.context._meta.renderError;
|
|
132
165
|
}
|
package/src/lib/ssrMetaStore.ts
CHANGED
|
@@ -15,11 +15,6 @@ export class CtxSSRMetaStore extends BeanSimple {
|
|
|
15
15
|
if (process.env.SERVER) {
|
|
16
16
|
const ssrContext = this.ctx.meta.$ssr.context;
|
|
17
17
|
ssrContext.__qMetaList = [];
|
|
18
|
-
if (this.sys.env.SSR_BODYREADYOBSERVER === 'true') {
|
|
19
|
-
ssrContext.__qMetaList.push({
|
|
20
|
-
bodyStyle: { display: 'none' },
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
18
|
ssrContext.rendered = () => {
|
|
24
19
|
this._onRenderedLast();
|
|
25
20
|
ssrContext.rendered = () => {};
|
|
@@ -155,7 +150,8 @@ export class CtxSSRMetaStore extends BeanSimple {
|
|
|
155
150
|
'',
|
|
156
151
|
)}<script${nonce} id="ssr-meta-init">window.__Q_META__=${delete data.bodyStyle && delete data.bodyClass && delete data.noscript && unevalPatch(data)}</script>`;
|
|
157
152
|
|
|
158
|
-
|
|
153
|
+
const cookieTheme = this.ctx.meta.$ssr.profileOptions.useCookie;
|
|
154
|
+
let ssr_local_themedark = cookieTheme
|
|
159
155
|
? `let ssr_cookie_themedark=document.cookie.split('; ')?.find(item=>item.indexOf('themedark=')>-1)?.split('=')[1];
|
|
160
156
|
ssr_cookie_themedark=ssr_cookie_themedark==='true'?true:ssr_cookie_themedark==='false'?false:${this.sys.env.SSR_COOKIE_THEMEDARK_DEFAULT};
|
|
161
157
|
window.ssr_themedark=window.ssr_cookie_themedark=ssr_cookie_themedark;`
|
|
@@ -174,7 +170,7 @@ export class CtxSSRMetaStore extends BeanSimple {
|
|
|
174
170
|
return _data;
|
|
175
171
|
},
|
|
176
172
|
});`;
|
|
177
|
-
const ssr_local_themename =
|
|
173
|
+
const ssr_local_themename = cookieTheme
|
|
178
174
|
? ''
|
|
179
175
|
: `window.ssr_local_themename=window.ssr_load_local('themename','${this.sys.env.STYLE_DEFAULT_THEME}');`;
|
|
180
176
|
ctx.endingHeadTags += `<script id="ssr-prefers-color-schema-dark">
|
|
@@ -187,34 +183,6 @@ export class CtxSSRMetaStore extends BeanSimple {
|
|
|
187
183
|
${ssr_local_themename}
|
|
188
184
|
document.querySelector('#ssr-prefers-color-schema-dark').remove();
|
|
189
185
|
</script>`.replaceAll('\n', '');
|
|
190
|
-
|
|
191
|
-
if (this.sys.env.SSR_BODYREADYOBSERVER === 'true') {
|
|
192
|
-
ctx.bodyTags += `<script id="ssr-body-ready-observer">
|
|
193
|
-
window.ssr_bodyReadyObserverClear=()=>{
|
|
194
|
-
if(window.ssr_bodyReadyObserver){
|
|
195
|
-
window.ssr_body_ready_condition=undefined;
|
|
196
|
-
window.ssr_body_ready_callback=undefined;
|
|
197
|
-
window.ssr_bodyReadyObserver.disconnect();
|
|
198
|
-
window.ssr_bodyReadyObserver=undefined;
|
|
199
|
-
document.body.style.display='block';
|
|
200
|
-
document.querySelector('#ssr-body-ready-observer').remove();
|
|
201
|
-
}
|
|
202
|
-
};
|
|
203
|
-
window.ssr_bodyReadyObserver = new MutationObserver(() => {
|
|
204
|
-
if(window.ssr_body_ready_condition && window.ssr_body_ready_condition()){
|
|
205
|
-
window.ssr_body_ready_callback();
|
|
206
|
-
window.ssr_bodyReadyObserverClear();
|
|
207
|
-
}
|
|
208
|
-
});
|
|
209
|
-
window.ssr_bodyReadyObserver.observe(document.body, {
|
|
210
|
-
subtree: true,
|
|
211
|
-
childList: true,
|
|
212
|
-
});
|
|
213
|
-
document.addEventListener("DOMContentLoaded", () => {
|
|
214
|
-
window.ssr_bodyReadyObserverClear();
|
|
215
|
-
});
|
|
216
|
-
</script>`.replaceAll('\n', '');
|
|
217
|
-
}
|
|
218
186
|
}
|
|
219
187
|
|
|
220
188
|
private _injectContextState(ssrContext: SSRContext) {
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { ZovaConfigSsrProfile } from 'zova';
|
|
2
|
+
|
|
3
|
+
import type {
|
|
4
|
+
ISsrProfileOptions,
|
|
5
|
+
ISsrResponseCachePolicy,
|
|
6
|
+
ISsrRouteProfileOptions,
|
|
7
|
+
TypeSsrProfile,
|
|
8
|
+
} from '../types/ssr.js';
|
|
9
|
+
|
|
10
|
+
export function resolveSsrProfile(
|
|
11
|
+
routeProfile: TypeSsrProfile | undefined,
|
|
12
|
+
defaultProfile: string | undefined,
|
|
13
|
+
): TypeSsrProfile {
|
|
14
|
+
const ssrProfile = routeProfile ?? defaultProfile ?? 'public';
|
|
15
|
+
if (ssrProfile !== 'public' && ssrProfile !== 'session') {
|
|
16
|
+
throw new Error(`invalid SSR profile: ${ssrProfile}`);
|
|
17
|
+
}
|
|
18
|
+
return ssrProfile;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export function resolveSsrProfileOptions(
|
|
22
|
+
ssrProfile: TypeSsrProfile,
|
|
23
|
+
profiles: Readonly<Record<TypeSsrProfile, ZovaConfigSsrProfile>>,
|
|
24
|
+
routeProfileOptions?: Readonly<ISsrRouteProfileOptions>,
|
|
25
|
+
): Readonly<ISsrProfileOptions> {
|
|
26
|
+
const profileOptions = profiles[ssrProfile];
|
|
27
|
+
if (!profileOptions) {
|
|
28
|
+
throw new Error(`invalid SSR profile: ${ssrProfile}`);
|
|
29
|
+
}
|
|
30
|
+
const responseCache = routeProfileOptions?.responseCache ?? profileOptions.responseCache;
|
|
31
|
+
return Object.freeze({
|
|
32
|
+
useCookie: ssrProfile === 'session' && profileOptions.useCookie,
|
|
33
|
+
responseCache:
|
|
34
|
+
responseCache === false
|
|
35
|
+
? false
|
|
36
|
+
: (Object.freeze({ ...responseCache }) as Readonly<ISsrResponseCachePolicy>),
|
|
37
|
+
});
|
|
38
|
+
}
|
package/src/monkey.ts
CHANGED
|
@@ -28,6 +28,20 @@ export class Monkey
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
async appInitialize() {
|
|
31
|
+
this.app.meta.event.on('a-router:routerGuards', async (router, next) => {
|
|
32
|
+
if (process.env.CLIENT) {
|
|
33
|
+
// Server profile state is prepared before appInitialize; this synchronizes client navigation.
|
|
34
|
+
router.beforeEach(to => {
|
|
35
|
+
this.ctx.meta.$ssr._setProfile(to.meta.ssrProfile, to.meta.ssrProfileOptions);
|
|
36
|
+
});
|
|
37
|
+
router.afterEach((_to, from, failure) => {
|
|
38
|
+
if (failure) {
|
|
39
|
+
this.ctx.meta.$ssr._setProfile(from.meta.ssrProfile, from.meta.ssrProfileOptions);
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
return await next();
|
|
44
|
+
});
|
|
31
45
|
if (process.env.CLIENT && this.ctx.meta.$ssr.isRuntimeSsrPreHydration) {
|
|
32
46
|
this.ctx.meta.$ssr.onHydrated(() => {
|
|
33
47
|
document.documentElement.setAttribute('data-zova-hydrated', this.sys.env.SITE_ID);
|
package/src/types/config.ts
CHANGED
|
@@ -1,20 +1,13 @@
|
|
|
1
1
|
import '@cabloy/vue-router';
|
|
2
|
-
import type {
|
|
3
|
-
|
|
4
|
-
export interface ISsrConfigTransferCache {
|
|
5
|
-
expires?: number | StringValue;
|
|
6
|
-
}
|
|
2
|
+
import type { ISsrRouteProfileOptions, TypeSsrProfile } from './ssr.js';
|
|
7
3
|
|
|
8
4
|
export interface ISsrConfig {
|
|
9
5
|
cookieThemeDarkDefault: boolean;
|
|
10
|
-
optimization: {
|
|
11
|
-
bodyReadyObserver: boolean;
|
|
12
|
-
};
|
|
13
|
-
transferCache: false | ISsrConfigTransferCache;
|
|
14
6
|
}
|
|
15
7
|
|
|
16
8
|
declare module '@cabloy/vue-router' {
|
|
17
9
|
export interface RouteMeta {
|
|
18
|
-
|
|
10
|
+
ssrProfile?: TypeSsrProfile;
|
|
11
|
+
ssrProfileOptions?: Readonly<ISsrRouteProfileOptions>;
|
|
19
12
|
}
|
|
20
13
|
}
|
package/src/types/ssr.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ComponentInternalInstance, VNode } from 'vue';
|
|
2
|
-
import type { ZovaConfigEnv } from 'zova';
|
|
2
|
+
import type { ZovaConfigEnv, ZovaConfigSsrProfile, ZovaConfigSsrResponseCachePolicy } from 'zova';
|
|
3
3
|
|
|
4
4
|
import type { CtxSSR } from '../lib/ssr.js';
|
|
5
5
|
import 'zova';
|
|
@@ -44,11 +44,27 @@ export interface SSRContextMeta {
|
|
|
44
44
|
renderError: ErrorSSR | string;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
+
export type TypeSsrProfile = 'public' | 'session';
|
|
48
|
+
|
|
49
|
+
export type ISsrResponseCachePolicy = ZovaConfigSsrResponseCachePolicy;
|
|
50
|
+
|
|
51
|
+
export interface ISsrRouteProfileOptions {
|
|
52
|
+
responseCache?: false | Readonly<ISsrResponseCachePolicy>;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export type ISsrProfileOptions = Readonly<
|
|
56
|
+
Omit<ZovaConfigSsrProfile, 'responseCache'> & {
|
|
57
|
+
responseCache: false | Readonly<ISsrResponseCachePolicy>;
|
|
58
|
+
}
|
|
59
|
+
>;
|
|
60
|
+
|
|
47
61
|
export interface SSRContextState {
|
|
48
62
|
envClient?: ZovaConfigEnv;
|
|
49
63
|
pagePathFull?: string;
|
|
50
64
|
pagePath?: string;
|
|
51
65
|
pageData?: unknown;
|
|
66
|
+
ssrProfile?: TypeSsrProfile;
|
|
67
|
+
ssrProfileOptions?: Readonly<ISsrProfileOptions>;
|
|
52
68
|
}
|
|
53
69
|
export interface SSRContextStateDefer {}
|
|
54
70
|
|
|
@@ -115,13 +131,6 @@ declare module 'zova' {
|
|
|
115
131
|
$ssr: CtxSSR;
|
|
116
132
|
$useMeta(options: SSRMetaOptions | (() => SSRMetaOptions)): void;
|
|
117
133
|
}
|
|
118
|
-
|
|
119
|
-
export interface ZovaConfigEnv {
|
|
120
|
-
SSR_COOKIE_THEMEDARK_DEFAULT: string | undefined;
|
|
121
|
-
SSR_BODYREADYOBSERVER: string | undefined;
|
|
122
|
-
SSR_TRANSFERCACHE: string | undefined;
|
|
123
|
-
SSR_TRANSFERCACHE_EXPIRES: string | undefined;
|
|
124
|
-
}
|
|
125
134
|
}
|
|
126
135
|
|
|
127
136
|
declare global {
|