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

Add dynamic block documentation #4067

Merged
merged 6 commits into from Dec 19, 2017

Conversation

Projects
None yet
3 participants
@atimmer
Member

atimmer commented Dec 18, 2017

I wanted to onboard one of our developers onto writing a dynamic Gutenberg block, but I couldn't find the documentation. So I've added the documentation from @youknowriad's blog to the handbook. Taken from https://riad.blog/2017/10/16/one-thousand-and-one-way-to-extend-gutenberg-today/#dynamic-block. I've rewritten some sentences to better fit the handbook.

@youknowriad

Some small comments, but thanks for adding this. I also had some people asking about it.

Show outdated Hide outdated docs/blocks-dynamic.md
Show outdated Hide outdated docs/blocks-dynamic.md

atimmer added some commits Dec 18, 2017

* The edit function still shows a representation of the block in the editor's context (this could be very different from the rendered version, it's up to the block's author)
* The save function just returns null because the rendering is performed server-side.
* The server-side rendering is a function taking the block attributes as an argument and returning the markup (quite similar to shortcodes)

This comment has been minimized.

@aduth

aduth Dec 19, 2017

Member

Do we need to be clearer about how attributes are also defined on the server for this to work correctly? Though in this case there are no attributes for this block.

@aduth

aduth Dec 19, 2017

Member

Do we need to be clearer about how attributes are also defined on the server for this to work correctly? Though in this case there are no attributes for this block.

This comment has been minimized.

@atimmer

atimmer Dec 19, 2017

Member

I don't know, I've copied these points from Riad's post. Could we merge this and iterate on it further?

@atimmer

atimmer Dec 19, 2017

Member

I don't know, I've copied these points from Riad's post. Could we merge this and iterate on it further?

Show outdated Hide outdated docs/blocks-dynamic.md
@aduth

aduth approved these changes Dec 19, 2017

@aduth aduth merged commit 64ac510 into WordPress:master Dec 19, 2017

2 checks passed

codecov/project 38.9% (+0.24%) compared to 1b35aac
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@atimmer atimmer deleted the Yoast:add/docs-dynamic-blocks branch Dec 20, 2017

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