Skip to content

Update Gutenberg lifecycle clarity and grammar#13574

Merged
gziolo merged 2 commits intoWordPress:masterfrom
rjcdr:patch-1
Feb 8, 2019
Merged

Update Gutenberg lifecycle clarity and grammar#13574
gziolo merged 2 commits intoWordPress:masterfrom
rjcdr:patch-1

Conversation

@rjcdr
Copy link
Copy Markdown

@rjcdr rjcdr commented Jan 29, 2019

Description

Simplified sentence structure, semantics of the closing paragraph. Also made redundant content relevant to the overall aims of the passage.

Simplified sentence structure, semantics of the closing paragraph. Also made redundant content relevant to the overall aims of the passage.
## The Gutenberg Lifecycle

In summary, the workflow for editing a Gutenberg post starts with taking the persisted version of the document and generating the in-memory tree, aided by the presence of token delimiters. It ends with the reverse: serialization of blocks into `post_content`. During editing, all manipulations happen within the block tree. In summary, a Gutenberg post is built upon an in-memory data structure which gets persisted somehow in an fully-isomorphic way. Right now that persistence is via a serialization/parser pair but could just as easily be replaced through a plugin to store the data structure as a JSON blob somewhere else.
In summary, the workflow for editing a Gutenberg post starts with using token delimeters to generate an in-memory tree from the persisted version of the document. The process ends by reversing the serialization of blocks into the `post_content`. During editing, all manipulations happen within the block tree. Alternatively, a Gutenberg post is built and manipulated using an isomorphically persistied, in-memory data structure. Although Gutenberg post persistence is currently achieved using a serialization/parser pair, in hypothetical scenarios the post data structure could also be stored using a plugin or retreived from a remote JSON file.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The process ends by reversing the serialization of blocks

The phrasing here seems to imply that a serialization is reversed, which doesn't really make sense. The previous phrasing was more to emphasize the inverse of the initial parse, i.e. completing the cycle of "Markup -> (Parse) -> Blocks -> (Serialize) -> Markup".

@gziolo gziolo added the [Type] Developer Documentation Documentation for developers label Jan 31, 2019
@gziolo gziolo added this to the Documentation & Handbook milestone Jan 31, 2019
@mkaz
Copy link
Copy Markdown
Member

mkaz commented Jan 31, 2019

My two cents both versions are fairly dense and difficult to read, here is a potential rewrite for simplicity

In summary, the Gutenberg workflow parses the saved document to an in-memory tree of blocks, using token delimiters to help. During editing, all manipulations happen within the block tree. The process ends by serializing the blocks back to the post_content.

The workflow process relies on a serialization/parser pair to persist posts. Hypothetically, the post data structure could be stored using a plugin or retrieved from a remote JSON file to be converted to the block tree.

@gziolo
Copy link
Copy Markdown
Member

gziolo commented Feb 5, 2019

I applied changes proposed by @mkaz - is it good to go now?

Copy link
Copy Markdown
Member

@mkaz mkaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me ;-)

@gziolo gziolo merged commit f345f96 into WordPress:master Feb 8, 2019
youknowriad pushed a commit that referenced this pull request Mar 6, 2019
* Update Gutenberg lifecycle clarity and grammar

Simplified sentence structure, semantics of the closing paragraph. Also made redundant content relevant to the overall aims of the passage.

* Update key-concepts.md
youknowriad pushed a commit that referenced this pull request Mar 6, 2019
* Update Gutenberg lifecycle clarity and grammar

Simplified sentence structure, semantics of the closing paragraph. Also made redundant content relevant to the overall aims of the passage.

* Update key-concepts.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Type] Developer Documentation Documentation for developers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants