@vue/compiler-ssr
Advanced tools
Comparing version 3.4.0-alpha.1 to 3.4.0-alpha.2
@@ -466,9 +466,10 @@ 'use strict'; | ||
} else { | ||
if (node.tag === "textarea" && prop.name === "value" && prop.value) { | ||
const name = prop.name; | ||
if (node.tag === "textarea" && name === "value" && prop.value) { | ||
rawChildrenMap.set(node, shared.escapeHtml(prop.value.content)); | ||
} else if (!needMergeProps) { | ||
if (prop.name === "key" || prop.name === "ref") { | ||
if (name === "key" || name === "ref") { | ||
continue; | ||
} | ||
if (prop.name === "class" && prop.value) { | ||
if (name === "class" && prop.value) { | ||
staticClassBinding = JSON.stringify(prop.value.content); | ||
@@ -805,3 +806,3 @@ } | ||
}; | ||
function createVNodeSlotBranch(props, vForExp, children, parentContext) { | ||
function createVNodeSlotBranch(slotProps, vFor, children, parentContext) { | ||
const rawOptions = rawOptionsMap.get(parentContext.root); | ||
@@ -820,2 +821,16 @@ const subOptions = { | ||
}; | ||
const wrapperProps = []; | ||
if (slotProps) { | ||
wrapperProps.push({ | ||
type: 7, | ||
name: "slot", | ||
exp: slotProps, | ||
arg: void 0, | ||
modifiers: [], | ||
loc: compilerDom.locStub | ||
}); | ||
} | ||
if (vFor) { | ||
wrapperProps.push(shared.extend({}, vFor)); | ||
} | ||
const wrapperNode = { | ||
@@ -826,23 +841,3 @@ type: 1, | ||
tagType: 3, | ||
isSelfClosing: false, | ||
// important: provide v-slot="props" and v-for="exp" on the wrapper for | ||
// proper scope analysis | ||
props: [ | ||
{ | ||
type: 7, | ||
name: "slot", | ||
exp: props, | ||
arg: void 0, | ||
modifiers: [], | ||
loc: compilerDom.locStub | ||
}, | ||
{ | ||
type: 7, | ||
name: "for", | ||
exp: vForExp, | ||
arg: void 0, | ||
modifiers: [], | ||
loc: compilerDom.locStub | ||
} | ||
], | ||
props: wrapperProps, | ||
children, | ||
@@ -1221,3 +1216,3 @@ loc: compilerDom.locStub, | ||
} | ||
if (node.type === 1 && node.tagType === 1 && (compilerDom.isBuiltInType(node.tag, "Transition") || compilerDom.isBuiltInType(node.tag, "KeepAlive"))) { | ||
if (node.type === 1 && node.tagType === 1 && (node.tag === "transition" || node.tag === "Transition" || node.tag === "KeepAlive" || node.tag === "keep-alive")) { | ||
const rootChildren = filterChild(context.root); | ||
@@ -1289,3 +1284,3 @@ if (rootChildren.length === 1 && rootChildren[0] === node) { | ||
if (node.type === 1 && (node.tagType === 0 || node.tagType === 1) && !compilerDom.findDir(node, "for")) { | ||
if (compilerDom.isBuiltInType(node.tag, "Suspense")) { | ||
if (node.tag === "suspense" || node.tag === "Suspense") { | ||
for (const child of node.children) { | ||
@@ -1311,6 +1306,5 @@ if (child.type === 1 && child.tagType === 3) { | ||
function compile(template, options = {}) { | ||
function compile(source, options = {}) { | ||
options = { | ||
...options, | ||
// apply DOM-specific parsing options | ||
...compilerDom.parserOptions, | ||
@@ -1326,3 +1320,3 @@ ssr: true, | ||
}; | ||
const ast = compilerDom.baseParse(template, options); | ||
const ast = typeof source === "string" ? compilerDom.baseParse(source, options) : source; | ||
rawOptionsMap.set(ast, options); | ||
@@ -1351,3 +1345,3 @@ compilerDom.transform(ast, { | ||
on: compilerDom.transformOn, | ||
// model and show has dedicated SSR handling | ||
// model and show have dedicated SSR handling | ||
model: ssrTransformModel, | ||
@@ -1354,0 +1348,0 @@ show: ssrTransformShow, |
@@ -1,4 +0,4 @@ | ||
import { CompilerOptions, CodegenResult } from '@vue/compiler-dom'; | ||
import { RootNode, CompilerOptions, CodegenResult } from '@vue/compiler-dom'; | ||
export declare function compile(template: string, options?: CompilerOptions): CodegenResult; | ||
export declare function compile(source: string | RootNode, options?: CompilerOptions): CodegenResult; | ||
{ | ||
"name": "@vue/compiler-ssr", | ||
"version": "3.4.0-alpha.1", | ||
"version": "3.4.0-alpha.2", | ||
"description": "@vue/compiler-ssr", | ||
@@ -31,5 +31,5 @@ "main": "dist/compiler-ssr.cjs.js", | ||
"dependencies": { | ||
"@vue/shared": "3.4.0-alpha.1", | ||
"@vue/compiler-dom": "3.4.0-alpha.1" | ||
"@vue/shared": "3.4.0-alpha.2", | ||
"@vue/compiler-dom": "3.4.0-alpha.2" | ||
} | ||
} |
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
45765
1335
+ Added@vue/compiler-core@3.4.0-alpha.2(transitive)
+ Added@vue/compiler-dom@3.4.0-alpha.2(transitive)
+ Added@vue/shared@3.4.0-alpha.2(transitive)
+ Addedentities@4.5.0(transitive)
- Removed@vue/compiler-core@3.4.0-alpha.1(transitive)
- Removed@vue/compiler-dom@3.4.0-alpha.1(transitive)
- Removed@vue/shared@3.4.0-alpha.1(transitive)
Updated@vue/shared@3.4.0-alpha.2