-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Conversation
This reverts commit 9e02abe.
Gatsby Cloud Build Reportusing-styled-components 🎉 Your build was successful! See the Deploy preview here. Build Details🕐 Build time: 21s PerformanceLighthouse report
|
Gatsby Cloud Build Reportclient-only-paths 🎉 Your build was successful! See the Deploy preview here. Build Details🕐 Build time: 21s PerformanceLighthouse report
|
Gatsby Cloud Build Reportgatsby-master 🎉 Your build was successful! See the Deploy preview here. Build Details🕐 Build time: 1m PerformanceLighthouse report
|
Gatsby Cloud Build Reportusing-reach-skip-nav 🎉 Your build was successful! See the Deploy preview here. Build Details🕐 Build time: 27s PerformanceLighthouse report
|
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.
🙏
Gatsby Cloud Build Reportgatsby 🎉 Your build was successful! See the Deploy preview here. Build Details🕐 Build time: 22m |
Published in [email protected] |
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 toJSON.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 likeexport const foo = randomExpression();
and drop the keyword toconst foo = randomExpression();
. This works because theexport
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.