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

fix: remove useless js-loader in front of mdx-loader #8972

Merged
merged 1 commit into from
May 12, 2023

Conversation

slorber
Copy link
Collaborator

@slorber slorber commented May 12, 2023

Motivation

It is not needed to put a js-loader (Babel/SWC) on top of the mdx compiler.

The output of MDX is already good to be run directly since MDX v2 and does not need any extra transpilation step (the JSX is now transpiled, unlike in MDX v1 output)

Site benchmark

I run some basic local tests by building our website locally.
Unfortunately, the impact of this perf improvement is not as significant as I hoped it to be.

Still, we see some improvement for the Docusaurus site when running on the default Babel JS Loader.
For SWC users, the impact is even smaller.

Before + Babel

  • 92s
  • 96s
  • 95s
  • 97s

Before + SWC

  • 87s
  • 85s
  • 81s
  • 86s

After + Babel

  • 90s
  • 90s
  • 91s
  • 91s

After + SWC

  • 84s
  • 85s
  • 84s
  • 83s

Test Plan

Preview builds and run as before + unit tests

Test links

Deploy preview: https://deploy-preview-8972--docusaurus-2.netlify.app/

@slorber slorber added the pr: performance This PR does not add a new behavior, but existing behaviors will be more memory- / time-efficient. label May 12, 2023
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label May 12, 2023
@netlify
Copy link

netlify bot commented May 12, 2023

[V2]

Name Link
🔨 Latest commit e9f3537
🔍 Latest deploy log https://app.netlify.com/sites/docusaurus-2/deploys/645e47f514fa2800070930b3
😎 Deploy Preview https://deploy-preview-8972--docusaurus-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@github-actions
Copy link

⚡️ Lighthouse report for the deploy preview of this PR

URL Performance Accessibility Best Practices SEO PWA Report
/ 🟠 74 🟢 97 🟢 92 🟢 100 🟠 89 Report
/docs/installation 🟠 83 🟢 100 🟢 92 🟢 100 🟠 89 Report

@github-actions
Copy link

Size Change: +144 B (0%)

Total Size: 1.01 MB

Filename Size Change
website/build/assets/css/styles.********.css 113 kB +68 B (0%)
website/build/assets/js/main.********.js 752 kB +76 B (0%)
ℹ️ View Unchanged
Filename Size
website/.docusaurus/globalData.json 101 kB
website/build/index.html 41.3 kB

compressed-size-action

@slorber slorber merged commit d746f68 into main May 12, 2023
@slorber slorber deleted the slorber/remove-useless-js-loader-mdx branch May 12, 2023 14:31
@slorber slorber mentioned this pull request Jun 23, 2023
This was referenced Oct 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA pr: performance This PR does not add a new behavior, but existing behaviors will be more memory- / time-efficient.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants