Skip to content
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

[Question] shared core codebase with different {N} frontends for mobile? #20

Open
lambourn opened this issue May 12, 2021 · 4 comments
Open

Comments

@lambourn
Copy link

I wonder if this Nx plugin could satisfy the requirement to create multiple variants of a {N} application where core parts (non-UI) are shared and the concrete variants have custom (Angular) application tier logic and UI.

The variants would need their own metadata (final app name, signing, bundle identifiers, package names, etc.) so they would come with their own build & packaging time configuration (Info.plist, AndroidManifest.xml, code signing etc.)

Would that work?

@mahmoudajawad
Copy link
Contributor

I'm working on something similar now. This is one of the reasons I'm so excited about having the ability to use nativescript with nx. Basically, you can have your business-logic abstracted as shared lib and then your apps would be simple presentational components that do only pass the input values to the business-logic shared lib, and receive back the results and present them to the user.

@sergegl
Copy link

sergegl commented May 14, 2021

I'm working on something similar now. This is one of the reasons I'm so excited about having the ability to use nativescript with nx. Basically, you can have your business-logic abstracted as shared lib and then your apps would be simple presentational components that do only pass the input values to the business-logic shared lib, and receive back the results and present them to the user.

I was thinking of separating into a base libs as well. However, since we have bunch of angular web apps, I am thinking of using web apps as the base classes for mobile apps.

@mahmoudajawad
Copy link
Contributor

@sergegl, you know your project better and can decide, but the idea of using an app as base for another seems risky for many reasons, such as, web implementations are not available in NativeScript (which you would hit sooner than later), and ending-up with much fragile codebase that tries to work with two platforms rather than having good separation of concern across the apps.

Shared lib in the other hand asserts you don't hit this issue, because you will always abstract the part of the business logic that is platform-non-independent, while keeping your platform-specific parts at apps.

@mahmoudajawad
Copy link
Contributor

@sergegl, I was able to produce a PoC. Mainly, in my team we are investigating the best approach and so far this is what we are at, though we might consider other approaches. For now, I'm sharing this with you to give you an idea about the approach I WA suggesting:
https://github.com/mahmoudajawad/nx-ns-shared

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants