johno
Projects

Gatsby Recipes

Setup instructions written in MDX that the Gatsby CLI could run.

An illustrated MDX recipe that installs the Gatsby Theme UI plugin.

I worked on Gatsby Recipes to make setup instructions executable. A recipe could explain why a site needed a plugin, install the package, and add it to the Gatsby config. The explanation and the work lived in the same MDX document.

For the first version we parsed the document into a list of instructions. That worked well for local changes like editing package.json. Then I tried modeling Contentful. A content type belongs to an environment, which belongs to a space. In a flat list I kept having to tell a child resource the names of its parent and grandparent. There were a lot of places to mistype the same name.

Kyle Mathews had suggested trying a custom React reconciler early on. Contentful gave me a concrete reason to revisit it. If the recipe nested a content type inside its environment, the interpreter could pass the environment down through context. The author had already expressed that relationship just by putting one component inside the other.