How to Give Yourself a Raise

I know this may sound a bit deceiving and illegal but trust me it’s not. Having more take home pay is not always possible but having more money after all the bills are paid is the same as giving…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




Gutenberg 2.9 and My Contributions

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.

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

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.

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?

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:

Source: Github

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

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

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.

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.

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.

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.

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:

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

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.

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.

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.

This was my first attempt of contributing to an open source project and experimentation with React. I had been checking out React in documentations and examples in the past but got a chance to study and work on it this once. I’m loving it so far and hopefully will continue my study and contributions in the Gutenberg project.

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.

Add a comment

Related posts:

First Principle Thinking in Software Development

First principle thinking is the scientific questioning of various preconceived statements, which are generally assumed to be scientific. It does not assume preconceptions and biasness in its…

Stay updated with the last news about Hive Power on our new blog

We announce that in order to have full control on our content, we have created our own blog which is available at this link: https://blog.hivepower.tech This means that we won’t use Medium anymore…

So What Is Design Operations?

Working in the media, and especially the creative industry, new job titles are made up almost every week. It is getting harder and harder to describe what you do at your job as a Designer because the…