Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
208db30
update react and some libs
dnlsilva Jun 7, 2022
13e2c6e
android
dnlsilva Jun 7, 2022
0292f08
update expo av patch
dnlsilva Jun 7, 2022
5e6a1e0
update bugsnag gradlew version
dnlsilva Jun 7, 2022
234ce57
android live
dnlsilva Jun 8, 2022
77d7e21
fix list handler
dnlsilva Jun 8, 2022
65a7729
ios building
dnlsilva Jun 15, 2022
647ab00
update keyboard aware view
dnlsilva Jun 17, 2022
be26b67
iOS building
diegolmello Jun 24, 2022
7144ac8
Temp remove UIKit
diegolmello Jun 24, 2022
54079c2
Temp remove mmkv workaround
diegolmello Jun 24, 2022
db0d898
Patching this VERY obscure issue on FlatList props
diegolmello Jun 24, 2022
a4aa1e9
Fix rn-root-view android
diegolmello Jul 1, 2022
9a13db4
Stash iOS proj
diegolmello Jul 1, 2022
a9b5db4
Apply "stock" RN 0.68.2
diegolmello Jul 1, 2022
36b6c35
hasPermission apparently working
diegolmello Jul 1, 2022
f14292d
Temp remove react-native-keycommands
diegolmello Jul 7, 2022
598b30f
Apply 12.5 M1 podfile
diegolmello Jul 7, 2022
f50ea54
AppDelegate.m -> AppDelegate.mm
diegolmello Jul 7, 2022
d7b6409
Apply Expo changes
diegolmello Jul 7, 2022
dd217d6
Remove unused expo modules
diegolmello Jul 7, 2022
b61ce04
Remove some mmkv patches
diegolmello Jul 8, 2022
2086b11
Remove animatable patch
diegolmello Jul 8, 2022
2f609e5
Prettier
diegolmello Jul 8, 2022
90fc7e7
Update MMKV mock
diegolmello Jul 8, 2022
32bf617
Use jest-expo instead of our mocks and update tests
diegolmello Jul 8, 2022
4a2704c
Fix lint
diegolmello Jul 8, 2022
9683731
Temp disable LoadMore tests
diegolmello Jul 8, 2022
51abd8b
Update gems iOS
diegolmello Jul 8, 2022
d09fefc
Building release on M1 with Flipper disabled
diegolmello Jul 14, 2022
a9a3677
Merge branch 'develop' into upgrade-react-native-68
diegolmello Jul 14, 2022
873ee3f
Temp disable test
diegolmello Jul 14, 2022
c1c62d7
Manually enable Hermes on iOS
diegolmello Jul 14, 2022
ff04532
Fix jumpTo functions
diegolmello Jul 19, 2022
678f29c
Upgrade react-native-scrollable-tab-view
diegolmello Jul 19, 2022
65991d4
autoCompleteType -> autoComplete
diegolmello Jul 20, 2022
495af1a
Fix emoji picker
diegolmello Jul 20, 2022
a56015e
Remove unused expo-error-recovery
diegolmello Jul 20, 2022
273bcbb
Use our react-native fork
diegolmello Jul 20, 2022
74c2234
Patch react-native-mmkv-storage
diegolmello Jul 21, 2022
34d804d
Use analytics without ad id
diegolmello Jul 21, 2022
8684f1d
Flipper comment
diegolmello Jul 21, 2022
4f5029f
Fix CircleCI pods cache
diegolmello Jul 21, 2022
6f4e10b
Try running pods from gem and with deployment mode
diegolmello Jul 21, 2022
a335132
Cleanup CI config
diegolmello Jul 21, 2022
3bdd519
Fix react-native-mmkv-storage installation
diegolmello Jul 21, 2022
33b1daf
Remove jcenter
diegolmello Jul 21, 2022
643de6e
Update blur
diegolmello Jul 21, 2022
a4609ac
Fix SSL pinning
diegolmello Jul 22, 2022
b1b37eb
Reenable keycommands
diegolmello Jul 22, 2022
90d928c
Cleanup
diegolmello Jul 22, 2022
35ea50a
Re add a few methods to AppDelegate
diegolmello Jul 22, 2022
9bff334
Update podfile.lock
diegolmello Jul 26, 2022
3d90394
Remove the need for metro-babel-register
diegolmello Jul 27, 2022
4f62973
Try tests on CI
diegolmello Jul 27, 2022
8d1ba2e
Reenable LoadMore tests
diegolmello Jul 27, 2022
9aed1ed
Point to maven only fix on rn-root-view
diegolmello Jul 27, 2022
c06146c
Merge branch 'develop' into upgrade-react-native-68
diegolmello Jul 27, 2022
a5d94f7
Update supported iOS version
diegolmello Jul 27, 2022
7a38822
Update pods
diegolmello Jul 27, 2022
724e534
Update gradle.properties on CI
diegolmello Jul 27, 2022
74c0a82
Upload source maps to Bugsnag
diegolmello Jul 27, 2022
6eb009d
Build Order: Manual Order -> Dependency Order
diegolmello Jul 27, 2022
7024f90
Run Detox on iOS
diegolmello Jul 29, 2022
082a63b
Fix ImageViewer thread usage
diegolmello Aug 1, 2022
b89380f
Merge branch 'develop' into upgrade-react-native-68
diegolmello Aug 1, 2022
172bd6d
Merge branch 'develop' into upgrade-react-native-68
diegolmello Aug 8, 2022
a2deadb
Revert mappedIcons and selection changes from Prettier
diegolmello Aug 8, 2022
26bee5f
Remove fixed implementation of okhttp
diegolmello Aug 8, 2022
61a3932
Merge and apply rn-root-view branch
diegolmello Aug 8, 2022
96a6794
Apply gson 2.8.9
diegolmello Aug 8, 2022
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: 2 additions & 0 deletions .bundle/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
BUNDLE_PATH: "vendor/bundle"
BUNDLE_FORCE_RUBY_PLATFORM: 1
12 changes: 5 additions & 7 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,18 +80,15 @@ commands:
steps:
- restore_cache:
name: Restore pods
# TODO: CircleCI isn't caching Podfile.lock correctly, because checksum changes after install
# key: pods-v1-{{ checksum "ios/Podfile.lock" }}
key: pods-v1-{{ checksum "ios/Podfile" }}
key: pods-v1-{{ checksum "ios/Podfile.lock" }}
- run:
name: Install pods libs
command: |
bundle exec pod install
bundle exec pod install --deployment
working_directory: ios
- save_cache:
name: Save pods specs and pods cache
# key: pods-v1-{{ checksum "ios/Podfile.lock" }}
key: pods-v1-{{ checksum "ios/Podfile" }}
key: pods-v1-{{ checksum "ios/Podfile.lock" }}
paths:
- ~/.pods
- ios/Pods
Expand All @@ -114,7 +111,8 @@ commands:
# echo -e "android.enableAapt2=false" >> ./gradle.properties
echo -e "android.useAndroidX=true" >> ./gradle.properties
echo -e "android.enableJetifier=true" >> ./gradle.properties
echo -e "FLIPPER_VERSION=0.51.0" >> ./gradle.properties
echo -e "newArchEnabled=false" >> ./gradle.properties
echo -e "FLIPPER_VERSION=0.125.0" >> ./gradle.properties
echo -e "VERSIONCODE=$CIRCLE_BUILD_NUM" >> ./gradle.properties

