@vue/compiler-ssr
Advanced tools
Comparing version 3.1.3 to 3.1.4
@@ -400,11 +400,7 @@ 'use strict'; | ||
const vnodeNodeTransforms = [...baseNodeTransforms, ...compilerDom.DOMNodeTransforms]; | ||
const vnodeDirectiveTransforms = { | ||
...baseDirectiveTransforms, | ||
...compilerDom.DOMDirectiveTransforms | ||
}; | ||
const vnodeDirectiveTransforms = Object.assign(Object.assign({}, baseDirectiveTransforms), compilerDom.DOMDirectiveTransforms); | ||
function createVNodeSlotBranch(props, children, parentContext) { | ||
// apply a sub-transform using vnode-based transforms. | ||
const rawOptions = rawOptionsMap.get(parentContext.root); | ||
const subOptions = { | ||
...rawOptions, | ||
const subOptions = Object.assign(Object.assign({}, rawOptions), { | ||
// overwrite with vnode-based transforms | ||
@@ -414,8 +410,3 @@ nodeTransforms: [ | ||
...(rawOptions.nodeTransforms || []) | ||
], | ||
directiveTransforms: { | ||
...vnodeDirectiveTransforms, | ||
...(rawOptions.directiveTransforms || {}) | ||
} | ||
}; | ||
], directiveTransforms: Object.assign(Object.assign({}, vnodeDirectiveTransforms), (rawOptions.directiveTransforms || {})) }); | ||
// wrap the children with a wrapper template for proper children treatment. | ||
@@ -454,4 +445,4 @@ const wrapperNode = { | ||
// inherit parent scope analysis state | ||
childContext.scopes = { ...parentContext.scopes }; | ||
childContext.identifiers = { ...parentContext.identifiers }; | ||
childContext.scopes = Object.assign({}, parentContext.scopes); | ||
childContext.identifiers = Object.assign({}, parentContext.identifiers); | ||
childContext.imports = parentContext.imports; | ||
@@ -1100,14 +1091,7 @@ // traverse | ||
function compile(template, options = {}) { | ||
options = { | ||
...options, | ||
// apply DOM-specific parsing options | ||
...compilerDom.parserOptions, | ||
ssr: true, | ||
scopeId: options.mode === 'function' ? null : options.scopeId, | ||
options = Object.assign(Object.assign(Object.assign({}, options), compilerDom.parserOptions), { ssr: true, scopeId: options.mode === 'function' ? null : options.scopeId, | ||
// always prefix since compiler-ssr doesn't have size concern | ||
prefixIdentifiers: true, | ||
prefixIdentifiers: true, | ||
// disable optimizations that are unnecessary for ssr | ||
cacheHandlers: false, | ||
hoistStatic: false | ||
}; | ||
cacheHandlers: false, hoistStatic: false }); | ||
const ast = compilerDom.baseParse(template, options); | ||
@@ -1117,6 +1101,3 @@ // Save raw options for AST. This is needed when performing sub-transforms | ||
rawOptionsMap.set(ast, options); | ||
compilerDom.transform(ast, { | ||
...options, | ||
hoistStatic: false, | ||
nodeTransforms: [ | ||
compilerDom.transform(ast, Object.assign(Object.assign({}, options), { hoistStatic: false, nodeTransforms: [ | ||
ssrTransformIf, | ||
@@ -1134,16 +1115,10 @@ ssrTransformFor, | ||
...(options.nodeTransforms || []) // user transforms | ||
], | ||
directiveTransforms: { | ||
], directiveTransforms: Object.assign({ | ||
// reusing core v-bind | ||
bind: compilerDom.transformBind, | ||
bind: compilerDom.transformBind, | ||
// model and show has dedicated SSR handling | ||
model: ssrTransformModel, | ||
show: ssrTransformShow, | ||
model: ssrTransformModel, show: ssrTransformShow, | ||
// the following are ignored during SSR | ||
on: compilerDom.noopDirectiveTransform, | ||
cloak: compilerDom.noopDirectiveTransform, | ||
once: compilerDom.noopDirectiveTransform, | ||
...(options.directiveTransforms || {}) // user transforms | ||
} | ||
}); | ||
on: compilerDom.noopDirectiveTransform, cloak: compilerDom.noopDirectiveTransform, once: compilerDom.noopDirectiveTransform }, (options.directiveTransforms || {}) // user transforms | ||
) })); | ||
// traverse the template AST and convert into SSR codegen AST | ||
@@ -1150,0 +1125,0 @@ // by replacing ast.codegenNode. |
{ | ||
"name": "@vue/compiler-ssr", | ||
"version": "3.1.3", | ||
"version": "3.1.4", | ||
"description": "@vue/compiler-ssr", | ||
@@ -31,5 +31,5 @@ "main": "dist/compiler-ssr.cjs.js", | ||
"dependencies": { | ||
"@vue/shared": "3.1.3", | ||
"@vue/compiler-dom": "3.1.3" | ||
"@vue/shared": "3.1.4", | ||
"@vue/compiler-dom": "3.1.4" | ||
} | ||
} |
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
52746
1109
+ Added@vue/compiler-core@3.1.4(transitive)
+ Added@vue/compiler-dom@3.1.4(transitive)
+ Added@vue/shared@3.1.4(transitive)
- Removed@vue/compiler-core@3.1.3(transitive)
- Removed@vue/compiler-dom@3.1.3(transitive)
- Removed@vue/shared@3.1.3(transitive)
Updated@vue/compiler-dom@3.1.4
Updated@vue/shared@3.1.4