-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
MDX v2: ☂️ Umbrella issue #1041
Comments
This is so exciting to see! When the time is right, I’d be happy to help test this with our design system: https://seeds.sproutsocial.com |
Thanks @johno ! Excited for this to progress. I guess the first thing we can do for the Vue package is to work on the documentation so we can get some people to use it and gather some feedback. Then when it's stable we can see how to normalize the MDX rendering props and attrs for Vue in mdx v2. |
For sure @codebender828! Are you interested in owning that (#851)? |
@johno |
Is it possible to solve vscode's IntelliSense problem? mdx-js/mdx-analyzer#56 |
@johno worst question ever, but any updated ETA on this? we've added a bit of scope to Storybook 6 and are looking at RC late june and final release late july. would be amazing to make MDX2 part of that. and--since it's a breaking change--pretty bad if we can't, since we try to limit our major release cycle to once per year (tho we're not religious about that) |
Hey @shilman, we're hoping for an RC in the by June, and if all goes well a mid July release. Generally speaking, the breaking changes should be pretty light because they're generally internals aside from the new parsing changes (which we will also offer a codemod that should address most problems that might arise). Hopefully this corresponds nicely with you folks? I'm pretty busy this week with other things, but plan on picking MDX v2 back up full time starting next week. |
This updates MDX to use and support remark@13, which comes with a new internal parser (micromark), and supports CommonMark. See <https://github.com/remarkjs/remark/releases/tag/13.0.0> for more information. In short, this means MDX parses markdown closer to what folks expect. And it means all latest plugins work (again). But it also means that parsing MDX syntax (JSX, expressions, ESM) got an update. See: <https://github.com/micromark/micromark-extension-mdxjs> and <https://github.com/syntax-tree/mdast-util-mdx> for the syntax. In short, this means MDX parsing is now JavaScript-aware: import/exports are actually parsed for being valid JavaScript. Expressions previously counted braces, but now can include braces in strings or comments or whatnot. This also means we can drop Babel (in a future PR) because we already have a JavaScript AST. This also deprecates the packages `remark-mdxjs` (which is now the default in `remark-mdx`), `remark-mdx-remove-exports`, and `remark-mdx-remove-imports`. Related to GH-704. Related to GH-1041. Closes GH-720. Closes GH-1028. Closes GH-1050. Closes GH-1081. Closes GH-1193. Closes GH-1238. Closes GH-1283. Closes GH-1316. Closes GH-1318. Closes GH-1341.
I think I've spotted an edge-case issue with mixed html / md (@mdx-js/[email protected]). See for example this: <abbr title="Foo Bar">FB</abbr>, I like [links](https://domain.org)
will render as: <p>
<abbr title="Foo Bar">FB</abbr>, I like [links](https://domain.org)
</p> instead of <p>
<abbr title="Foo Bar">FB</abbr>, I like <a href="https://domain.org">links</a>
</p> The workaround I've found is to add a zero-width space at the beginning of the line, like so: ​<abbr title="Foo Bar">FB</abbr>, I like [links](https://domain.org)
|
Is there any way to "simply" test it with my Gatsby websites? I'd love to give it a try and report back bugs :) |
A new version was released. Progress. LOVELY!!! |
@wooorm Hey! You just released the RC-1. That is awesome! Can I support you? Is there a way to try it out with Gatsby? :) Thank you so much!!! |
Hey! Thanks for the kind words. You can indeed support MDX and the underlying projects (and me). To help out financially, see Sponsor on the site. A big part of helping is also just helping out in repos, as in, contributing. See Contribute on the website. Unfortunately Gatsby integrates heavily with the internals of MDX. That allows Gatsby to do some cool things, and has allowed them to apply other improvements specific to Gatsby, but it means you can’t just switch to the RC of V2 in Gatsby. It is possible. But hard. @thecodingwizard made it work in I am assuming that Gatsby will work on adding support for Version 2 themselves though! :) |
@wooorm Alright, thank you. I contribute to Gatsby itself, so I'll see if I can help over there. |
I'll consider financial support as soon the rebranding of my tiny agency is done :) |
Can we have an estimate of the v2 release date? |
Hey all! V2 was finally released, thanks for everyone who contributed, and for everyone who waited! ✨ More on v2 in the release and on the site: https://github.com/mdx-js/mdx/releases/tag/2.0.0. |
That is amazing! 🎉 🎉 🎉 I have just created an issue in Prettier to discuss MDX 2 support: prettier/prettier#12209 Feel free to contribute with your thoughts 🙌 (or code 🙏 ) |
👋 Hey folks, the time has come to begin putting together MDX v2. We've been aggregating feedback, working on parsing, and we think we now have all of our 🦆🦆🦆🦆 ducks in a line to begin releasing a
next
tag in the next week.Please note: Nothing written here is final and we'd love for contributors, users, and anyone else to comment with ideas, opinions, and questions/concerns.
Features
Breaking changes?
Generally speaking, most of the breaking changes will be internal and shouldn't directly affect end users. We haven't yet shipped them, though, because they are technically changing behavior users may've been depending on (which will be documented below).
However, with the parsing overhaul (#1039) the syntax has been formalized which will likely cause issues for characters that aren't HTML encoded,
<
and{
, (some of which we'll be able to address with codemods).components
for the pragma prop has been renamed tomdxComponents
Remove components prop merging in MDXCreateElement #638layoutProps
being passed toMDXContent
/wrapper
RemovelayoutProps
from transpiled output #742mdPlugins
andhastPlugins
options Remove option support formdPlugins
andhastPlugins
#718RFCs
The following RFCs (request for comments) are either accepted (✅), being discussed (💬), declined (✖️), or need to be written (📝). If you have opinions here, please chime in on these issues as they will affect the v2 release.
Work left to complete or currently in flight
If you have any interest in working on any of these tasks please let us know! We'd be happy to help guide anyone along.
eslint-mdx
Support for MDX v2 eslint-mdx#204next
branch #1078export { default } from './foo'
Makeexport { default } from "…"
work #961import * as Foo from './foo'
Add support for namespace imports #1050next
tagremark-mdx
andremark-mdxjs
, imports and exports can be turned off with an optionmdx
package that includes all packages with exports like:mdx/react
andmdx/vue
Encountered bugs
Performance considerations
How can you help?
Let us know if you want to take on any of the issues that don't yet have folks assigned. You can also take the canary for a spin and let us know if you encounter any problems:
Is there something missing? Is there something you're concerned about?
The text was updated successfully, but these errors were encountered: