vike 0.4.235-commit-16164c3 → 0.4.235-commit-8f42b16
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/cjs/node/runtime/html/injectAssets/injectHtmlTags.js +2 -0
- package/dist/cjs/node/runtime/html/serializeContext.js +14 -1
- package/dist/cjs/utils/PROJECT_VERSION.js +1 -1
- package/dist/esm/node/runtime/html/injectAssets/injectHtmlTags.js +2 -0
- package/dist/esm/node/runtime/html/serializeContext.js +14 -1
- package/dist/esm/utils/PROJECT_VERSION.d.ts +1 -1
- package/dist/esm/utils/PROJECT_VERSION.js +1 -1
- package/package.json +2 -2
|
@@ -150,6 +150,8 @@ function getTagClosing(tag) {
|
|
|
150
150
|
return tagClosing;
|
|
151
151
|
}
|
|
152
152
|
function injectAtPlaceholder(htmlFragment, htmlString, isFirst) {
|
|
153
|
+
// TO-DO/eventually: soft deprecate in favor of https://github.com/vikejs/vike/issues/695
|
|
154
|
+
// Used by BurdaForward https://github.com/vikejs/vike/discussions/2528#discussioncomment-13637156
|
|
153
155
|
const placeholder = isFirst ? '__VITE_PLUGIN_SSR__ASSETS_FIRST__' : '__VITE_PLUGIN__SSR_ASSETS_LAST__';
|
|
154
156
|
const parts = htmlString.split(placeholder);
|
|
155
157
|
if (parts.length === 1)
|
|
@@ -108,7 +108,20 @@ function serializeObject(obj, objName, passToClient) {
|
|
|
108
108
|
return serialized;
|
|
109
109
|
}
|
|
110
110
|
function serializeValue(value, varName) {
|
|
111
|
-
return (0, stringify_1.stringify)(value, {
|
|
111
|
+
return (0, stringify_1.stringify)(value, {
|
|
112
|
+
forbidReactElements: true,
|
|
113
|
+
valueName: varName,
|
|
114
|
+
// Prevent Google from crawling URLs in JSON:
|
|
115
|
+
// - https://github.com/vikejs/vike/discussions/2541#discussioncomment-13660198
|
|
116
|
+
// - https://github.com/vikejs/vike/discussions/2277
|
|
117
|
+
// - https://github.com/vikejs/vike/pull/2542
|
|
118
|
+
replacer(_key, value) {
|
|
119
|
+
if (typeof value === 'string' && value.startsWith('/')) {
|
|
120
|
+
// No need to use a reviver: https://github.com/brillout/json-serializer/blob/70fc8ed3741306391b51655b05df24e6963d1fdb/test/main.spec.ts#L74-L80
|
|
121
|
+
return { replacement: (value = '!' + value) };
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
});
|
|
112
125
|
}
|
|
113
126
|
function getPassToClientPageContext(pageContext) {
|
|
114
127
|
let passToClient = [...pageContext._passToClient, ...passToClientBuiltInPageContext];
|
|
@@ -149,6 +149,8 @@ function getTagClosing(tag) {
|
|
|
149
149
|
return tagClosing;
|
|
150
150
|
}
|
|
151
151
|
function injectAtPlaceholder(htmlFragment, htmlString, isFirst) {
|
|
152
|
+
// TO-DO/eventually: soft deprecate in favor of https://github.com/vikejs/vike/issues/695
|
|
153
|
+
// Used by BurdaForward https://github.com/vikejs/vike/discussions/2528#discussioncomment-13637156
|
|
152
154
|
const placeholder = isFirst ? '__VITE_PLUGIN_SSR__ASSETS_FIRST__' : '__VITE_PLUGIN__SSR_ASSETS_LAST__';
|
|
153
155
|
const parts = htmlString.split(placeholder);
|
|
154
156
|
if (parts.length === 1)
|
|
@@ -103,7 +103,20 @@ function serializeObject(obj, objName, passToClient) {
|
|
|
103
103
|
return serialized;
|
|
104
104
|
}
|
|
105
105
|
function serializeValue(value, varName) {
|
|
106
|
-
return stringify(value, {
|
|
106
|
+
return stringify(value, {
|
|
107
|
+
forbidReactElements: true,
|
|
108
|
+
valueName: varName,
|
|
109
|
+
// Prevent Google from crawling URLs in JSON:
|
|
110
|
+
// - https://github.com/vikejs/vike/discussions/2541#discussioncomment-13660198
|
|
111
|
+
// - https://github.com/vikejs/vike/discussions/2277
|
|
112
|
+
// - https://github.com/vikejs/vike/pull/2542
|
|
113
|
+
replacer(_key, value) {
|
|
114
|
+
if (typeof value === 'string' && value.startsWith('/')) {
|
|
115
|
+
// No need to use a reviver: https://github.com/brillout/json-serializer/blob/70fc8ed3741306391b51655b05df24e6963d1fdb/test/main.spec.ts#L74-L80
|
|
116
|
+
return { replacement: (value = '!' + value) };
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
});
|
|
107
120
|
}
|
|
108
121
|
function getPassToClientPageContext(pageContext) {
|
|
109
122
|
let passToClient = [...pageContext._passToClient, ...passToClientBuiltInPageContext];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const PROJECT_VERSION: "0.4.235-commit-
|
|
1
|
+
export declare const PROJECT_VERSION: "0.4.235-commit-8f42b16";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Automatically updated by @brillout/release-me
|
|
2
|
-
export const PROJECT_VERSION = '0.4.235-commit-
|
|
2
|
+
export const PROJECT_VERSION = '0.4.235-commit-8f42b16';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vike",
|
|
3
|
-
"version": "0.4.235-commit-
|
|
3
|
+
"version": "0.4.235-commit-8f42b16",
|
|
4
4
|
"repository": "https://github.com/vikejs/vike",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./server": {
|
|
@@ -120,7 +120,7 @@
|
|
|
120
120
|
},
|
|
121
121
|
"dependencies": {
|
|
122
122
|
"@brillout/import": "^0.2.6",
|
|
123
|
-
"@brillout/json-serializer": "^0.5.
|
|
123
|
+
"@brillout/json-serializer": "^0.5.16",
|
|
124
124
|
"@brillout/picocolors": "^1.0.26",
|
|
125
125
|
"@brillout/require-shim": "^0.1.2",
|
|
126
126
|
"@brillout/vite-plugin-server-entry": "^0.7.8",
|