wip: disable time-slicing in compat mode

This commit is contained in:
Evan You
2018-11-08 18:41:04 -05:00
parent 132da6c354
commit d39eb6cdbc
2 changed files with 36 additions and 28 deletions

View File

@@ -271,29 +271,7 @@ export function createRenderer(options: RendererOptions) {
const doMount = () => {
handle.runner = autorun(
() => {
if (handle.prevTree) {
// mounted
const { prevTree, current } = handle
if (__DEV__) {
pushWarningContext(current)
}
const nextTree = (handle.prevTree = current.children = renderFunctionalRoot(
current
))
queuePostCommitHook(() => {
current.el = nextTree.el
})
patch(
prevTree as MountedVNode,
nextTree,
platformParentNode(current.el),
current as MountedVNode,
isSVG
)
if (__DEV__) {
popWarningContext()
}
} else {
if (!handle.prevTree) {
// initial mount
if (__DEV__) {
pushWarningContext(vnode)
@@ -308,6 +286,8 @@ export function createRenderer(options: RendererOptions) {
if (__DEV__) {
popWarningContext()
}
} else {
updateFunctionalComponent(handle, isSVG)
}
},
{
@@ -324,6 +304,30 @@ export function createRenderer(options: RendererOptions) {
}
}
function updateFunctionalComponent(handle: FunctionalHandle, isSVG: boolean) {
// mounted
const { prevTree, current } = handle
if (__DEV__) {
pushWarningContext(current)
}
const nextTree = (handle.prevTree = current.children = renderFunctionalRoot(
current
))
queuePostCommitHook(() => {
current.el = nextTree.el
})
patch(
prevTree as MountedVNode,
nextTree,
platformParentNode(current.el),
current as MountedVNode,
isSVG
)
if (__DEV__) {
popWarningContext()
}
}
function mountText(
vnode: VNode,
container: RenderNode | null,