Skip to content
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

Post mono-repo-transition direction of the structure / architecture #171

Open
Mohammer5 opened this issue Jul 29, 2020 · 0 comments
Open

Comments

@Mohammer5
Copy link
Contributor

This issue replaces dhis2/ui#218. The original topic was about how we want to handle context within our UI libraries, but it turns out there's a more fundamental topic that we need to talk about, which is most likely going to solve the context issue:

Organization of our packages inside this repository

We've successfully transitioned to the mono-repo, now is the time we can talk about what we want to do with it.
Viktor already pointed out his vision of the base package in a comment down below:

  • Base components are simple to re-use across higher-level components.
  • They forward refs & displayName
  • Incoming, unhandled, prop are spread onto the underlying root element
  • They lack of attached behavior, so they stay pure & deterministic

If we go for this, then I think the ideal structure I'd like to aim for is to have dedicated, small packages for specific tasks,
like validation, layout, input (basically form components), react-final-form (what is forms now), etc. Then there'd be a clear separation between the different packages. All of them (except base) could have translations, make api calls or work on dhis2 specific data structures as long as we expose the base components as well & use names that indicate differences between similar components (e. g. we use Field to show the difference between an input component and an input component with meta data & helpers attached to it; or adding a FF suffix to components made ready for working with react final form)

Alternatives

Alternatively to the approach above is a more pragmatic approach. The current approach has a lot of theory, assumptions and expectations behind it.
For example: We don't know if

  • people will ever create their own components using base components
  • there is a practical gain from not putting translations on the base components if they can be turned off

I can see the idea behind managing components in different packages, but without having any data backing up our decisions, it's hard for me to see a real benefit and we keep speculating about what's the best approach. We have to rely on assumptions (some are probably very accurate while others might be off by quite a big margin), which feels like a premature optimization for issues that might not even be there.

We've just transitioned to the mono-repo, so we should probably just stick to it and see how it turns out. But what I would really like to do is to collect information. I don't know if there are any tools for this though. Is there a way to see how much time we spend on adding features, refactoring code/architecture or fixing bugs? Is there a good way for us to find out how/where our components are being used?

@Mohammer5 Mohammer5 changed the title Post-mono-repo-transition direction of the structure / architecture Post mono-repo-transition direction of the structure / architecture Aug 3, 2020
@varl varl transferred this issue from dhis2/ui Nov 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants