Skip to content

Commit 84dbd63

Browse files
feat: upgrade react-native version, improve example apps (#672)
* feat: upgrade react-native version, improve example apps * fix: add missing eslint def * fix: add missing eslint def * test: patch snapshot * test: patch tsconfig * test: patch tsconfig * test: update snapshot * Update and reinit the windows example support * Update package deps regarding windows support * Increase the space for the android build * Build new arch as default and old arch with dedicated cached gradle.properties * Correct the new arch build needs * Use new arch as the default for no-cache scenario --------- Co-authored-by: Bartosz Klonowski <[email protected]>
1 parent b37ab56 commit 84dbd63

40 files changed

+16692
-19371
lines changed

.github/workflows/ReactNativeSlider-CI.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ jobs:
8989
- name: Run TypeScript on the sources
9090
run: cd example && npx tsc --noEmit
9191

92-
build-android-app:
92+
build-android-app-old-arch:
9393
name: Build example app Android
9494
runs-on: ubuntu-latest
9595
needs: [verify-example-sources]
@@ -105,13 +105,22 @@ jobs:
105105
distribution: 'zulu'
106106
java-version: '17'
107107

108+
- name: Use old arch config
109+
id: cache-old-arch-gradle
110+
uses: actions/cache@v4
111+
env:
112+
cache-name: cached-gradle-old-arch-prop
113+
with:
114+
path: example/android/gradle.properties
115+
key: gradle-prop-old-arch-config
116+
108117
- name: Build the Android OS app
109118
run: cd example/android && ./gradlew assembleDebug
110119

111120
build-android-app-new-arch:
112121
name: Build example app Android (Fabric)
113122
runs-on: ubuntu-latest
114-
needs: [build-android-app]
123+
needs: [build-android-app-old-arch]
115124

116125
steps:
117126
- uses: actions/checkout@v4
@@ -124,15 +133,6 @@ jobs:
124133
distribution: 'zulu'
125134
java-version: '17'
126135

127-
- name: Use new arch config
128-
id: cache-new-arch-gradle
129-
uses: actions/cache@v4
130-
env:
131-
cache-name: cached-gradle-new-arch-prop
132-
with:
133-
path: example/android/gradle.properties
134-
key: gradle-prop-new-arch-config
135-
136136
- name: Build the Android OS app
137137
run: cd example/android && ./gradlew assembleDebug
138138

example-web/package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
"@testing-library/user-event": "^13.5.0",
99
"@types/jest": "^27.5.2",
1010
"@types/node": "^16.18.9",
11-
"@types/react": "^18.0.26",
12-
"@types/react-dom": "^18.0.9",
13-
"react": "^18.2.0",
14-
"react-dom": "^18.2.0",
15-
"react-native-web": "^0.19.12",
11+
"@types/react": "^18.3.12",
12+
"@types/react-dom": "^18.3.1",
13+
"react": "^18.3.1",
14+
"react-dom": "^18.3.1",
15+
"react-native-web": "^0.19.13",
1616
"react-scripts": "5.0.1",
17-
"typescript": "^4.9.4",
17+
"typescript": "5.0.4",
1818
"web-vitals": "^2.1.4"
1919
},
2020
"scripts": {

example/Gemfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ source 'https://rubygems.org'
33
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
44
ruby ">= 2.6.10"
55

6-
# Cocoapods 1.15 introduced a bug which break the build. We will remove the upper
7-
# bound in the template on Cocoapods with next React Native release.
8-
gem 'cocoapods', '>= 1.13', '< 1.15'
9-
gem 'activesupport', '>= 6.1.7.5', '< 7.1.0'
6+
# Exclude problematic versions of cocoapods and activesupport that causes build failures.
7+
gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1'
8+
gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0'
9+
gem 'xcodeproj', '< 1.26.0'

example/Gemfile.lock

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
GEM
2+
remote: https://rubygems.org/
3+
specs:
4+
CFPropertyList (3.0.7)
5+
base64
6+
nkf
7+
rexml
8+
activesupport (7.1.3.4)
9+
base64
10+
bigdecimal
11+
concurrent-ruby (~> 1.0, >= 1.0.2)
12+
connection_pool (>= 2.2.5)
13+
drb
14+
i18n (>= 1.6, < 2)
15+
minitest (>= 5.1)
16+
mutex_m
17+
tzinfo (~> 2.0)
18+
addressable (2.8.7)
19+
public_suffix (>= 2.0.2, < 7.0)
20+
algoliasearch (1.27.5)
21+
httpclient (~> 2.8, >= 2.8.3)
22+
json (>= 1.5.1)
23+
atomos (0.1.3)
24+
base64 (0.2.0)
25+
bigdecimal (3.1.1)
26+
claide (1.1.0)
27+
cocoapods (1.15.2)
28+
addressable (~> 2.8)
29+
claide (>= 1.0.2, < 2.0)
30+
cocoapods-core (= 1.15.2)
31+
cocoapods-deintegrate (>= 1.0.3, < 2.0)
32+
cocoapods-downloader (>= 2.1, < 3.0)
33+
cocoapods-plugins (>= 1.0.0, < 2.0)
34+
cocoapods-search (>= 1.0.0, < 2.0)
35+
cocoapods-trunk (>= 1.6.0, < 2.0)
36+
cocoapods-try (>= 1.1.0, < 2.0)
37+
colored2 (~> 3.1)
38+
escape (~> 0.0.4)
39+
fourflusher (>= 2.3.0, < 3.0)
40+
gh_inspector (~> 1.0)
41+
molinillo (~> 0.8.0)
42+
nap (~> 1.0)
43+
ruby-macho (>= 2.3.0, < 3.0)
44+
xcodeproj (>= 1.23.0, < 2.0)
45+
cocoapods-core (1.15.2)
46+
activesupport (>= 5.0, < 8)
47+
addressable (~> 2.8)
48+
algoliasearch (~> 1.0)
49+
concurrent-ruby (~> 1.1)
50+
fuzzy_match (~> 2.0.4)
51+
nap (~> 1.0)
52+
netrc (~> 0.11)
53+
public_suffix (~> 4.0)
54+
typhoeus (~> 1.0)
55+
cocoapods-deintegrate (1.0.5)
56+
cocoapods-downloader (2.1)
57+
cocoapods-plugins (1.0.0)
58+
nap
59+
cocoapods-search (1.0.1)
60+
cocoapods-trunk (1.6.0)
61+
nap (>= 0.8, < 2.0)
62+
netrc (~> 0.11)
63+
cocoapods-try (1.2.0)
64+
colored2 (3.1.2)
65+
concurrent-ruby (1.3.4)
66+
connection_pool (2.4.1)
67+
drb (2.1.0)
68+
ruby2_keywords
69+
escape (0.0.4)
70+
ethon (0.16.0)
71+
ffi (>= 1.15.0)
72+
ffi (1.17.0-arm64-darwin)
73+
fourflusher (2.3.1)
74+
fuzzy_match (2.0.4)
75+
gh_inspector (1.1.3)
76+
httpclient (2.8.3)
77+
i18n (1.14.5)
78+
concurrent-ruby (~> 1.0)
79+
json (2.7.2)
80+
minitest (5.25.1)
81+
molinillo (0.8.0)
82+
mutex_m (0.1.1)
83+
nanaimo (0.3.0)
84+
nap (1.1.0)
85+
netrc (0.11.0)
86+
nkf (0.2.0)
87+
public_suffix (4.0.7)
88+
rexml (3.3.7)
89+
ruby-macho (2.5.1)
90+
ruby2_keywords (0.0.5)
91+
typhoeus (1.4.1)
92+
ethon (>= 0.9.0)
93+
tzinfo (2.0.6)
94+
concurrent-ruby (~> 1.0)
95+
xcodeproj (1.25.0)
96+
CFPropertyList (>= 2.3.3, < 4.0)
97+
atomos (~> 0.1.3)
98+
claide (>= 1.0.2, < 2.0)
99+
colored2 (~> 3.1)
100+
nanaimo (~> 0.3.0)
101+
rexml (>= 3.3.2, < 4.0)
102+
103+
PLATFORMS
104+
arm64-darwin
105+
106+
DEPENDENCIES
107+
activesupport (>= 6.1.7.5, != 7.1.0)
108+
cocoapods (>= 1.13, != 1.15.1, != 1.15.0)
109+
xcodeproj (< 1.26.0)
110+
111+
RUBY VERSION
112+
ruby 3.1.2p20
113+
114+
BUNDLED WITH
115+
2.5.17

example/android/app/build.gradle

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ react {
4949
//
5050
// The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
5151
// hermesFlags = ["-O", "-output-source-map"]
52+
/* Autolinking */
53+
autolinkLibrariesWithApp()
5254
}
5355

5456
/**
@@ -107,13 +109,10 @@ android {
107109
dependencies {
108110
// The version of react-native is set by the React Native Gradle Plugin
109111
implementation("com.facebook.react:react-android")
110-
implementation("com.facebook.react:flipper-integration")
111112

112113
if (hermesEnabled.toBoolean()) {
113114
implementation("com.facebook.react:hermes-android")
114115
} else {
115116
implementation jscFlavor
116117
}
117118
}
118-
119-
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import com.facebook.react.ReactPackage
99
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load
1010
import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
1111
import com.facebook.react.defaults.DefaultReactNativeHost
12-
import com.facebook.react.flipper.ReactNativeFlipper
12+
import com.facebook.react.soloader.OpenSourceMergedSoMapping
1313
import com.facebook.soloader.SoLoader
1414

1515
class MainApplication : Application(), ReactApplication {
@@ -35,11 +35,10 @@ class MainApplication : Application(), ReactApplication {
3535

3636
override fun onCreate() {
3737
super.onCreate()
38-
SoLoader.init(this, false)
38+
SoLoader.init(this, OpenSourceMergedSoMapping)
3939
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
4040
// If you opted-in for the New Architecture, we load the native entry point for this app.
4141
load()
4242
}
43-
ReactNativeFlipper.initializeFlipper(this, reactNativeHost.reactInstanceManager)
4443
}
4544
}

example/android/build.gradle

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
buildscript {
22
ext {
3-
buildToolsVersion = "34.0.0"
4-
minSdkVersion = 21
5-
compileSdkVersion = 34
3+
buildToolsVersion = "35.0.0"
4+
minSdkVersion = 24
5+
compileSdkVersion = 35
66
targetSdkVersion = 34
7-
ndkVersion = "25.1.8937393"
8-
kotlinVersion = "1.8.0"
7+
ndkVersion = "26.1.10909125"
8+
kotlinVersion = "1.9.24"
99
}
1010
repositories {
1111
google()

example/android/gradle.properties

Lines changed: 2 additions & 2 deletions
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
@@ -34,7 +34,7 @@ reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64
3434
# your application. You should enable this flag either if you want
3535
# to write custom TurboModules/Fabric components OR use libraries that
3636
# are providing them.
37-
newArchEnabled=false
37+
newArchEnabled=true
3838

3939
# Use this property to enable or disable the Hermes JS engine.
4040
# If set to false, you will be using JSC instead.
-19.7 KB
Binary file not shown.

example/android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
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.10.2-all.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

0 commit comments

Comments
 (0)