-
Notifications
You must be signed in to change notification settings - Fork 5
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
Building a multi-block plugin #292
Comments
... making sure this comment by @zzap doesn't get lost
|
Here are a few links to get you started, @troychaplin Tips and guidelines for writers and in there you also find Google Doc template to get you started.. Notes on creating and formatting a Google Doc #242 |
@troychaplin - nice to see you over here, we've chatted on Ryan's livestream a bit. Here are a number of links and resources, and some GitHub issues that this could help to address. Issue #22 - Block Developer CookbookIssue #80 - Block Development Examples repo
Slack discussion:https://wordpress.slack.com/archives/C03RL47B3S8/p1709818696592279
Video resources
|
Good to hear from you again @flexseth. Thanks for these links, I'll go over them once I get my first draft written and see how they relate. |
@zzap The first draft of my article is ready for review -- https://docs.google.com/document/d/1vlCwOmoea4HdqkVlNACNTWuVKFC7KIs3mg4cIIva_JQ/edit?usp=sharing |
This is a partial review. I added a bookmark for myself to know where to continue. First of all, thank you so much for writing this tutorial, @troychaplin. I'm having a lot of fun following it. Here are my suggestions so far: 1. The local environment. Following the tutorial, I went to one of my local installs that I use for testing, fun and break. It's just a regular WordPress inside my Apache. I ran the block scaffolding script inside of it, easy-peasy, all good. Then I saw you want to use wp-env. Oki doki, moved the plugin dir outside of my www folder, ran the env install script and, shoot, my node version is wrong. So I went to install new node version and switch to it. Then I had to shut down Apache and mySQL and run Docker Desktop. And then everything was working. Now, I am used to this. I do this every time I switch between enterprise and smaller clients. But some people might have never used Docker or wp-env. And, honestly, they probably don't have to. But that's besides the point. The point is that local environment is NOT important for this tutorial. Blocks work in any. Personally I would lose the whole section about environment. Just mention what you use and why, link to its documentation and say that it doesn't matter what you use to be able to follow the tutorial. Because it doesn't and it's just a roadblock for people who don't use Docker. 2. Render callback 3. Best practices The rest of the review will follow soon. Thanks again ❤️ |
@troychaplin - I included some suggestions in your draft. Thanks for putting this together. |
Thanks for the feedback @zzap, I have made all suggested changes. The section about wp-env has been completely removed, your feedback made perfect sense. I've also updated code related to the render property, and have also taken the suggestions from @flexseth into consideration and have added more code examples in all areas of the basic setup section of the article. I plan on going over the next advanced configuration section this evening to make similar modifications and make sure the way examples are presented is done consistently. |
@zzap forgot to comment to say I'm finished with additional revisions to the content you haven't reviewed yet. Cheers! |
Hey @troychaplin , thank you so much for accepting suggestions. I completed the review and found it very interesting and informative. It has a nice arch, bringing the reader from a known place to new knowledge. I love the additional settings and custom webpack config section because that's not something you do every day, so when you do it, you become an expert, but tomorrow, that expertise is gone and you're a clueless noobie when you have to do it again in a few months 😂 I'm left with two things on my mind after reading it:
This is not a request or suggestion, but if you have an opinion on the second item, I'd love to hear it, and maybe include it in one sentence in the article. Thank you again. @bph this is ready for second review. |
Thanks @zzap I am not familiar with the Interactivity API just yet, I did not know it leverages view.js. I do have a very simple work around for this, but it's not idea so I didn't want to put it out there in the article, but I do it for a couple of project. In the register_block_type function you can point to the block.json file in the src folder. The issue with the view.js is that when you add webpack and compile it this way no individual JS files get placed in each block folder in the build directory which is needed with the way the view.js file is referenced in the block.json. I would be interested in hearing if you do dive in to this one and find a solution. I may have a look at some point too, I've never had the need to this point. As for the copy paste, I think there's an addition I could make here. Just a little side note about being able to run @bph could you please give me until tomorrow to make a few updates before the doc gets a second review? |
@troychaplin I just got back from vacation and I am almost through my backlog. I put the review of your post on my to-do list for Monday (9/2) Have a great weekend! For what it's worth, I like your |
@troychaplin I started the 2nd review, but ran out of steam. I will continue it tomorrow. I already left a few comments following along with your code example and had opinions. Ignore my bookmark to find the spot where I stopped. More tomorrow. |
Thank you @bph, I just went through all of your feedback. I also went through the content after your bookmark to change the we's to you's, etc |
I finished my review. You are almost there! 🎉
Once you are through this round of updates, you can start moving it to the dev blog. I also sent you and invite to your wp.org email address. You would need to click on the link to accept the invitation. I'll share the pre- and post publish checklist in the next comment. |
Pre-publishing checklist:
Post-publishing checklist
|
Thanks @bph, I've gone through the checklist and have everything ready. Here's some copy for a social post:
The public preview URL is https://developer.wordpress.org/news/?p=4208&preview=1&_ppp=4fd288d9fe |
@troychaplin I went through the post on the blog and made quite a few adjustments. (Don't take this as criticism of your work, that I publish my changes here. I am logging my changes so we can create formatting standards for the blog and future new writers have it a bit easier. ) I modified your headers and subheaders. We only use two-level heading (h2 and h3). That way we can avoid duplicate subheaders and too deep leveling. This shortened the Table of Contents quite a bit and is less intimidating. I also move the TOC below your introductory remarked. They then don't need any headers either. One sentence doesn't need a sub header. Where it was necessary for readability to leave them I converted them to paragraphs with large and bold fonts so they stand out. Featured image: We don't have standard instructions for what a good feature image would make either. But we have been working on it. I also changed your note about text domain to a notice block, so it wouldn't need a sub header either. The post is now scheduled for September 17 at 2:45 am UTC |
Thanks for all the feedback and help @bph, much appreciated. I don't see this as criticism, but rather guidance on how to follow the process which I need to learn. |
We are all on a learning path to get better and better. Thanks for your great work on this article! |
Article has been published at https://developer.wordpress.org/news/2024/09/17/how-to-build-a-multi-block-plugin/#comment-12125 |
Schedule for Oct 2 |
Discussed in #289
Originally posted by troychaplin July 15, 2024
Create block is a fantastic to help get you up and running with a new block rather quickly. but what if you plan to build multiple blocks and want to keep them all contained within one plugin?
I was faced with this challenge in a recent project and think sharing my experience and configuration would benefit other developers. This post would include plenty of code examples as well as a repo with a multi-block starter project that I would build during the process of writing the post.
The text was updated successfully, but these errors were encountered: