Skip to content

buggy serializing info into EditorState #739

@addlistener

Description

@addlistener

Is your feature request related to a problem? Please describe.

I put a ReactNode inside craft.info and found that node.info is serialized into EditorState

So immer.js serializes it and caused an error when I hit "undo" after using "actions.replaceNode"(#571 (comment)) --> "Cannot add property validated, object is not extensible".

The reason
https://stackoverflow.com/a/61345526/1922857

Describe the solution you'd like

  1. Do not serialize info into editor state. And use a getter in node to get the info.

  2. Perhaps deprecate info? I know it's a big change. But info is just a map from component name to a record. craft.js core does not read it at all. The best way is to give up control totally. Issues like this will be out of scope Allowing type augmentation #678

Additional context

As described info is component level and should not be serialized
#578

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions