4 ms·
One thought that is likely to be controversial... Prefer simpler and flatter directory structure over heavily nested and over-organized directory structure. It
by cynicalpeace 2y ago
One thought that is likely to be controversial... Prefer simpler and flatter directory structure over heavily nested and over-organized directory structure.
It's annoying to have a slight error in your import (ie features/segment/part/buttons/MyButton should be features/segment/portion/buttons/MyButton)
I've found through trial and error it's better to just have components/MyButton, maybe another level down
- christophilus 2y agoI have a fairly flat project that I’ve been managing for the past 5 years. It’s worked well for me. I have found that deep nesting just makes me think more about unimportant stuff. It adds unnecessary friction. Also, naming is hard. More folders means more naming.
- cynicalpeace 2y agoWell said
- jackblemming 2y agoEverything is relative. This won’t scale on large websites with huge amounts of components. More useful is guidelines or tips on how to organize.
- cocoflunchy 2y agoScaled to at least 30k components for Facebook :) https://www.reddit.com/r/reactjs/comments/6al7h2/comment/dhgruqh/ https://www.reddit.com/r/reactjs/comments/6al7h2/comment/dhg...
- jackblemming 2y agoThe post explicitly mentions it works because they invested a lot into internal tooling. > It probably would be a bad idea unless you can build tooling that really benefits from this choice.
- cynicalpeace 2y agoIt is a tip on how to organize lmao
- jackblemming 2y agoIn the same way “no architecture” is a type of architecture, sure, throwing everything into one folder is technically organizing.
- cynicalpeace 2y agoGood thing I didn't say throw everything into one folder