-
Notifications
You must be signed in to change notification settings - Fork 10.3k
docs: Update browser and ssr api docs to include pluginOptions parameter #12547
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
Conversation
| @@ -1,5 +1,6 @@ | |||
| /** | |||
| * Called when the Gatsby browser runtime first starts. | |||
| * @param {Object} pluginOptions | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is weird, but pluginOptions I think will be second paramater, and first one will actually be undefined. And this is the same for all APis that doesn't really pass any args (so to onInitialClientRender, registerServiceWorker, disableCorePrefetching, replaceHydrateFunction as well)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed a little weird, but correct. I pulled down your update and added
@param undefined _
for the first parameter on those you listed (not sure that is the best way to display that though), and including the @param {Object} pluginOptions after. I then tried gatsby develop just to be sure everything was good, and I'm getting the error:
GraphQL Error Fragment "DocumentationParamsFieldsFragment" cannot be spread here as objects of type "params_2" can never be of type "DocumentationJs".
file: /Users/sbardian/stuff/dev/javascript/PRs/gatsby/www/src/components/api-reference/params.js
35 | static {
36 | ...DocumentationParamBase
37 | }
38 | }
39 | }
40 | }
41 | }
42 | fragment DocumentationParamsFragmentR1 on DocumentationJs {
43 | ...DocumentationParamsFieldsFragment
44 | params {
> 45 | ...DocumentationParamsFieldsFragment
| ^
46 | }
47 | properties {
48 | ...DocumentationParamsFieldsFragment
49 | }
50 | members {
51 | static {
52 | ...DocumentationParamsFieldsFragment
53 | }
54 | }
55 | type {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems to be something upstream. Pushed and will rebase after it's fixed.
|
@pieh bump to avoid stale bot. Let me know if you would like updates/etc. No rush. |
|
Hey @sbardian! Sorry for getting quiet on this one. I went ahead and apply few changes:
|
|
I also unified |
|
@pieh not a problem. Looks nice and clean to me! Let me know if you would like me to jump in on anything, but looking good 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 LGTM


Description
Was using
wrapRootElementapi and had need ofpluginOptionsin mygatsby-plugin-breadcrumbplugin. Documentation didn't showpluginOptionsas a parameter, but reviewing the code it seems allBrowserandSSRapi's do getpluginOptionssent as a parameter, from what I can see. I was able to use them successfully withwrapRootElementso thought adding it to the docs would be helpful.Related Issues
N/A