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

[pickers] Avoid some nested imports in @mui/utils #9172

Closed
wants to merge 1 commit into from

Conversation

alexfauquette
Copy link
Member

@alexfauquette alexfauquette commented May 31, 2023

Fix #9170

@alexfauquette alexfauquette added the component: charts This is the name of the generic UI component, not the React module! label May 31, 2023
@mui-bot
Copy link

mui-bot commented May 31, 2023

Netlify deploy preview

Netlify deploy preview: https://deploy-preview-9172--material-ui-x.netlify.app/

Updated pages

No updates.

These are the results for the performance tests:

Test case Unit Min Max Median Mean σ
Filter 100k rows ms 612.9 1,200.4 612.9 858.04 246.262
Sort 100k rows ms 547.4 1,184.9 1,184.9 956.86 215.614
Select 100k rows ms 239.3 398.4 282.8 311.14 63.932
Deselect 100k rows ms 204.9 287.4 207.6 227.38 31.673

Generated by 🚫 dangerJS against 8dcf956

Copy link
Member

@flaviendelangle flaviendelangle left a comment

Choose a reason for hiding this comment

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

Are we sure we want to do this?
For me it's going against what we are trying to achieve in mui/material-ui#35840

@alexfauquette
Copy link
Member Author

Are we sure we want to do this?

Not at all, that's why I asked for your review 😉
But in that case, I've no clue about how to solve the issue

@flaviendelangle
Copy link
Member

I think the issue is that @mui/utils nested imports are files, not folders.
So the build process can not create nested package.json, which causes the issue here:

image

vs

image

So for me, the clean fix would be to move all the utils (or at least the one used in other packages) into folders with an index file.
@michaldudak I'd like your opinion here. On the core repo, all the imports from @mui/utils are from the root, but mui/material-ui#35840 lets me think that's not something we want to keep in the future. Does my proposal make sense?

@flaviendelangle flaviendelangle added component: pickers This is the name of the generic UI component, not the React module! and removed component: charts This is the name of the generic UI component, not the React module! labels Jun 12, 2023
@michaldudak
Copy link
Member

I share @flaviendelangle's concerns about not using nested imports (especially when we try to teach other developers to use them). If introducing directories solves the problem, we can do it. In the future, we can explicitly say it's a private package, then reorganize it a bit more (e.g., place all the prop-types utilities into one directory etc.).

@flaviendelangle
Copy link
Member

@michaldudak @alexfauquette @LukasTy

If I open a PR tomorrow on the core to create the folders, I think we can fix the problem without having the intermediate step proposed in this PR.
But if one of you think the fix will take more that 2-3 weeks top, then I think the intermediate step is needed to unlock our users.

@LukasTy
Copy link
Member

LukasTy commented Jun 13, 2023

But if one of you think the fix will take more that 2-3 weeks top, then I think the intermediate step is needed to unlock our users.

This PR has already been open for 2 weeks already. 🙈
What's 1 or 2 more weeks if it comes to that? 🤷

@flaviendelangle
Copy link
Member

flaviendelangle commented Jun 14, 2023

Here is the PR: mui/material-ui#37586
I migrated all the files that are used in the X repo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: pickers This is the name of the generic UI component, not the React module!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[pickers] Unable to import DatePicker V6 components from components library
5 participants