Skip to content
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

DRAFT: [FEAT] new architecture support #797

Closed
wants to merge 29 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
6291cf7
[FEAT] new architecture support
gabrielbazan7 May 9, 2023
8939d7a
use useEffect instead of useLayoutEffect
rastajpa May 9, 2023
3cbd356
Downgrade react-native to 0.71.8, downgrade react-native-reanimated t…
cnguyen812 May 15, 2023
b27bd61
Update Android config for react-native@0.71.8
cnguyen812 May 15, 2023
ca66d50
Update iOS config for react-native@0.71.8
cnguyen812 May 15, 2023
e6c166f
Prevent Tap and Pay initialization to avoid compilation error until m…
cnguyen812 May 15, 2023
d8d9c76
[FIX] remove dup concurrentRootEnabled
gabrielbazan7 May 16, 2023
15da524
[REF] revert upgrade to 0.72.x changes
gabrielbazan7 May 16, 2023
6aabe3a
Remove nested HomeStack, render HomeRoot directly
cnguyen812 Jun 2, 2023
ce3faea
Move ShopStack to Root, render ShopHome directly in tab
cnguyen812 Jun 2, 2023
7b80748
Refactor LinearGradient to avoid crash on Android
cnguyen812 Jun 5, 2023
7fd8bc5
Fix HomeRoot header overlapping status bar
cnguyen812 Jun 5, 2023
57fb2ac
Add temporary workaround for transaction skeleton row component
cnguyen812 Jun 7, 2023
702c954
Move CardStack to Root, render CardHome directly in tab
cnguyen812 Jun 7, 2023
a87a3b2
Add react-native-reanimated-carousel
cnguyen812 Jun 9, 2023
5d32d87
Temporarily disable animations on Button component
cnguyen812 Jun 9, 2023
0d9938f
Replace carousel component in Card Settings
cnguyen812 Jun 9, 2023
44b7f26
Move SettingsStack to Root, render SettingsHome directly in tab
cnguyen812 Jun 9, 2023
25f4a24
Adjust navigation route names
cnguyen812 Jun 9, 2023
132987f
Update card and giftcard deeplinks
cnguyen812 Jun 13, 2023
b682502
[FIX] remove use useLayoutEffect - replace fast image plugin
gabrielbazan7 Jul 19, 2023
7b0fadc
[FIX] Property 'nativeFabricUIManager' doesn't exist
gabrielbazan7 Jul 19, 2023
c074281
Merge branch 'master' into feat/new-arch
gabrielbazan7 Jul 26, 2023
2606e33
[FIX] bill pay navigation
gabrielbazan7 Jul 26, 2023
7a0849b
Merge branch 'master' into feat/new-arch
gabrielbazan7 Jul 26, 2023
9f6a0e6
[REF] replace deprecated carousel package
gabrielbazan7 Jul 24, 2023
996bdde
Merge branch 'ref/carousel' into feat/new-arch
gabrielbazan7 Jul 26, 2023
5c58083
Merge branch 'master' into feat/new-arch
gabrielbazan7 Jul 27, 2023
57da0fa
[FIX] fix wallet transaction list. lint code
gabrielbazan7 Jul 27, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ build/
local.properties
*.iml
*.hprof
android/app/src/main/res/raw/*
.cxx/
*.keystore
!debug.keystore
android/app/src/main/res/raw/*

# Emacs
.log/
Expand Down Expand Up @@ -67,6 +67,9 @@ yarn-error.log
# Temporary files created by Metro to check the health of the file watcher
.metro-health-check*

# testing
/coverage

.env
.env.development
.env.production
Expand Down
4 changes: 2 additions & 2 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = {
bracketSpacing: false,
arrowParens: 'avoid',
bracketSameLine: true,
bracketSpacing: false,
singleQuote: true,
trailingComma: 'all',
arrowParens: 'avoid',
};
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.7.6
2.7.6
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
source 'https://rubygems.org'

# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
ruby File.read(File.join(__dir__, '.ruby-version')).strip
gem 'cocoapods', '~> 1.11', '>= 1.11.3'
ruby ">= 2.6.10"
gem 'cocoapods', '>= 1.11.3'
44 changes: 21 additions & 23 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,41 +1,40 @@
GEM
remote: https://rubygems.org/
specs:
CFPropertyList (3.0.5)
CFPropertyList (3.0.6)
rexml
activesupport (6.1.5)
activesupport (7.0.4.3)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
zeitwerk (~> 2.3)
addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0)
addressable (2.8.4)
public_suffix (>= 2.0.2, < 6.0)
algoliasearch (1.27.5)
httpclient (~> 2.8, >= 2.8.3)
json (>= 1.5.1)
atomos (0.1.3)
claide (1.1.0)
cocoapods (1.11.3)
cocoapods (1.12.1)
addressable (~> 2.8)
claide (>= 1.0.2, < 2.0)
cocoapods-core (= 1.11.3)
cocoapods-core (= 1.12.1)
cocoapods-deintegrate (>= 1.0.3, < 2.0)
cocoapods-downloader (>= 1.4.0, < 2.0)
cocoapods-downloader (>= 1.6.0, < 2.0)
cocoapods-plugins (>= 1.0.0, < 2.0)
cocoapods-search (>= 1.0.0, < 2.0)
cocoapods-trunk (>= 1.4.0, < 2.0)
cocoapods-trunk (>= 1.6.0, < 2.0)
cocoapods-try (>= 1.1.0, < 2.0)
colored2 (~> 3.1)
escape (~> 0.0.4)
fourflusher (>= 2.3.0, < 3.0)
gh_inspector (~> 1.0)
molinillo (~> 0.8.0)
nap (~> 1.0)
ruby-macho (>= 1.0, < 3.0)
ruby-macho (>= 2.3.0, < 3.0)
xcodeproj (>= 1.21.0, < 2.0)
cocoapods-core (1.11.3)
activesupport (>= 5.0, < 7)
cocoapods-core (1.12.1)
activesupport (>= 5.0, < 8)
addressable (~> 2.8)
algoliasearch (~> 1.0)
concurrent-ruby (~> 1.1)
Expand All @@ -45,7 +44,7 @@ GEM
public_suffix (~> 4.0)
typhoeus (~> 1.0)
cocoapods-deintegrate (1.0.5)
cocoapods-downloader (1.5.1)
cocoapods-downloader (1.6.3)
cocoapods-plugins (1.0.0)
nap
cocoapods-search (1.0.1)
Expand All @@ -54,44 +53,43 @@ GEM
netrc (~> 0.11)
cocoapods-try (1.2.0)
colored2 (3.1.2)
concurrent-ruby (1.1.9)
concurrent-ruby (1.2.2)
escape (0.0.4)
ethon (0.15.0)
ethon (0.16.0)
ffi (>= 1.15.0)
ffi (1.15.5)
fourflusher (2.3.1)
fuzzy_match (2.0.4)
gh_inspector (1.1.3)
httpclient (2.8.3)
i18n (1.10.0)
i18n (1.12.0)
concurrent-ruby (~> 1.0)
json (2.6.1)
minitest (5.15.0)
json (2.6.3)
minitest (5.18.0)
molinillo (0.8.0)
nanaimo (0.3.0)
nap (1.1.0)
netrc (0.11.0)
public_suffix (4.0.6)
public_suffix (4.0.7)
rexml (3.2.5)
ruby-macho (2.5.1)
typhoeus (1.4.0)
ethon (>= 0.9.0)
tzinfo (2.0.4)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
xcodeproj (1.21.0)
xcodeproj (1.22.0)
CFPropertyList (>= 2.3.3, < 4.0)
atomos (~> 0.1.3)
claide (>= 1.0.2, < 2.0)
colored2 (~> 3.1)
nanaimo (~> 0.3.0)
rexml (~> 3.2.4)
zeitwerk (2.5.4)

PLATFORMS
ruby

DEPENDENCIES
cocoapods (~> 1.11, >= 1.11.3)
cocoapods (>= 1.11.3)

RUBY VERSION
ruby 2.7.6p219
Expand Down
2 changes: 1 addition & 1 deletion android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -183,4 +183,4 @@ dependencies {
}

apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
apply plugin: 'com.google.android.gms.strict-version-matcher-plugin'
apply plugin: 'com.google.android.gms.strict-version-matcher-plugin'
4 changes: 2 additions & 2 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@
android:name=".MainActivity"
android:label="@string/app_name"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode"
android:exported="true"
android:launchMode="singleTask"
android:windowSoftInputMode="stateAlwaysHidden|adjustPan">
android:windowSoftInputMode="stateAlwaysHidden|adjustPan"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.VIEW" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,4 @@ public GooglePushProvisioningModule(ReactApplicationContext reactContext) {
reactContext.addActivityEventListener(activityEventListener);
}

}
}
15 changes: 9 additions & 6 deletions android/app/src/main/java/com/bitpay/wallet/MainActivity.java
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
package com.bitpay.wallet;

import com.braze.ui.inappmessage.BrazeInAppMessageManager;
import com.facebook.react.ReactActivity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Build;
import android.app.Activity;
import android.view.View;
import com.facebook.react.ReactActivityDelegate;
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint;
import com.facebook.react.defaults.DefaultReactActivityDelegate;

import android.app.Activity;
import android.content.Intent;
import android.graphics.Color;
import android.os.Build;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import com.braze.ui.inappmessage.BrazeInAppMessageManager;
import com.zoontek.rnbootsplash.RNBootSplash;


public class MainActivity extends ReactActivity {

/**
Expand Down
19 changes: 10 additions & 9 deletions android/app/src/main/java/com/bitpay/wallet/MainApplication.java
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
package com.bitpay.wallet;

import android.app.Application;
import android.content.Context;

import com.facebook.react.PackageList;
import com.facebook.react.ReactApplication;
import com.mkuczera.RNReactNativeHapticFeedbackPackage;

import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint;
import com.facebook.react.defaults.DefaultReactNativeHost;
import com.facebook.soloader.SoLoader;
import java.util.ArrayList;
import java.util.List;

import android.content.Context;
import com.facebook.react.bridge.JSIModulePackage;
import com.facebook.react.modules.network.NetworkingModule;
import com.mkuczera.RNReactNativeHapticFeedbackPackage;
import java.util.ArrayList;
import java.util.List;
import okhttp3.OkHttpClient;

// Register custom font
Expand Down Expand Up @@ -71,15 +74,16 @@ public ReactNativeHost getReactNativeHost() {
@Override
public void onCreate() {
super.onCreate();
Context context = this;
SoLoader.init(this, /* native exopackage */ false);
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
// If you opted-in for the New Architecture, we load the native entry point for this app.
DefaultNewArchitectureEntryPoint.load();
}
ReactNativeFlipper.initializeFlipper(this, getReactNativeHost().getReactInstanceManager());

