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

feat: general configuration, application layout and directory structure #1

Conversation

HendrikThePendric
Copy link
Contributor

This PR is a combination of DHIS2-11283 and DHIS2-11284 plus includes a lot of general project configuration:

  • Configure linting, formatting, CI, i18n, jest
  • Introduce required dependencies use-query-params and prop-types
  • Create a basic layout
  • Implement a basic directory structure/ project organisation
  • Introduce and auth-wall and cached-resources-provider

A few points to take into consideration when reviewing:

  • The directory structure might still change quite a bit over time. What I have tried to do is to organise things "by-function". The app has three distinct sections, a context-selector (top bar), a data-workspace (main content), and an action-bar (bottom bar). These sections will be implemented as components, and all corresponding sub-components will be colocated with these main components. In this particular app I do not expect a lot of components to emerge that are shared across these three sections, but if the do I guess I'll just add a shared folder in the src dir.
  • This app only has a single view, so we don't really need a router. We do want to be able to deeplink, so I want the current context-selection-state to be reflected in the query parameters. Hence the inclusion of use-query-params.
  • The purpose of the cached-resources provider is not really to reduce network traffic because I am counting on the app-platform to do client side caching soon. It's more to reduce cognitive overhead. Some data is read-only and can be regarded as static from the perspective of the app and it makes sense to just fetch this once the app loads and ensure it is directly available to all components once the app has loaded. This way we don't have to continuously take a loading or error state into account.

@HendrikThePendric HendrikThePendric self-assigned this Jun 16, 2021
Copy link
Contributor

@Mohammer5 Mohammer5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO the name cached-resources is not really descriptive, it's rather technical. Also, it's not really caching, it's just a wrapper for loading the values and providing them to the rest of the app via context, The data itself is actually "meta data", unfortunately that term already has meaning in the dhis2 context, but it's some form of contextual data. I'm not sure myself what a better description is, but I'd like to raise awareness about this kind of naming in general (e. g. auth-wall is way more descriptive and therefore any dev knows what to expect, at least to some extend)

src/app/providers.js Outdated Show resolved Hide resolved
src/cached-resources/hooks.js Outdated Show resolved Hide resolved
src/context-selector/index.js Outdated Show resolved Hide resolved
Co-authored-by: Jan-Gerke Salomon <Mohammer5@users.noreply.github.com>
@HendrikThePendric HendrikThePendric merged commit 80b808d into master Jun 16, 2021
@HendrikThePendric HendrikThePendric deleted the DHIS2-11283-11284-project-config-file-structure-and-layout branch June 16, 2021 20:20
dhis2-bot added a commit that referenced this pull request Jun 16, 2021
# 1.0.0 (2021-06-16)

### Features

* general configuration, application layout and directory structure ([#1](#1)) ([80b808d](80b808d))
@dhis2-bot
Copy link
Contributor

🎉 This PR is included in version 1.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants