WordPress / developer-blog-content

In this GitHub space, WordPress team coordinates content to be published on the Developer Blog. Discussions and montly meetings (first Thu - 13:00 UTC) in WP Slack #core-dev-blog
https://developer.wordpress.org/news
40 stars 5 forks source link

Examples of using the new filter blockEditor.useSetting.before #85

Closed bph closed 1 year ago

bph commented 1 year ago

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

Originally posted by **annezazu** December 8, 2022 Pulled from this PR: https://github.com/WordPress/gutenberg/pull/45089 This would be a great filter to highlight, especially when thinking about additional curation options with the block editor. >This allows the injection of block settings into the block editor before everything is rendered, so we are able to customize the settings available for a block however we want. This unlocks a ton of neat options but definitely needs to be explained in detail and documented in general.
ndiego commented 1 year ago

Thanks @bph I'll pick this up.

cbirdsong commented 1 year ago

Here are some examples of stuff that I haven't been able to figure out that seem like they should be possible with this?

(If these aren't possible then I guess that's another thing to clarify?)

ndiego commented 1 year ago

Thanks @cbirdsong, I am going to start diving into this next week.

bph commented 1 year ago

Notes from the Editorial meeting March 2.

Share examples of using the new filter blockEditor.useSetting.before (#38) (title of the discussion, not working title yet) -> agreement in principle for idea, further discussion to follow

ndiego commented 1 year ago

The first draft of the article is ready for review: https://docs.google.com/document/d/1ktyuo4BHOeN3YzIpgoR83tmFGFTZIviKpC-NG2oabpA/edit#

marybaum commented 1 year ago

On it!

marybaum commented 1 year ago

Done!

ndiego commented 1 year ago

Thanks for all your help @marybaum 🙏

ndiego commented 1 year ago

The draft has been updated based on @marybaum's edits. @ingeniumed @alecgeatches @ryanwelcher @mburridge if you have time, I would greatly appreciate a technical review. This will be the first real article on the new blockEditor.useSetting.before filter so I want to make sure I am showcasing it well. 🙏

The code is all available via a companion plugin. I would like to keep the functionality of the examples the same if possible so I don't have to update the graphics, but any suggestions for improvement would be most welcome. Thanks!

mburridge commented 1 year ago

Excellent article. I just added a couple of minor comments.

bph commented 1 year ago

After the 2nd review is done on the blog draft, here is the Pre-publish checklist @ndiego

alecgeatches commented 1 year ago

@ndiego @marybaum @mburridge Fantastic article! I left a couple of very minor suggestions. I also left a comment chain about possible performance issues with expensive operations in blockEditor.useSetting.before, but after some testing I was incorrect about the cost of the example code and it's fine.

Thank you for writing up this awesome guide.

ndiego commented 1 year ago

Thanks for the review @alecgeatches 🙏

ingeniumed commented 1 year ago

@ndiego @marybaum @mburridge Great article! I love the practical examples that have been provided along with screenshots of them in action. No suggestions from my end, as it looks great. 🚢

ndiego commented 1 year ago

This article has been published: https://developer.wordpress.org/news/2023/05/curating-the-editor-experience-with-client-side-filters/ 🎉