Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependencies and upgrade to RN 0.76.5 #8421

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .solidarity
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
{
"rule": "cli",
"binary": "pod",
"semver": "1.15.2",
"semver": "1.16.1",
"platform": "darwin"
}
],
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
source "https://rubygems.org"

gem "cocoapods", "1.15.2"
gem "cocoapods", "1.16.1"
38 changes: 21 additions & 17 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,32 @@ GEM
base64
nkf
rexml
activesupport (7.1.3.4)
activesupport (7.2.2.1)
base64
benchmark (>= 0.3)
bigdecimal
concurrent-ruby (~> 1.0, >= 1.0.2)
concurrent-ruby (~> 1.0, >= 1.3.1)
connection_pool (>= 2.2.5)
drb
i18n (>= 1.6, < 2)
logger (>= 1.4.2)
minitest (>= 5.1)
mutex_m
tzinfo (~> 2.0)
securerandom (>= 0.3)
tzinfo (~> 2.0, >= 2.0.5)
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
algoliasearch (1.27.5)
httpclient (~> 2.8, >= 2.8.3)
json (>= 1.5.1)
atomos (0.1.3)
base64 (0.2.0)
benchmark (0.4.0)
bigdecimal (3.1.8)
claide (1.1.0)
cocoapods (1.15.2)
cocoapods (1.16.1)
addressable (~> 2.8)
claide (>= 1.0.2, < 2.0)
cocoapods-core (= 1.15.2)
cocoapods-core (= 1.16.1)
cocoapods-deintegrate (>= 1.0.3, < 2.0)
cocoapods-downloader (>= 2.1, < 3.0)
cocoapods-plugins (>= 1.0.0, < 2.0)
Expand All @@ -41,8 +44,8 @@ GEM
molinillo (~> 0.8.0)
nap (~> 1.0)
ruby-macho (>= 2.3.0, < 3.0)
xcodeproj (>= 1.23.0, < 2.0)
cocoapods-core (1.15.2)
xcodeproj (>= 1.26.0, < 2.0)
cocoapods-core (1.16.1)
activesupport (>= 5.0, < 8)
addressable (~> 2.8)
algoliasearch (~> 1.0)
Expand Down Expand Up @@ -73,36 +76,37 @@ GEM
fuzzy_match (2.0.4)
gh_inspector (1.1.3)
httpclient (2.8.3)
i18n (1.14.5)
i18n (1.14.6)
concurrent-ruby (~> 1.0)
json (2.7.2)
minitest (5.25.1)
json (2.9.0)
logger (1.6.3)
minitest (5.25.4)
molinillo (0.8.0)
mutex_m (0.2.0)
nanaimo (0.3.0)
nanaimo (0.4.0)
nap (1.1.0)
netrc (0.11.0)
nkf (0.2.0)
public_suffix (4.0.7)
rexml (3.3.9)
ruby-macho (2.5.1)
securerandom (0.4.0)
typhoeus (1.4.1)
ethon (>= 0.9.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
xcodeproj (1.25.0)
xcodeproj (1.27.0)
CFPropertyList (>= 2.3.3, < 4.0)
atomos (~> 0.1.3)
claide (>= 1.0.2, < 2.0)
colored2 (~> 3.1)
nanaimo (~> 0.3.0)
rexml (>= 3.3.2, < 4.0)
nanaimo (~> 0.4.0)
rexml (>= 3.3.6, < 4.0)

PLATFORMS
ruby

DEPENDENCIES
cocoapods (= 1.15.2)
cocoapods (= 1.16.1)

BUNDLED WITH
2.5.11
20 changes: 11 additions & 9 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ apply plugin: "com.facebook.react"

react {
/* Folders */
// The root of your project, i.e. where "package.json" lives. Default is '..'
// root = file("../")
// The folder where the react-native NPM package is. Default is ../node_modules/react-native
// reactNativeDir = file("../node_modules/react-native")
// The folder where the react-native Codegen package is. Default is ../node_modules/@react-native/codegen
// codegenDir = file("../node_modules/@react-native/codegen")
// The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js
// cliFile = file("../node_modules/react-native/cli.js")
// The root of your project, i.e. where "package.json" lives. Default is '../..'
// root = file("../../")
// The folder where the react-native NPM package is. Default is ../../node_modules/react-native
// reactNativeDir = file("../../node_modules/react-native")
// The folder where the react-native Codegen package is. Default is ../../node_modules/@react-native/codegen
// codegenDir = file("../../node_modules/@react-native/codegen")
// The cli.js file which is the React Native CLI entrypoint. Default is ../../node_modules/react-native/cli.js
// cliFile = file("../../node_modules/react-native/cli.js")
/* Variants */
// The list of variants to that are debuggable. For those we're going to
// skip the bundling of the JS bundle and the assets. By default is just 'debug'.
Expand Down Expand Up @@ -47,6 +47,9 @@ apply plugin: "com.facebook.react"
//
// The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
// hermesFlags = ["-O", "-output-source-map"]

/* Autolinking */
autolinkLibrariesWithApp()
}

apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"
Expand Down Expand Up @@ -253,4 +256,3 @@ tasks.register('copyDownloadableDepsToLibs', Copy) {
}

apply plugin: 'com.google.gms.google-services'
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class Network {
private static final Promise emptyPromise = new ResolvePromise();

public static void init(Context context) {
final ReactApplicationContext reactContext = (ApiClientModuleImpl.context == null) ? new ReactApplicationContext(context) : ApiClientModuleImpl.context;
final ReactApplicationContext reactContext = (ApiClientModuleImpl.context == null) ? (ReactApplicationContext) context.getApplicationContext() : ApiClientModuleImpl.context;
clientModule = new ApiClientModuleImpl(reactContext);
createClientOptions();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.mattermost.helpers;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.facebook.react.bridge.Promise;
import com.facebook.react.bridge.WritableMap;
Expand All @@ -9,58 +10,59 @@
* ResolvePromise: Helper class that abstracts boilerplate
*/
public class ResolvePromise implements Promise {

@Override
public void resolve(@javax.annotation.Nullable Object value) {
public void reject(@NonNull String s) {

}

@Override
public void reject(String code, String message) {
public void resolve(@Nullable Object o) {

}

@Override
public void reject(String code, @NonNull WritableMap map) {
public void reject(@NonNull String s, @Nullable String s1) {

}

@Override
public void reject(String code, Throwable e) {
public void reject(@NonNull String s, @Nullable Throwable throwable) {

}

@Override
public void reject(Throwable e, WritableMap map) {
public void reject(@NonNull String s, @Nullable String s1, @Nullable Throwable throwable) {

}

@Override
public void reject(String code, Throwable e, WritableMap map) {
public void reject(@NonNull Throwable throwable) {

}

@Override
public void reject(String code, String message, Throwable e, WritableMap map) {
public void reject(@NonNull Throwable throwable, @NonNull WritableMap writableMap) {

}

@Override
public void reject(String code, String message, Throwable e) {
public void reject(@NonNull String s, @NonNull WritableMap writableMap) {

}

@Override
public void reject(String code, String message, @NonNull WritableMap map) {
public void reject(@NonNull String s, @Nullable Throwable throwable, @NonNull WritableMap writableMap) {

}

@Override
public void reject(String message) {
public void reject(@NonNull String s, @Nullable String s1, @NonNull WritableMap writableMap) {

}

@Override
public void reject(Throwable reason) {
public void reject(@Nullable String s, @Nullable String s1, @Nullable Throwable throwable, @Nullable WritableMap writableMap) {

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ internal suspend fun PushNotificationDataRunnable.Companion.fetch(serverUrl: Str
}
}

override fun reject(code: String, message: String) {
override fun reject(code: String, message: String?) {
cont.resumeWith(Result.failure(IOException("Unexpected code $code $message")))
}

override fun reject(reason: Throwable?) {
cont.resumeWith(Result.failure(IOException("Unexpected code $reason")))
override fun reject(throwable: Throwable) {
cont.resumeWith(Result.failure(IOException("Unexpected code $throwable")))
}
})
}
Expand All @@ -41,12 +41,12 @@ internal suspend fun PushNotificationDataRunnable.Companion.fetchWithPost(server
cont.resumeWith(Result.success(response))
}

override fun reject(code: String, message: String) {
override fun reject(code: String, message: String?) {
cont.resumeWith(Result.failure(IOException("Unexpected code $code $message")))
}

override fun reject(reason: Throwable?) {
cont.resumeWith(Result.failure(IOException("Unexpected code $reason")))
override fun reject(throwable: Throwable) {
cont.resumeWith(Result.failure(IOException("Unexpected code $throwable")))
}
})
}
Expand Down
31 changes: 4 additions & 27 deletions android/app/src/main/java/com/mattermost/rnbeta/MainApplication.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@ import android.content.res.Configuration
import android.os.Bundle
import com.facebook.react.PackageList
import com.facebook.react.ReactHost
import com.facebook.react.ReactInstanceManager
import com.facebook.react.ReactNativeHost
import com.facebook.react.ReactPackage
import com.facebook.react.bridge.ReactContext
import com.facebook.react.bridge.UiThreadUtil
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load
import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
import com.facebook.react.defaults.DefaultReactNativeHost
import com.facebook.react.soloader.OpenSourceMergedSoMapping
import com.facebook.react.modules.network.OkHttpClientProvider
import com.facebook.soloader.SoLoader
import com.mattermost.networkclient.RCTOkHttpClientFactory
import com.mattermost.rnshare.helpers.RealPathUtil
import com.mattermost.turbolog.TurboLog
import com.mattermost.turbolog.ConfigureOptions
import com.nozbe.watermelondb.jsi.JSIInstaller
import com.nozbe.watermelondb.jsi.WatermelonDBJSIPackage
import com.reactnativenavigation.NavigationApplication
import com.wix.reactnativenotifications.RNNotificationsPackage
import com.wix.reactnativenotifications.core.AppLaunchHelper
Expand All @@ -45,6 +45,7 @@ class MainApplication : NavigationApplication(), INotificationsApplication {
// Packages that cannot be autolinked yet can be added manually here, for example:
// add(MyReactNativePackage())
add(RNNotificationsPackage(this@MainApplication))
add(WatermelonDBJSIPackage())
}

override fun getJSMainModuleName(): String = "index"
Expand Down Expand Up @@ -78,13 +79,12 @@ class MainApplication : NavigationApplication(), INotificationsApplication {
OkHttpClientProvider.setOkHttpClientFactory(RCTOkHttpClientFactory())
ExpoImageOkHttpClientGlideModule.okHttpClient = RCTOkHttpClientFactory().createNewNetworkModuleClient()

SoLoader.init(this, false)
SoLoader.init(this, OpenSourceMergedSoMapping)
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
// If you opted-in for the New Architecture, we load the native entry point for this app.
load(bridgelessEnabled = false)
}
ApplicationLifecycleDispatcher.onApplicationCreate(this)
registerJSIModules()
}

override fun onConfigurationChanged(newConfig: Configuration) {
Expand Down Expand Up @@ -117,27 +117,4 @@ class MainApplication : NavigationApplication(), INotificationsApplication {
}
}
}

@Suppress("DEPRECATION")
private fun registerJSIModules() {
val reactInstanceManager = reactNativeHost.reactInstanceManager

if (!listenerAdded) {
listenerAdded = true
reactInstanceManager.addReactInstanceEventListener(object : ReactInstanceManager.ReactInstanceEventListener {
override fun onReactContextInitialized(context: ReactContext) {
runOnJSQueueThread {
registerWatermelonJSI(context)
}
}
})
}
}

private fun registerWatermelonJSI(context: ReactContext) {
val holder = context.javaScriptContextHolder?.get()
if (holder != null) {
JSIInstaller.install(context, holder)
}
}
}
10 changes: 5 additions & 5 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
buildscript {
ext {
buildToolsVersion = "34.0.0"
buildToolsVersion = "35.0.0"
minSdkVersion = 24
compileSdkVersion = 34
compileSdkVersion = 35
targetSdkVersion = 34
supportLibVersion = "33.0.0"
kotlinVersion = "1.9.22"
supportLibVersion = "35.0.0"
kotlinVersion = "1.9.24"
kotlin_version = kotlinVersion
RNNKotlinVersion = kotlinVersion
firebaseVersion = "24.0.0"
firebaseVersion = "24.1.0"
ndkVersion = "26.1.10909125"
}
repositories {
Expand Down
3 changes: 0 additions & 3 deletions android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ org.gradle.jvmargs=-Xmx4096m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true

# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true

# Use this property to specify which architecture you want to build.
# You can also override it from the CLI using
# ./gradlew <task> -PreactNativeArchitectures=x86_64
Expand Down
Binary file modified android/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
Loading