-
I understand that MDX wants to encourage you to use JSX comments. But when you have use cases like legacy Apps with hundreds and hundreds of block comments I'm just genuinely curious about the historical decision process behind it and why there are no "compatibility" plugins/options for MDX. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 19 replies
-
Use a regex to replace
No, it was a very careful decision to make what is markdown and what is JS(X) unambiguous. If you want to migrate from markdown, you don’t need to migrate, use an
a) there is a plugin. |
Beta Was this translation helpful? Give feedback.
-
This is not a feasible option when you have hundreds of files. I cannot feasibly ask the other collaborators to review each one of the 700+ file changes and guarantee them that these changes are safe. (Assuming I'm going the regex route)
If I import a plain Markdown file inside MDX, it will be treated as MDX. So, there's an issue here, not sure if it's a bug or per design. But that's minor, honestly.
Which plugin? And what does that plugin does? |
Beta Was this translation helpful? Give feedback.
Use a regex to replace
<!--
with{/*
and-->
with*/}
, or a plugin, or use the.md
extension if you want markdown.No, it was a very careful decision to make what is markdown and what is JS(X) unambiguous. If you want to migrate from markdown, you don’t need to migrate, use an
.md
extension.a) there is a plugin.
b) because MDX before v2 passed everything that looked like XML through as JS(X) to Babel/Webpack. We can’t codemod that. We can’t support that. From v2 on, we have an actual AST, which can be transformed, so we can do that.