Skip to content

Commit 624f347

Browse files
authored
feat: react native 82 upgrade (#92)
* updated file changes for react native 82 upgrade, ios and android working * removed rn community dependencies in main package.json * package-lock.json file regeneration
1 parent e383f8e commit 624f347

23 files changed

+21197
-14826
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ android/*.iml
2929
android/local.properties
3030
android/.settings
3131
android/.project
32+
.kotlin/
3233
Session.vim
3334

3435

RNFS2.xcodeproj/project.pbxproj

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@
9494
F12AFB931ADAF8F800E0535D /* Project object */ = {
9595
isa = PBXProject;
9696
attributes = {
97-
LastUpgradeCheck = 0630;
97+
LastUpgradeCheck = 1500;
9898
ORGANIZATIONNAME = "Johannes Lumpe";
9999
TargetAttributes = {
100100
F12AFB9A1ADAF8F800E0535D = {
@@ -138,7 +138,7 @@
138138
isa = XCBuildConfiguration;
139139
buildSettings = {
140140
ALWAYS_SEARCH_USER_PATHS = NO;
141-
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
141+
CLANG_CXX_LANGUAGE_STANDARD = "c++20";
142142
CLANG_CXX_LIBRARY = "libc++";
143143
CLANG_ENABLE_MODULES = YES;
144144
CLANG_ENABLE_OBJC_ARC = YES;
@@ -169,7 +169,7 @@
169169
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
170170
GCC_WARN_UNUSED_FUNCTION = YES;
171171
GCC_WARN_UNUSED_VARIABLE = YES;
172-
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
172+
IPHONEOS_DEPLOYMENT_TARGET = 15.1;
173173
MTL_ENABLE_DEBUG_INFO = YES;
174174
ONLY_ACTIVE_ARCH = YES;
175175
SDKROOT = iphoneos;
@@ -180,7 +180,7 @@
180180
isa = XCBuildConfiguration;
181181
buildSettings = {
182182
ALWAYS_SEARCH_USER_PATHS = NO;
183-
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
183+
CLANG_CXX_LANGUAGE_STANDARD = "c++20";
184184
CLANG_CXX_LIBRARY = "libc++";
185185
CLANG_ENABLE_MODULES = YES;
186186
CLANG_ENABLE_OBJC_ARC = YES;
@@ -205,7 +205,7 @@
205205
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
206206
GCC_WARN_UNUSED_FUNCTION = YES;
207207
GCC_WARN_UNUSED_VARIABLE = YES;
208-
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
208+
IPHONEOS_DEPLOYMENT_TARGET = 15.1;
209209
MTL_ENABLE_DEBUG_INFO = NO;
210210
SDKROOT = iphoneos;
211211
VALIDATE_PRODUCT = YES;

android/gradlew

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/sh
22

33
#
4-
# Copyright © 2015-2021 the original authors.
4+
# Copyright © 2015 the original authors.
55
#
66
# Licensed under the Apache License, Version 2.0 (the "License");
77
# you may not use this file except in compliance with the License.
@@ -15,6 +15,8 @@
1515
# See the License for the specific language governing permissions and
1616
# limitations under the License.
1717
#
18+
# SPDX-License-Identifier: Apache-2.0
19+
#
1820

1921
##############################################################################
2022
#
@@ -55,8 +57,7 @@
5557
# Darwin, MinGW, and NonStop.
5658
#
5759
# (3) This script is generated from the Groovy template
58-
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
59-
# within the Gradle project.
60+
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
6061
#
6162
# You can find Gradle at https://github.com/gradle/gradle/.
6263
#
@@ -80,11 +81,11 @@ do
8081
esac
8182
done
8283

83-
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
84-
8584
APP_NAME="Gradle"
8685
APP_BASE_NAME=${0##*/}
8786

87+
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
88+
8889
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
8990
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
9091

@@ -114,7 +115,7 @@ case "$( uname )" in #(
114115
NONSTOP* ) nonstop=true ;;
115116
esac
116117

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

119120

120121
# Determine the Java command to use to start the JVM.
@@ -160,7 +161,7 @@ fi
160161
# * -classpath
161162
# * -D...appname settings
162163
# * --module-path (only if needed)
163-
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
164+
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
164165

165166
# For Cygwin or MSYS, switch paths to Windows format before running java
166167
if "$cygwin" || "$msys" ; then
@@ -202,7 +203,7 @@ fi
202203
set -- \
203204
"-Dorg.gradle.appname=$APP_BASE_NAME" \
204205
-classpath "$CLASSPATH" \
205-
org.gradle.wrapper.GradleWrapperMain \
206+
-jar "$APP_HOME/gradle/wrapper/gradle-wrapper.jar" \
206207
"$@"
207208

208209
# Use "xargs" to parse quoted args.

android/gradlew.bat

Lines changed: 9 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
@@ -13,6 +18,8 @@
1318
@rem See the License for the specific language governing permissions and
1419
@rem limitations under the License.
1520
@rem
21+
@rem SPDX-License-Identifier: Apache-2.0
22+
@rem
1623

1724
@if "%DEBUG%" == "" @echo off
1825
@rem ##########################################################################
@@ -67,11 +74,11 @@ goto fail
6774
:execute
6875
@rem Setup the command line
6976

70-
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
77+
set CLASSPATH=
7178

7279

7380
@rem Execute Gradle
74-
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
81+
"%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" %*
7582

7683
:end
7784
@rem End local scope for the variables with windows NT shell

example/.prettierrc.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
module.exports = {
22
arrowParens: 'avoid',
3-
bracketSameLine: true,
4-
bracketSpacing: false,
53
singleQuote: true,
64
trailingComma: 'all',
75
};

example/android/app/build.gradle

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ apply plugin: "com.facebook.react"
88
*/
99
react {
1010
/* Folders */
11-
// The root of your project, i.e. where "package.json" lives. Default is '..'
12-
// root = file("../")
13-
// The folder where the react-native NPM package is. Default is ../node_modules/react-native
14-
// reactNativeDir = file("../node_modules/react-native")
15-
// The folder where the react-native Codegen package is. Default is ../node_modules/@react-native/codegen
16-
// codegenDir = file("../node_modules/@react-native/codegen")
17-
// The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js
18-
// cliFile = file("../node_modules/react-native/cli.js")
11+
// The root of your project, i.e. where "package.json" lives. Default is '../..'
12+
// root = file("../../")
13+
// The folder where the react-native NPM package is. Default is ../../node_modules/react-native
14+
// reactNativeDir = file("../../node_modules/react-native")
15+
// The folder where the react-native Codegen package is. Default is ../../node_modules/@react-native/codegen
16+
// codegenDir = file("../../node_modules/@react-native/codegen")
17+
// The cli.js file which is the React Native CLI entrypoint. Default is ../../node_modules/react-native/cli.js
18+
// cliFile = file("../../node_modules/react-native/cli.js")
1919

2020
/* Variants */
2121
// The list of variants to that are debuggable. For those we're going to

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

Lines changed: 0 additions & 11 deletions
This file was deleted.

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
android:allowBackup="false"
1414
android:requestLegacyExternalStorage="true"
1515
android:theme="@style/AppTheme"
16+
android:usesCleartextTraffic="${usesCleartextTraffic}"
1617
android:supportsRtl="true">
1718
<activity
1819
android:name=".MainActivity"

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

Lines changed: 12 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -4,41 +4,27 @@ 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.ReactNativeHost
8-
import com.facebook.react.ReactPackage
9-
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load
7+
import com.facebook.react.ReactNativeApplicationEntryPoint.loadReactNative
108
import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
11-
import com.facebook.react.defaults.DefaultReactNativeHost
129
import com.facebook.react.soloader.OpenSourceMergedSoMapping
1310
import com.facebook.soloader.SoLoader
1411

1512
class MainApplication : Application(), ReactApplication {
1613

17-
override val reactNativeHost: ReactNativeHost =
18-
object : DefaultReactNativeHost(this) {
19-
override fun getPackages(): List<ReactPackage> =
20-
PackageList(this).packages.apply {
21-
// Packages that cannot be autolinked yet can be added manually here, for example:
22-
// add(MyReactNativePackage())
23-
}
24-
25-
override fun getJSMainModuleName(): String = "index"
26-
27-
override fun getUseDeveloperSupport(): Boolean = BuildConfig.DEBUG
28-
29-
override val isNewArchEnabled: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED
30-
override val isHermesEnabled: Boolean = BuildConfig.IS_HERMES_ENABLED
31-
}
32-
33-
override val reactHost: ReactHost
34-
get() = getDefaultReactHost(applicationContext, reactNativeHost)
14+
override val reactHost: ReactHost by lazy {
15+
getDefaultReactHost(
16+
context = applicationContext,
17+
packageList =
18+
PackageList(this).packages.apply {
19+
// Packages that cannot be autolinked yet can be added manually here, for example:
20+
// add(MyReactNativePackage())
21+
},
22+
)
23+
}
3524

3625
override fun onCreate() {
3726
super.onCreate()
3827
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-
}
28+
loadReactNative(this)
4329
}
4430
}

example/android/build.gradle

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

33
buildscript {
44
ext {
5-
buildToolsVersion = "35.0.0"
5+
buildToolsVersion = "36.0.0"
66
minSdkVersion = 24
7-
compileSdkVersion = 35
8-
targetSdkVersion = 35
7+
compileSdkVersion = 36
8+
targetSdkVersion = 36
99
ndkVersion = "27.1.12297006"
10-
kotlinVersion = "2.0.21"
10+
kotlinVersion = "2.1.20"
1111
}
1212
repositories {
1313
google()

0 commit comments

Comments
 (0)