feat: 升级到ReactNative0.76

This commit is contained in:
maotoumao
2025-01-01 17:46:29 +08:00
parent b724377761
commit 6613e77203
16 changed files with 1730 additions and 1614 deletions
+4 -4
View File
@@ -3,7 +3,7 @@ source 'https://rubygems.org'
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
ruby ">= 2.6.10"
# Cocoapods 1.15 introduced a bug which break the build. We will remove the upper
# bound in the template on Cocoapods with next React Native release.
gem 'cocoapods', '>= 1.13', '< 1.15'
gem 'activesupport', '>= 6.1.7.5', '< 7.1.0'
# 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'
gem 'xcodeproj', '< 1.26.0'
+17 -9
View File
@@ -12,14 +12,14 @@ import groovy.json.JsonSlurper
*/
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
@@ -53,11 +53,20 @@ 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()
//
// Added by install-expo-modules
entryFile = file(["node", "-e", "require('expo/scripts/resolveAppEntry')", rootDir.getAbsoluteFile().getParentFile().getAbsolutePath(), "android", "absolute"].execute(null, rootDir).text.trim())
cliFile = new File(["node", "--print", "require.resolve('@expo/cli')"].execute(null, rootDir).text.trim())
bundleCommand = "export:embed"
//
// Added by install-expo-modules
entryFile = file(["node", "-e", "require('expo/scripts/resolveAppEntry')", rootDir.getAbsoluteFile().getParentFile().getAbsolutePath(), "android", "absolute"].execute(null, rootDir).text.trim())
cliFile = new File(["node", "--print", "require.resolve('@expo/cli')"].execute(null, rootDir).text.trim())
bundleCommand = "export:embed"
}
/**
@@ -179,4 +188,3 @@ dependencies {
implementation 'net.jthink:jaudiotagger:2.2.5'
}
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)
+1
View File
@@ -17,6 +17,7 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:allowBackup="false"
android:theme="@style/AppTheme"
android:supportsRtl="true"
android:requestLegacyExternalStorage="true"
android:usesCleartextTraffic="true"
android:extractNativeLibs="true"
@@ -12,6 +12,7 @@ import com.facebook.react.ReactPackage
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.soloader.SoLoader
import `fun`.upup.musicfree.lyricUtil.LyricUtilPackage
import `fun`.upup.musicfree.mp3Util.Mp3UtilPackage
@@ -43,7 +44,7 @@ class MainApplication : Application(), ReactApplication {
override fun onCreate() {
super.onCreate()
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()
+7 -5
View File
@@ -1,15 +1,18 @@
buildscript {
ext {
buildToolsVersion = "34.0.0"
minSdkVersion = 23
compileSdkVersion = 34
buildToolsVersion = "35.0.0"
minSdkVersion = 24
compileSdkVersion = 35
targetSdkVersion = 30
ndkVersion = "26.1.10909125"
kotlinVersion = "1.9.22"
kotlinVersion = "1.9.24"
}
repositories {
maven { url 'https://maven.aliyun.com/repository/public' }
maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }
google()
mavenCentral()
maven { url 'https://jitpack.io' }
}
dependencies {
classpath("com.android.tools.build:gradle")
@@ -17,5 +20,4 @@ buildscript {
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin")
}
}
apply plugin: "com.facebook.react.rootproject"
-2
View File
@@ -21,8 +21,6 @@ org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m
# Android operating system, and which are packaged with your app's APK
# 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
+2 -1
View File
@@ -1,6 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-all.zip
# distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip
distributionUrl=https\://mirrors.cloud.tencent.com/gradle/gradle-8.10.2-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
+5 -2
View File
@@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#
##############################################################################
#
@@ -55,7 +57,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
@@ -84,7 +86,8 @@ done
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
' "$PWD" ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
+2
View File
@@ -13,6 +13,8 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
+16 -2
View File
@@ -1,7 +1,21 @@
pluginManagement { includeBuild("../node_modules/@react-native/gradle-plugin") }
plugins { id("com.facebook.react.settings") }
extensions.configure(com.facebook.react.ReactSettingsExtension){ ex ->
def command = [
'node',
'--no-warnings',
'--eval',
'require(require.resolve(\'expo-modules-autolinking\', { paths: [require.resolve(\'expo/package.json\')] }))(process.argv.slice(1))',
'react-native-config',
'--json',
'--platform',
'android'
].toList()
ex.autolinkLibrariesFromCommand(command)
}
rootProject.name = 'MusicFree'
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
include ':app'
includeBuild('../node_modules/@react-native/gradle-plugin')
apply from: new File(["node", "--print", "require.resolve('expo/package.json')"].execute(null, rootDir).text.trim(), "../scripts/autolinking.gradle")
useExpoModules()
useExpoModules()
+1 -1
View File
@@ -1,5 +1,5 @@
module.exports = {
presets: ['module:@react-native/babel-preset'],
presets: ['babel-preset-expo'],
plugins: [
[
'module-resolver',
+10 -4
View File
@@ -420,7 +420,7 @@
"$(inherited)",
);
INFOPLIST_FILE = MusicFreeTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 13.4;
IPHONEOS_DEPLOYMENT_TARGET = 15.1;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
@@ -434,6 +434,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/MusicFree.app/MusicFree";
SWIFT_VERSION = 5.0;
};
name = Debug;
};
@@ -444,7 +445,7 @@
BUNDLE_LOADER = "$(TEST_HOST)";
COPY_PHASE_STRIP = NO;
INFOPLIST_FILE = MusicFreeTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 13.4;
IPHONEOS_DEPLOYMENT_TARGET = 15.1;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
@@ -458,6 +459,7 @@
PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/MusicFree.app/MusicFree";
SWIFT_VERSION = 5.0;
};
name = Release;
};
@@ -470,6 +472,7 @@
CURRENT_PROJECT_VERSION = 1;
ENABLE_BITCODE = NO;
INFOPLIST_FILE = MusicFree/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 15.1;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
@@ -496,6 +499,7 @@
CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 1;
INFOPLIST_FILE = MusicFree/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 15.1;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
@@ -562,7 +566,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 13.4;
IPHONEOS_DEPLOYMENT_TARGET = 15.1;
LD_RUNPATH_SEARCH_PATHS = (
/usr/lib/swift,
"$(inherited)",
@@ -583,6 +587,7 @@
"-DFOLLY_HAVE_CLOCK_GETTIME=1",
);
SDKROOT = iphoneos;
SWIFT_VERSION = 5.0;
};
name = Debug;
};
@@ -628,7 +633,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 13.4;
IPHONEOS_DEPLOYMENT_TARGET = 15.1;
LD_RUNPATH_SEARCH_PATHS = (
/usr/lib/swift,
"$(inherited)",
@@ -649,6 +654,7 @@
);
SDKROOT = iphoneos;
VALIDATE_PRODUCT = YES;
SWIFT_VERSION = 5.0;
};
name = Release;
};
+2 -3
View File
@@ -2,9 +2,6 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSPrivacyCollectedDataTypes</key>
<array>
</array>
<key>NSPrivacyAccessedAPITypes</key>
<array>
<dict>
@@ -32,6 +29,8 @@
</array>
</dict>
</array>
<key>NSPrivacyCollectedDataTypes</key>
<array/>
<key>NSPrivacyTracking</key>
<false/>
</dict>
+17 -2
View File
@@ -24,8 +24,23 @@ target 'MusicFree' do
Pod::UI.warn e
end
end
config = use_native_modules!
if ENV['EXPO_USE_COMMUNITY_AUTOLINKING'] == '1'
config_command = ['node', '-e', "process.argv=['', '', 'config'];require('@react-native-community/cli').run()"];
else
config_command = [
'node',
'--no-warnings',
'--eval',
'require(require.resolve(\'expo-modules-autolinking\', { paths: [require.resolve(\'expo/package.json\')] }))(process.argv.slice(1))',
'react-native-config',
'--json',
'--platform',
'ios'
]
end
config = use_native_modules!(config_command)
use_react_native!(
:path => config[:reactNativePath],
# An absolute path to your application root.
+35 -33
View File
@@ -11,7 +11,7 @@
"android": "react-native run-android",
"ios": "react-native run-ios",
"lint": "eslint . --ext .js,.jsx,.ts,.tsx src --fix",
"start": "react-native start --experimental-debugger",
"start": "react-native start",
"clean": "cd ./android && ./gradlew clean",
"test": "jest",
"commit-lint": "commitlint --edit",
@@ -22,17 +22,17 @@
"prepare": "husky"
},
"dependencies": {
"@react-native-async-storage/async-storage": "^1.24.0",
"@react-native-clipboard/clipboard": "^1.14.1",
"@react-native-community/netinfo": "^11.3.2",
"@react-native-community/slider": "^4.5.2",
"@react-native-async-storage/async-storage": "1.23.1",
"@react-native-clipboard/clipboard": "^1.15.0",
"@react-native-community/netinfo": "11.4.1",
"@react-native-community/slider": "4.5.5",
"@react-native-cookies/cookies": "^6.2.1",
"@react-native-masked-view/masked-view": "^0.3.1",
"@react-native-masked-view/masked-view": "0.3.2",
"@react-navigation/drawer": "^6.7.2",
"@react-navigation/native": "^6.1.18",
"@react-navigation/native-stack": "^6.11.0",
"@shopify/flash-list": "^1.7.0",
"axios": "^1.7.3",
"@shopify/flash-list": "1.7.1",
"axios": "1.7.4",
"big-integer": "^1.6.52",
"cheerio": "^1.0.0-rc.12",
"color": "^4.2.3",
@@ -41,42 +41,41 @@
"dayjs": "^1.11.12",
"deepmerge": "^4.3.1",
"eventemitter3": "^5.0.1",
"expo": "^51.0.0",
"expo-document-picker": "^12.0.2",
"expo-file-system": "^17.0.1",
"expo-keep-awake": "^13.0.2",
"expo-splash-screen": "~0.27.5",
"expo": "^52.0.0",
"expo-document-picker": "~13.0.1",
"expo-file-system": "~18.0.6",
"expo-keep-awake": "~14.0.1",
"expo-splash-screen": "~0.29.18",
"he": "^1.2.0",
"immer": "^10.1.1",
"jotai": "^2.9.1",
"lodash.shuffle": "^4.2.0",
"lru-cache": "^11.0.0",
"nanoid": "^5.0.7",
"nanoid": "5.0.8",
"object-path": "^0.11.8",
"p-queue": "^8.0.1",
"path-browserify": "^1.0.1",
"qs": "^6.13.0",
"react": "18.2.0",
"react-native": "0.74.4",
"react": "18.3.1",
"react-native": "0.76.5",
"react-native-background-timer": "^2.4.1",
"react-native-circular-progress-indicator": "^4.4.2",
"react-native-device-info": "^11.1.0",
"react-native-fast-image": "^8.6.3",
"react-native-fs": "^2.20.0",
"react-native-gesture-handler": "^2.18.1",
"react-native-gesture-handler": "~2.20.2",
"react-native-get-random-values": "^1.11.0",
"react-native-image-colors": "^2.4.0",
"react-native-image-picker": "^7.1.2",
"react-native-linear-gradient": "^2.8.3",
"react-native-logs": "^5.1.0",
"react-native-mmkv": "^2.12.2",
"react-native-pager-view": "^6.3.3",
"react-native-pager-view": "6.5.1",
"react-native-permissions": "^4.1.5",
"react-native-reanimated": "^3.16.0",
"react-native-safe-area-context": "^4.10.8",
"react-native-screens": "^3.33.0",
"react-native-reanimated": "^3.16.6",
"react-native-safe-area-context": "4.12.0",
"react-native-screens": "~4.4.0",
"react-native-share": "^10.2.1",
"react-native-svg": "^15.4.0",
"react-native-svg": "15.8.0",
"react-native-tab-view": "^3.5.2",
"react-native-track-player": "^4.1.1",
"react-native-url-polyfill": "^2.0.0",
@@ -84,15 +83,18 @@
"webdav": "^5.7.0"
},
"devDependencies": {
"@babel/core": "^7.20.0",
"@babel/preset-env": "^7.20.0",
"@babel/runtime": "^7.20.0",
"@babel/core": "^7.25.2",
"@babel/preset-env": "^7.25.3",
"@babel/runtime": "^7.25.0",
"@commitlint/cli": "^19.3.0",
"@commitlint/config-conventional": "^19.2.2",
"@react-native/babel-preset": "0.74.86",
"@react-native/eslint-config": "0.74.86",
"@react-native/metro-config": "0.74.86",
"@react-native/typescript-config": "0.74.86",
"@react-native-community/cli": "15.0.1",
"@react-native-community/cli-platform-android": "15.0.1",
"@react-native-community/cli-platform-ios": "15.0.1",
"@react-native/babel-preset": "0.76.5",
"@react-native/eslint-config": "0.76.5",
"@react-native/metro-config": "0.76.5",
"@react-native/typescript-config": "0.76.5",
"@types/color": "^3.0.6",
"@types/crypto-js": "^4.2.2",
"@types/he": "^1.2.3",
@@ -100,7 +102,7 @@
"@types/object-path": "^0.11.4",
"@types/path-browserify": "^1.0.2",
"@types/qs": "^6.9.15",
"@types/react": "^18.2.6",
"@types/react": "~18.3.12",
"@types/react-native-background-timer": "^2.0.2",
"@types/react-test-renderer": "^18.0.0",
"babel-jest": "^29.6.3",
@@ -112,8 +114,8 @@
"lint-staged": "^15.2.7",
"prettier": "2.8.8",
"react-native-svg-transformer": "^1.5.0",
"react-test-renderer": "18.2.0",
"typescript": "5.0.4"
"react-test-renderer": "18.3.1",
"typescript": "^5.3.3"
},
"engines": {
"node": ">=18"
+1609 -1545
View File
File diff suppressed because it is too large Load Diff