โ† Go Back

Woohoo! Gutenberg 2.9 is out today. I have to say it’s going good so far and coming into a shape to be merged into the core.

 

The Gutenberg Project

For peeps who are not familiar to what I’m talking about, the Gutenberg project introduces a new publishing experience to WordPress, with it’s current focus in the post editor. It’s first phase replaces the current open text editor window with an intuitive “block” based interface. You can know more about the project here.

 

Changes in 2.9

Gutenberg 2.9 doesn’t introduce too many revolutionary changes like it did in 2.8. The team merged about 100 pull requests in the release which mostly consisted of bug fixes. The most notable changes in my opinion include:

Adding pinning support for sidebar plugins

This addition was by far the most exciting enhancement in 2.9.

pull-6442
Source: Github

It adds a pinning feature to all the plugins that extend the editor which lets the user pin a plugin in the main editor header, mostly for quick access and ease of usage.

Adding (more) keyboard shortcuts

This PR adds the ability to use a couple more very useful keyboard shortcuts within the Gutenberg editor. Now, users can use CMD+S to save, CMD+Z to Undo to CMD+Shift+Z for redo (for macOS) / CTRL+S to save, CTRL+Z to undo and CTRL+Y to redo. Sounds interesting, doesn’t it?

Fixing caption width in resized images

This PR introduces usage of fit-content and min-content in figures, where min-content uses the minimum width of the images when resized and sets that width for the caption. Here’s a nifty before/after image to describe the enhancement:

Image Border Editor: https://www.tuxpi.com/photo-effects/borders
Source: Github

Polishing the table block in terms of responsiveness

This PR introduces a toggle in table block’s sidebar in order to determine if the table has fixed widths.

pull-6314

It also includes other improvements to styles regarding the table block.

Determining if Publish UI should be displayed

This was an interesting one which introduces usage of wp:action-publish to determine if the publish panel and publish button should be displayed. Previously, just isContributor conditional which depended on the user component was used to determine if the current user was a contributor and if so, the publish UI was not shown to him. This PR introduces hasPublishAction which depends on wp:action-publish to explicitly check if the publish panel to the current user.

Improving performance by stopping unnecessary re-renders

This PR introduces the usage of memoization which makes sure the getColor and setColor functions do not return a new object or a new function every time they are changed. This results in the elimination of unnecessary renders when the mentioned functions are used.

Adding FontSizePicker component

Another interesting one which makes the font size UI in the paragraph block generic. That way, other blocks in the post will be able to take advantage of the UI and font size logic used in the paragraph block and use the same in themselves.

Improving focus behaviour for RichText component

Previously, local state was manually used to store which component is in focus and then others were prevented to be selected at the same time. This one enhances the focus behavior for the RichText component ensuring that only one of these components can be focused at the same time.

These were the changes that seemed worth looking into in my opinion. There’s a more descriptive post by Matias Ventura here which describes all the changes and additions that rolled out in 2.9.

 

My Contributions in 2.9

I have been planning of contributing to Gutenberg since I first heard about the project. I finally was able to figure out a routine to spend a part of my day on study, practice, experimentations and contributions which rolled out in version 2.9. Though very minor updates, but here are the ones that were merged in this version:

Introducing text-alignment setting to the subheading block

The subheading block in the editor was missing the text alignment setting which was available in other blocks like heading, paragraph and so on.

pull-6525

I did a bit studying on the structure of other blocks and didn’t find it very difficult to determine what were the requirements for this setting to work and how the structure would be, which resulted in a successful merge after some reviews and updates.

Moving alignment setting in heading block from sidebar to block toolbar

The text alignment setting for the heading block was located in the sidebar initially. I discovered that the team had been working on moving the text alignment setting from the sidebar to the block toolbar for blocks. This merged PR did that in case of the heading block.
Though, this change was reverted in a later PR due to some visual issues in smaller devices.

Showing caption and description fields in post featured image modal

The caption and description fields in the post featured image modal were initially hidden as they were considered unnecessary. The issue that this PR addressed demanded the change to be reverted and the caption and description fields to be shown, as many users found them useful.

 

Conclusion

I have been planning on spending a part of my day on open source contributions with the purpose of study, practice and experimentations in order to enrich the horizon of my knowledge. For most WordPress fanatics like me, the Gutenberg project is considered WP’s one step forward for being the best (which it is already) of the best content management system out there. I intend to continue my contributions to the project and sharing my journey here all along.

React is one of the Javascript libraries that I wanted to try using for quite some time now. I had been checking it out in documentations and examples in the past and got a chance to play a bit with it this once, thanks to Gutenberg ๐Ÿ˜‰

With that said, I’ll wrap this one up here and will be looking into the comments section for thoughts from your end to appear. What do you think of the 2.9 release? Do you feel that these updates are enhancing your usage experience? Do you think Gutenberg is matured enough to be merged to the core? Let me know in the comments section ๐Ÿ™‚

Nahid Ferdous Mohit

Nahid Ferdous Mohit

Nahid is a 20 years old, self-learned software developer, currently working as a tech support engineer at WPMU DEV. Besides his awesome day job, he spends the rest of his leisure time in open source development.