Gatsby: General Question On Gatsby Plugins

Created on 14 Feb 2018  Â·  7Comments  Â·  Source: gatsbyjs/gatsby

Some plugins need a configuration string in gatsby-config.js and some like gatsby-image and gatsby-link while documented in the https://www.gatsbyjs.org/docs/plugins/ page is called a gatsby-component. Does it make sense to make this demarcation be made more formal by separation of documentation?

So we don't think why some plugins need an entry in gatsby-config and and some dont.

question or discussion

All 7 comments

They're called "Official components" there — perhaps it'd be more clear if we called them "Official React Components"? We're revamping the plugin library soon https://github.com/gatsbyjs/gatsby/pull/3906 and we'll make clear in results if something is a "plugin" (which needs added to gatsby-config.js) or a "React component" where you just import it like normal into a Gatsby site.

The gatsby-image component is awesome and could be used in any react app. Possibly such components could be spun off to a separate repo so it could be discoverable used in any react app independent of Gatsby. This will help Gatsby get discovered more, through these components and also improve the probability of the components to remain updated and remain generic react components.

Closing the issue as the remaining question left is more directional in nature for gatsby react components.

Would be happy to help if we need to move gatsby-image as a generic react component, as I already did some stuff using similar logic as in gatsby plugins to build some image resizing in lambda. https://github.com/Jaikant/lambda-image-sharp

gatsby-image isn't an overly complicated component. We'd prefer it to be tightly integrated with Gatsby rather than generic. If others want to copy it (or figure out how to use it in a generic way) that'd be great.

The advantage of gatsby-image is that it's tightly integrated with Gatsby's build system. As a standalone component, it's not as special.

@KyleAMathews I would have to disagree with you on that.

I wish the html img tag was as rich as gatsby-image. Yes there is nothing special, which is more the reason that such a component should be generically available so anyone can integrate into their apps.

The image processing part would have to be separated, just like the way it is done in gatsby, with the data layer handling the image processing.

But then again, that is my personal opinion.

There's nothing stopping anyone from using it :-) It's an npm install --save gatsby-image away

Was this page helpful?
0 / 5 - 0 ratings

Related issues

signalwerk picture signalwerk  Â·  3Comments

andykais picture andykais  Â·  3Comments

Oppenheimer1 picture Oppenheimer1  Â·  3Comments

totsteps picture totsteps  Â·  3Comments

kalinchernev picture kalinchernev  Â·  3Comments