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

chore(gatsby-plugin-mdx): Revert "perf(gatsby-plugin-mdx): performance changes" #26202

Merged
merged 1 commit into from
Aug 3, 2020

Conversation

pvdz
Copy link
Contributor

@pvdz pvdz commented Aug 3, 2020

Reverts #26004

Fixes #25734

Before the exports would be gathered through our custom babel plugin babel-plugin-gather-exports. It would visit all named exports, attempt to JSON.parse their init, and if that worked record it. It would ignore cases where this doesn't works. These cases are then returned as an object.

Next step comes babel-plugin-remove-export-keywords, which would take these named exports like export const foo = randomExpression(); and drop the keyword to const foo = randomExpression();. This works because the export keyword doesn't really change anything for the declaration. Only meta stuff. So the module itself works the same either way.

Since we bypass the babel step the exports are no longer JSON.parse()ed and so the frontmatter object is not found.

At this point there are too many pointy edges in this part that I'm going to concede and leave it as is. Stripping the babel step is worth it but it needs a lot more tests and some thorough rewrites in mdx itself before we test this again. Luckily v2 is on the horizon.

@pvdz pvdz requested a review from a team as a code owner August 3, 2020 18:04
@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Aug 3, 2020
@pvdz pvdz added topic: MDX topic: performance Related to runtime & build performance type: bug An issue or pull request relating to a bug in Gatsby and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Aug 3, 2020
@gatsby-cloud
Copy link

gatsby-cloud bot commented Aug 3, 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: 21s

Performance

Lighthouse report

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

🔗 View full report

@gatsby-cloud
Copy link

gatsby-cloud bot commented Aug 3, 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: 21s

Performance

Lighthouse report

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

🔗 View full report

@gatsby-cloud-staging
Copy link

gatsby-cloud-staging bot commented Aug 3, 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 💚 96
Accessibility 🔶 87
Best Practices 💚 93
SEO 🔶 73

🔗 View full report

@gatsby-cloud
Copy link

gatsby-cloud bot commented Aug 3, 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: 27s

Performance

Lighthouse report

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

🔗 View full report

Copy link
Contributor

@johno johno left a comment

Choose a reason for hiding this comment

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

🙏

@pvdz pvdz added the bot: merge on green Gatsbot will merge these PRs automatically when all tests passes label Aug 3, 2020
@gatsby-cloud
Copy link

gatsby-cloud bot commented Aug 3, 2020

Gatsby Cloud Build Report

gatsby

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

Build Details

View the build logs here.

🕐 Build time: 22m

@gatsbybot gatsbybot merged commit 7e431fd into master Aug 3, 2020
@delete-merged-branch delete-merged-branch bot deleted the revert-26004-fix-createmdxnode branch August 3, 2020 18:44
@pvdz
Copy link
Contributor Author

pvdz commented Aug 3, 2020

Published in gatsby-plugin-mdx@1.2.33

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: performance Related to runtime & build performance type: bug An issue or pull request relating to a bug in Gatsby
Projects
None yet
Development

Successfully merging this pull request may close these issues.

error "gatsby-plugin-mdx" threw an error while running the onCreateNode lifecycle:
3 participants