forked from MetaMask/metamask-mobile
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Experiment/upgrade react native 66 (MetaMask#3509)
* Commit upgrade paths * Checkpoint: iOS can build * Reintroduce viewpager library with patch (deprecated) * Upgrade keyboard aware library to support new RN * Stabilize Android (WIP) need to patch react-native * Remove setting NDK. Android auto sets it based on gradle * Update build gradle + Add postinstall for react-native-codegen * Add comment for postinstall (react-native-codegen) * Remove workspace settings * Upgrade gradle versions. Fix viewpager patch. Revert to support pre-upgrade min sdk versions * Fix unit tests * update rn codegen postinstall script * Fix react-native-scrollable-tab-view with patch * Update README.md ndk section * update rn codegen postinstall script * Update pod file lock * update allow-scripts * update yarn.lock * Remove --strip-components=2 * Update ndk version to 21e * Upgrade Detox + ignore warnings * Enable Hermes. Reconfigure Flipper. * Update pods * Remove entitlements from copy resources step * Polyfill Intl for iOS for Hermes * Remove nvm related code in build phase * Remove duplicate node from homebrew * Remove engine version dependencies. Allow bitrise to use any node * Reintroduce engines in package.json * Try to unset PREFIX * Reintroduce nvm compatibility in build phase * Patch react-native-payments * Expose removeListener warnings * Patch react-native-modal removeListner * Update build number * Fix virtualization error on send flow * Update build number to 3.8.2 * Ignore EventEmitter.removeListener * Update build version for bitrise * fixing broken e2e tests * Replace drawer. Update reanimated + webview libraries. Begin fixing browser functionality. * Hook up reanimated 2 on Android * Remove traces of react navigation drawer. Refactor tutorial. * Fix display account name on drawer. * Fix patches -> fixes Android back button behavior * Update build version * Update build version to fix bitrise * Re run unit tests * Update readme with Flipper instructions * Remove requestAnimationFramea and InteractionManager that causes iOS to crash when switching networks * Update EasingNode * Hide tab bar * Fix browser deep link * Upgrade web3 in controllers to fix app hang up. * Remove isZero undefined from controllers * Handle initial and subsequent deeplinks to browser * Fix svg length undefined issue * Update build number * Fix BN function calls + patch swaps controller * Update build number * Disable Hermes for iOS. * Disable hermes for Android * Update build number * unset PREFIX on all bitrise steps * dimissing keyboard in wallet spec * addressbook,wallet,request payment fix. * update snapshots * Remove intl polyfill Co-authored-by: Ricky Miller <[email protected]> Co-authored-by: Curtis <[email protected]>
- Loading branch information
1 parent
d9757b7
commit 1f03de0
Showing
91 changed files
with
5,099 additions
and
3,078 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
*.pbxproj -text | ||
# specific for windows script files | ||
# Windows files should use crlf line endings | ||
# https://help.github.com/articles/dealing-with-line-endings/ | ||
*.bat text eol=crlf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,12 +62,7 @@ yarn watch | |
- Install the Android SDK, via [Android Studio](https://developer.android.com/studio). | ||
- _MetaMask Only:_ To create production builds, you need to install Google Play Licensing Library via the SDK Manager in Android Studio. | ||
- Install the Android NDK, via [Android Studio](https://developer.android.com/studio)'s SDK Manager. | ||
- In the SDK Manager, select the `SDK Tools` tab and install NDK version `17.2.4988734`. You'll need to click "Show Package Details" in order to select the appropriate version. | ||
- In the `android` directory, update the `local.properties` file by adding line: | ||
``` | ||
ndk.dir=/Users/YOUR_HOME_DIRECTORY/Library/Android/sdk/ndk/17.2.4988734 | ||
``` | ||
_(You may have to create local.properties if it doesn't exist.)_ | ||
- In the SDK Manager, select the `SDK Tools` tab and install NDK version `21.4.7075529`. You'll need to click "Show Package Details" in order to select the appropriate version. | ||
- Linux only: | ||
- Ensure that you have the `secret-tool` binary on your machine. | ||
- Part of the [libsecret-tools](https://launchpad.net/ubuntu/bionic/+package/libsecret-tools) package on Debian/Ubuntu based distributions. | ||
|
@@ -130,43 +125,30 @@ First, make sure you have the following running: | |
- Your Android emulator or iOS simulator | ||
- `yarn start:android` or `yarn start:ios` | ||
|
||
Next, check that the React Native Debugger is working: | ||
Next, install the [Flipper](https://fbflipper.com/) desktop app (verified working with v0.127.0) | ||
|
||
- Open your emulator or simulator, and select `Debug JS Remotely` (or something similar) from its developer menu | ||
- To open the developer menu: | ||
- iOS Simulator: `Cmd + D` | ||
- Android Emulator | ||
- macOS: `Cmd + M` - Windows, Linux: `Ctrl + M` | ||
- If it doesn't open automatically, try navigating to this URL in Chrome: http://localhost:8081/debugger-ui/ | ||
- If these steps do not take you to the React Native Debugger, something is wrong | ||
- Once Flipper is installed, configure your system as follows: | ||
- Install react-devtools: `npm i -g [email protected]` | ||
- Update Android SDK location settings by accessing Flipper's settings via the `Gear Icon` -> `Settings` | ||
- Example SDK path: `/Users/<USER_NAME>/Library/Android/sdk` | ||
|
||
#### Debugging iOS (macOS Only) | ||
Finally, check that the debugger is working: | ||
|
||
For more details, see [this page](https://medium.com/@mattcroak718/debugging-your-iphone-mobile-web-app-using-safari-development-tools-71240657c487). | ||
- Open your emulator or simulator alongside the Flipper app | ||
- Flipper should auto-detect the device and the application to debug | ||
- You should now be able to access features such as `Logs` | ||
|
||
- You should be able to inspect the mobile app using the console in the React Native Debugger in Chrome | ||
- To debug a website (dapp) in the browser: | ||
- Navigate to the website in the app's browser | ||
- Open Safari | ||
- Go to: _Preferences -> Advanced_ and select `Show Develop menu in menu bar` | ||
- Select `Develop` in the menu bar | ||
- Find your simulator in the second section from the top | ||
- Select the relevant WebView from the list | ||
- The simulator will highlight the WebView when you hover over it in Safari | ||
#### Debugging Physical iOS devices | ||
|
||
#### Debugging Android | ||
|
||
For more details, see [this page](https://developers.google.com/web/tools/chrome-devtools/remote-debugging/webviews). | ||
|
||
- You should be able to inspect the mobile app using the console in the React Native Debugger in Chrome | ||
- To debug a website (dapp) in the browser: | ||
- Navigate to the website in the app's browser | ||
- Go to chrome://inspect | ||
- Select the relevant WebView under **Remote Target** | ||
- Debugging physical iOS devices requires `idb` to be installed, which consists of 2 parts | ||
- Install the two idb parts: | ||
1. `brew tap facebook/fb` & `brew install idb-companion` | ||
2. `pip3.9 install fb-idb` (This step may require that you install python3 via `python -m pip3 install --upgrade pip`) | ||
|
||
#### Miscellaneous | ||
|
||
- [Troubleshooting for React Native](https://facebook.github.io/react-native/docs/troubleshooting#content) | ||
- [Flipper Documentation](https://fbflipper.com/docs/features/react-native/) | ||
|
||
### Running Tests | ||
|
||
|
@@ -194,11 +176,11 @@ yarn test:e2e:android | |
|
||
Whenever you change dependencies (adding, removing, or updating, either in `package.json` or `yarn.lock`), there are various files that must be kept up-to-date. | ||
|
||
* `yarn.lock`: | ||
* Run `yarn setup` again after your changes to ensure `yarn.lock` has been properly updated. | ||
* The `allow-scripts` configuration in `package.json` | ||
* Run `yarn allow-scripts auto` to update the `allow-scripts` configuration automatically. This config determines whether the package's install/postinstall scripts are allowed to run. Review each new package to determine whether the install script needs to run or not, testing if necessary. | ||
* Unfortunately, `yarn allow-scripts auto` will behave inconsistently on different platforms. macOS and Windows users may see extraneous changes relating to optional dependencies. | ||
- `yarn.lock`: | ||
- Run `yarn setup` again after your changes to ensure `yarn.lock` has been properly updated. | ||
- The `allow-scripts` configuration in `package.json` | ||
- Run `yarn allow-scripts auto` to update the `allow-scripts` configuration automatically. This config determines whether the package's install/postinstall scripts are allowed to run. Review each new package to determine whether the install script needs to run or not, testing if necessary. | ||
- Unfortunately, `yarn allow-scripts auto` will behave inconsistently on different platforms. macOS and Windows users may see extraneous changes relating to optional dependencies. | ||
|
||
### Architecture | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.