@vue/compiler-ssr
Advanced tools
Comparing version 3.0.7 to 3.0.8
@@ -107,10 +107,16 @@ 'use strict'; | ||
const { slotName, slotProps } = compilerDom.processSlotOutlet(node, context); | ||
node.ssrCodegenNode = compilerDom.createCallExpression(context.helper(SSR_RENDER_SLOT), [ | ||
const args = [ | ||
`_ctx.$slots`, | ||
slotName, | ||
slotProps || `{}`, | ||
// fallback content placeholder. will be replaced in the process phase | ||
`null`, | ||
`_push`, | ||
`_parent` | ||
]); | ||
]; | ||
// inject slot scope id if current template uses :slotted | ||
if (context.scopeId && context.slotted !== false) { | ||
args.push(`"${context.scopeId}-s"`); | ||
} | ||
node.ssrCodegenNode = compilerDom.createCallExpression(context.helper(SSR_RENDER_SLOT), args); | ||
} | ||
@@ -127,2 +133,9 @@ }; | ||
} | ||
// Forwarded <slot/>. Merge slot scope ids | ||
if (context.withSlotScopeId) { | ||
const slotScopeId = renderCall.arguments[6]; | ||
renderCall.arguments[6] = slotScopeId | ||
? `${slotScopeId} + _scopeId` | ||
: `_scopeId`; | ||
} | ||
context.pushStatement(node.ssrCodegenNode); | ||
@@ -370,2 +383,6 @@ } | ||
} | ||
// component is inside a slot, inherit slot scope Id | ||
if (context.withSlotScopeId) { | ||
node.ssrCodegenNode.arguments.push(`_scopeId`); | ||
} | ||
if (typeof component === 'string') { | ||
@@ -439,7 +456,19 @@ // static component | ||
childContext.identifiers = { ...parentContext.identifiers }; | ||
childContext.imports = parentContext.imports; | ||
// traverse | ||
compilerDom.traverseNode(childRoot, childContext); | ||
['helpers', 'components', 'directives'].forEach(key => { | ||
childContext[key].forEach((value) => { | ||
parentContext[key].add(value); | ||
childContext[key].forEach((value, helperKey) => { | ||
if (key === 'helpers') { | ||
const parentCount = parentContext.helpers.get(helperKey); | ||
if (parentCount === undefined) { | ||
parentContext.helpers.set(helperKey, value); | ||
} | ||
else { | ||
parentContext.helpers.set(helperKey, value + parentCount); | ||
} | ||
} | ||
else { | ||
parentContext[key].add(value); | ||
} | ||
}); | ||
@@ -446,0 +475,0 @@ }); |
{ | ||
"name": "@vue/compiler-ssr", | ||
"version": "3.0.7", | ||
"version": "3.0.8", | ||
"description": "@vue/compiler-ssr", | ||
@@ -31,5 +31,5 @@ "main": "dist/compiler-ssr.cjs.js", | ||
"dependencies": { | ||
"@vue/shared": "3.0.7", | ||
"@vue/compiler-dom": "3.0.7" | ||
"@vue/shared": "3.0.8", | ||
"@vue/compiler-dom": "3.0.8" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
52413
1123
+ Added@vue/compiler-core@3.0.8(transitive)
+ Added@vue/compiler-dom@3.0.8(transitive)
+ Added@vue/shared@3.0.8(transitive)
- Removed@vue/compiler-core@3.0.7(transitive)
- Removed@vue/compiler-dom@3.0.7(transitive)
- Removed@vue/shared@3.0.7(transitive)
Updated@vue/compiler-dom@3.0.8
Updated@vue/shared@3.0.8