Open alexgetty opened 3 years ago
Personally, I'm all on board with components having their own folder as a strict rule. Especially given that we are holding storybook files, test files, and now stylesheets next to the component, the folders will fill up quickly.
@brandongregoryscott Yeah I think it sets the best precedent for keeping things organized in the future. The fewer questions we have to ask ourselves for every future component, the more likely things will stay organized and well maintained.
I have a branch queued up with these changes, but it is dependent on some other things happening first:
This is a bit convoluted, I know, but all of these things are interrelated changes that can't be made in isolation without more manual rework later, so Phil and I thought this would be the best way to handle it.
While many components are organized this way, the notable exception is the
forms
folder. Abutton
component has its own folder, yet almost a dozen components share theforms
folder. By giving each component its own named folder, it eases organization, maintainability, and portability since components are self-contained and isolated from each other.I think there could be some exceptions to this rule. Perhaps if two or more components are very similar to each other, use the same base styles, and were only kept separate to avoid bloated prop objects or over-abstraction, then they could share a folder. An example of this might be the
input
components (text-input
,password-input
, etc).On the other hand, if we did keep this as a strict rule and forced somewhat similar - but still distinct - components to have separate folders, then we could abstract out their shared visual styles into mixins which could then be reused in other situations as well.