Skip to content
This repository was archived by the owner on Oct 19, 2024. It is now read-only.

Commit 4a60d81

Browse files
committed
Merge branch 'main' into candidate
2 parents 40330e5 + f1ba7ce commit 4a60d81

File tree

29 files changed

+2065
-1878
lines changed

29 files changed

+2065
-1878
lines changed
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
diff --git a/Libraries/Utilities/setAndForwardRef.js b/Libraries/Utilities/setAndForwardRef.js
2+
new file mode 100644
3+
index 0000000000000000000000000000000000000000..e67b530b9a933b68e219e2b8cec2a66dc8f51323
4+
--- /dev/null
5+
+++ b/Libraries/Utilities/setAndForwardRef.js
6+
@@ -0,0 +1,68 @@
7+
+/**
8+
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
9+
+ *
10+
+ * This source code is licensed under the MIT license found in the
11+
+ * LICENSE file in the root directory of this source tree.
12+
+ *
13+
+ * @format
14+
+ * @flow
15+
+ */
16+
+
17+
+'use strict'
18+
+
19+
+import type { ElementRef, Ref } from 'react'
20+
+
21+
+type Args = $ReadOnly<{|
22+
+ getForwardedRef: () => ?Ref<any>,
23+
+ setLocalRef: (ref: ElementRef<any>) => mixed
24+
+|}>
25+
+
26+
+/**
27+
+ * This is a helper function for when a component needs to be able to forward a ref
28+
+ * to a child component, but still needs to have access to that component as part of
29+
+ * its implementation.
30+
+ *
31+
+ * Its main use case is in wrappers for native components.
32+
+ *
33+
+ * Usage:
34+
+ *
35+
+ * class MyView extends React.Component {
36+
+ * _nativeRef = null;
37+
+ *
38+
+ * _setNativeRef = setAndForwardRef({
39+
+ * getForwardedRef: () => this.props.forwardedRef,
40+
+ * setLocalRef: ref => {
41+
+ * this._nativeRef = ref;
42+
+ * },
43+
+ * });
44+
+ *
45+
+ * render() {
46+
+ * return <View ref={this._setNativeRef} />;
47+
+ * }
48+
+ * }
49+
+ *
50+
+ * const MyViewWithRef = React.forwardRef((props, ref) => (
51+
+ * <MyView {...props} forwardedRef={ref} />
52+
+ * ));
53+
+ *
54+
+ * module.exports = MyViewWithRef;
55+
+ */
56+
+
57+
+function setAndForwardRef({ getForwardedRef, setLocalRef }: Args): (ref: ElementRef<any>) => void {
58+
+ return function forwardRef(ref: ElementRef<any>) {
59+
+ const forwardedRef = getForwardedRef()
60+
+
61+
+ setLocalRef(ref)
62+
+
63+
+ // Forward to user ref prop (if one has been specified)
64+
+ if (typeof forwardedRef === 'function') {
65+
+ // Handle function-based refs. String-based refs are handled as functions.
66+
+ forwardedRef(ref)
67+
+ } else if (typeof forwardedRef === 'object' && forwardedRef != null) {
68+
+ // Handle createRef-based refs
69+
+ forwardedRef.current = ref
70+
+ }
71+
+ }
72+
+}
73+
+
74+
+module.exports = setAndForwardRef

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
source "https://rubygems.org"
22

33
gem "fastlane"
4-
gem 'cocoapods'
4+
gem 'cocoapods', '~> 1.12'
55
plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile')
66
eval_gemfile(plugins_path) if File.exist?(plugins_path)

android/app/build.gradle

Lines changed: 2 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ apply plugin: "com.android.application"
22
apply plugin: "com.facebook.react"
33
apply plugin: 'com.google.gms.google-services'
44

