@ubean/client 0.3.4 → 0.3.5
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/ssr.js +3 -3
- package/package.json +7 -7
package/dist/ssr.js
CHANGED
|
@@ -3,7 +3,7 @@ import { applyAppConfig } from "./define-app.js";
|
|
|
3
3
|
import { createSSRApp, defineComponent, h, provide, reactive } from "vue";
|
|
4
4
|
import { SSR_CONTENT_MARKER, STATE_DATA_ID, STATE_MARKER, __clearDataPayload, __clearDeferred, __resolveDataPayload, __resolveDeferred, __serializeDataPayload, __serializeDeferred, safeJsonStringify } from "@ubean/pages";
|
|
5
5
|
import { buildLocaleHead } from "@ubean/i18n/browser";
|
|
6
|
-
import { createHead,
|
|
6
|
+
import { createHead, transformHtmlTemplate } from "@unhead/vue/server";
|
|
7
7
|
import { renderToNodeStream, renderToString, renderToString as renderToString$1 } from "@vue/server-renderer";
|
|
8
8
|
import { getIslandsBootstrapScript } from "@ubean/islands";
|
|
9
9
|
//#region src/ssr.ts
|
|
@@ -164,7 +164,7 @@ async function resolveState(app, appConfig) {
|
|
|
164
164
|
* (title, og:tags, etc.) without waiting for client hydration.
|
|
165
165
|
*/
|
|
166
166
|
function collectDynamicHeadTags(head, staticHeadTags) {
|
|
167
|
-
const fullTags =
|
|
167
|
+
const fullTags = head.render().headTags || "";
|
|
168
168
|
if (!fullTags || fullTags === staticHeadTags) return "";
|
|
169
169
|
const staticLines = new Set(staticHeadTags.split("\n").map((l) => l.trim()).filter(Boolean));
|
|
170
170
|
const dynamicLines = fullTags.split("\n").map((l) => l.trim()).filter((l) => Boolean(l) && !staticLines.has(l));
|
|
@@ -249,7 +249,7 @@ function createVueRenderer(options) {
|
|
|
249
249
|
const stateScriptRegex = new RegExp(`<script id="${STATE_DATA_ID}" type="application/json">${STATE_MARKER}<\/script>`);
|
|
250
250
|
headPart = headPart.replace(stateScriptRegex, "");
|
|
251
251
|
headPart = transformHtmlTemplate(head, headPart);
|
|
252
|
-
const staticHeadTags =
|
|
252
|
+
const staticHeadTags = head.render().headTags || "";
|
|
253
253
|
controller.enqueue(encoder.encode(headPart));
|
|
254
254
|
await pumpVueStream(renderToNodeStream(app), controller);
|
|
255
255
|
const dynamicHeadTags = collectDynamicHeadTags(head, staticHeadTags);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ubean/client",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.5",
|
|
4
4
|
"description": "Framework client runtime for ubean — layered over the lean @ubean/vue kernel, adding app factories, unhead, i18n, data layer, islands hydration and SSR state helpers",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -32,11 +32,11 @@
|
|
|
32
32
|
}
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@ubean/i18n": "0.3.
|
|
36
|
-
"@ubean/islands": "0.3.
|
|
37
|
-
"@ubean/pages": "0.3.
|
|
38
|
-
"@ubean/shared": "0.3.
|
|
39
|
-
"@ubean/vue": "0.3.
|
|
35
|
+
"@ubean/i18n": "0.3.5",
|
|
36
|
+
"@ubean/islands": "0.3.5",
|
|
37
|
+
"@ubean/pages": "0.3.5",
|
|
38
|
+
"@ubean/shared": "0.3.5",
|
|
39
|
+
"@ubean/vue": "0.3.5",
|
|
40
40
|
"@unhead/vue": "^3.4.0",
|
|
41
41
|
"@vue/server-renderer": "^3.5.42",
|
|
42
42
|
"vue": "^3.5.42",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"vite-plus": "0.3.0"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
|
-
"@ubean/seo": "0.3.
|
|
52
|
+
"@ubean/seo": "0.3.5"
|
|
53
53
|
},
|
|
54
54
|
"peerDependenciesMeta": {
|
|
55
55
|
"@ubean/seo": {
|