Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove the Document model #2863

Closed
ianstormtaylor opened this issue Jun 7, 2019 · 1 comment
Closed

remove the Document model #2863

ianstormtaylor opened this issue Jun 7, 2019 · 1 comment

Comments

@ianstormtaylor
Copy link
Owner

Do you want to request a feature or report a bug?

Improvement.

What's the current behavior?

Right now we have a Document model, which doesn't get us much other than being able to know that we're at a "root" node in the tree. With #2495 there's a benefit to being able to further eliminate the need for .object properties, so we can remove it.

What's the expected behavior?

Based on #2757, we'd change things to remove the idea of a Document model. And instead put its properties directly on the Value. So you'd have:

const value = {
  nodes: [...],
  data: {},
  ...
}

(The data property technically already exists, so we're simplifying by getting rid of the arbitrary distinction between document.data and value.data which is currently confusing anyways.)

We'd still need to be able to express the concept of a "fragment". But this can be handled by a simple array of nodes, instead of a separate object.

(In the further future we may need to be able to determine whether the edges of a fragment are "open" or "closed", to better handle insertion logic when nodes should be merged. But we can handle this case when we get there, by using an object with extra properties.)

@ianstormtaylor
Copy link
Owner Author

Fixed by #3093.

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

Successfully merging a pull request may close this issue.

1 participant