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: icon imports #6499

Merged
merged 4 commits into from
Mar 12, 2024
Merged

fix: icon imports #6499

merged 4 commits into from
Mar 12, 2024

Conversation

FredrikOseberg
Copy link
Contributor

@FredrikOseberg FredrikOseberg commented Mar 11, 2024

Based on this article: https://mui.com/material-ui/guides/minimizing-bundle-size/ importing from '@mui/icons-material' instead of specifying the actual path to the icon like import Delete from '@mui/icons-material/Delete'; can be up to six time slower. This change changes all named imports in Unleash referencing the @mui/icons-material to default imports.

This reduced the amount of modules we had to process when building the frontend from 15206 to 4746

Before:
Skjermbilde 2024-03-11 kl  14 19 58

After:
Skjermbilde 2024-03-11 kl  14 20 32

Build time locally decreased by around 50%

Before:
Skjermbilde 2024-03-11 kl  14 31 45

After:
Skjermbilde 2024-03-11 kl  14 27 00

Copy link

vercel bot commented Mar 11, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
unleash-monorepo-frontend ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 12, 2024 8:22am
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
unleash-docs ⬜️ Ignored (Inspect) Visit Preview Mar 12, 2024 8:22am

Copy link

@codescene-delta-analysis codescene-delta-analysis bot left a comment

Choose a reason for hiding this comment

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

Code Health Quality Gates: OK

  • Declining Code Health: 0 findings(s) 🚩
  • Improving Code Health: 0 findings(s) ✅
  • Affected Hotspots: 0 files(s) 🔥

Recommended Review Level: Detailed -- Increased risk for defects: The change involves more modules than 99% of the historic high-risk change sets. The risk is higher as much of the code in this repo (99% of all commits) is written by other authors.
View detailed results in CodeScene

Copy link

@codescene-delta-analysis codescene-delta-analysis bot left a comment

Choose a reason for hiding this comment

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

Code Health Quality Gates: OK

  • Declining Code Health: 0 findings(s) 🚩
  • Improving Code Health: 0 findings(s) ✅
  • Affected Hotspots: 0 files(s) 🔥

Recommended Review Level: Detailed -- Increased risk for defects: The change involves more modules than 99% of the historic high-risk change sets. The risk is higher as much of the code in this repo (99% of all commits) is written by other authors.
View detailed results in CodeScene

Copy link
Member

@ivarconr ivarconr left a comment

Choose a reason for hiding this comment

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

cool!

import FlagRounded from '@mui/icons-material/FlagRounded';
import Report from '@mui/icons-material/Report';
import Timeline from '@mui/icons-material/Timeline';
import { SvgIconComponent } from '@mui/icons-material';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a type and does not seem to affect the module count

Copy link

@codescene-delta-analysis codescene-delta-analysis bot left a comment

Choose a reason for hiding this comment

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

Code Health Quality Gates: OK

  • Declining Code Health: 0 findings(s) 🚩
  • Improving Code Health: 0 findings(s) ✅
  • Affected Hotspots: 0 files(s) 🔥

Recommended Review Level: Detailed -- Increased risk for defects: The change involves more modules than 99% of the historic high-risk change sets. The risk is higher as much of the code in this repo (99% of all commits) is written by other authors.
View detailed results in CodeScene

Copy link
Contributor

@sjaanus sjaanus left a comment

Choose a reason for hiding this comment

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

LG

@kwasniew kwasniew self-requested a review March 12, 2024 09:16
@FredrikOseberg FredrikOseberg merged commit f381718 into main Mar 12, 2024
13 checks passed
@FredrikOseberg FredrikOseberg deleted the fix/icon-imports branch March 12, 2024 09:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

4 participants