Skip to content

Commit cac3bc4

Browse files
itsramielMaciej Makowski
andauthored
feat/fix: update to react native 0.80.0 and fix android (#511)
* feat: update to react native 0.80.0 * fix: use ResourceDrawableIdHelper as object * refactor: use deprecated property for backward compat --------- Co-authored-by: Maciej Makowski <maciej.makowski2608@gmail.com>
1 parent d36987f commit cac3bc4

File tree

16 files changed

+1992
-1525
lines changed

16 files changed

+1992
-1525
lines changed

apps/common-app/package.json

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,36 +7,36 @@
77
"react-native": "*"
88
},
99
"dependencies": {
10-
"@react-native-vector-icons/common": "^11.0.0",
11-
"@react-native-vector-icons/icomoon": "^0.0.1",
12-
"@react-navigation/native": "^7.0.15",
13-
"@react-navigation/native-stack": "^7.2.1",
14-
"@react-navigation/stack": "^7.1.2",
15-
"@shopify/react-native-skia": "1.11.11",
10+
"@react-native-vector-icons/common": "12.0.1",
11+
"@react-native-vector-icons/icomoon": "12.0.1",
12+
"@react-navigation/native": "7.1.13",
13+
"@react-navigation/native-stack": "7.3.18",
14+
"@react-navigation/stack": "7.3.6",
15+
"@shopify/react-native-skia": "2.0.5",
1616
"react-native-audio-api": "workspace:*",
1717
"react-native-dotenv": "3.4.11",
18-
"react-native-gesture-handler": "2.24.0",
19-
"react-native-reanimated": "3.17.1",
20-
"react-native-safe-area-context": "5.3.0",
21-
"react-native-screens": "4.9.1"
18+
"react-native-gesture-handler": "2.26.0",
19+
"react-native-reanimated": "3.18.0",
20+
"react-native-safe-area-context": "5.4.1",
21+
"react-native-screens": "4.11.1"
2222
},
2323
"devDependencies": {
2424
"@babel/core": "^7.25.2",
2525
"@babel/preset-env": "^7.25.2",
2626
"@babel/runtime": "^7.25.0",
27-
"@react-native/babel-preset": "0.77.1",
28-
"@react-native/eslint-config": "0.77.1",
29-
"@react-native/metro-config": "0.77.1",
30-
"@react-native/typescript-config": "0.77.1",
27+
"@react-native/babel-preset": "0.80.0",
28+
"@react-native/eslint-config": "0.80.0",
29+
"@react-native/metro-config": "0.80.0",
30+
"@react-native/typescript-config": "0.80.0",
3131
"@types/jest": "^29.5.13",
32-
"@types/react": "^18.2.6",
33-
"@types/react-test-renderer": "^18.0.0",
32+
"@types/react": "^19.1.0",
33+
"@types/react-test-renderer": "^19.1.0",
3434
"eslint": "^8.57.0",
3535
"jest": "^29.6.3",
3636
"prettier": "^3.3.3",
37-
"react": "18.3.1",
38-
"react-native": "0.77.1",
39-
"react-test-renderer": "18.3.1",
37+
"react": "19.1.0",
38+
"react-native": "0.80.0",
39+
"react-test-renderer": "19.1.0",
4040
"typescript": "~5.3.0"
4141
}
4242
}

apps/fabric-example/Gemfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,9 @@ gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1'
88
gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0'
99
gem 'xcodeproj', '< 1.26.0'
1010
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'

apps/fabric-example/android/app/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,14 @@ def enableProguardInReleaseBuilds = false
6363
* The preferred build flavor of JavaScriptCore (JSC)
6464
*
6565
* For example, to use the international variant, you can use:
66-
* `def jscFlavor = 'org.webkit:android-jsc-intl:+'`
66+
* `def jscFlavor = io.github.react-native-community:jsc-android-intl:2026004.+`
6767
*
6868
* The international variant includes ICU i18n library and necessary data
6969
* allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
7070
* give correct results when using with locales other than en-US. Note that
7171
* this variant is about 6MiB larger per architecture than default.
7272
*/
73-
def jscFlavor = 'org.webkit:android-jsc:+'
73+
def jscFlavor = 'io.github.react-native-community:jsc-android:2026004.+'
7474

7575
android {
7676
ndkVersion rootProject.ext.ndkVersion

apps/fabric-example/android/app/src/main/java/com/fabricexample/MainApplication.kt

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,11 @@ import android.app.Application
44
import com.facebook.react.PackageList
55
import com.facebook.react.ReactApplication
66
import com.facebook.react.ReactHost
7+
import com.facebook.react.ReactNativeApplicationEntryPoint.loadReactNative
78
import com.facebook.react.ReactNativeHost
89
import com.facebook.react.ReactPackage
9-
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
13-
import com.facebook.soloader.SoLoader
1412

1513
class MainApplication : Application(), ReactApplication {
1614

@@ -35,10 +33,6 @@ class MainApplication : Application(), ReactApplication {
3533

3634
override fun onCreate() {
3735
super.onCreate()
38-
SoLoader.init(this, OpenSourceMergedSoMapping)
39-
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
40-
// If you opted-in for the New Architecture, we load the native entry point for this app.
41-
load()
42-
}
36+
loadReactNative(this)
4337
}
4438
}

apps/fabric-example/android/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ buildscript {
33
buildToolsVersion = "35.0.0"
44
minSdkVersion = 24
55
compileSdkVersion = 35
6-
targetSdkVersion = 34
6+
targetSdkVersion = 35
77
ndkVersion = "27.1.12297006"
8-
kotlinVersion = "2.0.21"
8+
kotlinVersion = "2.1.20"
99
}
1010
repositories {
1111
google()
Binary file not shown.

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

apps/fabric-example/android/gradlew

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,7 @@ done
8686
# shellcheck disable=SC2034
8787
APP_BASE_NAME=${0##*/}
8888
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
89-
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
90-
' "$PWD" ) || exit
89+
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
9190

9291
# Use the maximum available, or set MAX_FD != -1 to use that value.
9392
MAX_FD=maximum
@@ -115,7 +114,7 @@ case "$( uname )" in #(
115114
NONSTOP* ) nonstop=true ;;
116115
esac
117116

118-
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
117+
CLASSPATH="\\\"\\\""
119118

120119

121120
# Determine the Java command to use to start the JVM.
@@ -206,15 +205,15 @@ fi
206205
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
207206

208207
# Collect all arguments for the java command:
209-
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
208+
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
210209
# and any embedded shellness will be escaped.
211210
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
212211
# treated as '${Hostname}' itself on the command line.
213212

214213
set -- \
215214
"-Dorg.gradle.appname=$APP_BASE_NAME" \
216215
-classpath "$CLASSPATH" \
217-
org.gradle.wrapper.GradleWrapperMain \
216+
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
218217
"$@"
219218

220219
# Stop when "xargs" is not available.

apps/fabric-example/android/gradlew.bat

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
@REM Copyright (c) Meta Platforms, Inc. and affiliates.
2+
@REM
3+
@REM This source code is licensed under the MIT license found in the
4+
@REM LICENSE file in the root directory of this source tree.
5+
16
@rem
27
@rem Copyright 2015 the original author or authors.
38
@rem
@@ -70,11 +75,11 @@ goto fail
7075
:execute
7176
@rem Setup the command line
7277

73-
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
78+
set CLASSPATH=
7479

7580

7681
@rem Execute Gradle
77-
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
82+
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %*
7883

7984
:end
8085
@rem End local scope for the variables with windows NT shell

apps/fabric-example/ios/FabricExample/AppDelegate.swift

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,36 @@ import React_RCTAppDelegate
44
import ReactAppDependencyProvider
55

66
@main
7-
class AppDelegate: RCTAppDelegate {
8-
override func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
9-
self.moduleName = "FabricExample"
10-
self.dependencyProvider = RCTAppDependencyProvider()
7+
class AppDelegate: UIResponder, UIApplicationDelegate {
8+
var window: UIWindow?
119

12-
// You can add your custom initial props in the dictionary below.
13-
// They will be passed down to the ViewController used by React Native.
14-
self.initialProps = [:]
10+
var reactNativeDelegate: ReactNativeDelegate?
11+
var reactNativeFactory: RCTReactNativeFactory?
1512

16-
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
13+
func application(
14+
_ application: UIApplication,
15+
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil
16+
) -> Bool {
17+
let delegate = ReactNativeDelegate()
18+
let factory = RCTReactNativeFactory(delegate: delegate)
19+
delegate.dependencyProvider = RCTAppDependencyProvider()
20+
21+
reactNativeDelegate = delegate
22+
reactNativeFactory = factory
23+
24+
window = UIWindow(frame: UIScreen.main.bounds)
25+
26+
factory.startReactNative(
27+
withModuleName: "FabricExample",
28+
in: window,
29+
launchOptions: launchOptions
30+
)
31+
32+
return true
1733
}
34+
}
1835

36+
class ReactNativeDelegate: RCTDefaultReactNativeFactoryDelegate {
1937
override func sourceURL(for bridge: RCTBridge) -> URL? {
2038
self.bundleURL()
2139
}

0 commit comments

Comments
 (0)