Skip to content

Commit 124247e

Browse files
authored
Merge pull request #126 from larkox/dependenciesUpdate
2 parents 538497a + 3867cfa commit 124247e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+7293
-7923
lines changed

.husky/commit-msg

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
#!/bin/sh
2-
. "$(dirname "$0")/_/husky.sh"
3-
41
npx --no-install commitlint --edit "$1"

.husky/pre-commit

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
#!/bin/sh
2-
. "$(dirname "$0")/_/husky.sh"
3-
41
npm run lint && npm run typescript

android/build.gradle

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -127,13 +127,9 @@ dependencies {
127127
implementation "com.squareup.okhttp3:okhttp:4.12.0"
128128
implementation "com.squareup.okhttp3:okhttp-tls:4.12.0"
129129
implementation "com.squareup.okhttp3:okhttp-urlconnection:4.12.0"
130+
implementation("com.facebook.react:flipper-integration")
130131

131132
testImplementation "junit:junit:4.12"
132133
testImplementation "org.mockito:mockito-core:3.+"
133134
testImplementation "com.squareup.okhttp3:mockwebserver:4.12.0"
134-
135-
debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}")
136-
debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
137-
exclude group:'com.squareup.okhttp3', module:'okhttp'
138-
}
139135
}
4.91 KB
Binary file not shown.
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.1-all.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip
44
networkTimeout=10000
5+
validateDistributionUrl=true
56
zipStoreBase=GRADLE_USER_HOME
67
zipStorePath=wrapper/dists

android/gradlew

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,8 @@ done
8383
# This is normally unused
8484
# shellcheck disable=SC2034
8585
APP_BASE_NAME=${0##*/}
86-
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
87-
88-
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
89-
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
86+
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
87+
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
9088

9189
# Use the maximum available, or set MAX_FD != -1 to use that value.
9290
MAX_FD=maximum
@@ -133,26 +131,29 @@ location of your Java installation."
133131
fi
134132
else
135133
JAVACMD=java
136-
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
134+
if ! command -v java >/dev/null 2>&1
135+
then
136+
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
137137
138138
Please set the JAVA_HOME variable in your environment to match the
139139
location of your Java installation."
140+
fi
140141
fi
141142

142143
# Increase the maximum file descriptors if we can.
143144
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
144145
case $MAX_FD in #(
145146
max*)
146147
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
147-
# shellcheck disable=SC3045
148+
# shellcheck disable=SC3045
148149
MAX_FD=$( ulimit -H -n ) ||
149150
warn "Could not query maximum file descriptor limit"
150151
esac
151152
case $MAX_FD in #(
152153
'' | soft) :;; #(
153154
*)
154155
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
155-
# shellcheck disable=SC3045
156+
# shellcheck disable=SC3045
156157
ulimit -n "$MAX_FD" ||
157158
warn "Could not set maximum file descriptor limit to $MAX_FD"
158159
esac
@@ -197,6 +198,9 @@ if "$cygwin" || "$msys" ; then
197198
done
198199
fi
199200

201+
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
202+
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
203+
200204
# Collect all arguments for the java command;
201205
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
202206
# shell script including quotes and variable substitutions, so put them in
Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
package com.mattermost.networkclient
22

3-
import com.facebook.flipper.plugins.network.FlipperOkhttpInterceptor
4-
import com.facebook.flipper.plugins.network.NetworkFlipperPlugin
53
import com.facebook.react.bridge.*
64
import com.mattermost.networkclient.interceptors.*
75
import okhttp3.*
@@ -21,20 +19,4 @@ internal class NetworkClient(baseUrl: HttpUrl? = null, options: ReadableMap? = n
2119

2220
okHttpClient = builder.build()
2321
}
24-
25-
override fun applyGenericClientBuilderConfiguration() {
26-
super.applyGenericClientBuilderConfiguration()
27-
applyFlipperInterceptor()
28-
}
29-
30-
override fun applyClientBuilderConfiguration(options: ReadableMap?, cookieJar: CookieJar?) {
31-
super.applyClientBuilderConfiguration(options, cookieJar)
32-
applyFlipperInterceptor()
33-
}
34-
35-
private fun applyFlipperInterceptor() {
36-
if (RCTOkHttpClientFactory.flipperPlugin != null) {
37-
builder.addNetworkInterceptor(FlipperOkhttpInterceptor(RCTOkHttpClientFactory.flipperPlugin as NetworkFlipperPlugin))
38-
}
39-
}
4022
}

babel.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
// See LICENSE.txt for license information.
33

44
module.exports = {
5-
presets: ["module:metro-react-native-babel-preset"],
5+
presets: ["module:@react-native/babel-preset"],
66
};

example/@types/app.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ type Multipart = {
1111
value: string;
1212
};
1313

14-
type File = {
14+
type NativeFile = {
1515
name?: string | null;
1616
size?: number | null;
1717
type?: string | null;

example/Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ source 'https://rubygems.org'
22
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
33

44
gem "cocoapods", "1.14.2"
5-
gem 'activesupport', '>= 6.1.7.3', '< 7.1.0'
5+
gem 'activesupport', '>= 6.1.7.5', '< 7.1.0'

example/android/app/build.gradle

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
apply plugin: "com.android.application"
2+
apply plugin: "org.jetbrains.kotlin.android"
23
apply plugin: "com.facebook.react"
3-
apply plugin: 'kotlin-android'
44

55
/**
66
* This is the configuration block to customize your React Native Android app.
@@ -70,7 +70,10 @@ def enableProguardInReleaseBuilds = false
7070
def jscFlavor = 'org.webkit:android-jsc:+'
7171

7272
android {
73-
compileSdkVersion rootProject.ext.compileSdkVersion
73+
ndkVersion rootProject.ext.ndkVersion
74+
75+
buildToolsVersion rootProject.ext.buildToolsVersion
76+
compileSdk rootProject.ext.compileSdkVersion
7477

7578
namespace "com.example.reactnativenetworkclient"
7679
defaultConfig {
@@ -108,12 +111,8 @@ android {
108111
dependencies {
109112
// The version of react-native is set by the React Native Gradle Plugin
110113
implementation("com.facebook.react:react-android")
114+
implementation("com.facebook.react:flipper-integration")
111115

112-
debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}")
113-
debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
114-
exclude group:'com.squareup.okhttp3', module:'okhttp'
115-
}
116-
debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}")
117116
if (hermesEnabled.toBoolean()) {
118117
implementation("com.facebook.react:hermes-android")
119118
} else {

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,8 @@
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
33
xmlns:tools="http://schemas.android.com/tools">
44

5-
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
6-
75
<application
86
android:usesCleartextTraffic="true"
97
tools:targetApi="28"
10-
tools:ignore="GoogleAppIndexingWarning">
11-
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" android:exported="false" />
12-
</application>
8+
tools:ignore="GoogleAppIndexingWarning"/>
139
</manifest>

example/android/app/src/debug/java/com/example/reactnativenetworkclient/ReactNativeFlipper.java

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

example/android/app/src/main/java/com/example/reactnativenetworkclient/MainActivity.java

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

0 commit comments

Comments
 (0)