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-mdx): support import shorthand syntax #26198
Conversation
Gatsby Cloud Build Reportclient-only-paths 🎉 Your build was successful! See the Deploy preview here. Build Details🕐 Build time: 1m PerformanceLighthouse report
|
The "shorthand" syntax is an import that only imports a path, without declaring any symbols: ```js import "./foo.css" ``` This happened in the real world so we have to support it. This fixes #25734
Gatsby Cloud Build Reportusing-styled-components 🎉 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: 1m PerformanceLighthouse report
|
c35b7c7
to
10da200
Compare
Gatsby Cloud Build Reportgatsby-master 🎉 Your build was successful! See the Deploy preview here. Build Details🕐 Build time: 1m PerformanceLighthouse report
|
Gatsby Cloud Build Reportgatsby 🎉 Your build was successful! See the Deploy preview here. Build Details🕐 Build time: 24m |
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.
This looks fine and glad we got this edge case. But I’m wondering if we should look at the parsing for imports in mdx directly? It’d be great if they were the same. I can look at the 2.0 stuff this morning to see if it’s worth lifting.
@laurieontech mdx itself should/could definitely handle this better. For the time being, our plugin does it. Before it would off-load that to Babel but since we don't do that anymore, we need to be specific ourselves. I missed (or well, didn't expect) this particular case of the import. Hopefully that's the last of them. If this approach can be brought into |
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.
Let's get this in. Can make changes later if necessary but want to fix.
Published in gatsby-plugin-mdx@1.2.32 |
The "shorthand" syntax is an import that only imports a path, without declaring any symbols:
This happened in the real world so we have to support it.
This fixes #25734