Skip to content

Commit e5664b7

Browse files
authored
chore: upgrade react native in example (#948)
* chore: upgrade react native in example * chore: memory * chore: update detox * chore: update tests * chore: update xcode * chore: undo android signing
1 parent 80446e4 commit e5664b7

File tree

9 files changed

+2752
-1378
lines changed

9 files changed

+2752
-1378
lines changed

.circleci/config.yml

+17-6
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,18 @@ jobs:
2424
- run:
2525
command: yarn lint
2626
name: Run ESLint
27-
- run:
28-
command: yarn flow
29-
name: Flow
27+
# we should just use TS
28+
# - run:
29+
# command: yarn flow
30+
# name: Flow
3031
- run:
3132
command: yarn test
3233
name: Jest
3334

3435
new_arch_ios_build_only:
3536
executor:
3637
name: rn/macos
37-
xcode_version: '15.3.0'
38+
xcode_version: '16.2.0'
3839
resource_class: macos.m1.medium.gen1
3940
steps:
4041
- checkout
@@ -51,7 +52,7 @@ jobs:
5152
e2e_release_ios:
5253
executor:
5354
name: rn/macos
54-
xcode_version: '15.3.0'
55+
xcode_version: '16.2.0'
5556
resource_class: macos.m1.medium.gen1
5657
steps:
5758
- checkout
@@ -72,7 +73,7 @@ jobs:
7273
# - rn/pod_install:
7374
# pod_install_directory: 'example/ios'
7475
- run:
75-
command: (cd example && npx pod-install)
76+
command: (cd example && RCT_NEW_ARCH_ENABLED=0 npx pod-install)
7677
name: pod install
7778
- run:
7879
command: yarn detox:ios:build:release
@@ -88,6 +89,8 @@ jobs:
8889
name: android/android-machine
8990
resource-class: large
9091
tag: default
92+
environment:
93+
GRADLE_OPTS: '-Dorg.gradle.jvmargs="-Xmx4g -XX:+HeapDumpOnOutOfMemoryError" -Dorg.gradle.daemon=false'
9194
steps:
9295
- checkout
9396
- android/change-java-version:
@@ -121,6 +124,9 @@ jobs:
121124
- run:
122125
command: yarn bundle:android
123126
name: bundle js
127+
- run:
128+
command: yarn generateManifest
129+
name: generateManifest
124130
- run:
125131
command: ORG_GRADLE_PROJECT_newArchEnabled=false yarn detox:android:build:release
126132
name: build app for e2e tests
@@ -135,6 +141,8 @@ jobs:
135141
name: android/android-machine
136142
resource-class: large
137143
tag: default
144+
environment:
145+
GRADLE_OPTS: '-Dorg.gradle.jvmargs="-Xmx4g -XX:+HeapDumpOnOutOfMemoryError" -Dorg.gradle.daemon=false'
138146
steps:
139147
- checkout
140148
- android/change-java-version:
@@ -164,6 +172,9 @@ jobs:
164172
- run:
165173
command: yarn bundle:android
166174
name: bundle js
175+
- run:
176+
command: yarn generateManifest
177+
name: generateManifest
167178
- run:
168179
command: ORG_GRADLE_PROJECT_newArchEnabled=true yarn detox:android:build:release
169180
name: build app for e2e tests

example/App.js

+2
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,9 @@ export const App = () => {
444444
minimumDate={minimumDate}
445445
value={date}
446446
mode={mode}
447+
// for consistent display
447448
is24Hour
449+
locale="en-US"
448450
display={display}
449451
onChange={onChange}
450452
textColor={textColor || undefined}

example/android/build.gradle

+9-1
Original file line numberDiff line numberDiff line change
@@ -40,19 +40,24 @@ allprojects {
4040
maven {
4141
// All of Detox' artifacts are provided via the npm module
4242
url "$rootDir/../../node_modules/detox/Detox-android"
43-
}
43+
}
4444
mavenCentral()
4545
google()
4646
}
47+
// https://github.com/microsoft/react-native-test-app/wiki/Platform-Specifics:-Android#detox
4748
afterEvaluate { project ->
4849
def androidExtension = project.extensions.findByName('android')
4950
if (androidExtension != null && project.name == 'app') {
5051
androidExtension.defaultConfig {
5152
ndk {
5253
abiFilters 'arm64-v8a', 'x86', 'x86_64'
5354
}
55+
// this along with `androidTestImplementation`s fixes
56+
// Opening an oat file without a class loader. Are you using the deprecated DexFile APIs?
57+
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
5458
}
5559

60+
// needed for release signing
5661
androidExtension.signingConfigs {
5762
test {
5863
keyAlias "androiddebugkey"
@@ -65,11 +70,14 @@ allprojects {
6570
androidExtension.buildTypes.debug.signingConfig = androidExtension.signingConfigs.test
6671
androidExtension.buildTypes.release.signingConfig = androidExtension.signingConfigs.test
6772
androidExtension.testBuildType = System.getProperty('testBuildType', 'debug')
73+
// end needed for release signing
6874

6975
androidExtension.sourceSets.androidTest.java.srcDirs += "$rootDir/app/src/androidTest/java"
7076

7177
project.dependencies {
7278
androidTestImplementation('com.wix:detox:+')
79+
androidTestImplementation 'androidx.test:runner:1.5.2'
80+
androidTestImplementation 'androidx.test:rules:1.5.2'
7381
}
7482
}
7583
}

example/android/gradle.properties

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ org.gradle.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryEr
2525
# https://developer.android.com/topic/libraries/support-library/androidx-rn
2626
android.useAndroidX=true
2727
# Automatically convert third-party libraries to use AndroidX
28-
android.enableJetifier=true
28+
android.enableJetifier=false
2929
# Jetifier randomly fails on these libraries
3030
android.jetifier.ignorelist=hermes-android
3131

@@ -40,8 +40,8 @@ reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64
4040
# to write custom TurboModules/Fabric components OR use libraries that
4141
# are providing them.
4242
# Note that this is incompatible with web debugging.
43-
#newArchEnabled=true
44-
#bridgelessEnabled=true
43+
newArchEnabled=true
44+
bridgelessEnabled=true
4545

4646
# Uncomment the line below to build React Native from source.
4747
#react.buildFromSource=true

example/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.6-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-all.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

example/ios/Podfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ require "#{ws_dir}/node_modules/react-native-test-app/test_app.rb"
66

77
workspace 'date-time-picker-example.xcworkspace'
88

9-
use_test_app!
9+
use_test_app! :hermes_enabled => true, :fabric_enabled => true, :bridgeless_enabled => true

0 commit comments

Comments
 (0)