Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create RFC for extending Gatsby's WordPress plugin #5796

Closed
m-allanson opened this issue Jun 8, 2018 · 5 comments
Closed

Create RFC for extending Gatsby's WordPress plugin #5796

m-allanson opened this issue Jun 8, 2018 · 5 comments
Labels
help wanted Issue with a clear description that the community can help with. stale? Issue that may be closed soon due to the original author not responding any more.

Comments

@m-allanson
Copy link
Contributor

Summary

Create an RFC to spec out extension points to gatsby-source-wordpress.

Add extension points to gatsby-source-wordpress to allow it to work with additional gatsby plugins. This would enable usage with a variety of WordPress setups (e.g. WooCommerce, Gravity Forms) without having to directly support everything within gatsby-source-wordpress.

Basic example

See discussion at #5599 (comment)

A config might look like:

// In your gatsby-config.js
module.exports = {
  plugins: [
    {
      resolve: `gatsby-source-wordpress`,
      options: {
        plugins: [
          {
            resolve: `gatsby-wordpress-woocommerce`,
            options: {
              // options here
            },
          },
          {
            resolve: "gatsby-wordpress-gravity-forms",
            options: {
              // more options
            },
          },
        ],
      },
    },
  ],
}

Motivation

WordPress can be used in many different ways. Supporting every available WordPress plugin within gatsby-source-wordpress is likely to become unwieldy quite quickly. Adding plugin support to the gatsby-source-wordpress would allow the Gatsby community to evolve with the WordPress community.

@m-allanson m-allanson added help wanted Issue with a clear description that the community can help with. 🏷 type: feature labels Jun 8, 2018
@kennethormandy
Copy link
Contributor

kennethormandy commented Jun 8, 2018

This sounds great, and I’d be happy to contribute to the RFC, and port what I have for Gravity Forms to this structure as one test case.

A couple of questions (perhaps best saved for the RFC):

  • Would this mean moving the existing plugins supported out of gatsby-source-wordpress? Right now I think we should keep ACF support in gatsby-source-wordpress, but I can also see the case for moving all WordPress plugin…plugins out of it.
  • Should the plugins be responsible for re-formatting data for Gatsby when needed? Often, the WP REST API returns nothing or false when you need it to return null for GraphQL. This also happens within the WP REST API implementations of each individual WordPress plugin. It can be solved with another WordPress plugin, but then you’d need a the original WP plugin, the companion WordPress plugin, and the companion Gatsby plugin to be able to support any WP plugins. Alternatively, the Gatsby plugin can it. I believe there is a proposal (from @pieh?) about mitigating this at a higher level for other Gatsby source plugins too, not sure if that would extend to this.

I’ve started on a draft RFC here.

@Amanej
Copy link

Amanej commented Jun 13, 2018

I would also be happy to contribute. Documenting the pattern behind the wordpress source plugins, would be helpful to anyone who wants to extend it to other data types created by popular wordpress plugins.

@Amanej
Copy link

Amanej commented Jul 4, 2018

Started here, would appreciate help from anyone with Gatsbyjs.

https://github.com/Amanej/gatsby-source-woocommerce-plugin

@gatsbot
Copy link

gatsbot bot commented Dec 13, 2018

Old issues will be closed after 30 days of inactivity. This issue has been quiet for 20 days and is being marked as stale. Reply here or add the label "not stale" to keep this issue open!

@gatsbot gatsbot bot added the stale? Issue that may be closed soon due to the original author not responding any more. label Dec 13, 2018
@gatsbot
Copy link

gatsbot bot commented Dec 24, 2018

This issue is being closed due to inactivity. Is this a mistake? Please re-open this issue or create a new issue.

@gatsbot gatsbot bot closed this as completed Dec 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Issue with a clear description that the community can help with. stale? Issue that may be closed soon due to the original author not responding any more.
Projects
None yet
Development

No branches or pull requests

3 participants