-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
feat(ci): Expo #12244
base: main
Are you sure you want to change the base?
feat(ci): Expo #12244
Conversation
Report is too large to display inline. Next stepsMark a package as acceptable riskTo ignore an alert, reply with a comment starting with
|
Bitrise❌❌❌ Commit hash: 97dfdba Note
Tip
|
Bitrise❌❌❌ Commit hash: 7f8a041 Note
Tip
|
65042e8
to
d629c06
Compare
Report too large to display inline |
Quality Gate passedIssues Measures |
Description
Problem
Right now, setting up the environment for running the MetaMask Mobile app is a major pain and a point of huge friction for developers looking to build a feature on the app. It takes hours for the first setup because of the so many tools needed to be installed which are prone to errors and problems (many times difficult to understand and debug) which causes devs, especially devs with less experience on mobile, to give up on developing on the MM Mobile app. This problem is also taking time from the Mobile team that has to help devs to debug issues and setup the app. Furthermore, every time a developer wants to run the Mobile app (after first setup), they need to compile the native part of the app which takes several minutes and is also prone to many issues with incompatibilities with the system.
Solution implemented
The work on this PR will allow major improvements in contributor experience in the MetaMask Mobile app. By integrating expo development builds, there is no more need for compiling the native part of the app meaning, devs can just install an APK on their device or simulator and load the javascript bundle. This makes the first setup and consequently runs several times faster.
The experience will be much similar to how a webapp works, but in this case the browser will be the development build, bundling and loading the javascript files is exactly the same. This means that for web/extension devs, the process will be much more familiar, and not only that but much much faster to setup and easier to understand.
Improvements in time to setup/run
Time for first setup goes from 3-4 hours to 1-2 minutes
Time for running the app goes from 4-5 mins to 1 min (and 8s for subsequently runs)
Why so much faster?
Before, the setup included everything here: https://github.com/MetaMask/metamask-mobile/blob/main/docs/readme/environment.md. Included installing several tools and apps such as xcode and android studio. This was always followed by errors and problems caused by the tools or the computer environment that were hard to understand and debug.
Now, devs can just download and install an APK and run one command
yarn expo:start
and that is it.Steps I took to integrate expo
Commit 1 c36edda
npx install-expo-modules@latest
npx expo run:ios
doesn’t run out of the box, it has to be integrated with our build.sh in order to build or dependencies. This is because it tries to run pod install but we actually install pods with bundle execute pod install.sourcecode.c.objc
withsourcecode.cpp.objcpp
as explained in Xcode build fails Property 'reactDelegate' not found on object of type 'AppDelegate *' expo/expo#20850 (comment) because of property 'reactDelegate' not found on object of type 'AppDelegate *' error.Commit 2 abcb412
#import <UIKit/UIKit.h>
with#import <objc/runtime.h> in RCTMinimizer.m
Commit 3 b181a1f
npx expo install expo-build-properties
to include the maven repos to fix an Android error. The expo build properties will be useful to implement (CNG)[https://docs.expo.dev/workflow/continuous-native-generation/]Commit 4 f586844
"expo-dev-client": "~2.4.13"
is installed"react-native-reanimated": "~3.3.0"
return [super application:application didFinishLaunchingWithOptions:launchOptions];
Commit 5 820321f
[EXDevLauncherController.sharedInstance onDeepLink:url options:options]
Commit 6 d482e09
✅ Android working
✅ iOS working
TODOs
Related issues
Fixes: #11548
Manual testing steps
These are subject to change!
yarn setup
yarn start:android:expo
oryarn start:ios:expo
yarn expo:start
and scan the QR codeScreenshots/Recordings
Before
Video so long I don't want to put it here 😂
After
expo.metamask.recording.mov
Pre-merge author checklist
Pre-merge reviewer checklist