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
Upgrade next-mdx-remote
and other markdown-related dependencies
#321
Conversation
@@ -3,11 +3,10 @@ import matter from "gray-matter"; | |||
import { MDXRemoteSerializeResult } from "next-mdx-remote"; | |||
import { serialize } from "next-mdx-remote/serialize"; |
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 was impossible without #322 because next-mdx-remote/serialize
v2 is ESM only. The build script was crashing.
import remarkMdx from "remark-mdx"; | ||
import remarkParse from "remark-parse"; | ||
import slugify from "slugify"; | ||
import unified from "unified"; | ||
import { unified } from "unified"; |
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.
Breaking change in unified
@@ -30,14 +30,12 @@ The JSON metadata file should look like this: | |||
} | |||
``` | |||
|
|||
<!-- markdownlint-disable no-emphasis-as-heading --> |
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.
MDX 2 requires comments to be in {* *}
instead of <!-- -->
, which Prettier does on like. Upstream issues: prettier/prettier#12209 / hashicorp/next-mdx-remote#277
In the meantime, if we do need to disable a markdownlint rule, we can do so in .markdownlint.json
. I switched to regular MD headers here to avoid that. The text is a bit bigger than before but the doc looks good overall.
Unblocks:
Was blocked by:
next-mdx-remote@v2
is ESM-only, so we need to finish Addtype: module
to site and to monorepo root and use ESM in scripts #322 firstRelated links:
How to test:
/docs
and/specs
```block-function
.