mui / mui/material-ui

[docs-infra] Remove all ES6 transpilation features

Open
#42,385 1 comment 0 reactions 1 assignee View on GitHub

@Janpot is already working on this.

Since Nov 13, 2024.

performance scope: docs-infra
Dominant language
JavaScript
Stars
99.1k
Forks
32.5k
Avg merge
2d 17h
Merged PRs (30d)
106

Description

Summary

The docs transform modern JavaScript features for old browsers, but it's not necessary.

https://pagespeed.web.dev/analysis?url=https%3A%2F%2Fmaster--material-ui.netlify.app%2F

SCR-20240508-qkhd

Lighthouse uses Cannot call a class as a function to detect https://babeljs.io/docs/babel-plugin-transform-classes https://github.com/GoogleChrome/lighthouse/blob/369979f498bd6560127e10476edffb264d4fa3b9/core/audits/byte-efficiency/legacy-javascript.js#L301C22-L301C55.

Seeing this on https://master--material-ui.netlify.app/ is wrong:

SCR-20240508-tytg

We should at minimum go into loose mode: https://github.com/vercel/next.js/blob/5ff2731c589692ed86379f876a38e1ca46f5761e/packages/next/src/build/babel/preset.ts#L161.

Examples

As you can see from https://codesandbox.io/p/sandbox/loving-goodall-f5p6nl?file=%2Fsrc%2Fcomponents%2FApp.js%3A13%2C26 the loose mode already has a good bundle size reduction impact.

Motivation

A better docs experience. Upstream dependency with Next.js https://github.com/vercel/next.js/issues/65540. Moving to SWC could be enough otherwise.

Search keywords: -

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.