Skip to content

Commit 8c43daf

Browse files
authored
chore: upgrade rtn in example app (#14641)
* chore: upgrade rtn in example app * chore: added codegen nohoist config * chore: fix whitespaces
1 parent 1fe3c5d commit 8c43daf

File tree

12 files changed

+154
-1131
lines changed

12 files changed

+154
-1131
lines changed

packages/react-native/example/Gemfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@ source 'https://rubygems.org'
22

33
ruby ">= 2.6.10"
44

5+
# Ruby 3.4.0 has removed some libraries from the standard library.
6+
gem 'bigdecimal'
7+
gem 'logger'
8+
gem 'benchmark'
9+
gem 'mutex_m'
10+
511
# Exclude problematic versions of cocoapods and activesupport that causes build failures.
612
gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1'
713
gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0'

packages/react-native/example/android/app/src/main/java/com/amplifyrtncoreexample/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()
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
buildscript {
22
ext {
3-
buildToolsVersion = "34.0.0"
4-
minSdkVersion = 23
5-
compileSdkVersion = 34
6-
targetSdkVersion = 34
7-
ndkVersion = "26.1.10909125"
8-
kotlinVersion = "1.9.25"
3+
buildToolsVersion = "35.0.0"
4+
minSdkVersion = 24
5+
compileSdkVersion = 35
6+
targetSdkVersion = 35
7+
ndkVersion = "27.0.12077973"
8+
kotlinVersion = "2.0.21"
99
}
1010
repositories {
1111
google()
@@ -18,4 +18,4 @@ buildscript {
1818
}
1919
}
2020

21-
apply plugin: "com.facebook.react.rootproject"
21+
// apply plugin: "com.facebook.react.rootproject"

packages/react-native/example/android/gradle.properties

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m
32
android.useAndroidX=true
43
reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64
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.7-all.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip
44
networkTimeout=10000
55
zipStoreBase=GRADLE_USER_HOME
66
zipStorePath=wrapper/dists

packages/react-native/example/babel.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const path = require('path');
33
const pak = require('../package.json');
44

55
module.exports = {
6-
presets: ['module:metro-react-native-babel-preset'],
6+
presets: ['module:@react-native/babel-preset'],
77
plugins: [
88
[
99
'module-resolver',

packages/react-native/example/ios/AmplifyRTNCoreExample/AppDelegate.mm

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
1515
}
1616

1717
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
18+
{
19+
return [self bundleURL];
20+
}
21+
22+
- (NSURL *)bundleURL
1823
{
1924
#if DEBUG
2025
return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"];

packages/react-native/example/ios/Podfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ require Pod::Executable.execute_command('node', ['-p',
77
platform :ios, min_ios_version_supported
88
prepare_react_native_project!
99

10-
1110
linkage = ENV['USE_FRAMEWORKS']
1211
if linkage != nil
1312
Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green
@@ -22,7 +21,8 @@ target 'AmplifyRTNCoreExample' do
2221
use_react_native!(
2322
:path => config[:reactNativePath],
2423
:hermes_enabled => flags[:hermes_enabled],
25-
:fabric_enabled => flags[:fabric_enabled],
24+
:fabric_enabled => false,
25+
:new_arch_enabled => false,
2626
:app_path => "#{Pod::Config.instance.installation_root}/.."
2727
)
2828

@@ -35,7 +35,8 @@ target 'AmplifyRTNCoreExample' do
3535
react_native_post_install(
3636
installer,
3737
config[:reactNativePath],
38-
:mac_catalyst_enabled => false
38+
:mac_catalyst_enabled => false,
39+
:ccache_enabled => ENV['USE_CCACHE'] == '1'
3940
)
4041
end
4142
end

packages/react-native/example/metro.config.js

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const config = {
1717
// We need to make sure that only one version is loaded for peerDependencies
1818
// So we block them at the root, and alias them to the versions in example's node_modules
1919
resolver: {
20-
blacklistRE: exclusionList(
20+
blockList: exclusionList(
2121
modules.map(
2222
m => new RegExp(`^${escape(path.join(root, 'node_modules', m))}\\/.*$`),
2323
),
@@ -27,19 +27,8 @@ const config = {
2727

2828
return acc;
2929
}, {}),
30-
// eslint-disable-next-line camelcase
3130
unstable_enableSymlinks: true,
3231
},
33-
transformer: {
34-
getTransformOptions: async () => ({
35-
transform: {
36-
experimentalImportSupport: false,
37-
inlineRequires: true,
38-
},
39-
}),
40-
},
4132
};
4233

43-
config.resetCache = true;
44-
4534
module.exports = mergeConfig(getDefaultConfig(__dirname), config);

packages/react-native/example/package.json

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,23 @@
1010
"build:ios": "cd ios && xcodebuild -workspace AmplifyRTNCoreExample.xcworkspace -scheme AmplifyRTNCoreExample -configuration Debug -sdk iphonesimulator CC=clang CPLUSPLUS=clang++ LD=clang LDPLUSPLUS=clang++ GCC_OPTIMIZATION_LEVEL=0 GCC_PRECOMPILE_PREFIX_HEADER=YES ASSETCATALOG_COMPILER_OPTIMIZATION=time DEBUG_INFORMATION_FORMAT=dwarf COMPILER_INDEX_STORE_ENABLE=NO"
1111
},
1212
"dependencies": {
13-
"react": "^18.3.1",
14-
"react-native": "0.75.5"
13+
"react": "19.0.0",
14+
"react-native": "0.79.2"
1515
},
1616
"devDependencies": {
17-
"@babel/core": "^7.20.0",
18-
"@babel/preset-env": "^7.20.0",
19-
"@babel/runtime": "^7.20.0",
20-
"@react-native/metro-config": "^0.72.11",
21-
"babel-plugin-module-resolver": "^5.0.0",
22-
"metro-react-native-babel-preset": "0.76.8"
17+
"@babel/core": "^7.25.2",
18+
"@babel/preset-env": "^7.25.3",
19+
"@babel/runtime": "^7.25.0",
20+
"@react-native-community/cli": "18.0.1",
21+
"@react-native-community/cli-platform-android": "18.0.0",
22+
"@react-native-community/cli-platform-ios": "18.0.0",
23+
"@react-native/babel-preset": "0.79.2",
24+
"@react-native/metro-config": "0.79.2",
25+
"@react-native/typescript-config": "0.79.2",
26+
"babel-plugin-module-resolver": "^5.0.0"
2327
},
2428
"engines": {
25-
"node": ">=16"
29+
"node": ">=18"
2630
},
2731
"workspaces": {
2832
"nohoist": [

0 commit comments

Comments
 (0)