-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[Data Grid] Add experimental headless exports #15662
Conversation
Deploy preview: https://deploy-preview-15662--material-ui-x.netlify.app/ |
266c113
to
9904e6a
Compare
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
Signed-off-by: Lauri <[email protected]>
The team is currently working to split the DataGrid logique and the |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
Thanks but I'm already working on this, there's many aspects to take into consideration and this approach is too limited for what we're trying to do. I should have something available on the v8 alpha in a month or two. I'll close this PR to avoid duplicating work. |
Makes sense. Would you accept a simpler PR though where I move all material slot imports into a single file per datagrid type (community, pro, premium)? Currently, the import resolution tree is so complex, that we'd have to patch all 3 packages to remove material imports in the upper layer. Currently: It'd be a pretty simple change to have material "themes" resolve their own components, which would then make it easier to rip them out as well. While I'm sure you can come up with a 10x approach, I'm also quite certain it will have to come at a steep cost for adoption / migration. Which will take time, and thus a stopgap solution would be greatly appreciated. |
Something along these lines: import type { GridPremiumIconSlotsComponent } from '../models';
import {
GridWorkspacesIcon,
GridGroupWorkIcon,
GridFunctionsIcon,
GridSendPromptIcon,
GridRecordPromptIcon,
} from './icons';
import materialSlotsCommunity from '@mui/x-data-grid/material';
import materialSlotsPro from '@mui/x-data-grid-pro/material';
const iconsSlots: GridPremiumIconSlotsComponent = {
columnMenuUngroupIcon: GridWorkspacesIcon,
columnMenuGroupIcon: GridGroupWorkIcon,
columnMenuAggregationIcon: GridFunctionsIcon,
toolbarPromptSendIcon: GridSendPromptIcon,
toolbarPromptRecordIcon: GridRecordPromptIcon,
};
const materialSlots = {
...materialSlotsCommunity,
...materialSlotsPro,
...iconsSlots,
};
export default materialSlots; |
I'm planning to do a refactor of that kind in the next weeks, and I think I already have it done to some extent in #12432 (though I'll probably reuse that PR for parts). I will however be working on getting rid of material-ui style-engine and typings first, so this part (the components) would be the last one of the design-agnostic refactor.
I understand that this is a priority for you so if you want to make a very very simple PR that's enough to keep you happy for the time being, I will review it, but I can't guarantee that we will merge it if there is a potential conflict with the ongoing work. In other words, I don't recommend that you do it, but it's not a strict no. |
Trying to address my main gripe with the datagrid – we love the core of it, but we don't use Material UI. We have all custom slots in place already, but we cannot get rid of the default slots from our bundle. This is one suggested way to do this for now.
Adds a possibility to import:
This would prompt the developer to provide all of their own base slots and icons (excl. core components like rows, etc.).
Addresses #10143, #12370, etc. partially at least, for the time being.
An alternative option would be to put all the material slots into a separate package, so we could, within our build tooling, resolve it easily to an internal file that exports an empty object.
Very open to feedback, if you think there's a better way to achieve this.