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

[DataGrid] Introduce new component #18872

Closed
wants to merge 2 commits into from

Conversation

oliviertassinari
Copy link
Member

@oliviertassinari oliviertassinari commented Dec 16, 2019

Preview: https://deploy-preview-18872--material-ui.netlify.com/components/data-grid/

This is a first batch for the MIT version of the component. The long term objective is to be, more or less at feature parity with ag-grid. This is a strategical effort to strengthen the idea that Material-UI primary focus is to solve complex UI problems at its core. To truly execute on our strapline:

React components for faster and easier web development. Build your own design system, or start with Material Design.

Providing a nice looking layer on top of these components is a necessary secondary requirement (Material Design), that we might support different design specifications in the future (2-3 years?), like fluent, or ant.

I plan to dedicate 100 hours to this first batch, similarly to the first batch of the Autocomplete component. I estimate that it will take about 6 weeks to complete (end of January) if I keep the primary focus on the daily issues and pull requests flow coordination. Long term, we will likely need a good 5,000 hours on this problem.

@gabrielliwerant, @gregnb, @geoperez, @mbrn, @Domino987 per your previous interest and effort on different projects to solve this problem, you are welcome to come in and help :)! We have a dedicated $ fund to support this effort (including the development of not MIT features).

Regarding the 4 complementary projects we link in the documentation, once this component is feature-rich enough, we will remove these mentions, as we did for the Autocomplete for downshift and react-select because they overlap.

Progress: 30/100 hours (still in a preliminary phase, most of the time spent on early R&D).

Closes #5069
Closes #14267
Closes #18019
Closes #18434
Closes #18712

@oliviertassinari oliviertassinari added new feature New feature or request component: data grid This is the name of the generic UI component, not the React module! labels Dec 16, 2019
@mui-pr-bot
Copy link

mui-pr-bot commented Dec 16, 2019

@material-ui/core: parsed: +0.04% , gzip: +0.48%
@material-ui/lab: parsed: +45.03% , gzip: +42.93%

Details of bundle changes.

Comparing: c99bd0d...9b3301c

bundle Size Change Size Gzip Change Gzip
DataGrid ▲ +170 kB (+Infinity% ) 170 kB ▲ +49.4 kB (+Infinity% ) 49.4 kB
@material-ui/lab ▲ +82.5 kB (+45.03% ) 266 kB ▲ +23.5 kB (+42.93% ) 78.4 kB
docs.main ▼ -6.64 kB (-1.08% ) 608 kB ▼ -2.3 kB (-1.17% ) 194 kB
TablePagination ▼ -148 B (-0.10% ) 141 kB ▲ +34 B (+0.08% ) 41.5 kB
@material-ui/core ▲ +135 B (+0.04% ) 359 kB ▲ +475 B (+0.48% ) 98.9 kB
Drawer ▲ +134 B (+0.16% ) 84.9 kB ▲ +46 B (+0.18% ) 25.9 kB
SwipeableDrawer ▲ +130 B (+0.14% ) 92.3 kB ▲ +49 B (+0.17% ) 29 kB
Dialog ▲ +128 B (+0.15% ) 83.1 kB ▲ +11 B (+0.04% ) 26 kB
@material-ui/core[umd] ▲ +126 B (+0.04% ) 314 kB ▲ +55 B (+0.06% ) 90.8 kB
Backdrop ▲ +117 B (+0.17% ) 68.1 kB ▲ +53 B (+0.25% ) 21.2 kB
docs.landing ▼ -42 B (-0.08% ) 50.9 kB ▼ -3 B (-0.02% ) 13.5 kB
MenuItem ▼ -34 B (-0.04% ) 78.3 kB ▼ -2 B (-0.01% ) 24.6 kB
Button ▼ -29 B (-0.04% ) 79.9 kB ▼ -3 B (-0.01% ) 24.6 kB
Select ▼ -24 B (-0.02% ) 115 kB ▲ +3 B (+0.01% ) 34.2 kB
LinearProgress ▼ -22 B (-0.03% ) 65.5 kB ▼ -196 B (-0.95% ) 20.4 kB
ListItem ▼ -15 B (-0.02% ) 77.3 kB ▲ +4 B (+0.02% ) 24.3 kB
TableCell ▼ -13 B (-0.02% ) 64.3 kB ▼ -205 B (-1.01% ) 20.1 kB
OutlinedInput ▼ -13 B (-0.02% ) 74.2 kB ▼ -2 B (-0.01% ) 23.2 kB
FilledInput ▼ -13 B (-0.02% ) 73.8 kB ▼ -1 B (-0.00% ) 23 kB
FormControl ▲ +11 B (+0.02% ) 64.6 kB ▼ -6 B (-0.03% ) 20.2 kB
FormLabel ▲ +10 B (+0.02% ) 63.7 kB ▼ -5 B (-0.03% ) 19.8 kB
MenuList ▼ -9 B (-0.01% ) 66.2 kB ▲ +7 B (+0.03% ) 20.8 kB
StepIcon ▲ +9 B (+0.01% ) 64.9 kB ▼ -1 B (-0.00% ) 20.3 kB
Popover ▼ -8 B (-0.01% ) 83 kB ▲ +9 B (+0.03% ) 25.8 kB
Tooltip ▲ +8 B (+0.01% ) 101 kB ▼ -2 B (-0.01% ) 32.1 kB
Chip ▲ +7 B (+0.01% ) 82.8 kB ▲ +5 B (+0.02% ) 25.5 kB
Collapse ▲ +7 B (+0.01% ) 68.1 kB ▼ -4 B (-0.02% ) 21.2 kB
Fab ▲ +7 B (+0.01% ) 77 kB ▲ +4 B (+0.02% ) 24.1 kB
Autocomplete ▲ +7 B (+0.01% ) 130 kB ▲ +3 B (+0.01% ) 40.8 kB
Menu ▲ +7 B (+0.01% ) 88.7 kB ▲ +3 B (+0.01% ) 27.4 kB
Box ▲ +5 B (+0.01% ) 71 kB ▼ -5 B (-0.02% ) 21.7 kB
@material-ui/system ▲ +5 B (+0.03% ) 14.6 kB ▲ +2 B (+0.05% ) 4.04 kB
IconButton ▲ +5 B (+0.01% ) 76.4 kB ▲ +2 B (+0.01% ) 23.9 kB
List ▼ -5 B (-0.01% ) 62.6 kB ▼ -2 B (-0.01% ) 19.6 kB
TableSortLabel ▼ -4 B (-0.01% ) 77.6 kB ▼ -210 B (-0.86% ) 24.3 kB
NativeSelect ▼ -4 B (-0.01% ) 77 kB ▲ +31 B (+0.13% ) 24.4 kB
Grow ▲ +4 B (+0.02% ) 23.9 kB ▲ +10 B (+0.12% ) 8.21 kB
ButtonBase ▲ +4 B (+0.01% ) 74.2 kB ▲ +5 B (+0.02% ) 23.4 kB
SvgIcon ▲ +4 B (+0.01% ) 63.3 kB ▼ -2 B (-0.01% ) 19.8 kB
InputLabel ▲ +3 B (0.00% ) 65.6 kB ▲ +240 B (+1.18% ) 20.6 kB
InputBase ▼ -3 B (-0.00% ) 70.8 kB -- 22.3 kB
Modal ▲ +2 B (+0.01% ) 14.3 kB ▲ +18 B (+0.36% ) 5.03 kB
Fade ▼ -2 B (-0.01% ) 23.3 kB ▲ +7 B (+0.09% ) 8 kB
Typography ▲ +2 B (0.00% ) 63.9 kB ▼ -7 B (-0.03% ) 20.1 kB
TextField ▲ +1 B (0.00% ) 124 kB ▲ +32 B (+0.09% ) 36.3 kB
Input ▼ -1 B (-0.00% ) 72.7 kB ▼ -3 B (-0.01% ) 22.8 kB
Paper ▼ -1 B (-0.00% ) 62.6 kB ▼ -3 B (-0.02% ) 19.6 kB
ExpansionPanelSummary -- 78.3 kB ▲ +80 B (+0.32% ) 24.9 kB
SpeedDialIcon -- 64.8 kB ▼ -35 B (-0.17% ) 20.4 kB
SpeedDialAction -- 117 kB ▲ +31 B (+0.08% ) 37.3 kB
MobileStepper -- 68.1 kB ▲ +30 B (+0.14% ) 21.5 kB
Switch -- 81.4 kB ▼ -28 B (-0.11% ) 25.7 kB
FormControlLabel -- 65.8 kB ▼ -23 B (-0.11% ) 20.7 kB
Avatar -- 65.5 kB ▼ -22 B (-0.11% ) 20.7 kB
Grid -- 65.3 kB ▼ -17 B (-0.08% ) 20.6 kB
StepButton -- 82.5 kB ▼ -17 B (-0.06% ) 26.2 kB
ButtonGroup -- 83.4 kB ▲ +16 B (+0.06% ) 25.7 kB
Alert -- 84 kB ▲ +12 B (+0.05% ) 26.4 kB
Table -- 62.8 kB ▼ -11 B (-0.06% ) 19.8 kB
Badge -- 65.6 kB ▲ +10 B (+0.05% ) 20.5 kB
TableBody -- 62.4 kB ▼ -9 B (-0.05% ) 19.6 kB
Toolbar -- 62.6 kB ▲ +9 B (+0.05% ) 19.7 kB
TableRow -- 62.8 kB ▼ -8 B (-0.04% ) 19.7 kB
Zoom -- 23.4 kB ▼ -8 B (-0.10% ) 8.1 kB
Popper -- 28.7 kB ▲ +7 B (+0.07% ) 10.3 kB
ToggleButtonGroup -- 63.5 kB ▼ -7 B (-0.03% ) 20 kB
Checkbox -- 82.2 kB ▲ +6 B (+0.02% ) 26.1 kB
ExpansionPanel -- 71.6 kB ▲ +6 B (+0.03% ) 22.5 kB
Tab -- 76.6 kB ▼ -6 B (-0.02% ) 24.3 kB
TreeView -- 66.6 kB ▼ -6 B (-0.03% ) 21 kB
AlertTitle -- 64.4 kB ▲ +5 B (+0.02% ) 20.4 kB
AvatarGroup -- 62.5 kB ▲ +5 B (+0.03% ) 19.7 kB
ExpansionPanelDetails -- 62.2 kB ▲ +5 B (+0.03% ) 19.6 kB
GridListTile -- 64 kB ▲ +5 B (+0.02% ) 20.1 kB
Link -- 66.8 kB ▼ -5 B (-0.02% ) 21.2 kB
Slide -- 25.3 kB ▼ -5 B (-0.06% ) 8.72 kB
Slider -- 75.8 kB ▼ -5 B (-0.02% ) 24.1 kB
SpeedDial -- 86.3 kB ▼ -5 B (-0.02% ) 27.3 kB
StepContent -- 69.2 kB ▲ +5 B (+0.02% ) 21.8 kB
Tabs -- 85.7 kB ▼ -5 B (-0.02% ) 27.3 kB
BottomNavigationAction -- 75.7 kB ▲ +4 B (+0.02% ) 24 kB
ListItemAvatar -- 62.4 kB ▼ -4 B (-0.02% ) 19.6 kB
ListItemSecondaryAction -- 62.3 kB ▼ -4 B (-0.02% ) 19.6 kB
Radio -- 83.2 kB ▲ +4 B (+0.02% ) 26.3 kB
Breadcrumbs -- 68.2 kB ▼ -3 B (-0.01% ) 21.5 kB
Container -- 63.5 kB ▲ +3 B (+0.02% ) 19.9 kB
DialogActions -- 62.3 kB ▲ +3 B (+0.02% ) 19.6 kB
ListItemIcon -- 62.4 kB ▼ -3 B (-0.02% ) 19.6 kB
RootRef -- 4.21 kB ▼ -3 B (-0.18% ) 1.64 kB
Snackbar -- 75.4 kB ▼ -3 B (-0.01% ) 23.7 kB
Step -- 62.9 kB ▼ -3 B (-0.02% ) 19.8 kB
TableHead -- 62.4 kB ▼ -3 B (-0.02% ) 19.6 kB
TreeItem -- 74 kB ▼ -3 B (-0.01% ) 23.5 kB
CardHeader -- 65.3 kB ▲ +2 B (+0.01% ) 20.6 kB
CircularProgress -- 64.4 kB ▲ +2 B (+0.01% ) 20.4 kB
CssBaseline -- 57.8 kB ▲ +2 B (+0.01% ) 18.2 kB
Divider -- 62.8 kB ▼ -2 B (-0.01% ) 19.8 kB
GridList -- 62.7 kB ▼ -2 B (-0.01% ) 19.8 kB
ListSubheader -- 63 kB ▲ +2 B (+0.01% ) 19.9 kB
NoSsr -- 2.19 kB ▲ +2 B (+0.19% ) 1.04 kB
Portal -- 2.9 kB ▼ -2 B (-0.15% ) 1.3 kB
Rating -- 70.7 kB ▲ +2 B (+0.01% ) 22.8 kB
Skeleton -- 63.2 kB ▲ +2 B (+0.01% ) 20.1 kB
StepConnector -- 63 kB ▼ -2 B (-0.01% ) 19.9 kB
TableFooter -- 62.4 kB ▼ -2 B (-0.01% ) 19.6 kB
BottomNavigation -- 62.7 kB ▲ +1 B (+0.01% ) 19.7 kB
Card -- 63.1 kB ▲ +1 B (+0.01% ) 19.8 kB
CardActionArea -- 75.3 kB ▲ +1 B (0.00% ) 23.8 kB
CardActions -- 62.3 kB ▼ -1 B (-0.01% ) 19.6 kB
CardMedia -- 62.6 kB ▼ -1 B (-0.01% ) 19.8 kB
ClickAwayListener -- 3.85 kB ▼ -1 B (-0.06% ) 1.54 kB
DialogContent -- 62.5 kB ▼ -1 B (-0.01% ) 19.7 kB
DialogContentText -- 64.3 kB ▼ -1 B (-0.00% ) 20.3 kB
DialogTitle -- 64.5 kB ▲ +1 B (0.00% ) 20.3 kB
FormHelperText -- 63.5 kB ▼ -1 B (-0.00% ) 20 kB
GridListTileBar -- 63.5 kB ▲ +1 B (+0.01% ) 20 kB
Hidden -- 66.2 kB ▼ -1 B (-0.00% ) 20.8 kB
Icon -- 63 kB ▼ -1 B (-0.01% ) 19.8 kB
InputAdornment -- 65.3 kB ▼ -1 B (-0.00% ) 20.6 kB
RadioGroup -- 63.7 kB ▼ -1 B (-0.00% ) 20 kB
SnackbarContent -- 63.8 kB ▼ -1 B (-0.00% ) 20.2 kB
StepLabel -- 68.8 kB ▼ -1 B (-0.00% ) 21.7 kB
Stepper -- 65.1 kB ▲ +1 B (0.00% ) 20.6 kB
styles/createMuiTheme -- 16.5 kB ▲ +1 B (+0.02% ) 5.85 kB
TextareaAutosize -- 5.09 kB ▲ +1 B (+0.05% ) 2.14 kB
@material-ui/styles -- 51.3 kB -- 15.4 kB
AppBar -- 64.2 kB -- 20.2 kB
CardContent -- 62.2 kB -- 19.6 kB
colorManipulator -- 3.85 kB -- 1.52 kB
ExpansionPanelActions -- 62.3 kB -- 19.6 kB
FormGroup -- 62.3 kB -- 19.6 kB
ListItemText -- 65.2 kB -- 20.6 kB
TableContainer -- 62.2 kB -- 19.6 kB
ToggleButton -- 76.4 kB -- 24.2 kB
useAutocomplete -- 13.1 kB -- 4.83 kB
useMediaQuery -- 2.5 kB -- 1.06 kB

Generated by 🚫 dangerJS against 9b3301c

@mbrn
Copy link
Contributor

mbrn commented Dec 16, 2019

Congratulations, i am really appreciated with your effort as a open source developer and consumer. I hope that MUI ecosystem achieves more than this. I will help as i can. But firstly i want to focus on material-table. I don't see this situation as competition. I am still part of MUI ecosystem :)

@Domino987
Copy link
Contributor

Hi, I will see how I can help out. The great work of @mbrn can probably teach us a lot for this component. We should think about how to save the data without mutating the props and how to connect the rows with data like selection, edit etc. I am thinking about a flat state where maps with IDs are used instead of plain arrays. Will this Component be written in ts or js?

@geoperez
Copy link
Contributor

Hi, thanks for the opportunity. @kadosh is also involved in the development of Tubular React. He is willing to participate.

@Janpot
Copy link
Member

Janpot commented Dec 16, 2019

Regarding layout here's another post that may or may not be interesting in the context of R&D for this component: https://adamlynch.com/flexible-data-tables-with-css-grid/
Didn't play around with this myself, but I found it an interesting approach in solving some of the issues I've had before when laying out html tables.

@oliviertassinari
Copy link
Member Author

oliviertassinari commented Dec 16, 2019

Will this Component be written in ts or js?

I would like to give it a try to sources written in TypeScript:

  1. The audience of this component is more likely to use TypeScript.
  2. The component is going to be complex, TypeScript might help its usage, maintenance and documentation.
  3. It would help with the code infrastructure and give a precedent to later host the date picker component in the mono repository (already written in TypeScript).
  4. It will help to evaluate the cost and value of a migration of the whole codebase to TypeScript.

@kadosh
Copy link

kadosh commented Dec 17, 2019

Hey guys, I'm willingly to help on this but I need some orientation. Where should I start?

@Domino987
Copy link
Contributor

Domino987 commented Dec 17, 2019

@kadosh thats great. We decided to write it in typescript so I added a PR to the fork which is the source of this PR to turn the dataGrid Component to tsx. Once this is merged we can start hacking away in ts.

@oliviertassinari oliviertassinari self-assigned this Dec 17, 2019
@dimitropoulos
Copy link
Member

The long term objective is to be, more or less at feature parity with ag-grid.

I've spent a great deal of time working with ag-grid all the way from version 1 back when I was an angular dev 🤕 and through literally every version since both at work and for personal projects. I've also had the pleasure of meeting some of the people from the team. @ceolter and @seanlandsman (and the rest of the team - they have a full fledged company now) have been working around the clock on ag-grid for a few years now. They are fantastic and highly determined engineers - not to mention just being great all-around people. Ag-grid is extraordinarily capable product and is very well documented.

Why am I mentioning all that? Well.. if your goal is to achieve feature parity with ag-grid... why not just use ag-grid? Without even asking them first, I feel absolutely certain that Niall and Sean would at least have a quick video call with you some day to discuss synergistic ways material-ui and ag-grid can work together.

On our side with material-ui, this could be a huge huge boon for the project as many many enterprise and serious companies are already using ag-grid (since it's by far the most capable tool of its class). On their side, they are very very interested in maintaining their status as a first-class react tool, so I know aligning with a project that has as much momentum as material-ui would be enticing to them.

I'd be happy to send an intro email if you want.

@Domino987
Copy link
Contributor

@oliviertassinari great work so far, what are some open issue we should focus on? And is there a reason why the main component is still js?

@oliviertassinari
Copy link
Member Author

oliviertassinari commented Dec 26, 2019

@Domino987 I have started writing the component in TypeScript to later realize that:

  1. Our code infrastructure isn't ready for it, we would need to work on it on a different pull request. For instance, I have started to fix the tests with:
require('@babel/register')({ extensions: ['.js', '.jsx', '.ts', '.tsx'] });

But it's only one piece of the puzzle. We also need to handle: eslint vs tslint, API generation for docs, d.ts generation for build, and maybe more.

  1. We should be able to get 80% of the value with the .d.ts files, maybe we should focus on the core logic first?

# Data Grid - Data

<p class="description">A fast and extendable data table and data grid for React. It's a feature-rich compoent available in MIT or Enterprise versions.</p>

Copy link
Contributor

Choose a reason for hiding this comment

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

might be worth adding a section on row and cell rendering since that's a pretty common use case

/**
* The data record array to be rendered.
*/
rowsData: PropTypes.array,
Copy link
Contributor

Choose a reason for hiding this comment

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

how about just rows? (since columns are simply columns)


const rowsHeader = [columns];

const handleResizeMouseMove = useEventCallback(event => {});
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe column resize can be its own hook? useColumnResize or something? 🤷‍♂

@oliviertassinari oliviertassinari removed their assignment Feb 1, 2020
@kadosh
Copy link

kadosh commented Feb 14, 2020

Hi @oliviertassinari,

Is there anything I can help with? This is the first time I'm involved in something like this. And to be honest, I'm not sure how to contribute. It feels like you're doing all the work.

@oliviertassinari
Copy link
Member Author

oliviertassinari commented Feb 14, 2020

@kadosh Thanks for your interest! We are in the process of hiring https://material-ui.com/company/software-engineer/ a skilled developer that will lead this effort. While I did start the effort, gain enough context on it, they are too much work for me to handle it alone and likely nor to coordinate contributions. Stay tuned :).

@kurtwilbies

This comment has been minimized.

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Mar 20, 2020
@oliviertassinari oliviertassinari added this to the v5 milestone Apr 25, 2020
@oliviertassinari
Copy link
Member Author

oliviertassinari commented May 31, 2020

Closing, we have been working on this component for the last 3 months with @dtassone (450+ cumulated hours so far, probably x10 more to come) under a private repository. We will soon or later start to share more information about it, make it public, etc. If you want to get an early preview or be part of the early beta testers, please send us a message at [email protected] :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: data grid This is the name of the generic UI component, not the React module! new feature New feature or request PR: out-of-date The pull request has merge conflicts and can't be merged
Projects
None yet
10 participants