Is [partial] sequential plugin execution possible? #27433
Replies: 2 comments
-
Hi @atomicpages
If you are referring to Then map series is actually not serial - it's sequential But, it depends on API you would to use - with Can you talk more about what specifically you are trying to do with your plugin? Maybe we can figure out a way to make it work. Need of access to |
Beta Was this translation helpful? Give feedback.
-
@pieh thanks for the reply! I was really probing to see if there was an option to synchronously execute (some or all) plugins.
Edit: I'm trying to build a plugin that uses react-docgen-typescript instead of react-docgen. There are two issues:
Most of the code from gatsby/packages/gatsby-transformer-react-docgen/src/on-node-create.js Lines 110 to 114 in 7688f59 I tried something similar with try {
const ast = parseMetadata(node.absolutePath);
} catch (e) {
reporter.error(/* ... */);
} |
Beta Was this translation helpful? Give feedback.
-
Summary
How can you wait for
createNode
from one plugin to complete before starting the execution of another plugin?Relevant information
In my case, I want to wait for
gatsby-source-filesystem
to complete before starting so I have the full list of sourced files that I can delegate to another plugin for post-processing. I found a few leads in the docs likegetNodesByType
orgetNodes
but the issue is the map series which allows for parallel execution of all the plugins.onCreateNode
?Note: I'm guessing no since schemas are generated after this lifecycle hook
Unfortunately the plugin needs access to the list of files and ideally I'd like to source them from
gatsby-source-filesystem
to avoid adding something likeglobby
Other wild ideas included:
Seeing is there's an event emitted I can wait for
Using something like
globby
and let the user of the plugin specify where to read files from:File contents
gatsby-config.js
:my-plugin/gatsby-node.js
:package.json
: N/Agatsby-node.js
: N/Agatsby-browser.js
: N/Agatsby-ssr.js
: N/ABeta Was this translation helpful? Give feedback.
All reactions