@vue/server-renderer
Advanced tools
Comparing version 3.0.0-rc.9 to 3.0.0-rc.10
@@ -160,8 +160,16 @@ 'use strict'; | ||
const res = setupComponent(instance, true /* isSSR */); | ||
if (shared.isPromise(res)) { | ||
return res | ||
.catch(err => { | ||
vue.warn(`[@vue/server-renderer]: Uncaught error in async setup:\n`, err); | ||
}) | ||
.then(() => renderComponentSubTree(instance)); | ||
const hasAsyncSetup = shared.isPromise(res); | ||
const prefetch = vnode.type.serverPrefetch; | ||
if (hasAsyncSetup || prefetch) { | ||
let p = hasAsyncSetup | ||
? res.catch(err => { | ||
vue.warn(`[@vue/server-renderer]: Uncaught error in async setup:\n`, err); | ||
}) | ||
: Promise.resolve(); | ||
if (prefetch) { | ||
p = p.then(() => prefetch.call(instance.proxy)).catch(err => { | ||
vue.warn(`[@vue/server-renderer]: Uncaught error in serverPrefetch:\n`, err); | ||
}); | ||
} | ||
return p.then(() => renderComponentSubTree(instance)); | ||
} | ||
@@ -176,3 +184,3 @@ else { | ||
if (shared.isFunction(comp)) { | ||
renderVNode(push, renderComponentRoot(instance), instance); | ||
renderVNode(push, (instance.subTree = renderComponentRoot(instance)), instance); | ||
} | ||
@@ -206,3 +214,3 @@ else { | ||
else if (instance.render) { | ||
renderVNode(push, renderComponentRoot(instance), instance); | ||
renderVNode(push, (instance.subTree = renderComponentRoot(instance)), instance); | ||
} | ||
@@ -266,11 +274,3 @@ else { | ||
} | ||
if (scopeId) { | ||
openTag += ` ${scopeId}`; | ||
const treeOwnerId = parentComponent && parentComponent.type.__scopeId; | ||
// vnode's own scopeId and the current rendering component's scopeId is | ||
// different - this is a slot content node. | ||
if (treeOwnerId && treeOwnerId !== scopeId) { | ||
openTag += ` ${treeOwnerId}-s`; | ||
} | ||
} | ||
openTag += resolveScopeId(scopeId, vnode, parentComponent); | ||
push(openTag + `>`); | ||
@@ -304,2 +304,20 @@ if (!shared.isVoidTag(tag)) { | ||
} | ||
function resolveScopeId(scopeId, vnode, parentComponent) { | ||
let res = ``; | ||
if (scopeId) { | ||
res = ` ${scopeId}`; | ||
} | ||
if (parentComponent) { | ||
const treeOwnerId = parentComponent.type.__scopeId; | ||
// vnode's own scopeId and the current rendering component's scopeId is | ||
// different - this is a slot content node. | ||
if (treeOwnerId && treeOwnerId !== scopeId) { | ||
res += ` ${treeOwnerId}-s`; | ||
} | ||
if (vnode === parentComponent.subTree) { | ||
res += resolveScopeId(parentComponent.vnode.scopeId, parentComponent.vnode, parentComponent.parent); | ||
} | ||
} | ||
return res; | ||
} | ||
function applySSRDirectives(vnode, rawProps, dirs) { | ||
@@ -306,0 +324,0 @@ const toMerge = []; |
@@ -157,8 +157,16 @@ 'use strict'; | ||
const res = setupComponent(instance, true /* isSSR */); | ||
if (shared.isPromise(res)) { | ||
return res | ||
.catch(err => { | ||
vue.warn(`[@vue/server-renderer]: Uncaught error in async setup:\n`, err); | ||
}) | ||
.then(() => renderComponentSubTree(instance)); | ||
const hasAsyncSetup = shared.isPromise(res); | ||
const prefetch = vnode.type.serverPrefetch; | ||
if (hasAsyncSetup || prefetch) { | ||
let p = hasAsyncSetup | ||
? res.catch(err => { | ||
vue.warn(`[@vue/server-renderer]: Uncaught error in async setup:\n`, err); | ||
}) | ||
: Promise.resolve(); | ||
if (prefetch) { | ||
p = p.then(() => prefetch.call(instance.proxy)).catch(err => { | ||
vue.warn(`[@vue/server-renderer]: Uncaught error in serverPrefetch:\n`, err); | ||
}); | ||
} | ||
return p.then(() => renderComponentSubTree(instance)); | ||
} | ||
@@ -173,3 +181,3 @@ else { | ||
if (shared.isFunction(comp)) { | ||
renderVNode(push, renderComponentRoot(instance), instance); | ||
renderVNode(push, (instance.subTree = renderComponentRoot(instance)), instance); | ||
} | ||
@@ -203,3 +211,3 @@ else { | ||
else if (instance.render) { | ||
renderVNode(push, renderComponentRoot(instance), instance); | ||
renderVNode(push, (instance.subTree = renderComponentRoot(instance)), instance); | ||
} | ||
@@ -263,11 +271,3 @@ else { | ||
} | ||
if (scopeId) { | ||
openTag += ` ${scopeId}`; | ||
const treeOwnerId = parentComponent && parentComponent.type.__scopeId; | ||
// vnode's own scopeId and the current rendering component's scopeId is | ||
// different - this is a slot content node. | ||
if (treeOwnerId && treeOwnerId !== scopeId) { | ||
openTag += ` ${treeOwnerId}-s`; | ||
} | ||
} | ||
openTag += resolveScopeId(scopeId, vnode, parentComponent); | ||
push(openTag + `>`); | ||
@@ -301,2 +301,20 @@ if (!shared.isVoidTag(tag)) { | ||
} | ||
function resolveScopeId(scopeId, vnode, parentComponent) { | ||
let res = ``; | ||
if (scopeId) { | ||
res = ` ${scopeId}`; | ||
} | ||
if (parentComponent) { | ||
const treeOwnerId = parentComponent.type.__scopeId; | ||
// vnode's own scopeId and the current rendering component's scopeId is | ||
// different - this is a slot content node. | ||
if (treeOwnerId && treeOwnerId !== scopeId) { | ||
res += ` ${treeOwnerId}-s`; | ||
} | ||
if (vnode === parentComponent.subTree) { | ||
res += resolveScopeId(parentComponent.vnode.scopeId, parentComponent.vnode, parentComponent.parent); | ||
} | ||
} | ||
return res; | ||
} | ||
function applySSRDirectives(vnode, rawProps, dirs) { | ||
@@ -303,0 +321,0 @@ const toMerge = []; |
{ | ||
"name": "@vue/server-renderer", | ||
"version": "3.0.0-rc.9", | ||
"version": "3.0.0-rc.10", | ||
"description": "@vue/server-renderer", | ||
@@ -18,3 +18,4 @@ "main": "index.js", | ||
"type": "git", | ||
"url": "git+https://github.com/vuejs/vue-next.git" | ||
"url": "git+https://github.com/vuejs/vue-next.git", | ||
"directory": "packages/server-renderer" | ||
}, | ||
@@ -31,8 +32,8 @@ "keywords": [ | ||
"peerDependencies": { | ||
"vue": "3.0.0-rc.9" | ||
"vue": "3.0.0-rc.10" | ||
}, | ||
"dependencies": { | ||
"@vue/shared": "3.0.0-rc.9", | ||
"@vue/compiler-ssr": "3.0.0-rc.9" | ||
"@vue/shared": "3.0.0-rc.10", | ||
"@vue/compiler-ssr": "3.0.0-rc.10" | ||
} | ||
} |
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
47586
1211
+ Added@vue/compiler-core@3.0.0-rc.10(transitive)
+ Added@vue/compiler-dom@3.0.0-rc.10(transitive)
+ Added@vue/compiler-ssr@3.0.0-rc.10(transitive)
+ Added@vue/reactivity@3.0.0-rc.10(transitive)
+ Added@vue/runtime-core@3.0.0-rc.10(transitive)
+ Added@vue/runtime-dom@3.0.0-rc.10(transitive)
+ Added@vue/shared@3.0.0-rc.10(transitive)
+ Addedvue@3.0.0-rc.10(transitive)
- Removed@vue/compiler-core@3.0.0-rc.9(transitive)
- Removed@vue/compiler-dom@3.0.0-rc.9(transitive)
- Removed@vue/compiler-ssr@3.0.0-rc.9(transitive)
- Removed@vue/reactivity@3.0.0-rc.9(transitive)
- Removed@vue/runtime-core@3.0.0-rc.9(transitive)
- Removed@vue/runtime-dom@3.0.0-rc.9(transitive)
- Removed@vue/shared@3.0.0-rc.9(transitive)
- Removedvue@3.0.0-rc.9(transitive)
Updated@vue/shared@3.0.0-rc.10