Skip to content

Conversation

HcySunYang
Copy link
Member

@HcySunYang HcySunYang commented Apr 7, 2021

Fix: #3548

Edit:

Also fix #3569, at first I tried to fix issue #3569 in another independent PR(#3573), and then I realized the strong coupling between issue #3548 and issue #3569, so I merged them into this one PR.

Issue #3569 is another problem caused by the mixed-use of optimization mode and manual render function, technically, the user can get any VNode in the manually written render function, e.g.

setup(props, { slots }) {
  const index = ref(100)
  return () => {
    // get any vnode
    return slots.foo()[3].children[index.value]
  }
}

Suppose the initial value of index is 100, and then it becomes 999, then the old and new subTree may be:

// old
{ type: 'div', dynamicChildren: [vnode1, vnode2] }
// new
{ type: 'div', dynamicChildren: [vnode99], patchFlags: xxx }

Obviously, they are not comparable, and they may come from different levels.

The idea is, for slots, if the user manually obtains the contents of the slot by calling the slots function, we should be forced to bail out the optimization mode

@HcySunYang HcySunYang added the 🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. label Apr 7, 2021
@HcySunYang HcySunYang added ❗ p4-important Priority 4: this fixes bugs that violate documented behavior, or significantly improves perf. and removed 🔨 p3-minor-bug Priority 3: this fixes a bug, but is an edge case that only affects very specific usage. labels May 8, 2021
@yyx990803 yyx990803 merged commit 2010607 into vuejs:master May 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

❗ p4-important Priority 4: this fixes bugs that violate documented behavior, or significantly improves perf.

Projects

None yet

2 participants