-
Notifications
You must be signed in to change notification settings - Fork 81
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
Frontend Modularization Planning #398
Comments
Thanks for sharing the plan for the migration! I have a few questions for clarification:
|
Hello @nikpodsh , thanks for the feedback, regarding the asked question:
|
I have updated the ticket with a section for adding a new module |
Nice @AmrSaber
|
Hey @dlpzx , I have some comments on what you said...
|
After consulting with Raul (Senior SDE) he had the following comments:
|
I have updated the planning once again to reflect the latest feedback from Raul. |
Hi @AmrSaber, thanks for the update.
|
Hi @dlpzx I totally agree with you about the Also, same thing about the |
### Feature or Bug-fix <!-- please choose --> - Feature ### Detail - I am working as we agreed on the planning mentioned below - First step I took is to unify all the exports and make most of them into named exports (so it's easier to move things around and to have each directory's export aggregated to be imported from its main directory) - I am trying to make the commit meaningful so that they can be reviewed individually, but that does not always work, as there is a lot of moving things around - I created a branch out of `modularization-main` called `modularization/frontend` and made it the target of this PR so that FE updates are separated as we agreed **Important note**: This PR does not contain any logic updates whatsoever, only moving things around, and updating their export/import with a minor exception of inlining the -previously- component `Topics` which is now updated to be just an array and moved to constants. ### Relates - #398 --- By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. --------- Co-authored-by: Raul Cajias <[email protected]>
### Feature or Bugfix - Refactoring ### Detail - Modularize notebooks - Move notebooks views into notebooks module - Move services that were only used by notebooks into notebooks module - Move notebooks components into notebooks module ### Relates - #398 --- By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
### Feature or Bugfix - Refactoring ### Detail - Setup frontend (React) modules absolute imports using jsconfig.json ### Relates - #398 By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
### Feature or Bugfix <!-- please choose --> - Refactoring ### Detail - create a 'shared' directory for shared components ### Relates - #398 By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
### Feature or Bugfix <!-- please choose --> - Bugfix ### Detail - compilation error when using absolute import ### Relates - #398 By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
### Feature or Bugfix - Refactoring ### Detail - Modularized Dashboards folder into views, components and services subfolders - Refactored relative imports used in the module to use absolute paths - Removed unused scripts: `services/graphql/Dashboard/createDashboard.js` and `services/graphql/Dashboard/shareDashboard.js` - Updated routes to reflect new file paths ### Relates - #398 By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
### Feature or Bugfix - Refactoring ### Detail - Pipelines modularization into views, components and services - Refactored relative imports used in the module to use absolute paths - Removed unused scripts from services/graphql/Pipelines - Updated routes to reflect new file paths ### Relates - #398 By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
### Feature or Bugfix <!-- please choose --> - Refactoring ### Details - Organizations modularization into views, components and services - Refactored relative imports used in the module to use absolute paths - Removed unused scripts from services/graphql/Organizations - Updated routes to reflect new file paths ### Relates - #398 By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
### Feature or Bugfix <!-- please choose --> - Refactoring ### Detail - Move folder views into Folders module - Move services that were only used by Folders into Folders module - Move Folders components into Folders module ### Relates - [Frontend modularization](#398) By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
### Feature or Bugfix - Refactoring ### Detail - Modularized worksheets folder into components, views and services - Refactored relative imports used in the module to use absolute paths - Removed unused scripts - Updated routes to reflect new file paths - Added module enablement option to routes and sidebar ### Relates - #398 By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
### Feature or Bugfix - Refactoring ### Detail - Modularized Shares folder into components, views and services - Refactored relative imports used in the module to use absolute paths - Removed unused component: `ShareInboxTable.js` - Updated routes to reflect new file paths ### Relates - #398 By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
### Feature or Bugfix <!-- please choose --> - Refactoring ### Detail - fix linting issues in modules: Organizations, Dashboards, Pipelines ### Relates - [Frontend modularization](#398) By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
### Feature or Bugfix - Refactoring ### Detail - Tables folder modularization into views, components and services - Refactored relative imports used in the module to use absolute paths - Removed unused component - Updated routes to reflect new file paths ### Relates - #398 By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
### Feature or Bugfix <!-- please choose --> - Refactoring ### Detail - Align coding style in exporting components ### Relates - [Frontend modularization](#398) By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
### Feature or Bugfix <!-- please choose --> - Refactoring ### Detail - Move catalog views into catalog module - Move services that were only used by catalog into catalog module - Move catalogs components into catalog module ### Relates - [Frontend modularization](#398) By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
### Feature or Bugfix - Refactoring ### Detail - Modularise administration folder into components, views and services - Refactored relative imports used in the module to use absolute paths - Removed unused service: getUserRoleInTenant - Updated routes to reflect new file paths ### Relates - #398 By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
### Feature or Bugfix - Refactoring ### Detail - Cleanup imports to use absolute method ### Relates - #398 By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
### Feature or Bugfix <!-- please choose --> - Refactoring ### Detail - Move Environments views into Environments module - Move services that were only used by Environments into Environments module - Move Environments components into Environments module ### Relates - [Frontend modularization](#398) By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. --------- Co-authored-by: Nikita Podshivalov <[email protected]>
### Feature or Bugfix - Refactoring ### Detail - Modularized Glossaries folder into components, views and services - Refactored relative imports used in the module to use absolute paths - Removed unused scripts - Updated routes to reflect new file paths ### Relates - #398 By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
### Feature or Bugfix - Refactoring ### Detail - Moved Login view to the authentication module - Refactored imports ### Relates - #398 By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
### Feature or Bugfix <!-- please choose --> - Refactoring ### Detail - Refactor module enablement ### Relates - #398 By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
### Feature or Bugfix <!-- please choose --> - Merge request ### Detail - Merge modularization-main into modularization/frontend ### Relates - #398 By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license. --------- Co-authored-by: Amr Saber <[email protected]> Co-authored-by: Raul Cajias <[email protected]> Co-authored-by: nikpodsh <[email protected]> Co-authored-by: Maryam Khidir <[email protected]> Co-authored-by: Nikita Podshivalov <[email protected]>
### Feature or Bugfix <!-- please choose --> - Feature ### Detail - module enablement for `datasets`, `catalog`, and `glossaries` ### Relates - #398 By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Frontend Modularization Plan
Current Frontend Structure
The current structure of the frontend application is as follows
As you see, the files are structure based on their logical properties, and not based on their module. But a lot of the directories already contains common code used by different parts of the application that we could consider modules, we will make use of that fact later on.
The Problem With The Current Structure
The project is currently structured in a manner that describes the "What" of each component of the code. As the scope and the size of the project get bigger and bigger, this structure gets in the way of contributing to the project because of 2 problems:
Because of this, we agreed that we will split the project into meaningful modules, so that contributing to an existing module is almost trivial, you will know exactly what files are related to that module. And also adding a new module will be a well defined process so that the project is kept organized.
Modular Structure
The description of each of the new directory is as follows:
This structure organizes the files depending on the "Why" that's why common functionality are not just grouped into
common
but they are moved into a directory that describes the functionality they provide, such as (authentication, design, errors, and services).Notes
views
(screens)components
,hooks
, andservices
) directories are for their respective parts of the code that are only used inside this moduleMisc
module that groups all the views (screens) that are not grouped into a modulesrc
except formodules
must contain anindex.js
file that exports the directory's content. This is to simplify importing different parts of the code, and also to keep implementation details and internal structure of each directory hidden from its consumersglobalError
directory, and in the future it can be removed entirely and be replaced with a context that does the same thingservices
as it is used to call BE's API and not expose FE's API, so the nameservice
has better description of its purpose and to make it less confusingMigration Steps
First Step
To adopt the new structure by:
api
,components
,contexts
,hooks
,icons
,store
,theme
) into the new structure that focuses on the purpose of each file as described aboveviews
to be undersrc/modules/Misc/views
Next N Steps
For the N modules we agree upon, we make the following:
src/modules/Misc/Views
intosrc/modules/ModuleName/views
src/router.js
to use the new path of the viewsLast Step
Finalize
Misc
module after all the other modules are decided and have been split by:Misc
module intoMisc
moduleFiles Naming Conventions
The current convention will be kept, and that is:
Adding a New Module
In the future, if someone wants to add a new module, they should follow these steps:
src/modules
views
directorysrc/routes.js
src/utils
unless it's a helper that is super specific to this module, then it can be in the same directory as the module underhelpers
orutils
src/modules
) then no extra action is requiredAll created files and directories must follow the mentioned naming conventions
Notes
The text was updated successfully, but these errors were encountered: