Skip to content

Commit 210fd1d

Browse files
sethkfmanchrisleewilcoxmetamaskbotjoaoloureirop
authored
fix: remove expo changes (#13067)
## **Description** This PR revert the EXPO commit from 7.38.0 release. This commit was identified as causing performance issues. ## **Related issues** Fixes: ## **Manual testing steps** 1. Go to this page... 2. 3. ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> ## **Pre-merge author checklist** - [ ] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots. --------- Co-authored-by: CW <[email protected]> Co-authored-by: metamaskbot <[email protected]> Co-authored-by: João Loureiro <[email protected]>
1 parent dba4661 commit 210fd1d

File tree

66 files changed

+983
-3003
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+983
-3003
lines changed

.depcheckrc.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,3 @@ ignores:
8484
- 'app'
8585
- 'i18n-js'
8686
- 'images'
87-
88-
## Expo
89-
- '@config-plugins/detox'
90-
- 'cross-spawn'
91-
- 'expo-build-properties'
92-
- 'expo-dev-client'
93-

.eslintrc.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ module.exports = {
6060
},
6161
},
6262
{
63-
files: ['scripts/**/*.js', 'app.config.js'],
63+
files: ['scripts/**/*.js'],
6464
rules: {
6565
'no-console': 0,
6666
'import/no-commonjs': 0,
@@ -76,7 +76,7 @@ module.exports = {
7676
{
7777
files: [
7878
'app/components/UI/Name/**/*.{js,ts,tsx}',
79-
'app/components/hooks/DisplayName/**/*.{js,ts,tsx}'
79+
'app/components/hooks/DisplayName/**/*.{js,ts,tsx}',
8080
],
8181
rules: {
8282
'no-restricted-syntax': [
@@ -91,7 +91,7 @@ module.exports = {
9191
'selectProviderType',
9292
'selectRpcUrl',
9393
'selectSelectedNetworkClientId',
94-
'selectTicker'
94+
'selectTicker',
9595
]
9696
.map((method) => `(${method})`)
9797
.join('|')}/]`,

.github/scripts/tsconfig.json

Lines changed: 1 addition & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,3 @@
11
{
2-
"compilerOptions": {
3-
/* Basic Options */
4-
"target": "esnext" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017','ES2018' or 'ESNEXT'. */,
5-
"module": "commonjs" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */,
6-
"lib": [
7-
"es2017",
8-
] /* Specify library files to be included in the compilation. */,
9-
"allowJs": true /* Allow javascript files to be compiled. */,
10-
// "checkJs": true, /* Report errors in .js files. */
11-
"jsx": "react-native" /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */,
12-
// "declaration": true, /* Generates corresponding '.d.ts' file. */
13-
// "sourceMap": true, /* Generates corresponding '.map' file. */
14-
// "outFile": "./", /* Concatenate and emit output to single file. */
15-
// "outDir": "./", /* Redirect output structure to the directory. */
16-
// "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
17-
// "removeComments": true, /* Do not emit comments to output. */
18-
"noEmit": true /* Do not emit outputs. */,
19-
// "incremental": true, /* Enable incremental compilation */
20-
// "importHelpers": true, /* Import emit helpers from 'tslib'. */
21-
// "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
22-
"isolatedModules": true /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */,
23-
/* Strict Type-Checking Options */
24-
"strict": true /* Enable all strict type-checking options. */,
25-
// "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */
26-
// "strictNullChecks": true, /* Enable strict null checks. */
27-
// "strictFunctionTypes": true, /* Enable strict checking of function types. */
28-
// "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */
29-
// "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */
30-
// "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */
31-
/* Additional Checks */
32-
// "noUnusedLocals": true, /* Report errors on unused locals. */
33-
// "noUnusedParameters": true, /* Report errors on unused parameters. */
34-
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
35-
// "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */
36-
/* Module Resolution Options */
37-
"moduleResolution": "node" /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */,
38-
"resolveJsonModule": true /* Allows importing JSON files */,
39-
"baseUrl": "." /* Base directory to resolve non-absolute module names. */,
40-
/* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */
41-
// "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */
42-
// "typeRoots": [], /* List of folders to include type definitions from. */
43-
// "types": [], /* Type declaration files to be included in compilation. */
44-
"allowSyntheticDefaultImports": true /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */,
45-
"esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */,
46-
// "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */
47-
"skipLibCheck": true /* Skip type checking of declaration files. */
48-
/* Source Map Options */
49-
// "sourceRoot": "./", /* Specify the location where debugger should locate TypeScript files instead of source locations. */
50-
// "mapRoot": "./", /* Specify the location where debugger should locate map files instead of generated locations. */
51-
// "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */
52-
// "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */
53-
/* Experimental Options */
54-
// "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */
55-
// "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */
56-
},
57-
"exclude": [
58-
"node_modules",
59-
"jest.config.js"
60-
]
2+
"extends": "../../tsconfig.json"
613
}

.gitignore

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ DerivedData
2323
project.xcworkspace
2424
ios/debug.xcconfig
2525
ios/release.xcconfig
26-
.xcode.env.local
2726

2827
# android / intellij
2928
build/
@@ -131,8 +130,4 @@ docs/assets/termsOfUse.html
131130
android/app/src/main/assets/modules.json
132131

133132
# Google firebase base64 derived configs
134-
**/GoogleService-Info.plist
135-
# Expo
136-
.expo
137-
dist/
138-
web-build/
133+
**/GoogleService-Info.plist

README.md

Lines changed: 9 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ To learn how to contribute to the MetaMask codebase, visit our [Contributor Docs
1515
## Documentation
1616

1717
- [Architecture](./docs/readme/architecture.md)
18-
- [Expo Development Environment Setup](./docs/readme/expo-environment.md)
19-
- [Native Development Environment Setup](./docs/readme/environment.md)
18+
- [Development Environment Setup](./docs/readme/environment.md)
2019
- [Build Troubleshooting](./docs/readme/troubleshooting.md)
2120
- [Testing](./docs/readme/testing.md)
2221
- [Debugging](./docs/readme/debugging.md)
@@ -25,67 +24,13 @@ To learn how to contribute to the MetaMask codebase, visit our [Contributor Docs
2524

2625
## Getting started
2726

28-
### Using Expo (recommended)
27+
### Environment setup
2928

30-
Expo is the fastest way to start developing. With the Expo framework, developers don't need to compile the native side of the application as before, hence no need for any native enviornment setup, developers only need to download a precompiled develpoment build and run the javascript bundler. The development build will then connect with the bundler to load the javascript code.
31-
32-
#### Expo Environment Setup
33-
34-
[Install node, yarn and watchman.](./docs/readme/expo-environment.md)
35-
36-
#### Clone the project
37-
38-
```bash
39-
git clone [email protected]:MetaMask/metamask-mobile.git && \
40-
cd metamask-mobile
41-
```
42-
43-
#### Install dependencies
44-
45-
```bash
46-
yarn setup:expo
47-
```
48-
49-
#### Run the bundler
50-
51-
```bash
52-
yarn watch
53-
```
54-
55-
#### Download and install the development build
56-
57-
#### For internal developers
58-
- Access Runway via Okta and go to the Expo bucket either on the iOS or Android section. From there you will see the available development builds (android-expo-dev-build.apk or ios-expo-dev-build.ipa).
59-
- For Android:
60-
- Install the .apk on your Android device or simulator.
61-
- For iOS:
62-
- Device: you need to have your iPhone registered with our Apple dev account. If you have it, you can install the .ipa on your device.
63-
- Simulator: please follow the [native development section](https://github.com/MetaMask/metamask-mobile?tab=readme-ov-file#native-development) and run `yarn setup` and `yarn start:ios` as the .ipa will not work for now, we are working on having an .app that works on simulators.
64-
65-
##### [SOON] For external developers (we are testing the new dev builds and will make them publicly available soon after)
66-
67-
#### Load the app
68-
69-
If on a simulator:
70-
- use the initial expo screen that appears when starting the development to choose the bundler url
71-
- OR press "a" for Android or "i" for iOS on the terminal where the bundler is running
72-
73-
If on a physical device:
74-
- Use the camera app to scan the QR code presented by the bundler running on the terminal
75-
76-
That's it! This will work for any javascript development, if you need to develop or modify native code please see the next section.
77-
78-
### Native Development
79-
80-
If developing or modifying native code or installing any library that introduces or uses native code, it is not possible to use an Expo precompiled development build as you need to compile the native side of the application again. To do so, please follow the steps stated in this section.
81-
82-
#### Native Environment setup
83-
84-
Before running the app for native development, make sure your development environment has all the required tools. Several of these tools (ie Node and Ruby) may require specific versions in order to successfully build the app.
29+
Before running the app, make sure your development environment has all the required tools. Several of these tools (ie Node and Ruby) may require specific versions in order to successfully build the app.
8530

8631
[Setup your development environment](./docs/readme/environment.md)
8732

88-
#### Building the app
33+
### Building the app
8934

9035
**Clone the project**
9136

@@ -94,16 +39,16 @@ git clone [email protected]:MetaMask/metamask-mobile.git && \
9439
cd metamask-mobile
9540
```
9641

97-
##### Firebase Messaging Setup
42+
#### Firebase Messaging Setup
9843

9944
MetaMask uses Firebase Cloud Messaging (FCM) to enable app communications. To integrate FCM, you’ll need configuration files for both iOS and Android platforms.
10045

101-
###### Internal Contributor instructions
46+
##### Internal Contributor instructions
10247

10348
1. Grab the `.js.env` file from 1Password, ask around for the correct vault. This file contains the `GOOGLE_SERVICES_B64_ANDROID` and `GOOGLE_SERVICES_B64_IOS` secrets that will be used to generate the relevant configuration files for IOS/Android.
10449
2. [Install](./README.md#install-dependencies) and [run & start](./README.md#running-the-app) the application as documented below.
10550

106-
###### External Contributor instructions
51+
##### External Contributor instructions
10752

10853
As an external contributor, you need to provide your own Firebase project configuration files:
10954
- **`GoogleService-Info.plist`** (iOS)
@@ -132,15 +77,15 @@ export GOOGLE_SERVICES_B64_IOS="$(base64 -w0 -i ./ios/GoogleServices/GoogleServi
13277
In case of any doubt, please follow the instructions in the link below to get your Firebase project config file.
13378
[Firebase Project Quickstart](https://firebaseopensource.com/projects/firebase/quickstart-js/messaging/readme/#getting_started)
13479

135-
##### Install dependencies
80+
#### Install dependencies
13681

13782
```bash
13883
yarn setup
13984
```
14085

14186
_Not the usual install command, this will run scripts and a lengthy postinstall flow_
14287

143-
#### Running the app for native development
88+
### Running the app
14489

14590
**Run Metro bundler**
14691

android/app/build.gradle

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,6 @@ react {
4747
//
4848
// The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
4949
// hermesFlags = ["-O", "-output-source-map"]
50-
//
51-
// Added by install-expo-modules
52-
entryFile = file(["node", "-e", "require('expo/scripts/resolveAppEntry')", rootDir.getAbsoluteFile().getParentFile().getAbsolutePath(), "android", "absolute"].execute(null, rootDir).text.trim())
53-
cliFile = new File(["node", "--print", "require.resolve('@expo/cli')"].execute(null, rootDir).text.trim())
54-
bundleCommand = "export:embed"
5550
}
5651

5752
// Override default React Native to generate source maps for Hermes

android/app/src/main/AndroidManifest.xml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@
7676
<data android:host="metamask-alternate.app.link" />
7777
<data android:host="metamask.test-app.link" />
7878
<data android:host="metamask-alternate.test-app.link" />
79-
<data android:scheme="expo-metamask" />
8079
</intent-filter>
8180
<!-- Branch URI Scheme -->
8281
<intent-filter>
@@ -115,12 +114,6 @@
115114
<category android:name="android.intent.category.DEFAULT" />
116115
<category android:name="android.intent.category.BROWSABLE" />
117116
</intent-filter>
118-
<intent-filter>
119-
<data android:scheme="expo-metamask" />
120-
<action android:name="android.intent.action.VIEW" />
121-
<category android:name="android.intent.category.DEFAULT" />
122-
<category android:name="android.intent.category.BROWSABLE" />
123-
</intent-filter>
124117
</activity>
125118
<!-- Explicitly opt-in to safe browsing -->
126119
<meta-data android:name="android.webkit.WebView.EnableSafeBrowsing" android:value="true" />

android/app/src/main/java/io/metamask/MainActivity.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
package io.metamask;
2-
import expo.modules.ReactActivityDelegateWrapper;
32

43
import com.facebook.react.ReactActivity;
54
import com.facebook.react.ReactActivityDelegate;
@@ -63,7 +62,7 @@ public void onNewIntent(Intent intent) {
6362
*/
6463
@Override
6564
protected ReactActivityDelegate createReactActivityDelegate() {
66-
return new ReactActivityDelegateWrapper(this, BuildConfig.IS_NEW_ARCHITECTURE_ENABLED, new DefaultReactActivityDelegate(this, getMainComponentName(), DefaultNewArchitectureEntryPoint.getFabricEnabled()) {
65+
return new DefaultReactActivityDelegate(this, getMainComponentName(), DefaultNewArchitectureEntryPoint.getFabricEnabled()) {
6766
@Override
6867
protected Bundle getLaunchOptions() {
6968
Bundle initialProperties = new Bundle();
@@ -74,6 +73,6 @@ protected Bundle getLaunchOptions() {
7473
}
7574
return initialProperties;
7675
}
77-
});
76+
};
7877
}
7978
}

android/app/src/main/java/io/metamask/MainApplication.java

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
package io.metamask;
2-
import android.content.res.Configuration;
3-
import expo.modules.ApplicationLifecycleDispatcher;
4-
import expo.modules.ReactNativeHostWrapper;
52

63
import android.app.Application;
74
import com.facebook.react.ReactApplication;
@@ -40,7 +37,7 @@ public String getFileProviderAuthority() {
4037
return BuildConfig.APPLICATION_ID + ".provider";
4138
}
4239

43-
private final ReactNativeHost mReactNativeHost = new ReactNativeHostWrapper(this, new DefaultReactNativeHost(this) {
40+
private final ReactNativeHost mReactNativeHost = new DefaultReactNativeHost(this) {
4441
@Override
4542
public boolean getUseDeveloperSupport() {
4643
return BuildConfig.DEBUG;
@@ -71,9 +68,9 @@ protected Boolean isHermesEnabled() {
7168

7269
@Override
7370
protected String getJSMainModuleName() {
74-
return ".expo/.virtual-metro-entry";
71+
return "index";
7572
}
76-
});
73+
};
7774

7875
@Override
7976
public ReactNativeHost getReactNativeHost() {
@@ -115,12 +112,5 @@ public void onCreate() {
115112
}
116113

117114
ReactNativeFlipper.initializeFlipper(this, getReactNativeHost().getReactInstanceManager());
118-
ApplicationLifecycleDispatcher.onApplicationCreate(this);
119-
}
120-
121-
@Override
122-
public void onConfigurationChanged(Configuration newConfig) {
123-
super.onConfigurationChanged(newConfig);
124-
ApplicationLifecycleDispatcher.onConfigurationChanged(this, newConfig);
125115
}
126116
}

android/app/src/main/res/xml/react_native_config.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
<domain includeSubdomains="false">10.0.2.2</domain>
77
<domain includeSubdomains="false">10.0.3.2</domain>
88
</domain-config>
9-
<base-config cleartextTrafficPermitted="${isDebug}" />
9+
<base-config cleartextTrafficPermitted="false" />
1010
</network-security-config>

0 commit comments

Comments
 (0)