• Sabbatical, a Gift

    I’m sitting here writing this post, with a few days left in my 3 month Sabbatical. One of the great perks of working for Automattic is that every 5 years I have the opportunity to take a 2-3 month fully paid time away from my regular work with no expectations beyond disconnecting from work. It is a blessed, and very kind, gift. I’m fully aware that I’m already fortunate to live and work in a job that pays well for the needs of me and my family – affording some “wants” too – and live in a part of the… Keep reading

  • One of the things I wanted to do during my sabbatical (more on that later this week) was to create (from scratch) a new block theme for my site. I haven’t done this in a long time and thought it’d be a good way to get familiar with the state of block themes as a whole. In my role at WooCommerce I’ve been working deep in different parts of the block and site editors but haven’t spent as much time building things, for fun. Today, I launched the theme on my site. It’s not packaged for public distribution – if there’s interest I might – as I consider my design skills “highly niche” so might just stay bespoke for a while. I’ll do a full write up on the experience at some point.

    A New Theme

  • WordPress Data Store Properties: Resolvers

    Before we took our side detour into learning about the controls property, I mentioned that since we now have a selector for getting products, it’d be good to implement a way to retrieve the products from the server. This is where resolvers come in. Let’s get started by creating a resolver for retrieving products. If…

    Keep Reading

  • WordPress Data Store Properties: Reducer

    In the exploration through wp.data, we’ve already created the necessary properties needed to register the custom products store for our example app. This includes, action creators, selectors, controls, and resolvers. Now it’s time to get to the last property we need for registering our store, and that’s the reducer. The reducer is arguably the most…

    Keep Reading

  • WordPress Data: Putting it all together and registering your store!

    To recap: so far in the series we’ve looked at the various properties of the configuration object for a store: selectors: which interface with the store for retrieving data from its state. actions: (actually action creators) which are used to dispatch action objects for handling by the reducer. reducer: which receives dispatched actions and determines…

    Keep Reading

  • WordPress Data: Interfacing With the Store

    Now that we have our new custom data store registered, we need to start integrating it with our example app. There are numerous ways in which you can interface with the data store in your components but I’m going to cover the four most common, straightforward ways. withSelect( mapToProps )( Component) withSelect is a higher…

    Keep Reading

  • WordPress Data Store Properties: Controls

    Often with any sort of state in a given application, there can be times in an application’s lifecycle where you want to be able to execute some sort of logic as a part of the flow in setting state or updating state. A good example of this is asynchronous data flows between the client and…

    Keep Reading

  • WordPress Data Store Properties: Selectors

    The job of selectors is to provide an interface to access state from the registered data store. With wp.data this is the primary way that your store state is exposed and allows you to encapsulate logic surrounding exposing that data. For instance, let’s say you just want to store all products in the store state…

    Keep Reading

  • WordPress Data Series Overview and Introduction

    For the past couple of years, my involvement with the Gutenberg project in WordPress has frequently taken me into the innards of @wordpress/data.  I’ve had to use it for projects integrating with the new WordPress Block Editor (Gutenberg), new interfaces and user experiences utilizing the new WordPress JavaScript packages, and I’ve also been directly involved…

    Keep Reading

  • Into the next decade…

    It’s been a while since I’ve written one of these year end, year beginning posts, but this is a significant year as the 2010’s draw to a close and the 2020’s have begun. So I figured it be a good exercise to reflect and predict. Let’s start with reflect: Reflect I’m going to group things…

    Keep Reading

  • Fantastic hooks and where to use them.

    An introduction to the useDispatch and useSelect hooks exposed via the wp.data api of the new WordPress editor.

    Keep Reading

  • Testing Javascript for your Gutenberg Integrated Plugin

    (Edit October 10, 2018) Note: This article is now out of date but is kept published for reference purposes. Nearly everything in Gutenberg is published as a package so for the purpose of testing you can include those packages as a devDependency in your package.json file and jest will know to reference those in tests.  As a…

    Keep Reading