Skip to content
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

Merged
merged 12 commits into from Jun 13, 2022

Conversation

kachkaev
Copy link
Contributor

@kachkaev kachkaev commented Jun 3, 2022

Unblocks:

Was blocked by:

Related links:

How to test:

  1. Open preview release /docs and /specs
  2. Check visual consistency of inline code insertions, code blocks, info cards and also special anchor headers that start with ```block-function.

@github-actions github-actions bot added area: dependencies Relates to third-party or otherwise imported dependencies (area) area: infra Relates to version control, CI, CD or IaC (area) area: apps > site The blockprotocol.org website, inc. Hub (app) labels Jun 3, 2022
@@ -3,11 +3,10 @@ import matter from "gray-matter";
import { MDXRemoteSerializeResult } from "next-mdx-remote";
import { serialize } from "next-mdx-remote/serialize";
Copy link
Contributor Author

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";
Copy link
Contributor Author

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 -->
Copy link
Contributor Author

@kachkaev kachkaev Jun 10, 2022

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.

@kachkaev kachkaev requested a review from CiaranMn June 10, 2022 19:30
@kachkaev kachkaev marked this pull request as ready for review June 10, 2022 19:30
@kachkaev kachkaev requested a review from nathggns June 10, 2022 19:40
@kachkaev kachkaev requested a review from teenoh June 10, 2022 19:40
@kachkaev kachkaev merged commit 36edc92 into main Jun 13, 2022
@kachkaev kachkaev deleted the ak/upgrade-next-mdx-remote branch June 13, 2022 11:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: apps > site The blockprotocol.org website, inc. Hub (app) area: dependencies Relates to third-party or otherwise imported dependencies (area) area: infra Relates to version control, CI, CD or IaC (area)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants