Skip to content

[HybridApp] Configure HybridApp setup process and local environment #49845

Description

@Julesssss

P/S authored by @staszekscp here

Problem

One of our biggest headaches is a smooth HybridApp local setup for the developers. I noticed that maybe the most problematic part was to wrap the head around the monorepo structure, and the fact that we have to remember about updating both repositories. This is how the structure looks like:

  • 📂 Mobile-Expensify
    • 📂 Android: Expensify Classic Android specific code
    • 📂 app: Expensify Classic JavaScript logic (aka YAPL)
    • 📂 iOS: Expensify Classic iOS specific code
    • 📂 react-native: git submodule that is pointed to Expensify/App
      • 📂 android: New Expensify Android specific code (not a part of HybridApp native code)
      • 📂 ios: New Expensify iOS specific code (not a part of HybridApp native code)
      • 📂 src: New Expensify TypeScript logic

Solution

For the beginning we should create a simple bash script to recognise if we’re currently working on the HybridApp. It could look up one directory, and see if in its package.json the value for the name key is mobile-expensify. 💻

Then, let’s migrate/create the following scripts in Expensify/App repo in order to minify overhead during the transition to HybridApp.

  • setup-hybrid-app - NEW - helper script (in parent Expensify/Mobile-Expensify repo) that would do all necessary setup to start working with the HybridApp. Its responsibilities would be to:
    • help you to set your fork as the NewDot submodule’s origin
    • install dependencies for both, ND and OD
  • pull-old-dot - NEW - helper script that would go to OD repo, and pull the changes, so you don’t have to jump between directories
  • postinstall - add execution of npm i command in OldDot repo. It would also print out information if your OldDot repo is out of date, and inform you if you should run npm run pull-old-dot - the OldDot repo doesn’t change so often, so it’s easy to forget about it 😄
  • ios, pod-install, ipad, ipad-sm, android, clean - if they’re executed in the HybridApp, run the commands in the HybridApp context (eg. build/clean HybridApp, not NewDot). Otherwise let them work as before. If someone works on the HybridApp, but would like to build NewDot, we can add a --nd flag. In this way running npm run ios --nd in HybridApp would build a standalone NewDot application

By introducing or modifying the scripts I’d like to limit to the minimum unnecessary switches between OldDot and NewDot. We could stay focused on the most important work in the React Native code, but in case of emergency we could jump up, and see what’s going on in OldDot! 😄

The key takeaway is that on HybridApp we’ll build the native code from another place, therefore the android and ios folders in Expensify/App can be used only to build standalone NewDot, not the HybridApp. I know it may be a bit confusing at this moment, and we’ll point out in the README 😄 Nevertheless by using the proposed commands we should be able to minimise that problem. The android/ios folders will have to stay, though, because many OS contributors will only have access to NewDot, as it is at this moment!

Metadata

Metadata

Labels

DailyKSv2EngineeringImprovementItem broken or needs improvement.InternalRequires API changes or must be handled by Expensify staff

Type

No type
No fields configured for issues without a type.

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions