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] Flatten imports to speed up webpack build & node resolution #10354

Open
oliviertassinari opened this issue Sep 16, 2023 · 2 comments
Open
Labels
component: charts This is the name of the generic UI component, not the React module! component: data grid This is the name of the generic UI component, not the React module! component: pickers This is the name of the generic UI component, not the React module! component: tree view TreeView, TreeItem. This is the name of the generic UI component, not the React module! core Infrastructure work going on behind the scenes performance

Comments

@oliviertassinari
Copy link
Member

oliviertassinari commented Sep 16, 2023

Summary 💡

Same as mui/material-ui#35840 but for MUI X.

We also miss an eslint rule to fail the build, but this is likely missing from the main eslint configuration, so a bit outside of the scope of X.

Examples 🌈

We should be able to import deep in:

import { unstable_useEnhancedEffect as useEnhancedEffect } from '@mui/utils';

Motivation 🔦

It was raised in #10215.

Note that https://www.notion.so/mui-org/mui-utils-purpose-9a9fc9da3a004864b6c4e1f4d1f24f95 is a different problem/discussion. But regardless of either we import from base or utils, barrel imports shouldn't happen.

cc @romgrk maybe the type of performance topics you enjoy 😁. It's not about runtime performance though, mostly in dev mode.

@oliviertassinari oliviertassinari added performance core Infrastructure work going on behind the scenes component: data grid This is the name of the generic UI component, not the React module! status: waiting for maintainer These issues haven't been looked at yet by a maintainer component: pickers This is the name of the generic UI component, not the React module! component: charts This is the name of the generic UI component, not the React module! labels Sep 16, 2023
@romgrk
Copy link
Contributor

romgrk commented Oct 2, 2023

Just to be sure, by "importing deep" you mean:

-import { xxx } from '@mui/utils';
+import xxx from '@mui/utils/xxx';

right?

@oliviertassinari
Copy link
Member Author

@romgrk Correct

@oliviertassinari oliviertassinari removed the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Jan 5, 2024
@oliviertassinari oliviertassinari added the component: tree view TreeView, TreeItem. This is the name of the generic UI component, not the React module! label Nov 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: charts This is the name of the generic UI component, not the React module! component: data grid This is the name of the generic UI component, not the React module! component: pickers This is the name of the generic UI component, not the React module! component: tree view TreeView, TreeItem. This is the name of the generic UI component, not the React module! core Infrastructure work going on behind the scenes performance
Projects
None yet
Development

No branches or pull requests

2 participants