Repository navigation
Replace next-mdx-remote with @mdx-js/mdx - #48
Merged
Merged
Conversation
Blog posts are currently compiled and rendered with next-mdx-remote, which is licensed under MPL-2.0 and has actually been archived upstream. It's just a thin wrapper around @mdx-js/mdx, which is MIT licensed, maintained, and already in our dependency tree. This commit now just uses @mdx-js/mdx directly, with the same plugins and options, so every blog post renders the same HTML as it did before. We drop the problematic next-mdx-remote dependency completely. Note that next-mdx-remote also stripped JavaScript out of posts by default. None of our posts uses JavaScript, and I don't see why we'd need to, so we do not reimplement that functionality here. Signed-off-by: Jared Watts <jbw976@gmail.com>
jbw976
commented
Oct 30, 2026
Comment on lines
-200
to
-221
| remarkPlugins: [remarkGfm], | ||
| rehypePlugins: [ | ||
| // Lift standalone images out of their wrapping <p> so our <figure>/<figcaption> | ||
| // image renderer doesn't produce invalid <p><figure> nesting (a hydration error). | ||
| rehypeUnwrapImages, | ||
| rehypeSlug, | ||
| [ | ||
| rehypeAutolinkHeadings, | ||
| { | ||
| behavior: 'append', | ||
| properties: { className: ['heading-anchor'], ariaHidden: true, tabIndex: -1 }, | ||
| content: { type: 'text', value: '#' }, | ||
| }, | ||
| ], | ||
| [ | ||
| rehypePrettyCode, | ||
| { | ||
| theme: 'github-dark', | ||
| // Let our CSS own the background so code blocks match the deep-space theme. | ||
| keepBackground: false, | ||
| }, | ||
| ], |
Contributor
Author
There was a problem hiding this comment.
all these options are basically the same, their indentation just changed
negz
approved these changes
Oct 30, 2026
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
Blog posts are currently compiled and rendered with
next-mdx-remote, which is licensed under MPL-2.0 and has actually been archived upstream. It's just a thin wrapper around@mdx-js/mdx, which is MIT licensed, maintained, and already in our dependency tree.This commit now just uses
@mdx-js/mdxdirectly, with the same plugins and options, so every blog post renders the same HTML as it did before. We drop the problematicnext-mdx-remotedependency completely.This makes our website licensing story better - it would be hard to ask for an MPL exception for a dependency that is archived/unsupported 😅
Note that
next-mdx-remotealso stripped JavaScript out of posts by default. None of our posts uses JavaScript, and I don't see why we'd need to, so we do not reimplement that functionality here.The scope of these changes would only affect how we compile blog posts from their source tree mdx format into HTML live on the site. I built the site locally and had an agent compare all the blog posts HTML from the local site versus the production site and they resulted in the same HTML. I also poked around through the rendered blog posts on my local site, clicked the links, checked the formatting, etc. and things look OK to my human eyes also 👀
I'll do the same on the Vercel preview when it's ready.
I am not a typescript expert but i did walk through all these code changes and think about them to understand them myself - I didn't see anything unreasonable here IMO.
Checklist
npm run lintandnpm run buildlocally.npm run validate-postsif I changed blog content.git commit -s.