Skip to content
This repository was archived by the owner on Jun 6, 2019. It is now read-only.
This repository was archived by the owner on Jun 6, 2019. It is now read-only.

Enhance the tolerance of invalid data format #22

@Hanks10100

Description

@Hanks10100

See the two examples below, they are actually the same program but writen in different syntax.

They both rendered a list, and set this.lists.lengh++ in the mounted (and ready) intentially.

Because the this.lists[1] is undefined, which is an invalid data in the lists, it will cause an error when evaluating obj.name. However, despite the error Weex (.we) can still render the this.lists[2] correctlly, but the Vue 2.0 couldn't.

The simplified error stack is like this:

updateComponent() -> watcher.run() -> watcher.get() -> getter.call(vm)

The key reason for this problem is the watcher in Vue 2.0 is binding to the whole render function, every data change will re-run the render function. But in .we, the watcher is bind one-by-one to the specific element (as Vue 1.0 did).

The problem also exists on the web platform. It's not a bug, it's a feature in Vue 2.0. But This feature did troubled many Weex developers. The data fetched from the server is always unreliable in the real world. It's much better to tolerance the invalid data format in the framework. (or not ?)

@yyx990803 Do you have any advice to solve it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions