WIP: Modularizing a Non-Modularized Project
This guide is currently work in progress, as project developers gather more and more information during modularizing a non-modularized project.
If you have suggestions or additional details, please use the “Feedback” button at the bottom of this page or contact us via the ticket system or another appropriate channel.
This guide describes how to migrate a customized monolithic project to a modular architecture.
Recommended Strategy
While it's best to design customer projects as modular from the beginning, the following staged approach can be used to modularize an existing not modularized project:
-
Extract Custom Code
Move all customer-specific implementations into a dedicated module that is clearly separated from the ADITO xRM standard code. -
Replace Standard xRM with Modularized xRM
Integrate the modularized version of the ADITO xRM (available as of version 2024.1.0). This allows easier updates via individual modules. -
Split the Custom Module (Optional)
If needed, further divide the customer module into smaller, domain-specific modules at a later point.
You do not need to include all modules at once.
Begin with a small set of modules. Also remember to add each module’s peerDependencies to your project’s dependencies.
Start with modules where you made little to no customization. In those cases, you can usually adopt the standard libraries with minimal or no changes.
For modules with significant customization, you must integrate your changes using Modifications, Extension Points, and Services. This is more complex work, so postpone these modules or skip them initially.
Upgrading to Modularized Libraries
From version 2024.1.0 onwards, parts of the ADITO xRM were modularized. This includes renaming or moving functions and libraries. To support this:
- Every module provides upgrade scripts (
upgraders) located in itsothersdirectory. - These scripts help adapt function calls and import paths automatically.
Use the Designer's "Upgrade JDito..." action to adapt call sites and imports. See JDito upgraders for details.
Preparation Steps
Before running the upgrade process:
- Ensure that the libraries in the customer project match the final not modularized ADITO xRM version (2024.0.3).
- Move any changes in standard libraries to new customer-specific libraries using a consistent prefix (e.g.,
MYCUSTOMER_Person_lib). - Create matching upgrader scripts if needed to refactor customer function calls.
Only after this cleanup step can you begin the modular upgrade safely.
You also want to add your changes often to the version control system. If you are encountering issues with the upgrade process, you can always revert to a previous version.
Upgrade Process
Use the JDito upgraders to update all processes.
Prerequisites:
- Have the ADITO xRM project checked out in a compatible version on your machine.
- Run
npm installin the xRM project to install all dependencies.
Steps:
- In the customer project, run "Upgrade JDito...".
- When prompted, select the ADITO xRM project as the source of upgraders.
- Confirm to execute. The Designer runs all upgraders from the xRM project against the customer project.
Result:
- All applicable upgraders from the xRM project are applied to the customer project.
Post-Processing
After the upgrade:
- All matching imports and function calls will be replaced with those from the new modular libraries.
- Some unused imports may remain.
Run ESLint to ensure consistent formatting and to detect unused or broken imports.
Always run the Transpile and review its log to verify that all modules were compiled successfully.
Warnings and errors reported during Transpile can indicate critical issues.
Review the log and resolve all problems before proceeding. Otherwise, your project might not work as expected.