/
3-onplugininit.patch
69 lines (66 loc) · 3.07 KB
/
3-onplugininit.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
diff --git a/packages/gatsby/index.d.ts b/packages/gatsby/index.d.ts
index 4ed2e22114..df803ef8b4 100644
--- a/packages/gatsby/index.d.ts
+++ b/packages/gatsby/index.d.ts
@@ -350,7 +350,7 @@ export interface GatsbyNode<
callback: PluginCallback<void>
): void | Promise<void>
- /** Called at the end of the bootstrap process after all other extension APIs have been called. If you indend to use this API in a plugin, use "unstable_onPluginInit" instead. */
+ /** Called at the end of the bootstrap process after all other extension APIs have been called. If you indend to use this API in a plugin, use "onPluginInit" instead. */
onPreBootstrap?(
args: ParentSpanPluginArgs,
options: PluginOptions,
@@ -376,18 +376,18 @@ export interface GatsbyNode<
* @gatsbyVersion 3.9.0
* @example
* let createJobV2
- * exports.unstable_onPluginInit = ({ actions }) => {
+ * exports.onPluginInit = ({ actions }) => {
* // Store job creation action to use it later
* createJobV2 = actions.createJobV2
* }
*/
- unstable_onPluginInit?(
+ onPluginInit?(
args: ParentSpanPluginArgs,
options: PluginOptions,
callback: PluginCallback<void>
): void | Promise<void>
- /** The first API called during Gatsby execution, runs as soon as plugins are loaded, before cache initialization and bootstrap preparation. If you indend to use this API in a plugin, use "unstable_onPluginInit" instead. */
+ /** The first API called during Gatsby execution, runs as soon as plugins are loaded, before cache initialization and bootstrap preparation. If you indend to use this API in a plugin, use "onPluginInit" instead. */
onPreInit?(
args: ParentSpanPluginArgs,
options: PluginOptions,
diff --git a/packages/gatsby/scripts/__tests__/api.js b/packages/gatsby/scripts/__tests__/api.js
index c0b7735a76..593059e8ce 100644
--- a/packages/gatsby/scripts/__tests__/api.js
+++ b/packages/gatsby/scripts/__tests__/api.js
@@ -57,7 +57,7 @@ it("generates the expected api output", done => {
"resolvableExtensions": Object {},
"setFieldsOnGraphQLNodeType": Object {},
"sourceNodes": Object {},
- "unstable_onPluginInit": Object {
+ "onPluginInit": Object {
"version": "3.9.0",
},
"unstable_shouldOnCreateNode": Object {
diff --git a/packages/gatsby/src/utils/api-node-docs.ts b/packages/gatsby/src/utils/api-node-docs.ts
index 793386f614..06b2259350 100644
--- a/packages/gatsby/src/utils/api-node-docs.ts
+++ b/packages/gatsby/src/utils/api-node-docs.ts
@@ -415,14 +415,13 @@ export const onPreInit = true
*
* @example
* let createJobV2
- * exports.unstable_onPluginInit = ({ actions }) => {
+ * exports.onPluginInit = ({ actions }) => {
* // store job creation action to use it later
* createJobV2 = actions.createJobV2
* }
* @gatsbyVersion 3.9.0
*/
-// eslint-disable-next-line @typescript-eslint/naming-convention
-export const unstable_onPluginInit = true
+export const onPluginInit = true
/**
* Called once Gatsby has initialized itself and is ready to bootstrap your site.