5-
import com.android.build.OutputFile
6-
75
/**
86
* This is the configuration block to customize your React Native Android app.
97
* By default you don't need to apply any configuration, just uncomment the lines you need.
@@ -15,8 +13,8 @@ react {
1513
// root = file("../")
1614
// The folder where the react-native NPM package is. Default is ../node_modules/react-native
1715
// reactNativeDir = file("../node_modules/react-native")
18-
// The folder where the react-native Codegen package is. Default is ../node_modules/react-native-codegen
19-
// codegenDir = file("../node_modules/react-native-codegen")
16+
// The folder where the react-native Codegen package is. Default is ../node_modules/@react-native/codegen
17+
// codegenDir = file("../node_modules/@react-native/codegen")
2018
// The cli.js file which is the React Native CLI entrypoint. Default is ../node_modules/react-native/cli.js
2119
// cliFile = file("../node_modules/react-native/cli.js")
2220
/* Variants */
@@ -51,14 +49,6 @@ react {
5149
// hermesFlags = ["-O", "-output-source-map"]
5250
}
5351

54-
/**
55-
* Set this to true to create four separate APKs instead of one,
56-
* one for each native architecture. This is useful if you don't
57-
* use App Bundles (https://developer.android.com/guide/app-bundle/)
58-
* and want to have separate APKs to upload to the Play Store.
59-
*/
60-
def enableSeparateBuildPerCPUArchitecture = false
61-
6252
/**
6353
* Set this to true to Run Proguard on Release builds to minify the Java bytecode.
6454
*/
@@ -77,16 +67,6 @@ def enableProguardInReleaseBuilds = false
7767
*/
7868
def jscFlavor = 'org.webkit:android-jsc:+'
7969

80-
/**
81-
* Private function to get the list of Native Architectures you want to build.
82-
* This reads the value from reactNativeArchitectures in your gradle.properties
83-
* file and works together with the --active-arch-only flag of react-native run-android.
84-
*/
85-
def reactNativeArchitectures() {
86-
def value = project.getProperties().get("reactNativeArchitectures")
87-
return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"]
88-
}
89-
9070
android {
9171
ndkVersion rootProject.ext.ndkVersion
9272

@@ -105,14 +85,6 @@ android {
10585
versionCode 50
10686
versionName "0.2"
10787
}
108-
splits {
109-
abi {
110-
reset()
111-
enable enableSeparateBuildPerCPUArchitecture
112-
universalApk false // If true, also generate a universal APK
113-
include (*reactNativeArchitectures())
114-
}
115-
}
11688
signingConfigs {
11789
debug {
11890
storeFile file('debug.keystore')
@@ -133,28 +105,9 @@ android {
133105
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
134106
}
135107
}
136-
137-
// applicationVariants are e.g. debug, release
138-
applicationVariants.all { variant ->
139-
variant.outputs.each { output ->
140-
// For each separate APK per architecture, set a unique version code as described here:
141-
// https://developer.android.com/studio/build/configure-apk-splits.html
142-
def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]
143-
def abi = output.getFilter(OutputFile.ABI)
144-
if (abi != null) { // null for the universal-debug, universal-release variants
145-
output.versionCodeOverride =
146-
defaultConfig.versionCode * 1000 + versionCodes.get(abi)
147-
}
148-
149-
}
150-
}
151108
}
152109

153110
dependencies {
154-
implementation ("androidx.lifecycle:lifecycle-runtime-ktx:2.3.0") {
155-
force = true
156-
}
157-
158111
def isGifEnabled = (findProperty('expo.gif.enabled') ?: "") == "true";
159112
def isWebpEnabled = (findProperty('expo.webp.enabled') ?: "") == "true";
160113
def isWebpAnimatedEnabled = (findProperty('expo.webp.animated') ?: "") == "true";
@@ -182,7 +135,6 @@ dependencies {
182135

183136
// The version of react-native is set by the React Native Gradle Plugin
184137
implementation("com.facebook.react:react-android")
185-
implementation("androidx.swiperefreshlayout:swiperefreshlayout:1.0.0")
186138
debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}")
187139
debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
188140
exclude group:'com.squareup.okhttp3', module:'okhttp'

android/app/src/main/java/com/xmflsct/app/tooot/MainActivity.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@ protected ReactActivityDelegate createReactActivityDelegate() {
3434
this,
3535
getMainComponentName(),
3636
// If you opted-in for the New Architecture, we enable the Fabric Renderer.
37-
DefaultNewArchitectureEntryPoint.getFabricEnabled(), // fabricEnabled
38-
// If you opted-in for the New Architecture, we enable Concurrent React (i.e. React 18).
39-
DefaultNewArchitectureEntryPoint.getConcurrentReactEnabled() // concurrentRootEnabled
40-
);
37+
DefaultNewArchitectureEntryPoint.getFabricEnabled());
4138
}
4239
}

