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): place auto-generated virtual modules in .cache #26396

Merged
merged 2 commits into from
Aug 12, 2020

Conversation

pieh
Copy link
Contributor

@pieh pieh commented Aug 12, 2020

Description

There are some plugins that traditionally were excluding .cache directory from being checked (for example default configuration for gatsby-plugin-eslint). With the move to virtual modules, our autogenerated modules ( (a)sync-requires.js) where no longer "placed" in .cache resulting in quite a lot of problems for gatsby-plugin-eslint users. This PR moves autogenerated modules to back to .cache (virtually at least), so any custom webpack loaders that were using .cache in their configuration work as they did before introducing virtual modules.

Related Issues

Fixes #26393
Fixes #26319

@pieh pieh requested a review from a team as a code owner August 12, 2020 09:16
@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Aug 12, 2020
@pieh pieh added topic: webpack/babel Webpack or babel and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Aug 12, 2020
@gatsby-cloud
Copy link

gatsby-cloud bot commented Aug 12, 2020

Gatsby Cloud Build Report

client-only-paths

🎉 Your build was successful! See the Deploy preview here.

Build Details

View the build logs here.

🕐 Build time: 19s

Performance

Lighthouse report

Metric Score
Performance 💚 100
Accessibility 🔶 85
Best Practices 💚 100
SEO 🔶 70

🔗 View full report

@gatsby-cloud
Copy link

gatsby-cloud bot commented Aug 12, 2020

Gatsby Cloud Build Report

using-styled-components

🎉 Your build was successful! See the Deploy preview here.

Build Details

View the build logs here.

🕐 Build time: 19s

Performance

Lighthouse report

Metric Score
Performance 💚 100
Accessibility 💚 90
Best Practices 💚 100
SEO 💚 90

🔗 View full report

@gatsby-cloud-staging
Copy link

gatsby-cloud-staging bot commented Aug 12, 2020

Gatsby Cloud Build Report

gatsby-master

🎉 Your build was successful! See the Deploy preview here.

Build Details

View the build logs here.

🕐 Build time: 1m

Performance

Lighthouse report

Metric Score
Performance 💚 98
Accessibility 🔶 87
Best Practices 💚 93
SEO 🔶 73

🔗 View full report

@gatsby-cloud-staging
Copy link

gatsby-cloud-staging bot commented Aug 12, 2020

Gatsby Cloud Build Report

gatsby

🎉 Your build was successful! See the Deploy preview here.

Build Details

View the build logs here.

🕐 Build time: 21m

Performance

Lighthouse report

Metric Score
Performance 💚 92
Accessibility 💚 100
Best Practices 💚 100
SEO 🔶 76

🔗 View full report

@gatsby-cloud
Copy link

gatsby-cloud bot commented Aug 12, 2020

Gatsby Cloud Build Report

gatsby

🎉 Your build was successful! See the Deploy preview here.

Build Details

View the build logs here.

🕐 Build time: 38m

pvdz
pvdz previously approved these changes Aug 12, 2020
Copy link
Contributor

@pvdz pvdz left a comment

Choose a reason for hiding this comment

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

sure :)

@wardpeet
Copy link
Contributor

We should update packages/gatsby/src/utils/__tests__/map-templates-to-static-query-hashes.js as well

@pieh
Copy link
Contributor Author

pieh commented Aug 12, 2020

Ah yes, thanks for noticing this.

Also

/* When we traverse upwards, we need to know where to stop. We'll call these terminal nodes.
* `async-requires.js` is the entry point for every page, while `api-runner-browser-plugins.js`
* is the one for `gatsby-browser` (where one would use wrapRootElement or wrapPageElement APIs)
*/
const entryNodes = [
`.cache/api-runner-browser-plugins.js`,
`.cache/async-requires.js`,
]
seems fishy after I looked a bit more into tests themselves

Copy link
Contributor

@sidharthachatterjee sidharthachatterjee left a comment

Choose a reason for hiding this comment

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

Looks good!

@sidharthachatterjee sidharthachatterjee added the bot: merge on green Gatsbot will merge these PRs automatically when all tests passes label Aug 12, 2020
@sidharthachatterjee sidharthachatterjee removed their assignment Aug 12, 2020
@gatsby-cloud
Copy link

gatsby-cloud bot commented Aug 12, 2020

Gatsby Cloud Build Report

using-reach-skip-nav

🎉 Your build was successful! See the Deploy preview here.

Build Details

View the build logs here.

🕐 Build time: 21s

Performance

Lighthouse report

Metric Score
Performance 💚 100
Accessibility 💚 100
Best Practices 💚 100
SEO 🔶 82

🔗 View full report

@gatsbybot gatsbybot merged commit 9590a2c into master Aug 12, 2020
@LekoArts LekoArts deleted the fix/virtual-modules/place-in-dot-cache branch November 9, 2020 08:28
pragmaticpat pushed a commit to pragmaticpat/gatsby that referenced this pull request Apr 28, 2022
…js#26396)

* fix(gatsby): place auto-generated virtual modules in `.cache`

* adjust async-requires paths in map-template-to-static-query-hashes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot: merge on green Gatsbot will merge these PRs automatically when all tests passes topic: webpack/babel Webpack or babel
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Virtual path with gatsby development ESLint warnings in file that doesn't exist
5 participants