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

feat: nextjs and mdx compiler #6071

Merged
merged 12 commits into from
Nov 1, 2023
Merged

Conversation

ovflowd
Copy link
Member

@ovflowd ovflowd commented Oct 31, 2023

Description

This PR does a significant rework on our MDX Parsing and updates Next.js to v14 and MDX to v3.

Motivation

We used a 3rd party package to parse mdx with source strings, aka, next-mdx-remote "maintained" by Hashicorp. But as it became more apparent that we don't need a 3rd party solution and we can use a lightweight solution, I've decided to use the core of MDX itself @mdxjs/mdx without any extra sugar etc.

  • This allows us to be always up to date with upstream @mdxjs and all the unified ecosystem (vfile, unified, remark, rehype, etc)
  • Allows us to finally use remark-gfm plugin instead of handpicking a few versions and specific plugins and trying to make a live with it
  • Removes complexity, simplifies the code, and gives better ownership for our needs.
  • Simplifies some of our direct dependencies
  • Removed rehype-raw and use plain Markdown. Because Markdown files should not mix HTML. (PLEASE DOUBLE CHECK PAGES ARE WORKING AS EXPECTED (compare with nodejs.org))
  • Tried to optimise a few pieces of the build process

The implementation is bare-bones and very simple, and it works fantastically.

Validation

Pages should be rendered as usual without content change...

@ovflowd ovflowd added the infrastructure Issues/PRs related to the Repository Infra label Oct 31, 2023
@ovflowd ovflowd requested review from a team as code owners October 31, 2023 01:25
@vercel
Copy link

vercel bot commented Oct 31, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
nodejs-org ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 1, 2023 2:10pm

@ovflowd ovflowd added the github_actions:pull-request Trigger Pull Request Checks label Oct 31, 2023
@github-actions github-actions bot removed the github_actions:pull-request Trigger Pull Request Checks label Oct 31, 2023
@github-actions
Copy link

github-actions bot commented Oct 31, 2023

Lighthouse Results

URL Performance Accessibility Best Practices SEO Report
/en 🟢 100 🟢 95 🟢 92 🟢 92 🔗
/en/about 🟢 99 🟢 92 🟢 92 🟢 92 🔗
/en/about/previous-releases 🟢 99 🟢 91 🟢 92 🟢 92 🔗
/en/download 🟢 100 🟢 92 🟢 92 🟢 92 🔗
/en/blog 🟢 98 🟢 92 🟢 92 🟢 92 🔗

@github-actions
Copy link

github-actions bot commented Oct 31, 2023

Unit Test Coverage Report

Lines Statements Branches Functions
Coverage: 95%
95.41% (333/349) 77.21% (61/79) 93.05% (67/72)

Unit Test Report

Tests Skipped Failures Errors Time
42 0 💤 0 ❌ 0 🔥 7.483s ⏱️

Copy link
Collaborator

@bmuenzenmeyer bmuenzenmeyer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

next.dynamic.mjs Outdated Show resolved Hide resolved
next.dynamic.mjs Outdated Show resolved Hide resolved
next.dynamic.mjs Outdated Show resolved Hide resolved
next.dynamic.mjs Outdated Show resolved Hide resolved
@ovflowd
Copy link
Member Author

ovflowd commented Oct 31, 2023

@bmuenzenmeyer feel free to re-review this ✨

Copy link
Contributor

@AugustinMauroy AugustinMauroy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SGTM

Copy link
Member

@canerakdas canerakdas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I compared the preview with nodejs.org. Also, fixes the markdown formatted tables

@ovflowd ovflowd added this pull request to the merge queue Nov 1, 2023
Merged via the queue into main with commit 1c49600 Nov 1, 2023
15 checks passed
@ovflowd ovflowd deleted the feat/next-14-lightweight-mdx-compiler branch November 1, 2023 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
infrastructure Issues/PRs related to the Repository Infra
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants