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

fix(gatsby): add onPluginInit to docs #33070

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 15 additions & 2 deletions packages/gatsby/src/utils/api-node-docs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ export const onCreateNode = true
* then Gatsby will not schedule the `onCreateNode` callback for this node for this plugin.
* Note: this API does not receive the regular `api` that other callbacks get as first arg.
*
* @gatsbyVersion 2.24.80
* @gatsbyVersion 2.24.8
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this intentional?

* @example
* exports.unstable_shouldOnCreateNode = ({node}, pluginOptions) => node.internal.type === 'Image'
*/
Expand Down Expand Up @@ -422,7 +422,20 @@ export const onPreInit = true
* @gatsbyVersion 3.9.0
*/
// eslint-disable-next-line @typescript-eslint/naming-convention
export const unstable_onPluginInit = true
export const unstable_onPluginInit = _CFLAGS_.GATSBY_MAJOR !== `4`

/**
* Lifecycle executed in each process (one time per process). Used to store actions etc for later use.
*
* @example
* let createJobV2
* exports.onPluginInit = ({ actions }) => {
* // store job creation action to use it later
* createJobV2 = actions.createJobV2
* }
* @gatsbyVersion 4.0.0
*/
export const onPluginInit = _CFLAGS_.GATSBY_MAJOR === `4`

/**
* Called once Gatsby has initialized itself and is ready to bootstrap your site.
Expand Down