Migrate to Netlify Today

Netlify announces the next evolution of Gatsby Cloud. Learn more

ContactSign Up

Improvements to Plugin Authoring Experience

Shannon Soper
April 25th, 2019

We recently interviewed authors of popular Gatsby plugins; here's what we learned and how we're changing to support plugin authors!

Stats on interviewees

We interviewed 6 authors of and/or contributors to popular plugins:

Thanks to all for taking the time to give thoughtful interviews!

Are you a plugin author/maintainer? If you have additional feedback that is not covered by this article, please let us know here If you're thinking of creating a plugin, sign up for a CLI usability test. You'll get to try out some new things in the CLI!

Why do people decide to create a plugin?

We asked people what motivated them to create and maintain a plugin so we can make sure to support them in their goals. Most plugin authors we interviewed said something like: “I created the plugin to solve a problem I had that other plugins couldn’t solve". Typically, other plugins couldn't solve the problem because they weren’t v2 compatible, weren’t being maintained, or didn’t exist.

For example, Tyler Barnes is working on alternative WordPress source plugin, with a functionality closer to how Netlify CMS works as opposed to pulling from the WP REST API every time.

Why? Pulling all data and images every time he started gatsby develop was annoying — some of the sites were big and it could take 2 minutes to download. Local images would get dumped so he’d wait 10 minutes for the images to get processed again. Some cheaper servers were limited and would crash when trying to handle large numbers of images. He said he “wanted to make WP and Gatsby work on a crappy server.”

What did he do to solve his problem? He commits the data instead so it’s available on the local machine instead. He was using gatsby-source-wordpress and adding extra stuff to it (permalink support, etc.) and then turned that functionality into a plugin. He basically added the features necessary to make it work like Netlify CMS and didn’t need to use the source plugin anymore.

Creating a plugin isn't the only kind of contribution that helps others; @pieh's story of how he started to contribute to Gatsby involves editing a plugin:“gatsby-source-wordpress didn’t handle gallery type fields which I needed for some freelance work. It was my first PR to work on that plugin”.

Other reasons people build plugins include having fun! According to Orestis, “Learning is fun! Actually having people open pull request against my plugins is also fun”.

How can we better support plugin authors?

ANSWER: make time-consuming things take less time, and make frustrating things less frustrating 🙂

Make time-consuming things take less time

People who use plugin authoring docs say they are super helpful; however, most people don’t know about them and solve challenges through looking at the source code of other plugins. While this works for many people, we think making this even easier is a positive change.

Solution

Make frustrating things less frustrating

It's frustrating that many plugins are outdated or not maintained.

Examples of things that are confusing:

  • Yarn link has weird inconsistencies
  • People run into issues around processing a lot of nodes in a for loop
  • There's some misunderstanding around how async/await works — one person said they were awaiting everything instead of creating an array of Promises and using Promise.all()
  • Most people don’t know how to write automated tests for plugins and mentioned building a site just to test the plugin, which they felt wasn't the most ideal way to test
  • Rebuilding for every change often “feels wrong” to people

Solution

Redesigned the plugin docs to include a category called "Creating Plugins" where we can document answers to people's concerns; for example, ideas for how to test plugins and advice to use yarn workspaces to avoid yarn link inconsistencies.

What we need help with

It'd be great to get help with any of the following:

Read these ideas and create issues and/or PRs for ones that prove valuable!

  • Add a “processAllNodes()” helper that automatically sets up the Promise.all() so people don’t need to know how this works
  • Plugin library default filter set to v2 compatible. Script to grab file, looks for exported APIs that aren’t compatible
  • Create end-to-end tests for plugins (more needed for internal/core plugins where we want to test the output)
  • Create #plugin-authoring Discord channel and publicize the #contributing channel more
Share on TwitterShare on LinkedInShare on FacebookShare via Email

Talk to our team of Gatsby Experts to supercharge your website performance.

Contact Gatsby Now
© 2023 Gatsby, Inc.