Explicit plugin API with defined dependencies #32295
Unanswered
aaronadamsCA
asked this question in
Ideas / Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Plugin load order is currently determined entirely by array order in
gatsby-config.js
. If one plugin depends on another plugin, it's the user's responsibility to get the order correct.This doesn't feel very robust. It seems the user should have better options for defining load order, and plugins should additionally have some control of this themselves.
What I'd prefer to see is something along these lines:
package.json
, Gatsby automatically imports the plugin; it's no longer necessary to add it togatsby-config.js
.package.json
, Gatsby automatically imports those, too.This could potentially harden configurations, and allow larger projects to become much more modular.
Obviously this would need to be part of a whole new plugin API, but my hope is that we'll eventually get modern APIs that drop the need to depend exclusively on "magic exports"/shadowing (#15277 (comment)), and this could be a part of that.
Beta Was this translation helpful? Give feedback.
All reactions