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] Define rules to modularize packages in Next.js #38736

Open
michaldudak opened this issue Aug 31, 2023 · 1 comment
Open

[core] Define rules to modularize packages in Next.js #38736

michaldudak opened this issue Aug 31, 2023 · 1 comment
Labels
core Infrastructure work going on behind the scenes enhancement This is not a bug, nor a new feature nextjs performance

Comments

@michaldudak
Copy link
Member

From #35457 (comment)

we can scale this (modularizing the icons package) to all the MUI npm packages, beyond @mui/icons-material. It could be done with special rules, like in https://github.com/vercel/next.js/blob/261db496f7cf04b70f078a6eae0c8baf6fe5c238/packages/next/src/server/config.ts#L738. I didn't have time in vercel/next.js#51953 to do it right, there was an urgency to fix it before it was rolled from their canary release to stable. Then, the question is is the Next.js job to keep this up to date? Is there a similar opportunity with Vite, should we update the Vite example as well? At the end of the day, it's about improving the DX.

@michaldudak michaldudak added the core Infrastructure work going on behind the scenes label Aug 31, 2023
@oliviertassinari oliviertassinari added performance enhancement This is not a bug, nor a new feature labels Aug 31, 2023
@oliviertassinari
Copy link
Member

oliviertassinari commented Sep 20, 2023

This option in Next.js is gone: https://nextjs.org/blog/next-13-5#optimized-package-imports.

Previously, we added support for modularizeImports, enabling you to configure how imports should resolve when using these libraries. In 13.5, we have superseeded this option with optimizePackageImports, which doesn't require you to specify the mapping of imports, but instead will automatically optimize imports for you.

vercel/next.js#54695 is a great example of how we should details our PR descriptions. It explains well what's going on, and the implications.


We can remove it, e.g.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Infrastructure work going on behind the scenes enhancement This is not a bug, nor a new feature nextjs performance
Projects
None yet
Development

No branches or pull requests

3 participants