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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(gatsby-plugin-mdx): allow plugins: [...] in options schema #27709

Merged
merged 2 commits into from Oct 30, 2020

Conversation

mxstbr
Copy link
Contributor

@mxstbr mxstbr commented Oct 29, 2020

Turns out, there is a use-case for specifying plugins: [...] in gatsby-plugin-mdx as explained in this comment as a workaround for gatsby-browser/node/... support in rehype/markPlugins: #15486 (comment)

This adds plugins to the plugin options schema for gatsby-plugin-mdx! 馃憤

@mxstbr mxstbr requested a review from a team as a code owner October 29, 2020 07:50
@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Oct 29, 2020
@wardpeet
Copy link
Contributor

Any tests cases you could add? This won't validate options for plugin-mdx sub plugins, right?

We probably want to "copy" the logic from gatsby in here...

@mxstbr
Copy link
Contributor Author

mxstbr commented Oct 29, 2020

This won't validate options for plugin-mdx sub plugins, right?

It will!

rehype/markPlugins won't be validated of course, because we do not look at their gatsby-configs at the moment (hence why you also need to add them to plugins: [], that's what the workaround is for), so there's nothing to validate. But if you add a plugin to plugins: [], it will be validated like any other subplugin 馃憤

@wardpeet
Copy link
Contributor

I was talking about gatsbyRemarkPlugins & rehype plugins.

@wardpeet
Copy link
Contributor

Can we add a dummy plugin to the test so we actually caught this code change?

@LekoArts LekoArts added topic: MDX and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Oct 30, 2020
@mxstbr
Copy link
Contributor Author

mxstbr commented Oct 30, 2020

I was talking about gatsbyRemarkPlugins & rehype plugins.

Now that I look at what I wrote yesterday, I have no idea how I thought that made any sense. Of course the options of those aren't validated. 馃う

Added plugins to the tests, good call!

@wardpeet wardpeet merged commit f8cf904 into master Oct 30, 2020
@wardpeet wardpeet deleted the mdx/options-schema-plugins branch October 30, 2020 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants