[RFC] Should we flatten the folder structure?
See original GitHub issueThis issue is opened to discuss the following proposal: flattening the folder structure.
The problem
The problem I try to solve is the following. Letās say you want to use the circular progress component. You have to know two things to get the import working.
- Know the name of the component:
CircularProgress
. - Know the import path:
Progress/CircularProgress
.
Itās unclear to me why CircularProgress
is under a Progress
folder or why Radio
isnāt under a Switch
folder. There are many more examples in the codebase.
The solution
I think that we can save (2.) complexity by flatting the folder structure. We can make the import path predictable.
import COMPONENT_NAME from 'material-ui/COMPONENT_NAME`;
Going back to the example, we would move src/Progress/CircularProgress.js
to src/CircularProgress/CircularProgress.js
. People will be able to use the following import:
-import CircularProgress from 'material-ui/Progress/CircularProgress';
+import CircularProgress from 'material-ui/CircularProgress';
Let me know what you think about this proposal! The issue was raised by @neoziro.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:34
- Comments:25 (19 by maintainers)
Top GitHub Comments
All š, no š, I think itās a go!
@tony-kerz
or