if [[ $CIRCLE_JOB == "android-build-official" ]]; then
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ DerivedData
project.xcworkspace
*.mobileprovision
ios/Pods/
/vendor/bundle/

# Android/IntelliJ
#
Expand Down
4 changes: 2 additions & 2 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
module.exports = {
bracketSpacing: true,
jsxBracketSameLine: true,
singleQuote: true,
jsxSingleQuote: true,
trailingComma: 'none',
printWidth: 130,
useTabs: true,
arrowParens: 'avoid'
arrowParens: 'avoid',
bracketSameLine: true
};
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.7.4
4 changes: 4 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
source 'https://rubygems.org'
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
ruby '2.7.4'
gem 'cocoapods', '~> 1.11', '>= 1.11.2'
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
[![CodeFactor](https://www.codefactor.io/repository/github/rocketchat/rocket.chat.reactnative/badge)](https://www.codefactor.io/repository/github/rocketchat/rocket.chat.reactnative)

- **Supported server versions:** 0.70.0+
- **Supported iOS versions**: 11+
- **Supported iOS versions**: 12+
- **Supported Android versions**: 6.0+

## Download
Expand Down
14 changes: 0 additions & 14 deletions __mocks__/expo-av.js

This file was deleted.

4 changes: 0 additions & 4 deletions __mocks__/expo-keep-awake.js

This file was deleted.

3 changes: 0 additions & 3 deletions __mocks__/expo-web-browser.js

This file was deleted.

17 changes: 17 additions & 0 deletions __mocks__/react-native-mmkv-storage.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
export class MMKVLoader {
constructor() {
console.log('MMKVLoader constructor mock');
}

setProcessingMode = jest.fn().mockImplementation(() => ({
withEncryption: jest.fn().mockImplementation(() => ({
initialize: jest.fn().mockImplementation(() => {})
}))
}));
}

export const ProcessingModes = {
MULTI_PROCESS: ''
};

export const create = jest.fn();
4 changes: 0 additions & 4 deletions __mocks__/rn-user-defaults.js

This file was deleted.

122 changes: 108 additions & 14 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ project.ext.react = [
]

apply from: "../../node_modules/react-native/react.gradle"
apply from: '../../node_modules/react-native-unimodules/gradle.groovy'

/**
* Set this to true to create two separate APKs instead of one:
Expand Down Expand Up @@ -131,14 +130,18 @@ def jscFlavor = 'org.webkit:android-jsc:+'
*/
def enableHermes = project.ext.react.get("enableHermes", false);

/**
* Architectures to build native code for.
*/
def reactNativeArchitectures() {
def value = project.getProperties().get("reactNativeArchitectures")
return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"]
}

android {
ndkVersion rootProject.ext.ndkVersion
compileSdkVersion rootProject.ext.compileSdkVersion

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

defaultConfig {
applicationId APPLICATION_ID
minSdkVersion rootProject.ext.minSdkVersion
Expand All @@ -153,6 +156,76 @@ android {
resValue "string", "rn_config_reader_custom_package", "chat.rocket.reactnative"
testBuildType System.getProperty('testBuildType', 'debug')
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'

buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
if (isNewArchitectureEnabled()) {
// We configure the NDK build only if you decide to opt-in for the New Architecture.
externalNativeBuild {
ndkBuild {
arguments "APP_PLATFORM=android-21",
"APP_STL=c++_shared",
"NDK_TOOLCHAIN_VERSION=clang",
"GENERATED_SRC_DIR=$buildDir/generated/source",
"PROJECT_BUILD_DIR=$buildDir",
"REACT_ANDROID_DIR=$rootDir/../node_modules/react-native/ReactAndroid",
"REACT_ANDROID_BUILD_DIR=$rootDir/../node_modules/react-native/ReactAndroid/build"
cFlags "-Wall", "-Werror", "-fexceptions", "-frtti", "-DWITH_INSPECTOR=1"
cppFlags "-std=c++17"
// Make sure this target name is the same you specify inside the
// src/main/jni/Android.mk file for the `LOCAL_MODULE` variable.
targets "rndiffapp_appmodules"
// Fix for windows limit on number of character in file paths and in command lines
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
arguments "NDK_APP_SHORT_COMMANDS=true"
}
}
}
if (!enableSeparateBuildPerCPUArchitecture) {
ndk {
abiFilters (*reactNativeArchitectures())
}
}
}
}

if (isNewArchitectureEnabled()) {
// We configure the NDK build only if you decide to opt-in for the New Architecture.
externalNativeBuild {
ndkBuild {
path "$projectDir/src/main/jni/Android.mk"
}
}
def reactAndroidProjectDir = project(':ReactAndroid').projectDir
def packageReactNdkDebugLibs = tasks.register("packageReactNdkDebugLibs", Copy) {
dependsOn(":ReactAndroid:packageReactNdkDebugLibsForBuck")
from("$reactAndroidProjectDir/src/main/jni/prebuilt/lib")
into("$buildDir/react-ndk/exported")
}
def packageReactNdkReleaseLibs = tasks.register("packageReactNdkReleaseLibs", Copy) {
dependsOn(":ReactAndroid:packageReactNdkReleaseLibsForBuck")
from("$reactAndroidProjectDir/src/main/jni/prebuilt/lib")
into("$buildDir/react-ndk/exported")
}
afterEvaluate {
// If you wish to add a custom TurboModule or component locally,
// you should uncomment this line.
// preBuild.dependsOn("generateCodegenArtifactsFromSchema")
preDebugBuild.dependsOn(packageReactNdkDebugLibs)
preReleaseBuild.dependsOn(packageReactNdkReleaseLibs)
// Due to a bug inside AGP, we have to explicitly set a dependency
// between configureNdkBuild* tasks and the preBuild tasks.
// This can be removed once this is solved: https://issuetracker.google.com/issues/207403732
configureNdkBuildRelease.dependsOn(preReleaseBuild)
configureNdkBuildDebug.dependsOn(preDebugBuild)
reactNativeArchitectures().each { architecture ->
tasks.findByName("configureNdkBuildDebug[${architecture}]")?.configure {
dependsOn("preDebugBuild")
}
tasks.findByName("configureNdkBuildRelease[${architecture}]")?.configure {
dependsOn("preReleaseBuild")
}
}
}
}

signingConfigs {
Expand All @@ -170,7 +243,7 @@ android {
reset()
enable enableSeparateBuildPerCPUArchitecture
universalApk false // If true, also generate a universal APK
include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
include (*reactNativeArchitectures())
}
}
buildTypes {
Expand All @@ -181,6 +254,8 @@ android {
if (!isFoss) {
firebaseCrashlytics {
nativeSymbolUploadEnabled true
strippedNativeLibsDir 'build/intermediates/stripped_native_libs/release/out/lib'
unstrippedNativeLibsDir 'build/intermediates/merged_native_libs/release/out/lib'
}
}
}
Expand Down Expand Up @@ -275,7 +350,6 @@ android {
}

dependencies {
addUnimodulesDependencies()
implementation project(':@react-native-community_viewpager')
playImplementation project(':react-native-notifications')
playImplementation 'com.google.firebase:firebase-core:16.0.0'
Expand All @@ -286,14 +360,16 @@ dependencies {
exclude group: 'com.facebook.react',module:'react-native-svg'
}
implementation fileTree(dir: "libs", include: ["*.jar"])

//noinspection GradleDynamicVersion
implementation "com.facebook.react:react-native:+" // From node_modules
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"
debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
exclude group:'com.facebook.fbjni'
exclude group:'com.facebook.fbjni'
}
debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
exclude group:'com.facebook.flipper'
exclude group:'com.squareup.okhttp3', module:'okhttp'
}
debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") {
exclude group:'com.facebook.flipper'
Expand All @@ -307,24 +383,42 @@ dependencies {
implementation jscFlavor
}

implementation "com.google.code.gson:gson:2.8.5"
implementation "com.google.code.gson:gson:2.8.9"
implementation "com.github.bumptech.glide:glide:4.9.0"
annotationProcessor "com.github.bumptech.glide:compiler:4.9.0"
implementation "com.tencent:mmkv-static:1.2.1"
implementation 'com.squareup.okhttp3:okhttp:4.9.0'
implementation "com.squareup.okhttp3:okhttp-urlconnection:4.9.0"
implementation "com.tencent:mmkv-static:1.2.10"
androidTestImplementation('com.wix:detox:+') { transitive = true }
androidTestImplementation 'junit:junit:4.12'
}

if (isNewArchitectureEnabled()) {
// If new architecture is enabled, we let you build RN from source
// Otherwise we fallback to a prebuilt .aar bundled in the NPM package.
// This will be applied to all the imported transtitive dependency.
configurations.all {
resolutionStrategy.dependencySubstitution {
substitute(module("com.facebook.react:react-native"))
.using(project(":ReactAndroid")).because("On New Architecture we're building React Native from source")
}
}
}

// Run this once to be able to run the application with BUCK
// puts all compile dependencies into folder libs for BUCK to use
task copyDownloadableDepsToLibs(type: Copy) {
from configurations.compile
from configurations.implementation
into 'libs'
}

apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
if (!isFoss) {
apply plugin: 'com.google.gms.google-services'
}

def isNewArchitectureEnabled() {
// To opt-in for the New Architecture, you can either:
// - Set `newArchEnabled` to true inside the `gradle.properties` file
// - Invoke gradle with `-newArchEnabled=true`
// - Set an environment variable `ORG_GRADLE_PROJECT_newArchEnabled=true`
return project.hasProperty("newArchEnabled") && project.newArchEnabled == "true"
}
2 changes: 1 addition & 1 deletion android/app/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
tools:replace="android:name"
tools:targetApi="28"
android:networkSecurityConfig="@xml/network_security_config">
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" android:exported="true" />
</application>

<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import com.facebook.flipper.plugins.network.NetworkFlipperPlugin;
import com.facebook.flipper.plugins.react.ReactFlipperPlugin;
import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin;
import com.facebook.react.ReactInstanceEventListener;
import com.facebook.react.ReactInstanceManager;
import com.facebook.react.bridge.ReactContext;
import com.facebook.react.modules.network.NetworkingModule;
Expand Down Expand Up @@ -47,7 +48,7 @@ public void apply(OkHttpClient.Builder builder) {
ReactContext reactContext = reactInstanceManager.getCurrentReactContext();
if (reactContext == null) {
reactInstanceManager.addReactInstanceEventListener(
new ReactInstanceManager.ReactInstanceEventListener() {
new ReactInstanceEventListener() {
@Override
public void onReactContextInitialized(ReactContext reactContext) {
reactInstanceManager.removeReactInstanceEventListener(this);
Expand Down
8 changes: 5 additions & 3 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,16 @@
tools:replace="android:allowBackup">
<activity
android:name="com.zoontek.rnbootsplash.RNBootSplashActivity"
android:theme="@style/BootTheme">
android:theme="@style/BootTheme"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="chat.rocket.reactnative.MainActivity"
android:configChanges="keyboard|keyboardHidden|orientation|screenSize|uiMode"
android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize|uiMode"
android:exported="true"
android:label="@string/app_name"
android:launchMode="singleTask"
Expand Down Expand Up @@ -62,7 +63,8 @@
android:label="@string/share_extension_name"
android:noHistory="true"
android:screenOrientation="portrait"
android:theme="@style/AppTheme">
android:theme="@style/AppTheme"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.SEND" />
<action android:name="android.intent.action.SEND_MULTIPLE" />
Expand Down
Loading