-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extract components from components/utils into their own folder #324
Comments
By @Birkbjo:
I'm not sure that We can probably do without |
That's not what I was trying to say, but that having two nested abstraction-folders is increasing complexity.
Another point I made is that it can be debatable which component is a util and which is not, which introduces ambiguity. I think Considering my comment to move what's inside So having
I can't see the component being used anywhere right now. |
By @Birkbjo:
Yeah I agree that it can be a bit arbitrary. I'm not sure if it's ambiguous though - it's just a decision where it lives. And everything we do are decisions right? And can look arbitrary if you don't know the context or reason behind a decision. But that doesn't mean it's ambiguous. |
It is ambiguous until there's a clear rule about what lives where. Whether a component is "complex" or "just a utility" is subjective by nature, so until there's a clear rule, I don't see why this wouldn't be ambiguous.
I don't think that a folder would be overkill; it's not much work, it keeps things consistent and simple. One alternative I could live with is to have components that don't have any co-located files directly in src/components. That's a straightforward rule, there's no ambiguity, and it keeps things simple. To me, this just seems to be an overabstraction architecture-wise. I don't see much value in having these components nested in an extra folder; it seems to be an anticipation to solve a potential issue that is not there yet. Thanks to using index files as entry files for our modules (folders), we don't have to worry about the internal architecture from the rest of the app's perspective. So it makes sense to keep things as simple as possible and only introduce more complex patterns when needed, not before. |
Relates to DHIS2-15080
components/utils folder
src/components/utils
should have a better name. I'd argue for splitting it up into the components that are inside.src/components
is already an "abstraction" (components that are shared), adding another architectural layer of abstraction makes the architecture more complex & complicated. It's also debatable which component is autil
and which is not, which introduces ambiguity. With my suggestion to centralize/simplify the state in the sidebar (see one headline above) and subsequently being able to removeHidePreventUnmount
, we can get rid of this folder as there's nothing in there right nowThe text was updated successfully, but these errors were encountered: