Skip to content

Add mutations detection to the babel plugin  #103

Description

@dumconstantin

In order to avoid unnecessary cloning we can infer from the AST the type of operations that occur on data and then can label which props need cloning and which don't.

The default strategy should be as conservative as possible and expand from there.

We can augment the producer object with a mutated prop that flags which property is potentially mutated and then rely on the runtime to apply the proper approach.

....
mutated: {
   foo: false,
   bar: true,
   baz: {
      bam: false
   }
}

Cloning inside producers is done at a granular level but a flag needs to be given to the db to avoid cloning values on listeners.

Another topic would be the cloning done during the set operation. This might be trickier to implement.

Only observe and get.value fall in the category of cloning.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions