WordPress / developer-blog-content

In this GitHub space, WordPress team coordinate content to be published on the Developer Blog. Discussion and montly meetings (first Thu) in WP Slack #core-dev-blog
38 stars 4 forks source link

Static blocks vs Dynamic blocks - what's the difference #72

Closed bph closed 1 year ago

bph commented 1 year ago

Discussed in https://github.com/WordPress/developer-blog-content/discussions/21

Originally posted by **mburridge** November 16, 2022 Article idea

Somehow the discussion didn't come over. I copy/paste comments from the Discussion.

Resources

https://design.oit.ncsu.edu/2019/03/11/choosing-dynamic-blocks-one/ https://github.com/WordPress/gutenberg/discussions/35918 https://kinsta.com/blog/dynamic-blocks/ Definitions

A type of block where the content of which may change and cannot be determined at the time of saving a post, instead calculated any time the post is shown on the front of a site. These blocks may save fallback content or no content at all in their JavaScript implementation, instead deferring to a PHP block implementation for runtime rendering.

https://developer.wordpress.org/block-editor/explanations/glossary/#dynamic-block A type of block where the content of which is known at the time of saving a post. A static block will be saved with HTML markup directly in post content.

https://developer.wordpress.org/block-editor/explanations/glossary/#static-block

@wordpress/create-block will build a dynamic block with the following option:

$ npx @wordpress/create-block --variant dynamic

Blocks can be static or dynamic. Static blocks contain rendered content and an object of Attributes used to re-render based on changes. Dynamic blocks require server-side data and rendering while the post content is being generated (rendering).

from here.

bph commented 1 year ago

Huge Thank you to Joni Halabi for taking on this content. Please comment on this issue, so it can be assigned to you.

fabiankaegy commented 1 year ago

Just adding this resource here in the hat since I have some thoughts on the topic: https://gutenberg.10up.com/reference/Blocks/custom-blocks#dynamic-blocks :)

Happy to also help review this when it's ready or contribute in any way I can :) Really looking forward to what you come up with Joni :)

thatdevgirl commented 1 year ago

Commenting on this issue so that I can be assigned to it. :)

thatdevgirl commented 1 year ago

I have an updated draft! Is it OK to post drafts here or is there a better place to post a draft? (This is my first WP post.)

bph commented 1 year ago

We habe two options: 1) You can post a link to a Google doc and people can comment there.
2) You get author access to the blog and you can post a draft there. We have Public Post Preview installed, and feedback will.be shared on this issue.

Let me know which you prefer..

thatdevgirl commented 1 year ago

I prefer the Google doc. I think it will be easier to track discussions and comments there.

Here is the link to my draft: https://docs.google.com/document/d/1TecVPkATrySRy5Dtj7GaQBg1L9rAtYdkCznskBxe9RA/edit?usp=sharing

Feel free to comment as much as you would like and please let me know if you have questions. Thank you all!

justintadlock commented 1 year ago

@thatdevgirl - Thanks for putting this together. I'll be running through the doc and providing some feedback today. I'm really looking forward to this being on the Dev Blog.

justintadlock commented 1 year ago

I've left a few comments in the post. This is shaping up to be really great!

Aside from my in-doc notes, I'd love to see a couple of screenshots of both static and dynamic blocks in the editor. They'll just help readers better visualize things and break up the text a bit more.

thatdevgirl commented 1 year ago

@fabiankaegy & @justintadlock - Thank you so much for reading and commenting on the article! I made several edits based on your comments and added a couple of screenshots. Please let me know what you think. Thanks!

justintadlock commented 1 year ago

As far as I'm concerned, it looks good to go.

I've moved this over to "Needs 2nd review." @abhansnuk - Did you do the second review (I saw a comment from you in there)? If so, we can move this the "Ready to publish" stage.

abhansnuk commented 1 year ago

Hello, Yes second review completed. It will need the credits added at the end and excerpt when added to the CMS. Back to you @thatdevgirl .

Note to self for general follow-up : https://wordpress.org/documentation/article/wordpress-block-editor/ has Block Editor with caps B and E.

thatdevgirl commented 1 year ago

I added credits to the end of the article, copied below. I used everyone's WordPress handles, but please let me know if I should have used a different handle for everyone:

Props to @fabiankaegy, @greenshady, @mburridge, and @webcommsat for reviewing this post.

I also wrote an excerpt, which I added to the very bottom of the Google doc.

What happens next in terms of publishing? (I don't have access to publish.)

Thank you all!!

bph commented 1 year ago

@thatdevgirl I just invited you to the Developer Blog site. You need to confirm via the link in the email. :-) The tips and guidelines for writers you already read, so this is just a reminder..

Here is a short pre-publish check list.

If you share the Public Preview Link, I'll double-check :-)

thatdevgirl commented 1 year ago

@bph I just drafted the post. Here is the preview link: https://developer.wordpress.org/news/?p=879&preview=true

Thank you so much!

bph commented 1 year ago

I removed the two mention of Gutenberg, at the beginning and published the post. Developer Blog: Static vs. dynamic blocks: What’s the difference?

Congratulations! And Thank you so much for your great work!