conda-incubator / conda-store-ui

conda-store-ui is a frontend for conda-store powered by react
https://conda-incubator.github.io/conda-store-ui/
BSD 3-Clause "New" or "Revised" License
14 stars 21 forks source link

[MAINT] - Maintenance refactor (not redesign) #439

Open gabalafou opened 1 month ago

gabalafou commented 1 month ago

This issue is to provide a reference URL and place to track work on refactoring the UI codebase.

This work is NOT a redesign. This is not about changing the look and feel of the current UI. It is just about making the code behind the UI easier to work with by refactoring it. To an end user, there should be no apparent change. But for people working in the code base, adding features, it should become much easier.

Currently the code base has a number of problems:

For more on the point about side effects, read the first section of React anti-patterns that lead to unnecessary complexity.

gabalafou commented 1 month ago

The approach that I plan to take:

  1. Create a new directory outside the repo using a scaffold for a React app (such as create-react-app)
  2. Copy over files from the current repo as needed
    • The idea is that I do not want to carry over cruft
    • But I will be very thorough going through the files
  3. Overwrite the current directory with the new directory
    • I will keep the new directory structure as close as possible to the old structure in order to keep history
    • But I think it is inevitable that history will be lost because part of the refactor involves changing component and module boundaries, which will require things like splitting one file out into multiple files or consolidating code across multiple files into one file.
  4. Create a new branch and push to GitHub