mui / mui-x

MUI X: Build complex and data-rich applications using a growing list of advanced React components, like the Data Grid, Date and Time Pickers, Charts, and more!
https://mui.com/x/
4.15k stars 1.3k forks source link

[RFC] Package structure #30

Closed oliviertassinari closed 4 years ago

oliviertassinari commented 4 years ago

This is a follow-up on a couple of past discussions we had, mostly speaking. I couldn't find any written conclusion on how to best name the package and components outside of a verbal discussion that no other member can introspect. In order to improve decision making and transparency, I'm making a written RFC, so we can settle.

Introduction

We came to the conclusion at https://github.com/mui-org/material-ui-pickers/issues/1778 that:

Problems

Looking at the current naming organization, I see a couple of things we could potentially improve:

Solutions?

A couple of options that we could consider to solve the above:

  1. We could put emphasis on the components, paid or not. This would enable to flatten the file structure. Moving from:
/data-grid
/x-grid-data-generator
/x-grid-modules
/x-grid
/pickers
/x-pickers
/x-tree-view

to

/data-grid
/grid-x-generator
/grid-x-modules
/grid-x
/pickers
/pickers-x
/tree-view-x

I've not convinced it's better, but it could have its advantages, to consider.

  1. We could simply remove the intermediary /grid folder. I think that it would make it easier to navigate the codebase.
  2. We could consider that the Enterprise version of the component is meant to completely replace and extend the MIT version. I think that it would create a good constraint for the developer experience. We would only document one component, with props that are restricted to X with a dedicated notice. In practice, it would mean:
import { DatePicker } from '@material-ui/pickers';
import { DateRangePicker } from '@material-ui/x-pickers';
// import { DataGrid } from '@material-ui/data-grid';
import { DataGrid } from '@material-ui/x-data-grid';
  1. In the even 3. it not identified as the best approach, we can differentiate the two components (free and paid):
import { DatePicker } from '@material-ui/pickers';
import { DateRangePicker } from '@material-ui/x-pickers';
import { DataGrid } from '@material-ui/data-grid';
import { XGrid } from '@material-ui/x-grid';
oliviertassinari commented 4 years ago

Problem solved, we went with

import { DatePicker } from '@material-ui/pickers';
import { DateRangePicker } from '@material-ui/x-pickers';
import { DataGrid } from '@material-ui/data-grid';
import { XGrid } from '@material-ui/x-grid';