Skip to content

Commit c3caf15

Browse files
authored
feat: upgrade example app to RN79 (#85)
1 parent 88faf3c commit c3caf15

File tree

25 files changed

+1875
-1907
lines changed

25 files changed

+1875
-1907
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ on:
66

77
jobs:
88
build:
9-
runs-on: ubuntu-22.04
9+
runs-on: ubuntu-24.04
1010
strategy:
1111
matrix:
12-
node: ['18']
12+
node: ['22']
1313
name: Node ${{ matrix.node }}
1414
steps:
1515
- uses: actions/checkout@v3

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- name: Setup node
1616
uses: actions/setup-node@v3
1717
with:
18-
node-version: 18
18+
node-version: 22
1919
cache: 'npm'
2020
registry-url: 'https://registry.npmjs.org'
2121

example/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ ios/.xcode.env.local
2424

2525
# Android/IntelliJ
2626
#
27-
build/
2827
.idea
2928
.gradle
3029
local.properties
@@ -33,6 +32,7 @@ local.properties
3332
.cxx/
3433
*.keystore
3534
!debug.keystore
35+
.kotlin/
3636

3737
# node.js
3838
#

example/Gemfile

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,14 @@ 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'
10+
gem 'concurrent-ruby', '< 1.3.4'
11+
12+
# Ruby 3.4.0 has removed some libraries from the standard library.
13+
gem 'bigdecimal'
14+
gem 'logger'
15+
gem 'benchmark'
16+
gem 'mutex_m'

example/__tests__/App-test.tsx

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
1-
/**
2-
* @format
3-
*/
4-
5-
import 'react-native';
61
import React from 'react';
2+
import ReactTestRenderer from 'react-test-renderer';
73
import App from '../App';
84

9-
// Note: test renderer must be required after react-native.
10-
import renderer from 'react-test-renderer';
11-
12-
it('renders correctly', () => {
13-
renderer.create(<App />);
5+
test('renders correctly', async () => {
6+
await ReactTestRenderer.act(() => {
7+
ReactTestRenderer.create(<App />);
8+
});
149
});

example/android/app/build.gradle

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ 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+
53+
/* Autolinking */
54+
autolinkLibrariesWithApp()
5255
}
5356

5457
/**
@@ -60,14 +63,14 @@ def enableProguardInReleaseBuilds = false
6063
* The preferred build flavor of JavaScriptCore (JSC)
6164
*
6265
* For example, to use the international variant, you can use:
63-
* `def jscFlavor = 'org.webkit:android-jsc-intl:+'`
66+
* `def jscFlavor = io.github.react-native-community:jsc-android-intl:2026004.+`
6467
*
6568
* The international variant includes ICU i18n library and necessary data
6669
* allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
6770
* give correct results when using with locales other than en-US. Note that
6871
* this variant is about 6MiB larger per architecture than default.
6972
*/
70-
def jscFlavor = 'org.webkit:android-jsc:+'
73+
def jscFlavor = 'io.github.react-native-community:jsc-android:2026004.+'
7174

7275
android {
7376
ndkVersion rootProject.ext.ndkVersion
@@ -116,5 +119,3 @@ dependencies {
116119
implementation jscFlavor
117120
}
118121
}
119-
120-
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)

example/android/app/src/main/AndroidManifest.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
<manifest xmlns:tools="http://schemas.android.com/tools"
22
xmlns:android="http://schemas.android.com/apk/res/android">
33

4-
<uses-permission android:name="android.permission.INTERNET" />
4+
<uses-permission android:name="android.permission.INTERNET" />
55
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
6-
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"
7-
android:maxSdkVersion="32" />
6+
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="32" />
87

98
<application
109
android:name=".MainApplication"
@@ -13,7 +12,8 @@
1312
android:roundIcon="@mipmap/ic_launcher_round"
1413
android:allowBackup="false"
1514
android:requestLegacyExternalStorage="true"
16-
android:theme="@style/AppTheme">
15+
android:theme="@style/AppTheme"
16+
android:supportsRtl="true">
1717
<activity
1818
android:name=".MainActivity"
1919
android:label="@string/app_name"

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +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.soloader.OpenSourceMergedSoMapping
1213
import com.facebook.soloader.SoLoader
1314

1415
class MainApplication : Application(), ReactApplication {
@@ -34,7 +35,7 @@ class MainApplication : Application(), ReactApplication {
3435

3536
override fun onCreate() {
3637
super.onCreate()
37-
SoLoader.init(this, false)
38+
SoLoader.init(this, OpenSourceMergedSoMapping)
3839
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
3940
// If you opted-in for the New Architecture, we load the native entry point for this app.
4041
load()

example/android/build.gradle

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,12 @@
22

33
buildscript {
44
ext {
5-
6-
buildToolsVersion = "34.0.0"
7-
minSdkVersion = 23
8-
compileSdkVersion = 34
9-
targetSdkVersion = 34
10-
ndkVersion = "26.1.10909125"
11-
kotlinVersion = "1.9.22"
5+
buildToolsVersion = "35.0.0"
6+
minSdkVersion = 24
7+
compileSdkVersion = 35
8+
targetSdkVersion = 35
9+
ndkVersion = "27.1.12297006"
10+
kotlinVersion = "2.0.21"
1211
}
1312
repositories {
1413
google()

example/android/gradle.properties

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m
2121
# Android operating system, and which are packaged with your app's APK
2222
# https://developer.android.com/topic/libraries/support-library/androidx-rn
2323
android.useAndroidX=true
24-
# Automatically convert third-party libraries to use AndroidX
25-
android.enableJetifier=true
2624

2725
# Use this property to specify which architecture you want to build.
2826
# You can also override it from the CLI using

0 commit comments

Comments
 (0)