Skip to content

Commit

Permalink
[Issue-1780] Update react-native 0.75
Browse files Browse the repository at this point in the history
  • Loading branch information
dominhquang committed Sep 17, 2024
1 parent 03e768c commit f74be5c
Show file tree
Hide file tree
Showing 47 changed files with 32,824 additions and 21,334 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/build-internal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ jobs:
with:
fetch-depth: 0
token: ${{ secrets.GH_PAT }}
- name: Enable Corepack
run: corepack enable

- name: Add APP ENV
run: |
Expand Down Expand Up @@ -137,6 +139,8 @@ jobs:
with:
fetch-depth: 0
token: ${{ secrets.GH_PAT }}
- name: Enable Corepack
run: corepack enable
- name: Remove unused web-runner for Android
run: |
rm -r ./html/OldWeb.bundle
Expand Down Expand Up @@ -179,7 +183,7 @@ jobs:
- uses: actions/setup-java@v1
with:
java-version: '11'
java-version: '17'

- name: Cache Gradle Wrapper
uses: actions/cache@v3
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/build-release-mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ jobs:
with:
fetch-depth: 0
token: ${{ secrets.GH_PAT }}
- name: Enable Corepack
run: corepack enable

- name: Add APP ENV
run: |
Expand Down Expand Up @@ -134,6 +136,8 @@ jobs:
with:
fetch-depth: 0
token: ${{ secrets.GH_PAT }}
- name: Enable Corepack
run: corepack enable

- name: Add APP ENV
run: |
Expand Down Expand Up @@ -172,7 +176,7 @@ jobs:
- uses: actions/setup-java@v1
with:
java-version: '11'
java-version: '17'

- name: Cache Gradle Wrapper
uses: actions/cache@v3
Expand Down Expand Up @@ -227,4 +231,4 @@ jobs:
title: ${{ github.workflow }}
description: |
Android: Published on Play Console.
Click [here](https://play.google.com/console/u/0/developers/5178189030889328266/app/4973509903908456575/tracks/internal-testing) to check internal testing
Click [here](https://play.google.com/console/u/0/developers/5178189030889328266/app/4973509903908456575/tracks/internal-testing) to check internal testing
12 changes: 10 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ DerivedData
*.hmap
*.ipa
*.xcuserstate
ios/.xcode.env.local
**/.xcode.env.local

# Android/IntelliJ
#
Expand Down Expand Up @@ -60,7 +60,7 @@ yarn-error.log
*.jsbundle

# Ruby / CocoaPods
/ios/Pods/
**/Pods/
/vendor/bundle/

# Temporary files created by Metro to check the health of the file watcher
Expand All @@ -71,3 +71,11 @@ yarn-error.log
app-center-private.pem
# testing
/coverage

# Yarn
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions
5 changes: 5 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
enableImmutableInstalls: false

enableProgressBars: false

nodeLinker: node-modules
4 changes: 3 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ source 'https://rubygems.org'
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
ruby '>= 2.6.10'

gem 'cocoapods', '~> 1.12'
# Exclude problematic versions of cocoapods and activesupport that causes build failures.
gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1'
gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0'
2 changes: 1 addition & 1 deletion __tests__/App-test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import 'react-native';
import React from 'react';

// Note: import explicitly to use the types shiped with jest.
// Note: import explicitly to use the types shipped with jest.
import { it } from '@jest/globals';

// Note: test renderer must be required after react-native.
Expand Down
31 changes: 13 additions & 18 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
apply plugin: "com.android.application"
apply plugin: "org.jetbrains.kotlin.android"
apply plugin: "com.facebook.react"
apply from: project(':react-native-config').projectDir.getPath() + "/dotenv.gradle"
apply from: "../../node_modules/react-native-code-push/android/codepush.gradle"
Expand All @@ -9,14 +10,14 @@ apply from: "../../node_modules/react-native-code-push/android/codepush.gradle"
*/
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 +48,8 @@ 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()
}

/**
Expand All @@ -70,7 +73,8 @@ def jscFlavor = 'org.webkit:android-jsc:+'
android {
ndkVersion rootProject.ext.ndkVersion

compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion
compileSdk rootProject.ext.compileSdkVersion
namespace "app.subwallet.mobile"
defaultConfig {
applicationId "app.subwallet.mobile"
Expand Down Expand Up @@ -135,18 +139,9 @@ dependencies {
// The version of react-native is set by the React Native Gradle Plugin
implementation("com.facebook.react:react-android")

debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}")
debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
exclude group:'com.squareup.okhttp3', module:'okhttp'
}

debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}")
if (hermesEnabled.toBoolean()) {
implementation("com.facebook.react:hermes-android")
} else {
implementation jscFlavor
}
}

apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
apply from: "../../node_modules/react-native-vector-icons/fonts.gradle"
6 changes: 1 addition & 5 deletions android/app/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">

<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>

<application
android:usesCleartextTraffic="true"
tools:targetApi="28"
tools:ignore="GoogleAppIndexingWarning">
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" android:exported="false" />
</application>
tools:ignore="GoogleAppIndexingWarning"/>
</manifest>

This file was deleted.

4 changes: 3 additions & 1 deletion android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:allowBackup="false"
android:usesCleartextTraffic="true"
android:theme="@style/AppTheme">
android:theme="@style/AppTheme"
android:extractNativeLibs="true"
android:supportsRtl="true">
<activity
android:name=".MainActivity"
android:theme="@style/SplashTheme"
Expand Down
41 changes: 0 additions & 41 deletions android/app/src/main/java/app/subwallet/mobile/MainActivity.java

This file was deleted.

30 changes: 30 additions & 0 deletions android/app/src/main/java/app/subwallet/mobile/MainActivity.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package app.subwallet.mobile

import com.facebook.react.ReactActivity
import android.os.Bundle
import org.devio.rn.splashscreen.SplashScreen
import com.facebook.react.ReactActivityDelegate
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.fabricEnabled
import com.facebook.react.defaults.DefaultReactActivityDelegate

class MainActivity : ReactActivity() {
// Add this method.
override fun onCreate(savedInstanceState: Bundle?) {
setTheme(R.style.AppTheme);
SplashScreen.show(this);
super.onCreate(null);
}

/**
* Returns the name of the main component registered from JavaScript. This is used to schedule
* rendering of the component.
*/
override fun getMainComponentName(): String = "SubWalletMobile"

/**
* Returns the instance of the [ReactActivityDelegate]. We use [DefaultReactActivityDelegate]
* which allows you to enable New Architecture with a single boolean flags [fabricEnabled]
*/
override fun createReactActivityDelegate(): ReactActivityDelegate =
DefaultReactActivityDelegate(this, mainComponentName, fabricEnabled)
}
Loading

0 comments on commit f74be5c

Please sign in to comment.