android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ buildscript {
1717
jcenter()
1818
}
1919
dependencies {
20-
classpath("com.android.tools.build:gradle:7.4.1")
20+
classpath("com.android.tools.build:gradle")
2121
classpath("com.facebook.react:react-native-gradle-plugin")
2222
classpath 'com.google.gms:google-services:4.3.14'
2323
}

android/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ android.useAndroidX=true
2626
android.enableJetifier=true
2727

2828
# Version of flipper SDK to use with React Native
29-
FLIPPER_VERSION=0.176.1
29+
FLIPPER_VERSION=0.182.0
3030

3131
# Use this property to specify which architecture you want to build.
3232
# You can also override it from the CLI using
1.71 KB
Binary file not shown.
Lines changed: 2 additions & 1 deletion
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

android/gradlew

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,11 @@ do
3737
*) app_path=$APP_HOME$link ;;
3838
esac
3939
done
40-
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
4140

42-
APP_NAME="Gradle"
41+
# This is normally unused
42+
# shellcheck disable=SC2034
4343
APP_BASE_NAME=${0##*/}
44+
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
4445

4546
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
4647
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
@@ -99,12 +100,16 @@ fi
99100
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
100101
case $MAX_FD in #(
101102
max*)
103+
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
104+
# shellcheck disable=SC3045
102105
MAX_FD=$( ulimit -H -n ) ||
103106
warn "Could not query maximum file descriptor limit"
104107
esac
105108
case $MAX_FD in #(
106109
'' | soft) :;; #(
107110
*)
111+
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
112+
# shellcheck disable=SC3045
108113
ulimit -n "$MAX_FD" ||
109114
warn "Could not set maximum file descriptor limit to $MAX_FD"
110115
esac
@@ -157,6 +162,13 @@ set -- \
157162
-classpath "$CLASSPATH" \
158163
org.gradle.wrapper.GradleWrapperMain \
159164
"$@"
165+
166+
# Stop when "xargs" is not available.
167+
if ! command -v xargs >/dev/null 2>&1
168+
then
169+
die "xargs is not available"
170+
fi
171+
160172
# Use "xargs" to parse quoted args.
161173
#
162174
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.

android/gradlew.bat

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
@rem limitations under the License.
1515
@rem
1616

17-
@if "%DEBUG%" == "" @echo off
17+
@if "%DEBUG%"=="" @echo off
1818
@rem ##########################################################################
1919
@rem
2020
@rem Gradle startup script for Windows
@@ -25,7 +25,8 @@
2525
if "%OS%"=="Windows_NT" setlocal
2626

2727
set DIRNAME=%~dp0
28-
if "%DIRNAME%" == "" set DIRNAME=.
28+
if "%DIRNAME%"=="" set DIRNAME=.
29+
@rem This is normally unused
2930
set APP_BASE_NAME=%~n0
3031
set APP_HOME=%DIRNAME%
3132

@@ -40,7 +41,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome
4041

4142
set JAVA_EXE=java.exe
4243
%JAVA_EXE% -version >NUL 2>&1
43-
if "%ERRORLEVEL%" == "0" goto execute
44+
if %ERRORLEVEL% equ 0 goto execute
4445

4546
echo.
4647
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
@@ -74,13 +75,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
7475

7576
:end
7677
@rem End local scope for the variables with windows NT shell
77-
if "%ERRORLEVEL%"=="0" goto mainEnd
78+
if %ERRORLEVEL% equ 0 goto mainEnd
7879

7980
:fail
8081
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
8182
rem the _cmd.exe /c_ return code!
82-
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
83-
exit /b 1
83+
set EXIT_CODE=%ERRORLEVEL%
84+
if %EXIT_CODE% equ 0 set EXIT_CODE=1
85+
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
86+
exit /b %EXIT_CODE%
8487

8588
:mainEnd
8689
if "%OS%"=="Windows_NT" endlocal

0 commit comments

Comments
 (0)