Skip to content

Commit 3ee8223

Browse files
authored
Merge pull request #67 from revtel/RN76
feat: react native 76.9 upgrade
2 parents 55079ff + 599fbb3 commit 3ee8223

File tree

28 files changed

+8825
-9617
lines changed

28 files changed

+8825
-9617
lines changed

.gitignore

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ DerivedData
2020
*.hmap
2121
*.ipa
2222
*.xcuserstate
23-
ios/.xcode.env.local
23+
**/.xcode.env.local
2424

2525
# Android/IntelliJ
2626
#
@@ -56,7 +56,7 @@ yarn-error.log
5656
*.jsbundle
5757

5858
# Ruby / CocoaPods
59-
/ios/Pods/
59+
**/Pods/
6060
/vendor/bundle/
6161

6262
# Temporary files created by Metro to check the health of the file watcher
@@ -69,4 +69,12 @@ yarn-error.log
6969
.env
7070
*.jsbundle.map
7171
*.android.bundle
72-
*.android.bundle.map
72+
*.android.bundle.map
73+
74+
# Yarn
75+
.yarn/*
76+
!.yarn/patches
77+
!.yarn/plugins
78+
!.yarn/releases
79+
!.yarn/sdks
80+
!.yarn/versions

Gemfile

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
source 'https://rubygems.org'
2-
2+
33
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
44
ruby ">= 2.6.10"
5-
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.3', '< 7.1.0'
5+
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'

android/app/build.gradle

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
apply plugin: "com.android.application"
2+
apply plugin: "org.jetbrains.kotlin.android"
23
apply plugin: "com.facebook.react"
34

45
/**
@@ -7,14 +8,14 @@ apply plugin: "com.facebook.react"
78
*/
89
react {
910
/* Folders */
10-
// The root of your project, i.e. where "package.json" lives. Default is '..'
11-
// root = file("../")
12-
// The folder where the react-native NPM package is. Default is ../node_modules/react-native
13-
// reactNativeDir = file("../node_modules/react-native")
14-
// The folder where the react-native Codegen package is. Default is ../node_modules/@react-native/codegen
15-
// codegenDir = file("../node_modules/@react-native/codegen")
16-
// The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js
17-
// 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")
1819

1920
/* Variants */
2021
// The list of variants to that are debuggable. For those we're going to
@@ -48,6 +49,9 @@ react {
4849
//
4950
// The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
5051
// hermesFlags = ["-O", "-output-source-map"]
52+
53+
/* Autolinking */
54+
autolinkLibrariesWithApp()
5155
}
5256

5357
/**
@@ -70,16 +74,16 @@ def jscFlavor = 'org.webkit:android-jsc:+'
7074

7175
android {
7276
ndkVersion rootProject.ext.ndkVersion
73-
74-
compileSdkVersion rootProject.ext.compileSdkVersion
77+
buildToolsVersion rootProject.ext.buildToolsVersion
78+
compileSdk rootProject.ext.compileSdkVersion
7579

7680
namespace "com.washow.nfcopenrewriter"
7781
defaultConfig {
7882
applicationId "com.washow.nfcopenrewriter"
7983
minSdkVersion rootProject.ext.minSdkVersion
8084
targetSdkVersion rootProject.ext.targetSdkVersion
81-
versionCode 2003
82-
versionName "0.2.3"
85+
versionCode 3003
86+
versionName "0.3.3"
8387
}
8488
signingConfigs {
8589
debug {
@@ -115,19 +119,11 @@ dependencies {
115119
// The version of react-native is set by the React Native Gradle Plugin
116120
implementation("com.facebook.react:react-android")
117121

118-
debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}")
119-
debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
120-
exclude group:'com.squareup.okhttp3', module:'okhttp'
121-
}
122-
123-
debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}")
124122
if (hermesEnabled.toBoolean()) {
125123
implementation("com.facebook.react:hermes-android")
126124
} else {
127125
implementation jscFlavor
128126
}
129127
}
130128

131-
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
132-
133129
apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"

android/app/src/debug/AndroidManifest.xml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,5 @@
77
<application
88
android:usesCleartextTraffic="true"
99
tools:targetApi="28"
10-
tools:ignore="GoogleAppIndexingWarning">
11-
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" android:exported="false" />
12-
</application>
10+
tools:ignore="GoogleAppIndexingWarning"/>
1311
</manifest>

android/app/src/debug/java/com/nfcopenreader/ReactNativeFlipper.java

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

android/app/src/main/java/com/washow/nfcopenrewriter/MainActivity.java

Lines changed: 0 additions & 39 deletions
This file was deleted.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package com.washow.nfcopenrewriter
2+
3+
import com.facebook.react.ReactActivity
4+
import com.facebook.react.ReactActivityDelegate
5+
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled
6+
import com.facebook.react.defaults.DefaultReactActivityDelegate
7+
import android.os.Bundle
8+
9+
10+
class MainActivity : ReactActivity() {
11+
12+
/**
13+
* Returns the name of the main component registered from JavaScript. This is used to schedule
14+
* rendering of the component.
15+
*/
16+
override fun getMainComponentName(): String = "NfcOpenReader"
17+
18+
/**
19+
* Returns the instance of the [ReactActivityDelegate]. We use [DefaultReactActivityDelegate]
20+
* which allows you to enable New Architecture with a single boolean flags [fabricEnabled]
21+
*/
22+
override fun createReactActivityDelegate(): ReactActivityDelegate =
23+
DefaultReactActivityDelegate(this, mainComponentName, fabricEnabled)
24+
25+
// react-navigation
26+
override fun onCreate(savedInstanceState: Bundle?) {
27+
super.onCreate(null)
28+
}
29+
}

android/app/src/main/java/com/washow/nfcopenrewriter/MainApplication.java

Lines changed: 0 additions & 62 deletions
This file was deleted.
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
package com.washow.nfcopenrewriter
2+
3+
import android.app.Application
4+
import com.facebook.react.PackageList
5+
import com.facebook.react.ReactApplication
6+
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
10+
import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
11+
import com.facebook.react.defaults.DefaultReactNativeHost
12+
import com.facebook.react.soloader.OpenSourceMergedSoMapping
13+
import com.facebook.soloader.SoLoader
14+
15+
class MainApplication : Application(), ReactApplication {
16+
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(RevtelNativePackage())
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)
35+
36+
override fun onCreate() {
37+
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+
}
43+
}
44+
}

0 commit comments

Comments
 (0)