@vue/compiler-ssr 3.3.6 → 3.3.8
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 +66 -32
- package/package.json +3 -3
package/dist/compiler-ssr.cjs.js
CHANGED
|
@@ -219,7 +219,7 @@ function ssrProcessTeleport(node, context) {
|
|
|
219
219
|
);
|
|
220
220
|
}
|
|
221
221
|
|
|
222
|
-
const wipMap$
|
|
222
|
+
const wipMap$3 = /* @__PURE__ */ new WeakMap();
|
|
223
223
|
function ssrTransformSuspense(node, context) {
|
|
224
224
|
return () => {
|
|
225
225
|
if (node.children.length) {
|
|
@@ -228,29 +228,33 @@ function ssrTransformSuspense(node, context) {
|
|
|
228
228
|
// to be immediately set
|
|
229
229
|
wipSlots: []
|
|
230
230
|
};
|
|
231
|
-
wipMap$
|
|
232
|
-
wipEntry.slotsExp = compilerDom.buildSlots(
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
231
|
+
wipMap$3.set(node, wipEntry);
|
|
232
|
+
wipEntry.slotsExp = compilerDom.buildSlots(
|
|
233
|
+
node,
|
|
234
|
+
context,
|
|
235
|
+
(_props, _vForExp, children, loc) => {
|
|
236
|
+
const fn = compilerDom.createFunctionExpression(
|
|
237
|
+
[],
|
|
238
|
+
void 0,
|
|
239
|
+
// no return, assign body later
|
|
240
|
+
true,
|
|
241
|
+
// newline
|
|
242
|
+
false,
|
|
243
|
+
// suspense slots are not treated as normal slots
|
|
244
|
+
loc
|
|
245
|
+
);
|
|
246
|
+
wipEntry.wipSlots.push({
|
|
247
|
+
fn,
|
|
248
|
+
children
|
|
249
|
+
});
|
|
250
|
+
return fn;
|
|
251
|
+
}
|
|
252
|
+
).slots;
|
|
249
253
|
}
|
|
250
254
|
};
|
|
251
255
|
}
|
|
252
256
|
function ssrProcessSuspense(node, context) {
|
|
253
|
-
const wipEntry = wipMap$
|
|
257
|
+
const wipEntry = wipMap$3.get(node);
|
|
254
258
|
if (!wipEntry) {
|
|
255
259
|
return;
|
|
256
260
|
}
|
|
@@ -556,7 +560,7 @@ function ssrProcessElement(node, context) {
|
|
|
556
560
|
}
|
|
557
561
|
}
|
|
558
562
|
|
|
559
|
-
const wipMap$
|
|
563
|
+
const wipMap$2 = /* @__PURE__ */ new WeakMap();
|
|
560
564
|
function ssrTransformTransitionGroup(node, context) {
|
|
561
565
|
return () => {
|
|
562
566
|
const tag = compilerDom.findProp(node, "tag");
|
|
@@ -577,7 +581,7 @@ function ssrTransformTransitionGroup(node, context) {
|
|
|
577
581
|
buildSSRProps(props, directives, context)
|
|
578
582
|
]);
|
|
579
583
|
}
|
|
580
|
-
wipMap$
|
|
584
|
+
wipMap$2.set(node, {
|
|
581
585
|
tag,
|
|
582
586
|
propsExp,
|
|
583
587
|
scopeId: context.scopeId || null
|
|
@@ -586,7 +590,7 @@ function ssrTransformTransitionGroup(node, context) {
|
|
|
586
590
|
};
|
|
587
591
|
}
|
|
588
592
|
function ssrProcessTransitionGroup(node, context) {
|
|
589
|
-
const entry = wipMap$
|
|
593
|
+
const entry = wipMap$2.get(node);
|
|
590
594
|
if (entry) {
|
|
591
595
|
const { tag, propsExp, scopeId } = entry;
|
|
592
596
|
if (tag.type === 7) {
|
|
@@ -631,6 +635,25 @@ function ssrProcessTransitionGroup(node, context) {
|
|
|
631
635
|
}
|
|
632
636
|
}
|
|
633
637
|
|
|
638
|
+
const wipMap$1 = /* @__PURE__ */ new WeakMap();
|
|
639
|
+
function ssrTransformTransition(node, context) {
|
|
640
|
+
return () => {
|
|
641
|
+
const appear = compilerDom.findProp(node, "appear", false, true);
|
|
642
|
+
wipMap$1.set(node, !!appear);
|
|
643
|
+
};
|
|
644
|
+
}
|
|
645
|
+
function ssrProcessTransition(node, context) {
|
|
646
|
+
node.children = node.children.filter((c) => c.type !== 3);
|
|
647
|
+
const appear = wipMap$1.get(node);
|
|
648
|
+
if (appear) {
|
|
649
|
+
context.pushStringPart(`<template>`);
|
|
650
|
+
processChildren(node, context, false, true);
|
|
651
|
+
context.pushStringPart(`</template>`);
|
|
652
|
+
} else {
|
|
653
|
+
processChildren(node, context, false, true);
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
|
|
634
657
|
const wipMap = /* @__PURE__ */ new WeakMap();
|
|
635
658
|
const WIP_SLOT = Symbol();
|
|
636
659
|
const componentTypeMap = /* @__PURE__ */ new WeakMap();
|
|
@@ -649,9 +672,10 @@ const ssrTransformComponent = (node, context) => {
|
|
|
649
672
|
if (shared.isSymbol(component)) {
|
|
650
673
|
if (component === compilerDom.SUSPENSE) {
|
|
651
674
|
return ssrTransformSuspense(node, context);
|
|
652
|
-
}
|
|
653
|
-
if (component === compilerDom.TRANSITION_GROUP) {
|
|
675
|
+
} else if (component === compilerDom.TRANSITION_GROUP) {
|
|
654
676
|
return ssrTransformTransitionGroup(node, context);
|
|
677
|
+
} else if (component === compilerDom.TRANSITION) {
|
|
678
|
+
return ssrTransformTransition(node);
|
|
655
679
|
}
|
|
656
680
|
return;
|
|
657
681
|
}
|
|
@@ -659,8 +683,10 @@ const ssrTransformComponent = (node, context) => {
|
|
|
659
683
|
const clonedNode = clone(node);
|
|
660
684
|
return function ssrPostTransformComponent() {
|
|
661
685
|
if (clonedNode.children.length) {
|
|
662
|
-
compilerDom.buildSlots(clonedNode, context, (props, children) => {
|
|
663
|
-
vnodeBranches.push(
|
|
686
|
+
compilerDom.buildSlots(clonedNode, context, (props, vFor, children) => {
|
|
687
|
+
vnodeBranches.push(
|
|
688
|
+
createVNodeSlotBranch(props, vFor, children, context)
|
|
689
|
+
);
|
|
664
690
|
return compilerDom.createFunctionExpression(void 0);
|
|
665
691
|
});
|
|
666
692
|
}
|
|
@@ -679,7 +705,7 @@ const ssrTransformComponent = (node, context) => {
|
|
|
679
705
|
}
|
|
680
706
|
const wipEntries = [];
|
|
681
707
|
wipMap.set(node, wipEntries);
|
|
682
|
-
const buildSSRSlotFn = (props, children, loc) => {
|
|
708
|
+
const buildSSRSlotFn = (props, _vForExp, children, loc) => {
|
|
683
709
|
const param0 = props && compilerDom.stringifyExpression(props) || `_`;
|
|
684
710
|
const fn = compilerDom.createFunctionExpression(
|
|
685
711
|
[param0, `_push`, `_parent`, `_scopeId`],
|
|
@@ -736,7 +762,7 @@ function ssrProcessComponent(node, context, parent) {
|
|
|
736
762
|
context.pushStringPart(``);
|
|
737
763
|
}
|
|
738
764
|
if (component === compilerDom.TRANSITION) {
|
|
739
|
-
|
|
765
|
+
return ssrProcessTransition(node, context);
|
|
740
766
|
}
|
|
741
767
|
processChildren(node, context);
|
|
742
768
|
}
|
|
@@ -775,7 +801,7 @@ const vnodeDirectiveTransforms = {
|
|
|
775
801
|
...baseDirectiveTransforms,
|
|
776
802
|
...compilerDom.DOMDirectiveTransforms
|
|
777
803
|
};
|
|
778
|
-
function createVNodeSlotBranch(props, children, parentContext) {
|
|
804
|
+
function createVNodeSlotBranch(props, vForExp, children, parentContext) {
|
|
779
805
|
const rawOptions = rawOptionsMap.get(parentContext.root);
|
|
780
806
|
const subOptions = {
|
|
781
807
|
...rawOptions,
|
|
@@ -795,8 +821,8 @@ function createVNodeSlotBranch(props, children, parentContext) {
|
|
|
795
821
|
tag: "template",
|
|
796
822
|
tagType: 3,
|
|
797
823
|
isSelfClosing: false,
|
|
798
|
-
// important: provide v-slot="props" on the wrapper for
|
|
799
|
-
// scope analysis
|
|
824
|
+
// important: provide v-slot="props" and v-for="exp" on the wrapper for
|
|
825
|
+
// proper scope analysis
|
|
800
826
|
props: [
|
|
801
827
|
{
|
|
802
828
|
type: 7,
|
|
@@ -805,6 +831,14 @@ function createVNodeSlotBranch(props, children, parentContext) {
|
|
|
805
831
|
arg: void 0,
|
|
806
832
|
modifiers: [],
|
|
807
833
|
loc: compilerDom.locStub
|
|
834
|
+
},
|
|
835
|
+
{
|
|
836
|
+
type: 7,
|
|
837
|
+
name: "for",
|
|
838
|
+
exp: vForExp,
|
|
839
|
+
arg: void 0,
|
|
840
|
+
modifiers: [],
|
|
841
|
+
loc: compilerDom.locStub
|
|
808
842
|
}
|
|
809
843
|
],
|
|
810
844
|
children,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vue/compiler-ssr",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.8",
|
|
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.3.
|
|
32
|
-
"@vue/compiler-dom": "3.3.
|
|
31
|
+
"@vue/shared": "3.3.8",
|
|
32
|
+
"@vue/compiler-dom": "3.3.8"
|
|
33
33
|
}
|
|
34
34
|
}
|