I’m in the design phase of a new app, but one of the main criteria is that the app will have optional modules. There are two use cases for this.
The first use case is that the app will have a couple of modules that would be included in a free version, however users that pay for additional features would get an updated module with more features.
The second use case would be modules that are not included at all in the free version.
I think the loading makes both of these easily possible, For instance if we had a “basic” reports module and an “advanced” reports module, it would be fairly easy to check the user permissions or abilities and lazy load the appropriate module using a simple if or switch statement, and have a fairly simple check inside the advanced module to ensure the user actually has the rights to load that module. The same could be done for totally optional modules.
However, does that solution add overhead (code size) to the main app? If so, how much?
Another solution could be to add switches to the build process so that only the appropriate modules are included in the build, but that has the disadvantage of requiring many different builds on our server and redirecting users to the appropriate build.
Are there best practices for this? What strategies have other developers used successfully, or even not successfully?
Should have added this I guess… Current plan is to use Ionic 4, angular, and capacitor if we feel they are usable when we need to start coding. The app will be a PWA, we have no plans for native versions. When I say a module I mean a page. The Free app might have 7 or 8 pages (modules), but sometime in the future there might be as many as 30 optional modules. That’s why I’m worried about any additional code added to the main app for each optional module