Skip to content

Commit 549e461

Browse files
authored
chore: updated react native and other deps (#1412)
1 parent 949d9de commit 549e461

File tree

17 files changed

+3066
-3689
lines changed

17 files changed

+3066
-3689
lines changed

.eslintrc.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module.exports = {
22
root: true,
3-
extends: ['@react-native-community', 'prettier'],
3+
extends: ['@react-native', 'prettier'],
44
rules: {
55
'no-console': ['error', { allow: ['warn', 'error'] }],
66
'prettier/prettier': 'error',

example/bare/android/app/build.gradle

+3-45
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
apply plugin: "com.android.application"
22
apply plugin: "com.facebook.react"
33

4-
import com.android.build.OutputFile
54
import org.apache.tools.ant.taskdefs.condition.Os
65

76
/**
@@ -15,7 +14,7 @@ react {
1514
// The folder where the react-native NPM package is. Default is ../node_modules/react-native
1615
// reactNativeDir = file("../node_modules/react-native")
1716
// The folder where the react-native Codegen package is. Default is ../node_modules/react-native-codegen
18-
// codegenDir = file("../node_modules/react-native-codegen")
17+
// codegenDir = file("../node_modules/@react-native/codegen")
1918
// The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js
2019
// cliFile = file("../node_modules/react-native/cli.js")
2120

@@ -53,16 +52,6 @@ react {
5352
// hermesFlags = ["-O", "-output-source-map"]
5453
}
5554

56-
/**
57-
* Set this to true to create two separate APKs instead of one:
58-
* - An APK that only works on ARM devices
59-
* - An APK that only works on x86 devices
60-
* The advantage is the size of the APK is reduced by about 4MB.
61-
* Upload all the APKs to the Play Store and people will download
62-
* the correct one based on the CPU architecture of their device.
63-
*/
64-
def enableSeparateBuildPerCPUArchitecture = false
65-
6655
/**
6756
* Run Proguard to shrink the Java bytecode in release builds.
6857
*/
@@ -81,31 +70,15 @@ def enableProguardInReleaseBuilds = false
8170
*/
8271
def jscFlavor = 'org.webkit:android-jsc:+'
8372

84-
/**
85-
* Architectures to build native code for in debug.
86-
*/
87-
def reactNativeArchitectures() {
88-
def value = project.getProperties().get("reactNativeArchitectures")
89-
return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"]
90-
}
91-
9273
android {
9374
compileSdkVersion rootProject.ext.compileSdkVersion
9475

9576
defaultConfig {
9677
applicationId "dev.gorhom.bottomsheet"
9778
minSdkVersion rootProject.ext.minSdkVersion
9879
targetSdkVersion rootProject.ext.targetSdkVersion
99-
versionCode 1
100-
versionName "1.0"
101-
}
102-
splits {
103-
abi {
104-
reset()
105-
enable enableSeparateBuildPerCPUArchitecture
106-
universalApk false // If true, also generate a universal APK
107-
include (*reactNativeArchitectures())
108-
}
80+
versionCode 5
81+
versionName "5.0"
10982
}
11083
signingConfigs {
11184
debug {
@@ -127,28 +100,13 @@ android {
127100
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
128101
}
129102
}
130-
// applicationVariants are e.g. debug, release
131-
applicationVariants.all { variant ->
132-
variant.outputs.each { output ->
133-
// For each separate APK per architecture, set a unique version code as described here:
134-
// https://developer.android.com/studio/build/configure-apk-splits.html
135-
def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]
136-
def abi = output.getFilter(OutputFile.ABI)
137-
if (abi != null) { // null for the universal-debug, universal-release variants
138-
output.versionCodeOverride =
139-
defaultConfig.versionCode * 1000 + versionCodes.get(abi)
140-
}
141-
142-
}
143-
}
144103
}
145104

146105
dependencies {
147106
// The version of react-native is set by the React Native Gradle Plugin
148107
implementation("com.facebook.react:react-android")
149108

150109
//noinspection GradleDynamicVersion
151-
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0"
152110
implementation 'androidx.work:work-runtime-ktx:2.7.1'
153111

154112
debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}")

example/bare/android/app/src/main/java/dev/gorhom/bottomsheet/MainActivity.java

+2-5
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,6 @@ protected ReactActivityDelegate createReactActivityDelegate() {
3535
this,
3636
getMainComponentName(),
3737
// If you opted-in for the New Architecture, we enable the Fabric Renderer.
38-
DefaultNewArchitectureEntryPoint.getFabricEnabled(), // fabricEnabled
39-
// If you opted-in for the New Architecture, we enable Concurrent React (i.e. React 18).
40-
DefaultNewArchitectureEntryPoint.getConcurrentReactEnabled() // concurrentRootEnabled
41-
);
38+
DefaultNewArchitectureEntryPoint.getFabricEnabled());
4239
}
43-
}
40+
}

example/bare/android/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ buildscript {
1414
mavenCentral()
1515
}
1616
dependencies {
17-
classpath("com.android.tools.build:gradle:7.3.1")
17+
classpath("com.android.tools.build:gradle")
1818
classpath("com.facebook.react:react-native-gradle-plugin")
1919
}
2020
}

