-
Notifications
You must be signed in to change notification settings - Fork 5
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
[RFC] Refactoring GFG repo #426
Comments
Please share your concerns and suggestions if any |
I agree that the above is a more maintainable structure, but refactoring this might take quite an effort so I suggest that we do this incrementally, perhaps on a page by page basis |
@jamessspanggg Agreed. This should be done incrementally. After this is approved by everyone, I will make a todo list within this issue to track what needs to changed. |
Folder structure looks good with clear purpose for each location. Just a few questions:
|
Regarding
|
After speaking to everyone. We have decided to go ahead with this major refactoring. I will put a Todo list inside this issue to keep track of the changes that we need to make over the subsequent weeks. |
Let's refactor pages first and leave the individual components alone. By doing this refactor, there might be duplicated code. It is fine because it helps with the readability of the codebase overall. But we shouldn't be afraid of having some duplicated code. |
Issue
As GFG repo continues to grow larger, the current folder structure doesn't seem be as clear and direct to a developer.
As a result, differentiating from a
dummy
component from apage
component is difficult.Suggestion
src/components
:dummy
componentssrc/pages
:page
componentssrc/pages/{pageName}/index.js
src/pages/{pageName}/components
page
components should live within hereindex.js
that exports all the components within, this is done so that importing components can be in a single linesrc/pages/components/RegisterDonor/index.js
can havesrc/pages/components/RegisterDonor/components/RegisterCard/index.js
src/pages/{pageName}/utils
src/pages/{pageName}/constants
src/utils
src/constants
Additionally, try to group the import statements based on their groups if possible, i.e.
Template to copy
Benefits
Downsides
The text was updated successfully, but these errors were encountered: