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

[core] Use terser for minification in umd bundle #15491

Merged
merged 4 commits into from Apr 26, 2019

Conversation

eps1lon
Copy link
Member

@eps1lon eps1lon commented Apr 25, 2019

Makes it easier to switch between es5 and es6 builds. uglify-js does not support es6 while terser is the better alternative to uglify-es. webpack 5 will use terser by default.

@eps1lon eps1lon added performance package: material-ui Specific to @mui/material labels Apr 25, 2019
@@ -8,7 +8,7 @@ import Popover from '../Popover';
import MenuList from '../MenuList';
import warning from 'warning';
import ReactDOM from 'react-dom';
import { setRef } from '@material-ui/core/utils/reactHelpers';
Copy link
Member

Choose a reason for hiding this comment

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

😱 Murphy!

Copy link
Member Author

Choose a reason for hiding this comment

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

This caused

@material-ui/core: parsed: -0.15% heart_eyes, gzip: -0.15% heart_eyes

Copy link
Member Author

Choose a reason for hiding this comment

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

Need to investigate why the script didn't fail. Preferably rollup would exit with non-zero.

Copy link
Member

Choose a reason for hiding this comment

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

During the last release, I have seen unusual rollup warnings.

Copy link
Member

Choose a reason for hiding this comment

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

I can see the same warning in the next build CI output:

Capture d’écran 2019-04-25 à 22 56 54
The warnings are gone on this branch 👌.

@TrySound Do you know if we can make these warnings failing?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, you can

onwarn(warning, warn) {
  if (condition1) {
    return;
  }
  if (condition2) {
    return warn(warning)
  }
  throw Error(warning.message);
},

Copy link
Member

Choose a reason for hiding this comment

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

Awesome, I'm trying this out :)

Copy link
Member

Choose a reason for hiding this comment

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

Capture d’écran 2019-04-26 à 21 15 11

@mui-pr-bot
Copy link

mui-pr-bot commented Apr 25, 2019

@material-ui/core: parsed: -0.15% 😍, gzip: -0.15% 😍

Details of bundle changes.

Comparing: 1155be4...b24ddcd

bundle parsed diff gzip diff prev parsed current parsed prev gzip current gzip
@material-ui/core -0.15% -0.15% 311,191 310,731 84,408 84,285
@material-ui/core/Paper -0.00% 0.00% 67,308 67,307 19,985 19,985
@material-ui/core/Paper.esm 0.00% -0.01% 60,714 60,714 18,898 18,897
@material-ui/core/Popper 0.00% 0.00% 31,113 31,113 10,801 10,801
@material-ui/core/Textarea 0.00% -0.04% 5,472 5,472 2,366 2,365
@material-ui/core/TrapFocus 0.00% 0.00% 3,731 3,731 1,564 1,564
@material-ui/core/styles/createMuiTheme 0.00% 0.00% 15,943 15,943 5,778 5,778
@material-ui/core/useMediaQuery 0.00% 0.00% 2,106 2,106 974 974
@material-ui/lab -0.00% +0.01% 🔺 140,760 140,759 42,560 42,565
@material-ui/styles 0.00% +0.02% 🔺 50,835 50,835 15,023 15,026
@material-ui/system 0.00% 0.00% 11,765 11,765 3,923 3,923
Button 0.00% 0.00% 85,663 85,663 25,640 25,641
Modal 0.00% -0.03% 20,578 20,578 6,609 6,607
colorManipulator 0.00% 0.00% 3,904 3,904 1,543 1,543
docs.landing 0.00% 0.00% 51,154 51,154 11,250 11,250
docs.main 0.00% 0.00% 648,872 648,872 202,332 202,332
packages/material-ui/build/umd/material-ui.production.min.js -0.04% -0.02% 292,685 292,566 82,275 82,260

Generated by 🚫 dangerJS against b24ddcd

@TrySound
Copy link
Contributor

I think webpack 4 already uses terser out of the box. And I migrated rollup-plugin-uglify back to uglify-js. uglify-es is dead project. Terser is uglify-es fork of activists.

@oliviertassinari oliviertassinari merged commit 90b9f3d into mui:next Apr 26, 2019
@eps1lon eps1lon deleted the build/umd-enhancments branch April 27, 2019 07:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: material-ui Specific to @mui/material performance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants