Gatsby: Add tutorial page for creating a generic plugin

Created on 10 Jan 2020  路  9Comments  路  Source: gatsbyjs/gatsby

Summary

I was starting myself to create a plugin and trying to find a tutorial on this and couldn't even find it on our own page. (Algolia search did not help).

We do have https://www.gatsbyjs.org/docs/creating-plugins/ which is very helpful and sufficient for me to get started. Yet it would be nice to have an actual tutorial on how to create a new Gatsby plugin.

Having a plugin tutorial in the actual tutorial tab also helps with discoverability of this topic.

Motivation

Improve discoverability of how to create a plugin

documentation

All 9 comments

So do you need someone to create a simple plugin and document that process?

This was in response to an internal discussion on how the tutorial page on our website currently has no tutorial for making a generic plugin. And once you're stuck on the tutorial tab it's rather difficult to find the page, if you assume docs won't have the "tutorial" you're looking for.

I'm actually not sure what the best way is while preventing duplication. @laurieontech, thoughts on this?

The idea is indeed to create a simple plugin and document the process! However, I think @Ekwuno has started on this? If you have Obinna, can you assign this to yourself? If not, let @srs231198 know so he can work on it :)

Some things to add:

  • Some clarity on what you'd consider a good use case for a generic plugin would help. How does this differ from a source plugin? Why would someone want to create a generic plugin?
  • There are issues for source plugin learning materials already underway: https://github.com/gatsbyjs/gatsby/issues/8697 and https://github.com/gatsbyjs/gatsby/issues/16095
  • We previously didn't publish plugin authoring in the tutorials section to provide a distinction between "building with" and "building for", as these are often different audiences. But I can also see that the Building a Theme tutorial blurs those boundaries a bit, so I wouldn't hold up additional tutorials from being added if that feels like the most appropriate format and place for it.
  • Refer to docs templates for format suggestions, i.e. what is a reference guide vs. a tutorial. We should be intentional about format as we fill in coverage of various topics: what is needed most? https://www.gatsbyjs.org/contributing/docs-templates/

The main thing I tried to surface was discoverability. If you end up on the tutorial tab before the docs tab then you're not likely to find what you want if you're looking to create a plugin. A "source plugin" is terminology that may not mean anything to somebody.

As for my case, I wasn't looking to create a plugin for sourcing (which I'd assume to have different API's, why else make the distinction at all) but for gathering stats by hooking into the build life cycle.

Search for "create plugin" on the tutorial page and you'll not find the page that is present in the docs section. Would have helped me at the time if it somehow popped up. I'm not sure what needs to be done to make that happen, if nothing else.

Hiya!

This issue has gone quiet. Spooky quiet. 馃懟

We get a lot of issues, so we currently close issues after 30 days of inactivity. It鈥檚 been at least 20 days since the last update here.
If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not stale" to keep this issue open!
As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing!

Thanks for being a part of the Gatsby community! 馃挭馃挏

I'm so glad you surfaced this, @pvdz. I do think a new guide or tutorial on Creating a Generic Plugin would be useful, and your suggestion of hooking into lifecycle events seems like good material. But if you have other generic plugin ideas鈥揺specially super simple ones鈥搇et us know! @Ekwuno, let's discuss the format as either a guide or tutorial would work.

@marcysutton I had a call with @Ekwuno about this last week. I have no strong preference about the followup. And between when I reported it and now, I think something has changed / improved that partially-if-not-completely resolves my initial issue. I trust he'll do what's best here and this issue can be closed after that as far as I'm concerned.

I created the first draft of PR #21961 to close this issue. I still need to add more context as reviewed by Laurie. We should get this wrapped up soon. Thanks for the input @pvdz 馃槃.

Was this page helpful?
0 / 5 - 0 ratings