My first side quest in Gutenberg

According to the logs, my first commit to Gutenberg/WordPress added the “convert to blocks” option to the HTML block. It was July 2018, months before the block editor became the default experience in WordPress 5.0 — and I still went by my old nickname.

Though my actual first memory of a contribution was me writing tutorials for the block editor with Marcus. In doing so, I grew frustrated by how poor the API docs were at the time. Most people don’t remember it now, but, more often than not, they were out of sync with the code — rendering them unusable. That was my first side quest in Gutenberg: I wanted to autogenerate the JavaScript API docs, so they were always up to date.

It took me a few days to have a working prototype, and 6 weeks to make it production-ready, convince people it was worth doing it, and get the approvals to merge it.

The tool’s job was very simple: given a entry point, extract the ES6 exports and generate a markdown file with the documentation.

npx docgen <entry-point>

Over that simple idea, in Gutenberg, we added some scripts that took docgen’s output and embedded it into the existing README files of existing packages — which are part of our official docs everywhere (block editor handbook, npm, GitHub).

Since the initial release, docgen sit there, unattended, doing its job silently. It got two major updates that I’m aware of: changing the parsing library to support newer syntax, and updating some edge cases for TypeScript a few years later. It’s the kind of little thing that fixed 90% of the use cases we had, not of all of them, and then it vanished from everyone’s view.

After that, I focused back on the things we actually wanted to ship: the main quest.


Comments

One response to “My first side quest in Gutenberg”

  1. This was a really cool side quest. Thanks for all the work over the years.

Leave a Reply

Your email address will not be published. Required fields are marked *