NetworkingModule.setCustomClientBuilder(
Context context = this;

NetworkingModule.setCustomClientBuilder(
new NetworkingModule.CustomClientBuilder() {
@Override
public void apply(OkHttpClient.Builder builder) {
Expand All @@ -93,9 +97,6 @@ public void apply(OkHttpClient.Builder builder) {
// Braze
registerActivityLifecycleCallbacks(new BrazeActivityLifecycleCallbackListener());
}
/*
Fix for IAB TODO
*/

public void addActivityToStack (Class cls) {
if (!runningActivities.contains(cls)) runningActivities.add(cls);
Expand Down
23 changes: 4 additions & 19 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle:7.3.1")
classpath("com.android.tools.build:gradle")
classpath("com.facebook.react:react-native-gradle-plugin")
classpath 'com.google.android.gms:strict-version-matcher-plugin:1.2.1'
classpath 'com.google.gms:google-services:4.3.14'
Expand All @@ -28,25 +28,10 @@ buildscript {
allprojects {
repositories {
mavenLocal()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url("$rootDir/../node_modules/react-native/android")
}
maven {
// Android JSC is installed from npm
url("$rootDir/../node_modules/jsc-android/dist")
}
mavenCentral {
// We don't want to fetch react-native from Maven Central as there are
// older versions over there.
content {
excludeGroup "com.facebook.react"
}
}
google()
jcenter()
mavenCentral()
maven { url 'https://www.jitpack.io' }

// Braze
maven { url "https://appboy.github.io/appboy-android-sdk/sdk" }
}
}
}
2 changes: 1 addition & 1 deletion android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64
# your application. You should enable this flag either if you want
# to write custom TurboModules/Fabric components OR use libraries that
# are providing them.
newArchEnabled=false
newArchEnabled=true

# Use this property to enable or disable the Hermes JS engine.
# If set to false, you will be using JSC instead.
Expand Down
3 changes: 1 addition & 2 deletions android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-bin.zip
networkTimeout=10000
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
16 changes: 3 additions & 13 deletions android/gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,11 @@ do
esac
done

# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

APP_NAME="Gradle"
APP_BASE_NAME=${0##*/}

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

Expand Down Expand Up @@ -143,16 +143,12 @@ fi
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -209,12 +205,6 @@ set -- \
org.gradle.wrapper.GradleWrapperMain \
"$@"

# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi

# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
Expand Down
2 changes: 1 addition & 1 deletion index.js → index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import 'react-native-get-random-values';// must import before @ethersproject/shims
import 'react-native-get-random-values'; // must import before @ethersproject/shims
import '@ethersproject/shims';
import './shim';
import '@walletconnect/react-native-compat';
Expand Down
Loading