@vue/server-renderer 3.2.47 → 3.3.0-alpha.2
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/server-renderer.cjs.js +836 -864
- package/dist/server-renderer.cjs.prod.js +639 -656
- package/dist/server-renderer.d.ts +71 -101
- package/dist/server-renderer.esm-browser.js +6724 -7333
- package/dist/server-renderer.esm-browser.prod.js +1 -1
- package/dist/server-renderer.esm-bundler.js +812 -852
- package/package.json +4 -4
|
@@ -2,1010 +2,970 @@ import { createVNode, ssrContextKey, warn as warn$1, Fragment, Static, Comment,
|
|
|
2
2
|
import { makeMap, isOn, isSVGTag, propsToAttrMap, isBooleanAttr, includeBooleanAttr, isSSRSafeAttrName, escapeHtml, normalizeClass, isString, normalizeStyle, stringifyStyle, isArray, toDisplayString, isFunction, isObject, looseEqual, looseIndexOf, isPromise, NOOP, escapeHtmlComment, isVoidTag } from '@vue/shared';
|
|
3
3
|
export { includeBooleanAttr as ssrIncludeBooleanAttr } from '@vue/shared';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
const shouldIgnoreProp = makeMap(
|
|
6
|
+
`,key,ref,innerHTML,textContent,ref_key,ref_for`
|
|
7
|
+
);
|
|
7
8
|
function ssrRenderAttrs(props, tag) {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
ret += ssrRenderDynamicAttr(key, value, tag);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
return ret;
|
|
9
|
+
let ret = "";
|
|
10
|
+
for (const key in props) {
|
|
11
|
+
if (shouldIgnoreProp(key) || isOn(key) || tag === "textarea" && key === "value") {
|
|
12
|
+
continue;
|
|
13
|
+
}
|
|
14
|
+
const value = props[key];
|
|
15
|
+
if (key === "class") {
|
|
16
|
+
ret += ` class="${ssrRenderClass(value)}"`;
|
|
17
|
+
} else if (key === "style") {
|
|
18
|
+
ret += ` style="${ssrRenderStyle(value)}"`;
|
|
19
|
+
} else {
|
|
20
|
+
ret += ssrRenderDynamicAttr(key, value, tag);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return ret;
|
|
27
24
|
}
|
|
28
|
-
// render an attr with dynamic (unknown) key.
|
|
29
25
|
function ssrRenderDynamicAttr(key, value, tag) {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
return ``;
|
|
45
|
-
}
|
|
26
|
+
if (!isRenderableValue(value)) {
|
|
27
|
+
return ``;
|
|
28
|
+
}
|
|
29
|
+
const attrKey = tag && (tag.indexOf("-") > 0 || isSVGTag(tag)) ? key : propsToAttrMap[key] || key.toLowerCase();
|
|
30
|
+
if (isBooleanAttr(attrKey)) {
|
|
31
|
+
return includeBooleanAttr(value) ? ` ${attrKey}` : ``;
|
|
32
|
+
} else if (isSSRSafeAttrName(attrKey)) {
|
|
33
|
+
return value === "" ? ` ${attrKey}` : ` ${attrKey}="${escapeHtml(value)}"`;
|
|
34
|
+
} else {
|
|
35
|
+
console.warn(
|
|
36
|
+
`[@vue/server-renderer] Skipped rendering unsafe attribute name: ${attrKey}`
|
|
37
|
+
);
|
|
38
|
+
return ``;
|
|
39
|
+
}
|
|
46
40
|
}
|
|
47
|
-
// Render a v-bind attr with static key. The key is pre-processed at compile
|
|
48
|
-
// time and we only need to check and escape value.
|
|
49
41
|
function ssrRenderAttr(key, value) {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
42
|
+
if (!isRenderableValue(value)) {
|
|
43
|
+
return ``;
|
|
44
|
+
}
|
|
45
|
+
return ` ${key}="${escapeHtml(value)}"`;
|
|
54
46
|
}
|
|
55
47
|
function isRenderableValue(value) {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
48
|
+
if (value == null) {
|
|
49
|
+
return false;
|
|
50
|
+
}
|
|
51
|
+
const type = typeof value;
|
|
52
|
+
return type === "string" || type === "number" || type === "boolean";
|
|
61
53
|
}
|
|
62
54
|
function ssrRenderClass(raw) {
|
|
63
|
-
|
|
55
|
+
return escapeHtml(normalizeClass(raw));
|
|
64
56
|
}
|
|
65
57
|
function ssrRenderStyle(raw) {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
58
|
+
if (!raw) {
|
|
59
|
+
return "";
|
|
60
|
+
}
|
|
61
|
+
if (isString(raw)) {
|
|
62
|
+
return escapeHtml(raw);
|
|
63
|
+
}
|
|
64
|
+
const styles = normalizeStyle(raw);
|
|
65
|
+
return escapeHtml(stringifyStyle(styles));
|
|
74
66
|
}
|
|
75
67
|
|
|
76
68
|
function ssrRenderComponent(comp, props = null, children = null, parentComponent = null, slotScopeId) {
|
|
77
|
-
|
|
69
|
+
return renderComponentVNode(
|
|
70
|
+
createVNode(comp, props, children),
|
|
71
|
+
parentComponent,
|
|
72
|
+
slotScopeId
|
|
73
|
+
);
|
|
78
74
|
}
|
|
79
75
|
|
|
80
76
|
function ssrRenderSlot(slots, slotName, slotProps, fallbackRenderFn, push, parentComponent, slotScopeId) {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
77
|
+
push(`<!--[-->`);
|
|
78
|
+
ssrRenderSlotInner(
|
|
79
|
+
slots,
|
|
80
|
+
slotName,
|
|
81
|
+
slotProps,
|
|
82
|
+
fallbackRenderFn,
|
|
83
|
+
push,
|
|
84
|
+
parentComponent,
|
|
85
|
+
slotScopeId
|
|
86
|
+
);
|
|
87
|
+
push(`<!--]-->`);
|
|
85
88
|
}
|
|
86
89
|
function ssrRenderSlotInner(slots, slotName, slotProps, fallbackRenderFn, push, parentComponent, slotScopeId, transition) {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
90
|
+
const slotFn = slots[slotName];
|
|
91
|
+
if (slotFn) {
|
|
92
|
+
const slotBuffer = [];
|
|
93
|
+
const bufferedPush = (item) => {
|
|
94
|
+
slotBuffer.push(item);
|
|
95
|
+
};
|
|
96
|
+
const ret = slotFn(
|
|
97
|
+
slotProps,
|
|
98
|
+
bufferedPush,
|
|
99
|
+
parentComponent,
|
|
100
|
+
slotScopeId ? " " + slotScopeId : ""
|
|
101
|
+
);
|
|
102
|
+
if (isArray(ret)) {
|
|
103
|
+
renderVNodeChildren(push, ret, parentComponent, slotScopeId);
|
|
104
|
+
} else {
|
|
105
|
+
let isEmptySlot = true;
|
|
106
|
+
if (transition) {
|
|
107
|
+
isEmptySlot = false;
|
|
108
|
+
} else {
|
|
109
|
+
for (let i = 0; i < slotBuffer.length; i++) {
|
|
110
|
+
if (!isComment(slotBuffer[i])) {
|
|
111
|
+
isEmptySlot = false;
|
|
112
|
+
break;
|
|
113
|
+
}
|
|
97
114
|
}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
if (transition) {
|
|
103
|
-
isEmptySlot = false;
|
|
104
|
-
}
|
|
105
|
-
else {
|
|
106
|
-
for (let i = 0; i < slotBuffer.length; i++) {
|
|
107
|
-
if (!isComment(slotBuffer[i])) {
|
|
108
|
-
isEmptySlot = false;
|
|
109
|
-
break;
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
if (isEmptySlot) {
|
|
114
|
-
if (fallbackRenderFn) {
|
|
115
|
-
fallbackRenderFn();
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
else {
|
|
119
|
-
for (let i = 0; i < slotBuffer.length; i++) {
|
|
120
|
-
push(slotBuffer[i]);
|
|
121
|
-
}
|
|
122
|
-
}
|
|
115
|
+
}
|
|
116
|
+
if (isEmptySlot) {
|
|
117
|
+
if (fallbackRenderFn) {
|
|
118
|
+
fallbackRenderFn();
|
|
123
119
|
}
|
|
120
|
+
} else {
|
|
121
|
+
for (let i = 0; i < slotBuffer.length; i++) {
|
|
122
|
+
push(slotBuffer[i]);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
124
125
|
}
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
126
|
+
} else if (fallbackRenderFn) {
|
|
127
|
+
fallbackRenderFn();
|
|
128
|
+
}
|
|
128
129
|
}
|
|
129
130
|
const commentTestRE = /^<!--.*-->$/s;
|
|
130
131
|
const commentRE = /<!--[^]*?-->/gm;
|
|
131
132
|
function isComment(item) {
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
return !item.replace(commentRE, '').trim();
|
|
133
|
+
if (typeof item !== "string" || !commentTestRE.test(item))
|
|
134
|
+
return false;
|
|
135
|
+
if (item.length <= 8)
|
|
136
|
+
return true;
|
|
137
|
+
return !item.replace(commentRE, "").trim();
|
|
138
138
|
}
|
|
139
139
|
|
|
140
140
|
function ssrRenderTeleport(parentPush, contentRenderFn, target, disabled, parentComponent) {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
}
|
|
159
|
-
targetBuffer.splice(bufferIndex, 0, teleportContent);
|
|
160
|
-
parentPush('<!--teleport end-->');
|
|
141
|
+
parentPush("<!--teleport start-->");
|
|
142
|
+
const context = parentComponent.appContext.provides[ssrContextKey];
|
|
143
|
+
const teleportBuffers = context.__teleportBuffers || (context.__teleportBuffers = {});
|
|
144
|
+
const targetBuffer = teleportBuffers[target] || (teleportBuffers[target] = []);
|
|
145
|
+
const bufferIndex = targetBuffer.length;
|
|
146
|
+
let teleportContent;
|
|
147
|
+
if (disabled) {
|
|
148
|
+
contentRenderFn(parentPush);
|
|
149
|
+
teleportContent = `<!--teleport anchor-->`;
|
|
150
|
+
} else {
|
|
151
|
+
const { getBuffer, push } = createBuffer();
|
|
152
|
+
contentRenderFn(push);
|
|
153
|
+
push(`<!--teleport anchor-->`);
|
|
154
|
+
teleportContent = getBuffer();
|
|
155
|
+
}
|
|
156
|
+
targetBuffer.splice(bufferIndex, 0, teleportContent);
|
|
157
|
+
parentPush("<!--teleport end-->");
|
|
161
158
|
}
|
|
162
159
|
|
|
163
160
|
function ssrInterpolate(value) {
|
|
164
|
-
|
|
161
|
+
return escapeHtml(toDisplayString(value));
|
|
165
162
|
}
|
|
166
163
|
|
|
167
|
-
Symbol(
|
|
168
|
-
Symbol(
|
|
164
|
+
Symbol(process.env.NODE_ENV !== "production" ? "iterate" : "");
|
|
165
|
+
Symbol(process.env.NODE_ENV !== "production" ? "Map key iterate" : "");
|
|
169
166
|
let shouldTrack = true;
|
|
170
167
|
const trackStack = [];
|
|
171
168
|
function pauseTracking() {
|
|
172
|
-
|
|
173
|
-
|
|
169
|
+
trackStack.push(shouldTrack);
|
|
170
|
+
shouldTrack = false;
|
|
174
171
|
}
|
|
175
172
|
function resetTracking() {
|
|
176
|
-
|
|
177
|
-
|
|
173
|
+
const last = trackStack.pop();
|
|
174
|
+
shouldTrack = last === void 0 ? true : last;
|
|
178
175
|
}
|
|
179
176
|
|
|
180
177
|
function toRaw(observed) {
|
|
181
|
-
|
|
182
|
-
|
|
178
|
+
const raw = observed && observed["__v_raw"];
|
|
179
|
+
return raw ? toRaw(raw) : observed;
|
|
183
180
|
}
|
|
184
181
|
|
|
185
182
|
function isRef(r) {
|
|
186
|
-
|
|
183
|
+
return !!(r && r.__v_isRef === true);
|
|
187
184
|
}
|
|
188
185
|
|
|
189
186
|
const stack = [];
|
|
190
187
|
function pushWarningContext(vnode) {
|
|
191
|
-
|
|
188
|
+
stack.push(vnode);
|
|
192
189
|
}
|
|
193
190
|
function popWarningContext() {
|
|
194
|
-
|
|
191
|
+
stack.pop();
|
|
195
192
|
}
|
|
196
193
|
function warn(msg, ...args) {
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
194
|
+
if (!process.env.NODE_ENV !== "production")
|
|
195
|
+
return;
|
|
196
|
+
pauseTracking();
|
|
197
|
+
const instance = stack.length ? stack[stack.length - 1].component : null;
|
|
198
|
+
const appWarnHandler = instance && instance.appContext.config.warnHandler;
|
|
199
|
+
const trace = getComponentTrace();
|
|
200
|
+
if (appWarnHandler) {
|
|
201
|
+
callWithErrorHandling(
|
|
202
|
+
appWarnHandler,
|
|
203
|
+
instance,
|
|
204
|
+
11,
|
|
205
|
+
[
|
|
206
|
+
msg + args.join(""),
|
|
207
|
+
instance && instance.proxy,
|
|
208
|
+
trace.map(
|
|
209
|
+
({ vnode }) => `at <${formatComponentName(instance, vnode.type)}>`
|
|
210
|
+
).join("\n"),
|
|
211
|
+
trace
|
|
212
|
+
]
|
|
213
|
+
);
|
|
214
|
+
} else {
|
|
215
|
+
const warnArgs = [`[Vue warn]: ${msg}`, ...args];
|
|
216
|
+
if (trace.length && // avoid spamming console during tests
|
|
217
|
+
true) {
|
|
218
|
+
warnArgs.push(`
|
|
219
|
+
`, ...formatTrace(trace));
|
|
220
|
+
}
|
|
221
|
+
console.warn(...warnArgs);
|
|
222
|
+
}
|
|
223
|
+
resetTracking();
|
|
226
224
|
}
|
|
227
225
|
function getComponentTrace() {
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
const parentInstance = currentVNode.component && currentVNode.component.parent;
|
|
248
|
-
currentVNode = parentInstance && parentInstance.vnode;
|
|
249
|
-
}
|
|
250
|
-
return normalizedStack;
|
|
226
|
+
let currentVNode = stack[stack.length - 1];
|
|
227
|
+
if (!currentVNode) {
|
|
228
|
+
return [];
|
|
229
|
+
}
|
|
230
|
+
const normalizedStack = [];
|
|
231
|
+
while (currentVNode) {
|
|
232
|
+
const last = normalizedStack[0];
|
|
233
|
+
if (last && last.vnode === currentVNode) {
|
|
234
|
+
last.recurseCount++;
|
|
235
|
+
} else {
|
|
236
|
+
normalizedStack.push({
|
|
237
|
+
vnode: currentVNode,
|
|
238
|
+
recurseCount: 0
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
const parentInstance = currentVNode.component && currentVNode.component.parent;
|
|
242
|
+
currentVNode = parentInstance && parentInstance.vnode;
|
|
243
|
+
}
|
|
244
|
+
return normalizedStack;
|
|
251
245
|
}
|
|
252
|
-
/* istanbul ignore next */
|
|
253
246
|
function formatTrace(trace) {
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
247
|
+
const logs = [];
|
|
248
|
+
trace.forEach((entry, i) => {
|
|
249
|
+
logs.push(...i === 0 ? [] : [`
|
|
250
|
+
`], ...formatTraceEntry(entry));
|
|
251
|
+
});
|
|
252
|
+
return logs;
|
|
259
253
|
}
|
|
260
254
|
function formatTraceEntry({ vnode, recurseCount }) {
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
255
|
+
const postfix = recurseCount > 0 ? `... (${recurseCount} recursive calls)` : ``;
|
|
256
|
+
const isRoot = vnode.component ? vnode.component.parent == null : false;
|
|
257
|
+
const open = ` at <${formatComponentName(
|
|
258
|
+
vnode.component,
|
|
259
|
+
vnode.type,
|
|
260
|
+
isRoot
|
|
261
|
+
)}`;
|
|
262
|
+
const close = `>` + postfix;
|
|
263
|
+
return vnode.props ? [open, ...formatProps(vnode.props), close] : [open + close];
|
|
264
|
+
}
|
|
270
265
|
function formatProps(props) {
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
266
|
+
const res = [];
|
|
267
|
+
const keys = Object.keys(props);
|
|
268
|
+
keys.slice(0, 3).forEach((key) => {
|
|
269
|
+
res.push(...formatProp(key, props[key]));
|
|
270
|
+
});
|
|
271
|
+
if (keys.length > 3) {
|
|
272
|
+
res.push(` ...`);
|
|
273
|
+
}
|
|
274
|
+
return res;
|
|
280
275
|
}
|
|
281
|
-
/* istanbul ignore next */
|
|
282
276
|
function formatProp(key, value, raw) {
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
return [`${key}=fn${value.name ? `<${value.name}>` : ``}`];
|
|
298
|
-
}
|
|
299
|
-
else {
|
|
300
|
-
value = toRaw(value);
|
|
301
|
-
return raw ? value : [`${key}=`, value];
|
|
302
|
-
}
|
|
277
|
+
if (isString(value)) {
|
|
278
|
+
value = JSON.stringify(value);
|
|
279
|
+
return raw ? value : [`${key}=${value}`];
|
|
280
|
+
} else if (typeof value === "number" || typeof value === "boolean" || value == null) {
|
|
281
|
+
return raw ? value : [`${key}=${value}`];
|
|
282
|
+
} else if (isRef(value)) {
|
|
283
|
+
value = formatProp(key, toRaw(value.value), true);
|
|
284
|
+
return raw ? value : [`${key}=Ref<`, value, `>`];
|
|
285
|
+
} else if (isFunction(value)) {
|
|
286
|
+
return [`${key}=fn${value.name ? `<${value.name}>` : ``}`];
|
|
287
|
+
} else {
|
|
288
|
+
value = toRaw(value);
|
|
289
|
+
return raw ? value : [`${key}=`, value];
|
|
290
|
+
}
|
|
303
291
|
}
|
|
304
292
|
|
|
305
293
|
const ErrorTypeStrings = {
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
'Please open an issue at https://new-issue.vuejs.org/?repo=vuejs/core'
|
|
294
|
+
["sp"]: "serverPrefetch hook",
|
|
295
|
+
["bc"]: "beforeCreate hook",
|
|
296
|
+
["c"]: "created hook",
|
|
297
|
+
["bm"]: "beforeMount hook",
|
|
298
|
+
["m"]: "mounted hook",
|
|
299
|
+
["bu"]: "beforeUpdate hook",
|
|
300
|
+
["u"]: "updated",
|
|
301
|
+
["bum"]: "beforeUnmount hook",
|
|
302
|
+
["um"]: "unmounted hook",
|
|
303
|
+
["a"]: "activated hook",
|
|
304
|
+
["da"]: "deactivated hook",
|
|
305
|
+
["ec"]: "errorCaptured hook",
|
|
306
|
+
["rtc"]: "renderTracked hook",
|
|
307
|
+
["rtg"]: "renderTriggered hook",
|
|
308
|
+
[0]: "setup function",
|
|
309
|
+
[1]: "render function",
|
|
310
|
+
[2]: "watcher getter",
|
|
311
|
+
[3]: "watcher callback",
|
|
312
|
+
[4]: "watcher cleanup function",
|
|
313
|
+
[5]: "native event handler",
|
|
314
|
+
[6]: "component event handler",
|
|
315
|
+
[7]: "vnode hook",
|
|
316
|
+
[8]: "directive hook",
|
|
317
|
+
[9]: "transition hook",
|
|
318
|
+
[10]: "app errorHandler",
|
|
319
|
+
[11]: "app warnHandler",
|
|
320
|
+
[12]: "ref function",
|
|
321
|
+
[13]: "async component loader",
|
|
322
|
+
[14]: "scheduler flush. This is likely a Vue internals bug. Please open an issue at https://new-issue.vuejs.org/?repo=vuejs/core"
|
|
336
323
|
};
|
|
337
324
|
function callWithErrorHandling(fn, instance, type, args) {
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
return res;
|
|
325
|
+
let res;
|
|
326
|
+
try {
|
|
327
|
+
res = args ? fn(...args) : fn();
|
|
328
|
+
} catch (err) {
|
|
329
|
+
handleError(err, instance, type);
|
|
330
|
+
}
|
|
331
|
+
return res;
|
|
346
332
|
}
|
|
347
333
|
function handleError(err, instance, type, throwInDev = true) {
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
for (let i = 0; i < errorCapturedHooks.length; i++) {
|
|
359
|
-
if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) {
|
|
360
|
-
return;
|
|
361
|
-
}
|
|
362
|
-
}
|
|
363
|
-
}
|
|
364
|
-
cur = cur.parent;
|
|
365
|
-
}
|
|
366
|
-
// app-level handling
|
|
367
|
-
const appErrorHandler = instance.appContext.config.errorHandler;
|
|
368
|
-
if (appErrorHandler) {
|
|
369
|
-
callWithErrorHandling(appErrorHandler, null, 10 /* ErrorCodes.APP_ERROR_HANDLER */, [err, exposedInstance, errorInfo]);
|
|
334
|
+
const contextVNode = instance ? instance.vnode : null;
|
|
335
|
+
if (instance) {
|
|
336
|
+
let cur = instance.parent;
|
|
337
|
+
const exposedInstance = instance.proxy;
|
|
338
|
+
const errorInfo = process.env.NODE_ENV !== "production" ? ErrorTypeStrings[type] : type;
|
|
339
|
+
while (cur) {
|
|
340
|
+
const errorCapturedHooks = cur.ec;
|
|
341
|
+
if (errorCapturedHooks) {
|
|
342
|
+
for (let i = 0; i < errorCapturedHooks.length; i++) {
|
|
343
|
+
if (errorCapturedHooks[i](err, exposedInstance, errorInfo) === false) {
|
|
370
344
|
return;
|
|
345
|
+
}
|
|
371
346
|
}
|
|
347
|
+
}
|
|
348
|
+
cur = cur.parent;
|
|
349
|
+
}
|
|
350
|
+
const appErrorHandler = instance.appContext.config.errorHandler;
|
|
351
|
+
if (appErrorHandler) {
|
|
352
|
+
callWithErrorHandling(
|
|
353
|
+
appErrorHandler,
|
|
354
|
+
null,
|
|
355
|
+
10,
|
|
356
|
+
[err, exposedInstance, errorInfo]
|
|
357
|
+
);
|
|
358
|
+
return;
|
|
372
359
|
}
|
|
373
|
-
|
|
360
|
+
}
|
|
361
|
+
logError(err, type, contextVNode, throwInDev);
|
|
374
362
|
}
|
|
375
363
|
function logError(err, type, contextVNode, throwInDev = true) {
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
}
|
|
381
|
-
warn(`Unhandled error${info ? ` during execution of ${info}` : ``}`);
|
|
382
|
-
if (contextVNode) {
|
|
383
|
-
popWarningContext();
|
|
384
|
-
}
|
|
385
|
-
// crash in dev by default so it's more noticeable
|
|
386
|
-
if (throwInDev) {
|
|
387
|
-
throw err;
|
|
388
|
-
}
|
|
389
|
-
else {
|
|
390
|
-
console.error(err);
|
|
391
|
-
}
|
|
364
|
+
if (process.env.NODE_ENV !== "production") {
|
|
365
|
+
const info = ErrorTypeStrings[type];
|
|
366
|
+
if (contextVNode) {
|
|
367
|
+
pushWarningContext(contextVNode);
|
|
392
368
|
}
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
369
|
+
warn(`Unhandled error${info ? ` during execution of ${info}` : ``}`);
|
|
370
|
+
if (contextVNode) {
|
|
371
|
+
popWarningContext();
|
|
396
372
|
}
|
|
373
|
+
if (throwInDev) {
|
|
374
|
+
throw err;
|
|
375
|
+
} else {
|
|
376
|
+
console.error(err);
|
|
377
|
+
}
|
|
378
|
+
} else {
|
|
379
|
+
console.error(err);
|
|
380
|
+
}
|
|
397
381
|
}
|
|
398
382
|
|
|
399
383
|
const classifyRE = /(?:^|[-_])(\w)/g;
|
|
400
|
-
const classify = (str) => str.replace(classifyRE, c => c.toUpperCase()).replace(/[-_]/g,
|
|
384
|
+
const classify = (str) => str.replace(classifyRE, (c) => c.toUpperCase()).replace(/[-_]/g, "");
|
|
401
385
|
function getComponentName(Component, includeInferred = true) {
|
|
402
|
-
|
|
403
|
-
? Component.displayName || Component.name
|
|
404
|
-
: Component.name || (includeInferred && Component.__name);
|
|
386
|
+
return isFunction(Component) ? Component.displayName || Component.name : Component.name || includeInferred && Component.__name;
|
|
405
387
|
}
|
|
406
|
-
/* istanbul ignore next */
|
|
407
388
|
function formatComponentName(instance, Component, isRoot = false) {
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
return name ? classify(name) : isRoot ? `App` : `Anonymous`;
|
|
389
|
+
let name = getComponentName(Component);
|
|
390
|
+
if (!name && Component.__file) {
|
|
391
|
+
const match = Component.__file.match(/([^/\\]+)\.\w+$/);
|
|
392
|
+
if (match) {
|
|
393
|
+
name = match[1];
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
if (!name && instance && instance.parent) {
|
|
397
|
+
const inferFromRegistry = (registry) => {
|
|
398
|
+
for (const key in registry) {
|
|
399
|
+
if (registry[key] === Component) {
|
|
400
|
+
return key;
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
};
|
|
404
|
+
name = inferFromRegistry(
|
|
405
|
+
instance.components || instance.parent.type.components
|
|
406
|
+
) || inferFromRegistry(instance.appContext.components);
|
|
407
|
+
}
|
|
408
|
+
return name ? classify(name) : isRoot ? `App` : `Anonymous`;
|
|
429
409
|
}
|
|
430
410
|
|
|
431
411
|
function ssrRenderList(source, renderItem) {
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
}
|
|
459
|
-
}
|
|
460
|
-
}
|
|
412
|
+
if (isArray(source) || isString(source)) {
|
|
413
|
+
for (let i = 0, l = source.length; i < l; i++) {
|
|
414
|
+
renderItem(source[i], i);
|
|
415
|
+
}
|
|
416
|
+
} else if (typeof source === "number") {
|
|
417
|
+
if (process.env.NODE_ENV !== "production" && !Number.isInteger(source)) {
|
|
418
|
+
warn(`The v-for range expect an integer value but got ${source}.`);
|
|
419
|
+
return;
|
|
420
|
+
}
|
|
421
|
+
for (let i = 0; i < source; i++) {
|
|
422
|
+
renderItem(i + 1, i);
|
|
423
|
+
}
|
|
424
|
+
} else if (isObject(source)) {
|
|
425
|
+
if (source[Symbol.iterator]) {
|
|
426
|
+
const arr = Array.from(source);
|
|
427
|
+
for (let i = 0, l = arr.length; i < l; i++) {
|
|
428
|
+
renderItem(arr[i], i);
|
|
429
|
+
}
|
|
430
|
+
} else {
|
|
431
|
+
const keys = Object.keys(source);
|
|
432
|
+
for (let i = 0, l = keys.length; i < l; i++) {
|
|
433
|
+
const key = keys[i];
|
|
434
|
+
renderItem(source[key], key, i);
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
}
|
|
461
438
|
}
|
|
462
439
|
|
|
463
440
|
async function ssrRenderSuspense(push, { default: renderContent }) {
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
}
|
|
441
|
+
if (renderContent) {
|
|
442
|
+
renderContent();
|
|
443
|
+
} else {
|
|
444
|
+
push(`<!---->`);
|
|
445
|
+
}
|
|
470
446
|
}
|
|
471
447
|
|
|
472
448
|
function ssrGetDirectiveProps(instance, dir, value, arg, modifiers = {}) {
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
449
|
+
if (typeof dir !== "function" && dir.getSSRProps) {
|
|
450
|
+
return dir.getSSRProps(
|
|
451
|
+
{
|
|
452
|
+
dir,
|
|
453
|
+
instance,
|
|
454
|
+
value,
|
|
455
|
+
oldValue: void 0,
|
|
456
|
+
arg,
|
|
457
|
+
modifiers
|
|
458
|
+
},
|
|
459
|
+
null
|
|
460
|
+
) || {};
|
|
461
|
+
}
|
|
462
|
+
return {};
|
|
484
463
|
}
|
|
485
464
|
|
|
486
465
|
const ssrLooseEqual = looseEqual;
|
|
487
466
|
function ssrLooseContain(arr, value) {
|
|
488
|
-
|
|
467
|
+
return looseIndexOf(arr, value) > -1;
|
|
489
468
|
}
|
|
490
|
-
// for <input :type="type" v-model="model" value="value">
|
|
491
469
|
function ssrRenderDynamicModel(type, model, value) {
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
return ssrRenderAttr('value', model);
|
|
502
|
-
}
|
|
503
|
-
}
|
|
504
|
-
// for <input v-bind="obj" v-model="model">
|
|
470
|
+
switch (type) {
|
|
471
|
+
case "radio":
|
|
472
|
+
return looseEqual(model, value) ? " checked" : "";
|
|
473
|
+
case "checkbox":
|
|
474
|
+
return (isArray(model) ? ssrLooseContain(model, value) : model) ? " checked" : "";
|
|
475
|
+
default:
|
|
476
|
+
return ssrRenderAttr("value", model);
|
|
477
|
+
}
|
|
478
|
+
}
|
|
505
479
|
function ssrGetDynamicModelProps(existingProps = {}, model) {
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
// text types
|
|
516
|
-
return { value: model };
|
|
517
|
-
}
|
|
480
|
+
const { type, value } = existingProps;
|
|
481
|
+
switch (type) {
|
|
482
|
+
case "radio":
|
|
483
|
+
return looseEqual(model, value) ? { checked: true } : null;
|
|
484
|
+
case "checkbox":
|
|
485
|
+
return (isArray(model) ? ssrLooseContain(model, value) : model) ? { checked: true } : null;
|
|
486
|
+
default:
|
|
487
|
+
return { value: model };
|
|
488
|
+
}
|
|
518
489
|
}
|
|
519
490
|
|
|
520
491
|
function ssrCompile(template, instance) {
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
}
|
|
492
|
+
{
|
|
493
|
+
throw new Error(
|
|
494
|
+
`On-the-fly template compilation is not supported in the ESM build of @vue/server-renderer. All templates must be pre-compiled into render functions.`
|
|
495
|
+
);
|
|
496
|
+
}
|
|
527
497
|
}
|
|
528
498
|
|
|
529
|
-
const {
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
499
|
+
const {
|
|
500
|
+
createComponentInstance,
|
|
501
|
+
setCurrentRenderingInstance,
|
|
502
|
+
setupComponent,
|
|
503
|
+
renderComponentRoot,
|
|
504
|
+
normalizeVNode
|
|
505
|
+
} = ssrUtils;
|
|
536
506
|
function createBuffer() {
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
buffer.hasAsync = true;
|
|
557
|
-
}
|
|
558
|
-
}
|
|
559
|
-
};
|
|
507
|
+
let appendable = false;
|
|
508
|
+
const buffer = [];
|
|
509
|
+
return {
|
|
510
|
+
getBuffer() {
|
|
511
|
+
return buffer;
|
|
512
|
+
},
|
|
513
|
+
push(item) {
|
|
514
|
+
const isStringItem = isString(item);
|
|
515
|
+
if (appendable && isStringItem) {
|
|
516
|
+
buffer[buffer.length - 1] += item;
|
|
517
|
+
} else {
|
|
518
|
+
buffer.push(item);
|
|
519
|
+
}
|
|
520
|
+
appendable = isStringItem;
|
|
521
|
+
if (isPromise(item) || isArray(item) && item.hasAsync) {
|
|
522
|
+
buffer.hasAsync = true;
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
};
|
|
560
526
|
}
|
|
561
527
|
function renderComponentVNode(vnode, parentComponent = null, slotScopeId) {
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
}
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
528
|
+
const instance = createComponentInstance(vnode, parentComponent, null);
|
|
529
|
+
const res = setupComponent(
|
|
530
|
+
instance,
|
|
531
|
+
true
|
|
532
|
+
/* isSSR */
|
|
533
|
+
);
|
|
534
|
+
const hasAsyncSetup = isPromise(res);
|
|
535
|
+
const prefetches = instance.sp;
|
|
536
|
+
if (hasAsyncSetup || prefetches) {
|
|
537
|
+
let p = hasAsyncSetup ? res : Promise.resolve();
|
|
538
|
+
if (prefetches) {
|
|
539
|
+
p = p.then(
|
|
540
|
+
() => Promise.all(prefetches.map((prefetch) => prefetch.call(instance.proxy)))
|
|
541
|
+
).catch(() => {
|
|
542
|
+
});
|
|
543
|
+
}
|
|
544
|
+
return p.then(() => renderComponentSubTree(instance, slotScopeId));
|
|
545
|
+
} else {
|
|
546
|
+
return renderComponentSubTree(instance, slotScopeId);
|
|
547
|
+
}
|
|
581
548
|
}
|
|
582
549
|
function renderComponentSubTree(instance, slotScopeId) {
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
if (
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
push(`<!---->`);
|
|
660
|
-
}
|
|
661
|
-
}
|
|
662
|
-
return getBuffer();
|
|
550
|
+
const comp = instance.type;
|
|
551
|
+
const { getBuffer, push } = createBuffer();
|
|
552
|
+
if (isFunction(comp)) {
|
|
553
|
+
let root = renderComponentRoot(instance);
|
|
554
|
+
if (!comp.props) {
|
|
555
|
+
for (const key in instance.attrs) {
|
|
556
|
+
if (key.startsWith(`data-v-`)) {
|
|
557
|
+
(root.props || (root.props = {}))[key] = ``;
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
renderVNode(push, instance.subTree = root, instance, slotScopeId);
|
|
562
|
+
} else {
|
|
563
|
+
if ((!instance.render || instance.render === NOOP) && !instance.ssrRender && !comp.ssrRender && isString(comp.template)) {
|
|
564
|
+
comp.ssrRender = ssrCompile(comp.template);
|
|
565
|
+
}
|
|
566
|
+
for (const e of instance.scope.effects) {
|
|
567
|
+
if (e.computed)
|
|
568
|
+
e.computed._cacheable = true;
|
|
569
|
+
}
|
|
570
|
+
const ssrRender = instance.ssrRender || comp.ssrRender;
|
|
571
|
+
if (ssrRender) {
|
|
572
|
+
let attrs = instance.inheritAttrs !== false ? instance.attrs : void 0;
|
|
573
|
+
let hasCloned = false;
|
|
574
|
+
let cur = instance;
|
|
575
|
+
while (true) {
|
|
576
|
+
const scopeId = cur.vnode.scopeId;
|
|
577
|
+
if (scopeId) {
|
|
578
|
+
if (!hasCloned) {
|
|
579
|
+
attrs = { ...attrs };
|
|
580
|
+
hasCloned = true;
|
|
581
|
+
}
|
|
582
|
+
attrs[scopeId] = "";
|
|
583
|
+
}
|
|
584
|
+
const parent = cur.parent;
|
|
585
|
+
if (parent && parent.subTree && parent.subTree === cur.vnode) {
|
|
586
|
+
cur = parent;
|
|
587
|
+
} else {
|
|
588
|
+
break;
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
if (slotScopeId) {
|
|
592
|
+
if (!hasCloned)
|
|
593
|
+
attrs = { ...attrs };
|
|
594
|
+
attrs[slotScopeId.trim()] = "";
|
|
595
|
+
}
|
|
596
|
+
const prev = setCurrentRenderingInstance(instance);
|
|
597
|
+
try {
|
|
598
|
+
ssrRender(
|
|
599
|
+
instance.proxy,
|
|
600
|
+
push,
|
|
601
|
+
instance,
|
|
602
|
+
attrs,
|
|
603
|
+
// compiler-optimized bindings
|
|
604
|
+
instance.props,
|
|
605
|
+
instance.setupState,
|
|
606
|
+
instance.data,
|
|
607
|
+
instance.ctx
|
|
608
|
+
);
|
|
609
|
+
} finally {
|
|
610
|
+
setCurrentRenderingInstance(prev);
|
|
611
|
+
}
|
|
612
|
+
} else if (instance.render && instance.render !== NOOP) {
|
|
613
|
+
renderVNode(
|
|
614
|
+
push,
|
|
615
|
+
instance.subTree = renderComponentRoot(instance),
|
|
616
|
+
instance,
|
|
617
|
+
slotScopeId
|
|
618
|
+
);
|
|
619
|
+
} else {
|
|
620
|
+
const componentName = comp.name || comp.__file || `<Anonymous>`;
|
|
621
|
+
warn$1(`Component ${componentName} is missing template or render function.`);
|
|
622
|
+
push(`<!---->`);
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
return getBuffer();
|
|
663
626
|
}
|
|
664
627
|
function renderVNode(push, vnode, parentComponent, slotScopeId) {
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
628
|
+
const { type, shapeFlag, children } = vnode;
|
|
629
|
+
switch (type) {
|
|
630
|
+
case Text:
|
|
631
|
+
push(escapeHtml(children));
|
|
632
|
+
break;
|
|
633
|
+
case Comment:
|
|
634
|
+
push(
|
|
635
|
+
children ? `<!--${escapeHtmlComment(children)}-->` : `<!---->`
|
|
636
|
+
);
|
|
637
|
+
break;
|
|
638
|
+
case Static:
|
|
639
|
+
push(children);
|
|
640
|
+
break;
|
|
641
|
+
case Fragment:
|
|
642
|
+
if (vnode.slotScopeIds) {
|
|
643
|
+
slotScopeId = (slotScopeId ? slotScopeId + " " : "") + vnode.slotScopeIds.join(" ");
|
|
644
|
+
}
|
|
645
|
+
push(`<!--[-->`);
|
|
646
|
+
renderVNodeChildren(
|
|
647
|
+
push,
|
|
648
|
+
children,
|
|
649
|
+
parentComponent,
|
|
650
|
+
slotScopeId
|
|
651
|
+
);
|
|
652
|
+
push(`<!--]-->`);
|
|
653
|
+
break;
|
|
654
|
+
default:
|
|
655
|
+
if (shapeFlag & 1) {
|
|
656
|
+
renderElementVNode(push, vnode, parentComponent, slotScopeId);
|
|
657
|
+
} else if (shapeFlag & 6) {
|
|
658
|
+
push(renderComponentVNode(vnode, parentComponent, slotScopeId));
|
|
659
|
+
} else if (shapeFlag & 64) {
|
|
660
|
+
renderTeleportVNode(push, vnode, parentComponent, slotScopeId);
|
|
661
|
+
} else if (shapeFlag & 128) {
|
|
662
|
+
renderVNode(push, vnode.ssContent, parentComponent, slotScopeId);
|
|
663
|
+
} else {
|
|
664
|
+
warn$1(
|
|
665
|
+
"[@vue/server-renderer] Invalid VNode type:",
|
|
666
|
+
type,
|
|
667
|
+
`(${typeof type})`
|
|
668
|
+
);
|
|
669
|
+
}
|
|
670
|
+
}
|
|
702
671
|
}
|
|
703
672
|
function renderVNodeChildren(push, children, parentComponent, slotScopeId) {
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
673
|
+
for (let i = 0; i < children.length; i++) {
|
|
674
|
+
renderVNode(push, normalizeVNode(children[i]), parentComponent, slotScopeId);
|
|
675
|
+
}
|
|
707
676
|
}
|
|
708
677
|
function renderElementVNode(push, vnode, parentComponent, slotScopeId) {
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
678
|
+
const tag = vnode.type;
|
|
679
|
+
let { props, children, shapeFlag, scopeId, dirs } = vnode;
|
|
680
|
+
let openTag = `<${tag}`;
|
|
681
|
+
if (dirs) {
|
|
682
|
+
props = applySSRDirectives(vnode, props, dirs);
|
|
683
|
+
}
|
|
684
|
+
if (props) {
|
|
685
|
+
openTag += ssrRenderAttrs(props, tag);
|
|
686
|
+
}
|
|
687
|
+
if (scopeId) {
|
|
688
|
+
openTag += ` ${scopeId}`;
|
|
689
|
+
}
|
|
690
|
+
let curParent = parentComponent;
|
|
691
|
+
let curVnode = vnode;
|
|
692
|
+
while (curParent && curVnode === curParent.subTree) {
|
|
693
|
+
curVnode = curParent.vnode;
|
|
694
|
+
if (curVnode.scopeId) {
|
|
695
|
+
openTag += ` ${curVnode.scopeId}`;
|
|
696
|
+
}
|
|
697
|
+
curParent = curParent.parent;
|
|
698
|
+
}
|
|
699
|
+
if (slotScopeId) {
|
|
700
|
+
openTag += ` ${slotScopeId}`;
|
|
701
|
+
}
|
|
702
|
+
push(openTag + `>`);
|
|
703
|
+
if (!isVoidTag(tag)) {
|
|
704
|
+
let hasChildrenOverride = false;
|
|
715
705
|
if (props) {
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
}
|
|
742
|
-
else if (props.textContent) {
|
|
743
|
-
hasChildrenOverride = true;
|
|
744
|
-
push(escapeHtml(props.textContent));
|
|
745
|
-
}
|
|
746
|
-
else if (tag === 'textarea' && props.value) {
|
|
747
|
-
hasChildrenOverride = true;
|
|
748
|
-
push(escapeHtml(props.value));
|
|
749
|
-
}
|
|
750
|
-
}
|
|
751
|
-
if (!hasChildrenOverride) {
|
|
752
|
-
if (shapeFlag & 8 /* ShapeFlags.TEXT_CHILDREN */) {
|
|
753
|
-
push(escapeHtml(children));
|
|
754
|
-
}
|
|
755
|
-
else if (shapeFlag & 16 /* ShapeFlags.ARRAY_CHILDREN */) {
|
|
756
|
-
renderVNodeChildren(push, children, parentComponent, slotScopeId);
|
|
757
|
-
}
|
|
758
|
-
}
|
|
759
|
-
push(`</${tag}>`);
|
|
760
|
-
}
|
|
706
|
+
if (props.innerHTML) {
|
|
707
|
+
hasChildrenOverride = true;
|
|
708
|
+
push(props.innerHTML);
|
|
709
|
+
} else if (props.textContent) {
|
|
710
|
+
hasChildrenOverride = true;
|
|
711
|
+
push(escapeHtml(props.textContent));
|
|
712
|
+
} else if (tag === "textarea" && props.value) {
|
|
713
|
+
hasChildrenOverride = true;
|
|
714
|
+
push(escapeHtml(props.value));
|
|
715
|
+
}
|
|
716
|
+
}
|
|
717
|
+
if (!hasChildrenOverride) {
|
|
718
|
+
if (shapeFlag & 8) {
|
|
719
|
+
push(escapeHtml(children));
|
|
720
|
+
} else if (shapeFlag & 16) {
|
|
721
|
+
renderVNodeChildren(
|
|
722
|
+
push,
|
|
723
|
+
children,
|
|
724
|
+
parentComponent,
|
|
725
|
+
slotScopeId
|
|
726
|
+
);
|
|
727
|
+
}
|
|
728
|
+
}
|
|
729
|
+
push(`</${tag}>`);
|
|
730
|
+
}
|
|
761
731
|
}
|
|
762
732
|
function applySSRDirectives(vnode, rawProps, dirs) {
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
733
|
+
const toMerge = [];
|
|
734
|
+
for (let i = 0; i < dirs.length; i++) {
|
|
735
|
+
const binding = dirs[i];
|
|
736
|
+
const {
|
|
737
|
+
dir: { getSSRProps }
|
|
738
|
+
} = binding;
|
|
739
|
+
if (getSSRProps) {
|
|
740
|
+
const props = getSSRProps(binding, vnode);
|
|
741
|
+
if (props)
|
|
742
|
+
toMerge.push(props);
|
|
743
|
+
}
|
|
744
|
+
}
|
|
745
|
+
return mergeProps(rawProps || {}, ...toMerge);
|
|
774
746
|
}
|
|
775
747
|
function renderTeleportVNode(push, vnode, parentComponent, slotScopeId) {
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
748
|
+
const target = vnode.props && vnode.props.to;
|
|
749
|
+
const disabled = vnode.props && vnode.props.disabled;
|
|
750
|
+
if (!target) {
|
|
751
|
+
if (!disabled) {
|
|
752
|
+
warn$1(`[@vue/server-renderer] Teleport is missing target prop.`);
|
|
753
|
+
}
|
|
754
|
+
return [];
|
|
755
|
+
}
|
|
756
|
+
if (!isString(target)) {
|
|
757
|
+
warn$1(
|
|
758
|
+
`[@vue/server-renderer] Teleport target must be a query selector string.`
|
|
759
|
+
);
|
|
760
|
+
return [];
|
|
761
|
+
}
|
|
762
|
+
ssrRenderTeleport(
|
|
763
|
+
push,
|
|
764
|
+
(push2) => {
|
|
765
|
+
renderVNodeChildren(
|
|
766
|
+
push2,
|
|
767
|
+
vnode.children,
|
|
768
|
+
parentComponent,
|
|
769
|
+
slotScopeId
|
|
770
|
+
);
|
|
771
|
+
},
|
|
772
|
+
target,
|
|
773
|
+
disabled || disabled === "",
|
|
774
|
+
parentComponent
|
|
775
|
+
);
|
|
791
776
|
}
|
|
792
777
|
|
|
793
778
|
const { isVNode: isVNode$1 } = ssrUtils;
|
|
794
779
|
async function unrollBuffer$1(buffer) {
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
}
|
|
808
|
-
}
|
|
809
|
-
return ret;
|
|
810
|
-
}
|
|
811
|
-
else {
|
|
812
|
-
// sync buffer can be more efficiently unrolled without unnecessary await
|
|
813
|
-
// ticks
|
|
814
|
-
return unrollBufferSync$1(buffer);
|
|
780
|
+
if (buffer.hasAsync) {
|
|
781
|
+
let ret = "";
|
|
782
|
+
for (let i = 0; i < buffer.length; i++) {
|
|
783
|
+
let item = buffer[i];
|
|
784
|
+
if (isPromise(item)) {
|
|
785
|
+
item = await item;
|
|
786
|
+
}
|
|
787
|
+
if (isString(item)) {
|
|
788
|
+
ret += item;
|
|
789
|
+
} else {
|
|
790
|
+
ret += await unrollBuffer$1(item);
|
|
791
|
+
}
|
|
815
792
|
}
|
|
793
|
+
return ret;
|
|
794
|
+
} else {
|
|
795
|
+
return unrollBufferSync$1(buffer);
|
|
796
|
+
}
|
|
816
797
|
}
|
|
817
798
|
function unrollBufferSync$1(buffer) {
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
// since this is a sync buffer, child buffers are never promises
|
|
826
|
-
ret += unrollBufferSync$1(item);
|
|
827
|
-
}
|
|
799
|
+
let ret = "";
|
|
800
|
+
for (let i = 0; i < buffer.length; i++) {
|
|
801
|
+
let item = buffer[i];
|
|
802
|
+
if (isString(item)) {
|
|
803
|
+
ret += item;
|
|
804
|
+
} else {
|
|
805
|
+
ret += unrollBufferSync$1(item);
|
|
828
806
|
}
|
|
829
|
-
|
|
807
|
+
}
|
|
808
|
+
return ret;
|
|
830
809
|
}
|
|
831
810
|
async function renderToString(input, context = {}) {
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
const
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
}
|
|
848
|
-
}
|
|
849
|
-
return result;
|
|
811
|
+
if (isVNode$1(input)) {
|
|
812
|
+
return renderToString(createApp({ render: () => input }), context);
|
|
813
|
+
}
|
|
814
|
+
const vnode = createVNode(input._component, input._props);
|
|
815
|
+
vnode.appContext = input._context;
|
|
816
|
+
input.provide(ssrContextKey, context);
|
|
817
|
+
const buffer = await renderComponentVNode(vnode);
|
|
818
|
+
const result = await unrollBuffer$1(buffer);
|
|
819
|
+
await resolveTeleports(context);
|
|
820
|
+
if (context.__watcherHandles) {
|
|
821
|
+
for (const unwatch of context.__watcherHandles) {
|
|
822
|
+
unwatch();
|
|
823
|
+
}
|
|
824
|
+
}
|
|
825
|
+
return result;
|
|
850
826
|
}
|
|
851
827
|
async function resolveTeleports(context) {
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
}
|
|
828
|
+
if (context.__teleportBuffers) {
|
|
829
|
+
context.teleports = context.teleports || {};
|
|
830
|
+
for (const key in context.__teleportBuffers) {
|
|
831
|
+
context.teleports[key] = await unrollBuffer$1(
|
|
832
|
+
await Promise.all([context.__teleportBuffers[key]])
|
|
833
|
+
);
|
|
859
834
|
}
|
|
835
|
+
}
|
|
860
836
|
}
|
|
861
837
|
|
|
862
838
|
const { isVNode } = ssrUtils;
|
|
863
839
|
async function unrollBuffer(buffer, stream) {
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
// sync buffer can be more efficiently unrolled without unnecessary await
|
|
880
|
-
// ticks
|
|
881
|
-
unrollBufferSync(buffer, stream);
|
|
882
|
-
}
|
|
840
|
+
if (buffer.hasAsync) {
|
|
841
|
+
for (let i = 0; i < buffer.length; i++) {
|
|
842
|
+
let item = buffer[i];
|
|
843
|
+
if (isPromise(item)) {
|
|
844
|
+
item = await item;
|
|
845
|
+
}
|
|
846
|
+
if (isString(item)) {
|
|
847
|
+
stream.push(item);
|
|
848
|
+
} else {
|
|
849
|
+
await unrollBuffer(item, stream);
|
|
850
|
+
}
|
|
851
|
+
}
|
|
852
|
+
} else {
|
|
853
|
+
unrollBufferSync(buffer, stream);
|
|
854
|
+
}
|
|
883
855
|
}
|
|
884
856
|
function unrollBufferSync(buffer, stream) {
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
// since this is a sync buffer, child buffers are never promises
|
|
892
|
-
unrollBufferSync(item, stream);
|
|
893
|
-
}
|
|
857
|
+
for (let i = 0; i < buffer.length; i++) {
|
|
858
|
+
let item = buffer[i];
|
|
859
|
+
if (isString(item)) {
|
|
860
|
+
stream.push(item);
|
|
861
|
+
} else {
|
|
862
|
+
unrollBufferSync(item, stream);
|
|
894
863
|
}
|
|
864
|
+
}
|
|
895
865
|
}
|
|
896
866
|
function renderToSimpleStream(input, context, stream) {
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
stream.destroy(error);
|
|
919
|
-
});
|
|
920
|
-
return stream;
|
|
921
|
-
}
|
|
922
|
-
/**
|
|
923
|
-
* @deprecated
|
|
924
|
-
*/
|
|
867
|
+
if (isVNode(input)) {
|
|
868
|
+
return renderToSimpleStream(
|
|
869
|
+
createApp({ render: () => input }),
|
|
870
|
+
context,
|
|
871
|
+
stream
|
|
872
|
+
);
|
|
873
|
+
}
|
|
874
|
+
const vnode = createVNode(input._component, input._props);
|
|
875
|
+
vnode.appContext = input._context;
|
|
876
|
+
input.provide(ssrContextKey, context);
|
|
877
|
+
Promise.resolve(renderComponentVNode(vnode)).then((buffer) => unrollBuffer(buffer, stream)).then(() => resolveTeleports(context)).then(() => {
|
|
878
|
+
if (context.__watcherHandles) {
|
|
879
|
+
for (const unwatch of context.__watcherHandles) {
|
|
880
|
+
unwatch();
|
|
881
|
+
}
|
|
882
|
+
}
|
|
883
|
+
}).then(() => stream.push(null)).catch((error) => {
|
|
884
|
+
stream.destroy(error);
|
|
885
|
+
});
|
|
886
|
+
return stream;
|
|
887
|
+
}
|
|
925
888
|
function renderToStream(input, context = {}) {
|
|
926
|
-
|
|
927
|
-
|
|
889
|
+
console.warn(
|
|
890
|
+
`[@vue/server-renderer] renderToStream is deprecated - use renderToNodeStream instead.`
|
|
891
|
+
);
|
|
892
|
+
return renderToNodeStream(input, context);
|
|
928
893
|
}
|
|
929
894
|
function renderToNodeStream(input, context = {}) {
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
895
|
+
{
|
|
896
|
+
throw new Error(
|
|
897
|
+
`ESM build of renderToStream() does not support renderToNodeStream(). Use pipeToNodeWritable() with an existing Node.js Writable stream instance instead.`
|
|
898
|
+
);
|
|
899
|
+
}
|
|
935
900
|
}
|
|
936
901
|
function pipeToNodeWritable(input, context = {}, writable) {
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
});
|
|
902
|
+
renderToSimpleStream(input, context, {
|
|
903
|
+
push(content) {
|
|
904
|
+
if (content != null) {
|
|
905
|
+
writable.write(content);
|
|
906
|
+
} else {
|
|
907
|
+
writable.end();
|
|
908
|
+
}
|
|
909
|
+
},
|
|
910
|
+
destroy(err) {
|
|
911
|
+
writable.destroy(err);
|
|
912
|
+
}
|
|
913
|
+
});
|
|
950
914
|
}
|
|
951
915
|
function renderToWebStream(input, context = {}) {
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
}
|
|
971
|
-
},
|
|
972
|
-
destroy(err) {
|
|
973
|
-
controller.error(err);
|
|
974
|
-
}
|
|
975
|
-
});
|
|
916
|
+
if (typeof ReadableStream !== "function") {
|
|
917
|
+
throw new Error(
|
|
918
|
+
`ReadableStream constructor is not available in the global scope. If the target environment does support web streams, consider using pipeToWebWritable() with an existing WritableStream instance instead.`
|
|
919
|
+
);
|
|
920
|
+
}
|
|
921
|
+
const encoder = new TextEncoder();
|
|
922
|
+
let cancelled = false;
|
|
923
|
+
return new ReadableStream({
|
|
924
|
+
start(controller) {
|
|
925
|
+
renderToSimpleStream(input, context, {
|
|
926
|
+
push(content) {
|
|
927
|
+
if (cancelled)
|
|
928
|
+
return;
|
|
929
|
+
if (content != null) {
|
|
930
|
+
controller.enqueue(encoder.encode(content));
|
|
931
|
+
} else {
|
|
932
|
+
controller.close();
|
|
933
|
+
}
|
|
976
934
|
},
|
|
977
|
-
|
|
978
|
-
|
|
935
|
+
destroy(err) {
|
|
936
|
+
controller.error(err);
|
|
979
937
|
}
|
|
980
|
-
|
|
938
|
+
});
|
|
939
|
+
},
|
|
940
|
+
cancel() {
|
|
941
|
+
cancelled = true;
|
|
942
|
+
}
|
|
943
|
+
});
|
|
981
944
|
}
|
|
982
945
|
function pipeToWebWritable(input, context = {}, writable) {
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
writer.close();
|
|
1007
|
-
}
|
|
1008
|
-
});
|
|
946
|
+
const writer = writable.getWriter();
|
|
947
|
+
const encoder = new TextEncoder();
|
|
948
|
+
let hasReady = false;
|
|
949
|
+
try {
|
|
950
|
+
hasReady = isPromise(writer.ready);
|
|
951
|
+
} catch (e) {
|
|
952
|
+
}
|
|
953
|
+
renderToSimpleStream(input, context, {
|
|
954
|
+
async push(content) {
|
|
955
|
+
if (hasReady) {
|
|
956
|
+
await writer.ready;
|
|
957
|
+
}
|
|
958
|
+
if (content != null) {
|
|
959
|
+
return writer.write(encoder.encode(content));
|
|
960
|
+
} else {
|
|
961
|
+
return writer.close();
|
|
962
|
+
}
|
|
963
|
+
},
|
|
964
|
+
destroy(err) {
|
|
965
|
+
console.log(err);
|
|
966
|
+
writer.close();
|
|
967
|
+
}
|
|
968
|
+
});
|
|
1009
969
|
}
|
|
1010
970
|
|
|
1011
971
|
initDirectivesForSSR();
|