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

chore: upgrade to react-native 0.74 #2050

Merged
merged 3 commits into from
Jul 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions .detoxrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ module.exports = {
testBinaryPath: 'android/app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk',
binaryPath: 'android/app/build/outputs/apk/debug/app-universal-debug.apk',
build:
'cd android && ./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug && cd .. ',
'cd android && ./gradlew app:assembleDebug app:assembleAndroidTest -DtestBuildType=debug && cd .. ',
reversePorts,
},
'android.release': {
type: 'android.apk',
testBinaryPath: 'android/app/build/outputs/apk/androidTest/release/app-release-androidTest.apk',
binaryPath: 'android/app/build/outputs/apk/release/app-universal-release.apk',
build:
'cd android && ./gradlew assembleRelease assembleAndroidTest -DtestBuildType=release && cd ..',
'cd android && ./gradlew app:assembleRelease app:assembleAndroidTest -DtestBuildType=release && cd ..',
reversePorts,
},
},
Expand Down
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ metro.config.js
postinstall.js
__mocks__/**

src/polyfills/**
src/**/*_deprecated.tsx
4 changes: 1 addition & 3 deletions .github/workflows/e2e-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,7 @@ jobs:
HUSKY: 0

- name: Activate Gradle variables
run: |
cp .github/workflows/gradle.properties ~/.gradle/gradle.properties
patch -p1 -i ./.github/workflows/react-native-quick-crypto.patch
run: cp .github/workflows/gradle.properties ~/.gradle/gradle.properties

- name: Use specific Java version for sdkmanager to work
uses: actions/setup-java@v4
Expand Down
13 changes: 0 additions & 13 deletions .github/workflows/react-native-quick-crypto.patch

This file was deleted.

12 changes: 10 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ DerivedData
*.hmap
*.ipa
*.xcuserstate
ios/.xcode.env.local
**/.xcode.env.local
IDEWorkspaceChecks.plist

# Android/IntelliJ
Expand All @@ -39,6 +39,14 @@ local.properties
#
node_modules/
npm-debug.log

# Yarn
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
yarn-error.log

# BUCK
Expand All @@ -61,7 +69,7 @@ buck-out/
*.jsbundle

# Ruby / CocoaPods
/ios/Pods/
**/Pods/
/vendor/bundle/

# Temporary files created by Metro to check the health of the file watcher
Expand Down
874 changes: 874 additions & 0 deletions .yarn/releases/yarn-3.6.4.cjs

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
nodeLinker: node-modules

checksumBehavior: 'update'

yarnPath: .yarn/releases/yarn-3.6.4.cjs
1 change: 1 addition & 0 deletions __mocks__/@react-native-clipboard/clipboard/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = jest.mock('@react-native-clipboard/clipboard');
2 changes: 1 addition & 1 deletion android/app/src/main/java/com/bitkit/MainApplication.kt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class MainApplication : Application(), ReactApplication {
}

override val reactHost: ReactHost
get() = getDefaultReactHost(this.applicationContext, reactNativeHost)
get() = getDefaultReactHost(applicationContext, reactNativeHost)

override fun onCreate() {
super.onCreate()
Expand Down
6 changes: 3 additions & 3 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ buildscript {
minSdkVersion = 28
compileSdkVersion = 34
targetSdkVersion = 34
kotlin_version = "1.8.0"
kotlinVersion = "1.8.0"
ndkVersion = "25.2.9519653"
ndkVersion = "26.1.10909125"
kotlin_version = "1.9.22"
kotlinVersion = "1.9.22"
}
repositories {
google()
Expand Down
2 changes: 1 addition & 1 deletion android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
# Default value: -Xmx512m -XX:MaxMetaspaceSize=256m
org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m
org.gradle.jvmargs=-Xmx4096m -XX:MaxMetaspaceSize=1024m

# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
Expand Down
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
14 changes: 7 additions & 7 deletions android/gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -145,15 +145,15 @@ 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
# shellcheck disable=SC2039,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
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -202,11 +202,11 @@ fi
# 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"'

# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.

set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
Expand Down
20 changes: 10 additions & 10 deletions android/gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand All @@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto execute

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand Down
2 changes: 0 additions & 2 deletions babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,9 @@ module.exports = {
};

// Copied from unsupported /~https://github.com/babel/babel/pull/10102/files
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
function transformBigIntLiteral() {
return {
visitor: {
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
BigIntLiteral(path) {
const bigintCall = types.callExpression(types.identifier('BigInt'), [
types.stringLiteral(path.node.value),
Expand Down
6 changes: 3 additions & 3 deletions e2e/slashtags.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {
} from './helpers';
import initWaitForElectrumToSync from '../__tests__/utils/wait-for-electrum';

const __DEV__ = process.env.DEV === 'true';
const d = checkComplete('slash-1') ? describe.skip : describe;

// private key: rhuoi5upr3he3d5p9ef685bnxq8adbariwphg7i8gxdnnazok87xtc3e15pkouxizbzm6m4kjaoi9bndwp88iefycf6i6qhqu1ifzfa
Expand Down Expand Up @@ -143,9 +142,10 @@ d('Profile and Contacts', () => {
await expect(element(by.text(satoshi.website))).toExist();
await element(by.id('NavigationBack')).tap();

if (!__DEV__ && device.getPlatform() === 'ios') {
if (device.getPlatform() === 'ios') {
// FIXME: this bottom sheet should not appear
await element(by.id('AddContactNote')).swipe('down');
// Tap on background to dismiss
await element(by.label('Close')).atIndex(0).tap({ x: 10, y: 10 });
}

// Hal
Expand Down
1 change: 1 addition & 0 deletions ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ target 'bitkit' do
installer,
config[:reactNativePath],
:mac_catalyst_enabled => false
# :ccache_enabled => true
)

# buildcache begin
Expand Down
Loading
Loading