# Exodus Mobile DX Improvement Plan ## Table of Contents 1. [Minimal feature grouping](#minimal-feature-grouping) 1. [Logging improvements](#logging-improvements) 1. [Cloud tACKs](#cloud-tacks) 1. [Replace Metro Transformer](#replace-metro-transformer) 1. [Replace ESLint/Prettier with Biome](#replace-eslintprettier-with-biome) 1. [Use Bun as Test Runner](#use-bun-as-test-runner) 1. [QA Automation](#qa-automation) 1. [Split Tests into Unit, E2E, and Performance](#split-tests-into-unit-e2e-and-performance) 1. [Clean Up Tests logs](#clean-up-tests-logs) 1. [Run Tests in Parallel](#run-tests-in-parallel) 1. [Reduce Babel transformations to only required](#reduce-babel-transformations-to-only-required) 1. [Use ESBuild to minify instead of uglify](#use-esbuild-to-minify-instead-of-uglify) 1. [Clean Build Scripts in src/package.json](#clean-build-scripts-in-srcpackagejson) 1. [Enhanced Use of DEBUG Environment Variable](#enhanced-use-of-debug-environment-variable) 1. [Document Debugging Methods](#document-debugging-methods) 1. [SafeReport Toolings Enhancement](#safereport-toolings-enhancement) 1. [Automate Package Building with GitHub Actions](#automate-package-building-with-github-actions) 1. [Improve Android Emulator Reliability](#improve-android-emulator-reliability) 1. [Explore Alternative Technologies and Practices](#explore-alternative-technologies-and-practices) 1. [Stability and Performance Improvements](#stability-and-performance-improvements) ## Minimal feature grouping - Local, gitignored env/config file to specify which features are enabled, to make the ones you're working on fast - **TODO**: First, try it out with some feature-set, e.g., for the exchange team, to see if it's worth it - Features in the SDK: can check the dependency graph. We can try to do it dynamically, or pre-create a bunch for different teams - NFTs team: Enable NFTs, disable everything else... except features upstream of NFTs - Exchange team: Enable exchange, disable everything else... except features upstream of exchange - Mocking network requests - Measure with/without network mocking, decide whether to explore further - V2: Don't transpile/bundle anything that's not needed | Criteria | Description | | ----------------- |:------------------------------------------------------- | | Possible Benefits | Faster development times, easier troubleshooting | | Blockers | None | | Effort Required | High | | Status | Research | | Priority | | ## Logging improvements Context: Some random package can pollute logs globally - [x] Hijack console.log and reroute to the `console:log|warn|error` namespace using the `debug` package - [x] ~~use `DEBUG` for log filtering.~~ A config file has been implemented instead. ~~- [ ] Make debug.enable() accessible from the console - Tested this and it didn't work.~~ - [x] DEBUG=* enables logs for metro itself as it's running (biblical flood) AND for the Exodus app. We should separate those. ~~- [ ] Inform developer about DEBUG value early in startup, with colours. - Not necessary now that we have a configuration file~~ - [x] DEBUG value caching issue solved with new configuration file ~~- [ ] Command line utility to hot reload with a new DEBUG scope~~ - [x] Debug config file that can be updated and hotreloaded with new scope - [x] Log levels, ie. log whould also show warn and error. warn whould show warn and error. - [x] Adjust log settings to minimize UI disruption from warnings, including setting `LOG_BOX_MINI=true` and managing the YellowBox ignore list. - [x] Truncate long messages - [x] Format JSON in messages - [x] Provide link/command near truncated messages to see the full messages - [x] Deduplication: Don't see the same statement multiple times - [x] Propose a standardized format for console warnings to include team handles. - [x] Make log truncation and console.log file creation optional - [x] Provide the ability to control LogBox notifications via dev pref file and developer menu - [ ] Combine dev-preferences with debug-namespaces - [ ] Use the dev-preferences template for default values | Criteria | Description | | ----------------- |:----------------------------------------- | | Possible Benefits | Cleaner log output, easier error tracking | | Blockers | None | | Effort Required | Medium | | Status | | | Priority | High | ## Cloud tACKs Figure out what's missing for this to work and take it over the finish line https://github.com/ExodusMovement/exodus-mobile/pull/17448 Stretch goal: Use something like appetize.io so people can test in a simulator in the browser | Criteria | Description | | ----------------- |:------------------------------------------------------------- | | Possible Benefits | Improved remote testing capabilities, faster iteration cycles | | Blockers | None | | Effort Required | High | | Status | In progress | | Priority | | ## Replace Metro Transformer **TODO**: Open an issue with current blockers and keep it updated Goals: - Improve transpilation perf: Need to first measure this - Improve runtime perf: Whether modern features are actually faster - Simplify build pipeline - Sourcemaps would get simplified, debugging should be simpler/more accurate Main blockers: - [MAJOR] Limited Hermes features: https://github.com/facebook/hermes/blob/main/doc/Features.md - JSX | Criteria | Description | | ----------------- |:------------------------------------------------------------ | | Possible Benefits | Improved build and runtime performance, simplified debugging | | Blockers | Limited support in Hermes, dependency on JSX | | Effort Required | High | | Status | Initial research | | Priority | | ## Replace ESLint/Prettier with Biome [biome](https://biomejs.dev/) | Criteria | Description | | ----------------- |:-------------------------------------------------------------------------- | | Possible Benefits | Potential for improved linting performance, streamlined code quality tools | | Blockers | Compatibility with custom plugins | | Effort Required | Medium | | Status | Initial research | | Priority | Low | ## Use Bun as Test Runner Previous attempt: https://github.com/ExodusMovement/exodus-hydra/pull/3944 Test runtime is 6m on mobile, 1m in hydra. There's a possibility of 10x improvement. | Criteria | Description | | ----------------- |:------------------------------------------------------ | | Possible Benefits | Faster test execution, improved developer productivity | | Blockers | Current test suite setup | | Effort Required | Medium | | Status | Initial research | | Priority | Low | ## QA Automation Contribute to Maestro to make finding elements by testId easier https://maestro.mobile.dev/ | Criteria | Description | | ----------------- |:------------------------------------------------------------------ | | Possible Benefits | Improved test automation capabilities, easier maintenance of tests | | Blockers | None | | Effort Required | Medium | | Status | | | Priority | | ## Split Tests into Unit, E2E, and Performance | Criteria | Description | | ----------------- |:--------------------------------------------------- | | Possible Benefits | Better test organization, focused test environments | | Blockers | None | | Effort Required | Medium | | Status | | | Priority | | ## Clean Up Tests logs | Criteria | Description | | ----------------- |:------------------------------------------- | | Possible Benefits | Cleaner logs, reduced noise in test outputs | | Blockers | None | | Effort Required | Medium | | Status | | | Priority | | ## Run Tests in Parallel | Criteria | Description | | ----------------- |:------------------------------------------- | | Possible Benefits | Faster test runs, improved CI/CD throughput | | Blockers | None | | Effort Required | Medium | | Status | | | Priority | | ## Reduce Babel transformations to only required | Criteria | Description | | ----------------- |:--------------------------------------------- | | Possible Benefits | Reduced build times, optimized resource usage | | Blockers | None | | Effort Required | Medium | | Status | Initial research | | Priority | | ## Use ESBuild to minify instead of uglify | Criteria | Description | | ----------------- |:--------------------------------------------------- | | Possible Benefits | Faster minification, potentially better performance | | Blockers | None | | Effort Required | Low | | Status | Initial research | | Priority | | --- ## Clean Build Scripts in src/package.json - Review and document the build commands in `src/package.json`. - Add a new command for building a prod-like app for debugging that includes `PROD=true` and `scripts/touch-google-services.sh prod`. | Criteria | Description | | ----------------- |:-------------------------------------------------------- | | Possible Benefits | Simplifies the build process, improves build consistency | | Blockers | None | | Effort Required | Moderate (requires updating scripts and documentation) | | Status | | | Priority | | ## Enhanced Use of DEBUG Environment Variable - Implement a method to apply `DEBUG` settings in real-time, without needing to restart the metro server. | Criteria | Description | | ----------------- |:-------------------------------------------------- | | Possible Benefits | Faster debugging, increased developer productivity | | Blockers | None | | Effort Required | | | Status | Completed | | Priority | | ## Document Debugging Methods - Create comprehensive documentation for the `DEBUG` environment variable, hydra debug API, global exodus object, and other debugging tools and code snippets. | Criteria | Description | | ----------------- |:-------------------------------------------- | | Possible Benefits | Improved onboarding and debugging efficiency | | Blockers | None | | Effort Required | | | Status | | | Priority | | ## SafeReport Toolings Enhancement - Continue development of the SafeReport dashboard and related tools to better support customer issue debugging. | Criteria | Description | | ----------------- |:----------------------------------------------------------- | | Possible Benefits | Enhanced capability to diagnose and resolve customer issues | | Blockers | None | | Effort Required | | | Status | | | Priority | | ## Automate Package Building with GitHub Actions - Set up GitHub Actions to automate the building and publishing of platform packages. | Criteria | Description | | ----------------- |:------------------------------------------------------ | | Possible Benefits | Streamlined development process, reduced manual errors | | Blockers | None | | Effort Required | | | Status | | | Priority | | ## Improve Android Emulator Reliability - Address issues with the Android emulator startup process to ensure consistency and reliability. | Criteria | Description | | ----------------- |:---------------------------------- | | Possible Benefits | More reliable testing environments | | Blockers | None | | Effort Required | | | Status | | | Priority | | ## Explore Alternative Technologies and Practices - Assess the feasibility and benefits of switching to or incorporating features from Expo, focusing on support for extra modules and system stability. | Criteria | Description | | ----------------- |:------------------------------------------------------------ | | Possible Benefits | Easier management of native dependencies, enhanced stability | | Blockers | None | | Effort Required | | | Status | | | Priority | | ## Stability and Performance Improvements - Address frequent app crashes, particularly on refresh, and investigate causes of performance issues with older test wallets. - Explore alternatives for package management to resolve issues with `node_modules` cleanup, potentially moving to yarn berry with a legacy linker. | Criteria | Description | | ----------------- |:---------------------------------------- | | Possible Benefits | Improved app reliability and performance | | Blockers | None | | Effort Required | | | Status | | | Priority | |