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-plugin-netlify-cms): Don't use StaticQueryMapper #30599

Merged
merged 1 commit into from
Apr 2, 2021

Conversation

ridem
Copy link
Contributor

@ridem ridem commented Mar 31, 2021

Description

This PR makes sure that the StaticQueryMapper plugin isn't used by the webpack instance of gatsby-plugin-netlify-cms.

The Netlify CMS plugin is spinning an extra webpack instance with almost every plugin from gatsby. Reusing the StaticQueryMapper plugin caused issues given how it's dealing with a Gatsby state.

This PR also:

  • Removes the cssTests variable which wasn't used anymore
  • Adds a clear TODO comment for how to get excludeAssets to be taken into account again. A webpack plugin had been removed to make this package compatible with webpack 5, but the functionality hasn't been put back. (Edit: this means that since gatsby-plugin-netlify-cms was made compatible with webpack 5, all of the CSS that is imported is included in its HTML SPA template. Maybe there's a bug report out there already, but that means there could be CSS from the website polluting the CSS of the admin page)

Related Issues

Fixes #29951

The Netlify CMS plugin is spinning an extra webpack instance with almost
every plugin from gatsby. Reusing the `StaticQueryMapper` plugin caused
issues given how it's dealing with a Gatsby state.

Fixes gatsbyjs#29951

This commit also:
- removes `cssTests` which wasn't used anymore
- adds a clear TODO for how to get `excludeAssets` to be taken into account again
@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Mar 31, 2021
@ridem ridem changed the title Netlify CMS plugin: Don't use StaticQueryMapper fix(gatsby-plugin-netlify-cms): Don't use StaticQueryMapper Mar 31, 2021
@phipag
Copy link

phipag commented Apr 1, 2021

I can confirm that this fixed the issue.

Copy link
Contributor

@wardpeet wardpeet left a comment

Choose a reason for hiding this comment

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

Thanks for fixing it! Looks great!

@wardpeet wardpeet merged commit 66d548e into gatsbyjs:master Apr 2, 2021
@ridem ridem deleted the fix/plugin-netlify-cms branch April 5, 2021 21:10
@LekoArts LekoArts removed the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Apr 6, 2021
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.

Error in function useStaticQuery in ./.cache/gatsby-browser-entry.js:77 (After upgrade to v3)
4 participants