example/bare/android/gradle.properties

+2-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m
2121
android.useAndroidX=true
2222
android.enableJetifier=true
2323

24-
FLIPPER_VERSION=0.125.0
24+
# Version of flipper SDK to use with React Native
25+
FLIPPER_VERSION=0.182.0
2526

2627
# Use this property to specify which architecture you want to build.
2728
# You can also override it from the CLI using
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-all.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.1-all.zip
4+
networkTimeout=10000
45
zipStoreBase=GRADLE_USER_HOME
56
zipStorePath=wrapper/dists

example/bare/android/gradlew

+13-3
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,10 @@ do
8080
esac
8181
done
8282

83-
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
84-
85-
APP_NAME="Gradle"
83+
# This is normally unused
84+
# shellcheck disable=SC2034
8685
APP_BASE_NAME=${0##*/}
86+
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
8787

8888
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
8989
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
@@ -143,12 +143,16 @@ fi
143143
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
144144
case $MAX_FD in #(
145145
max*)
146+
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
147+
# shellcheck disable=SC3045
146148
MAX_FD=$( ulimit -H -n ) ||
147149
warn "Could not query maximum file descriptor limit"
148150
esac
149151
case $MAX_FD in #(
150152
'' | soft) :;; #(
151153
*)
154+
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
155+
# shellcheck disable=SC3045
152156
ulimit -n "$MAX_FD" ||
153157
warn "Could not set maximum file descriptor limit to $MAX_FD"
154158
esac
@@ -205,6 +209,12 @@ set -- \
205209
org.gradle.wrapper.GradleWrapperMain \
206210
"$@"
207211

212+
# Stop when "xargs" is not available.
213+
if ! command -v xargs >/dev/null 2>&1
214+
then
215+
die "xargs is not available"
216+
fi
217+
208218
# Use "xargs" to parse quoted args.
209219
#
210220
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.

example/bare/android/settings.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ rootProject.name = 'BottomSheetExample'
22
apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings)
33
include ':app'
44

5-
includeBuild('../node_modules/react-native-gradle-plugin')
5+
includeBuild('../node_modules/@react-native/gradle-plugin')

example/bare/ios/BottomSheetExample.xcodeproj/project.pbxproj

+2
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,7 @@
396396
);
397397
MTL_ENABLE_DEBUG_INFO = YES;
398398
ONLY_ACTIVE_ARCH = YES;
399+
OTHER_CFLAGS = "$(inherited)";
399400
OTHER_CPLUSPLUSFLAGS = (
400401
"$(OTHER_CFLAGS)",
401402
"-DFOLLY_NO_CONFIG",
@@ -460,6 +461,7 @@
460461
"\"$(inherited)\"",
461462
);
462463
MTL_ENABLE_DEBUG_INFO = NO;
464+
OTHER_CFLAGS = "$(inherited)";
463465
OTHER_CPLUSPLUSFLAGS = (
464466
"$(OTHER_CFLAGS)",
465467
"-DFOLLY_NO_CONFIG",

example/bare/ios/BottomSheetExample/AppDelegate.mm

-10
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,4 @@ - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
2323
#endif
2424
}
2525

26-
/// This method controls whether the `concurrentRoot`feature of React18 is turned on or off.
27-
///
28-
/// @see: https://reactjs.org/blog/2022/03/29/react-v18.html
29-
/// @note: This requires to be rendering on Fabric (i.e. on the New Architecture).
30-
/// @return: `true` if the `concurrentRoot` feature is enabled. Otherwise, it returns `false`.
31-
- (BOOL)concurrentRootEnabled
32-
{
33-
return true;
34-
}
35-
3626
@end

example/bare/ios/Podfile

+13-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
require_relative '../node_modules/react-native/scripts/react_native_pods'
2-
require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules'
1+
# Resolve react_native_pods.rb with node to allow for hoisting
2+
require Pod::Executable.execute_command('node', ['-p',
3+
'require.resolve(
4+
"react-native/scripts/react_native_pods.rb",
5+
{paths: [process.argv[1]]},
6+
)', __dir__]).strip
37

48
platform :ios, min_ios_version_supported
59
prepare_react_native_project!
@@ -15,6 +19,12 @@ prepare_react_native_project!
1519
# ```
1620
flipper_config = ENV['NO_FLIPPER'] == "1" ? FlipperConfiguration.disabled : FlipperConfiguration.enabled
1721

22+
linkage = ENV['USE_FRAMEWORKS']
23+
if linkage != nil
24+
Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green
25+
use_frameworks! :linkage => linkage.to_sym
26+
end
27+
1828
target 'BottomSheetExample' do
1929
config = use_native_modules!
2030

@@ -41,8 +51,7 @@ target 'BottomSheetExample' do
4151
post_install do |installer|
4252
react_native_post_install(
4353
installer,
44-
# Set `mac_catalyst_enabled` to `true` in order to apply patches
45-
# necessary for Mac Catalyst builds
54+
config[:reactNativePath],
4655
:mac_catalyst_enabled => false
4756
)
4857
__apply_Xcode_12_5_M1_post_install_workaround(installer)

0 commit comments

Comments
 (0)