@vue/compiler-ssr 3.2.45 → 3.2.46
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/compiler-ssr.cjs.js +12 -12
- package/package.json +3 -3
package/dist/compiler-ssr.cjs.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
3
|
var compilerDom = require('@vue/compiler-dom');
|
|
6
4
|
var shared = require('@vue/shared');
|
|
7
5
|
|
|
@@ -210,7 +208,7 @@ function ssrProcessTeleport(node, context) {
|
|
|
210
208
|
]));
|
|
211
209
|
}
|
|
212
210
|
|
|
213
|
-
const wipMap = new WeakMap();
|
|
211
|
+
const wipMap$2 = new WeakMap();
|
|
214
212
|
// phase 1
|
|
215
213
|
function ssrTransformSuspense(node, context) {
|
|
216
214
|
return () => {
|
|
@@ -219,7 +217,7 @@ function ssrTransformSuspense(node, context) {
|
|
|
219
217
|
slotsExp: null,
|
|
220
218
|
wipSlots: []
|
|
221
219
|
};
|
|
222
|
-
wipMap.set(node, wipEntry);
|
|
220
|
+
wipMap$2.set(node, wipEntry);
|
|
223
221
|
wipEntry.slotsExp = compilerDom.buildSlots(node, context, (_props, children, loc) => {
|
|
224
222
|
const fn = compilerDom.createFunctionExpression([], undefined, // no return, assign body later
|
|
225
223
|
true, // newline
|
|
@@ -237,7 +235,7 @@ function ssrTransformSuspense(node, context) {
|
|
|
237
235
|
// phase 2
|
|
238
236
|
function ssrProcessSuspense(node, context) {
|
|
239
237
|
// complete wip slots with ssr code
|
|
240
|
-
const wipEntry = wipMap.get(node);
|
|
238
|
+
const wipEntry = wipMap$2.get(node);
|
|
241
239
|
if (!wipEntry) {
|
|
242
240
|
return;
|
|
243
241
|
}
|
|
@@ -593,7 +591,7 @@ function ssrProcessTransitionGroup(node, context) {
|
|
|
593
591
|
// scope tracking, but the children of each slot cannot be processed until
|
|
594
592
|
// the 2nd pass, so we store the WIP slot functions in a weakMap during the 1st
|
|
595
593
|
// pass and complete them in the 2nd pass.
|
|
596
|
-
const wipMap
|
|
594
|
+
const wipMap = new WeakMap();
|
|
597
595
|
const WIP_SLOT = Symbol();
|
|
598
596
|
const componentTypeMap = new WeakMap();
|
|
599
597
|
// ssr component transform is done in two phases:
|
|
@@ -647,7 +645,7 @@ const ssrTransformComponent = (node, context) => {
|
|
|
647
645
|
}
|
|
648
646
|
}
|
|
649
647
|
const wipEntries = [];
|
|
650
|
-
wipMap
|
|
648
|
+
wipMap.set(node, wipEntries);
|
|
651
649
|
const buildSSRSlotFn = (props, children, loc) => {
|
|
652
650
|
const param0 = (props && compilerDom.stringifyExpression(props)) || `_`;
|
|
653
651
|
const fn = compilerDom.createFunctionExpression([param0, `_push`, `_parent`, `_scopeId`], undefined, // no return, assign body later
|
|
@@ -716,7 +714,7 @@ function ssrProcessComponent(node, context, parent) {
|
|
|
716
714
|
}
|
|
717
715
|
else {
|
|
718
716
|
// finish up slot function expressions from the 1st pass.
|
|
719
|
-
const wipEntries = wipMap
|
|
717
|
+
const wipEntries = wipMap.get(node) || [];
|
|
720
718
|
for (let i = 0; i < wipEntries.length; i++) {
|
|
721
719
|
const { fn, vnodeBranch } = wipEntries[i];
|
|
722
720
|
// For each slot, we generate two branches: one SSR-optimized branch and
|
|
@@ -852,8 +850,7 @@ function ssrCodegenTransform(ast, options) {
|
|
|
852
850
|
const varsExp = compilerDom.processExpression(compilerDom.createSimpleExpression(options.ssrCssVars, false), cssContext);
|
|
853
851
|
context.body.push(compilerDom.createCompoundExpression([`const _cssVars = { style: `, varsExp, `}`]));
|
|
854
852
|
Array.from(cssContext.helpers.keys()).forEach(helper => {
|
|
855
|
-
|
|
856
|
-
ast.helpers.push(helper);
|
|
853
|
+
ast.helpers.add(helper);
|
|
857
854
|
});
|
|
858
855
|
}
|
|
859
856
|
const isFragment = ast.children.length > 1 && ast.children.some(c => !compilerDom.isText(c));
|
|
@@ -861,8 +858,11 @@ function ssrCodegenTransform(ast, options) {
|
|
|
861
858
|
ast.codegenNode = compilerDom.createBlockStatement(context.body);
|
|
862
859
|
// Finalize helpers.
|
|
863
860
|
// We need to separate helpers imported from 'vue' vs. '@vue/server-renderer'
|
|
864
|
-
ast.ssrHelpers = Array.from(new Set([
|
|
865
|
-
|
|
861
|
+
ast.ssrHelpers = Array.from(new Set([
|
|
862
|
+
...Array.from(ast.helpers).filter(h => h in ssrHelpers),
|
|
863
|
+
...context.helpers
|
|
864
|
+
]));
|
|
865
|
+
ast.helpers = new Set(Array.from(ast.helpers).filter(h => !(h in ssrHelpers)));
|
|
866
866
|
}
|
|
867
867
|
function createSSRTransformContext(root, options, helpers = new Set(), withSlotScopeId = false) {
|
|
868
868
|
const body = [];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vue/compiler-ssr",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.46",
|
|
4
4
|
"description": "@vue/compiler-ssr",
|
|
5
5
|
"main": "dist/compiler-ssr.cjs.js",
|
|
6
6
|
"types": "dist/compiler-ssr.d.ts",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
},
|
|
29
29
|
"homepage": "https://github.com/vuejs/core/tree/main/packages/compiler-ssr#readme",
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@vue/shared": "3.2.
|
|
32
|
-
"@vue/compiler-dom": "3.2.
|
|
31
|
+
"@vue/shared": "3.2.46",
|
|
32
|
+
"@vue/compiler-dom": "3.2.46"
|
|
33
33
|
}
|
|
34
34
|
}
|