material-ui icon indicating copy to clipboard operation
material-ui copied to clipboard

[core] refactor: remove manual displayName

Open romgrk opened this issue 8 months ago • 5 comments

Follow-up of https://github.com/mui/base-ui/pull/1920 Depends on https://github.com/mui/mui-public/pull/329

closes https://github.com/mui/material-ui/pull/44067

romgrk avatar May 14 '25 19:05 romgrk

Netlify deploy preview

https://deploy-preview-46147--material-ui.netlify.app/

@mui/material: parsed: +0.12% , gzip: +0.10%

Bundle size report

Details of bundle changes (Toolpad) Details of bundle changes

Generated by :no_entry_sign: dangerJS against a8e5c90af2b6636ef8008e0eea32f87c8f49d282

mui-bot avatar May 14 '25 19:05 mui-bot

🤔 Where does the bundle size increase come from? Shouldn't these be wrapped in a process.env.NODE_ENV check. The bundle size checker should take it into account.

Janpot avatar May 15 '25 07:05 Janpot

It's all wrapped, here is the output of diff -bur build-master build-this-pr for material-ui: https://gist.github.com/romgrk/98b47d15d498704bd61f89082374c36d. Don't know how the bundle size checker works, can't say anything about that.

romgrk avatar May 15 '25 08:05 romgrk

The current implementation runs webpack with minifier on a virtual module that imports the package and compares the result with merge base. Interestingly it seems to minify differently. Looks like in the baseline it omits variable declaration in the function body to create a global var, and in this PR it explicitly creates those const in global scope. Quite odd, maybe whitespace related in terser. https://gist.github.com/Janpot/2d3156e4ee4302687e29ae848f230c06

For now it probably makes most sense to not run this plugin on the tests.

Janpot avatar May 15 '25 10:05 Janpot

I've disabled the plugin in test. This is ready for review.

romgrk avatar May 19 '25 20:05 romgrk