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

Tree shaking for react-icons isn't working in local development. Loads all icon modules #84

Closed
nitishdhar opened this issue Aug 12, 2023 · 2 comments · Fixed by #92 or #93
Closed
Assignees
Labels
bug Something isn't working

Comments

@nitishdhar
Copy link
Collaborator

nitishdhar commented Aug 12, 2023

Tree shaking for react-icons isn't working in local development. Loads all icon modules

Works fine for the production build.

event compiled client and server successfully in 41.4s (2653 modules)

Screen Shot 2023-08-11 at 10 51 05 PM

Refer - react-icons/react-icons#154

Also Refer - vercel/next.js#48748

@nitishdhar
Copy link
Collaborator Author

PR for fix is open with that library - react-icons/react-icons#727

@nitishdhar nitishdhar changed the title Tree shaking for react-icons isn't working. Loads all icon modules during development Tree shaking for react-icons isn't working in local development. Loads all icon modules Aug 12, 2023
@nitishdhar nitishdhar added the bug Something isn't working label Aug 12, 2023
@aslink87
Copy link
Member

I've created the icon-lag-testing branch to sandbox some potential resolutions as there has been little activity on that PR from the maintainers. Which is disappointing.

icon-lag-testing branch currently has moved all of our icons to fontAwesome from react-icons. Total unzipped client size compared to development branch with same codebase is 3.7mb vs 14.3mb. Zipped size is larger with 372.9kb vs 356.9kb on development.

I suggest we test using the icon-lag-testing branch to see the impact on developer experience. If this difference is noticeable then we should merge it into all active main branches and eliminate using react-icons in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: 🎉 Done
2 participants