-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[docs] Fix imports for x-grid-data-generator #887
[docs] Fix imports for x-grid-data-generator #887
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if the x-data-grid-generator is supposed to work with just the data-grid module.
OK, so we are going with option 1. sounds fair. Considering that XGrid extends DataGrid, I would expect it to work with both. We need to fix the codesandbox dependency generation logic and update all the imports as well as the peer dependency.
Also if it should work then the name would also need to change IMO (remove the x- prefix).
Regarding the naming, if we were to improve it (in the future), I would personally suggest that we create a new repository under this folder: /packages/material-ui-x
. Then, we could do import {} from '@material-ui/x/dataGenerator';
.
I have also noticed that we forgot to prefix the relevant folders with material-ui in https://github.com/mui-org/material-ui-x/tree/master/packages to match https://github.com/mui-org/material-ui/tree/master/packages.
I understand that it is still broken. I opened the PR to use it as a discussion to decide between option 1 and option 2. |
:;master' of github.com:mui-org/material-ui-x into fix/DataGrid-NO_ISSUE-fix-imports
After giving it a bit more thought, removing |
What's the pros of option 2 compared to option 1? I mean, what's the selling point? (assuming this terminology #855 (comment)) |
Removing DataGrid from the dep would make using this simpler as you can use it with both right. Correct me if I'm wrong but if we keep it as it is and want to make it work with |
@DanailH OK thanks. I was interested in the rationale. We trade of bit of code duplication for one less dependency in the codesandbox-es/examples repo (when using x-grid). No objections, we can give it a try. Could we update the eslint rule to forbid imports, so we don't break the tradeoff in the future inadvertently like we did in the first place? |
We could move it to the grid folder as well, and build it the same way we build data-grid and x-grid package. |
22e1aa8
to
87a21ed
Compare
Ok, I moved the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great
In response to this comment #855 (comment)
I'm not sure if the
x-data-grid-generator
is supposed to work with just thedata-grid
module. Let's discuss it here. Also if it should work then the name would also need to change IMO (remove thex-
prefix).