Skip to content

Dep collection not paused during first invocation of immediate watchers, leading to unnecessary re-render #11942

Closed
@delaneyb

Description

@delaneyb

Version

2.6.11

Reproduction link

https://jsfiddle.net/gyejmL14/32/

Steps to reproduce

Press the button "change value of testKey".

What is expected?

No components should be updated

What is actually happening?

The root components render function is being run again.

During component-a's creation, the immediate watcher for testKey is invoked without a pushTarget(). At this point the updateComponent() of the parent is still the Dep.target. Everything accessed within the immediate watcher is then collected as a dependency of the parents updateComponent watcher. When the button is then pressed, this triggers an unnecessary update of the Root component.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions