@vue/server-renderer 3.2.15 → 3.2.19
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.
|
@@ -104,23 +104,37 @@ function ssrRenderStyle(raw) {
|
|
|
104
104
|
|
|
105
105
|
const compileCache = Object.create(null);
|
|
106
106
|
function ssrCompile(template, instance) {
|
|
107
|
-
|
|
107
|
+
// TODO: This is copied from runtime-core/src/component.ts and should probably be refactored
|
|
108
|
+
const Component = instance.type;
|
|
109
|
+
const { isCustomElement, compilerOptions } = instance.appContext.config;
|
|
110
|
+
const { delimiters, compilerOptions: componentCompilerOptions } = Component;
|
|
111
|
+
const finalCompilerOptions = shared.extend(shared.extend({
|
|
112
|
+
isCustomElement,
|
|
113
|
+
delimiters
|
|
114
|
+
}, compilerOptions), componentCompilerOptions);
|
|
115
|
+
finalCompilerOptions.isCustomElement =
|
|
116
|
+
finalCompilerOptions.isCustomElement || shared.NO;
|
|
117
|
+
finalCompilerOptions.isNativeTag = finalCompilerOptions.isNativeTag || shared.NO;
|
|
118
|
+
const cacheKey = JSON.stringify({
|
|
119
|
+
template,
|
|
120
|
+
compilerOptions: finalCompilerOptions
|
|
121
|
+
}, (key, value) => {
|
|
122
|
+
return shared.isFunction(value) ? value.toString() : value;
|
|
123
|
+
});
|
|
124
|
+
const cached = compileCache[cacheKey];
|
|
108
125
|
if (cached) {
|
|
109
126
|
return cached;
|
|
110
127
|
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
const codeFrame = err.loc &&
|
|
118
|
-
shared.generateCodeFrame(template, err.loc.start.offset, err.loc.end.offset);
|
|
119
|
-
vue.warn(codeFrame ? `${message}\n${codeFrame}` : message);
|
|
120
|
-
}
|
|
128
|
+
finalCompilerOptions.onError = (err) => {
|
|
129
|
+
{
|
|
130
|
+
const message = `[@vue/server-renderer] Template compilation error: ${err.message}`;
|
|
131
|
+
const codeFrame = err.loc &&
|
|
132
|
+
shared.generateCodeFrame(template, err.loc.start.offset, err.loc.end.offset);
|
|
133
|
+
vue.warn(codeFrame ? `${message}\n${codeFrame}` : message);
|
|
121
134
|
}
|
|
122
|
-
}
|
|
123
|
-
|
|
135
|
+
};
|
|
136
|
+
const { code } = compilerSsr.compile(template, finalCompilerOptions);
|
|
137
|
+
return (compileCache[cacheKey] = Function('require', code)(require));
|
|
124
138
|
}
|
|
125
139
|
|
|
126
140
|
function ssrRenderTeleport(parentPush, contentRenderFn, target, disabled, parentComponent) {
|
|
@@ -977,6 +991,8 @@ function ssrGetDynamicModelProps(existingProps = {}, model) {
|
|
|
977
991
|
}
|
|
978
992
|
}
|
|
979
993
|
|
|
994
|
+
vue.initDirectivesForSSR();
|
|
995
|
+
|
|
980
996
|
exports.ssrIncludeBooleanAttr = shared.includeBooleanAttr;
|
|
981
997
|
exports.pipeToNodeWritable = pipeToNodeWritable;
|
|
982
998
|
exports.pipeToWebWritable = pipeToWebWritable;
|
|
@@ -104,20 +104,34 @@ function ssrRenderStyle(raw) {
|
|
|
104
104
|
|
|
105
105
|
const compileCache = Object.create(null);
|
|
106
106
|
function ssrCompile(template, instance) {
|
|
107
|
-
|
|
107
|
+
// TODO: This is copied from runtime-core/src/component.ts and should probably be refactored
|
|
108
|
+
const Component = instance.type;
|
|
109
|
+
const { isCustomElement, compilerOptions } = instance.appContext.config;
|
|
110
|
+
const { delimiters, compilerOptions: componentCompilerOptions } = Component;
|
|
111
|
+
const finalCompilerOptions = shared.extend(shared.extend({
|
|
112
|
+
isCustomElement,
|
|
113
|
+
delimiters
|
|
114
|
+
}, compilerOptions), componentCompilerOptions);
|
|
115
|
+
finalCompilerOptions.isCustomElement =
|
|
116
|
+
finalCompilerOptions.isCustomElement || shared.NO;
|
|
117
|
+
finalCompilerOptions.isNativeTag = finalCompilerOptions.isNativeTag || shared.NO;
|
|
118
|
+
const cacheKey = JSON.stringify({
|
|
119
|
+
template,
|
|
120
|
+
compilerOptions: finalCompilerOptions
|
|
121
|
+
}, (key, value) => {
|
|
122
|
+
return shared.isFunction(value) ? value.toString() : value;
|
|
123
|
+
});
|
|
124
|
+
const cached = compileCache[cacheKey];
|
|
108
125
|
if (cached) {
|
|
109
126
|
return cached;
|
|
110
127
|
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
onError(err) {
|
|
115
|
-
{
|
|
116
|
-
throw err;
|
|
117
|
-
}
|
|
128
|
+
finalCompilerOptions.onError = (err) => {
|
|
129
|
+
{
|
|
130
|
+
throw err;
|
|
118
131
|
}
|
|
119
|
-
}
|
|
120
|
-
|
|
132
|
+
};
|
|
133
|
+
const { code } = compilerSsr.compile(template, finalCompilerOptions);
|
|
134
|
+
return (compileCache[cacheKey] = Function('require', code)(require));
|
|
121
135
|
}
|
|
122
136
|
|
|
123
137
|
function ssrRenderTeleport(parentPush, contentRenderFn, target, disabled, parentComponent) {
|
|
@@ -729,6 +743,8 @@ function ssrGetDynamicModelProps(existingProps = {}, model) {
|
|
|
729
743
|
}
|
|
730
744
|
}
|
|
731
745
|
|
|
746
|
+
vue.initDirectivesForSSR();
|
|
747
|
+
|
|
732
748
|
exports.ssrIncludeBooleanAttr = shared.includeBooleanAttr;
|
|
733
749
|
exports.pipeToNodeWritable = pipeToNodeWritable;
|
|
734
750
|
exports.pipeToWebWritable = pipeToWebWritable;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ssrContextKey, warn as warn$1, Fragment, Static, Comment, Text, mergeProps, ssrUtils, createApp, createVNode } from 'vue';
|
|
1
|
+
import { ssrContextKey, warn as warn$1, Fragment, Static, Comment, Text, mergeProps, ssrUtils, createApp, createVNode, initDirectivesForSSR } from 'vue';
|
|
2
2
|
import { makeMap, isOn, escapeHtml, normalizeClass, propsToAttrMap, isBooleanAttr, includeBooleanAttr, isSSRSafeAttrName, isString, normalizeStyle, stringifyStyle, escapeHtmlComment, isVoidTag, isPromise, isArray, isFunction, NOOP, toDisplayString, isObject, looseEqual, looseIndexOf } from '@vue/shared';
|
|
3
3
|
export { includeBooleanAttr as ssrIncludeBooleanAttr } from '@vue/shared';
|
|
4
4
|
|
|
@@ -962,4 +962,6 @@ function ssrGetDynamicModelProps(existingProps = {}, model) {
|
|
|
962
962
|
}
|
|
963
963
|
}
|
|
964
964
|
|
|
965
|
+
initDirectivesForSSR();
|
|
966
|
+
|
|
965
967
|
export { pipeToNodeWritable, pipeToWebWritable, renderToNodeStream, renderToSimpleStream, renderToStream, renderToString, renderToWebStream, ssrGetDynamicModelProps, ssrInterpolate, ssrLooseContain, ssrLooseEqual, ssrRenderAttr, ssrRenderAttrs, ssrRenderClass, ssrRenderComponent, ssrRenderDynamicAttr, ssrRenderDynamicModel, ssrRenderList, ssrRenderSlot, ssrRenderStyle, ssrRenderSuspense, ssrRenderTeleport, renderVNode as ssrRenderVNode };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vue/server-renderer",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.19",
|
|
4
4
|
"description": "@vue/server-renderer",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "dist/server-renderer.esm-bundler.js",
|
|
@@ -31,10 +31,10 @@
|
|
|
31
31
|
},
|
|
32
32
|
"homepage": "https://github.com/vuejs/vue-next/tree/master/packages/server-renderer#readme",
|
|
33
33
|
"peerDependencies": {
|
|
34
|
-
"vue": "3.2.
|
|
34
|
+
"vue": "3.2.19"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@vue/shared": "3.2.
|
|
38
|
-
"@vue/compiler-ssr": "3.2.
|
|
37
|
+
"@vue/shared": "3.2.19",
|
|
38
|
+
"@vue/compiler-ssr": "3.2.19"
|
|
39
39
|
}
|
|
40
40
|
}
|