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

[Dev] Speed up unit tests by not using MUI Icons barrel files #9828

Merged
merged 1 commit into from
May 4, 2024

Conversation

fzaninotto
Copy link
Member

@fzaninotto fzaninotto commented May 3, 2024

Following the advice at https://mui.com/material-ui/guides/minimizing-bundle-size/#development-environment, I fixed the few named imports from @mui/material-icons and replaced them with default imports for individual icons.

The results are spectacular. The npx jest command now takes a fraction of the time.

On my laptop:

  • Before: 118s
  • After: 41s

On the CI:

  • Before: 4m58s
  • After: 3m28s

Following the advice at https://mui.com/material-ui/guides/minimizing-bundle-size/#development-environment, I fixed the few imports from `@mui/material-icons` and replaced them with named imports for individual icons.

The results are spectacular. The `npx jest` command now takes a fraction of the time. On my laptop:

* Before: 118s
* After: 41s
Copy link
Collaborator

@djhi djhi left a comment

Choose a reason for hiding this comment

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

Now we should try avoiding barrel files import in all our code and measure it too 🔥

@djhi djhi merged commit 1f71769 into next May 4, 2024
13 checks passed
@djhi djhi deleted the remove-barrel-files-mui branch May 4, 2024 11:55
@djhi djhi added this to the 5.0.0 milestone May 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFR Ready For Review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants