perf: import MUI icons by path instead of the barrel - #93
saurabhraghuvanshii wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (8)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe ESLint configuration now rejects ChangesMUI icon import migration
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Refactor Merge Risk: ⚪ Minimal · up to The PR changes only icon import paths and lint enforcement. Tests pass, with no identified user-facing or operational regression. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Seven components imported icons from the `@mui/icons-material` barrel. The
rollup build keeps dependencies external, so `dist/index.js` shipped a
`require('@mui/icons-material')` for 11 icons, and every consumer's bundler
then had to resolve and parse the ~10,800 modules that barrel re-exports.
Import each icon by path and add a `no-restricted-imports` lint rule so the
barrel cannot come back. The built bundle now has zero barrel requires and
11 deep ones. All 236 tests pass; the 8 remaining lint errors are
pre-existing class-field parsing errors, identical on master.
Signed-off-by: saurabhraghuvanshii <saurabhsraghuvanshi@gmail.com>
2a2f3e5 to
fb83a23
Compare
Seven components imported icons from the
@mui/icons-materialbarrel. The rollup build keeps dependencies external, sodist/index.jsshipped arequire('@mui/icons-material')for 11 icons, and every consumer's bundler then had to resolve and parse the ~10,800 modules that barrel re-exports.Import each icon by path and add a
no-restricted-importslint rule so the barrel cannot come back. The built bundle now has zero barrel requires and 11 deep ones. All 236 tests pass; the 8 remaining lint errors are pre-existing class-field parsing errors, identical on master.Notes for Reviewers
This PR fixes #
Signed commits
Summary by CodeRabbit
Refactor
Chores