Skip to content

MDX app bundle bloating and global scope problems #25069

Discussion options

You must be logged in to vote

Hi!

We merged #35650 which means that a new major version of gatsby-plugin-mdx will be released on August 16. You can already try it out by installing gatsby-plugin-mdx@next & gatsby@next.

The original issue is fixed 🎉

MDX currently shoehorns imports into the app bundle, and adds all imports to the global scope (causing imports to need to be namespaced to avoid clashing)

The new version splits bundles and thus supports all the niceties of tree-shaking and scoping. It uses the MDX webpack loader under the hood so it can split the components, scope etc. by MDX file.

Replies: 8 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@phil-lgr
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@phil-lgr
Comment options

Answer selected by LekoArts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: remark/mdx Related to Markdown, remark & MDX ecosystem status: completed RFCs, Discussions etc. that are implemented/completed
9 participants
Converted from issue

This discussion was converted from issue #25069 on November 26, 2020 11:18.