Skip to content

Commit 94bdef3

Browse files
authored
chore: upgrade to react-native 0.74 (#2050)
* chore: upgrade to react-native 0.74 * test: fix e2e tests * fix: use correct schema for gh dependency
1 parent a80bb06 commit 94bdef3

Some content is hidden

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

44 files changed

+19119
-12698
lines changed

.detoxrc.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@ module.exports = {
3131
testBinaryPath: 'android/app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk',
3232
binaryPath: 'android/app/build/outputs/apk/debug/app-universal-debug.apk',
3333
build:
34-
'cd android && ./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug && cd .. ',
34+
'cd android && ./gradlew app:assembleDebug app:assembleAndroidTest -DtestBuildType=debug && cd .. ',
3535
reversePorts,
3636
},
3737
'android.release': {
3838
type: 'android.apk',
3939
testBinaryPath: 'android/app/build/outputs/apk/androidTest/release/app-release-androidTest.apk',
4040
binaryPath: 'android/app/build/outputs/apk/release/app-universal-release.apk',
4141
build:
42-
'cd android && ./gradlew assembleRelease assembleAndroidTest -DtestBuildType=release && cd ..',
42+
'cd android && ./gradlew app:assembleRelease app:assembleAndroidTest -DtestBuildType=release && cd ..',
4343
reversePorts,
4444
},
4545
},

.eslintignore

+1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ metro.config.js
99
postinstall.js
1010
__mocks__/**
1111

12+
src/polyfills/**
1213
src/**/*_deprecated.tsx

.github/workflows/e2e-android.yml

+1-3
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,7 @@ jobs:
8989
HUSKY: 0
9090

9191
- name: Activate Gradle variables
92-
run: |
93-
cp .github/workflows/gradle.properties ~/.gradle/gradle.properties
94-
patch -p1 -i ./.github/workflows/react-native-quick-crypto.patch
92+
run: cp .github/workflows/gradle.properties ~/.gradle/gradle.properties
9593

9694
- name: Use specific Java version for sdkmanager to work
9795
uses: actions/setup-java@v4

.github/workflows/react-native-quick-crypto.patch

-13
This file was deleted.

.gitignore

+10-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ DerivedData
2020
*.hmap
2121
*.ipa
2222
*.xcuserstate
23-
ios/.xcode.env.local
23+
**/.xcode.env.local
2424
IDEWorkspaceChecks.plist
2525

2626
# Android/IntelliJ
@@ -39,6 +39,14 @@ local.properties
3939
#
4040
node_modules/
4141
npm-debug.log
42+
43+
# Yarn
44+
.yarn/*
45+
!.yarn/patches
46+
!.yarn/plugins
47+
!.yarn/releases
48+
!.yarn/sdks
49+
!.yarn/versions
4250
yarn-error.log
4351

4452
# BUCK
@@ -61,7 +69,7 @@ buck-out/
6169
*.jsbundle
6270

6371
# Ruby / CocoaPods
64-
/ios/Pods/
72+
**/Pods/
6573
/vendor/bundle/
6674

6775
# Temporary files created by Metro to check the health of the file watcher

.yarn/releases/yarn-3.6.4.cjs

+874
Large diffs are not rendered by default.

.yarnrc.yml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
nodeLinker: node-modules
2+
3+
checksumBehavior: 'update'
4+
5+
yarnPath: .yarn/releases/yarn-3.6.4.cjs
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = jest.mock('@react-native-clipboard/clipboard');

android/app/src/main/java/com/bitkit/MainApplication.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class MainApplication : Application(), ReactApplication {
3232
}
3333

3434
override val reactHost: ReactHost
35-
get() = getDefaultReactHost(this.applicationContext, reactNativeHost)
35+
get() = getDefaultReactHost(applicationContext, reactNativeHost)
3636

3737
override fun onCreate() {
3838
super.onCreate()

android/build.gradle

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ buildscript {
66
minSdkVersion = 28
77
compileSdkVersion = 34
88
targetSdkVersion = 34
9-
kotlin_version = "1.8.0"
10-
kotlinVersion = "1.8.0"
11-
ndkVersion = "25.2.9519653"
9+
ndkVersion = "26.1.10909125"
10+
kotlin_version = "1.9.22"
11+
kotlinVersion = "1.9.22"
1212
}
1313
repositories {
1414
google()

android/gradle.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# Specifies the JVM arguments used for the daemon process.
1111
# The setting is particularly useful for tweaking memory settings.
1212
# Default value: -Xmx512m -XX:MaxMetaspaceSize=256m
13-
org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m
13+
org.gradle.jvmargs=-Xmx4096m -XX:MaxMetaspaceSize=1024m
1414

1515
# When configured, Gradle will run in incubating parallel mode.
1616
# This option should only be used with decoupled projects. More details, visit

android/gradle/wrapper/gradle-wrapper.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-all.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

android/gradlew

+7-7
Original file line numberDiff line numberDiff line change
@@ -145,15 +145,15 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
145145
case $MAX_FD in #(
146146
max*)
147147
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
148-
# shellcheck disable=SC3045
148+
# shellcheck disable=SC2039,SC3045
149149
MAX_FD=$( ulimit -H -n ) ||
150150
warn "Could not query maximum file descriptor limit"
151151
esac
152152
case $MAX_FD in #(
153153
'' | soft) :;; #(
154154
*)
155155
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
156-
# shellcheck disable=SC3045
156+
# shellcheck disable=SC2039,SC3045
157157
ulimit -n "$MAX_FD" ||
158158
warn "Could not set maximum file descriptor limit to $MAX_FD"
159159
esac
@@ -202,11 +202,11 @@ fi
202202
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
203203
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
204204

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

211211
set -- \
212212
"-Dorg.gradle.appname=$APP_BASE_NAME" \

android/gradlew.bat

+10-10
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ set JAVA_EXE=java.exe
4343
%JAVA_EXE% -version >NUL 2>&1
4444
if %ERRORLEVEL% equ 0 goto execute
4545

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

5252
goto fail
5353

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

5858
if exist "%JAVA_EXE%" goto execute
5959

60-
echo.
61-
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
62-
echo.
63-
echo Please set the JAVA_HOME variable in your environment to match the
64-
echo location of your Java installation.
60+
echo. 1>&2
61+
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
62+
echo. 1>&2
63+
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
64+
echo location of your Java installation. 1>&2
6565

6666
goto fail
6767

babel.config.js

-2
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,9 @@ module.exports = {
2727
};
2828

2929
// Copied from unsupported https://github.com/babel/babel/pull/10102/files
30-
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
3130
function transformBigIntLiteral() {
3231
return {
3332
visitor: {
34-
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
3533
BigIntLiteral(path) {
3634
const bigintCall = types.callExpression(types.identifier('BigInt'), [
3735
types.stringLiteral(path.node.value),

e2e/slashtags.e2e.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import {
1212
} from './helpers';
1313
import initWaitForElectrumToSync from '../__tests__/utils/wait-for-electrum';
1414

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

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

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

151151
// Hal

ios/Podfile

+1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ target 'bitkit' do
4848
installer,
4949
config[:reactNativePath],
5050
:mac_catalyst_enabled => false
51+
# :ccache_enabled => true
5152
)
5253

5354
# buildcache begin

0 commit comments

Comments
 (0)