question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItĀ collects links to all the places you might be looking at while hunting down a tough bug.

And, if youā€™re still stuck at the end, weā€™re happy to hop on a call to see how we can help out.

[RFC] Should we flatten the folder structure?

See original GitHub issue

This 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.

  1. Know the name of the component: CircularProgress.
  2. 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:closed
  • Created 6 years ago
  • Reactions:34
  • Comments:25 (19 by maintainers)

github_iconTop GitHub Comments

9reactions
mbrookescommented, Dec 20, 2017

All šŸ‘, no šŸ‘Ž, I think itā€™s a go!

4reactions
oliviertassinaricommented, Feb 23, 2018

@tony-kerz

-import Table, {TableBody, TableCell, TableHead, TableRow, TableSortLabel} from 'material-ui/Table'
+import {
+ Table,
+ TableBody,
+ TableCell,
+ TableHead,
+ TableRow,
+ TableSortLabel,
+} from 'material-ui'

or

-import Table, {TableBody, TableCell, TableHead, TableRow, TableSortLabel} from 'material-ui/Table'
+import Table from 'material-ui/Table'
+import TableBody from 'material-ui/TableBody'
+import TableCell from 'material-ui/TableCell'
+import TableHead from 'material-ui/TableHead'
+import TableRow from 'material-ui/TableRow'
+import TableSortLabel from 'material-ui/TableSortLabel'
Read more comments on GitHub >

github_iconTop Results From Across the Web

Flattening Folder Structure & Unique File Naming - YouTube
Use Document Conversion Service to convert documents and files to TIFF, JPEG, AdobeĀ® PDF, and other image formats with this high volume,Ā ...
Read more >
Flatten folder structure via AppleScript - Macworld
Flattening a folder means moving all the files from their various subfolders into one parent folder. You may want to do this to...
Read more >
RFC 2533 A Syntax for Describing Media Feature Sets - IETF
1.1 Structure of this document The main part of this memo addresses the following main areas: Section 2 introduces and references some terms...
Read more >
detailed passthrough copy options Ā· Issue #214 Ā· 11ty/eleventy
Do we flatten the directory structure and put all files, no matter how deep in the directory /all ? Obviously this will override...
Read more >
Unpacking a flattened Internet - APNIC Blog
If we examine the reachability of the Internet's networks without traversing the traditional hierarchy, we can see that there are a largeĀ ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found