From a3d9892ed9c993d16fa36fa6b713e2ead43fcc77 Mon Sep 17 00:00:00 2001 From: Nicola Corti Date: Fri, 11 Mar 2022 15:23:36 -0800 Subject: [PATCH 01/48] Build Hermes from Source (#33396) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/33396 This commit fully unplugs the `ReactAndroid` from using hermes from the NPM package and plugs the usage of Hermes via the `packages/hermes-engine` Gradle build. I've used prefab to share the .so between the two builds, so we don't need any extra machinery to make this possible. Moreover, I've added a `buildHermesFromSource` property, which defaults to false when RN is imported, but is set to true when RN is opened for local development. This should allow us to distribute the `react-native` NPM package and users could potentially toggle which source to use (but see below). Changelog: [Android] [Changed] - Build Hermes from Source Reviewed By: hramos Differential Revision: D34389875 fbshipit-source-id: 107cbe3686daf7607a1f0f75202f24cd80ce64bb --- .circleci/Dockerfiles/Dockerfile.android | 6 +- .circleci/config.yml | 2 +- ReactAndroid/build.gradle | 47 ++++++-------- ReactAndroid/hermes-engine/.npmignore | 3 + ReactAndroid/hermes-engine/build.gradle | 36 ++++++++++- ReactAndroid/hermes-engine/gradle.properties | 3 +- .../hermes/instrumentation/Android.mk | 5 +- .../facebook/hermes/reactexecutor/Android.mk | 64 +++++++++---------- .../main/jni/first-party/hermes/Android.mk | 10 --- .../src/main/jni/react/jni/Android.mk | 9 ++- ReactCommon/common.mk | 29 --------- ReactCommon/cxxreact/Android.mk | 5 +- ReactCommon/hermes/executor/Android.mk | 39 +++++------ ReactCommon/hermes/inspector/Android.mk | 3 +- build.gradle.kts | 3 + gradle.properties | 5 ++ 16 files changed, 134 insertions(+), 135 deletions(-) create mode 100644 ReactAndroid/hermes-engine/.npmignore delete mode 100644 ReactAndroid/src/main/jni/first-party/hermes/Android.mk delete mode 100644 ReactCommon/common.mk diff --git a/.circleci/Dockerfiles/Dockerfile.android b/.circleci/Dockerfiles/Dockerfile.android index af6c820ae19946..8d0e28803a5fc8 100644 --- a/.circleci/Dockerfiles/Dockerfile.android +++ b/.circleci/Dockerfiles/Dockerfile.android @@ -14,7 +14,7 @@ # and build a Android application that can be used to run the # tests specified in the scripts/ directory. # -FROM reactnativecommunity/react-native-android:5.2 +FROM reactnativecommunity/react-native-android:5.4 LABEL Description="React Native Android Test Image" LABEL maintainer="Héctor Ramos " @@ -53,6 +53,4 @@ ADD . /app RUN yarn -RUN ./gradlew :ReactAndroid:downloadBoost :ReactAndroid:downloadDoubleConversion :ReactAndroid:downloadFolly :ReactAndroid:downloadGlog - -RUN ./gradlew :ReactAndroid:packageReactNdkLibsForBuck -Pjobs=1 +RUN ./gradlew :ReactAndroid:assembleDebug diff --git a/.circleci/config.yml b/.circleci/config.yml index 00f5104016b9ca..1e8247ec26f157 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -67,7 +67,7 @@ executors: reactnativeandroid: <<: *defaults docker: - - image: reactnativecommunity/react-native-android:5.2 + - image: reactnativecommunity/react-native-android:5.4 resource_class: "large" environment: - TERM: "dumb" diff --git a/ReactAndroid/build.gradle b/ReactAndroid/build.gradle index 33a09c0a47ae7a..14aa4aea77c522 100644 --- a/ReactAndroid/build.gradle +++ b/ReactAndroid/build.gradle @@ -45,6 +45,10 @@ def boostPath = dependenciesPath ?: System.getenv("REACT_NATIVE_BOOST_PATH") // Setup build type for NDK, supported values: {debug, release} def nativeBuildType = System.getenv("NATIVE_BUILD_TYPE") ?: "release" +// We put the publishing version from gradle.properties inside ext. so other +// subprojects can access it as well. +ext.publishing_version = VERSION_NAME + task createNativeDepsDirectories { downloadsDir.mkdirs() thirdPartyNdkDir.mkdirs() @@ -127,24 +131,6 @@ final def prepareLibevent = tasks.register("prepareLibevent", PrepareLibeventTas it.outputDir.set(new File(thirdPartyNdkDir, "libevent")) } -task prepareHermes(dependsOn: createNativeDepsDirectories, type: Copy) { - def hermesPackagePath = findNodeModulePath(projectDir, "hermes-engine") - if (!hermesPackagePath) { - throw new GradleScriptException("Could not find the hermes-engine npm package", null) - } - - def hermesAAR = file("$hermesPackagePath/android/hermes-debug.aar") - if (!hermesAAR.exists()) { - throw new GradleScriptException("The hermes-engine npm package is missing \"android/hermes-debug.aar\"", null) - } - - def soFiles = zipTree(hermesAAR).matching({ it.include "**/*.so" }) - - from soFiles - from "src/main/jni/first-party/hermes/Android.mk" - into "$thirdPartyNdkDir/hermes" -} - task downloadGlog(dependsOn: createNativeDepsDirectories, type: Download) { src("https://github.com/google/glog/archive/v${GLOG_VERSION}.tar.gz") onlyIfNewer(true) @@ -259,18 +245,11 @@ final def extractNativeDependencies = tasks.register('extractNativeDependencies' it.extractHeadersConfiguration.setFrom(configurations.extractHeaders) it.extractJniConfiguration.setFrom(configurations.extractJNI) it.baseOutputDir = project.file("src/main/jni/first-party/") - // Sadly this task as an output folder path that is directly dependent on - // the task input (i.e. src/main/jni/first-party//... - // This means that this task is using the parent folder (first-party/) as - // @OutputFolder. The `prepareHermes` task will also output inside that - // folder and if the two tasks happen to be inside the same run, we want - // `extractNativeDependencies` to run after `prepareHermes` to do not - // invalidate the input/output calculation for this task. - it.mustRunAfter(prepareHermes) } task installArchives { dependsOn("publishReleasePublicationToNpmRepository") + dependsOn(":ReactAndroid:hermes-engine:installArchives") } // Creating sources with comments @@ -314,6 +293,7 @@ android { "REACT_COMMON_DIR=$projectDir/../ReactCommon", "REACT_GENERATED_SRC_DIR=$buildDir/generated/source", "REACT_SRC_DIR=$projectDir/src/main/java/com/facebook/react", + "APP_STL=c++_shared", "-j${ndkBuildJobs()}" if (Os.isFamily(Os.FAMILY_MAC)) { @@ -333,7 +313,7 @@ android { } } - preBuild.dependsOn(prepareJSC, prepareHermes, prepareBoost, prepareDoubleConversion, prepareFmt, prepareFolly, prepareGlog, prepareLibevent, extractNativeDependencies) + preBuild.dependsOn(prepareJSC, prepareBoost, prepareDoubleConversion, prepareFmt, prepareFolly, prepareGlog, prepareLibevent, extractNativeDependencies) preBuild.dependsOn("generateCodegenArtifactsFromSchema") sourceSets.main { @@ -366,6 +346,10 @@ android { extractJNI javadocDeps.extendsFrom api } + + buildFeatures { + prefab true + } } dependencies { @@ -388,6 +372,15 @@ dependencies { extractHeaders("com.facebook.fbjni:fbjni:0.2.2:headers") extractJNI("com.facebook.fbjni:fbjni:0.2.2") + // It's up to the consumer to decide if hermes should be included or not. + // Therefore hermes-engine is a compileOnly dependency. + // Moreover, you can toggle where to get the dependency with `buildHermesFromSource`. + if (project.getProperties().getOrDefault("buildHermesFromSource", "false").toBoolean()) { + compileOnly(project(":ReactAndroid:hermes-engine")) + } else { + compileOnly("com.facebook.react:hermes-engine:${VERSION_NAME}") + } + javadocDeps("com.squareup:javapoet:1.13.0") testImplementation("junit:junit:${JUNIT_VERSION}") diff --git a/ReactAndroid/hermes-engine/.npmignore b/ReactAndroid/hermes-engine/.npmignore new file mode 100644 index 00000000000000..b6a87b32364a2a --- /dev/null +++ b/ReactAndroid/hermes-engine/.npmignore @@ -0,0 +1,3 @@ +# Make sure we never publish the build folders to npm. +build/ +.cxx/ diff --git a/ReactAndroid/hermes-engine/build.gradle b/ReactAndroid/hermes-engine/build.gradle index 9f681313b2e2ab..b4adb9fb4b6e3f 100644 --- a/ReactAndroid/hermes-engine/build.gradle +++ b/ReactAndroid/hermes-engine/build.gradle @@ -22,6 +22,7 @@ if (hermesVersionFile.exists()) { hermesVersion = hermesVersionFile.text } def ndkBuildJobs = Runtime.runtime.availableProcessors().toString() +def prefabHeadersDir = new File("$buildDir/prefab-headers") // We inject the JSI directory used inside the Hermes build with the -DJSI_DIR config. def jsiDir = rootProject.file("ReactCommon/jsi") @@ -42,6 +43,10 @@ task downloadNdkBuildDependencies() { dependsOn(downloadHermes) } +task installArchives { + dependsOn("publishAllPublicationsToNpmRepository") +} + task unzipHermes(dependsOn: downloadHermes, type: Copy) { from(tarTree(downloadHermes.dest)) { eachFile { file -> @@ -56,7 +61,7 @@ task unzipHermes(dependsOn: downloadHermes, type: Copy) { } -task configureNinjaForHermes(dependsOn: unzipHermes, type: org.gradle.api.tasks.Exec) { +task configureNinjaForHermes(dependsOn: unzipHermes, type: Exec) { workingDir(hermesDir) commandLine(windowsAwareCommandLine( "python3", @@ -67,11 +72,19 @@ task configureNinjaForHermes(dependsOn: unzipHermes, type: org.gradle.api.tasks. )) } -task buildNinjaForHermes(dependsOn: configureNinjaForHermes, type: org.gradle.api.tasks.Exec) { +task buildNinjaForHermes(dependsOn: configureNinjaForHermes, type: Exec) { workingDir(hermesDir) commandLine(windowsAwareCommandLine("cmake", "--build", "./ninja_build", "--target", "hermesc", "-j", ndkBuildJobs)) } +task prepareHeadersForPrefab(dependsOn: unzipHermes, type: Copy) { + from("$hermesDir/API") + from("$hermesDir/public") + include("**/*.h") + exclude("jsi/**") + into(prefabHeadersDir) +} + static def windowsAwareCommandLine(String... commands) { def newCommands = [] if (Os.isFamily(Os.FAMILY_WINDOWS)) { @@ -88,6 +101,7 @@ def reactNativeArchitectures() { android { compileSdkVersion 31 + buildToolsVersion = "31.0.0" // Used to override the NDK path & version on internal CI if (System.getenv("ANDROID_NDK") != null && System.getenv("LOCAL_ANDROID_NDK_VERSION") != null) { @@ -180,12 +194,28 @@ android { allVariants() } } + + buildFeatures { + prefabPublishing true + } + + prefab { + libhermes { + headers prefabHeadersDir.absolutePath + libraryName "libhermes" + } + } } afterEvaluate { preBuild.dependsOn(buildNinjaForHermes) + preBuild.dependsOn(prepareHeadersForPrefab) // Needed as some of the native sources needs to be downloaded // before configureCMakeRelease/configureCMakeMinSizeRel could be executed. + reactNativeArchitectures().each { architecture -> + tasks.named("configureCMakeMinSizeRel[${architecture}]") { dependsOn(preBuild) } + tasks.named("configureCMakeRelease[${architecture}]") { dependsOn(preBuild) } + } configureCMakeRelease.dependsOn(preBuild) configureCMakeMinSizeRel.dependsOn(preBuild) @@ -206,4 +236,4 @@ afterEvaluate { } group = "com.facebook.react" -version = VERSION_NAME +version = parent.publishing_version diff --git a/ReactAndroid/hermes-engine/gradle.properties b/ReactAndroid/hermes-engine/gradle.properties index d43457e0b758ba..8b53deb7d709fe 100644 --- a/ReactAndroid/hermes-engine/gradle.properties +++ b/ReactAndroid/hermes-engine/gradle.properties @@ -1,2 +1 @@ -VERSION_NAME=1000.0.0-main -android.disableAutomaticComponentCreation=true \ No newline at end of file +android.disableAutomaticComponentCreation=true diff --git a/ReactAndroid/src/main/java/com/facebook/hermes/instrumentation/Android.mk b/ReactAndroid/src/main/java/com/facebook/hermes/instrumentation/Android.mk index 6495b130675500..a104743b82e9ab 100644 --- a/ReactAndroid/src/main/java/com/facebook/hermes/instrumentation/Android.mk +++ b/ReactAndroid/src/main/java/com/facebook/hermes/instrumentation/Android.mk @@ -7,14 +7,13 @@ LOCAL_PATH := $(call my-dir) REACT_NATIVE := $(LOCAL_PATH)/../../../../../../../.. -include $(REACT_NATIVE)/ReactCommon/common.mk include $(CLEAR_VARS) LOCAL_MODULE := jsijniprofiler LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp) -LOCAL_C_INCLUDES := $(LOCAL_PATH) $(REACT_NATIVE)/ReactCommon/jsi $(call find-node-module,$(LOCAL_PATH),hermes-engine)/android/include +LOCAL_C_INCLUDES := $(LOCAL_PATH) $(REACT_NATIVE)/ReactCommon/jsi LOCAL_CPP_FEATURES := exceptions @@ -29,5 +28,3 @@ LOCAL_SHARED_LIBRARIES := \ include $(BUILD_SHARED_LIBRARY) - -include $(CLEAR_VARS) diff --git a/ReactAndroid/src/main/java/com/facebook/hermes/reactexecutor/Android.mk b/ReactAndroid/src/main/java/com/facebook/hermes/reactexecutor/Android.mk index 505bab63a3a0eb..32679252689bc0 100644 --- a/ReactAndroid/src/main/java/com/facebook/hermes/reactexecutor/Android.mk +++ b/ReactAndroid/src/main/java/com/facebook/hermes/reactexecutor/Android.mk @@ -6,47 +6,47 @@ LOCAL_PATH := $(call my-dir) REACT_NATIVE := $(LOCAL_PATH)/../../../../../../../.. -include $(REACT_NATIVE)/ReactCommon/common.mk -include $(CLEAR_VARS) +ifeq ($(APP_OPTIM),debug) + include $(CLEAR_VARS) -LOCAL_MODULE := hermes-executor-release + LOCAL_MODULE := hermes-executor-debug + LOCAL_CFLAGS := -DHERMES_ENABLE_DEBUGGER=1 -LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp) + LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp) -LOCAL_C_INCLUDES := $(LOCAL_PATH) $(REACT_NATIVE)/ReactCommon/jsi $(call find-node-module,$(LOCAL_PATH),hermes-engine)/android/include + LOCAL_C_INCLUDES := $(LOCAL_PATH) $(REACT_NATIVE)/ReactCommon/jsi -LOCAL_CPP_FEATURES := exceptions + LOCAL_CPP_FEATURES := exceptions -LOCAL_STATIC_LIBRARIES := libjsireact libhermes-executor-common-release -LOCAL_SHARED_LIBRARIES := \ - libfb \ - libfbjni \ - libfolly_json \ - libhermes \ - libjsi \ - libreactnativejni + LOCAL_STATIC_LIBRARIES := libjsireact libhermes-executor-common-debug + LOCAL_SHARED_LIBRARIES := \ + libfb \ + libfbjni \ + libfolly_json \ + libhermes \ + libjsi \ + libreactnativejni -include $(BUILD_SHARED_LIBRARY) + include $(BUILD_SHARED_LIBRARY) +else + include $(CLEAR_VARS) + LOCAL_MODULE := hermes-executor-release -include $(CLEAR_VARS) + LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp) -LOCAL_MODULE := hermes-executor-debug -LOCAL_CFLAGS := -DHERMES_ENABLE_DEBUGGER=1 + LOCAL_C_INCLUDES := $(LOCAL_PATH) $(REACT_NATIVE)/ReactCommon/jsi -LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp) + LOCAL_CPP_FEATURES := exceptions -LOCAL_C_INCLUDES := $(LOCAL_PATH) $(REACT_NATIVE)/ReactCommon/jsi $(call find-node-module,$(LOCAL_PATH),hermes-engine)/android/include + LOCAL_STATIC_LIBRARIES := libjsireact libhermes-executor-common-release + LOCAL_SHARED_LIBRARIES := \ + libfb \ + libfbjni \ + libfolly_json \ + libhermes \ + libjsi \ + libreactnativejni -LOCAL_CPP_FEATURES := exceptions - -LOCAL_STATIC_LIBRARIES := libjsireact libhermes-executor-common-debug -LOCAL_SHARED_LIBRARIES := \ - libfb \ - libfbjni \ - libfolly_json \ - libhermes \ - libjsi \ - libreactnativejni - -include $(BUILD_SHARED_LIBRARY) + include $(BUILD_SHARED_LIBRARY) +endif diff --git a/ReactAndroid/src/main/jni/first-party/hermes/Android.mk b/ReactAndroid/src/main/jni/first-party/hermes/Android.mk deleted file mode 100644 index 266532a91cbd7f..00000000000000 --- a/ReactAndroid/src/main/jni/first-party/hermes/Android.mk +++ /dev/null @@ -1,10 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# -# This source code is licensed under the MIT license found in the -# LICENSE file in the root directory of this source tree. - -LOCAL_PATH:= $(call my-dir) -include $(CLEAR_VARS) -LOCAL_MODULE:= hermes -LOCAL_SRC_FILES := jni/$(TARGET_ARCH_ABI)/libhermes.so -include $(PREBUILT_SHARED_LIBRARY) diff --git a/ReactAndroid/src/main/jni/react/jni/Android.mk b/ReactAndroid/src/main/jni/react/jni/Android.mk index bb9e71013d5290..cb1c95789d7751 100644 --- a/ReactAndroid/src/main/jni/react/jni/Android.mk +++ b/ReactAndroid/src/main/jni/react/jni/Android.mk @@ -143,11 +143,18 @@ $(call import-module,jsiexecutor) $(call import-module,logger) $(call import-module,callinvoker) $(call import-module,reactperflogger) -$(call import-module,hermes) $(call import-module,runtimeexecutor) $(call import-module,react/renderer/runtimescheduler) $(call import-module,react/nativemodule/core) +# This block is needed only because we build the project on NDK r17 internally. +ifneq ($(call ndk-major-at-least,21),true) + $(call import-add-path,$(NDK_GRADLE_INJECTED_IMPORT_PATH)) +endif + +$(call import-module,prefab/hermes-engine) + + include $(REACT_SRC_DIR)/reactperflogger/jni/Android.mk # TODO (T48588859): Restructure this target to align with dir structure: "react/nativemodule/..." # Note: Update this only when ready to minimize breaking changes. diff --git a/ReactCommon/common.mk b/ReactCommon/common.mk deleted file mode 100644 index d752edce3e8e55..00000000000000 --- a/ReactCommon/common.mk +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# -# This source code is licensed under the MIT license found in the -# LICENSE file in the root directory of this source tree. - -## -# Returns the absolute path to the specified npm package, searching from the -# given base directory. This function uses Node's module resolution algorithm -# searching "node_modules" in the base directory and its ancestors. If no -# matching package is found, this function returns an empty string. -# -# The first argument to this function is the base directory from which to begin -# searching. The second argument is the name of the npm package. -# -# Ex: $(call find-node-module,$(LOCAL_PATH),hermes-engine) -### -define find-node-module -$(strip \ - $(eval _base := $(strip $(1))) \ - $(eval _package := $(strip $(2))) \ - $(eval _candidate := $(abspath $(_base)/node_modules/$(_package))) \ - $(if $(realpath $(_candidate)), \ - $(_candidate), \ - $(if $(_base), \ - $(call find-node-module,$(patsubst %/,%,$(dir $(_base))),$(_package)) \ - ) \ - ) \ -) -endef diff --git a/ReactCommon/cxxreact/Android.mk b/ReactCommon/cxxreact/Android.mk index 57533ee36cb1da..c6595e435d1678 100644 --- a/ReactCommon/cxxreact/Android.mk +++ b/ReactCommon/cxxreact/Android.mk @@ -42,6 +42,9 @@ $(call import-module,jsc) $(call import-module,glog) $(call import-module,jsi) $(call import-module,jsinspector) -$(call import-module,hermes/inspector) $(call import-module,hermes/executor) $(call import-module,logger) + +ifeq ($(APP_OPTIM),debug) + $(call import-module,hermes/inspector) +endif diff --git a/ReactCommon/hermes/executor/Android.mk b/ReactCommon/hermes/executor/Android.mk index ecd36f8d6fcbee..d5e42a1fa9d309 100644 --- a/ReactCommon/hermes/executor/Android.mk +++ b/ReactCommon/hermes/executor/Android.mk @@ -6,32 +6,33 @@ LOCAL_PATH := $(call my-dir) REACT_NATIVE := $(LOCAL_PATH)/../../.. -include $(REACT_NATIVE)/ReactCommon/common.mk -include $(CLEAR_VARS) +ifeq ($(APP_OPTIM),debug) + include $(CLEAR_VARS) -LOCAL_MODULE := hermes-executor-common-release + LOCAL_MODULE := hermes-executor-common-debug + LOCAL_CFLAGS := -DHERMES_ENABLE_DEBUGGER=1 -LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp) + LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp) -LOCAL_C_INCLUDES := $(LOCAL_PATH) $(REACT_NATIVE)/ReactCommon/jsi $(call find-node-module,$(LOCAL_PATH),hermes-engine)/android/include -LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) + LOCAL_C_INCLUDES := $(LOCAL_PATH) $(REACT_NATIVE)/ReactCommon/jsi + LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) -LOCAL_STATIC_LIBRARIES := libjsireact -LOCAL_SHARED_LIBRARIES := libhermes libjsi + LOCAL_STATIC_LIBRARIES := libjsireact libhermes-inspector + LOCAL_SHARED_LIBRARIES := libhermes libjsi -include $(BUILD_STATIC_LIBRARY) + include $(BUILD_STATIC_LIBRARY) +else + include $(CLEAR_VARS) -include $(CLEAR_VARS) + LOCAL_MODULE := hermes-executor-common-release -LOCAL_MODULE := hermes-executor-common-debug -LOCAL_CFLAGS := -DHERMES_ENABLE_DEBUGGER=1 + LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp) -LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp) + LOCAL_C_INCLUDES := $(LOCAL_PATH) $(REACT_NATIVE)/ReactCommon/jsi + LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) -LOCAL_C_INCLUDES := $(LOCAL_PATH) $(REACT_NATIVE)/ReactCommon/jsi $(call find-node-module,$(LOCAL_PATH),hermes-engine)/android/include -LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) + LOCAL_STATIC_LIBRARIES := libjsireact + LOCAL_SHARED_LIBRARIES := libhermes libjsi -LOCAL_STATIC_LIBRARIES := libjsireact libhermes-inspector -LOCAL_SHARED_LIBRARIES := libhermes libjsi - -include $(BUILD_STATIC_LIBRARY) + include $(BUILD_STATIC_LIBRARY) +endif diff --git a/ReactCommon/hermes/inspector/Android.mk b/ReactCommon/hermes/inspector/Android.mk index 77cef0a55b04b9..824ab7dfd46e88 100644 --- a/ReactCommon/hermes/inspector/Android.mk +++ b/ReactCommon/hermes/inspector/Android.mk @@ -6,7 +6,6 @@ LOCAL_PATH := $(call my-dir) REACT_NATIVE := $(LOCAL_PATH)/../../.. -include $(REACT_NATIVE)/ReactCommon/common.mk include $(CLEAR_VARS) LOCAL_MODULE := hermes-inspector @@ -16,7 +15,7 @@ LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp $(LOCAL_PATH)/detail/*.cpp $(L LOCAL_C_ROOT := $(LOCAL_PATH)/../.. LOCAL_CFLAGS := -DHERMES_ENABLE_DEBUGGER=1 -DHERMES_INSPECTOR_FOLLY_KLUDGE=1 -LOCAL_C_INCLUDES := $(LOCAL_C_ROOT) $(REACT_NATIVE)/ReactCommon/jsi $(call find-node-module,$(LOCAL_PATH),hermes-engine)/android/include +LOCAL_C_INCLUDES := $(LOCAL_C_ROOT) $(REACT_NATIVE)/ReactCommon/jsi LOCAL_EXPORT_C_INCLUDES := $(LOCAL_C_ROOT) LOCAL_CPP_FEATURES := exceptions diff --git a/build.gradle.kts b/build.gradle.kts index 8f839467045ec4..f479cf867407f5 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -25,6 +25,9 @@ allprojects { maven { url = uri("$rootDir/node_modules/jsc-android/dist") } + maven { + url = uri("$rootDir/android") + } google() mavenCentral { // We don't want to fetch react-native from Maven Central as there are diff --git a/gradle.properties b/gradle.properties index d8559b0b86ab3f..af6f360e59d4ca 100644 --- a/gradle.properties +++ b/gradle.properties @@ -11,3 +11,8 @@ kotlin_version=1.6.10 # You can also override it from the CLI using # ./gradlew -PreactNativeArchitectures=x86_64 reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64 + +# Use this property if hermes should be built from source or not. +# If set to true, ReactAndroid will depend on :packages:hermes-engine and will build it from source. +# If set to false, ReactAndroid will depend a hermes .aar which should be placed inside ./android folder. +buildHermesFromSource=true From 1042a8012fb472bd5c882b469fe507dd6279d562 Mon Sep 17 00:00:00 2001 From: Lulu Wu Date: Fri, 11 Mar 2022 16:26:48 -0800 Subject: [PATCH 02/48] Encode params in URLSearchParams Summary: URL params are not encoded which could cause a security risk, for more details pls see https://fb.workplace.com/groups/react.technologies.discussions/permalink/3184249088473474/ Changelog: [General][Security] - Encode URL params in URLSearchParams.toString() Reviewed By: yungsters Differential Revision: D34415119 fbshipit-source-id: 83c29df9427ad0adc9b6a2b4d0ff5494247aa5cb --- Libraries/Blob/URL.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Libraries/Blob/URL.js b/Libraries/Blob/URL.js index 9bcc8060e05e27..77b4d7f94d6d7f 100644 --- a/Libraries/Blob/URL.js +++ b/Libraries/Blob/URL.js @@ -101,7 +101,13 @@ export class URLSearchParams { } const last = this._searchParams.length - 1; return this._searchParams.reduce((acc, curr, index) => { - return acc + curr.join('=') + (index === last ? '' : '&'); + return ( + acc + + encodeURIComponent(curr[0]) + + '=' + + encodeURIComponent(curr[1]) + + (index === last ? '' : '&') + ); }, ''); } } From 64ebe5bbdd32fc3b3a243a8a81a6f724d8f81267 Mon Sep 17 00:00:00 2001 From: Gabriel Donadel Dall'Agnol Date: Fri, 11 Mar 2022 16:33:17 -0800 Subject: [PATCH 03/48] feat: Add dismissActionSheet method to ActionSheetIOS (#33189) Summary: This PR adds a `dismissActionSheet` method to `ActionSheetIOS` in order to allow dismissing an ActionSheet programmatically. This is especially useful in apps where a user has the ability to open an ActionSheet and then open a push notification that will redirect them to another screen which usually leads to scenarios where the presented ActionSheet has no relation with the current screen. #### TODO - [ ] Submit react-native-website PR updating ActionSheetIOS documentation. ## Changelog [iOS] [Added] - Add dismissActionSheet method to ActionSheetIOS Pull Request resolved: https://github.com/facebook/react-native/pull/33189 Test Plan: 1. Open the RNTester app and navigate to the ActionSheetIOS page 2. Test `dismissActionSheet` through the `Show Action Sheet and automatically dismiss it` example https://user-images.githubusercontent.com/11707729/155867546-c6770a49-9b09-45e3-a6b1-4f7645d67dbf.mov Reviewed By: lunaleaps Differential Revision: D34518952 Pulled By: cortinico fbshipit-source-id: 912a9b83ee078f791b42efddf5abb7e1cd09d520 --- Libraries/ActionSheetIOS/ActionSheetIOS.js | 7 ++++ .../NativeActionSheetManager.js | 1 + React/CoreModules/RCTActionSheetManager.mm | 30 ++++++++++++++++ .../ActionSheetIOS/ActionSheetIOSExample.js | 34 +++++++++++++++++++ 4 files changed, 72 insertions(+) diff --git a/Libraries/ActionSheetIOS/ActionSheetIOS.js b/Libraries/ActionSheetIOS/ActionSheetIOS.js index 30ecf4a3d019a7..0904d14024f27f 100644 --- a/Libraries/ActionSheetIOS/ActionSheetIOS.js +++ b/Libraries/ActionSheetIOS/ActionSheetIOS.js @@ -143,6 +143,13 @@ const ActionSheetIOS = { successCallback, ); }, + + dismissActionSheet: () => { + invariant(RCTActionSheetManager, "ActionSheetManager doesn't exist"); + if (typeof RCTActionSheetManager.dismissActionSheet === 'function') { + RCTActionSheetManager.dismissActionSheet(); + } + }, }; module.exports = ActionSheetIOS; diff --git a/Libraries/ActionSheetIOS/NativeActionSheetManager.js b/Libraries/ActionSheetIOS/NativeActionSheetManager.js index fb0a92ddb5d235..1f9ead0bdd8f73 100644 --- a/Libraries/ActionSheetIOS/NativeActionSheetManager.js +++ b/Libraries/ActionSheetIOS/NativeActionSheetManager.js @@ -47,6 +47,7 @@ export interface Spec extends TurboModule { |}) => void, successCallback: (completed: boolean, activityType: ?string) => void, ) => void; + +dismissActionSheet?: () => void; } export default (TurboModuleRegistry.get('ActionSheetManager'): ?Spec); diff --git a/React/CoreModules/RCTActionSheetManager.mm b/React/CoreModules/RCTActionSheetManager.mm index e2b579244de69f..433a2cfa74d6c6 100644 --- a/React/CoreModules/RCTActionSheetManager.mm +++ b/React/CoreModules/RCTActionSheetManager.mm @@ -21,10 +21,27 @@ using namespace facebook::react; @interface RCTActionSheetManager () + +@property (nonatomic, strong) NSMutableArray *alertControllers; + @end @implementation RCTActionSheetManager +- (instancetype)init +{ + self = [super init]; + if (self) { + _alertControllers = [NSMutableArray new]; + } + return self; +} + ++ (BOOL)requiresMainQueueSetup +{ + return NO; +} + RCT_EXPORT_MODULE() @synthesize viewRegistry_DEPRECATED = _viewRegistry_DEPRECATED; @@ -137,6 +154,7 @@ - (void)presentViewController:(UIViewController *)alertController handler:^(__unused UIAlertAction *action) { if (!callbackInvoked) { callbackInvoked = true; + [self->_alertControllers removeObject:alertController]; callback(@[ @(localIndex) ]); } }]; @@ -178,9 +196,21 @@ - (void)presentViewController:(UIViewController *)alertController } #endif + [_alertControllers addObject:alertController]; [self presentViewController:alertController onParentViewController:controller anchorViewTag:anchorViewTag]; } +RCT_EXPORT_METHOD(dismissActionSheet) +{ + if (_alertControllers.count == 0) { + RCTLogWarn(@"Unable to dismiss action sheet"); + } + + id _alertController = [_alertControllers lastObject]; + [_alertController dismissViewControllerAnimated:YES completion:nil]; + [_alertControllers removeLastObject]; +} + RCT_EXPORT_METHOD(showShareActionSheetWithOptions : (JS::NativeActionSheetManager::SpecShowShareActionSheetWithOptionsOptions &)options failureCallback : (RCTResponseSenderBlock)failureCallback successCallback diff --git a/packages/rn-tester/js/examples/ActionSheetIOS/ActionSheetIOSExample.js b/packages/rn-tester/js/examples/ActionSheetIOS/ActionSheetIOSExample.js index c9af0c16ffb8da..4b7ada70a3c214 100644 --- a/packages/rn-tester/js/examples/ActionSheetIOS/ActionSheetIOSExample.js +++ b/packages/rn-tester/js/examples/ActionSheetIOS/ActionSheetIOSExample.js @@ -204,6 +204,34 @@ class ActionSheetDisabledExample extends React.Component { }; } +class ActionSheetDismissExample extends React.Component<{...}> { + render() { + return ( + + + Click to show and automatically dismiss the ActionSheet after 3 + seconds + + + ); + } + + showAndDismissActionSheet = () => { + ActionSheetIOS.showActionSheetWithOptions( + { + options: BUTTONS, + cancelButtonIndex: CANCEL_INDEX, + destructiveButtonIndex: DESTRUCTIVE_INDEX, + }, + () => {}, + ); + + setTimeout(() => { + ActionSheetIOS.dismissActionSheet(); + }, 3000); + }; +} + class ShareActionSheetExample extends React.Component< $FlowFixMeProps, $FlowFixMeState, @@ -394,6 +422,12 @@ exports.examples = [ return ; }, }, + { + title: 'Show Action Sheet and automatically dismiss it', + render(): React.Element { + return ; + }, + }, { title: 'Show Share Action Sheet', render(): React.Element { From ae756647c9b8a88ba615fd30185f621825a33427 Mon Sep 17 00:00:00 2001 From: Janic Duplessis Date: Fri, 11 Mar 2022 23:24:22 -0800 Subject: [PATCH 04/48] Fix babel-plugin-codegen crash when export init is null (#33387) Summary: It is possible that `init` is null when using the following code. ```js export var a; ``` The typescript compiler actually generates something like this for enums so a lot of third party libraries triggered this issue. For example in expo-apple-authentication/build/AppleAuthentication.types.js ```js export var AppleAuthenticationScope; (function (AppleAuthenticationScope) { AppleAuthenticationScope[AppleAuthenticationScope["FULL_NAME"] = 0] = "FULL_NAME"; AppleAuthenticationScope[AppleAuthenticationScope["EMAIL"] = 1] = "EMAIL"; })(AppleAuthenticationScope || (AppleAuthenticationScope = {})); ``` This simply adds a null check. ## Changelog [General] [Fixed] - Fix babel-plugin-codegen crash when export init is null Pull Request resolved: https://github.com/facebook/react-native/pull/33387 Test Plan: Tested that this fixed the crash in an app. Reviewed By: javache Differential Revision: D34687271 Pulled By: philIip fbshipit-source-id: 7a7e0fe1bb6a7a21a5b442af26b221a263d4173d --- packages/babel-plugin-codegen/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/babel-plugin-codegen/index.js b/packages/babel-plugin-codegen/index.js index 0c7d37015b0fdf..33a71e403109c8 100644 --- a/packages/babel-plugin-codegen/index.js +++ b/packages/babel-plugin-codegen/index.js @@ -86,6 +86,7 @@ module.exports = function ({parse, types: t}) { if (firstDeclaration.type === 'VariableDeclarator') { if ( + firstDeclaration.init && firstDeclaration.init.type === 'CallExpression' && firstDeclaration.init.callee.type === 'Identifier' && firstDeclaration.init.callee.name === 'codegenNativeCommands' From 75105e692c2be9bd192089a6a6ffde7572ee1ce1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danilo=20B=C3=BCrger?= Date: Sat, 12 Mar 2022 08:32:09 -0800 Subject: [PATCH 05/48] Start surface after setting the delegate (#33402) Summary: When starting the surface, _propagateStageChange is called. This checks the delegate to call surface:didChangeStage: on it. When initWithSurface:sizeMeasureMode: is called after start, then the delegate will be nil and thus not be called. This turns it around so a delegate is present for the surface to propagate its state to. This fixes RCTContentDidAppearNotification not getting posted otherwise. ## Changelog [iOS] [Fixed] - Post RCTContentDidAppearNotification with new arch Pull Request resolved: https://github.com/facebook/react-native/pull/33402 Test Plan: I found it best to set a breakpoint in XCode to where RCTContentDidAppearNotification is being posted. Prior to the patch that breakpoint will not be called. After applying the patch, it will be called. Reviewed By: philIip Differential Revision: D34753329 Pulled By: ShikaSD fbshipit-source-id: cc44a4c3a787d49e22e9d0c3a82c0f11ed281a0a --- .../RCTSurfaceHostingProxyRootView.mm | 11 ++++------- .../SurfaceHostingView/RCTSurfaceHostingView.mm | 6 ++++-- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingProxyRootView.mm b/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingProxyRootView.mm index 626a47ed057ccf..8f48551167f398 100644 --- a/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingProxyRootView.mm +++ b/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingProxyRootView.mm @@ -73,13 +73,10 @@ - (instancetype)initWithBridge:(RCTBridge *)bridge // `RCTRootViewSizeFlexibilityNone` is the RCTRootView's default. RCTSurfaceSizeMeasureMode sizeMeasureMode = convertToSurfaceSizeMeasureMode(RCTRootViewSizeFlexibilityNone); - id surface = [[self class] createSurfaceWithBridge:bridge - moduleName:moduleName - initialProperties:initialProperties]; - [surface start]; - if (self = [super initWithSurface:surface sizeMeasureMode:sizeMeasureMode]) { - // Nothing specific to do. - } + self = [super initWithBridge:bridge + moduleName:moduleName + initialProperties:initialProperties + sizeMeasureMode:sizeMeasureMode]; RCT_PROFILE_END_EVENT(RCTProfileTagAlways, @""); diff --git a/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingView.mm b/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingView.mm index f271bb76957171..9dbfad6548dc65 100644 --- a/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingView.mm +++ b/React/Base/Surface/SurfaceHostingView/RCTSurfaceHostingView.mm @@ -46,8 +46,10 @@ - (instancetype)initWithBridge:(RCTBridge *)bridge id surface = [[self class] createSurfaceWithBridge:bridge moduleName:moduleName initialProperties:initialProperties]; - [surface start]; - return [self initWithSurface:surface sizeMeasureMode:sizeMeasureMode]; + if (self = [self initWithSurface:surface sizeMeasureMode:sizeMeasureMode]) { + [surface start]; + } + return self; } - (instancetype)initWithSurface:(id)surface From 0a004927ad18c9cf15356705bf6cac6991d7ce7b Mon Sep 17 00:00:00 2001 From: Andrei Shikov Date: Sat, 12 Mar 2022 11:19:57 -0800 Subject: [PATCH 06/48] Extract mapbuffer from reactutils module Summary: `MapBuffer` is not used in RN utils for anything shared for now, so we can remove it from the build config by reordering methods, shaving 20KB in APK size for each architecture. Also applies clang-tidy rules to `MapBuffer`/`folly::dynamic` configurations. Changelog: [Internal] - Remove `mapbuffer` dependency from `Android.mk` of reactutilsjni Reviewed By: javache, cortinico Differential Revision: D34620455 fbshipit-source-id: ad3717448f5c20fd071f71d436bb9dd00efe7eb0 --- .../textlayoutmanager/TextLayoutManager.cpp | 132 ++++++++++++++- ReactCommon/react/utils/Android.mk | 4 +- ReactCommon/react/utils/LayoutManager.h | 150 ------------------ 3 files changed, 128 insertions(+), 158 deletions(-) delete mode 100644 ReactCommon/react/utils/LayoutManager.h diff --git a/ReactCommon/react/renderer/textlayoutmanager/platform/android/react/renderer/textlayoutmanager/TextLayoutManager.cpp b/ReactCommon/react/renderer/textlayoutmanager/platform/android/react/renderer/textlayoutmanager/TextLayoutManager.cpp index 14d9a88e67e144..0701852e01d9e2 100644 --- a/ReactCommon/react/renderer/textlayoutmanager/platform/android/react/renderer/textlayoutmanager/TextLayoutManager.cpp +++ b/ReactCommon/react/renderer/textlayoutmanager/platform/android/react/renderer/textlayoutmanager/TextLayoutManager.cpp @@ -9,17 +9,139 @@ #include +#include #include #include #include +#include +#include #include -#include using namespace facebook::jni; namespace facebook { namespace react { +Size measureAndroidComponent( + ContextContainer::Shared const &contextContainer, + Tag rootTag, + std::string const &componentName, + folly::dynamic localData, + folly::dynamic props, + folly::dynamic state, + float minWidth, + float maxWidth, + float minHeight, + float maxHeight, + jfloatArray attachmentPositions) { + const jni::global_ref &fabricUIManager = + contextContainer->at>("FabricUIManager"); + + static auto measure = + jni::findClassStatic("com/facebook/react/fabric/FabricUIManager") + ->getMethod("measure"); + + auto componentNameRef = make_jstring(componentName); + local_ref localDataRNM = + ReadableNativeMap::newObjectCxxArgs(std::move(localData)); + local_ref propsRNM = + ReadableNativeMap::newObjectCxxArgs(std::move(props)); + local_ref stateRNM = + ReadableNativeMap::newObjectCxxArgs(std::move(state)); + + local_ref localDataRM = + make_local(reinterpret_cast(localDataRNM.get())); + local_ref propsRM = + make_local(reinterpret_cast(propsRNM.get())); + local_ref stateRM = + make_local(reinterpret_cast(stateRNM.get())); + + auto size = yogaMeassureToSize(measure( + fabricUIManager, + rootTag, + componentNameRef.get(), + localDataRM.get(), + propsRM.get(), + stateRM.get(), + minWidth, + maxWidth, + minHeight, + maxHeight, + attachmentPositions)); + + // Explicitly release smart pointers to free up space faster in JNI tables + componentNameRef.reset(); + localDataRM.reset(); + localDataRNM.reset(); + propsRM.reset(); + propsRNM.reset(); + stateRM.reset(); + stateRNM.reset(); + + return size; +} + +Size measureAndroidComponentMapBuffer( + const ContextContainer::Shared &contextContainer, + Tag rootTag, + std::string const &componentName, + MapBuffer localData, + MapBuffer props, + float minWidth, + float maxWidth, + float minHeight, + float maxHeight, + jfloatArray attachmentPositions) { + const jni::global_ref &fabricUIManager = + contextContainer->at>("FabricUIManager"); + auto componentNameRef = make_jstring(componentName); + + static auto measure = + jni::findClassStatic("com/facebook/react/fabric/FabricUIManager") + ->getMethod("measureMapBuffer"); + + auto localDataMap = + ReadableMapBuffer::createWithContents(std::move(localData)); + auto propsMap = ReadableMapBuffer::createWithContents(std::move(props)); + + auto size = yogaMeassureToSize(measure( + fabricUIManager, + rootTag, + componentNameRef.get(), + localDataMap.get(), + propsMap.get(), + minWidth, + maxWidth, + minHeight, + maxHeight, + attachmentPositions)); + + // Explicitly release smart pointers to free up space faster in JNI tables + componentNameRef.reset(); + localDataMap.reset(); + propsMap.reset(); + return size; +} + TextLayoutManager::TextLayoutManager( const ContextContainer::Shared &contextContainer) : contextContainer_(contextContainer), @@ -81,7 +203,7 @@ TextMeasurement TextLayoutManager::measureCachedSpannableById( contextContainer_, -1, // TODO: we should pass rootTag in "RCTText", - cacheIdMap, + std::move(cacheIdMap), toDynamic(paragraphAttributes), nullptr, minimumSize.width, @@ -232,7 +354,7 @@ TextMeasurement TextLayoutManager::doMeasure( auto attachments = TextMeasurement::Attachments{}; if (attachmentsCount > 0) { - folly::dynamic fragments = serializedAttributedString["fragments"]; + folly::dynamic const &fragments = serializedAttributedString["fragments"]; int attachmentIndex = 0; for (auto const &fragment : fragments) { auto isAttachment = fragment.find("isAttachment"); @@ -284,8 +406,8 @@ TextMeasurement TextLayoutManager::doMeasureMapBuffer( contextContainer_, -1, // TODO: we should pass rootTag in "RCTText", - attributedStringMap, - paragraphAttributesMap, + std::move(attributedStringMap), + std::move(paragraphAttributesMap), minimumSize.width, maximumSize.width, minimumSize.height, diff --git a/ReactCommon/react/utils/Android.mk b/ReactCommon/react/utils/Android.mk index f7df613ccf3369..53ebb849034544 100644 --- a/ReactCommon/react/utils/Android.mk +++ b/ReactCommon/react/utils/Android.mk @@ -23,12 +23,10 @@ LOCAL_STATIC_LIBRARIES := LOCAL_SHARED_LIBRARIES := \ libglog \ libglog_init \ - libreact_debug \ - libreact_render_mapbuffer + libreact_debug include $(BUILD_SHARED_LIBRARY) $(call import-module,react/debug) $(call import-module,fbgloginit) $(call import-module,glog) -$(call import-module,react/renderer/mapbuffer) diff --git a/ReactCommon/react/utils/LayoutManager.h b/ReactCommon/react/utils/LayoutManager.h deleted file mode 100644 index 95b7147c0f9aa1..00000000000000 --- a/ReactCommon/react/utils/LayoutManager.h +++ /dev/null @@ -1,150 +0,0 @@ -/* - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -#pragma once - -#include -#include -#include -#ifdef ANDROID -#include -#include -#include -#endif -#include - -namespace facebook { -namespace react { - -#ifdef ANDROID - -using namespace facebook::jni; - -Size measureAndroidComponent( - const ContextContainer::Shared &contextContainer, - Tag rootTag, - std::string componentName, - folly::dynamic localData, - folly::dynamic props, - folly::dynamic state, - float minWidth, - float maxWidth, - float minHeight, - float maxHeight, - jfloatArray attachmentPositions) { - const jni::global_ref &fabricUIManager = - contextContainer->at>("FabricUIManager"); - - static auto measure = - jni::findClassStatic("com/facebook/react/fabric/FabricUIManager") - ->getMethod("measure"); - - auto componentNameRef = make_jstring(componentName); - local_ref localDataRNM = - ReadableNativeMap::newObjectCxxArgs(localData); - local_ref propsRNM = - ReadableNativeMap::newObjectCxxArgs(props); - local_ref stateRNM = - ReadableNativeMap::newObjectCxxArgs(state); - - local_ref localDataRM = - make_local(reinterpret_cast(localDataRNM.get())); - local_ref propsRM = - make_local(reinterpret_cast(propsRNM.get())); - local_ref stateRM = - make_local(reinterpret_cast(stateRNM.get())); - - auto size = yogaMeassureToSize(measure( - fabricUIManager, - rootTag, - componentNameRef.get(), - localDataRM.get(), - propsRM.get(), - stateRM.get(), - minWidth, - maxWidth, - minHeight, - maxHeight, - attachmentPositions)); - - // Explicitly release smart pointers to free up space faster in JNI tables - componentNameRef.reset(); - localDataRM.reset(); - localDataRNM.reset(); - propsRM.reset(); - propsRNM.reset(); - stateRM.reset(); - stateRNM.reset(); - - return size; -} - -Size measureAndroidComponentMapBuffer( - const ContextContainer::Shared &contextContainer, - Tag rootTag, - std::string componentName, - MapBuffer &localData, - MapBuffer &props, - float minWidth, - float maxWidth, - float minHeight, - float maxHeight, - jfloatArray attachmentPositions) { - const jni::global_ref &fabricUIManager = - contextContainer->at>("FabricUIManager"); - auto componentNameRef = make_jstring(componentName); - - static auto measure = - jni::findClassStatic("com/facebook/react/fabric/FabricUIManager") - ->getMethod("measureMapBuffer"); - - auto localDataMap = - ReadableMapBuffer::createWithContents(std::move(localData)); - auto propsMap = ReadableMapBuffer::createWithContents(std::move(props)); - - auto size = yogaMeassureToSize(measure( - fabricUIManager, - rootTag, - componentNameRef.get(), - localDataMap.get(), - propsMap.get(), - minWidth, - maxWidth, - minHeight, - maxHeight, - attachmentPositions)); - - // Explicitly release smart pointers to free up space faster in JNI tables - componentNameRef.reset(); - localDataMap.reset(); - propsMap.reset(); - return size; -} - -#endif - -} // namespace react -} // namespace facebook From 5d5addd661cd269372df8fae7e8c6073f4ace749 Mon Sep 17 00:00:00 2001 From: Andrei Shikov Date: Sun, 13 Mar 2022 15:15:21 -0700 Subject: [PATCH 07/48] Separate folly into runtime + folly_futures specific for hermes inspector Summary: Rearranges folly_futures configuration into a static library only required for `hermes-inspector` + `folly_runtime` which merges `folly_json` and mutex-related implementations `folly_futures` was used for. As `hermes-executor-debug` is removed by `vmCleanup` configurations later, it allows to shave additional 300KB from the release APK size. Changelog: [Internal] - Rearrange folly build to reduce APK size Reviewed By: cortinico Differential Revision: D34342514 fbshipit-source-id: b646680343e6b9a7674019506b87b96f6007caf2 --- ReactAndroid/Android-prebuilt.mk | 17 ++--- .../hermes/instrumentation/Android.mk | 2 +- .../facebook/hermes/reactexecutor/Android.mk | 2 +- .../react/common/mapbuffer/jni/Android.mk | 2 - .../com/facebook/react/fabric/jni/Android.mk | 3 +- .../com/facebook/react/jscexecutor/Android.mk | 2 +- .../react/modules/blob/jni/Android.mk | 2 +- .../facebook/react/uimanager/jni/Android.mk | 2 - .../src/main/jni/react/jni/Android.mk | 4 +- .../src/main/jni/third-party/folly/Android.mk | 62 +++++++++---------- ReactCommon/butter/Android.mk | 2 - ReactCommon/cxxreact/Android.mk | 2 +- ReactCommon/hermes/inspector/Android.mk | 6 +- ReactCommon/jsi/Android.mk | 4 +- ReactCommon/jsiexecutor/Android.mk | 2 +- ReactCommon/react/debug/Android.mk | 2 +- .../react/nativemodule/core/Android.mk | 2 +- .../react/renderer/animations/Android.mk | 3 +- .../renderer/attributedstring/Android.mk | 3 +- .../renderer/componentregistry/Android.mk | 4 +- .../componentregistry/native/Android.mk | 3 +- .../renderer/components/image/Android.mk | 2 +- .../renderer/components/modal/Android.mk | 2 +- .../components/progressbar/Android.mk | 3 +- .../react/renderer/components/root/Android.mk | 3 +- .../renderer/components/scrollview/Android.mk | 3 +- .../renderer/components/slider/Android.mk | 3 +- .../renderer/components/switch/Android.mk | 3 +- .../react/renderer/components/text/Android.mk | 2 +- .../renderer/components/textinput/Android.mk | 2 +- .../components/unimplementedview/Android.mk | 3 +- .../react/renderer/components/view/Android.mk | 2 +- ReactCommon/react/renderer/core/Android.mk | 3 +- ReactCommon/react/renderer/debug/Android.mk | 2 +- .../react/renderer/graphics/Android.mk | 3 +- .../react/renderer/imagemanager/Android.mk | 2 +- .../react/renderer/mounting/Android.mk | 3 +- .../react/renderer/scheduler/Android.mk | 3 +- .../react/renderer/telemetry/Android.mk | 3 +- .../renderer/templateprocessor/Android.mk | 3 +- .../renderer/textlayoutmanager/Android.mk | 3 +- .../react/renderer/uimanager/Android.mk | 3 +- .../generators/modules/GenerateModuleJniH.js | 2 +- .../GenerateModuleJniH-test.js.snap | 14 ++--- .../android/app/src/main/jni/Android.mk | 3 +- template/android/app/src/main/jni/Android.mk | 5 +- 46 files changed, 90 insertions(+), 121 deletions(-) diff --git a/ReactAndroid/Android-prebuilt.mk b/ReactAndroid/Android-prebuilt.mk index 726a8a1d025e97..d7d0d593e95f30 100644 --- a/ReactAndroid/Android-prebuilt.mk +++ b/ReactAndroid/Android-prebuilt.mk @@ -29,10 +29,10 @@ LOCAL_SRC_FILES := $(REACT_NDK_EXPORT_DIR)/$(TARGET_ARCH_ABI)/libfb.so LOCAL_EXPORT_C_INCLUDES := $(FIRST_PARTY_NDK_DIR)/fb/include include $(PREBUILT_SHARED_LIBRARY) -# folly_json +# folly_runtime include $(CLEAR_VARS) -LOCAL_MODULE := folly_json -LOCAL_SRC_FILES := $(REACT_NDK_EXPORT_DIR)/$(TARGET_ARCH_ABI)/libfolly_json.so +LOCAL_MODULE := folly_runtime +LOCAL_SRC_FILES := $(REACT_NDK_EXPORT_DIR)/$(TARGET_ARCH_ABI)/libfolly_runtime.so LOCAL_EXPORT_C_INCLUDES := \ $(THIRD_PARTY_NDK_DIR)/boost/boost_1_63_0 \ $(THIRD_PARTY_NDK_DIR)/double-conversion \ @@ -49,13 +49,6 @@ LOCAL_CFLAGS += $(FOLLY_FLAGS) LOCAL_EXPORT_CPPFLAGS := $(FOLLY_FLAGS) include $(PREBUILT_SHARED_LIBRARY) -# folly_futures -include $(CLEAR_VARS) -LOCAL_MODULE := folly_futures -LOCAL_SRC_FILES := $(REACT_NDK_EXPORT_DIR)/$(TARGET_ARCH_ABI)/libfolly_futures.so -LOCAL_SHARED_LIBRARIES := liblibfolly_json -include $(PREBUILT_SHARED_LIBRARY) - # glog include $(CLEAR_VARS) LOCAL_MODULE := glog @@ -87,7 +80,7 @@ LOCAL_EXPORT_C_INCLUDES := \ $(REACT_COMMON_DIR)/jsi \ $(REACT_COMMON_DIR)/react/nativemodule/core \ $(REACT_COMMON_DIR)/react/nativemodule/core/platform/android -LOCAL_SHARED_LIBRARIES := libfolly_json +LOCAL_SHARED_LIBRARIES := libfolly_runtime include $(PREBUILT_SHARED_LIBRARY) # turbomodulejsijni @@ -121,7 +114,7 @@ LOCAL_MODULE := react_debug LOCAL_SRC_FILES := $(REACT_NDK_EXPORT_DIR)/$(TARGET_ARCH_ABI)/libreact_debug.so LOCAL_EXPORT_C_INCLUDES := \ $(REACT_COMMON_DIR)/react/debug -LOCAL_SHARED_LIBRARIES := libfolly_json +LOCAL_SHARED_LIBRARIES := libfolly_runtime include $(PREBUILT_SHARED_LIBRARY) # react_render_graphics diff --git a/ReactAndroid/src/main/java/com/facebook/hermes/instrumentation/Android.mk b/ReactAndroid/src/main/java/com/facebook/hermes/instrumentation/Android.mk index a104743b82e9ab..32f5844a453457 100644 --- a/ReactAndroid/src/main/java/com/facebook/hermes/instrumentation/Android.mk +++ b/ReactAndroid/src/main/java/com/facebook/hermes/instrumentation/Android.mk @@ -21,7 +21,7 @@ LOCAL_STATIC_LIBRARIES := libjsireact LOCAL_SHARED_LIBRARIES := \ libfb \ libfbjni \ - libfolly_json \ + libfolly_runtime \ libhermes \ libjsi \ libreactnativejni diff --git a/ReactAndroid/src/main/java/com/facebook/hermes/reactexecutor/Android.mk b/ReactAndroid/src/main/java/com/facebook/hermes/reactexecutor/Android.mk index 32679252689bc0..66b791f766d238 100644 --- a/ReactAndroid/src/main/java/com/facebook/hermes/reactexecutor/Android.mk +++ b/ReactAndroid/src/main/java/com/facebook/hermes/reactexecutor/Android.mk @@ -22,7 +22,7 @@ ifeq ($(APP_OPTIM),debug) LOCAL_SHARED_LIBRARIES := \ libfb \ libfbjni \ - libfolly_json \ + libfolly_runtime \ libhermes \ libjsi \ libreactnativejni diff --git a/ReactAndroid/src/main/java/com/facebook/react/common/mapbuffer/jni/Android.mk b/ReactAndroid/src/main/java/com/facebook/react/common/mapbuffer/jni/Android.mk index 170afa13b106c2..b56517b8ff0756 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/common/mapbuffer/jni/Android.mk +++ b/ReactAndroid/src/main/java/com/facebook/react/common/mapbuffer/jni/Android.mk @@ -14,8 +14,6 @@ LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/react/common/mapbuffer/*.cpp) LOCAL_SHARED_LIBRARIES := \ libfb \ libfbjni \ - libfolly_futures \ - libfolly_json \ libglog \ libglog_init \ libreact_debug \ diff --git a/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/Android.mk b/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/Android.mk index 90efbec92e8f0e..4d3b97aee7e35d 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/Android.mk +++ b/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/Android.mk @@ -15,8 +15,7 @@ LOCAL_SHARED_LIBRARIES := \ libbutter \ libfb \ libfbjni \ - libfolly_futures \ - libfolly_json \ + libfolly_runtime \ libglog \ libglog_init \ libjsi \ diff --git a/ReactAndroid/src/main/java/com/facebook/react/jscexecutor/Android.mk b/ReactAndroid/src/main/java/com/facebook/react/jscexecutor/Android.mk index 0bba11802b3fa8..bb426b20829231 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/jscexecutor/Android.mk +++ b/ReactAndroid/src/main/java/com/facebook/react/jscexecutor/Android.mk @@ -19,7 +19,7 @@ LOCAL_STATIC_LIBRARIES := libjsireact jscruntime LOCAL_SHARED_LIBRARIES := \ libfb \ libfbjni \ - libfolly_json \ + libfolly_runtime \ libjsi \ libreactnativejni diff --git a/ReactAndroid/src/main/java/com/facebook/react/modules/blob/jni/Android.mk b/ReactAndroid/src/main/java/com/facebook/react/modules/blob/jni/Android.mk index 76e0bd7e22ebb0..df00d67b191aa1 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/modules/blob/jni/Android.mk +++ b/ReactAndroid/src/main/java/com/facebook/react/modules/blob/jni/Android.mk @@ -19,7 +19,7 @@ LOCAL_STATIC_LIBRARIES := libjsireact LOCAL_SHARED_LIBRARIES := \ libfb \ libfbjni \ - libfolly_json \ + libfolly_runtime \ libjsi \ libreactnativejni diff --git a/ReactAndroid/src/main/java/com/facebook/react/uimanager/jni/Android.mk b/ReactAndroid/src/main/java/com/facebook/react/uimanager/jni/Android.mk index fbf8752c816d56..a685bf3a300e37 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/uimanager/jni/Android.mk +++ b/ReactAndroid/src/main/java/com/facebook/react/uimanager/jni/Android.mk @@ -14,8 +14,6 @@ LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp) LOCAL_SHARED_LIBRARIES := \ libfb \ libfbjni \ - libfolly_futures \ - libfolly_json \ libglog \ libglog_init \ librrc_native \ diff --git a/ReactAndroid/src/main/jni/react/jni/Android.mk b/ReactAndroid/src/main/jni/react/jni/Android.mk index cb1c95789d7751..69b7e01d128888 100644 --- a/ReactAndroid/src/main/jni/react/jni/Android.mk +++ b/ReactAndroid/src/main/jni/react/jni/Android.mk @@ -30,7 +30,7 @@ LOCAL_LDLIBS += -landroid LOCAL_SHARED_LIBRARIES := \ libfb \ libfbjni \ - libfolly_json \ + libfolly_runtime \ libglog_init \ libreact_render_runtimescheduler \ libruntimeexecutor \ @@ -87,7 +87,7 @@ LOCAL_LDLIBS += -landroid LOCAL_SHARED_LIBRARIES := \ libfb \ libfbjni \ - libfolly_json \ + libfolly_runtime \ libglog_init \ libreact_render_runtimescheduler \ libreactnativeutilsjni \ diff --git a/ReactAndroid/src/main/jni/third-party/folly/Android.mk b/ReactAndroid/src/main/jni/third-party/folly/Android.mk index dacf2118dc66b6..59b721767c1611 100644 --- a/ReactAndroid/src/main/jni/third-party/folly/Android.mk +++ b/ReactAndroid/src/main/jni/third-party/folly/Android.mk @@ -1,7 +1,28 @@ LOCAL_PATH:= $(call my-dir) + +FOLLY_FLAGS := \ + -DFOLLY_NO_CONFIG=1 \ + -DFOLLY_HAVE_CLOCK_GETTIME=1 \ + -DFOLLY_USE_LIBCPP=1 \ + -DFOLLY_MOBILE=1 \ + -DFOLLY_HAVE_RECVMMSG=1 \ + -DFOLLY_HAVE_PTHREAD=1 + +# If APP_PLATFORM in Application.mk targets android-23 above, please comment this line. +# NDK uses GNU style stderror_r() after API 23. +FOLLY_FLAGS += -DFOLLY_HAVE_XSI_STRERROR_R=1 + include $(CLEAR_VARS) -LOCAL_SRC_FILES:= \ +LOCAL_SRC_FILES := \ + folly/SharedMutex.cpp \ + folly/concurrency/CacheLocality.cpp \ + folly/detail/Futex.cpp \ + folly/lang/SafeAssert.cpp \ + folly/lang/ToAscii.cpp \ + folly/synchronization/ParkingLot.cpp \ + folly/system/ThreadId.cpp \ + folly/system/ThreadName.cpp \ folly/json.cpp \ folly/Unicode.cpp \ folly/Conv.cpp \ @@ -14,13 +35,11 @@ LOCAL_SRC_FILES:= \ folly/net/NetOps.cpp \ folly/json_pointer.cpp \ folly/lang/CString.cpp \ - folly/lang/SafeAssert.cpp \ folly/detail/UniqueInstance.cpp \ folly/hash/SpookyHashV2.cpp \ folly/container/detail/F14Table.cpp \ folly/ScopeGuard.cpp \ - folly/portability/SysUio.cpp \ - folly/lang/ToAscii.cpp + folly/portability/SysUio.cpp ifeq ($(APP_OPTIM),debug) LOCAL_SRC_FILES += \ @@ -30,28 +49,14 @@ endif LOCAL_C_INCLUDES := $(LOCAL_PATH) LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) -LOCAL_CFLAGS += -fexceptions -fno-omit-frame-pointer -frtti -Wno-sign-compare - -FOLLY_FLAGS := \ - -DFOLLY_NO_CONFIG=1 \ - -DFOLLY_HAVE_CLOCK_GETTIME=1 \ - -DFOLLY_USE_LIBCPP=1 \ - -DFOLLY_MOBILE=1 \ - -DFOLLY_HAVE_RECVMMSG=1 \ - -DFOLLY_HAVE_PTHREAD=1 - -# If APP_PLATFORM in Application.mk targets android-23 above, please comment this line. -# NDK uses GNU style stderror_r() after API 23. -FOLLY_FLAGS += -DFOLLY_HAVE_XSI_STRERROR_R=1 - +LOCAL_CFLAGS += -fexceptions -fno-omit-frame-pointer -frtti -Wno-sign-compare -Wno-unused-variable LOCAL_CFLAGS += $(FOLLY_FLAGS) - LOCAL_EXPORT_CPPFLAGS := $(FOLLY_FLAGS) -LOCAL_MODULE := libfolly_json +LOCAL_MODULE := folly_runtime -LOCAL_SHARED_LIBRARIES := libglog libdouble-conversion -LOCAL_STATIC_LIBRARIES := libboost libfmt +LOCAL_SHARED_LIBRARIES := libglog +LOCAL_STATIC_LIBRARIES := libboost libfmt libdouble-conversion include $(BUILD_SHARED_LIBRARY) @@ -61,13 +66,11 @@ LOCAL_SRC_FILES := \ folly/ExceptionWrapper.cpp \ folly/ExceptionString.cpp \ folly/Executor.cpp \ - folly/SharedMutex.cpp \ folly/Singleton.cpp \ folly/Try.cpp \ folly/concurrency/CacheLocality.cpp \ folly/detail/AsyncTrace.cpp \ folly/detail/AtFork.cpp \ - folly/detail/Futex.cpp \ folly/detail/MemoryIdler.cpp \ folly/detail/SingletonStackTrace.cpp \ folly/detail/StaticSingletonManager.cpp \ @@ -97,12 +100,9 @@ LOCAL_SRC_FILES := \ folly/portability/SysMembarrier.cpp \ folly/synchronization/AsymmetricMemoryBarrier.cpp \ folly/synchronization/Hazptr.cpp \ - folly/synchronization/ParkingLot.cpp \ folly/synchronization/WaitOptions.cpp \ folly/synchronization/detail/Sleeper.cpp \ - folly/system/Pid.cpp \ - folly/system/ThreadId.cpp \ - folly/system/ThreadName.cpp + folly/system/Pid.cpp LOCAL_C_INCLUDES := $(LOCAL_PATH) @@ -116,10 +116,10 @@ LOCAL_EXPORT_CPPFLAGS := $(FOLLY_FLAGS) LOCAL_MODULE := libfolly_futures -LOCAL_SHARED_LIBRARIES := libglog libdouble-conversion libfolly_json -LOCAL_STATIC_LIBRARIES := libboost libevent libfmt +LOCAL_SHARED_LIBRARIES := libglog libfolly_runtime +LOCAL_STATIC_LIBRARIES := libboost libevent libfmt libdouble-conversion -include $(BUILD_SHARED_LIBRARY) +include $(BUILD_STATIC_LIBRARY) $(call import-module,libevent) $(call import-module,glog) diff --git a/ReactCommon/butter/Android.mk b/ReactCommon/butter/Android.mk index f2bbd9a7dc919a..cda21ea7506c81 100644 --- a/ReactCommon/butter/Android.mk +++ b/ReactCommon/butter/Android.mk @@ -19,8 +19,6 @@ LOCAL_CFLAGS := \ LOCAL_CFLAGS += -fexceptions -frtti -std=c++17 -Wall -LOCAL_STATIC_LIBRARIES := - LOCAL_SHARED_LIBRARIES := glog include $(BUILD_SHARED_LIBRARY) diff --git a/ReactCommon/cxxreact/Android.mk b/ReactCommon/cxxreact/Android.mk index c6595e435d1678..4ff838da45af8e 100644 --- a/ReactCommon/cxxreact/Android.mk +++ b/ReactCommon/cxxreact/Android.mk @@ -28,7 +28,7 @@ LOCAL_STATIC_LIBRARIES := \ LOCAL_SHARED_LIBRARIES := \ glog \ jsinspector \ - libfolly_json \ + libfolly_runtime \ libruntimeexecutor \ logger diff --git a/ReactCommon/hermes/inspector/Android.mk b/ReactCommon/hermes/inspector/Android.mk index 824ab7dfd46e88..a5e95b0f05fbd9 100644 --- a/ReactCommon/hermes/inspector/Android.mk +++ b/ReactCommon/hermes/inspector/Android.mk @@ -24,10 +24,12 @@ LOCAL_SHARED_LIBRARIES := \ jsinspector \ libfb \ libfbjni \ - libfolly_futures \ - libfolly_json \ + libfolly_runtime \ libglog \ libhermes \ libjsi +LOCAL_STATIC_LIBRARIES := \ + libfolly_futures + include $(BUILD_STATIC_LIBRARY) diff --git a/ReactCommon/jsi/Android.mk b/ReactCommon/jsi/Android.mk index ee42537e70145c..f75a528e7467d5 100644 --- a/ReactCommon/jsi/Android.mk +++ b/ReactCommon/jsi/Android.mk @@ -15,7 +15,7 @@ LOCAL_C_INCLUDES := $(LOCAL_PATH) LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) LOCAL_CFLAGS := -fexceptions -frtti -O3 -LOCAL_SHARED_LIBRARIES := libfolly_json glog +LOCAL_SHARED_LIBRARIES := libfolly_runtime glog include $(BUILD_SHARED_LIBRARY) @@ -30,7 +30,7 @@ LOCAL_C_INCLUDES := $(LOCAL_PATH) LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) LOCAL_CFLAGS := -fexceptions -frtti -O3 -LOCAL_SHARED_LIBRARIES := libfolly_json libjsc glog +LOCAL_SHARED_LIBRARIES := libfolly_runtime libjsc glog # TODO: Remove this flag when ready. # Android has this enabled by default, but the flag is still needed for iOS. diff --git a/ReactCommon/jsiexecutor/Android.mk b/ReactCommon/jsiexecutor/Android.mk index 2c523fcbe28e8a..9749ca7a36f27c 100644 --- a/ReactCommon/jsiexecutor/Android.mk +++ b/ReactCommon/jsiexecutor/Android.mk @@ -17,6 +17,6 @@ LOCAL_EXPORT_C_INCLUDES := $(LOCAL_C_INCLUDES) LOCAL_CFLAGS := -fexceptions -frtti -O3 LOCAL_STATIC_LIBRARIES := reactnative reactperflogger -LOCAL_SHARED_LIBRARIES := libfolly_json glog libjsi +LOCAL_SHARED_LIBRARIES := libfolly_runtime glog libjsi include $(BUILD_STATIC_LIBRARY) diff --git a/ReactCommon/react/debug/Android.mk b/ReactCommon/react/debug/Android.mk index 26354629e27b3a..39be4fd41f7c1b 100644 --- a/ReactCommon/react/debug/Android.mk +++ b/ReactCommon/react/debug/Android.mk @@ -15,7 +15,7 @@ LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp) LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../../../ -LOCAL_SHARED_LIBRARIES := libfolly_json +LOCAL_SHARED_LIBRARIES := libfolly_runtime LOCAL_LDLIBS := -llog diff --git a/ReactCommon/react/nativemodule/core/Android.mk b/ReactCommon/react/nativemodule/core/Android.mk index 8689f2bfe11cc2..677bfec76d3a3c 100644 --- a/ReactCommon/react/nativemodule/core/Android.mk +++ b/ReactCommon/react/nativemodule/core/Android.mk @@ -17,7 +17,7 @@ LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../../../ $(LOCAL_PATH) $(LOCAL_PATH)/p LOCAL_SHARED_LIBRARIES := \ libfbjni \ - libfolly_json \ + libfolly_runtime \ libjsi \ libreact_debug \ libreactnativejni diff --git a/ReactCommon/react/renderer/animations/Android.mk b/ReactCommon/react/renderer/animations/Android.mk index ea096c3132210d..ce6a627e1b0ef3 100644 --- a/ReactCommon/react/renderer/animations/Android.mk +++ b/ReactCommon/react/renderer/animations/Android.mk @@ -23,8 +23,7 @@ LOCAL_STATIC_LIBRARIES := LOCAL_SHARED_LIBRARIES := \ glog \ - libfolly_futures \ - libfolly_json \ + libfolly_runtime \ libglog_init \ libjsi \ libreact_debug \ diff --git a/ReactCommon/react/renderer/attributedstring/Android.mk b/ReactCommon/react/renderer/attributedstring/Android.mk index aa1c13ff3fc9a9..eddbaa9bcd63b5 100644 --- a/ReactCommon/react/renderer/attributedstring/Android.mk +++ b/ReactCommon/react/renderer/attributedstring/Android.mk @@ -24,8 +24,7 @@ LOCAL_STATIC_LIBRARIES := LOCAL_SHARED_LIBRARIES := \ glog \ libbutter \ - libfolly_futures \ - libfolly_json \ + libfolly_runtime \ libglog_init \ libreact_debug \ libreact_render_core \ diff --git a/ReactCommon/react/renderer/componentregistry/Android.mk b/ReactCommon/react/renderer/componentregistry/Android.mk index 7e8948d14ecf3f..3d4a1379eb4017 100644 --- a/ReactCommon/react/renderer/componentregistry/Android.mk +++ b/ReactCommon/react/renderer/componentregistry/Android.mk @@ -16,8 +16,7 @@ LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp) LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../../../ LOCAL_SHARED_LIBRARIES := \ - libfolly_futures \ - libfolly_json \ + libfolly_runtime \ libglog_init \ libjsi \ libreact_debug \ @@ -25,6 +24,7 @@ LOCAL_SHARED_LIBRARIES := \ libreact_render_debug \ libreact_utils + LOCAL_CFLAGS := \ -DLOG_TAG=\"Fabric\" diff --git a/ReactCommon/react/renderer/componentregistry/native/Android.mk b/ReactCommon/react/renderer/componentregistry/native/Android.mk index 29fb69f5a9ae32..3e469cf20f1cc4 100644 --- a/ReactCommon/react/renderer/componentregistry/native/Android.mk +++ b/ReactCommon/react/renderer/componentregistry/native/Android.mk @@ -16,8 +16,7 @@ LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp) LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../../../../ LOCAL_SHARED_LIBRARIES := \ - libfolly_futures \ - libfolly_json \ + libfolly_runtime \ libglog_init \ libjsi \ libreact_debug \ diff --git a/ReactCommon/react/renderer/components/image/Android.mk b/ReactCommon/react/renderer/components/image/Android.mk index ddac17423151cb..220412cd6ac7a8 100644 --- a/ReactCommon/react/renderer/components/image/Android.mk +++ b/ReactCommon/react/renderer/components/image/Android.mk @@ -23,7 +23,7 @@ LOCAL_STATIC_LIBRARIES := LOCAL_SHARED_LIBRARIES := \ glog \ - libfolly_json \ + libfolly_runtime \ libglog_init \ libjsi \ libreact_debug \ diff --git a/ReactCommon/react/renderer/components/modal/Android.mk b/ReactCommon/react/renderer/components/modal/Android.mk index 62f84467af7c40..7b96f9b9fbff30 100644 --- a/ReactCommon/react/renderer/components/modal/Android.mk +++ b/ReactCommon/react/renderer/components/modal/Android.mk @@ -23,7 +23,7 @@ LOCAL_STATIC_LIBRARIES := LOCAL_SHARED_LIBRARIES := \ glog \ - libfolly_json \ + libfolly_runtime \ libglog_init \ libreact_codegen_rncore \ libreact_render_componentregistry \ diff --git a/ReactCommon/react/renderer/components/progressbar/Android.mk b/ReactCommon/react/renderer/components/progressbar/Android.mk index dcbf866581b708..82fa81563d2758 100644 --- a/ReactCommon/react/renderer/components/progressbar/Android.mk +++ b/ReactCommon/react/renderer/components/progressbar/Android.mk @@ -24,8 +24,7 @@ LOCAL_STATIC_LIBRARIES := LOCAL_SHARED_LIBRARIES := \ glog \ libfbjni \ - libfolly_futures \ - libfolly_json \ + libfolly_runtime \ libglog_init \ libreact_codegen_rncore \ libreact_debug \ diff --git a/ReactCommon/react/renderer/components/root/Android.mk b/ReactCommon/react/renderer/components/root/Android.mk index 2cd25871300e9f..370a6dc576adf4 100644 --- a/ReactCommon/react/renderer/components/root/Android.mk +++ b/ReactCommon/react/renderer/components/root/Android.mk @@ -23,8 +23,7 @@ LOCAL_STATIC_LIBRARIES := LOCAL_SHARED_LIBRARIES := \ glog \ - libfolly_futures \ - libfolly_json \ + libfolly_runtime \ libglog_init \ libreact_debug \ libreact_render_core \ diff --git a/ReactCommon/react/renderer/components/scrollview/Android.mk b/ReactCommon/react/renderer/components/scrollview/Android.mk index cd9e66243298bc..f45267d27d735d 100644 --- a/ReactCommon/react/renderer/components/scrollview/Android.mk +++ b/ReactCommon/react/renderer/components/scrollview/Android.mk @@ -23,8 +23,7 @@ LOCAL_STATIC_LIBRARIES := LOCAL_SHARED_LIBRARIES := \ glog \ - libfolly_futures \ - libfolly_json \ + libfolly_runtime \ libglog_init \ libjsi \ libreact_debug \ diff --git a/ReactCommon/react/renderer/components/slider/Android.mk b/ReactCommon/react/renderer/components/slider/Android.mk index e4515f601e54b2..1d533b86f1a832 100644 --- a/ReactCommon/react/renderer/components/slider/Android.mk +++ b/ReactCommon/react/renderer/components/slider/Android.mk @@ -24,8 +24,7 @@ LOCAL_STATIC_LIBRARIES := LOCAL_SHARED_LIBRARIES := \ glog \ libfbjni \ - libfolly_futures \ - libfolly_json \ + libfolly_runtime \ libglog_init \ libreact_codegen_rncore \ libreact_debug \ diff --git a/ReactCommon/react/renderer/components/switch/Android.mk b/ReactCommon/react/renderer/components/switch/Android.mk index a008d6626e63e1..e254c06de69d0a 100644 --- a/ReactCommon/react/renderer/components/switch/Android.mk +++ b/ReactCommon/react/renderer/components/switch/Android.mk @@ -24,8 +24,7 @@ LOCAL_STATIC_LIBRARIES := LOCAL_SHARED_LIBRARIES := \ glog \ libfbjni \ - libfolly_futures \ - libfolly_json \ + libfolly_runtime \ libglog_init \ libreact_codegen_rncore \ libreact_debug \ diff --git a/ReactCommon/react/renderer/components/text/Android.mk b/ReactCommon/react/renderer/components/text/Android.mk index fb3332e487cfd5..6d604894aaa9a0 100644 --- a/ReactCommon/react/renderer/components/text/Android.mk +++ b/ReactCommon/react/renderer/components/text/Android.mk @@ -23,7 +23,7 @@ LOCAL_STATIC_LIBRARIES := LOCAL_SHARED_LIBRARIES := \ glog \ - libfolly_json \ + libfolly_runtime \ libglog_init \ libjsi \ libreact_debug \ diff --git a/ReactCommon/react/renderer/components/textinput/Android.mk b/ReactCommon/react/renderer/components/textinput/Android.mk index 81cf1438b999fd..a8572954c580a5 100644 --- a/ReactCommon/react/renderer/components/textinput/Android.mk +++ b/ReactCommon/react/renderer/components/textinput/Android.mk @@ -23,7 +23,7 @@ LOCAL_STATIC_LIBRARIES := LOCAL_SHARED_LIBRARIES := \ glog \ - libfolly_json \ + libfolly_runtime \ libglog_init \ libjsi \ libreact_debug \ diff --git a/ReactCommon/react/renderer/components/unimplementedview/Android.mk b/ReactCommon/react/renderer/components/unimplementedview/Android.mk index d421bd66af0951..c6fdcad16eea8b 100644 --- a/ReactCommon/react/renderer/components/unimplementedview/Android.mk +++ b/ReactCommon/react/renderer/components/unimplementedview/Android.mk @@ -23,8 +23,7 @@ LOCAL_STATIC_LIBRARIES := LOCAL_SHARED_LIBRARIES := \ glog \ - libfolly_futures \ - libfolly_json \ + libfolly_runtime \ libglog_init \ libjsi \ libreact_debug \ diff --git a/ReactCommon/react/renderer/components/view/Android.mk b/ReactCommon/react/renderer/components/view/Android.mk index 07152f97c7fff3..59d3b01ed9ab50 100644 --- a/ReactCommon/react/renderer/components/view/Android.mk +++ b/ReactCommon/react/renderer/components/view/Android.mk @@ -23,7 +23,7 @@ LOCAL_STATIC_LIBRARIES := LOCAL_SHARED_LIBRARIES := \ glog \ - libfolly_json \ + libfolly_runtime \ libfolly_futures \ libglog_init \ libjsi \ diff --git a/ReactCommon/react/renderer/core/Android.mk b/ReactCommon/react/renderer/core/Android.mk index e6544446d4f151..8f5400379d7d62 100644 --- a/ReactCommon/react/renderer/core/Android.mk +++ b/ReactCommon/react/renderer/core/Android.mk @@ -16,8 +16,7 @@ LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp) LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../../../ LOCAL_SHARED_LIBRARIES := \ - libfolly_futures \ - libfolly_json \ + libfolly_runtime \ libglog \ libjsi \ libreact_debug \ diff --git a/ReactCommon/react/renderer/debug/Android.mk b/ReactCommon/react/renderer/debug/Android.mk index 676b2bfae83fd7..45a08f478aa425 100644 --- a/ReactCommon/react/renderer/debug/Android.mk +++ b/ReactCommon/react/renderer/debug/Android.mk @@ -15,7 +15,7 @@ LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp) LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../../../ -LOCAL_SHARED_LIBRARIES := libfolly_json +LOCAL_SHARED_LIBRARIES := libfolly_runtime LOCAL_CFLAGS := \ -DLOG_TAG=\"Fabric\" diff --git a/ReactCommon/react/renderer/graphics/Android.mk b/ReactCommon/react/renderer/graphics/Android.mk index 57f0d3821c1991..d1078d99ab4784 100644 --- a/ReactCommon/react/renderer/graphics/Android.mk +++ b/ReactCommon/react/renderer/graphics/Android.mk @@ -15,8 +15,7 @@ LOCAL_SHARED_LIBRARIES := \ glog \ libfb \ libfbjni \ - libfolly_json \ - libfolly_json \ + libfolly_runtime \ libreact_debug LOCAL_STATIC_LIBRARIES := diff --git a/ReactCommon/react/renderer/imagemanager/Android.mk b/ReactCommon/react/renderer/imagemanager/Android.mk index 6a3c88ddb4de26..a7013405950820 100644 --- a/ReactCommon/react/renderer/imagemanager/Android.mk +++ b/ReactCommon/react/renderer/imagemanager/Android.mk @@ -12,7 +12,7 @@ LOCAL_MODULE := react_render_imagemanager LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp $(LOCAL_PATH)/platform/cxx/react/renderer/imagemanager/*.cpp) LOCAL_SHARED_LIBRARIES := \ - libfolly_json \ + libfolly_runtime \ libreact_debug \ libreact_render_core \ libreact_render_debug \ diff --git a/ReactCommon/react/renderer/mounting/Android.mk b/ReactCommon/react/renderer/mounting/Android.mk index f9fb22951b223a..613d77b3e93e96 100644 --- a/ReactCommon/react/renderer/mounting/Android.mk +++ b/ReactCommon/react/renderer/mounting/Android.mk @@ -24,8 +24,7 @@ LOCAL_STATIC_LIBRARIES := LOCAL_SHARED_LIBRARIES := \ glog \ libbutter \ - libfolly_futures \ - libfolly_json \ + libfolly_runtime \ libglog_init \ libjsi \ libreact_debug \ diff --git a/ReactCommon/react/renderer/scheduler/Android.mk b/ReactCommon/react/renderer/scheduler/Android.mk index 26a922c29cfcd3..246af42a9448b4 100644 --- a/ReactCommon/react/renderer/scheduler/Android.mk +++ b/ReactCommon/react/renderer/scheduler/Android.mk @@ -23,8 +23,7 @@ LOCAL_STATIC_LIBRARIES := LOCAL_SHARED_LIBRARIES := \ glog \ - libfolly_futures \ - libfolly_json \ + libfolly_runtime \ libjsi \ libreact_debug \ libreact_render_componentregistry \ diff --git a/ReactCommon/react/renderer/telemetry/Android.mk b/ReactCommon/react/renderer/telemetry/Android.mk index 060d8ddf99d84a..01456036442157 100644 --- a/ReactCommon/react/renderer/telemetry/Android.mk +++ b/ReactCommon/react/renderer/telemetry/Android.mk @@ -24,8 +24,7 @@ LOCAL_STATIC_LIBRARIES := LOCAL_SHARED_LIBRARIES := \ glog \ libbutter \ - libfolly_futures \ - libfolly_json \ + libfolly_runtime \ libglog_init \ libreact_debug \ libreact_render_core \ diff --git a/ReactCommon/react/renderer/templateprocessor/Android.mk b/ReactCommon/react/renderer/templateprocessor/Android.mk index 5cf7a2e41d49d8..f6827f980270f3 100644 --- a/ReactCommon/react/renderer/templateprocessor/Android.mk +++ b/ReactCommon/react/renderer/templateprocessor/Android.mk @@ -23,8 +23,7 @@ LOCAL_STATIC_LIBRARIES := LOCAL_SHARED_LIBRARIES := \ glog \ - libfolly_futures \ - libfolly_json \ + libfolly_runtime \ libjsi \ libreact_render_componentregistry \ libreact_render_core \ diff --git a/ReactCommon/react/renderer/textlayoutmanager/Android.mk b/ReactCommon/react/renderer/textlayoutmanager/Android.mk index c254a254e05f50..6a724e0e8f4831 100644 --- a/ReactCommon/react/renderer/textlayoutmanager/Android.mk +++ b/ReactCommon/react/renderer/textlayoutmanager/Android.mk @@ -15,8 +15,7 @@ LOCAL_SHARED_LIBRARIES := \ glog \ libfb \ libfbjni \ - libfolly_futures \ - libfolly_json \ + libfolly_runtime \ libglog_init \ libmapbufferjni \ libreact_debug \ diff --git a/ReactCommon/react/renderer/uimanager/Android.mk b/ReactCommon/react/renderer/uimanager/Android.mk index b393f1a6050017..a492a5000fa83f 100644 --- a/ReactCommon/react/renderer/uimanager/Android.mk +++ b/ReactCommon/react/renderer/uimanager/Android.mk @@ -23,8 +23,7 @@ LOCAL_STATIC_LIBRARIES := LOCAL_SHARED_LIBRARIES := \ glog \ - libfolly_futures \ - libfolly_json \ + libfolly_runtime \ libjsi \ libreact_debug \ libreact_render_componentregistry \ diff --git a/packages/react-native-codegen/src/generators/modules/GenerateModuleJniH.js b/packages/react-native-codegen/src/generators/modules/GenerateModuleJniH.js index 0c90cee8e4bb6c..ad763698efe1c2 100644 --- a/packages/react-native-codegen/src/generators/modules/GenerateModuleJniH.js +++ b/packages/react-native-codegen/src/generators/modules/GenerateModuleJniH.js @@ -81,7 +81,7 @@ LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp) $(wildcard $(LOCAL_PATH)/reac LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) $(LOCAL_PATH)/react/renderer/components/${libraryName} LOCAL_SHARED_LIBRARIES := libfbjni \ - libfolly_json \ + libfolly_runtime \ libglog \ libjsi \ libreact_codegen_rncore \ diff --git a/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleJniH-test.js.snap b/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleJniH-test.js.snap index c9ddf301a476ea..7904f7d8b4be6b 100644 --- a/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleJniH-test.js.snap +++ b/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleJniH-test.js.snap @@ -52,7 +52,7 @@ LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp) $(wildcard $(LOCAL_PATH)/reac LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) $(LOCAL_PATH)/react/renderer/components/SampleWithUppercaseName -LOCAL_SHARED_LIBRARIES := libfbjni libfolly_json libglog libjsi libreact_codegen_rncore libreact_debug libreact_nativemodule_core libreact_render_core libreact_render_debug libreact_render_graphics librrc_view libturbomodulejsijni libyoga +LOCAL_SHARED_LIBRARIES := libfbjni libfolly_runtime libglog libjsi libreact_codegen_rncore libreact_debug libreact_nativemodule_core libreact_render_core libreact_render_debug libreact_render_graphics librrc_view libturbomodulejsijni libyoga LOCAL_CFLAGS := \\\\ -DLOG_TAG=\\\\\\"ReactNative\\\\\\" @@ -116,7 +116,7 @@ LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp) $(wildcard $(LOCAL_PATH)/reac LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) $(LOCAL_PATH)/react/renderer/components/complex_objects -LOCAL_SHARED_LIBRARIES := libfbjni libfolly_json libglog libjsi libreact_codegen_rncore libreact_debug libreact_nativemodule_core libreact_render_core libreact_render_debug libreact_render_graphics librrc_view libturbomodulejsijni libyoga +LOCAL_SHARED_LIBRARIES := libfbjni libfolly_runtime libglog libjsi libreact_codegen_rncore libreact_debug libreact_nativemodule_core libreact_render_core libreact_render_debug libreact_render_graphics librrc_view libturbomodulejsijni libyoga LOCAL_CFLAGS := \\\\ -DLOG_TAG=\\\\\\"ReactNative\\\\\\" @@ -180,7 +180,7 @@ LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp) $(wildcard $(LOCAL_PATH)/reac LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) $(LOCAL_PATH)/react/renderer/components/empty_native_modules -LOCAL_SHARED_LIBRARIES := libfbjni libfolly_json libglog libjsi libreact_codegen_rncore libreact_debug libreact_nativemodule_core libreact_render_core libreact_render_debug libreact_render_graphics librrc_view libturbomodulejsijni libyoga +LOCAL_SHARED_LIBRARIES := libfbjni libfolly_runtime libglog libjsi libreact_codegen_rncore libreact_debug libreact_nativemodule_core libreact_render_core libreact_render_debug libreact_render_graphics librrc_view libturbomodulejsijni libyoga LOCAL_CFLAGS := \\\\ -DLOG_TAG=\\\\\\"ReactNative\\\\\\" @@ -244,7 +244,7 @@ LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp) $(wildcard $(LOCAL_PATH)/reac LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) $(LOCAL_PATH)/react/renderer/components/native_modules_with_type_aliases -LOCAL_SHARED_LIBRARIES := libfbjni libfolly_json libglog libjsi libreact_codegen_rncore libreact_debug libreact_nativemodule_core libreact_render_core libreact_render_debug libreact_render_graphics librrc_view libturbomodulejsijni libyoga +LOCAL_SHARED_LIBRARIES := libfbjni libfolly_runtime libglog libjsi libreact_codegen_rncore libreact_debug libreact_nativemodule_core libreact_render_core libreact_render_debug libreact_render_graphics librrc_view libturbomodulejsijni libyoga LOCAL_CFLAGS := \\\\ -DLOG_TAG=\\\\\\"ReactNative\\\\\\" @@ -316,7 +316,7 @@ LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp) $(wildcard $(LOCAL_PATH)/reac LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) $(LOCAL_PATH)/react/renderer/components/real_module_example -LOCAL_SHARED_LIBRARIES := libfbjni libfolly_json libglog libjsi libreact_codegen_rncore libreact_debug libreact_nativemodule_core libreact_render_core libreact_render_debug libreact_render_graphics librrc_view libturbomodulejsijni libyoga +LOCAL_SHARED_LIBRARIES := libfbjni libfolly_runtime libglog libjsi libreact_codegen_rncore libreact_debug libreact_nativemodule_core libreact_render_core libreact_render_debug libreact_render_graphics librrc_view libturbomodulejsijni libyoga LOCAL_CFLAGS := \\\\ -DLOG_TAG=\\\\\\"ReactNative\\\\\\" @@ -380,7 +380,7 @@ LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp) $(wildcard $(LOCAL_PATH)/reac LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) $(LOCAL_PATH)/react/renderer/components/simple_native_modules -LOCAL_SHARED_LIBRARIES := libfbjni libfolly_json libglog libjsi libreact_codegen_rncore libreact_debug libreact_nativemodule_core libreact_render_core libreact_render_debug libreact_render_graphics librrc_view libturbomodulejsijni libyoga +LOCAL_SHARED_LIBRARIES := libfbjni libfolly_runtime libglog libjsi libreact_codegen_rncore libreact_debug libreact_nativemodule_core libreact_render_core libreact_render_debug libreact_render_graphics librrc_view libturbomodulejsijni libyoga LOCAL_CFLAGS := \\\\ -DLOG_TAG=\\\\\\"ReactNative\\\\\\" @@ -452,7 +452,7 @@ LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp) $(wildcard $(LOCAL_PATH)/reac LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) $(LOCAL_PATH)/react/renderer/components/two_modules_different_files -LOCAL_SHARED_LIBRARIES := libfbjni libfolly_json libglog libjsi libreact_codegen_rncore libreact_debug libreact_nativemodule_core libreact_render_core libreact_render_debug libreact_render_graphics librrc_view libturbomodulejsijni libyoga +LOCAL_SHARED_LIBRARIES := libfbjni libfolly_runtime libglog libjsi libreact_codegen_rncore libreact_debug libreact_nativemodule_core libreact_render_core libreact_render_debug libreact_render_graphics librrc_view libturbomodulejsijni libyoga LOCAL_CFLAGS := \\\\ -DLOG_TAG=\\\\\\"ReactNative\\\\\\" diff --git a/packages/rn-tester/android/app/src/main/jni/Android.mk b/packages/rn-tester/android/app/src/main/jni/Android.mk index 6cfdfccd460877..a02ac90bccb498 100644 --- a/packages/rn-tester/android/app/src/main/jni/Android.mk +++ b/packages/rn-tester/android/app/src/main/jni/Android.mk @@ -22,8 +22,7 @@ LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) $(GENERATED_SRC_DIR)/codegen/jni LOCAL_SHARED_LIBRARIES := \ libfabricjni \ libfbjni \ - libfolly_futures \ - libfolly_json \ + libfolly_runtime \ libglog \ libreact_codegen_rncore \ libreact_codegen_rntester \ diff --git a/template/android/app/src/main/jni/Android.mk b/template/android/app/src/main/jni/Android.mk index 0ae63667564998..cda139122533c1 100644 --- a/template/android/app/src/main/jni/Android.mk +++ b/template/android/app/src/main/jni/Android.mk @@ -17,7 +17,7 @@ LOCAL_SRC_FILES := $(wildcard $(LOCAL_PATH)/*.cpp) LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) # If you wish to add a custom TurboModule or Fabric component in your app you -# will have to uncomment those lines to include the generated source +# will have to uncomment those lines to include the generated source # files from the codegen (placed in $(GENERATED_SRC_DIR)/codegen/jni) # # LOCAL_C_INCLUDES += $(GENERATED_SRC_DIR)/codegen/jni @@ -28,8 +28,7 @@ LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) LOCAL_SHARED_LIBRARIES := \ libfabricjni \ libfbjni \ - libfolly_futures \ - libfolly_json \ + libfolly_runtime \ libglog \ libjsi \ libreact_codegen_rncore \ From b633cc130533f0731b2577123282c4530e4f0abe Mon Sep 17 00:00:00 2001 From: Gijs Weterings Date: Mon, 14 Mar 2022 05:33:40 -0700 Subject: [PATCH 08/48] Remove console.disableYellowBox support Summary: We're replacing console.disableYellowBox (untyped, global hack, only warnings) with LogBox.ignoreAllLogs() (typed, local method, handles errors and warnings). rickhanlonii made the initial deprecation of this >2 years ago in https://github.com/facebook/react-native/commit/87f1e22434210ad22f526422bbda0413f59786ce . This diff finally removes the support of `console.disableYellowBox`. Users of LogBox should be using `LogBox.ignoreAllLogs`. This removal also allows us to move LogBox to strict mode flow. Changelog: [BREAKING] [Removed] Removed console.disableYellowBox in favor of LogBox.ignoreAllLogs. Reviewed By: rickhanlonii, yungsters Differential Revision: D34689343 fbshipit-source-id: 3b2865a4918de703e47cd722e3f396475254c65a --- Libraries/Core/ExceptionsManager.js | 2 +- Libraries/LogBox/Data/LogBoxData.js | 2 +- Libraries/LogBox/Data/LogBoxLog.js | 2 +- Libraries/LogBox/Data/LogBoxSymbolication.js | 2 +- Libraries/LogBox/Data/parseLogBoxLog.js | 2 +- Libraries/LogBox/LogBox.js | 23 ++------------------ Libraries/LogBox/__tests__/LogBox-test.js | 1 - 7 files changed, 7 insertions(+), 27 deletions(-) diff --git a/Libraries/Core/ExceptionsManager.js b/Libraries/Core/ExceptionsManager.js index 7a63a31196aa23..55c2e4cd12bdce 100644 --- a/Libraries/Core/ExceptionsManager.js +++ b/Libraries/Core/ExceptionsManager.js @@ -5,7 +5,7 @@ * LICENSE file in the root directory of this source tree. * * @format - * @flow strict-local + * @flow strict */ 'use strict'; diff --git a/Libraries/LogBox/Data/LogBoxData.js b/Libraries/LogBox/Data/LogBoxData.js index 9ba8e6f098e00b..aaf670572428e7 100644 --- a/Libraries/LogBox/Data/LogBoxData.js +++ b/Libraries/LogBox/Data/LogBoxData.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @flow strict-local + * @flow strict * @format */ diff --git a/Libraries/LogBox/Data/LogBoxLog.js b/Libraries/LogBox/Data/LogBoxLog.js index 1f0ef0d6e483bd..ab93448201c979 100644 --- a/Libraries/LogBox/Data/LogBoxLog.js +++ b/Libraries/LogBox/Data/LogBoxLog.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @flow strict-local + * @flow strict * @format */ diff --git a/Libraries/LogBox/Data/LogBoxSymbolication.js b/Libraries/LogBox/Data/LogBoxSymbolication.js index 0bbfeecf862d0b..bd235dd34f24c7 100644 --- a/Libraries/LogBox/Data/LogBoxSymbolication.js +++ b/Libraries/LogBox/Data/LogBoxSymbolication.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @flow strict-local + * @flow strict * @format */ diff --git a/Libraries/LogBox/Data/parseLogBoxLog.js b/Libraries/LogBox/Data/parseLogBoxLog.js index def38e41c0e205..bf7ea56aa8197b 100644 --- a/Libraries/LogBox/Data/parseLogBoxLog.js +++ b/Libraries/LogBox/Data/parseLogBoxLog.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @flow strict-local + * @flow strict * @format */ diff --git a/Libraries/LogBox/LogBox.js b/Libraries/LogBox/LogBox.js index c18fe698289807..8a10f810694c1a 100644 --- a/Libraries/LogBox/LogBox.js +++ b/Libraries/LogBox/LogBox.js @@ -4,7 +4,7 @@ * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * - * @flow + * @flow strict * @format */ @@ -75,24 +75,6 @@ if (__DEV__) { consoleErrorImpl = registerError; consoleWarnImpl = registerWarning; - if ((console: any).disableYellowBox === true) { - LogBoxData.setDisabled(true); - console.warn( - 'console.disableYellowBox has been deprecated and will be removed in a future release. Please use LogBox.ignoreAllLogs(value) instead.', - ); - } - - (Object.defineProperty: any)(console, 'disableYellowBox', { - configurable: true, - get: () => LogBoxData.isDisabled(), - set: value => { - LogBoxData.setDisabled(value); - console.warn( - 'console.disableYellowBox has been deprecated and will be removed in a future release. Please use LogBox.ignoreAllLogs(value) instead.', - ); - }, - }); - if (Platform.isTesting) { LogBoxData.setDisabled(true); } @@ -115,7 +97,6 @@ if (__DEV__) { // After uninstalling: original > LogBox (noop) > OtherErrorHandler consoleErrorImpl = originalConsoleError; consoleWarnImpl = originalConsoleWarn; - delete (console: any).disableLogBox; }, isInstalled(): boolean { @@ -153,7 +134,7 @@ if (__DEV__) { return typeof args[0] === 'string' && args[0].startsWith('(ADVICE)'); }; - const isWarningModuleWarning = (...args: any) => { + const isWarningModuleWarning = (...args: Array) => { return typeof args[0] === 'string' && args[0].startsWith('Warning: '); }; diff --git a/Libraries/LogBox/__tests__/LogBox-test.js b/Libraries/LogBox/__tests__/LogBox-test.js index 6a41702ff1f839..bc793a56b2a164 100644 --- a/Libraries/LogBox/__tests__/LogBox-test.js +++ b/Libraries/LogBox/__tests__/LogBox-test.js @@ -37,7 +37,6 @@ describe('LogBox', () => { console.error = jest.fn(); console.log = jest.fn(); console.warn = jest.fn(); - console.disableYellowBox = false; }); afterEach(() => { From 5ea50fd5499af6c5c1927d2346d8078672e2f9ad Mon Sep 17 00:00:00 2001 From: Andrei Shikov Date: Mon, 14 Mar 2022 07:00:07 -0700 Subject: [PATCH 09/48] Fix Hermes Android release build (#33420) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/33420 Hermes executor release dependency was incorrectly merged. Changelog: [Internal] Reviewed By: cortinico Differential Revision: D34853948 fbshipit-source-id: b4d41d2a9ad850c042049b6d945ee1d2bb32ebd7 --- .../src/main/java/com/facebook/hermes/reactexecutor/Android.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReactAndroid/src/main/java/com/facebook/hermes/reactexecutor/Android.mk b/ReactAndroid/src/main/java/com/facebook/hermes/reactexecutor/Android.mk index 66b791f766d238..be0d150037e2fc 100644 --- a/ReactAndroid/src/main/java/com/facebook/hermes/reactexecutor/Android.mk +++ b/ReactAndroid/src/main/java/com/facebook/hermes/reactexecutor/Android.mk @@ -43,7 +43,7 @@ else LOCAL_SHARED_LIBRARIES := \ libfb \ libfbjni \ - libfolly_json \ + libfolly_runtime \ libhermes \ libjsi \ libreactnativejni From c1e9aa9a272aed3cba60c4aeff783eeb8bffce68 Mon Sep 17 00:00:00 2001 From: Moti Zilberman Date: Mon, 14 Mar 2022 07:40:05 -0700 Subject: [PATCH 10/48] Deprecate jest/preprocessor.js Summary: Changelog: [General][Deprecated] Deprecate the use of `react-native/jest/preprocessor.js` by external projects The supported method of using Jest in React Native projects is using the [Jest preset](https://jestjs.io/docs/tutorial-react-native) shipped as part of the `react-native` package. Some projects are directly using `preprocessor.js` which is part of the testing setup for the React Native repo itself. In a future release of React Native, we will stop publishing this file to npm and require projects to switch to the supported preset (or a custom Jest config if necessary). Reviewed By: GijsWeterings Differential Revision: D34820086 fbshipit-source-id: 197c33726639e66c6916a244117252e6af11f2f6 --- jest.config.js | 2 +- jest/preprocessor.js | 130 ++++++-------------------------- jest/preprocessor_DO_NOT_USE.js | 122 ++++++++++++++++++++++++++++++ 3 files changed, 147 insertions(+), 107 deletions(-) create mode 100644 jest/preprocessor_DO_NOT_USE.js diff --git a/jest.config.js b/jest.config.js index f16bd6be0ec817..2561d8e2571f86 100644 --- a/jest.config.js +++ b/jest.config.js @@ -13,7 +13,7 @@ module.exports = { transform: { '^.+\\.(bmp|gif|jpg|jpeg|mp4|png|psd|svg|webp)$': '/jest/assetFileTransformer.js', - '.*': './jest/preprocessor.js', + '.*': './jest/preprocessor_DO_NOT_USE.js', }, setupFiles: ['./jest/setup.js'], timers: 'fake', diff --git a/jest/preprocessor.js b/jest/preprocessor.js index b4fae006b41fd5..b63c603a940df9 100644 --- a/jest/preprocessor.js +++ b/jest/preprocessor.js @@ -12,111 +12,29 @@ 'use strict'; -const babelRegisterOnly = require('metro-babel-register'); -const createCacheKeyFunction = - require('@jest/create-cache-key-function').default; - -const {transformSync: babelTransformSync} = require('@babel/core'); -const generate = require('@babel/generator').default; - -const nodeFiles = new RegExp( - [ - '/metro(?:-[^/]*)?/', // metro, metro-core, metro-source-map, metro-etc. - ].join('|'), +// NOTE: Avoiding using a package like 'chalk' here, for simplicity +const YELLOW = process.stderr.isTTY ? '\u001b[33m' : ''; +const BOLD = process.stderr.isTTY ? '\u001b[1m' : ''; +const RESET = process.stderr.isTTY ? '\u001b[0m' : ''; +const UNDERLINE = process.stderr.isTTY ? '\u001b[4m' : ''; + +console.warn( + '\n' + + YELLOW + + BOLD + + 'react-native/jest/preprocessor.js' + + RESET + + YELLOW + + ' is deprecated and will be removed.\n' + + 'Use "preset": "react-native" in your Jest config instead.\n' + + 'See ' + + UNDERLINE + + 'https://jestjs.io/docs/tutorial-react-native' + + RESET + + YELLOW + + ' for more setup instructions.' + + RESET + + '\n', ); -const nodeOptions = babelRegisterOnly.config([nodeFiles]); - -babelRegisterOnly([]); - -const transformer = require('metro-react-native-babel-transformer'); -module.exports = { - process(src /*: string */, file /*: string */) /*: string */ { - if (nodeFiles.test(file)) { - // node specific transforms only - return babelTransformSync(src, { - filename: file, - sourceType: 'script', - ...nodeOptions, - ast: false, - }).code; - } - - const {ast} = transformer.transform({ - filename: file, - options: { - ast: true, // needed for open source (?) https://github.com/facebook/react-native/commit/f8d6b97140cffe8d18b2558f94570c8d1b410d5c#r28647044 - dev: true, - enableBabelRuntime: false, - experimentalImportSupport: false, - globalPrefix: '', - hot: false, - inlineRequires: true, - minify: false, - platform: '', - projectRoot: '', - publicPath: '/assets', - retainLines: true, - sourceType: 'unambiguous', // b7 required. detects module vs script mode - }, - src, - plugins: [ - [require('@babel/plugin-transform-block-scoping')], - // the flow strip types plugin must go BEFORE class properties! - // there'll be a test case that fails if you don't. - [require('@babel/plugin-transform-flow-strip-types')], - [ - require('@babel/plugin-proposal-class-properties'), - // use `this.foo = bar` instead of `this.defineProperty('foo', ...)` - {loose: true}, - ], - [require('@babel/plugin-transform-computed-properties')], - [require('@babel/plugin-transform-destructuring')], - [require('@babel/plugin-transform-function-name')], - [require('@babel/plugin-transform-literals')], - [require('@babel/plugin-transform-parameters')], - [require('@babel/plugin-transform-shorthand-properties')], - [require('@babel/plugin-transform-react-jsx')], - [require('@babel/plugin-transform-regenerator')], - [require('@babel/plugin-transform-sticky-regex')], - [require('@babel/plugin-transform-unicode-regex')], - [ - require('@babel/plugin-transform-modules-commonjs'), - {strict: false, allowTopLevelThis: true}, - ], - [require('@babel/plugin-transform-classes')], - [require('@babel/plugin-transform-arrow-functions')], - [require('@babel/plugin-transform-spread')], - [require('@babel/plugin-proposal-object-rest-spread')], - [ - require('@babel/plugin-transform-template-literals'), - {loose: true}, // dont 'a'.concat('b'), just use 'a'+'b' - ], - [require('@babel/plugin-transform-exponentiation-operator')], - [require('@babel/plugin-transform-for-of'), {loose: true}], - [require('@babel/plugin-transform-react-display-name')], - [require('@babel/plugin-transform-react-jsx-source')], - ], - }); - - return generate( - ast, - // $FlowFixMe[prop-missing] Error found when improving flow typing for libs - { - code: true, - comments: false, - compact: false, - filename: file, - retainLines: true, - sourceFileName: file, - sourceMaps: true, - }, - src, - ).code; - }, - getCacheKey: (createCacheKeyFunction([ - __filename, - require.resolve('metro-react-native-babel-transformer'), - require.resolve('@babel/core/package.json'), - ]) /*: any */), -}; +module.exports = require('./preprocessor_DO_NOT_USE'); diff --git a/jest/preprocessor_DO_NOT_USE.js b/jest/preprocessor_DO_NOT_USE.js new file mode 100644 index 00000000000000..b4fae006b41fd5 --- /dev/null +++ b/jest/preprocessor_DO_NOT_USE.js @@ -0,0 +1,122 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * @flow + */ + +/* eslint-env node */ + +'use strict'; + +const babelRegisterOnly = require('metro-babel-register'); +const createCacheKeyFunction = + require('@jest/create-cache-key-function').default; + +const {transformSync: babelTransformSync} = require('@babel/core'); +const generate = require('@babel/generator').default; + +const nodeFiles = new RegExp( + [ + '/metro(?:-[^/]*)?/', // metro, metro-core, metro-source-map, metro-etc. + ].join('|'), +); +const nodeOptions = babelRegisterOnly.config([nodeFiles]); + +babelRegisterOnly([]); + +const transformer = require('metro-react-native-babel-transformer'); +module.exports = { + process(src /*: string */, file /*: string */) /*: string */ { + if (nodeFiles.test(file)) { + // node specific transforms only + return babelTransformSync(src, { + filename: file, + sourceType: 'script', + ...nodeOptions, + ast: false, + }).code; + } + + const {ast} = transformer.transform({ + filename: file, + options: { + ast: true, // needed for open source (?) https://github.com/facebook/react-native/commit/f8d6b97140cffe8d18b2558f94570c8d1b410d5c#r28647044 + dev: true, + enableBabelRuntime: false, + experimentalImportSupport: false, + globalPrefix: '', + hot: false, + inlineRequires: true, + minify: false, + platform: '', + projectRoot: '', + publicPath: '/assets', + retainLines: true, + sourceType: 'unambiguous', // b7 required. detects module vs script mode + }, + src, + plugins: [ + [require('@babel/plugin-transform-block-scoping')], + // the flow strip types plugin must go BEFORE class properties! + // there'll be a test case that fails if you don't. + [require('@babel/plugin-transform-flow-strip-types')], + [ + require('@babel/plugin-proposal-class-properties'), + // use `this.foo = bar` instead of `this.defineProperty('foo', ...)` + {loose: true}, + ], + [require('@babel/plugin-transform-computed-properties')], + [require('@babel/plugin-transform-destructuring')], + [require('@babel/plugin-transform-function-name')], + [require('@babel/plugin-transform-literals')], + [require('@babel/plugin-transform-parameters')], + [require('@babel/plugin-transform-shorthand-properties')], + [require('@babel/plugin-transform-react-jsx')], + [require('@babel/plugin-transform-regenerator')], + [require('@babel/plugin-transform-sticky-regex')], + [require('@babel/plugin-transform-unicode-regex')], + [ + require('@babel/plugin-transform-modules-commonjs'), + {strict: false, allowTopLevelThis: true}, + ], + [require('@babel/plugin-transform-classes')], + [require('@babel/plugin-transform-arrow-functions')], + [require('@babel/plugin-transform-spread')], + [require('@babel/plugin-proposal-object-rest-spread')], + [ + require('@babel/plugin-transform-template-literals'), + {loose: true}, // dont 'a'.concat('b'), just use 'a'+'b' + ], + [require('@babel/plugin-transform-exponentiation-operator')], + [require('@babel/plugin-transform-for-of'), {loose: true}], + [require('@babel/plugin-transform-react-display-name')], + [require('@babel/plugin-transform-react-jsx-source')], + ], + }); + + return generate( + ast, + // $FlowFixMe[prop-missing] Error found when improving flow typing for libs + { + code: true, + comments: false, + compact: false, + filename: file, + retainLines: true, + sourceFileName: file, + sourceMaps: true, + }, + src, + ).code; + }, + + getCacheKey: (createCacheKeyFunction([ + __filename, + require.resolve('metro-react-native-babel-transformer'), + require.resolve('@babel/core/package.json'), + ]) /*: any */), +}; From 2f813f873a1692044ea3461e59ca732a4d952300 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danilo=20B=C3=BCrger?= Date: Mon, 14 Mar 2022 09:00:37 -0700 Subject: [PATCH 11/48] Consider relative to pwd installation root when looking for files in rn module via cocoapods (#33399) Summary: The `:reactNativePath` provided by `use_native_modules!` is the rn module path relative to the installation root (usually `./ios`). However, when executing cocoapods from a dir thats not the installation root, packages that use the relative `:reactNativePath` variable in their path must also consider the relative to pwd installation root. This fixes usage of cocoapods with the `--project-directory` flag like ```bash bundle exec pod install --project-directory=ios ``` ## Changelog [iOS] [Fixed] - Fix usage of cocoapods with --project-directory flag and new arch Pull Request resolved: https://github.com/facebook/react-native/pull/33399 Test Plan: 1) Enable the new arch 2) Execute from the projects root dir ```bash bundle exec pod install --project-directory=ios ``` 3) It will fail with ``` [!] Invalid `Podfile` file: [codegen] Couldn't not find react-native-codegen.. ``` 4) Apply the patch 5) Execute from the projects root dir ```bash bundle exec pod install --project-directory=ios ``` 6) It will succeed Reviewed By: ShikaSD Differential Revision: D34784966 Pulled By: dmitryrykun fbshipit-source-id: d6d5e71bc2fcd32f2cd60a498f39e6f772fc9005 --- scripts/react_native_pods.rb | 10 ++++++---- template/ios/Podfile | 4 ++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/scripts/react_native_pods.rb b/scripts/react_native_pods.rb index 97beacb7308dfe..5170c01f1234d9 100644 --- a/scripts/react_native_pods.rb +++ b/scripts/react_native_pods.rb @@ -278,8 +278,9 @@ def modify_flags_for_new_architecture(installer, cpp_flags) end def build_codegen!(react_native_path) - codegen_repo_path = "#{react_native_path}/packages/react-native-codegen"; - codegen_npm_path = "#{react_native_path}/../react-native-codegen"; + relative_installation_root = Pod::Config.instance.installation_root.relative_path_from(Pathname.pwd) + codegen_repo_path = "#{relative_installation_root}/#{react_native_path}/packages/react-native-codegen"; + codegen_npm_path = "#{relative_installation_root}/#{react_native_path}/../react-native-codegen"; codegen_cli_path = "" if Dir.exist?(codegen_repo_path) codegen_cli_path = codegen_repo_path @@ -320,7 +321,7 @@ def checkAndGenerateEmptyThirdPartyProvider!(react_native_path) Pod::Executable.execute_command( 'node', [ - "#{react_native_path}/scripts/generate-provider-cli.js", + "#{relative_installation_root}/#{react_native_path}/scripts/generate-provider-cli.js", "--platform", 'ios', "--schemaListPath", temp_schema_list_path, "--outputDir", "#{output_dir}" @@ -510,6 +511,7 @@ def use_react_native_codegen_discovery!(options={}) app_path = options[:app_path] fabric_enabled = options[:fabric_enabled] ||= false config_file_dir = options[:config_file_dir] ||= '' + relative_installation_root = Pod::Config.instance.installation_root.relative_path_from(Pathname.pwd) if !app_path Pod::UI.warn '[Codegen] Error: app_path is required for use_react_native_codegen_discovery.' @@ -525,7 +527,7 @@ def use_react_native_codegen_discovery!(options={}) out = Pod::Executable.execute_command( 'node', [ - "#{react_native_path}/scripts/generate-artifacts.js", + "#{relative_installation_root}/#{react_native_path}/scripts/generate-artifacts.js", "-p", "#{app_path}", "-o", Pod::Config.instance.installation_root, "-e", "#{fabric_enabled}", diff --git a/template/ios/Podfile b/template/ios/Podfile index 54920362cc31f1..01506faf7913c7 100644 --- a/template/ios/Podfile +++ b/template/ios/Podfile @@ -15,8 +15,8 @@ target 'HelloWorld' do # to enable hermes on iOS, change `false` to `true` and then install pods :hermes_enabled => flags[:hermes_enabled], :fabric_enabled => flags[:fabric_enabled], - # An abosolute path to your application root. - :app_path => "#{Dir.pwd}/.." + # An absolute path to your application root. + :app_path => "#{Pod::Config.instance.installation_root}/.." ) target 'HelloWorldTests' do From 145fd041c7afe9a18f08f461487bb515ab2f516a Mon Sep 17 00:00:00 2001 From: Xin Chen Date: Mon, 14 Mar 2022 10:25:00 -0700 Subject: [PATCH 12/48] Fix crash on empty snapToOffsets prop to ScrollView Summary: When the `snapToOffsets` prop is empty array, the scroll view would crash unexpectly. This diff fixed that by treating empty array prop as null value for `snapToOffsets`. Changelog: [Android][Fixed] - Fix crash on empty snapToOffsets array Reviewed By: makovkastar Differential Revision: D34802022 fbshipit-source-id: af330512e444081b0cb02b65288ec5cd2bd14205 --- .../react/views/scroll/ReactHorizontalScrollViewManager.java | 2 +- .../com/facebook/react/views/scroll/ReactScrollViewManager.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollViewManager.java b/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollViewManager.java index 6d4bd242dd2609..2cdfec69aa1ee8 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollViewManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollViewManager.java @@ -109,7 +109,7 @@ public void setSnapToAlignment(ReactHorizontalScrollView view, String alignment) @ReactProp(name = "snapToOffsets") public void setSnapToOffsets( ReactHorizontalScrollView view, @Nullable ReadableArray snapToOffsets) { - if (snapToOffsets == null) { + if (snapToOffsets == null || snapToOffsets.size() == 0) { view.setSnapOffsets(null); return; } diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollViewManager.java b/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollViewManager.java index 8a3623444be309..d1b32c61d3c96c 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollViewManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollViewManager.java @@ -102,7 +102,7 @@ public void setSnapToInterval(ReactScrollView view, float snapToInterval) { @ReactProp(name = "snapToOffsets") public void setSnapToOffsets(ReactScrollView view, @Nullable ReadableArray snapToOffsets) { - if (snapToOffsets == null) { + if (snapToOffsets == null || snapToOffsets.size() == 0) { view.setSnapOffsets(null); return; } From 06f504b8b28a1d80a64e76e8b40f1a96e29c939c Mon Sep 17 00:00:00 2001 From: Oleg Kot Date: Mon, 14 Mar 2022 10:31:18 -0700 Subject: [PATCH 13/48] Revert D34784966: Consider relative to pwd installation root when looking for files in rn module via cocoapods Differential Revision: D34784966 (https://github.com/facebook/react-native/commit/2f813f873a1692044ea3461e59ca732a4d952300) Original commit changeset: d6d5e71bc2fc Original Phabricator Diff: D34784966 (https://github.com/facebook/react-native/commit/2f813f873a1692044ea3461e59ca732a4d952300) fbshipit-source-id: edaf38cb26187f0bd08e1efb7fc086233cf094c8 --- scripts/react_native_pods.rb | 10 ++++------ template/ios/Podfile | 4 ++-- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/scripts/react_native_pods.rb b/scripts/react_native_pods.rb index 5170c01f1234d9..97beacb7308dfe 100644 --- a/scripts/react_native_pods.rb +++ b/scripts/react_native_pods.rb @@ -278,9 +278,8 @@ def modify_flags_for_new_architecture(installer, cpp_flags) end def build_codegen!(react_native_path) - relative_installation_root = Pod::Config.instance.installation_root.relative_path_from(Pathname.pwd) - codegen_repo_path = "#{relative_installation_root}/#{react_native_path}/packages/react-native-codegen"; - codegen_npm_path = "#{relative_installation_root}/#{react_native_path}/../react-native-codegen"; + codegen_repo_path = "#{react_native_path}/packages/react-native-codegen"; + codegen_npm_path = "#{react_native_path}/../react-native-codegen"; codegen_cli_path = "" if Dir.exist?(codegen_repo_path) codegen_cli_path = codegen_repo_path @@ -321,7 +320,7 @@ def checkAndGenerateEmptyThirdPartyProvider!(react_native_path) Pod::Executable.execute_command( 'node', [ - "#{relative_installation_root}/#{react_native_path}/scripts/generate-provider-cli.js", + "#{react_native_path}/scripts/generate-provider-cli.js", "--platform", 'ios', "--schemaListPath", temp_schema_list_path, "--outputDir", "#{output_dir}" @@ -511,7 +510,6 @@ def use_react_native_codegen_discovery!(options={}) app_path = options[:app_path] fabric_enabled = options[:fabric_enabled] ||= false config_file_dir = options[:config_file_dir] ||= '' - relative_installation_root = Pod::Config.instance.installation_root.relative_path_from(Pathname.pwd) if !app_path Pod::UI.warn '[Codegen] Error: app_path is required for use_react_native_codegen_discovery.' @@ -527,7 +525,7 @@ def use_react_native_codegen_discovery!(options={}) out = Pod::Executable.execute_command( 'node', [ - "#{relative_installation_root}/#{react_native_path}/scripts/generate-artifacts.js", + "#{react_native_path}/scripts/generate-artifacts.js", "-p", "#{app_path}", "-o", Pod::Config.instance.installation_root, "-e", "#{fabric_enabled}", diff --git a/template/ios/Podfile b/template/ios/Podfile index 01506faf7913c7..54920362cc31f1 100644 --- a/template/ios/Podfile +++ b/template/ios/Podfile @@ -15,8 +15,8 @@ target 'HelloWorld' do # to enable hermes on iOS, change `false` to `true` and then install pods :hermes_enabled => flags[:hermes_enabled], :fabric_enabled => flags[:fabric_enabled], - # An absolute path to your application root. - :app_path => "#{Pod::Config.instance.installation_root}/.." + # An abosolute path to your application root. + :app_path => "#{Dir.pwd}/.." ) target 'HelloWorldTests' do From 75de6d46e3833bac02ef7443d1ce2382c13c90b6 Mon Sep 17 00:00:00 2001 From: Evan Yeung Date: Mon, 14 Mar 2022 13:15:22 -0700 Subject: [PATCH 14/48] Deploy 0.173.0 to xplat Summary: Changelog: [Internal] Reviewed By: bradzacher Differential Revision: D34691988 fbshipit-source-id: f9c73d99d09440718cc05318ea415492652ff818 --- .flowconfig | 2 +- .flowconfig.android | 2 +- package.json | 2 +- repo-config/package.json | 2 +- template/_flowconfig | 2 +- yarn.lock | 8 ++++---- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.flowconfig b/.flowconfig index 86a412bb85a5d1..f5367aace01f6f 100644 --- a/.flowconfig +++ b/.flowconfig @@ -71,4 +71,4 @@ untyped-import untyped-type-import [version] -^0.172.0 +^0.173.0 diff --git a/.flowconfig.android b/.flowconfig.android index 738919d7d548fb..7a214dac224578 100644 --- a/.flowconfig.android +++ b/.flowconfig.android @@ -71,4 +71,4 @@ untyped-import untyped-type-import [version] -^0.172.0 +^0.173.0 diff --git a/package.json b/package.json index 2f1860c4b51bb1..2a399847069b15 100644 --- a/package.json +++ b/package.json @@ -123,7 +123,7 @@ "ws": "^6.1.4" }, "devDependencies": { - "flow-bin": "^0.172.0", + "flow-bin": "^0.173.0", "react": "17.0.2" }, "codegenConfig": { diff --git a/repo-config/package.json b/repo-config/package.json index c95a0b5460f442..d2cc56cc93f612 100644 --- a/repo-config/package.json +++ b/repo-config/package.json @@ -33,7 +33,7 @@ "eslint-plugin-react-hooks": "^4.2.0", "eslint-plugin-react-native": "^3.11.0", "eslint-plugin-relay": "^1.8.2", - "flow-bin": "^0.172.0", + "flow-bin": "^0.173.0", "inquirer": "^7.1.0", "jest": "^26.6.3", "jest-junit": "^10.0.0", diff --git a/template/_flowconfig b/template/_flowconfig index 4f345f30fdacce..0ace9d2f23dfcd 100644 --- a/template/_flowconfig +++ b/template/_flowconfig @@ -63,4 +63,4 @@ untyped-import untyped-type-import [version] -^0.172.0 +^0.173.0 diff --git a/yarn.lock b/yarn.lock index 02a900c4f64d17..1833b6694536b1 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3254,10 +3254,10 @@ flatted@^3.1.0: resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.2.tgz#64bfed5cb68fe3ca78b3eb214ad97b63bedce561" integrity sha512-JaTY/wtrcSyvXJl4IMFHPKyFur1sE9AUqc0QnhOaJ0CxHtAoIV8pYDzeEfAaNEtGkOfq4gr3LBFmdXW5mOQFnA== -flow-bin@^0.172.0: - version "0.172.0" - resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.172.0.tgz#b399d108c5a9f0272a8137fcc884dc7284b7c175" - integrity sha512-v9KolEk3qd+wFc2ABPaSr5/7VWbHOjdAzRaWwynEtaeMcKN0awlx0Q7b71g/XgVf/fWMR+K8q+3s/TCH+Gky/Q== +flow-bin@^0.173.0: + version "0.173.0" + resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.173.0.tgz#4eb4b0143ffcef3ef3ee64638554a8dff6b89735" + integrity sha512-CIvShSnB4I7SsfkE9S7ECpUCkBNqDQGDWr+0uzulKGYEBnCYwFzITE1T84weLmINQwO1dR6ntsH0LlWLoGCquQ== flow-parser@0.*: version "0.163.0" From e12bc9cf626aa54db1d878114b87097b29afc08a Mon Sep 17 00:00:00 2001 From: Nicola Corti Date: Tue, 15 Mar 2022 01:55:27 -0700 Subject: [PATCH 15/48] Setup Globbing with CONFIGURE_DEPENDS inside CMake files. Summary: This Diff moves from specifying a list of files to use file(GLOB) with CONFIGURE_DEPENDS on several CMakefiles. I've updates those where we use globbing also inside buck. Changelog: [Internal] [Changed] - Setup Globbing with CONFIGURE_DEPENDS inside CMake files Reviewed By: ShikaSD Differential Revision: D34826311 fbshipit-source-id: 8fc654626c897cdc4cdd79c699ce19f1e5e1212f --- .../react/common/mapbuffer/jni/CMakeLists.txt | 12 +++++------- .../facebook/react/jscexecutor/CMakeLists.txt | 5 +++-- .../react/modules/blob/jni/CMakeLists.txt | 7 +++---- .../react/reactperflogger/jni/CMakeLists.txt | 2 +- .../react/turbomodule/core/jni/CMakeLists.txt | 2 +- .../react/uimanager/jni/CMakeLists.txt | 7 +++---- .../src/main/jni/first-party/fb/CMakeLists.txt | 2 +- .../jni/first-party/fbgloginit/CMakeLists.txt | 2 +- .../main/jni/first-party/fbjni/CMakeLists.txt | 2 +- .../main/jni/first-party/hermes/CMakeLists.txt | 2 +- .../jni/first-party/yogajni/CMakeLists.txt | 4 ++-- .../src/main/jni/react/jni/CMakeLists.txt | 4 ++-- .../main/jni/third-party/boost/CMakeLists.txt | 3 ++- .../double-conversion/CMakeLists.txt | 2 +- .../main/jni/third-party/fmt/CMakeLists.txt | 2 +- .../main/jni/third-party/folly/CMakeLists.txt | 2 +- .../main/jni/third-party/glog/CMakeLists.txt | 2 +- .../main/jni/third-party/jsc/CMakeLists.txt | 2 +- .../jni/third-party/libevent/CMakeLists.txt | 2 +- ReactCommon/butter/CMakeLists.txt | 17 ++++------------- ReactCommon/callinvoker/CMakeLists.txt | 2 +- ReactCommon/cxxreact/CMakeLists.txt | 4 ++-- ReactCommon/jsi/CMakeLists.txt | 4 ++-- ReactCommon/jsiexecutor/CMakeLists.txt | 2 +- ReactCommon/jsinspector/CMakeLists.txt | 7 +++---- ReactCommon/logger/CMakeLists.txt | 7 +++---- ReactCommon/react/config/CMakeLists.txt | 7 +++---- ReactCommon/react/debug/CMakeLists.txt | 9 +++++---- .../react/nativemodule/core/CMakeLists.txt | 14 ++++++-------- .../react/renderer/animations/CMakeLists.txt | 11 +++-------- .../renderer/attributedstring/CMakeLists.txt | 12 +++--------- .../renderer/componentregistry/CMakeLists.txt | 11 +++-------- .../componentregistry/native/CMakeLists.txt | 9 +++------ .../renderer/components/image/CMakeLists.txt | 12 +++--------- .../renderer/components/root/CMakeLists.txt | 7 +++---- .../components/scrollview/CMakeLists.txt | 12 +++--------- .../renderer/components/text/CMakeLists.txt | 18 +++--------------- .../components/textinput/CMakeLists.txt | 11 +++-------- .../unimplementedview/CMakeLists.txt | 11 +++-------- .../renderer/components/view/CMakeLists.txt | 5 ++--- ReactCommon/react/renderer/core/CMakeLists.txt | 5 ++--- .../react/renderer/debug/CMakeLists.txt | 8 +++----- .../react/renderer/graphics/CMakeLists.txt | 10 ++++++---- .../react/renderer/imagemanager/CMakeLists.txt | 12 ++++++------ .../react/renderer/leakchecker/CMakeLists.txt | 8 +++----- .../react/renderer/mapbuffer/CMakeLists.txt | 8 +++----- .../react/renderer/mounting/CMakeLists.txt | 5 ++--- .../renderer/runtimescheduler/CMakeLists.txt | 11 +++-------- .../react/renderer/scheduler/CMakeLists.txt | 14 +++----------- .../react/renderer/telemetry/CMakeLists.txt | 8 +++----- .../renderer/templateprocessor/CMakeLists.txt | 7 +++---- .../renderer/textlayoutmanager/CMakeLists.txt | 10 ++++++---- .../react/renderer/uimanager/CMakeLists.txt | 10 +++------- ReactCommon/react/utils/CMakeLists.txt | 8 +++----- ReactCommon/reactperflogger/CMakeLists.txt | 7 +++---- ReactCommon/runtimeexecutor/CMakeLists.txt | 2 +- ReactCommon/yoga/CMakeLists.txt | 4 ++-- 57 files changed, 149 insertions(+), 246 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/common/mapbuffer/jni/CMakeLists.txt b/ReactAndroid/src/main/java/com/facebook/react/common/mapbuffer/jni/CMakeLists.txt index 3f520baf756b9d..680ab4bd274697 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/common/mapbuffer/jni/CMakeLists.txt +++ b/ReactAndroid/src/main/java/com/facebook/react/common/mapbuffer/jni/CMakeLists.txt @@ -3,17 +3,15 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -cmake_minimum_required(VERSION 3.4.1) +cmake_minimum_required(VERSION 3.13) set(CMAKE_VERBOSE_MAKEFILE on) add_compile_options(-fexceptions -frtti -std=c++17 -Wall -DLOG_TAG=\"Fabric\") -add_library( - mapbufferjni - SHARED - react/common/mapbuffer/OnLoad.cpp - react/common/mapbuffer/ReadableMapBuffer.cpp -) +file(GLOB mapbuffer_SRC CONFIGURE_DEPENDS + ${CMAKE_CURRENT_SOURCE_DIR}/react/common/mapbuffer/*.cpp) + +add_library(mapbufferjni SHARED ${mapbuffer_SRC}) target_include_directories(mapbufferjni PUBLIC diff --git a/ReactAndroid/src/main/java/com/facebook/react/jscexecutor/CMakeLists.txt b/ReactAndroid/src/main/java/com/facebook/react/jscexecutor/CMakeLists.txt index 9be5cfcac90ded..193426ca041f1b 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/jscexecutor/CMakeLists.txt +++ b/ReactAndroid/src/main/java/com/facebook/react/jscexecutor/CMakeLists.txt @@ -3,12 +3,13 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -cmake_minimum_required(VERSION 3.4.1) +cmake_minimum_required(VERSION 3.13) set(CMAKE_VERBOSE_MAKEFILE on) add_compile_options(-fvisibility=hidden -fexceptions -frtti) -add_library(jscexecutor SHARED OnLoad.cpp) +file(GLOB jscexecutor_SRC CONFIGURE_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +add_library(jscexecutor SHARED ${jscexecutor_SRC}) target_include_directories(jscexecutor PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/ReactAndroid/src/main/java/com/facebook/react/modules/blob/jni/CMakeLists.txt b/ReactAndroid/src/main/java/com/facebook/react/modules/blob/jni/CMakeLists.txt index fb936befd7bfc3..023737c44ad515 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/modules/blob/jni/CMakeLists.txt +++ b/ReactAndroid/src/main/java/com/facebook/react/modules/blob/jni/CMakeLists.txt @@ -3,14 +3,13 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -cmake_minimum_required(VERSION 3.4.1) +cmake_minimum_required(VERSION 3.13) set(CMAKE_VERBOSE_MAKEFILE on) add_compile_options(-fvisibility=hidden -fexceptions -frtti) -add_library(reactnativeblob SHARED - BlobCollector.cpp - OnLoad.cpp) +file(GLOB reactnativeblob_SRC CONFIGURE_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +add_library(reactnativeblob SHARED ${reactnativeblob_SRC}) target_include_directories(reactnativeblob PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/ReactAndroid/src/main/java/com/facebook/react/reactperflogger/jni/CMakeLists.txt b/ReactAndroid/src/main/java/com/facebook/react/reactperflogger/jni/CMakeLists.txt index 77cf0453b2930f..4c10b7eaca217e 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/reactperflogger/jni/CMakeLists.txt +++ b/ReactAndroid/src/main/java/com/facebook/react/reactperflogger/jni/CMakeLists.txt @@ -3,7 +3,7 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -cmake_minimum_required(VERSION 3.4.1) +cmake_minimum_required(VERSION 3.13) set(CMAKE_VERBOSE_MAKEFILE on) add_compile_options(-fexceptions -frtti -std=c++17 -Wall) diff --git a/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/jni/CMakeLists.txt b/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/jni/CMakeLists.txt index e2658fa613f52e..02cfe42beeaea6 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/jni/CMakeLists.txt +++ b/ReactAndroid/src/main/java/com/facebook/react/turbomodule/core/jni/CMakeLists.txt @@ -3,7 +3,7 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -cmake_minimum_required(VERSION 3.4.1) +cmake_minimum_required(VERSION 3.13) set(CMAKE_VERBOSE_MAKEFILE on) add_compile_options( diff --git a/ReactAndroid/src/main/java/com/facebook/react/uimanager/jni/CMakeLists.txt b/ReactAndroid/src/main/java/com/facebook/react/uimanager/jni/CMakeLists.txt index 33572211ba2a03..411832021cb6b0 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/uimanager/jni/CMakeLists.txt +++ b/ReactAndroid/src/main/java/com/facebook/react/uimanager/jni/CMakeLists.txt @@ -3,14 +3,13 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -cmake_minimum_required(VERSION 3.4.1) +cmake_minimum_required(VERSION 3.13) set(CMAKE_VERBOSE_MAKEFILE on) add_compile_options(-fexceptions -frtti -std=c++17 -Wall -DLOG_TAG=\"ReactNative\") -add_library(uimanagerjni SHARED - OnLoad.cpp - ComponentNameResolverManager.cpp) +file(GLOB uimanagerjni_SRC CONFIGURE_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +add_library(uimanagerjni SHARED ${uimanagerjni_SRC}) target_include_directories(uimanagerjni PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/ReactAndroid/src/main/jni/first-party/fb/CMakeLists.txt b/ReactAndroid/src/main/jni/first-party/fb/CMakeLists.txt index 7536286d348f9d..7319e832fcff96 100644 --- a/ReactAndroid/src/main/jni/first-party/fb/CMakeLists.txt +++ b/ReactAndroid/src/main/jni/first-party/fb/CMakeLists.txt @@ -3,7 +3,7 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -cmake_minimum_required(VERSION 3.4.1) +cmake_minimum_required(VERSION 3.13) set(CMAKE_VERBOSE_MAKEFILE on) add_library(fb diff --git a/ReactAndroid/src/main/jni/first-party/fbgloginit/CMakeLists.txt b/ReactAndroid/src/main/jni/first-party/fbgloginit/CMakeLists.txt index 02fb3540f85134..bc23ad95063949 100644 --- a/ReactAndroid/src/main/jni/first-party/fbgloginit/CMakeLists.txt +++ b/ReactAndroid/src/main/jni/first-party/fbgloginit/CMakeLists.txt @@ -3,7 +3,7 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -cmake_minimum_required(VERSION 3.4.1) +cmake_minimum_required(VERSION 3.13) set(CMAKE_VERBOSE_MAKEFILE on) add_compile_options(-fexceptions -fno-omit-frame-pointer) diff --git a/ReactAndroid/src/main/jni/first-party/fbjni/CMakeLists.txt b/ReactAndroid/src/main/jni/first-party/fbjni/CMakeLists.txt index dd1ced88a4956a..f8fa27c5a97ad8 100644 --- a/ReactAndroid/src/main/jni/first-party/fbjni/CMakeLists.txt +++ b/ReactAndroid/src/main/jni/first-party/fbjni/CMakeLists.txt @@ -3,7 +3,7 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -cmake_minimum_required(VERSION 3.4.1) +cmake_minimum_required(VERSION 3.13) set(CMAKE_VERBOSE_MAKEFILE on) add_library(fbjni SHARED IMPORTED GLOBAL) diff --git a/ReactAndroid/src/main/jni/first-party/hermes/CMakeLists.txt b/ReactAndroid/src/main/jni/first-party/hermes/CMakeLists.txt index db6da1e5067ca9..4bfbaa1c863095 100644 --- a/ReactAndroid/src/main/jni/first-party/hermes/CMakeLists.txt +++ b/ReactAndroid/src/main/jni/first-party/hermes/CMakeLists.txt @@ -3,7 +3,7 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -cmake_minimum_required(VERSION 3.4.1) +cmake_minimum_required(VERSION 3.13) set(CMAKE_VERBOSE_MAKEFILE on) add_library(hermes SHARED IMPORTED GLOBAL) diff --git a/ReactAndroid/src/main/jni/first-party/yogajni/CMakeLists.txt b/ReactAndroid/src/main/jni/first-party/yogajni/CMakeLists.txt index 8d6dce75ce0b2e..8f08a9977a7e09 100644 --- a/ReactAndroid/src/main/jni/first-party/yogajni/CMakeLists.txt +++ b/ReactAndroid/src/main/jni/first-party/yogajni/CMakeLists.txt @@ -3,7 +3,7 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -cmake_minimum_required(VERSION 3.4.1) +cmake_minimum_required(VERSION 3.13) set(CMAKE_VERBOSE_MAKEFILE on) add_compile_options( @@ -12,7 +12,7 @@ add_compile_options( -frtti -O3) -file(GLOB_RECURSE yoga_SRC jni/*.cpp) +file(GLOB yoga_SRC CONFIGURE_DEPENDS jni/*.cpp) add_library(yoga SHARED ${yoga_SRC}) target_include_directories(yoga PUBLIC jni) diff --git a/ReactAndroid/src/main/jni/react/jni/CMakeLists.txt b/ReactAndroid/src/main/jni/react/jni/CMakeLists.txt index 4182cb4d5e0fec..bacaa743f2dc80 100644 --- a/ReactAndroid/src/main/jni/react/jni/CMakeLists.txt +++ b/ReactAndroid/src/main/jni/react/jni/CMakeLists.txt @@ -3,12 +3,12 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -cmake_minimum_required(VERSION 3.4.1) +cmake_minimum_required(VERSION 3.13) set(CMAKE_VERBOSE_MAKEFILE on) # TODO Those two libraries are building against the same sources # and should probably be merged -file(GLOB reactnativejni_SRC ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +file(GLOB reactnativejni_SRC CONFIGURE_DEPENDS *.cpp) add_compile_options( -fexceptions diff --git a/ReactAndroid/src/main/jni/third-party/boost/CMakeLists.txt b/ReactAndroid/src/main/jni/third-party/boost/CMakeLists.txt index b7c8779161c374..19f8786245355a 100644 --- a/ReactAndroid/src/main/jni/third-party/boost/CMakeLists.txt +++ b/ReactAndroid/src/main/jni/third-party/boost/CMakeLists.txt @@ -3,7 +3,7 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -cmake_minimum_required(VERSION 3.4.1) +cmake_minimum_required(VERSION 3.13) set(CMAKE_VERBOSE_MAKEFILE on) # These ASM files are picked from the boost release separately, @@ -12,6 +12,7 @@ set(CMAKE_VERBOSE_MAKEFILE on) ENABLE_LANGUAGE(ASM) file(GLOB_RECURSE boostasm_SRC + CONFIGURE_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/asm/${ANDROID_ABI}/*.S) add_library(boost STATIC ${boostasm_SRC}) diff --git a/ReactAndroid/src/main/jni/third-party/double-conversion/CMakeLists.txt b/ReactAndroid/src/main/jni/third-party/double-conversion/CMakeLists.txt index bc279fbe8741ea..d32b34c5bf6add 100644 --- a/ReactAndroid/src/main/jni/third-party/double-conversion/CMakeLists.txt +++ b/ReactAndroid/src/main/jni/third-party/double-conversion/CMakeLists.txt @@ -3,7 +3,7 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -cmake_minimum_required(VERSION 3.4.1) +cmake_minimum_required(VERSION 3.13) set(CMAKE_VERBOSE_MAKEFILE on) add_compile_options(-Wno-unused-variable -Wno-unused-local-typedefs) diff --git a/ReactAndroid/src/main/jni/third-party/fmt/CMakeLists.txt b/ReactAndroid/src/main/jni/third-party/fmt/CMakeLists.txt index 1791e7dc833818..3c03de22fc4aca 100644 --- a/ReactAndroid/src/main/jni/third-party/fmt/CMakeLists.txt +++ b/ReactAndroid/src/main/jni/third-party/fmt/CMakeLists.txt @@ -3,7 +3,7 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -cmake_minimum_required(VERSION 3.4.1) +cmake_minimum_required(VERSION 3.13) set(CMAKE_VERBOSE_MAKEFILE on) add_compile_options(-std=c++11 -fexceptions) diff --git a/ReactAndroid/src/main/jni/third-party/folly/CMakeLists.txt b/ReactAndroid/src/main/jni/third-party/folly/CMakeLists.txt index 5048c7ef4ca623..7b06ec29819688 100644 --- a/ReactAndroid/src/main/jni/third-party/folly/CMakeLists.txt +++ b/ReactAndroid/src/main/jni/third-party/folly/CMakeLists.txt @@ -3,7 +3,7 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -cmake_minimum_required(VERSION 3.4.1) +cmake_minimum_required(VERSION 3.13) set(CMAKE_VERBOSE_MAKEFILE on) SET(folly_FLAGS diff --git a/ReactAndroid/src/main/jni/third-party/glog/CMakeLists.txt b/ReactAndroid/src/main/jni/third-party/glog/CMakeLists.txt index 66a4a426520cd1..4f07a4ef51dffe 100644 --- a/ReactAndroid/src/main/jni/third-party/glog/CMakeLists.txt +++ b/ReactAndroid/src/main/jni/third-party/glog/CMakeLists.txt @@ -3,7 +3,7 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -cmake_minimum_required(VERSION 3.4.1) +cmake_minimum_required(VERSION 3.13) set(CMAKE_VERBOSE_MAKEFILE on) add_compile_options( diff --git a/ReactAndroid/src/main/jni/third-party/jsc/CMakeLists.txt b/ReactAndroid/src/main/jni/third-party/jsc/CMakeLists.txt index 93c3d11a507b9b..4f72ace845ce36 100644 --- a/ReactAndroid/src/main/jni/third-party/jsc/CMakeLists.txt +++ b/ReactAndroid/src/main/jni/third-party/jsc/CMakeLists.txt @@ -3,7 +3,7 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -cmake_minimum_required(VERSION 3.4.1) +cmake_minimum_required(VERSION 3.13) set(CMAKE_VERBOSE_MAKEFILE on) add_library(jsc SHARED IMPORTED GLOBAL) diff --git a/ReactAndroid/src/main/jni/third-party/libevent/CMakeLists.txt b/ReactAndroid/src/main/jni/third-party/libevent/CMakeLists.txt index d729f409b34e73..964111f13cfaf1 100644 --- a/ReactAndroid/src/main/jni/third-party/libevent/CMakeLists.txt +++ b/ReactAndroid/src/main/jni/third-party/libevent/CMakeLists.txt @@ -3,7 +3,7 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -cmake_minimum_required(VERSION 3.4.1) +cmake_minimum_required(VERSION 3.13) set(CMAKE_VERBOSE_MAKEFILE on) add_compile_options( diff --git a/ReactCommon/butter/CMakeLists.txt b/ReactCommon/butter/CMakeLists.txt index 4bc2a7629410c5..f0369712e434b2 100644 --- a/ReactCommon/butter/CMakeLists.txt +++ b/ReactCommon/butter/CMakeLists.txt @@ -3,7 +3,7 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -cmake_minimum_required(VERSION 3.4.1) +cmake_minimum_required(VERSION 3.13) set(CMAKE_VERBOSE_MAKEFILE on) add_compile_options( @@ -13,17 +13,8 @@ add_compile_options( -std=c++17 -Wall) -add_library(butter - SHARED - butter.h - map.h - mutex.h - set.h - small_vector.h - ) +add_library(butter INTERFACE) -set_target_properties(butter PROPERTIES LINKER_LANGUAGE CXX) +target_include_directories(butter INTERFACE .) -target_include_directories(butter PUBLIC .) - -target_link_libraries(butter glog) +target_link_libraries(butter INTERFACE glog) diff --git a/ReactCommon/callinvoker/CMakeLists.txt b/ReactCommon/callinvoker/CMakeLists.txt index ab6716c0b2c494..58da1e6a1f0709 100644 --- a/ReactCommon/callinvoker/CMakeLists.txt +++ b/ReactCommon/callinvoker/CMakeLists.txt @@ -3,7 +3,7 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -cmake_minimum_required(VERSION 3.4.1) +cmake_minimum_required(VERSION 3.13) set(CMAKE_VERBOSE_MAKEFILE on) add_compile_options(-fexceptions -frtti -std=c++17 -Wall) diff --git a/ReactCommon/cxxreact/CMakeLists.txt b/ReactCommon/cxxreact/CMakeLists.txt index bb224989f42e60..ace8f7c982c8b4 100644 --- a/ReactCommon/cxxreact/CMakeLists.txt +++ b/ReactCommon/cxxreact/CMakeLists.txt @@ -3,7 +3,7 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -cmake_minimum_required(VERSION 3.4.1) +cmake_minimum_required(VERSION 3.13) set(CMAKE_VERBOSE_MAKEFILE on) add_compile_options( @@ -12,7 +12,7 @@ add_compile_options( -Wno-unused-lambda-capture -DLOG_TAG=\"ReactNative\") -file(GLOB reactnative_SRC ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) +file(GLOB reactnative_SRC CONFIGURE_DEPENDS *.cpp) add_library(reactnative STATIC ${reactnative_SRC}) target_include_directories(reactnative PUBLIC ${REACT_COMMON_DIR}) diff --git a/ReactCommon/jsi/CMakeLists.txt b/ReactCommon/jsi/CMakeLists.txt index 07901bae401c0f..d4bf231143ec00 100644 --- a/ReactCommon/jsi/CMakeLists.txt +++ b/ReactCommon/jsi/CMakeLists.txt @@ -7,7 +7,7 @@ ### jsi ### ################## -cmake_minimum_required(VERSION 3.4.1) +cmake_minimum_required(VERSION 3.13) set(CMAKE_VERBOSE_MAKEFILE on) add_compile_options( @@ -17,7 +17,7 @@ add_compile_options( -Wno-unused-lambda-capture -DLOG_TAG=\"ReactNative\") -file(GLOB jsi_SRC ${CMAKE_CURRENT_SOURCE_DIR}/jsi/*.cpp) +file(GLOB jsi_SRC CONFIGURE_DEPENDS jsi/*.cpp) add_library(jsi SHARED ${jsi_SRC}) target_include_directories(jsi PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/ReactCommon/jsiexecutor/CMakeLists.txt b/ReactCommon/jsiexecutor/CMakeLists.txt index 5964a7e5e9bb82..50f922c7217868 100644 --- a/ReactCommon/jsiexecutor/CMakeLists.txt +++ b/ReactCommon/jsiexecutor/CMakeLists.txt @@ -3,7 +3,7 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -cmake_minimum_required(VERSION 3.4.1) +cmake_minimum_required(VERSION 3.13) set(CMAKE_VERBOSE_MAKEFILE on) add_compile_options(-fexceptions -frtti -O3) diff --git a/ReactCommon/jsinspector/CMakeLists.txt b/ReactCommon/jsinspector/CMakeLists.txt index c349ca9fff220b..511afcb9a43d52 100644 --- a/ReactCommon/jsinspector/CMakeLists.txt +++ b/ReactCommon/jsinspector/CMakeLists.txt @@ -3,13 +3,12 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -cmake_minimum_required(VERSION 3.4.1) +cmake_minimum_required(VERSION 3.13) set(CMAKE_VERBOSE_MAKEFILE on) add_compile_options(-fexceptions) -add_library(jsinspector - SHARED - InspectorInterfaces.cpp) +file(GLOB jsinspector_SRC CONFIGURE_DEPENDS *.cpp) +add_library(jsinspector SHARED ${jsinspector_SRC}) target_include_directories(jsinspector PUBLIC ${REACT_COMMON_DIR}) diff --git a/ReactCommon/logger/CMakeLists.txt b/ReactCommon/logger/CMakeLists.txt index aa572387e715bf..4746c147ac313f 100644 --- a/ReactCommon/logger/CMakeLists.txt +++ b/ReactCommon/logger/CMakeLists.txt @@ -3,14 +3,13 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -cmake_minimum_required(VERSION 3.4.1) +cmake_minimum_required(VERSION 3.13) set(CMAKE_VERBOSE_MAKEFILE on) add_compile_options(-fexceptions) -add_library(logger - SHARED - react_native_log.cpp) +file(GLOB logger_SRC CONFIGURE_DEPENDS *.cpp) +add_library(logger SHARED ${logger_SRC}) target_include_directories(logger PUBLIC .) diff --git a/ReactCommon/react/config/CMakeLists.txt b/ReactCommon/react/config/CMakeLists.txt index 92c9a44b089bc1..fea8855cb9cc78 100644 --- a/ReactCommon/react/config/CMakeLists.txt +++ b/ReactCommon/react/config/CMakeLists.txt @@ -3,7 +3,7 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -cmake_minimum_required(VERSION 3.4.1) +cmake_minimum_required(VERSION 3.13) set(CMAKE_VERBOSE_MAKEFILE on) add_compile_options( @@ -13,8 +13,7 @@ add_compile_options( -Wall -DLOG_TAG=\"Fabric\") -add_library(react_config - SHARED - ReactNativeConfig.cpp) +file(GLOB react_config_SRC CONFIGURE_DEPENDS *.cpp) +add_library(react_config SHARED ${react_config_SRC}) target_include_directories(react_config PUBLIC ${REACT_COMMON_DIR}) diff --git a/ReactCommon/react/debug/CMakeLists.txt b/ReactCommon/react/debug/CMakeLists.txt index 8814f328a9c6dd..7c92d79cd9c99e 100644 --- a/ReactCommon/react/debug/CMakeLists.txt +++ b/ReactCommon/react/debug/CMakeLists.txt @@ -3,7 +3,7 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -cmake_minimum_required(VERSION 3.4.1) +cmake_minimum_required(VERSION 3.13) set(CMAKE_VERBOSE_MAKEFILE on) add_compile_options( @@ -13,10 +13,11 @@ add_compile_options( -Wall -DLOG_TAG=\"Fabric\") -add_library(react_debug - SHARED - react_native_assert.cpp) +file(GLOB react_debug_SRC CONFIGURE_DEPENDS *.cpp) +add_library(react_debug SHARED ${react_debug_SRC}) + +# TODO This should not be ../../.. but a proper variable target_include_directories(react_debug PUBLIC ../../..) target_link_libraries(react_debug log folly_json) diff --git a/ReactCommon/react/nativemodule/core/CMakeLists.txt b/ReactCommon/react/nativemodule/core/CMakeLists.txt index a1930c387eeb20..1239bb17712509 100644 --- a/ReactCommon/react/nativemodule/core/CMakeLists.txt +++ b/ReactCommon/react/nativemodule/core/CMakeLists.txt @@ -3,20 +3,18 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -cmake_minimum_required(VERSION 3.4.1) +cmake_minimum_required(VERSION 3.13) set(CMAKE_VERBOSE_MAKEFILE on) add_compile_options(-fexceptions -frtti -std=c++17 -Wall -DLOG_TAG=\"ReactNative\") + +file(GLOB react_nativemodule_core_SRC CONFIGURE_DEPENDS + ReactCommon/*.cpp + platform/android/ReactCommon/*.cpp) add_library(react_nativemodule_core SHARED - ReactCommon/LongLivedObject.cpp - ReactCommon/TurboCxxModule.cpp - ReactCommon/TurboModule.cpp - ReactCommon/TurboModuleBinding.cpp - ReactCommon/TurboModulePerfLogger.cpp - ReactCommon/TurboModuleUtils.cpp - platform/android/ReactCommon/JavaTurboModule.cpp) + ${react_nativemodule_core_SRC}) target_include_directories(react_nativemodule_core PUBLIC diff --git a/ReactCommon/react/renderer/animations/CMakeLists.txt b/ReactCommon/react/renderer/animations/CMakeLists.txt index ccb5f6e5e2198e..9d325d51d3171f 100644 --- a/ReactCommon/react/renderer/animations/CMakeLists.txt +++ b/ReactCommon/react/renderer/animations/CMakeLists.txt @@ -3,18 +3,13 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -cmake_minimum_required(VERSION 3.4.1) +cmake_minimum_required(VERSION 3.13) set(CMAKE_VERBOSE_MAKEFILE on) add_compile_options(-fexceptions -frtti -std=c++17 -Wall -DLOG_TAG=\"Fabric\") -add_library( - react_render_animations - SHARED - LayoutAnimationDriver.cpp - LayoutAnimationKeyFrameManager.cpp - utils.cpp -) +file(GLOB react_render_animations_SRC CONFIGURE_DEPENDS *.cpp) +add_library(react_render_animations SHARED ${react_render_animations_SRC}) target_include_directories(react_render_animations PUBLIC ${REACT_COMMON_DIR}) diff --git a/ReactCommon/react/renderer/attributedstring/CMakeLists.txt b/ReactCommon/react/renderer/attributedstring/CMakeLists.txt index 4566deac13f8d3..decca1b6310f8a 100644 --- a/ReactCommon/react/renderer/attributedstring/CMakeLists.txt +++ b/ReactCommon/react/renderer/attributedstring/CMakeLists.txt @@ -3,19 +3,13 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -cmake_minimum_required(VERSION 3.4.1) +cmake_minimum_required(VERSION 3.13) set(CMAKE_VERBOSE_MAKEFILE on) add_compile_options(-fexceptions -frtti -std=c++17 -Wall -DLOG_TAG=\"Fabric\") -add_library( - react_render_attributedstring - SHARED - AttributedString.cpp - AttributedStringBox.cpp - ParagraphAttributes.cpp - TextAttributes.cpp -) +file(GLOB react_render_attributedstring_SRC CONFIGURE_DEPENDS *.cpp) +add_library(react_render_attributedstring SHARED ${react_render_attributedstring_SRC}) target_include_directories(react_render_attributedstring PUBLIC ${REACT_COMMON_DIR}) diff --git a/ReactCommon/react/renderer/componentregistry/CMakeLists.txt b/ReactCommon/react/renderer/componentregistry/CMakeLists.txt index b4543e023fa02a..8b924260dfd8d7 100644 --- a/ReactCommon/react/renderer/componentregistry/CMakeLists.txt +++ b/ReactCommon/react/renderer/componentregistry/CMakeLists.txt @@ -3,18 +3,13 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -cmake_minimum_required(VERSION 3.4.1) +cmake_minimum_required(VERSION 3.13) set(CMAKE_VERBOSE_MAKEFILE on) add_compile_options(-fexceptions -frtti -std=c++17 -Wall -DLOG_TAG=\"Fabric\") -add_library( - react_render_componentregistry - SHARED - ComponentDescriptorProviderRegistry.cpp - ComponentDescriptorRegistry.cpp - componentNameByReactViewName.cpp -) +file(GLOB react_render_componentregistry_SRC CONFIGURE_DEPENDS *.cpp) +add_library(react_render_componentregistry SHARED ${react_render_componentregistry_SRC}) target_include_directories(react_render_componentregistry PUBLIC ${REACT_COMMON_DIR}) diff --git a/ReactCommon/react/renderer/componentregistry/native/CMakeLists.txt b/ReactCommon/react/renderer/componentregistry/native/CMakeLists.txt index b6139a015c4762..89c0792c4bfdc3 100644 --- a/ReactCommon/react/renderer/componentregistry/native/CMakeLists.txt +++ b/ReactCommon/react/renderer/componentregistry/native/CMakeLists.txt @@ -3,16 +3,13 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -cmake_minimum_required(VERSION 3.4.1) +cmake_minimum_required(VERSION 3.13) set(CMAKE_VERBOSE_MAKEFILE on) add_compile_options(-fexceptions -frtti -std=c++17 -Wall -DLOG_TAG=\"Fabric\") -add_library( - rrc_native - SHARED - NativeComponentRegistryBinding.cpp -) +file(GLOB rrc_native_SRC CONFIGURE_DEPENDS *.cpp) +add_library(rrc_native SHARED ${rrc_native_SRC}) target_include_directories(rrc_native PUBLIC ${REACT_COMMON_DIR}) diff --git a/ReactCommon/react/renderer/components/image/CMakeLists.txt b/ReactCommon/react/renderer/components/image/CMakeLists.txt index b750754849f181..49b8030a4a1ede 100644 --- a/ReactCommon/react/renderer/components/image/CMakeLists.txt +++ b/ReactCommon/react/renderer/components/image/CMakeLists.txt @@ -3,19 +3,13 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -cmake_minimum_required(VERSION 3.4.1) +cmake_minimum_required(VERSION 3.13) set(CMAKE_VERBOSE_MAKEFILE on) add_compile_options(-fexceptions -frtti -std=c++17 -Wall -DLOG_TAG=\"Fabric\") -add_library( - rrc_image - SHARED - ImageEventEmitter.cpp - ImageProps.cpp - ImageShadowNode.cpp - ImageState.cpp -) +file(GLOB rrc_image_SRC CONFIGURE_DEPENDS *.cpp) +add_library(rrc_image SHARED ${rrc_image_SRC}) target_include_directories(rrc_image PUBLIC ${REACT_COMMON_DIR}) diff --git a/ReactCommon/react/renderer/components/root/CMakeLists.txt b/ReactCommon/react/renderer/components/root/CMakeLists.txt index 9b96943ae9109e..2da824a8ece21d 100644 --- a/ReactCommon/react/renderer/components/root/CMakeLists.txt +++ b/ReactCommon/react/renderer/components/root/CMakeLists.txt @@ -3,14 +3,13 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -cmake_minimum_required(VERSION 3.4.1) +cmake_minimum_required(VERSION 3.13) set(CMAKE_VERBOSE_MAKEFILE on) add_compile_options(-fexceptions -frtti -std=c++17 -Wall -DLOG_TAG=\"Fabric\") -add_library(rrc_root SHARED - RootProps.cpp - RootShadowNode.cpp) +file(GLOB rrc_root_SRC CONFIGURE_DEPENDS *.cpp) +add_library(rrc_root SHARED ${rrc_root_SRC}) target_include_directories(rrc_root PUBLIC ${REACT_COMMON_DIR}) diff --git a/ReactCommon/react/renderer/components/scrollview/CMakeLists.txt b/ReactCommon/react/renderer/components/scrollview/CMakeLists.txt index ab7d8a267f2b9a..5d64f56ab05788 100644 --- a/ReactCommon/react/renderer/components/scrollview/CMakeLists.txt +++ b/ReactCommon/react/renderer/components/scrollview/CMakeLists.txt @@ -3,19 +3,13 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -cmake_minimum_required(VERSION 3.4.1) +cmake_minimum_required(VERSION 3.13) set(CMAKE_VERBOSE_MAKEFILE on) add_compile_options(-fexceptions -frtti -std=c++17 -Wall -DLOG_TAG=\"Fabric\") -add_library( - rrc_scrollview - SHARED - ScrollViewEventEmitter.cpp - ScrollViewProps.cpp - ScrollViewShadowNode.cpp - ScrollViewState.cpp -) +file(GLOB rrc_scrollview_SRC CONFIGURE_DEPENDS *.cpp) +add_library(rrc_scrollview SHARED ${rrc_scrollview_SRC}) target_include_directories(rrc_scrollview PUBLIC ${REACT_COMMON_DIR}) diff --git a/ReactCommon/react/renderer/components/text/CMakeLists.txt b/ReactCommon/react/renderer/components/text/CMakeLists.txt index 7c4eb29c6d25a9..404c5d429e8329 100644 --- a/ReactCommon/react/renderer/components/text/CMakeLists.txt +++ b/ReactCommon/react/renderer/components/text/CMakeLists.txt @@ -3,25 +3,13 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -cmake_minimum_required(VERSION 3.4.1) +cmake_minimum_required(VERSION 3.13) set(CMAKE_VERBOSE_MAKEFILE on) add_compile_options(-fexceptions -frtti -std=c++17 -Wall -DLOG_TAG=\"Fabric\") -add_library( - rrc_text - SHARED - BaseTextProps.cpp - BaseTextShadowNode.cpp - ParagraphEventEmitter.cpp - ParagraphProps.cpp - ParagraphShadowNode.cpp - ParagraphState.cpp - RawTextProps.cpp - RawTextShadowNode.cpp - TextProps.cpp - TextShadowNode.cpp -) +file(GLOB rrc_text_SRC CONFIGURE_DEPENDS *.cpp) +add_library(rrc_text SHARED ${rrc_text_SRC}) target_include_directories(rrc_text PUBLIC ${REACT_COMMON_DIR}) diff --git a/ReactCommon/react/renderer/components/textinput/CMakeLists.txt b/ReactCommon/react/renderer/components/textinput/CMakeLists.txt index bce6220cbbad6d..cd91ccf67ce8d8 100644 --- a/ReactCommon/react/renderer/components/textinput/CMakeLists.txt +++ b/ReactCommon/react/renderer/components/textinput/CMakeLists.txt @@ -3,18 +3,13 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -cmake_minimum_required(VERSION 3.4.1) +cmake_minimum_required(VERSION 3.13) set(CMAKE_VERBOSE_MAKEFILE on) add_compile_options(-fexceptions -frtti -std=c++17 -Wall -DLOG_TAG=\"Fabric\") -add_library( - rrc_textinput - SHARED - androidtextinput/react/renderer/components/androidtextinput/AndroidTextInputProps.cpp - androidtextinput/react/renderer/components/androidtextinput/AndroidTextInputShadowNode.cpp - androidtextinput/react/renderer/components/androidtextinput/AndroidTextInputState.cpp -) +file(GLOB rrc_textinput_SRC CONFIGURE_DEPENDS androidtextinput/react/renderer/components/androidtextinput/*.cpp) +add_library(rrc_textinput SHARED ${rrc_textinput_SRC}) target_include_directories(rrc_textinput PUBLIC diff --git a/ReactCommon/react/renderer/components/unimplementedview/CMakeLists.txt b/ReactCommon/react/renderer/components/unimplementedview/CMakeLists.txt index 7c2cdf823e90a4..0093c01eab2f70 100644 --- a/ReactCommon/react/renderer/components/unimplementedview/CMakeLists.txt +++ b/ReactCommon/react/renderer/components/unimplementedview/CMakeLists.txt @@ -3,18 +3,13 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -cmake_minimum_required(VERSION 3.4.1) +cmake_minimum_required(VERSION 3.13) set(CMAKE_VERBOSE_MAKEFILE on) add_compile_options(-fexceptions -frtti -std=c++17 -Wall -DLOG_TAG=\"Fabric\") -add_library( - rrc_unimplementedview - SHARED - UnimplementedViewComponentDescriptor.cpp - UnimplementedViewProps.cpp - UnimplementedViewShadowNode.cpp -) +file(GLOB rrc_unimplementedview_SRC CONFIGURE_DEPENDS *.cpp) +add_library(rrc_unimplementedview SHARED ${rrc_unimplementedview_SRC}) target_include_directories(rrc_unimplementedview PUBLIC ${REACT_COMMON_DIR}) diff --git a/ReactCommon/react/renderer/components/view/CMakeLists.txt b/ReactCommon/react/renderer/components/view/CMakeLists.txt index 5a9d0cdaf118ef..f11b2077112e7e 100644 --- a/ReactCommon/react/renderer/components/view/CMakeLists.txt +++ b/ReactCommon/react/renderer/components/view/CMakeLists.txt @@ -3,13 +3,12 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -cmake_minimum_required(VERSION 3.4.1) +cmake_minimum_required(VERSION 3.13) set(CMAKE_VERBOSE_MAKEFILE on) add_compile_options(-fexceptions -frtti -std=c++17 -Wall -DLOG_TAG=\"Fabric\") -file(GLOB rrc_view_SRC ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - +file(GLOB rrc_view_SRC CONFIGURE_DEPENDS *.cpp) add_library(rrc_view SHARED ${rrc_view_SRC}) target_include_directories(rrc_view PUBLIC ${REACT_COMMON_DIR}) diff --git a/ReactCommon/react/renderer/core/CMakeLists.txt b/ReactCommon/react/renderer/core/CMakeLists.txt index 23e0d9a8a84593..c63d82f867ac08 100644 --- a/ReactCommon/react/renderer/core/CMakeLists.txt +++ b/ReactCommon/react/renderer/core/CMakeLists.txt @@ -3,13 +3,12 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -cmake_minimum_required(VERSION 3.4.1) +cmake_minimum_required(VERSION 3.13) set(CMAKE_VERBOSE_MAKEFILE on) add_compile_options(-fexceptions -frtti -std=c++17 -Wall -DLOG_TAG=\"Fabric\") -file(GLOB react_render_core_SRC ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - +file(GLOB react_render_core_SRC CONFIGURE_DEPENDS *.cpp) add_library(react_render_core SHARED ${react_render_core_SRC}) target_include_directories(react_render_core PUBLIC ${REACT_COMMON_DIR}) diff --git a/ReactCommon/react/renderer/debug/CMakeLists.txt b/ReactCommon/react/renderer/debug/CMakeLists.txt index c191207c5d96bb..04bda64b346289 100644 --- a/ReactCommon/react/renderer/debug/CMakeLists.txt +++ b/ReactCommon/react/renderer/debug/CMakeLists.txt @@ -3,15 +3,13 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -cmake_minimum_required(VERSION 3.4.1) +cmake_minimum_required(VERSION 3.13) set(CMAKE_VERBOSE_MAKEFILE on) add_compile_options(-fexceptions -frtti -std=c++17 -Wall -DLOG_TAG=\"Fabric\") -add_library(react_render_debug - SHARED - DebugStringConvertible.cpp - DebugStringConvertibleItem.cpp) +file(GLOB react_render_debug_SRC CONFIGURE_DEPENDS *.cpp) +add_library(react_render_debug SHARED ${react_render_debug_SRC}) target_include_directories(react_render_debug PUBLIC ${REACT_COMMON_DIR}) target_link_libraries(react_render_debug folly_json) diff --git a/ReactCommon/react/renderer/graphics/CMakeLists.txt b/ReactCommon/react/renderer/graphics/CMakeLists.txt index 9a455bb5eac904..a566f9b1c2f794 100644 --- a/ReactCommon/react/renderer/graphics/CMakeLists.txt +++ b/ReactCommon/react/renderer/graphics/CMakeLists.txt @@ -3,16 +3,18 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -cmake_minimum_required(VERSION 3.4.1) +cmake_minimum_required(VERSION 3.13) set(CMAKE_VERBOSE_MAKEFILE on) add_compile_options(-fexceptions -frtti -std=c++17 -Wall -DLOG_TAG=\"Fabric\") +file(GLOB react_render_graphics_SRC CONFIGURE_DEPENDS + *.cpp + platform/cxx/react/renderer/graphics/*.cpp) + add_library(react_render_graphics SHARED - Transform.cpp - platform/cxx/react/renderer/graphics/Color.cpp - ) + ${react_render_graphics_SRC}) target_include_directories(react_render_graphics PUBLIC diff --git a/ReactCommon/react/renderer/imagemanager/CMakeLists.txt b/ReactCommon/react/renderer/imagemanager/CMakeLists.txt index d48d66c2854494..a53133c95e22bd 100644 --- a/ReactCommon/react/renderer/imagemanager/CMakeLists.txt +++ b/ReactCommon/react/renderer/imagemanager/CMakeLists.txt @@ -3,18 +3,18 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -cmake_minimum_required(VERSION 3.4.1) +cmake_minimum_required(VERSION 3.13) set(CMAKE_VERBOSE_MAKEFILE on) add_compile_options(-fexceptions -frtti -std=c++17 -Wall -DLOG_TAG=\"Fabric\") +file(GLOB react_render_imagemanager_SRC CONFIGURE_DEPENDS + *.cpp + platform/cxx/react/renderer/imagemanager/*.cpp) + add_library(react_render_imagemanager SHARED - ImageResponse.cpp - ImageResponseObserverCoordinator.cpp - ImageTelemetry.cpp - platform/cxx/react/renderer/imagemanager/ImageManager.cpp - platform/cxx/react/renderer/imagemanager/ImageRequest.cpp) + ${react_render_imagemanager_SRC}) target_include_directories(react_render_imagemanager PUBLIC diff --git a/ReactCommon/react/renderer/leakchecker/CMakeLists.txt b/ReactCommon/react/renderer/leakchecker/CMakeLists.txt index 9909bcfc2e9bb3..d7657198d942df 100644 --- a/ReactCommon/react/renderer/leakchecker/CMakeLists.txt +++ b/ReactCommon/react/renderer/leakchecker/CMakeLists.txt @@ -3,15 +3,13 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -cmake_minimum_required(VERSION 3.4.1) +cmake_minimum_required(VERSION 3.13) set(CMAKE_VERBOSE_MAKEFILE on) add_compile_options(-fexceptions -frtti -std=c++17 -Wall -DLOG_TAG=\"Fabric\") -add_library(react_render_leakchecker - SHARED - LeakChecker.cpp - WeakFamilyRegistry.cpp) +file(GLOB react_render_leakchecker_SRC CONFIGURE_DEPENDS *.cpp) +add_library(react_render_leakchecker SHARED ${react_render_leakchecker_SRC}) target_include_directories(react_render_leakchecker PUBLIC ${REACT_COMMON_DIR}) target_link_libraries(react_render_leakchecker diff --git a/ReactCommon/react/renderer/mapbuffer/CMakeLists.txt b/ReactCommon/react/renderer/mapbuffer/CMakeLists.txt index 930d0a363b7222..fe3648152f51bd 100644 --- a/ReactCommon/react/renderer/mapbuffer/CMakeLists.txt +++ b/ReactCommon/react/renderer/mapbuffer/CMakeLists.txt @@ -3,15 +3,13 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -cmake_minimum_required(VERSION 3.4.1) +cmake_minimum_required(VERSION 3.13) set(CMAKE_VERBOSE_MAKEFILE on) add_compile_options(-fexceptions -frtti -std=c++17 -Wall -DLOG_TAG=\"Fabric\") -add_library(react_render_mapbuffer - SHARED - MapBuffer.cpp - MapBufferBuilder.cpp) +file(GLOB react_render_mapbuffer_SRC CONFIGURE_DEPENDS *.cpp) +add_library(react_render_mapbuffer SHARED ${react_render_mapbuffer_SRC}) target_include_directories(react_render_mapbuffer PUBLIC ${REACT_COMMON_DIR}) target_link_libraries(react_render_mapbuffer glog glog_init react_debug) diff --git a/ReactCommon/react/renderer/mounting/CMakeLists.txt b/ReactCommon/react/renderer/mounting/CMakeLists.txt index 5cc54258ab12ee..6b6209a24a3fe6 100644 --- a/ReactCommon/react/renderer/mounting/CMakeLists.txt +++ b/ReactCommon/react/renderer/mounting/CMakeLists.txt @@ -3,13 +3,12 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -cmake_minimum_required(VERSION 3.4.1) +cmake_minimum_required(VERSION 3.13) set(CMAKE_VERBOSE_MAKEFILE on) add_compile_options(-fexceptions -frtti -std=c++17 -Wall -DLOG_TAG=\"Fabric\") -file(GLOB react_render_mounting_SRC ${CMAKE_CURRENT_SOURCE_DIR}/*.cpp) - +file(GLOB react_render_mounting_SRC CONFIGURE_DEPENDS *.cpp) add_library(react_render_mounting SHARED ${react_render_mounting_SRC}) target_include_directories(react_render_mounting PRIVATE .) diff --git a/ReactCommon/react/renderer/runtimescheduler/CMakeLists.txt b/ReactCommon/react/renderer/runtimescheduler/CMakeLists.txt index 3d089d91473a73..5a18fb85c09ad8 100644 --- a/ReactCommon/react/renderer/runtimescheduler/CMakeLists.txt +++ b/ReactCommon/react/renderer/runtimescheduler/CMakeLists.txt @@ -3,18 +3,13 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -cmake_minimum_required(VERSION 3.4.1) +cmake_minimum_required(VERSION 3.13) set(CMAKE_VERBOSE_MAKEFILE on) add_compile_options(-fexceptions -frtti -std=c++17 -Wall -DLOG_TAG=\"Fabric\") -add_library( - react_render_runtimescheduler - SHARED - RuntimeScheduler.cpp - RuntimeSchedulerBinding.cpp - RuntimeSchedulerCallInvoker.cpp - Task.cpp) +file(GLOB react_render_runtimescheduler_SRC CONFIGURE_DEPENDS *.cpp) +add_library(react_render_runtimescheduler SHARED ${react_render_runtimescheduler_SRC}) target_include_directories(react_render_runtimescheduler PUBLIC ${REACT_COMMON_DIR}) diff --git a/ReactCommon/react/renderer/scheduler/CMakeLists.txt b/ReactCommon/react/renderer/scheduler/CMakeLists.txt index 9a4b7fee93fb89..260e40cba8b00b 100644 --- a/ReactCommon/react/renderer/scheduler/CMakeLists.txt +++ b/ReactCommon/react/renderer/scheduler/CMakeLists.txt @@ -3,21 +3,13 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -cmake_minimum_required(VERSION 3.4.1) +cmake_minimum_required(VERSION 3.13) set(CMAKE_VERBOSE_MAKEFILE on) add_compile_options(-fexceptions -frtti -std=c++17 -Wall -DLOG_TAG=\"Fabric\") -add_library( - react_render_scheduler - SHARED - AsynchronousEventBeat.cpp - Scheduler.cpp - SchedulerToolbox.cpp - SurfaceHandler.cpp - SurfaceManager.cpp - SynchronousEventBeat.cpp -) +file(GLOB react_render_scheduler_SRC CONFIGURE_DEPENDS *.cpp) +add_library(react_render_scheduler SHARED ${react_render_scheduler_SRC}) target_include_directories(react_render_scheduler PUBLIC ${REACT_COMMON_DIR}) diff --git a/ReactCommon/react/renderer/telemetry/CMakeLists.txt b/ReactCommon/react/renderer/telemetry/CMakeLists.txt index b1d04a0e5420d5..bcbbf0b82f2fec 100644 --- a/ReactCommon/react/renderer/telemetry/CMakeLists.txt +++ b/ReactCommon/react/renderer/telemetry/CMakeLists.txt @@ -3,15 +3,13 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -cmake_minimum_required(VERSION 3.4.1) +cmake_minimum_required(VERSION 3.13) set(CMAKE_VERBOSE_MAKEFILE on) add_compile_options(-fexceptions -frtti -std=c++17 -Wall -DLOG_TAG=\"Fabric\") -add_library(react_render_telemetry - SHARED - SurfaceTelemetry.cpp - TransactionTelemetry.cpp) +file(GLOB react_render_telemetry_SRC CONFIGURE_DEPENDS *.cpp) +add_library(react_render_telemetry SHARED ${react_render_telemetry_SRC}) target_include_directories(react_render_telemetry PUBLIC ${REACT_COMMON_DIR}) diff --git a/ReactCommon/react/renderer/templateprocessor/CMakeLists.txt b/ReactCommon/react/renderer/templateprocessor/CMakeLists.txt index 5f77bbdd532ae6..07d119ceacb34b 100644 --- a/ReactCommon/react/renderer/templateprocessor/CMakeLists.txt +++ b/ReactCommon/react/renderer/templateprocessor/CMakeLists.txt @@ -3,14 +3,13 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -cmake_minimum_required(VERSION 3.4.1) +cmake_minimum_required(VERSION 3.13) set(CMAKE_VERBOSE_MAKEFILE on) add_compile_options(-fexceptions -frtti -std=c++17 -Wall -DLOG_TAG=\"Fabric\") -add_library(react_render_templateprocessor - SHARED - UITemplateProcessor.cpp) +file(GLOB react_render_templateprocessor_SRC CONFIGURE_DEPENDS *.cpp) +add_library(react_render_templateprocessor SHARED ${react_render_templateprocessor_SRC}) target_include_directories(react_render_templateprocessor PUBLIC ${REACT_COMMON_DIR}) diff --git a/ReactCommon/react/renderer/textlayoutmanager/CMakeLists.txt b/ReactCommon/react/renderer/textlayoutmanager/CMakeLists.txt index c0e56031471043..2098cbe60a8154 100644 --- a/ReactCommon/react/renderer/textlayoutmanager/CMakeLists.txt +++ b/ReactCommon/react/renderer/textlayoutmanager/CMakeLists.txt @@ -3,16 +3,18 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -cmake_minimum_required(VERSION 3.4.1) +cmake_minimum_required(VERSION 3.13) set(CMAKE_VERBOSE_MAKEFILE on) add_compile_options(-fexceptions -frtti -std=c++17 -Wall -DLOG_TAG=\"Fabric\") +file(GLOB react_render_textlayourmanager_SRC CONFIGURE_DEPENDS + *.cpp + platform/android/react/renderer/textlayoutmanager/*.cpp) + add_library(react_render_textlayoutmanager SHARED - TextMeasureCache.cpp - platform/android/react/renderer/textlayoutmanager/TextLayoutManager.cpp -) + ${react_render_textlayourmanager_SRC}) target_include_directories(react_render_textlayoutmanager PUBLIC diff --git a/ReactCommon/react/renderer/uimanager/CMakeLists.txt b/ReactCommon/react/renderer/uimanager/CMakeLists.txt index 03cf17135dadd4..42433e50292a20 100644 --- a/ReactCommon/react/renderer/uimanager/CMakeLists.txt +++ b/ReactCommon/react/renderer/uimanager/CMakeLists.txt @@ -3,17 +3,13 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -cmake_minimum_required(VERSION 3.4.1) +cmake_minimum_required(VERSION 3.13) set(CMAKE_VERBOSE_MAKEFILE on) add_compile_options(-fexceptions -frtti -std=c++17 -Wall -DLOG_TAG=\"Fabric\") -add_library(react_render_uimanager - SHARED - bindingUtils.cpp - SurfaceRegistryBinding.cpp - UIManager.cpp - UIManagerBinding.cpp) +file(GLOB react_render_uimanager_SRC CONFIGURE_DEPENDS *.cpp) +add_library(react_render_uimanager SHARED ${react_render_uimanager_SRC}) target_include_directories(react_render_uimanager PUBLIC ${REACT_COMMON_DIR}) diff --git a/ReactCommon/react/utils/CMakeLists.txt b/ReactCommon/react/utils/CMakeLists.txt index 8476c5c4e3ee68..8462de422a0ea4 100644 --- a/ReactCommon/react/utils/CMakeLists.txt +++ b/ReactCommon/react/utils/CMakeLists.txt @@ -3,7 +3,7 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -cmake_minimum_required(VERSION 3.4.1) +cmake_minimum_required(VERSION 3.13) set(CMAKE_VERBOSE_MAKEFILE on) add_compile_options( @@ -13,10 +13,8 @@ add_compile_options( -Wall -DLOG_TAG=\"Fabric\") -add_library(react_utils - SHARED - ManagedObjectWrapper.mm - RunLoopObserver.cpp) +file(GLOB react_utils_SRC CONFIGURE_DEPENDS *.cpp *.mm) +add_library(react_utils SHARED ${react_utils_SRC}) target_include_directories(react_utils PUBLIC ${REACT_COMMON_DIR}) diff --git a/ReactCommon/reactperflogger/CMakeLists.txt b/ReactCommon/reactperflogger/CMakeLists.txt index 257f0b2cc69644..5c18745cc57cc1 100644 --- a/ReactCommon/reactperflogger/CMakeLists.txt +++ b/ReactCommon/reactperflogger/CMakeLists.txt @@ -3,13 +3,12 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -cmake_minimum_required(VERSION 3.4.1) +cmake_minimum_required(VERSION 3.13) set(CMAKE_VERBOSE_MAKEFILE on) add_compile_options(-fexceptions -frtti -std=c++17 -Wall) -add_library(reactperflogger - STATIC - reactperflogger/BridgeNativeModulePerfLogger.cpp) +file(GLOB reactperflogger_SRC CONFIGURE_DEPENDS reactperflogger/*.cpp) +add_library(reactperflogger STATIC ${reactperflogger_SRC}) target_include_directories(reactperflogger PUBLIC .) diff --git a/ReactCommon/runtimeexecutor/CMakeLists.txt b/ReactCommon/runtimeexecutor/CMakeLists.txt index 86af520bd863ca..037d7ec3b7e33b 100644 --- a/ReactCommon/runtimeexecutor/CMakeLists.txt +++ b/ReactCommon/runtimeexecutor/CMakeLists.txt @@ -3,7 +3,7 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -cmake_minimum_required(VERSION 3.4.1) +cmake_minimum_required(VERSION 3.13) set(CMAKE_VERBOSE_MAKEFILE on) add_compile_options(-fexceptions -frtti -std=c++17 -Wall) diff --git a/ReactCommon/yoga/CMakeLists.txt b/ReactCommon/yoga/CMakeLists.txt index 353fc79617cd12..c7e6cd4fd23cb0 100644 --- a/ReactCommon/yoga/CMakeLists.txt +++ b/ReactCommon/yoga/CMakeLists.txt @@ -3,12 +3,12 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -cmake_minimum_required(VERSION 3.4.1) +cmake_minimum_required(VERSION 3.13) set(CMAKE_VERBOSE_MAKEFILE on) add_compile_options(-fexceptions -frtti -O3 -Wall) -file(GLOB_RECURSE yogacore_SRC yoga/*.cpp) +file(GLOB_RECURSE yogacore_SRC CONFIGURE_DEPENDS yoga/*.cpp) add_library(yogacore STATIC ${yogacore_SRC}) target_include_directories(yogacore PUBLIC .) From 4b6c0b92c06f54a41cfda3e3d74fa2ae426b1d4a Mon Sep 17 00:00:00 2001 From: Tommy Nguyen <4123478+tido64@users.noreply.github.com> Date: Tue, 15 Mar 2022 05:19:58 -0700 Subject: [PATCH 16/48] Remove `@babel/plugin-transform-regenerator` from RN Babel preset (#789) Summary: ## Summary Hermes added support for generators in 0.2.0, and JSC is ES6 feature complete since r202125. NOTE: This is a combined Metro + React Native commit. For React Native, the only change here is adding `babel/plugin-transform-regenerator` to `repo-config` ( = `devDependencies`), so the tests no longer implicitly consume it via Metro. Changelog: [Internal] X-link: https://github.com/facebook/metro/pull/789 Reviewed By: rh389 Differential Revision: D34819044 Pulled By: motiz88 fbshipit-source-id: fe27b2c2af0281d5309d4c16f95762d4d4935eba --- repo-config/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/repo-config/package.json b/repo-config/package.json index d2cc56cc93f612..6c230d96f42ae5 100644 --- a/repo-config/package.json +++ b/repo-config/package.json @@ -11,6 +11,7 @@ "dependencies": { "@babel/core": "^7.14.0", "@babel/generator": "^7.14.0", + "@babel/plugin-transform-regenerator": "^7.0.0", "@react-native-community/eslint-plugin": "*", "@react-native/eslint-plugin-specs": ">0.0.2", "@reactions/component": "^2.0.2", From be0ff779b1c48eaa15384ba7d93ec6f7001f6841 Mon Sep 17 00:00:00 2001 From: Pieter De Baets Date: Tue, 15 Mar 2022 05:58:52 -0700 Subject: [PATCH 17/48] Fix parseTypeFromHeader for Hermes bytecode Summary: Changelog: [Internal] Fix bug where Hermes bytecode bundles were not always recognized Reviewed By: motiz88 Differential Revision: D34718511 fbshipit-source-id: 5bbebe49962d098988d99153b0938fbb5d449ae6 --- React/Base/RCTJavaScriptLoader.h | 5 +--- React/Base/RCTJavaScriptLoader.mm | 28 ++++++++----------- React/CxxBridge/RCTCxxBridge.mm | 24 ++++++++-------- .../jni/react/jni/CatalystInstanceImpl.cpp | 2 +- .../src/main/jni/react/jni/JSLoader.cpp | 2 +- ReactCommon/cxxreact/Instance.cpp | 4 +-- ReactCommon/cxxreact/Instance.h | 2 +- ReactCommon/cxxreact/JSBundleType.cpp | 21 ++++++++------ ReactCommon/cxxreact/JSBundleType.h | 26 +++++++++-------- 9 files changed, 58 insertions(+), 56 deletions(-) diff --git a/React/Base/RCTJavaScriptLoader.h b/React/Base/RCTJavaScriptLoader.h index 49d31beceeb92a..a8a95f726392f2 100755 --- a/React/Base/RCTJavaScriptLoader.h +++ b/React/Base/RCTJavaScriptLoader.h @@ -11,10 +11,7 @@ extern NSString *const RCTJavaScriptLoaderErrorDomain; -extern const UInt32 RCT_BYTECODE_ALIGNMENT; - -UInt32 RCTReadUInt32LE(NSData *script, UInt32 offset); -bool RCTIsBytecodeBundle(NSData *script); +extern const uint32_t RCT_BYTECODE_ALIGNMENT; NS_ENUM(NSInteger){ RCTJavaScriptLoaderErrorNoScriptURL = 1, diff --git a/React/Base/RCTJavaScriptLoader.mm b/React/Base/RCTJavaScriptLoader.mm index aa89b99f1c73a3..133851a1d7f49d 100755 --- a/React/Base/RCTJavaScriptLoader.mm +++ b/React/Base/RCTJavaScriptLoader.mm @@ -19,19 +19,7 @@ NSString *const RCTJavaScriptLoaderErrorDomain = @"RCTJavaScriptLoaderErrorDomain"; -const UInt32 RCT_BYTECODE_ALIGNMENT = 4; -UInt32 RCTReadUInt32LE(NSData *script, UInt32 offset) -{ - return [script length] < offset + 4 ? 0 : CFSwapInt32LittleToHost(*(((uint32_t *)[script bytes]) + offset / 4)); -} - -bool RCTIsBytecodeBundle(NSData *script) -{ - static const UInt32 BYTECODE_BUNDLE_MAGIC_NUMBER = 0xffe7c3c3; - return ( - [script length] > 8 && RCTReadUInt32LE(script, 0) == BYTECODE_BUNDLE_MAGIC_NUMBER && - RCTReadUInt32LE(script, 4) > 0); -} +const uint32_t RCT_BYTECODE_ALIGNMENT = 4; @interface RCTSource () { @public @@ -47,12 +35,18 @@ @implementation RCTSource static RCTSource *RCTSourceCreate(NSURL *url, NSData *data, int64_t length) NS_RETURNS_RETAINED { + using facebook::react::ScriptTag; + facebook::react::BundleHeader header; + [data getBytes:&header length:sizeof(header)]; + RCTSource *source = [RCTSource new]; source->_url = url; // Multipart responses may give us an unaligned view into the buffer. This ensures memory is aligned. - source->_data = (RCTIsBytecodeBundle(data) && ((long)[data bytes] % RCT_BYTECODE_ALIGNMENT)) - ? [[NSData alloc] initWithData:data] - : data; + if (parseTypeFromHeader(header) == ScriptTag::MetroHBCBundle && ((long)[data bytes] % RCT_BYTECODE_ALIGNMENT)) { + source->_data = [[NSData alloc] initWithData:data]; + } else { + source->_data = data; + } source->_length = length; source->_filesChangedCount = RCTSourceFilesChangedCountNotBuiltByBundler; return source; @@ -177,7 +171,7 @@ + (NSData *)attemptSynchronousLoadOfBundleAtURL:(NSURL *)scriptURL facebook::react::ScriptTag tag = facebook::react::parseTypeFromHeader(header); switch (tag) { - case facebook::react::ScriptTag::HBCBundle: + case facebook::react::ScriptTag::MetroHBCBundle: case facebook::react::ScriptTag::RAMBundle: break; diff --git a/React/CxxBridge/RCTCxxBridge.mm b/React/CxxBridge/RCTCxxBridge.mm index e3b4ac19ff543b..2454980a9bbbc0 100644 --- a/React/CxxBridge/RCTCxxBridge.mm +++ b/React/CxxBridge/RCTCxxBridge.mm @@ -113,13 +113,6 @@ int32_t getUniqueId() } -static bool isRAMBundle(NSData *script) -{ - BundleHeader header; - [script getBytes:&header length:sizeof(header)]; - return parseTypeFromHeader(header) == ScriptTag::RAMBundle; -} - static void notifyAboutModuleSetup(RCTPerformanceLogger *performanceLogger, const char *tag) { NSString *moduleName = [[NSString alloc] initWithUTF8String:tag]; @@ -1498,6 +1491,11 @@ - (void)executeApplicationScriptSync:(NSData *)script url:(NSURL *)url [self executeApplicationScript:script url:url async:NO]; } +static uint32_t RCTReadUInt32LE(NSData *script, uint32_t offset) +{ + return [script length] < offset + 4 ? 0 : CFSwapInt32LittleToHost(*(((uint32_t *)[script bytes]) + offset / 4)); +} + - (void)executeApplicationScript:(NSData *)script url:(NSURL *)url async:(BOOL)async { [self _tryAndHandleError:^{ @@ -1506,18 +1504,22 @@ - (void)executeApplicationScript:(NSData *)script url:(NSURL *)url async:(BOOL)a object:self->_parentBridge userInfo:@{@"bridge" : self}]; + BundleHeader header; + [script getBytes:&header length:sizeof(header)]; + ScriptTag scriptType = parseTypeFromHeader(header); + // hold a local reference to reactInstance in case a parallel thread // resets it between null check and usage auto reactInstance = self->_reactInstance; - if (reactInstance && RCTIsBytecodeBundle(script)) { - UInt32 offset = 8; + if (reactInstance && scriptType == ScriptTag::MetroHBCBundle) { + uint32_t offset = 8; while (offset < script.length) { - UInt32 fileLength = RCTReadUInt32LE(script, offset); + uint32_t fileLength = RCTReadUInt32LE(script, offset); NSData *unit = [script subdataWithRange:NSMakeRange(offset + 4, fileLength)]; reactInstance->loadScriptFromString(std::make_unique(unit), sourceUrlStr.UTF8String, false); offset += ((fileLength + RCT_BYTECODE_ALIGNMENT - 1) & ~(RCT_BYTECODE_ALIGNMENT - 1)) + 4; } - } else if (isRAMBundle(script)) { + } else if (scriptType == ScriptTag::RAMBundle) { [self->_performanceLogger markStartForTag:RCTPLRAMBundleLoad]; auto ramBundle = std::make_unique(sourceUrlStr.UTF8String); std::unique_ptr scriptStr = ramBundle->getStartupCode(); diff --git a/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.cpp b/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.cpp index 18abeb88b2f1ea..9f017d082e4684 100644 --- a/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.cpp +++ b/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.cpp @@ -276,7 +276,7 @@ void CatalystInstanceImpl::jniLoadScriptFromFile( const std::string &sourceURL, bool loadSynchronously) { auto reactInstance = instance_; - if (reactInstance && Instance::isHBCBundle(fileName.c_str())) { + if (reactInstance && Instance::isMetroHBCBundle(fileName.c_str())) { std::unique_ptr script; RecoverableError::runRethrowingAsRecoverable( [&fileName, &script]() { diff --git a/ReactAndroid/src/main/jni/react/jni/JSLoader.cpp b/ReactAndroid/src/main/jni/react/jni/JSLoader.cpp index 16fcc43d4fa581..dc87d09bac8ff2 100644 --- a/ReactAndroid/src/main/jni/react/jni/JSLoader.cpp +++ b/ReactAndroid/src/main/jni/react/jni/JSLoader.cpp @@ -77,7 +77,7 @@ loadScriptFromAssets(AAssetManager *manager, const std::string &assetName) { // script to ensure we have a terminator. const BundleHeader *header = reinterpret_cast(script->c_str()); - if (parseTypeFromHeader(*header) == ScriptTag::HBCBundle) { + if (isHermesBytecodeBundle(*header)) { return script; } } diff --git a/ReactCommon/cxxreact/Instance.cpp b/ReactCommon/cxxreact/Instance.cpp index a48d5930ecfe73..85993f43a936cd 100644 --- a/ReactCommon/cxxreact/Instance.cpp +++ b/ReactCommon/cxxreact/Instance.cpp @@ -109,7 +109,7 @@ void Instance::loadScriptFromString( } } -bool Instance::isHBCBundle(const char *sourcePath) { +bool Instance::isMetroHBCBundle(const char *sourcePath) { std::ifstream bundle_stream(sourcePath, std::ios_base::in); BundleHeader header; @@ -118,7 +118,7 @@ bool Instance::isHBCBundle(const char *sourcePath) { return false; } - return parseTypeFromHeader(header) == ScriptTag::HBCBundle; + return parseTypeFromHeader(header) == ScriptTag::MetroHBCBundle; } bool Instance::isIndexedRAMBundle(const char *sourcePath) { diff --git a/ReactCommon/cxxreact/Instance.h b/ReactCommon/cxxreact/Instance.h index 8b2263679a0523..1b125d37f4b08c 100644 --- a/ReactCommon/cxxreact/Instance.h +++ b/ReactCommon/cxxreact/Instance.h @@ -56,7 +56,7 @@ class RN_EXPORT Instance { std::unique_ptr string, std::string sourceURL, bool loadSynchronously); - static bool isHBCBundle(const char *sourcePath); + static bool isMetroHBCBundle(const char *sourcePath); static bool isIndexedRAMBundle(const char *sourcePath); static bool isIndexedRAMBundle(std::unique_ptr *string); void loadRAMBundleFromString( diff --git a/ReactCommon/cxxreact/JSBundleType.cpp b/ReactCommon/cxxreact/JSBundleType.cpp index 8a7c38af9c22c8..036397c811356f 100644 --- a/ReactCommon/cxxreact/JSBundleType.cpp +++ b/ReactCommon/cxxreact/JSBundleType.cpp @@ -7,20 +7,21 @@ #include "JSBundleType.h" -#include - namespace facebook { namespace react { static uint32_t constexpr RAMBundleMagicNumber = 0xFB0BD1E5; -static uint32_t constexpr HBCBundleMagicNumber = 0xffe7c3c3; +static uint32_t constexpr MetroHBCBundleMagicNumber = 0xFFE7C3C3; + +// "Hermes" in ancient Greek encoded in UTF-16BE and truncated to 8 bytes. +static uint64_t constexpr HermesBCBundleMagicNumber = 0x1F1903C103BC1FC6; ScriptTag parseTypeFromHeader(const BundleHeader &header) { - switch (folly::Endian::little(header.magic)) { + switch (header.magic32.value) { case RAMBundleMagicNumber: return ScriptTag::RAMBundle; - case HBCBundleMagicNumber: - return ScriptTag::HBCBundle; + case MetroHBCBundleMagicNumber: + return ScriptTag::MetroHBCBundle; default: return ScriptTag::String; } @@ -32,11 +33,15 @@ const char *stringForScriptTag(const ScriptTag &tag) { return "String"; case ScriptTag::RAMBundle: return "RAM Bundle"; - case ScriptTag::HBCBundle: - return "HBC Bundle"; + case ScriptTag::MetroHBCBundle: + return "Metro Hermes Bytecode Bundle"; } return ""; } +bool isHermesBytecodeBundle(const BundleHeader &header) { + return header.magic64 == HermesBCBundleMagicNumber; +} + } // namespace react } // namespace facebook diff --git a/ReactCommon/cxxreact/JSBundleType.h b/ReactCommon/cxxreact/JSBundleType.h index f6c0d7a3fbb2d5..a9cdbc806a78dc 100644 --- a/ReactCommon/cxxreact/JSBundleType.h +++ b/ReactCommon/cxxreact/JSBundleType.h @@ -19,20 +19,18 @@ namespace facebook { namespace react { /* - * ScriptTag - * * Scripts given to the JS Executors to run could be in any of the following * formats. They are tagged so the executor knows how to run them. + * Hermes bytecode bundles (as encoded by hermesc, not metro) are not treated + * in a special way, they will be identified as ScriptTag::String. */ enum struct ScriptTag { String = 0, RAMBundle, - HBCBundle, + MetroHBCBundle, }; /** - * BundleHeader - * * RAM bundles and BC bundles begin with headers. For RAM bundles this is * 4 bytes, for BC bundles this is 12 bytes. This structure holds the first 12 * bytes from a bundle in a way that gives access to that information. @@ -43,27 +41,33 @@ struct FOLLY_PACK_ATTR BundleHeader { std::memset(this, 0, sizeof(BundleHeader)); } - uint32_t magic; - uint32_t reserved_; + union { + struct { + uint32_t value; + uint32_t reserved_; + } magic32; + uint64_t magic64; + }; uint32_t version; }; FOLLY_PACK_POP /** - * parseTypeFromHeader - * * Takes the first 8 bytes of a bundle, and returns a tag describing the * bundle's format. */ RN_EXPORT ScriptTag parseTypeFromHeader(const BundleHeader &header); /** - * stringForScriptTag - * * Convert an `ScriptTag` enum into a string, useful for emitting in errors * and diagnostic messages. */ RN_EXPORT const char *stringForScriptTag(const ScriptTag &tag); +/** + * Check whether a given bundle is hermesc-generated bytecode + */ +RN_EXPORT bool isHermesBytecodeBundle(const BundleHeader &header); + } // namespace react } // namespace facebook From 6c9de5543e2b19911ca2aa9f4247884706d32fbe Mon Sep 17 00:00:00 2001 From: Pieter De Baets Date: Tue, 15 Mar 2022 05:58:52 -0700 Subject: [PATCH 18/48] Cleanup ScriptTag helpers on Instance Summary: We were opening the file multiple times just to read the same couple of bytes. Changelog: [Internal] Reviewed By: motiz88 Differential Revision: D34835972 fbshipit-source-id: 9de899f37a9193db4ab72e69e02e8d41e5515da0 --- .../jni/react/jni/CatalystInstanceImpl.cpp | 95 ++++++++++++------- ReactCommon/cxxreact/Instance.cpp | 35 ------- ReactCommon/cxxreact/Instance.h | 3 - 3 files changed, 63 insertions(+), 70 deletions(-) diff --git a/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.cpp b/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.cpp index 9f017d082e4684..61911ce6e35120 100644 --- a/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.cpp +++ b/ReactAndroid/src/main/jni/react/jni/CatalystInstanceImpl.cpp @@ -8,6 +8,7 @@ #include "CatalystInstanceImpl.h" #include +#include #include #include #include @@ -248,6 +249,26 @@ void CatalystInstanceImpl::jniRegisterSegment( instance_->registerBundle((uint32_t)segmentId, path); } +static ScriptTag getScriptTagFromFile(const char *sourcePath) { + std::ifstream bundle_stream(sourcePath, std::ios_base::in); + BundleHeader header; + if (bundle_stream && + bundle_stream.read(reinterpret_cast(&header), sizeof(header))) { + return parseTypeFromHeader(header); + } else { + return ScriptTag::String; + } +} + +static bool isIndexedRAMBundle(std::unique_ptr *script) { + BundleHeader header; + strncpy( + reinterpret_cast(&header), + script->get()->c_str(), + sizeof(header)); + return parseTypeFromHeader(header) == ScriptTag::RAMBundle; +} + void CatalystInstanceImpl::jniLoadScriptFromAssets( jni::alias_ref assetManager, const std::string &assetURL, @@ -263,7 +284,7 @@ void CatalystInstanceImpl::jniLoadScriptFromAssets( instance_->loadRAMBundle( std::move(registry), std::move(script), sourceURL, loadSynchronously); return; - } else if (Instance::isIndexedRAMBundle(&script)) { + } else if (isIndexedRAMBundle(&script)) { instance_->loadRAMBundleFromString(std::move(script), sourceURL); } else { instance_->loadScriptFromString( @@ -276,38 +297,48 @@ void CatalystInstanceImpl::jniLoadScriptFromFile( const std::string &sourceURL, bool loadSynchronously) { auto reactInstance = instance_; - if (reactInstance && Instance::isMetroHBCBundle(fileName.c_str())) { - std::unique_ptr script; - RecoverableError::runRethrowingAsRecoverable( - [&fileName, &script]() { - script = JSBigFileString::fromPath(fileName); - }); - const char *buffer = script->c_str(); - uint32_t bufferLength = (uint32_t)script->size(); - uint32_t offset = 8; - while (offset < bufferLength) { - uint32_t segment = offset + 4; - uint32_t moduleLength = - bufferLength < segment ? 0 : *(((uint32_t *)buffer) + offset / 4); - - reactInstance->loadScriptFromString( - std::make_unique( - std::string(buffer + segment, buffer + moduleLength + segment)), - sourceURL, - false); - - offset += ((moduleLength + 3) & ~3) + 4; + if (!reactInstance) { + return; + } + + switch (getScriptTagFromFile(fileName.c_str())) { + case ScriptTag::MetroHBCBundle: { + std::unique_ptr script; + RecoverableError::runRethrowingAsRecoverable( + [&fileName, &script]() { + script = JSBigFileString::fromPath(fileName); + }); + const char *buffer = script->c_str(); + uint32_t bufferLength = (uint32_t)script->size(); + uint32_t offset = 8; + while (offset < bufferLength) { + uint32_t segment = offset + 4; + uint32_t moduleLength = + bufferLength < segment ? 0 : *(((uint32_t *)buffer) + offset / 4); + + reactInstance->loadScriptFromString( + std::make_unique( + std::string(buffer + segment, buffer + moduleLength + segment)), + sourceURL, + false); + + offset += ((moduleLength + 3) & ~3) + 4; + } + break; + } + case ScriptTag::RAMBundle: + instance_->loadRAMBundleFromFile(fileName, sourceURL, loadSynchronously); + break; + case ScriptTag::String: + default: { + std::unique_ptr script; + RecoverableError::runRethrowingAsRecoverable( + [&fileName, &script]() { + script = JSBigFileString::fromPath(fileName); + }); + instance_->loadScriptFromString( + std::move(script), sourceURL, loadSynchronously); } - } else if (Instance::isIndexedRAMBundle(fileName.c_str())) { - instance_->loadRAMBundleFromFile(fileName, sourceURL, loadSynchronously); - } else { - std::unique_ptr script; - RecoverableError::runRethrowingAsRecoverable( - [&fileName, &script]() { - script = JSBigFileString::fromPath(fileName); - }); - instance_->loadScriptFromString( - std::move(script), sourceURL, loadSynchronously); } } diff --git a/ReactCommon/cxxreact/Instance.cpp b/ReactCommon/cxxreact/Instance.cpp index 85993f43a936cd..71bb1512be2865 100644 --- a/ReactCommon/cxxreact/Instance.cpp +++ b/ReactCommon/cxxreact/Instance.cpp @@ -26,7 +26,6 @@ #include #include -#include #include #include #include @@ -109,40 +108,6 @@ void Instance::loadScriptFromString( } } -bool Instance::isMetroHBCBundle(const char *sourcePath) { - std::ifstream bundle_stream(sourcePath, std::ios_base::in); - BundleHeader header; - - if (!bundle_stream || - !bundle_stream.read(reinterpret_cast(&header), sizeof(header))) { - return false; - } - - return parseTypeFromHeader(header) == ScriptTag::MetroHBCBundle; -} - -bool Instance::isIndexedRAMBundle(const char *sourcePath) { - std::ifstream bundle_stream(sourcePath, std::ios_base::in); - BundleHeader header; - - if (!bundle_stream || - !bundle_stream.read(reinterpret_cast(&header), sizeof(header))) { - return false; - } - - return parseTypeFromHeader(header) == ScriptTag::RAMBundle; -} - -bool Instance::isIndexedRAMBundle(std::unique_ptr *script) { - BundleHeader header; - strncpy( - reinterpret_cast(&header), - script->get()->c_str(), - sizeof(header)); - - return parseTypeFromHeader(header) == ScriptTag::RAMBundle; -} - void Instance::loadRAMBundleFromString( std::unique_ptr script, const std::string &sourceURL) { diff --git a/ReactCommon/cxxreact/Instance.h b/ReactCommon/cxxreact/Instance.h index 1b125d37f4b08c..12bfd86d7b4b7a 100644 --- a/ReactCommon/cxxreact/Instance.h +++ b/ReactCommon/cxxreact/Instance.h @@ -56,9 +56,6 @@ class RN_EXPORT Instance { std::unique_ptr string, std::string sourceURL, bool loadSynchronously); - static bool isMetroHBCBundle(const char *sourcePath); - static bool isIndexedRAMBundle(const char *sourcePath); - static bool isIndexedRAMBundle(std::unique_ptr *string); void loadRAMBundleFromString( std::unique_ptr script, const std::string &sourceURL); From 68fde3b35b9ac10e8d124fc079150d52438ba6c7 Mon Sep 17 00:00:00 2001 From: Nicola Corti Date: Tue, 15 Mar 2022 06:29:25 -0700 Subject: [PATCH 19/48] Allow to override Hermes source location with REACT_NATIVE_OVERRIDE_HERMES_DIR Summary: This commit allows to specify a custom location for Hermes sources with the `REACT_NATIVE_OVERRIDE_HERMES_DIR` environment variable. This can be useful during local development if you wish to build against a local clone of facebook/hermes. Changelog: [Internal] [Changed] - Allow to override Hermes source location with REACT_NATIVE_OVERRIDE_HERMES_DIR Reviewed By: ShikaSD Differential Revision: D34858893 fbshipit-source-id: 4fad3d1c8e99f1f1880b5633e596b67f5dfcc264 --- ReactAndroid/hermes-engine/build.gradle | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/ReactAndroid/hermes-engine/build.gradle b/ReactAndroid/hermes-engine/build.gradle index b4adb9fb4b6e3f..8bdac48858aa03 100644 --- a/ReactAndroid/hermes-engine/build.gradle +++ b/ReactAndroid/hermes-engine/build.gradle @@ -15,7 +15,12 @@ plugins { def customDownloadDir = System.getenv("REACT_NATIVE_DOWNLOADS_DIR") def downloadsDir = customDownloadDir ? new File(customDownloadDir) : rootProject.file("sdks/download") -def hermesDir = rootProject.file("sdks/hermes") + +// By default we are going to download and unzip hermes inside the /sdks/hermes folder +// but you can provide an override for where the hermes source code is located. +def overrideHermesDir = System.getenv("REACT_NATIVE_OVERRIDE_HERMES_DIR") != null +def hermesDir = System.getenv("REACT_NATIVE_OVERRIDE_HERMES_DIR") ?: rootProject.file("sdks/hermes") + def hermesVersion = "main" def hermesVersionFile = rootProject.file("sdks/.hermesversion") if (hermesVersionFile.exists()) { @@ -38,11 +43,6 @@ task downloadHermes(type: Download) { dest(new File(downloadsDir, "hermes.tar.gz")) } -// This task is called by the CI to download all the extrenal source code tarballs. -task downloadNdkBuildDependencies() { - dependsOn(downloadHermes) -} - task installArchives { dependsOn("publishAllPublicationsToNpmRepository") } @@ -60,8 +60,7 @@ task unzipHermes(dependsOn: downloadHermes, type: Copy) { into(hermesDir) } - -task configureNinjaForHermes(dependsOn: unzipHermes, type: Exec) { +task configureNinjaForHermes(type: Exec) { workingDir(hermesDir) commandLine(windowsAwareCommandLine( "python3", @@ -77,7 +76,7 @@ task buildNinjaForHermes(dependsOn: configureNinjaForHermes, type: Exec) { commandLine(windowsAwareCommandLine("cmake", "--build", "./ninja_build", "--target", "hermesc", "-j", ndkBuildJobs)) } -task prepareHeadersForPrefab(dependsOn: unzipHermes, type: Copy) { +task prepareHeadersForPrefab(type: Copy) { from("$hermesDir/API") from("$hermesDir/public") include("**/*.h") @@ -208,6 +207,12 @@ android { } afterEvaluate { + if (!overrideHermesDir) { + // If you're not specifying a Hermes Path override, we want to + // download/unzip Hermes from Github then. + configureNinjaForHermes.dependsOn(unzipHermes) + prepareHeadersForPrefab.dependsOn(unzipHermes) + } preBuild.dependsOn(buildNinjaForHermes) preBuild.dependsOn(prepareHeadersForPrefab) // Needed as some of the native sources needs to be downloaded From 21dd646ecaf4f17cc62f18a4abf2f9cb88a72881 Mon Sep 17 00:00:00 2001 From: Nicola Corti Date: Tue, 15 Mar 2022 06:39:40 -0700 Subject: [PATCH 20/48] Reduce flakyness of `configureNdkBuild*` tasks by setting an explicit dependency on prefab. Summary: I've noticed that `test_android` and the Test Android Docker image jobs fails sometime with a missing `libhermes.so` file. That is happening because the `configureNdkBuild*` tasks are executing before the prefab for Hermes is ready. I'm adding an explicit dependency here that will prevent this kind of situations from happening. Changelog: [Internal] [Changed] - Reduce flakyness of `configureNdkBuild*` tasks by setting an explicit dependency on prefab. Reviewed By: ShikaSD Differential Revision: D34859961 fbshipit-source-id: e4dc4b22c808359018ec952287b2d8a7094f0698 --- ReactAndroid/build.gradle | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ReactAndroid/build.gradle b/ReactAndroid/build.gradle index 14aa4aea77c522..74905166f095e5 100644 --- a/ReactAndroid/build.gradle +++ b/ReactAndroid/build.gradle @@ -420,6 +420,16 @@ afterEvaluate { configureNdkBuildDebug.dependsOn(preBuild) configureNdkBuildRelease.dependsOn(preBuild) + // As we're consuming Hermes via Prefab, we're using the AGP C++ reference feature + // which is supposed to work for CMake only, we need to introduce an explicit dependency + // on publishing libraries prefab tasks. + // See https://developer.android.com/studio/releases/gradle-plugin?buildsystem=ndk-build#cpp-references. + // If we don't do this, the `configureNdkBuild*` is flaky and fails if the `prefabDebugPackage` + // is not yet executed. + // This can be safely removed once we move to CMake or once AGP supports C++ references on ndk-build. + configureNdkBuildDebug.dependsOn(":ReactAndroid:hermes-engine:prefabDebugPackage") + configureNdkBuildRelease.dependsOn(":ReactAndroid:hermes-engine:prefabReleasePackage") + publishing { publications { release(MavenPublication) { From f001d091b1fb3f56d028d6e2f0314e20aec1159e Mon Sep 17 00:00:00 2001 From: Ken Tominaga Date: Tue, 15 Mar 2022 07:10:21 -0700 Subject: [PATCH 21/48] Add scripts to debug the `rn-tester` project easier (#33386) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Summary: This pull request simplifies and makes it easy to debug the `rn-tester` project and switch configurations within the project. - `yarn start` : Start packager - `yarn install-android-jsc` : Build with `installJscDebug`. - `yarn install-android-hermes` : Build with `installHermesDebug`. - `yarn clean-android` : Clean up the Android build files. - `yarn setup-ios-jsc` : Install dependencies to use JSC. - `yarn setup-ios-hermes` : Install dependencies to use Hermes. - `yarn clean-ios` : Clean up the build files and Pods. ## Changelog [iOS] [Changed] - Add scripts to debug `rn-tester` easier Pull Request resolved: https://github.com/facebook/react-native/pull/33386 Test Plan:
Log

```sh // packages/rn-tester $ yarn setup-ios-jsc yarn run v1.22.17 $ yarn install && bundle install && bundle exec pod install [1/5] 🔍 Validating package.json... [2/5] 🔍 Resolving packages... success Already up-to-date. Using rexml 3.2.5 Using CFPropertyList 3.0.5 Using concurrent-ruby 1.1.9 Using i18n 1.9.1 Using minitest 5.15.0 Using tzinfo 2.0.4 Using zeitwerk 2.5.4 Using activesupport 6.1.4.4 Using public_suffix 4.0.6 Using addressable 2.8.0 Using httpclient 2.8.3 Using json 2.6.1 Using algoliasearch 1.27.5 Using atomos 0.1.3 Using bundler 2.1.4 Using claide 1.1.0 Using fuzzy_match 2.0.4 Using nap 1.1.0 Using netrc 0.11.0 Using ffi 1.15.5 Using ethon 0.15.0 Using typhoeus 1.4.0 Using cocoapods-core 1.11.2 Using cocoapods-deintegrate 1.0.5 Using cocoapods-downloader 1.5.1 Using cocoapods-plugins 1.0.0 Using cocoapods-search 1.0.1 Using cocoapods-trunk 1.6.0 Using cocoapods-try 1.2.0 Using colored2 3.1.2 Using escape 0.0.4 Using fourflusher 2.3.1 Using gh_inspector 1.1.3 Using molinillo 0.8.0 Using ruby-macho 2.5.1 Using nanaimo 0.3.0 Using xcodeproj 1.21.0 Using cocoapods 1.11.2 Bundle complete! 2 Gemfile dependencies, 38 gems now installed. Use `bundle info [gemname]` to see where a bundled gem is installed. Building RNTester with Fabric enabled. [Codegen] Generating ./build/generated/ios/React-Codegen.podspec.json [Codegen] generating an empty RCTThirdPartyFabricComponentsProvider Building RNTester with Fabric enabled. [Codegen] Skipping React-Codegen podspec generation. [Codegen] generating an empty RCTThirdPartyFabricComponentsProvider Building RNTester with Fabric enabled. [Codegen] Skipping React-Codegen podspec generation. [Codegen] generating an empty RCTThirdPartyFabricComponentsProvider Analyzing dependencies [Codegen] Found FBReactNativeSpec [Codegen] Found rncore [Codegen] Found ScreenshotmanagerSpec Downloading dependencies Installing FBLazyVector 1000.0.0 Installing FBReactNativeSpec 1000.0.0 Installing RCTRequired 1000.0.0 Installing RCTTypeSafety 1000.0.0 Installing React 1000.0.0 Installing React-Core 1000.0.0 Installing React-CoreModules 1000.0.0 Installing React-Fabric 1000.0.0 Installing React-RCTActionSheet 1000.0.0 Installing React-RCTAnimation 1000.0.0 Installing React-RCTBlob 1000.0.0 Installing React-RCTFabric 1000.0.0 Installing React-RCTImage 1000.0.0 Installing React-RCTLinking 1000.0.0 Installing React-RCTNetwork 1000.0.0 Installing React-RCTPushNotification 1000.0.0 Installing React-RCTSettings 1000.0.0 Installing React-RCTTest 1000.0.0 Installing React-RCTText 1000.0.0 Installing React-RCTVibration 1000.0.0 Installing React-callinvoker 1000.0.0 Installing React-cxxreact 1000.0.0 Installing React-graphics 1000.0.0 Installing React-jsi 1000.0.0 Installing React-jsiexecutor 1000.0.0 Installing React-jsinspector 1000.0.0 Installing React-logger 1000.0.0 Installing React-perflogger 1000.0.0 Installing React-rncore 1000.0.0 Installing React-runtimeexecutor 1000.0.0 Installing ReactCommon 1000.0.0 Installing Yoga 1.14.0 Generating Pods project [DEDUCTED]/react-native/packages/rn-tester/Pods/Target Support Files/Pods-RNTester/Pods-RNTester.release.xcconfig [DEDUCTED]/react-native/packages/rn-tester/Pods/Target Support Files/Pods-RNTester/Pods-RNTester.debug.xcconfig [DEDUCTED]/react-native/packages/rn-tester/Pods/Target Support Files/Pods-RNTesterUnitTests/Pods-RNTesterUnitTests.release.xcconfig [DEDUCTED]/react-native/packages/rn-tester/Pods/Target Support Files/Pods-RNTesterUnitTests/Pods-RNTesterUnitTests.debug.xcconfig [DEDUCTED]/react-native/packages/rn-tester/Pods/Target Support Files/Pods-RNTesterIntegrationTests/Pods-RNTesterIntegrationTests.release.xcconfig [DEDUCTED]/react-native/packages/rn-tester/Pods/Target Support Files/Pods-RNTesterIntegrationTests/Pods-RNTesterIntegrationTests.debug.xcconfig React-Core Integrating client project Pod installation complete! There are 65 dependencies from the Podfile and 53 total pods installed. ✨ Done in 8.68s. ```

Reviewed By: ShikaSD Differential Revision: D34835086 Pulled By: cortinico fbshipit-source-id: 83649f42e8ac77efd8617601e18f15bfcf8f1f61 --- packages/rn-tester/README.md | 18 ++++++++---------- packages/rn-tester/package.json | 9 +++++++++ 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/packages/rn-tester/README.md b/packages/rn-tester/README.md index 9b82278a78d5b1..0d6cde160105c9 100644 --- a/packages/rn-tester/README.md +++ b/packages/rn-tester/README.md @@ -12,7 +12,7 @@ Before running the app, make sure you ran: ### Running on iOS -If you are testing non-fabric component, modify [the fabric_enabled flag in RNTester's Podfile](https://github.com/facebook/react-native/blob/main/packages/rn-tester/Podfile#L21). +If you are testing non-fabric component, modify [the fabric_enabled flag in RNTester's Podfile](https://github.com/facebook/react-native/blob/main/packages/rn-tester/Podfile#L24). ```ruby fabric_enabled = false @@ -21,10 +21,8 @@ fabric_enabled = false Also, if you previously built RNTester with fabric enabled, you might need to clean up the build files and Pods. ```sh # Clean the generated files and folders to clean install RNTester -cd packages/rn-tester/ -rm -rf build/generated/ios -rm -rf Pods -rm Podfile.lock +cd packages/rn-tester +yarn clean-ios ``` If you are still having a problem after doing the clean up (which can happen if you have built RNTester with older React Native versions where files were generated inside the react-native folder.), the best way might be to clean-install react-native (e.g. remove node_modules and yarn install). @@ -32,7 +30,7 @@ If you are still having a problem after doing the clean up (which can happen if Both macOS and Xcode are required. 1. `cd packages/rn-tester` 1. Install [Bundler](https://bundler.io/): `gem install bundler`. We use bundler to install the right version of [CocoaPods](https://cocoapods.org/) locally. -1. Install Bundler and CocoaPods dependencies: `bundle install && bundle exec pod install`. In order to use Hermes engine instead of JSC, run: `USE_HERMES=1 bundle exec pod install` instead. +1. Install Bundler and CocoaPods dependencies: `bundle install && bundle exec pod install` or `yarn setup-ios-jsc`. In order to use Hermes engine instead of JSC, run: `USE_HERMES=1 bundle exec pod install` or `yarn setup-ios-hermes` instead. 1. Open the generated `RNTesterPods.xcworkspace`. This is not checked in, as it is generated by CocoaPods. Do not open `RNTesterPods.xcodeproj` directly. #### Note for M1 users @@ -48,10 +46,10 @@ You'll need to have all the [prerequisites](https://github.com/facebook/react-na Start an Android emulator. ```sh -cd react-native -# In order to use Hermes engine, run `installHermesDebug` instead. -./gradlew :packages:rn-tester:android:app:installJscDebug -./scripts/packager.sh +cd packages/rn-tester +# In order to use Hermes engine, run `yarn install-android-hermes` instead. +yarn install-android-jsc +yarn start ``` _Note: Building for the first time can take a while._ diff --git a/packages/rn-tester/package.json b/packages/rn-tester/package.json index a6f1c371f113f7..8f4605839d9817 100644 --- a/packages/rn-tester/package.json +++ b/packages/rn-tester/package.json @@ -9,6 +9,15 @@ "url": "git@github.com:facebook/react-native.git", "directory": "packages/rn-tester" }, + "scripts": { + "start": "../../scripts/packager.sh", + "install-android-jsc": "../../gradlew :packages:rn-tester:android:app:installJscDebug", + "install-android-hermes": "../../gradlew :packages:rn-tester:android:app:installHermesDebug", + "clean-android": "rm -rf android/app/build", + "setup-ios-jsc": "bundle install && bundle exec pod install", + "setup-ios-hermes": "bundle install && USE_HERMES=1 bundle exec pod install", + "clean-ios": "rm -rf build/generated/ios && rm -rf Pods && rm Podfile.lock" + }, "dependencies": { "invariant": "^2.2.4", "nullthrows": "^1.1.1" From 0d2ee7c17c6d967fc97ea8d35d4133333220c5de Mon Sep 17 00:00:00 2001 From: Nicola Corti Date: Tue, 15 Mar 2022 08:14:07 -0700 Subject: [PATCH 22/48] Re-apply main changes to CMake files Summary: This Diff re-applies some of the changes that landed on main to the CMake files we currently landed so far. Changelog: [Internal] [Changed] - Re-apply main changes to CMake files Reviewed By: ShikaSD Differential Revision: D34859685 fbshipit-source-id: 772a3aed05f56b6fbb2942bf9d1a5bd4581b48d5 --- ReactCommon/react/bridging/CMakeLists.txt | 17 +++++++++++++++++ .../react/nativemodule/core/CMakeLists.txt | 1 + ReactCommon/react/utils/CMakeLists.txt | 3 +-- 3 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 ReactCommon/react/bridging/CMakeLists.txt diff --git a/ReactCommon/react/bridging/CMakeLists.txt b/ReactCommon/react/bridging/CMakeLists.txt new file mode 100644 index 00000000000000..88d3aba2fae641 --- /dev/null +++ b/ReactCommon/react/bridging/CMakeLists.txt @@ -0,0 +1,17 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# +# This source code is licensed under the MIT license found in the +# LICENSE file in the root directory of this source tree. + +cmake_minimum_required(VERSION 3.13) +set(CMAKE_VERBOSE_MAKEFILE on) + +add_compile_options(-fexceptions -frtti -std=c++17 -Wall -DLOG_TAG=\"ReactNative\") + +file(GLOB react_bridging_SRC CONFIGURE_DEPENDS *.cpp) + +add_library(react_bridging STATIC ${react_bridging_SRC}) + +target_include_directories(react_bridging PUBLIC ${REACT_COMMON_DIR}) + +target_link_libraries(react_bridging jsi) diff --git a/ReactCommon/react/nativemodule/core/CMakeLists.txt b/ReactCommon/react/nativemodule/core/CMakeLists.txt index 1239bb17712509..844e3493a2287c 100644 --- a/ReactCommon/react/nativemodule/core/CMakeLists.txt +++ b/ReactCommon/react/nativemodule/core/CMakeLists.txt @@ -26,6 +26,7 @@ target_link_libraries(react_nativemodule_core fbjni folly_json jsi + react_bridging react_debug reactperflogger reactnativejni) diff --git a/ReactCommon/react/utils/CMakeLists.txt b/ReactCommon/react/utils/CMakeLists.txt index 8462de422a0ea4..335ebf9c365e76 100644 --- a/ReactCommon/react/utils/CMakeLists.txt +++ b/ReactCommon/react/utils/CMakeLists.txt @@ -21,5 +21,4 @@ target_include_directories(react_utils PUBLIC ${REACT_COMMON_DIR}) target_link_libraries(react_utils glog glog_init - react_debug - react_render_mapbuffer) + react_debug) From 5d560ca99ff7220de11d2d76dbe77d73990894a8 Mon Sep 17 00:00:00 2001 From: Krisztiaan Date: Tue, 15 Mar 2022 09:24:22 -0700 Subject: [PATCH 23/48] fix: `cliPath` should handle absolute paths (#32983) Summary: Avoid breaking tools relying on absolute path for `cliPath` ## Changelog [Android] [Fixed] - Enable cliPath to have an absolute path value Pull Request resolved: https://github.com/facebook/react-native/pull/32983 Test Plan: declare `cliPath` from `expo`: ```groovy cliPath: new File(["node", "--print", "require.resolve('react-native/package.json')"].execute(null, rootDir).text.trim()).getParentFile().getAbsolutePath() + "/cli.js", ``` and run an android build Reviewed By: ShikaSD Differential Revision: D33843275 Pulled By: cortinico fbshipit-source-id: 65f55a5e07a4ec0a6205d5f06f150377708c30cc --- .../com/facebook/react/utils/PathUtils.kt | 18 ++++++- .../com/facebook/react/utils/PathUtilsTest.kt | 41 +++++++++++++- react.gradle | 53 +++++++++++++------ 3 files changed, 93 insertions(+), 19 deletions(-) diff --git a/packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/utils/PathUtils.kt b/packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/utils/PathUtils.kt index 302c1d83a7b412..d485aa69bdf424 100644 --- a/packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/utils/PathUtils.kt +++ b/packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/utils/PathUtils.kt @@ -67,7 +67,18 @@ private fun detectCliPath( ): String { // 1. preconfigured path if (preconfiguredCliPath != null) { - return File(projectDir, preconfiguredCliPath).toString() + val preconfiguredCliJsAbsolute = File(preconfiguredCliPath) + if (preconfiguredCliJsAbsolute.exists()) { + return preconfiguredCliJsAbsolute.absolutePath + } + val preconfiguredCliJsRelativeToReactRoot = File(reactRoot, preconfiguredCliPath) + if (preconfiguredCliJsRelativeToReactRoot.exists()) { + return preconfiguredCliJsRelativeToReactRoot.absolutePath + } + val preconfiguredCliJsRelativeToProject = File(projectDir, preconfiguredCliPath) + if (preconfiguredCliJsRelativeToProject.exists()) { + return preconfiguredCliJsRelativeToProject.absolutePath + } } // 2. node module path @@ -81,7 +92,10 @@ private fun detectCliPath( val nodeProcessOutput = nodeProcess.inputStream.use { it.bufferedReader().readText().trim() } if (nodeProcessOutput.isNotEmpty()) { - return nodeProcessOutput + val nodeModuleCliJs = File(nodeProcessOutput) + if (nodeModuleCliJs.exists()) { + return nodeModuleCliJs.absolutePath + } } // 3. cli.js in the root folder diff --git a/packages/react-native-gradle-plugin/src/test/kotlin/com/facebook/react/utils/PathUtilsTest.kt b/packages/react-native-gradle-plugin/src/test/kotlin/com/facebook/react/utils/PathUtilsTest.kt index debba45740b3b0..0c9d3669079059 100644 --- a/packages/react-native-gradle-plugin/src/test/kotlin/com/facebook/react/utils/PathUtilsTest.kt +++ b/packages/react-native-gradle-plugin/src/test/kotlin/com/facebook/react/utils/PathUtilsTest.kt @@ -52,10 +52,47 @@ class PathUtilsTest { } @Test - fun detectedCliPath_withCliPathFromExtension() { + fun detectedCliPath_withCliPathFromExtensionAbsolute() { val project = ProjectBuilder.builder().build() val extension = TestReactExtension(project) - val expected = File(project.projectDir, "fake-cli.sh") + val expected = + File(project.projectDir, "abs/fake-cli.sh").apply { + parentFile.mkdirs() + writeText("") + } + extension.cliPath.set(project.projectDir + "/abs/fake-cli.sh") + + val actual = detectedCliPath(project.projectDir, extension) + + assertEquals(expected.toString(), actual) + } + + @Test + fun detectedCliPath_withCliPathFromExtensionInReactFolder() { + val project = ProjectBuilder.builder().build() + val extension = TestReactExtension(project) + val expected = + File(project.projectDir, "/react-root/fake-cli.sh").apply { + parentFile.mkdirs() + writeText("") + } + extension.cliPath.set("fake-cli.sh") + extension.reactRoot.set(project.projectDir + "/react-root") + + val actual = detectedCliPath(project.projectDir, extension) + + assertEquals(expected.toString(), actual) + } + + @Test + fun detectedCliPath_withCliPathFromExtensionInProjectFolder() { + val project = ProjectBuilder.builder().build() + val extension = TestReactExtension(project) + val expected = + File(project.projectDir, "fake-cli.sh").apply { + parentFile.mkdirs() + writeText("") + } extension.cliPath.set("fake-cli.sh") val actual = detectedCliPath(project.projectDir, extension) diff --git a/react.gradle b/react.gradle index 047560a998fc57..0283a18e73bb7a 100644 --- a/react.gradle +++ b/react.gradle @@ -22,20 +22,6 @@ def detectEntryFile(config) { return "index.js"; } -/** - * Detects CLI location in a similar fashion to the React Native CLI - */ -def detectCliPath(config) { - if (config.cliPath) { - return "${projectDir}/${config.cliPath}" - } - if (new File("${projectDir}/../../node_modules/react-native/cli.js").exists()) { - return "${projectDir}/../../node_modules/react-native/cli.js" - } - throw new Exception("Couldn't determine CLI location. " + - "Please set `project.ext.react.cliPath` to the path of the react-native cli.js file. This file typically resides in `node_modules/react-native/cli.js`"); -} - def composeSourceMapsPath = config.composeSourceMapsPath ?: "node_modules/react-native/scripts/compose-source-maps.js" def bundleAssetName = config.bundleAssetName ?: "index.android.bundle" def entryFile = detectEntryFile(config) @@ -46,6 +32,43 @@ def bundleConfig = config.bundleConfig ? "${reactRoot}/${config.bundleConfig}" : def enableVmCleanup = config.enableVmCleanup == null ? true : config.enableVmCleanup def hermesCommand = config.hermesCommand ?: "../../node_modules/hermes-engine/%OS-BIN%/hermesc" +/** + * Detects CLI location in a similar fashion to the React Native CLI + */ +def detectCliPath(config, reactRoot) { + // 1. preconfigured path + if (config.cliPath) { + def cliJsAbsolute = new File(config.cliPath) + if (cliJsAbsolute.exists()) { + return cliJsAbsolute.getAbsolutePath() + } + def cliJsRelativeToRoot = new File("${rootDir}/${config.cliPath}") + if (cliJsRelativeToRoot.exists()) { + return cliJsRelativeToRoot.getAbsolutePath() + } + def cliJsRelativeToProject = new File("${projectDir}/${config.cliPath}") + if (cliJsRelativeToProject.exists()) { + return cliJsRelativeToProject.getAbsolutePath() + } + } + + // 2. node module path + def cliJsFromNode = new File(["node", "--print", "require.resolve('react-native/cli').bin"].execute(null, rootDir).text.trim()) + if (cliJsFromNode.exists()) { + return cliJsFromNode.getAbsolutePath() + } + + // 3. cli.js in the root folder + def rootCliJs = new File(reactRoot, "node_modules/react-native/cli.js") + if (rootCliJs.exists()) { + return rootCliJs.getAbsolutePath() + } + + throw new Exception("Couldn't determine CLI location. " + + "Please set `project.ext.react.cliPath` to the path of the react-native cli.js file. " + + "This file typically resides in `node_modules/react-native/cli.js`"); +} + def reactNativeDevServerPort() { def value = project.getProperties().get("reactNativeDevServerPort") return value != null ? value : "8081" @@ -164,7 +187,7 @@ afterEvaluate { // Additional node and packager commandline arguments def nodeExecutableAndArgs = config.nodeExecutableAndArgs ?: ["node"] - def cliPath = detectCliPath(config) + def cliPath = detectCliPath(config, reactRoot) def execCommand = [] From 289c7f71804b74dc554159d824e2b96093a7d1bf Mon Sep 17 00:00:00 2001 From: Genki Kondo Date: Tue, 15 Mar 2022 10:55:08 -0700 Subject: [PATCH 24/48] Emit scroll events on overscroll and fix sticky header Summary: Sticky headers (via OCScrollTrackerStickyHeader) did not work with RN because overscroll does not trigger onScroll events. This diff adds a listener to overscroll, which then emits scroll events. Changelog: [Internal][Changed] - Changed ScrollEvent's scrollX and scrollY to float --- # Context GamingActivity headers are part of the FlatList; on overscroll (when you scroll up when you're already at the top of the FlatList), the header is translated via Animated's native event. The problem on RN is that onScroll is not fired during overscroll (due to how overscroll-decor works - it merely applies a translation on the scroll view itself). Scroll events propagate to the native animated events as follows: - ReactScrollView.onScrollChanged -> ReactScrollViewHelper.updateStateOnScrollChanged -> ReactScrollViewHelper.emitScrollEvent -> EventDispatcher.dispatchEvent -> NativeAnimatedNodesManager.onEventDispatch # Approaches Two approaches were considered to fix sticky headers: - [Implemented in this diff] Attach a listener on OverScrollDecor and fire onScroll events. I ran into 2 main issues with this: - The header clips as the scroll view is translated down. This is fixed via setting clipChildren. - Move headers out of FlatList, and translate the header only for positive scroll offsets. - Requires product-side code changes - Hover outline is cut off by the header - Click-drag to scroll does not work on the header Reviewed By: javache Differential Revision: D34696042 fbshipit-source-id: 15450f31a7042ce67cdffc74614f4f7b9684d0ca --- .../react/views/scroll/ScrollEvent.java | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ScrollEvent.java b/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ScrollEvent.java index 6d3eba9b8170e2..487a131cd3e878 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ScrollEvent.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ScrollEvent.java @@ -23,10 +23,10 @@ public class ScrollEvent extends Event { private static final Pools.SynchronizedPool EVENTS_POOL = new Pools.SynchronizedPool<>(3); - private int mScrollX; - private int mScrollY; - private double mXVelocity; - private double mYVelocity; + private float mScrollX; + private float mScrollY; + private float mXVelocity; + private float mYVelocity; private int mContentWidth; private int mContentHeight; private int mScrollViewWidth; @@ -37,8 +37,8 @@ public class ScrollEvent extends Event { public static ScrollEvent obtain( int viewTag, ScrollEventType scrollEventType, - int scrollX, - int scrollY, + float scrollX, + float scrollY, float xVelocity, float yVelocity, int contentWidth, @@ -63,8 +63,8 @@ public static ScrollEvent obtain( int surfaceId, int viewTag, ScrollEventType scrollEventType, - int scrollX, - int scrollY, + float scrollX, + float scrollY, float xVelocity, float yVelocity, int contentWidth, @@ -107,8 +107,8 @@ private void init( int surfaceId, int viewTag, ScrollEventType scrollEventType, - int scrollX, - int scrollY, + float scrollX, + float scrollY, float xVelocity, float yVelocity, int contentWidth, From 67af1b8218c4bca43d8fce32ae99b9d76d6fc364 Mon Sep 17 00:00:00 2001 From: Genki Kondo Date: Tue, 15 Mar 2022 12:06:58 -0700 Subject: [PATCH 25/48] Add RNTester example for nested text Summary: Existing RNTester examples for text did not contain a case where text with color was nested inside of another with text at both ends. This would have caught T113767991 Changelog: [Internal] - Add RNTester example for nested text Reviewed By: mdvacca Differential Revision: D34874080 fbshipit-source-id: cda91cde9c7449abb677ae9fa936a61e396ffbd3 --- .../rn-tester/js/examples/Text/TextExample.android.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/rn-tester/js/examples/Text/TextExample.android.js b/packages/rn-tester/js/examples/Text/TextExample.android.js index f1f15a242fecf8..61581d724d9bae 100644 --- a/packages/rn-tester/js/examples/Text/TextExample.android.js +++ b/packages/rn-tester/js/examples/Text/TextExample.android.js @@ -500,6 +500,16 @@ class TextExample extends React.Component<{...}> { Entity Name + + Nested text with size 8,{' '} + size 23, + and size 8 again + + + Nested text with red color,{' '} + blue color, + and red color again + auto (default) - english LTR From bbeb50e8b777bd838bc9b1243794d4c93f00411e Mon Sep 17 00:00:00 2001 From: Moti Zilberman Date: Tue, 15 Mar 2022 13:55:56 -0700 Subject: [PATCH 26/48] Upgrade Metro dependencies to 0.69.1 Summary: Upgrade React Native's direct dependencies on Metro packages from 0.69.0 to 0.69.1. Changelog: [Internal] Reviewed By: arushikesarwani94 Differential Revision: D34898033 fbshipit-source-id: 267821ec6cb926f371c4029bd6f09984c6f7334b --- package.json | 6 ++-- repo-config/package.json | 2 +- template/package.json | 2 +- yarn.lock | 78 ++++++++++++++++++++-------------------- 4 files changed, 44 insertions(+), 44 deletions(-) diff --git a/package.json b/package.json index 2a399847069b15..a7a2ae10ecd1a2 100644 --- a/package.json +++ b/package.json @@ -105,9 +105,9 @@ "hermes-engine": "~0.11.0", "invariant": "^2.2.4", "jsc-android": "^250230.2.1", - "metro-react-native-babel-transformer": "0.69.0", - "metro-runtime": "0.69.0", - "metro-source-map": "0.69.0", + "metro-react-native-babel-transformer": "0.69.1", + "metro-runtime": "0.69.1", + "metro-source-map": "0.69.1", "nullthrows": "^1.1.1", "pretty-format": "^26.5.2", "promise": "^8.0.3", diff --git a/repo-config/package.json b/repo-config/package.json index 6c230d96f42ae5..3fcbf9466b8cf6 100644 --- a/repo-config/package.json +++ b/repo-config/package.json @@ -39,7 +39,7 @@ "jest": "^26.6.3", "jest-junit": "^10.0.0", "jscodeshift": "^0.13.1", - "metro-babel-register": "0.69.0", + "metro-babel-register": "0.69.1", "mkdirp": "^0.5.1", "prettier": "^2.4.1", "react": "17.0.2", diff --git a/template/package.json b/template/package.json index 6b6ef673516c30..0d263dde3e05ee 100644 --- a/template/package.json +++ b/template/package.json @@ -20,7 +20,7 @@ "babel-jest": "^26.6.3", "eslint": "^7.32.0", "jest": "^26.6.3", - "metro-react-native-babel-preset": "^0.69.0", + "metro-react-native-babel-preset": "^0.69.1", "react-test-renderer": "17.0.2" }, "jest": { diff --git a/yarn.lock b/yarn.lock index 1833b6694536b1..7e9bed75525414 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4936,10 +4936,10 @@ merge2@^1.3.0: resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== -metro-babel-register@0.69.0: - version "0.69.0" - resolved "https://registry.yarnpkg.com/metro-babel-register/-/metro-babel-register-0.69.0.tgz#d5d904e249c100229277c6ada923bfc9797dd0b7" - integrity sha512-jNXQY0QFD7KZMeZJcymjVugF5squEJhRMmdGf5qyJm/QstU3z7rBt1xd4MCp1frdc4ku8IEP4Ye6XnIPST2szw== +metro-babel-register@0.69.1: + version "0.69.1" + resolved "https://registry.yarnpkg.com/metro-babel-register/-/metro-babel-register-0.69.1.tgz#c8db5253681a3a3b00607561f67591cee806ff53" + integrity sha512-4BLMrhD5IYMT64gGtkH8hra9BdSnCN9iEO/TpTTuDXhquoGAZd85N647ieG0e97WpCdDMqyd3VaSjfMyCpmlcQ== dependencies: "@babel/core" "^7.14.0" "@babel/plugin-proposal-nullish-coalescing-operator" "^7.0.0" @@ -4962,14 +4962,14 @@ metro-babel-transformer@0.67.0: metro-source-map "0.67.0" nullthrows "^1.1.1" -metro-babel-transformer@0.69.0: - version "0.69.0" - resolved "https://registry.yarnpkg.com/metro-babel-transformer/-/metro-babel-transformer-0.69.0.tgz#6598ef631ebcb62b36d79d19a89a00d6fb54cf64" - integrity sha512-tlfdy8vkNQUqyFQYBK9lAHQvWfpC/E+auXiJZNNnKV1mbVZhmfbGpt1sLxidfXWMpcYMI1cdF0RxOkZDqTLtwQ== +metro-babel-transformer@0.69.1: + version "0.69.1" + resolved "https://registry.yarnpkg.com/metro-babel-transformer/-/metro-babel-transformer-0.69.1.tgz#2d2e4dbf628e3b2a632450df6fa6d83c25b704f6" + integrity sha512-1K3TwIg7N7WrBuPKcmQGgUnFlqO53rnERzzBqviXqw1xKMahN0M9C++8mjg3KI8pVaSIjuWUd+QADKazgxr1sA== dependencies: "@babel/core" "^7.14.0" hermes-parser "0.6.0" - metro-source-map "0.69.0" + metro-source-map "0.69.1" nullthrows "^1.1.1" metro-cache-key@0.67.0: @@ -5075,10 +5075,10 @@ metro-react-native-babel-preset@0.67.0: "@babel/template" "^7.0.0" react-refresh "^0.4.0" -metro-react-native-babel-preset@0.69.0: - version "0.69.0" - resolved "https://registry.yarnpkg.com/metro-react-native-babel-preset/-/metro-react-native-babel-preset-0.69.0.tgz#5f651a027d3ced57fb1ef93e2e5a5a4a90059a93" - integrity sha512-AEvyI6h3ltvc3/hY+v7DhV3pFSSE3jhtebjYEX+ffXQ/oT3U3pbFvLXa24TCe7cTljM6eEMtmpYS+6UkGE9BKQ== +metro-react-native-babel-preset@0.69.1: + version "0.69.1" + resolved "https://registry.yarnpkg.com/metro-react-native-babel-preset/-/metro-react-native-babel-preset-0.69.1.tgz#d217553ca29267e688796132340b77ad91d75acb" + integrity sha512-ALl1j04MlCEZz6fhd28Dyx1Bpe4CEOdJRzTQbD7Rlq64/JgurOLvpqaOOda+vLsYdkrhIWKr7PHrPVjTAobG/g== dependencies: "@babel/core" "^7.14.0" "@babel/plugin-proposal-async-generator-functions" "^7.0.0" @@ -5121,17 +5121,17 @@ metro-react-native-babel-preset@0.69.0: "@babel/template" "^7.0.0" react-refresh "^0.4.0" -metro-react-native-babel-transformer@0.69.0: - version "0.69.0" - resolved "https://registry.yarnpkg.com/metro-react-native-babel-transformer/-/metro-react-native-babel-transformer-0.69.0.tgz#ce8183f94d18196545f1393ec37f81cd13d50c92" - integrity sha512-+s0LuEtkvIQkB+unDFTsbECtlOaPXWDOd4rrvFu9OHtDfZCbh1+7mVBLWH0noUc6b/I70beGPJQf9yiKGy7Syg== +metro-react-native-babel-transformer@0.69.1: + version "0.69.1" + resolved "https://registry.yarnpkg.com/metro-react-native-babel-transformer/-/metro-react-native-babel-transformer-0.69.1.tgz#3b073c113fe2667c9ca704bd0cdf1ff5929158ad" + integrity sha512-B36PYdXGSf8l4Mibb07jBvu8qR7YBczXfxXy6Fv9vGYF5vn0+zYir+M4I1JUQivggCT3akcihlgDC2AvS0IYhw== dependencies: "@babel/core" "^7.14.0" babel-preset-fbjs "^3.4.0" hermes-parser "0.6.0" - metro-babel-transformer "0.69.0" - metro-react-native-babel-preset "0.69.0" - metro-source-map "0.69.0" + metro-babel-transformer "0.69.1" + metro-react-native-babel-preset "0.69.1" + metro-source-map "0.69.1" nullthrows "^1.1.1" metro-react-native-babel-transformer@^0.67.0: @@ -5159,10 +5159,10 @@ metro-runtime@0.67.0, metro-runtime@^0.67.0: resolved "https://registry.yarnpkg.com/metro-runtime/-/metro-runtime-0.67.0.tgz#a8888dfd06bcebbac3c99dcac7cd622510dd8ee0" integrity sha512-IFtSL0JUt1xK3t9IoLflTDft82bjieSzdIJWLzrRzBMlesz8ox5bVmnpQbVQEwfYUpEOxbM3VOZauVbdCmXA7g== -metro-runtime@0.69.0: - version "0.69.0" - resolved "https://registry.yarnpkg.com/metro-runtime/-/metro-runtime-0.69.0.tgz#cfddafbb8f3e194b3e2eb917ed851d0ee10d8e04" - integrity sha512-m4qnrNIU5r/mYKiMJwfsUpJ8Q3oZa+bp0bpQHYxt5KvXETiFTEO3iF5ZsebLDII0SbEY+vIzGVXZFlA4p7XX9A== +metro-runtime@0.69.1: + version "0.69.1" + resolved "https://registry.yarnpkg.com/metro-runtime/-/metro-runtime-0.69.1.tgz#1a255a142e2a1c44b62b54bf05168aeae9cd09e0" + integrity sha512-PWyzWuUYIeUsEt0T2Vg+KYR/ij8Ze7sg8/NRKT57kcDdMsWTlcrIUo1AleT+zL2J5biYPZKUhG5ZdusynrdkTQ== metro-source-map@0.67.0: version "0.67.0" @@ -5178,17 +5178,17 @@ metro-source-map@0.67.0: source-map "^0.5.6" vlq "^1.0.0" -metro-source-map@0.69.0: - version "0.69.0" - resolved "https://registry.yarnpkg.com/metro-source-map/-/metro-source-map-0.69.0.tgz#1fd1d9a886da2d1b147b57647d86f91f0b57512b" - integrity sha512-EvnX4kgUALt/xS+kASgwMSXjNTMjoicN1bIAVZsYWi/fujoc/nWWm05WJqmNzJHMyA/IUR4nBmmcQT+y5ZE5RA== +metro-source-map@0.69.1: + version "0.69.1" + resolved "https://registry.yarnpkg.com/metro-source-map/-/metro-source-map-0.69.1.tgz#b0fc6160e7aacd7694bf9eacf2e30a5f6d184681" + integrity sha512-Ypp1NKorkEuk/5wWUT6SSIR/p1bhWnlx8lEAJivwVSnQju7t9IOv2g9EYu3RMCHpHDfLdRBE5tvFPPZT1V2dTQ== dependencies: "@babel/traverse" "^7.14.0" "@babel/types" "^7.0.0" invariant "^2.2.4" - metro-symbolicate "0.69.0" + metro-symbolicate "0.69.1" nullthrows "^1.1.1" - ob1 "0.69.0" + ob1 "0.69.1" source-map "^0.5.6" vlq "^1.0.0" @@ -5204,13 +5204,13 @@ metro-symbolicate@0.67.0: through2 "^2.0.1" vlq "^1.0.0" -metro-symbolicate@0.69.0: - version "0.69.0" - resolved "https://registry.yarnpkg.com/metro-symbolicate/-/metro-symbolicate-0.69.0.tgz#46911445f9114371e694c07c3d562f2747d3c581" - integrity sha512-KMDS5vB85WWlFX2P7d9+8+W5R78hAhgj8wfB5uw0HiG+bO2k3uACunFImFLqWU+Eqc57OZPxyF/XYi5h2q15CQ== +metro-symbolicate@0.69.1: + version "0.69.1" + resolved "https://registry.yarnpkg.com/metro-symbolicate/-/metro-symbolicate-0.69.1.tgz#b35164d2f6842532d5e53fe65154a7dfc83adc27" + integrity sha512-eTdO7iYbkjqxNkqN4+IpraMdvQ3Yl964+tjryXyVfDx3EtAcZSt+5dwZ99ntnqIvlZdAbOHc/ZzC2plan+FlxQ== dependencies: invariant "^2.2.4" - metro-source-map "0.69.0" + metro-source-map "0.69.1" nullthrows "^1.1.1" source-map "^0.5.6" through2 "^2.0.1" @@ -5551,10 +5551,10 @@ ob1@0.67.0: resolved "https://registry.yarnpkg.com/ob1/-/ob1-0.67.0.tgz#91f104c90641b1af8c364fc82a4b2c7d0801072d" integrity sha512-YvZtX8HKYackQ5PwdFIuuNFVsMChRPHvnARRRT0Vk59xsBvL5t9U1Ock3M1sYrKj+Gp73+0q9xcHLAxI+xLi5g== -ob1@0.69.0: - version "0.69.0" - resolved "https://registry.yarnpkg.com/ob1/-/ob1-0.69.0.tgz#46556143247f671b9b99fa4cbfd0a60a354fa050" - integrity sha512-TDhnMJnbb41HklhCy/1o7lJS6p8k14vk7rVaMuV7i8iDH/iVLF51UDFQtO0Yh73WhdONXquhRxaDjFtUBZqjmg== +ob1@0.69.1: + version "0.69.1" + resolved "https://registry.yarnpkg.com/ob1/-/ob1-0.69.1.tgz#560c328084a4256cc33fb9f6e51db3d2cc85d996" + integrity sha512-7cUI4kB24x/M2boLN2WXXIYr9A1Rl36TiHsENCNiCyC5HvhYSsVr+gMT41aFJbJGeDj6XFNZcb6cpGF5ngHclA== object-assign@^4.1.1: version "4.1.1" From 062a6169cecadb799284354103408a11afe1c24e Mon Sep 17 00:00:00 2001 From: Andrei Shikov Date: Tue, 15 Mar 2022 19:32:22 -0700 Subject: [PATCH 27/48] Generate CMakeLists.txt for codegen modules Summary: Generates `CMakeLists.txt` for the codegen the same way as we generate Android.mk Changelog: [Internal] - CMakeLists.txt for codegen targets Reviewed By: cortinico Differential Revision: D34821864 fbshipit-source-id: 0cbe7a450a4a064e2285890253ae152fb03267c2 --- .../generators/modules/GenerateModuleJniH.js | 51 +++ .../GenerateModuleJniH-test.js.snap | 308 ++++++++++++++++++ 2 files changed, 359 insertions(+) diff --git a/packages/react-native-codegen/src/generators/modules/GenerateModuleJniH.js b/packages/react-native-codegen/src/generators/modules/GenerateModuleJniH.js index ad763698efe1c2..90c06aa4d53e61 100644 --- a/packages/react-native-codegen/src/generators/modules/GenerateModuleJniH.js +++ b/packages/react-native-codegen/src/generators/modules/GenerateModuleJniH.js @@ -103,6 +103,56 @@ include $(BUILD_SHARED_LIBRARY) `; }; +// Note: this CMakeLists.txt template includes dependencies for both NativeModule and components. +const CMakeListsTemplate = ({ + libraryName, +}: $ReadOnly<{libraryName: string}>) => { + return `# Copyright (c) Meta Platforms, Inc. and affiliates. +# +# This source code is licensed under the MIT license found in the +# LICENSE file in the root directory of this source tree. + +cmake_minimum_required(VERSION 3.13) +set(CMAKE_VERBOSE_MAKEFILE on) + +file(GLOB react_codegen_SRCS *.cpp CONFIGURE_DEPENDS react/renderer/components/${libraryName}/*.cpp) + +add_library( + react_codegen_${libraryName} + SHARED + \${react_codegen_SRCS} +) + +target_include_directories(react_codegen_${libraryName} PUBLIC . react/renderer/components/${libraryName}) + +target_link_libraries( + react_codegen_${libraryName} + fbjni + folly_runtime + glog + ${libraryName !== 'rncore' ? 'react_codegen_rncore' : ''} + react_debug + react_nativemodule_core + react_render_core + react_render_debug + react_render_graphics + rrc_view + turbomodulejsijni + yoga +) + +target_compile_options( + react_codegen_${libraryName} + PRIVATE + -DLOG_TAG=\\"ReactNative\\" + -fexceptions + -frtti + -std=c++17 + -Wall +) +`; +}; + module.exports = { generate( libraryName: string, @@ -136,6 +186,7 @@ module.exports = { libraryName: libraryName, }), ], + ['jni/CMakeLists.txt', CMakeListsTemplate({libraryName: libraryName})], ]); }, }; diff --git a/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleJniH-test.js.snap b/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleJniH-test.js.snap index 7904f7d8b4be6b..5171213ca4c2ba 100644 --- a/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleJniH-test.js.snap +++ b/packages/react-native-codegen/src/generators/modules/__tests__/__snapshots__/GenerateModuleJniH-test.js.snap @@ -60,6 +60,50 @@ LOCAL_CFLAGS := \\\\ LOCAL_CFLAGS += -fexceptions -frtti -std=c++17 -Wall include $(BUILD_SHARED_LIBRARY) +", + "jni/CMakeLists.txt" => "# Copyright (c) Meta Platforms, Inc. and affiliates. +# +# This source code is licensed under the MIT license found in the +# LICENSE file in the root directory of this source tree. + +cmake_minimum_required(VERSION 3.13) +set(CMAKE_VERBOSE_MAKEFILE on) + +file(GLOB react_codegen_SRCS *.cpp CONFIGURE_DEPENDS react/renderer/components/SampleWithUppercaseName/*.cpp) + +add_library( + react_codegen_SampleWithUppercaseName + SHARED + \${react_codegen_SRCS} +) + +target_include_directories(react_codegen_SampleWithUppercaseName PUBLIC . react/renderer/components/SampleWithUppercaseName) + +target_link_libraries( + react_codegen_SampleWithUppercaseName + fbjni + folly_runtime + glog + react_codegen_rncore + react_debug + react_nativemodule_core + react_render_core + react_render_debug + react_render_graphics + rrc_view + turbomodulejsijni + yoga +) + +target_compile_options( + react_codegen_SampleWithUppercaseName + PRIVATE + -DLOG_TAG=\\\\\\"ReactNative\\\\\\" + -fexceptions + -frtti + -std=c++17 + -Wall +) ", } `; @@ -124,6 +168,50 @@ LOCAL_CFLAGS := \\\\ LOCAL_CFLAGS += -fexceptions -frtti -std=c++17 -Wall include $(BUILD_SHARED_LIBRARY) +", + "jni/CMakeLists.txt" => "# Copyright (c) Meta Platforms, Inc. and affiliates. +# +# This source code is licensed under the MIT license found in the +# LICENSE file in the root directory of this source tree. + +cmake_minimum_required(VERSION 3.13) +set(CMAKE_VERBOSE_MAKEFILE on) + +file(GLOB react_codegen_SRCS *.cpp CONFIGURE_DEPENDS react/renderer/components/complex_objects/*.cpp) + +add_library( + react_codegen_complex_objects + SHARED + \${react_codegen_SRCS} +) + +target_include_directories(react_codegen_complex_objects PUBLIC . react/renderer/components/complex_objects) + +target_link_libraries( + react_codegen_complex_objects + fbjni + folly_runtime + glog + react_codegen_rncore + react_debug + react_nativemodule_core + react_render_core + react_render_debug + react_render_graphics + rrc_view + turbomodulejsijni + yoga +) + +target_compile_options( + react_codegen_complex_objects + PRIVATE + -DLOG_TAG=\\\\\\"ReactNative\\\\\\" + -fexceptions + -frtti + -std=c++17 + -Wall +) ", } `; @@ -188,6 +276,50 @@ LOCAL_CFLAGS := \\\\ LOCAL_CFLAGS += -fexceptions -frtti -std=c++17 -Wall include $(BUILD_SHARED_LIBRARY) +", + "jni/CMakeLists.txt" => "# Copyright (c) Meta Platforms, Inc. and affiliates. +# +# This source code is licensed under the MIT license found in the +# LICENSE file in the root directory of this source tree. + +cmake_minimum_required(VERSION 3.13) +set(CMAKE_VERBOSE_MAKEFILE on) + +file(GLOB react_codegen_SRCS *.cpp CONFIGURE_DEPENDS react/renderer/components/empty_native_modules/*.cpp) + +add_library( + react_codegen_empty_native_modules + SHARED + \${react_codegen_SRCS} +) + +target_include_directories(react_codegen_empty_native_modules PUBLIC . react/renderer/components/empty_native_modules) + +target_link_libraries( + react_codegen_empty_native_modules + fbjni + folly_runtime + glog + react_codegen_rncore + react_debug + react_nativemodule_core + react_render_core + react_render_debug + react_render_graphics + rrc_view + turbomodulejsijni + yoga +) + +target_compile_options( + react_codegen_empty_native_modules + PRIVATE + -DLOG_TAG=\\\\\\"ReactNative\\\\\\" + -fexceptions + -frtti + -std=c++17 + -Wall +) ", } `; @@ -252,6 +384,50 @@ LOCAL_CFLAGS := \\\\ LOCAL_CFLAGS += -fexceptions -frtti -std=c++17 -Wall include $(BUILD_SHARED_LIBRARY) +", + "jni/CMakeLists.txt" => "# Copyright (c) Meta Platforms, Inc. and affiliates. +# +# This source code is licensed under the MIT license found in the +# LICENSE file in the root directory of this source tree. + +cmake_minimum_required(VERSION 3.13) +set(CMAKE_VERBOSE_MAKEFILE on) + +file(GLOB react_codegen_SRCS *.cpp CONFIGURE_DEPENDS react/renderer/components/native_modules_with_type_aliases/*.cpp) + +add_library( + react_codegen_native_modules_with_type_aliases + SHARED + \${react_codegen_SRCS} +) + +target_include_directories(react_codegen_native_modules_with_type_aliases PUBLIC . react/renderer/components/native_modules_with_type_aliases) + +target_link_libraries( + react_codegen_native_modules_with_type_aliases + fbjni + folly_runtime + glog + react_codegen_rncore + react_debug + react_nativemodule_core + react_render_core + react_render_debug + react_render_graphics + rrc_view + turbomodulejsijni + yoga +) + +target_compile_options( + react_codegen_native_modules_with_type_aliases + PRIVATE + -DLOG_TAG=\\\\\\"ReactNative\\\\\\" + -fexceptions + -frtti + -std=c++17 + -Wall +) ", } `; @@ -324,6 +500,50 @@ LOCAL_CFLAGS := \\\\ LOCAL_CFLAGS += -fexceptions -frtti -std=c++17 -Wall include $(BUILD_SHARED_LIBRARY) +", + "jni/CMakeLists.txt" => "# Copyright (c) Meta Platforms, Inc. and affiliates. +# +# This source code is licensed under the MIT license found in the +# LICENSE file in the root directory of this source tree. + +cmake_minimum_required(VERSION 3.13) +set(CMAKE_VERBOSE_MAKEFILE on) + +file(GLOB react_codegen_SRCS *.cpp CONFIGURE_DEPENDS react/renderer/components/real_module_example/*.cpp) + +add_library( + react_codegen_real_module_example + SHARED + \${react_codegen_SRCS} +) + +target_include_directories(react_codegen_real_module_example PUBLIC . react/renderer/components/real_module_example) + +target_link_libraries( + react_codegen_real_module_example + fbjni + folly_runtime + glog + react_codegen_rncore + react_debug + react_nativemodule_core + react_render_core + react_render_debug + react_render_graphics + rrc_view + turbomodulejsijni + yoga +) + +target_compile_options( + react_codegen_real_module_example + PRIVATE + -DLOG_TAG=\\\\\\"ReactNative\\\\\\" + -fexceptions + -frtti + -std=c++17 + -Wall +) ", } `; @@ -388,6 +608,50 @@ LOCAL_CFLAGS := \\\\ LOCAL_CFLAGS += -fexceptions -frtti -std=c++17 -Wall include $(BUILD_SHARED_LIBRARY) +", + "jni/CMakeLists.txt" => "# Copyright (c) Meta Platforms, Inc. and affiliates. +# +# This source code is licensed under the MIT license found in the +# LICENSE file in the root directory of this source tree. + +cmake_minimum_required(VERSION 3.13) +set(CMAKE_VERBOSE_MAKEFILE on) + +file(GLOB react_codegen_SRCS *.cpp CONFIGURE_DEPENDS react/renderer/components/simple_native_modules/*.cpp) + +add_library( + react_codegen_simple_native_modules + SHARED + \${react_codegen_SRCS} +) + +target_include_directories(react_codegen_simple_native_modules PUBLIC . react/renderer/components/simple_native_modules) + +target_link_libraries( + react_codegen_simple_native_modules + fbjni + folly_runtime + glog + react_codegen_rncore + react_debug + react_nativemodule_core + react_render_core + react_render_debug + react_render_graphics + rrc_view + turbomodulejsijni + yoga +) + +target_compile_options( + react_codegen_simple_native_modules + PRIVATE + -DLOG_TAG=\\\\\\"ReactNative\\\\\\" + -fexceptions + -frtti + -std=c++17 + -Wall +) ", } `; @@ -460,6 +724,50 @@ LOCAL_CFLAGS := \\\\ LOCAL_CFLAGS += -fexceptions -frtti -std=c++17 -Wall include $(BUILD_SHARED_LIBRARY) +", + "jni/CMakeLists.txt" => "# Copyright (c) Meta Platforms, Inc. and affiliates. +# +# This source code is licensed under the MIT license found in the +# LICENSE file in the root directory of this source tree. + +cmake_minimum_required(VERSION 3.13) +set(CMAKE_VERBOSE_MAKEFILE on) + +file(GLOB react_codegen_SRCS *.cpp CONFIGURE_DEPENDS react/renderer/components/two_modules_different_files/*.cpp) + +add_library( + react_codegen_two_modules_different_files + SHARED + \${react_codegen_SRCS} +) + +target_include_directories(react_codegen_two_modules_different_files PUBLIC . react/renderer/components/two_modules_different_files) + +target_link_libraries( + react_codegen_two_modules_different_files + fbjni + folly_runtime + glog + react_codegen_rncore + react_debug + react_nativemodule_core + react_render_core + react_render_debug + react_render_graphics + rrc_view + turbomodulejsijni + yoga +) + +target_compile_options( + react_codegen_two_modules_different_files + PRIVATE + -DLOG_TAG=\\\\\\"ReactNative\\\\\\" + -fexceptions + -frtti + -std=c++17 + -Wall +) ", } `; From a6095d43cd133be9f1d5d8aa11ea901dc918eb5b Mon Sep 17 00:00:00 2001 From: Andrei Shikov Date: Tue, 15 Mar 2022 20:23:51 -0700 Subject: [PATCH 28/48] Include CMakeLists.txt into third-party setup Summary: Includes `CMakeLists.txt` describing build of third-party libraries into "prepared" folders Changelog: [Internal] Reviewed By: cortinico Differential Revision: D34882968 fbshipit-source-id: 071cd9f2316b571c0ae007679ce85ba287904291 --- ReactAndroid/build.gradle | 12 ++++++------ .../react/tasks/internal/PrepareBoostTask.kt | 1 + .../facebook/react/tasks/internal/PrepareGlogTask.kt | 2 +- .../facebook/react/tasks/internal/PrepareJSCTask.kt | 1 + .../react/tasks/internal/PrepareLibeventTask.kt | 5 ++--- 5 files changed, 11 insertions(+), 10 deletions(-) diff --git a/ReactAndroid/build.gradle b/ReactAndroid/build.gradle index 74905166f095e5..9f5578c1670908 100644 --- a/ReactAndroid/build.gradle +++ b/ReactAndroid/build.gradle @@ -77,8 +77,8 @@ task downloadDoubleConversion(dependsOn: createNativeDepsDirectories, type: Down task prepareDoubleConversion(dependsOn: dependenciesPath ? [] : [downloadDoubleConversion], type: Copy) { from(dependenciesPath ?: tarTree(downloadDoubleConversion.dest)) - from("src/main/jni/third-party/double-conversion/Android.mk") - include("double-conversion-${DOUBLE_CONVERSION_VERSION}/src/**/*", "Android.mk") + from("src/main/jni/third-party/double-conversion/") + include("double-conversion-${DOUBLE_CONVERSION_VERSION}/src/**/*", "Android.mk", "CMakeLists.txt") filesMatching("*/src/**/*", { fname -> fname.path = "double-conversion/${fname.name}" }) includeEmptyDirs = false into("$thirdPartyNdkDir/double-conversion") @@ -93,8 +93,8 @@ task downloadFolly(dependsOn: createNativeDepsDirectories, type: Download) { task prepareFolly(dependsOn: dependenciesPath ? [] : [downloadFolly], type: Copy) { from(dependenciesPath ?: tarTree(downloadFolly.dest)) - from("src/main/jni/third-party/folly/Android.mk") - include("folly-${FOLLY_VERSION}/folly/**/*", "Android.mk") + from("src/main/jni/third-party/folly/") + include("folly-${FOLLY_VERSION}/folly/**/*", "Android.mk", "CMakeLists.txt") eachFile { fname -> fname.path = (fname.path - "folly-${FOLLY_VERSION}/") } includeEmptyDirs = false into("$thirdPartyNdkDir/folly") @@ -109,8 +109,8 @@ task downloadFmt(dependsOn: createNativeDepsDirectories, type: Download) { task prepareFmt(dependsOn: dependenciesPath ? [] : [downloadFmt], type: Copy) { from(dependenciesPath ?: tarTree(downloadFmt.dest)) - from("src/main/jni/third-party/fmt/Android.mk") - include("fmt-${FMT_VERSION}/src/**/*", "fmt-${FMT_VERSION}/include/**/*", "Android.mk") + from("src/main/jni/third-party/fmt/") + include("fmt-${FMT_VERSION}/src/**/*", "fmt-${FMT_VERSION}/include/**/*", "Android.mk", "CMakeLists.txt") eachFile { fname -> fname.path = (fname.path - "fmt-${FMT_VERSION}/") } includeEmptyDirs = false into("$thirdPartyNdkDir/fmt") diff --git a/packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/tasks/internal/PrepareBoostTask.kt b/packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/tasks/internal/PrepareBoostTask.kt index 2f4b684b68d5a7..9fe06794aeabd5 100644 --- a/packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/tasks/internal/PrepareBoostTask.kt +++ b/packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/tasks/internal/PrepareBoostTask.kt @@ -33,6 +33,7 @@ abstract class PrepareBoostTask : DefaultTask() { it.from(project.file("src/main/jni/third-party/boost")) it.include( "Android.mk", + "CMakeLists.txt", "boost_${boostVersion.get()}/boost/**/*.hpp", "boost/boost/**/*.hpp", "asm/**/*.S") diff --git a/packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/tasks/internal/PrepareGlogTask.kt b/packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/tasks/internal/PrepareGlogTask.kt index 57b656b564c227..f2320718872434 100644 --- a/packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/tasks/internal/PrepareGlogTask.kt +++ b/packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/tasks/internal/PrepareGlogTask.kt @@ -33,7 +33,7 @@ abstract class PrepareGlogTask : DefaultTask() { project.copy { it.from(glogPath) it.from(project.file("src/main/jni/third-party/glog/")) - it.include("glog-${glogVersion.get()}/src/**/*", "Android.mk", "config.h") + it.include("glog-${glogVersion.get()}/src/**/*", "Android.mk", "CMakeLists.txt", "config.h") it.duplicatesStrategy = DuplicatesStrategy.WARN it.includeEmptyDirs = false it.filesMatching("**/*.h.in") { matchedFile -> diff --git a/packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/tasks/internal/PrepareJSCTask.kt b/packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/tasks/internal/PrepareJSCTask.kt index 18a1db7826dbe7..de742285bb64b3 100644 --- a/packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/tasks/internal/PrepareJSCTask.kt +++ b/packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/tasks/internal/PrepareJSCTask.kt @@ -42,6 +42,7 @@ abstract class PrepareJSCTask : DefaultTask() { it.from(soFiles) it.from(headerFiles) it.from(project.file("src/main/jni/third-party/jsc/Android.mk")) + it.from(project.file("src/main/jni/third-party/jsc/CMakeLists.txt")) it.filesMatching("**/*.h") { it.path = "JavaScriptCore/${it.name}" } it.includeEmptyDirs = false it.into(outputDir) diff --git a/packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/tasks/internal/PrepareLibeventTask.kt b/packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/tasks/internal/PrepareLibeventTask.kt index 4f709fed88d19f..f5faa9ff75b6bd 100644 --- a/packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/tasks/internal/PrepareLibeventTask.kt +++ b/packages/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/tasks/internal/PrepareLibeventTask.kt @@ -30,15 +30,14 @@ abstract class PrepareLibeventTask : DefaultTask() { fun taskAction() { project.copy { it -> it.from(libeventPath) - it.from(project.file("src/main/jni/third-party/libevent/Android.mk")) - it.from(project.file("src/main/jni/third-party/libevent/event-config.h")) - it.from(project.file("src/main/jni/third-party/libevent/evconfig-private.h")) + it.from(project.file("src/main/jni/third-party/libevent/")) it.include( "libevent-${libeventVersion.get()}-stable/*.c", "libevent-${libeventVersion.get()}-stable/*.h", "libevent-${libeventVersion.get()}-stable/include/**/*", "evconfig-private.h", "event-config.h", + "CMakeLists.txt", "Android.mk") it.eachFile { it.path = it.path.removePrefix("libevent-${libeventVersion.get()}-stable/") } it.includeEmptyDirs = false From 6c5bd6d790ae0bd24708b2e19e1002d00734761c Mon Sep 17 00:00:00 2001 From: Andrei Shikov Date: Wed, 16 Mar 2022 01:47:05 -0700 Subject: [PATCH 29/48] Hermes executor migration to CMake Summary: Adds CMake files to configure hermes-executor build, with the same setup as we have in Android.mk Changelog: [Internal] - CMake build config for hermes executor Reviewed By: cortinico Differential Revision: D34811909 fbshipit-source-id: 2df6dbaf46131db87a25e26c83b38ba44f29d1d3 --- .../hermes/reactexecutor/CMakeLists.txt | 41 +++++++++++++++++++ .../jni/first-party/fbgloginit/CMakeLists.txt | 2 +- ReactCommon/hermes/executor/CMakeLists.txt | 29 +++++++++++++ ReactCommon/hermes/inspector/CMakeLists.txt | 32 +++++++++++++++ ReactCommon/react/debug/CMakeLists.txt | 3 +- 5 files changed, 104 insertions(+), 3 deletions(-) create mode 100644 ReactAndroid/src/main/java/com/facebook/hermes/reactexecutor/CMakeLists.txt create mode 100644 ReactCommon/hermes/executor/CMakeLists.txt create mode 100644 ReactCommon/hermes/inspector/CMakeLists.txt diff --git a/ReactAndroid/src/main/java/com/facebook/hermes/reactexecutor/CMakeLists.txt b/ReactAndroid/src/main/java/com/facebook/hermes/reactexecutor/CMakeLists.txt new file mode 100644 index 00000000000000..c4d47fb0123dba --- /dev/null +++ b/ReactAndroid/src/main/java/com/facebook/hermes/reactexecutor/CMakeLists.txt @@ -0,0 +1,41 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# +# This source code is licensed under the MIT license found in the +# LICENSE file in the root directory of this source tree. + +cmake_minimum_required(VERSION 3.13) +set(CMAKE_VERBOSE_MAKEFILE on) + +file(GLOB_RECURSE hermes_executor_SRC CONFIGURE_DEPENDS *.cpp) + +if(${CMAKE_BUILD_TYPE} MATCHES Debug) + set(HERMES_TARGET_SUFFIX debug) +else() + set(HERMES_TARGET_SUFFIX release) +endif() + +set(HERMES_TARGET_NAME hermes-executor-${HERMES_TARGET_SUFFIX}) + +add_library( + ${HERMES_TARGET_NAME} + SHARED + ${hermes_executor_SRC} +) +target_compile_options( + ${HERMES_TARGET_NAME} + PRIVATE + $<$:-DHERMES_ENABLE_DEBUGGER=1> + -fexceptions +) +target_include_directories(${HERMES_TARGET_NAME} PRIVATE .) +target_link_libraries( + ${HERMES_TARGET_NAME} + hermes-executor-common + jsireact + fb + fbjni + folly_json + hermes-engine::libhermes + jsi + reactnativejni +) diff --git a/ReactAndroid/src/main/jni/first-party/fbgloginit/CMakeLists.txt b/ReactAndroid/src/main/jni/first-party/fbgloginit/CMakeLists.txt index bc23ad95063949..45ffd31f75faa3 100644 --- a/ReactAndroid/src/main/jni/first-party/fbgloginit/CMakeLists.txt +++ b/ReactAndroid/src/main/jni/first-party/fbgloginit/CMakeLists.txt @@ -10,6 +10,6 @@ add_compile_options(-fexceptions -fno-omit-frame-pointer) add_library(glog_init SHARED glog_init.cpp) -target_include_directories(yoga PUBLIC .) +target_include_directories(glog_init PUBLIC .) target_link_libraries(glog_init log glog) diff --git a/ReactCommon/hermes/executor/CMakeLists.txt b/ReactCommon/hermes/executor/CMakeLists.txt new file mode 100644 index 00000000000000..a6d8bbac1ddf01 --- /dev/null +++ b/ReactCommon/hermes/executor/CMakeLists.txt @@ -0,0 +1,29 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# +# This source code is licensed under the MIT license found in the +# LICENSE file in the root directory of this source tree. + +cmake_minimum_required(VERSION 3.13) +set(CMAKE_VERBOSE_MAKEFILE on) + +file(GLOB_RECURSE hermes_executor_SRC CONFIGURE_DEPENDS *.cpp) +add_library( + hermes-executor-common + STATIC + ${hermes_executor_SRC} +) +target_include_directories(hermes-executor-common PUBLIC .) +target_link_libraries(hermes-executor-common + jsireact + hermes-engine::libhermes + jsi + debug hermes-inspector +) + +if(${CMAKE_BUILD_TYPE} MATCHES Debug) + target_compile_options( + hermes-executor-common + PRIVATE + -DHERMES_ENABLE_DEBUGGER=1 + ) +endif() diff --git a/ReactCommon/hermes/inspector/CMakeLists.txt b/ReactCommon/hermes/inspector/CMakeLists.txt new file mode 100644 index 00000000000000..679c916b9d25c5 --- /dev/null +++ b/ReactCommon/hermes/inspector/CMakeLists.txt @@ -0,0 +1,32 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# +# This source code is licensed under the MIT license found in the +# LICENSE file in the root directory of this source tree. + +cmake_minimum_required(VERSION 3.13) +set(CMAKE_VERBOSE_MAKEFILE on) + +file(GLOB hermesinspector_SRC CONFIGURE_DEPENDS *.cpp detail/*.cpp chrome/*.cpp) + +add_library(hermes-inspector + STATIC + ${hermesinspector_SRC}) + +target_compile_options( + hermes-inspector + PRIVATE + -DHERMES_ENABLE_DEBUGGER=1 + -DHERMES_INSPECTOR_FOLLY_KLUDGE=1 + -fexceptions +) + +target_include_directories(hermes-inspector PUBLIC ${REACT_COMMON_DIR}) +target_link_libraries(hermes-inspector + jsinspector + fb + fbjni + folly_futures + folly_json + glog + hermes-engine::libhermes + jsi) diff --git a/ReactCommon/react/debug/CMakeLists.txt b/ReactCommon/react/debug/CMakeLists.txt index 7c92d79cd9c99e..f4b205314a9604 100644 --- a/ReactCommon/react/debug/CMakeLists.txt +++ b/ReactCommon/react/debug/CMakeLists.txt @@ -17,7 +17,6 @@ add_compile_options( file(GLOB react_debug_SRC CONFIGURE_DEPENDS *.cpp) add_library(react_debug SHARED ${react_debug_SRC}) -# TODO This should not be ../../.. but a proper variable -target_include_directories(react_debug PUBLIC ../../..) +target_include_directories(react_debug PUBLIC ${REACT_COMMON_DIR}) target_link_libraries(react_debug log folly_json) From 0fba8fa443c32157b72262d82108caad6016d846 Mon Sep 17 00:00:00 2001 From: Nicola Corti Date: Wed, 16 Mar 2022 03:04:41 -0700 Subject: [PATCH 30/48] Reduce stale range from 365 days to 180 days Summary: We have a lot of stale issues that are receiving essentially no traffic. Previously we used to use `stalebot` which had an interval of 90 days but was somehow unreliable. Now we moved to the state GH actions but with an interval of 365 days which I believe is potentially too high. Changelog: [Internal] [Changed] - Reduce stale range from 365 days to 180 days Created from CodeHub with https://fburl.com/edit-in-codehub Reviewed By: GijsWeterings Differential Revision: D34831199 fbshipit-source-id: 70f3f6cc97ac4add625061577e53cc80da987c7a --- .github/workflows/stale-bot.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/stale-bot.yml b/.github/workflows/stale-bot.yml index 2ef7890236e881..7baf5144f55517 100644 --- a/.github/workflows/stale-bot.yml +++ b/.github/workflows/stale-bot.yml @@ -12,8 +12,8 @@ jobs: - uses: actions/stale@v4 with: repo-token: ${{ secrets.GITHUB_TOKEN }} - days-before-stale: 365 - stale-issue-message: 'This issue is stale because it has been open 365 days with no activity. Remove stale label or comment or this will be closed in 7 days.' - stale-pr-message: 'This PR is stale because it has been open 365 days with no activity. Remove stale label or comment or this will be closed in 7 days.' + days-before-stale: 180 + stale-issue-message: 'This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.' + stale-pr-message: 'This PR is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.' close-issue-message: 'This issue was closed because it has been stalled for 7 days with no activity.' close-pr-message: 'This PR was closed because it has been stalled for 7 days with no activity.' From 10d2e4cf2e00d7452609db106cfa3dc0c58c8cb3 Mon Sep 17 00:00:00 2001 From: Nicola Corti Date: Wed, 16 Mar 2022 04:59:47 -0700 Subject: [PATCH 31/48] Fix a typo in the hermes-engine srcSet folder Summary: There is a typo in the hermes-engine resulting in hermes-engine not picking up the Intl Java source code. I'm fixing it. Changelog: [Internal] [Changed] - Fix a typo in the hermes-engine srcSet folder Reviewed By: motiz88 Differential Revision: D34922477 fbshipit-source-id: a144f7a2f75702bc8ddea73fa8b48c71d8fcd499 --- ReactAndroid/hermes-engine/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReactAndroid/hermes-engine/build.gradle b/ReactAndroid/hermes-engine/build.gradle index 8bdac48858aa03..344a3ab21a008b 100644 --- a/ReactAndroid/hermes-engine/build.gradle +++ b/ReactAndroid/hermes-engine/build.gradle @@ -164,7 +164,7 @@ android { main { manifest.srcFile "$hermesDir/android/hermes/src/main/AndroidManifest.xml" java.srcDirs = [ - "$hermesDir/lib/Platfrom/Intl/java" + "$hermesDir/lib/Platform/Intl/java" ] } } From 9e7d91f2fc4d576b8fba81304a24e50134da93d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danilo=20B=C3=BCrger?= Date: Wed, 16 Mar 2022 05:25:28 -0700 Subject: [PATCH 32/48] Re-apply: Consider relative to pwd installation root when looking for files in rn module via cocoapods (#33427) Summary: This re-applies Consider relative to pwd installation root when looking for files in rn module via cocoapods by danilobuerger The `:reactNativePath` provided by `use_native_modules!` is the rn module path relative to the installation root (usually `./ios`). However, when executing cocoapods from a dir thats not the installation root, packages that use the relative `:reactNativePath` variable in their path must also consider the relative to pwd installation root. This fixes usage of cocoapods with the `--project-directory` flag like ```bash bundle exec pod install --project-directory=ios ``` ## Changelog [iOS] [Fixed] - Fix usage of cocoapods with --project-directory flag and new arch Pull Request resolved: https://github.com/facebook/react-native/pull/33427 Test Plan: 1) Enable the new arch 2) Execute from the projects root dir ```bash bundle exec pod install --project-directory=ios ``` 3) It will fail with ``` [!] Invalid `Podfile` file: [codegen] Couldn't not find react-native-codegen.. ``` 4) Apply the patch 5) Execute from the projects root dir ```bash bundle exec pod install --project-directory=ios ``` 6) It will succeed Reviewed By: cortinico Differential Revision: D34890926 Pulled By: dmitryrykun fbshipit-source-id: f7adc6196874822d5ff38f275414f529d385f2ea --- scripts/react_native_pods.rb | 10 ++++++---- template/ios/Podfile | 4 ++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/scripts/react_native_pods.rb b/scripts/react_native_pods.rb index 97beacb7308dfe..5170c01f1234d9 100644 --- a/scripts/react_native_pods.rb +++ b/scripts/react_native_pods.rb @@ -278,8 +278,9 @@ def modify_flags_for_new_architecture(installer, cpp_flags) end def build_codegen!(react_native_path) - codegen_repo_path = "#{react_native_path}/packages/react-native-codegen"; - codegen_npm_path = "#{react_native_path}/../react-native-codegen"; + relative_installation_root = Pod::Config.instance.installation_root.relative_path_from(Pathname.pwd) + codegen_repo_path = "#{relative_installation_root}/#{react_native_path}/packages/react-native-codegen"; + codegen_npm_path = "#{relative_installation_root}/#{react_native_path}/../react-native-codegen"; codegen_cli_path = "" if Dir.exist?(codegen_repo_path) codegen_cli_path = codegen_repo_path @@ -320,7 +321,7 @@ def checkAndGenerateEmptyThirdPartyProvider!(react_native_path) Pod::Executable.execute_command( 'node', [ - "#{react_native_path}/scripts/generate-provider-cli.js", + "#{relative_installation_root}/#{react_native_path}/scripts/generate-provider-cli.js", "--platform", 'ios', "--schemaListPath", temp_schema_list_path, "--outputDir", "#{output_dir}" @@ -510,6 +511,7 @@ def use_react_native_codegen_discovery!(options={}) app_path = options[:app_path] fabric_enabled = options[:fabric_enabled] ||= false config_file_dir = options[:config_file_dir] ||= '' + relative_installation_root = Pod::Config.instance.installation_root.relative_path_from(Pathname.pwd) if !app_path Pod::UI.warn '[Codegen] Error: app_path is required for use_react_native_codegen_discovery.' @@ -525,7 +527,7 @@ def use_react_native_codegen_discovery!(options={}) out = Pod::Executable.execute_command( 'node', [ - "#{react_native_path}/scripts/generate-artifacts.js", + "#{relative_installation_root}/#{react_native_path}/scripts/generate-artifacts.js", "-p", "#{app_path}", "-o", Pod::Config.instance.installation_root, "-e", "#{fabric_enabled}", diff --git a/template/ios/Podfile b/template/ios/Podfile index 54920362cc31f1..01506faf7913c7 100644 --- a/template/ios/Podfile +++ b/template/ios/Podfile @@ -15,8 +15,8 @@ target 'HelloWorld' do # to enable hermes on iOS, change `false` to `true` and then install pods :hermes_enabled => flags[:hermes_enabled], :fabric_enabled => flags[:fabric_enabled], - # An abosolute path to your application root. - :app_path => "#{Dir.pwd}/.." + # An absolute path to your application root. + :app_path => "#{Pod::Config.instance.installation_root}/.." ) target 'HelloWorldTests' do From e5874d90e20adce5c0350ce1794c6c1f759eae3b Mon Sep 17 00:00:00 2001 From: Andrei Shikov Date: Wed, 16 Mar 2022 08:10:55 -0700 Subject: [PATCH 33/48] Folly_runtime for CMake Summary: Ports improvements from Android.mk setup to CMake, replacing folly_json and futures with runtime where plausible Changelog: [Internal] - CMake folly_runtime setup Reviewed By: cortinico Differential Revision: D34854295 fbshipit-source-id: fa882a9cd0b78feb20f8abcc9350c27702375def --- .../hermes/reactexecutor/CMakeLists.txt | 2 +- .../react/common/mapbuffer/jni/CMakeLists.txt | 3 +- .../facebook/react/jscexecutor/CMakeLists.txt | 2 +- .../react/modules/blob/jni/CMakeLists.txt | 2 +- .../react/uimanager/jni/CMakeLists.txt | 3 +- .../src/main/jni/react/jni/CMakeLists.txt | 4 +- .../main/jni/third-party/folly/CMakeLists.txt | 39 ++++++++++--------- ReactCommon/cxxreact/CMakeLists.txt | 2 +- ReactCommon/hermes/inspector/CMakeLists.txt | 2 +- ReactCommon/jsi/CMakeLists.txt | 4 +- ReactCommon/jsiexecutor/CMakeLists.txt | 2 +- ReactCommon/react/debug/CMakeLists.txt | 2 +- .../react/nativemodule/core/CMakeLists.txt | 2 +- .../react/renderer/animations/CMakeLists.txt | 3 +- .../renderer/attributedstring/CMakeLists.txt | 3 +- .../renderer/componentregistry/CMakeLists.txt | 3 +- .../componentregistry/native/CMakeLists.txt | 3 +- .../renderer/components/image/CMakeLists.txt | 2 +- .../renderer/components/root/CMakeLists.txt | 3 +- .../components/scrollview/CMakeLists.txt | 3 +- .../renderer/components/text/CMakeLists.txt | 2 +- .../components/textinput/CMakeLists.txt | 2 +- .../unimplementedview/CMakeLists.txt | 3 +- .../react/renderer/components/view/Android.mk | 1 - .../renderer/components/view/CMakeLists.txt | 3 +- .../react/renderer/core/CMakeLists.txt | 3 +- .../react/renderer/debug/CMakeLists.txt | 2 +- .../react/renderer/graphics/CMakeLists.txt | 2 +- .../renderer/imagemanager/CMakeLists.txt | 2 +- .../react/renderer/mounting/CMakeLists.txt | 3 +- .../react/renderer/scheduler/CMakeLists.txt | 3 +- .../react/renderer/telemetry/CMakeLists.txt | 3 +- .../renderer/templateprocessor/CMakeLists.txt | 3 +- .../renderer/textlayoutmanager/CMakeLists.txt | 3 +- .../react/renderer/uimanager/CMakeLists.txt | 3 +- 35 files changed, 55 insertions(+), 72 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/hermes/reactexecutor/CMakeLists.txt b/ReactAndroid/src/main/java/com/facebook/hermes/reactexecutor/CMakeLists.txt index c4d47fb0123dba..d446141c7ed92d 100644 --- a/ReactAndroid/src/main/java/com/facebook/hermes/reactexecutor/CMakeLists.txt +++ b/ReactAndroid/src/main/java/com/facebook/hermes/reactexecutor/CMakeLists.txt @@ -34,7 +34,7 @@ target_link_libraries( jsireact fb fbjni - folly_json + folly_runtime hermes-engine::libhermes jsi reactnativejni diff --git a/ReactAndroid/src/main/java/com/facebook/react/common/mapbuffer/jni/CMakeLists.txt b/ReactAndroid/src/main/java/com/facebook/react/common/mapbuffer/jni/CMakeLists.txt index 680ab4bd274697..0aca9cb0f4eeca 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/common/mapbuffer/jni/CMakeLists.txt +++ b/ReactAndroid/src/main/java/com/facebook/react/common/mapbuffer/jni/CMakeLists.txt @@ -23,8 +23,7 @@ target_include_directories(mapbufferjni target_link_libraries(mapbufferjni fb fbjni - folly_futures - folly_json + folly_runtime glog glog_init react_debug diff --git a/ReactAndroid/src/main/java/com/facebook/react/jscexecutor/CMakeLists.txt b/ReactAndroid/src/main/java/com/facebook/react/jscexecutor/CMakeLists.txt index 193426ca041f1b..464aa19ccef868 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/jscexecutor/CMakeLists.txt +++ b/ReactAndroid/src/main/java/com/facebook/react/jscexecutor/CMakeLists.txt @@ -18,6 +18,6 @@ target_link_libraries(jscexecutor jscruntime fb fbjni - folly_json + folly_runtime jsi reactnativejni) diff --git a/ReactAndroid/src/main/java/com/facebook/react/modules/blob/jni/CMakeLists.txt b/ReactAndroid/src/main/java/com/facebook/react/modules/blob/jni/CMakeLists.txt index 023737c44ad515..d28871fdff69e6 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/modules/blob/jni/CMakeLists.txt +++ b/ReactAndroid/src/main/java/com/facebook/react/modules/blob/jni/CMakeLists.txt @@ -17,6 +17,6 @@ target_link_libraries(reactnativeblob jsireact fb fbjni - folly_json + folly_runtime jsi reactnativejni) diff --git a/ReactAndroid/src/main/java/com/facebook/react/uimanager/jni/CMakeLists.txt b/ReactAndroid/src/main/java/com/facebook/react/uimanager/jni/CMakeLists.txt index 411832021cb6b0..3a3dbe33212521 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/uimanager/jni/CMakeLists.txt +++ b/ReactAndroid/src/main/java/com/facebook/react/uimanager/jni/CMakeLists.txt @@ -16,8 +16,7 @@ target_include_directories(uimanagerjni PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) target_link_libraries(uimanagerjni fb fbjni - folly_futures - folly_json + folly_runtime glog glog_init rrc_native diff --git a/ReactAndroid/src/main/jni/react/jni/CMakeLists.txt b/ReactAndroid/src/main/jni/react/jni/CMakeLists.txt index bacaa743f2dc80..e1a8f58857a598 100644 --- a/ReactAndroid/src/main/jni/react/jni/CMakeLists.txt +++ b/ReactAndroid/src/main/jni/react/jni/CMakeLists.txt @@ -34,7 +34,7 @@ target_link_libraries(reactnativeutilsjni callinvokerholder fb fbjni - folly_json + folly_runtime glog_init react_render_runtimescheduler reactnative @@ -61,7 +61,7 @@ target_link_libraries(reactnativejni callinvokerholder fb fbjni - folly_json + folly_runtime glog_init logger react_render_runtimescheduler diff --git a/ReactAndroid/src/main/jni/third-party/folly/CMakeLists.txt b/ReactAndroid/src/main/jni/third-party/folly/CMakeLists.txt index 7b06ec29819688..3df8389ed82c18 100644 --- a/ReactAndroid/src/main/jni/third-party/folly/CMakeLists.txt +++ b/ReactAndroid/src/main/jni/third-party/folly/CMakeLists.txt @@ -19,10 +19,18 @@ SET(folly_FLAGS ) ################## -### folly_json ### +### folly_runtime ### ################## -SET(folly_json_SRC +SET(folly_runtime_SRC + folly/SharedMutex.cpp + folly/concurrency/CacheLocality.cpp + folly/detail/Futex.cpp + folly/lang/SafeAssert.cpp + folly/lang/ToAscii.cpp + folly/synchronization/ParkingLot.cpp + folly/system/ThreadId.cpp + folly/system/ThreadName.cpp folly/json.cpp folly/Unicode.cpp folly/Conv.cpp @@ -35,21 +43,19 @@ SET(folly_json_SRC folly/net/NetOps.cpp folly/json_pointer.cpp folly/lang/CString.cpp - folly/lang/SafeAssert.cpp folly/detail/UniqueInstance.cpp folly/hash/SpookyHashV2.cpp folly/container/detail/F14Table.cpp folly/ScopeGuard.cpp - folly/portability/SysUio.cpp - folly/lang/ToAscii.cpp) + folly/portability/SysUio.cpp) IF (CMAKE_BUILD_TYPE MATCHES Debug) - list(APPEND folly_json_SRC folly/lang/Assume.cpp) + list(APPEND folly_runtime_SRC folly/lang/Assume.cpp) ENDIF () -add_library(folly_json SHARED ${folly_json_SRC}) +add_library(folly_runtime SHARED ${folly_runtime_SRC}) -target_compile_options(folly_json +target_compile_options(folly_runtime PRIVATE -fexceptions -fno-omit-frame-pointer @@ -57,26 +63,24 @@ target_compile_options(folly_json -Wno-sign-compare ${folly_FLAGS}) -target_compile_options(folly_json PUBLIC ${folly_FLAGS}) +target_compile_options(folly_runtime PUBLIC ${folly_FLAGS}) -target_include_directories(folly_json PUBLIC .) -target_link_libraries(folly_json glog double-conversion boost fmt) +target_include_directories(folly_runtime PUBLIC .) +target_link_libraries(folly_runtime glog double-conversion boost fmt) ##################### ### folly_futures ### ##################### -add_library(folly_futures SHARED +add_library(folly_futures STATIC folly/ExceptionWrapper.cpp folly/ExceptionString.cpp folly/Executor.cpp - folly/SharedMutex.cpp folly/Singleton.cpp folly/Try.cpp folly/concurrency/CacheLocality.cpp folly/detail/AsyncTrace.cpp folly/detail/AtFork.cpp - folly/detail/Futex.cpp folly/detail/MemoryIdler.cpp folly/detail/SingletonStackTrace.cpp folly/detail/StaticSingletonManager.cpp @@ -106,12 +110,9 @@ add_library(folly_futures SHARED folly/portability/SysMembarrier.cpp folly/synchronization/AsymmetricMemoryBarrier.cpp folly/synchronization/Hazptr.cpp - folly/synchronization/ParkingLot.cpp folly/synchronization/WaitOptions.cpp folly/synchronization/detail/Sleeper.cpp - folly/system/Pid.cpp - folly/system/ThreadId.cpp - folly/system/ThreadName.cpp) + folly/system/Pid.cpp) target_compile_options(folly_futures PRIVATE @@ -122,4 +123,4 @@ target_compile_options(folly_futures -Wno-unused-variable) target_include_directories(folly_futures PUBLIC .) -target_link_libraries(folly_futures glog double-conversion folly_json boost event fmt) +target_link_libraries(folly_futures glog double-conversion folly_runtime boost event fmt) diff --git a/ReactCommon/cxxreact/CMakeLists.txt b/ReactCommon/cxxreact/CMakeLists.txt index ace8f7c982c8b4..5518b0909efc27 100644 --- a/ReactCommon/cxxreact/CMakeLists.txt +++ b/ReactCommon/cxxreact/CMakeLists.txt @@ -20,7 +20,7 @@ target_include_directories(reactnative PUBLIC ${REACT_COMMON_DIR}) target_link_libraries(reactnative boost callinvoker - folly_json + folly_runtime glog jsi jsinspector diff --git a/ReactCommon/hermes/inspector/CMakeLists.txt b/ReactCommon/hermes/inspector/CMakeLists.txt index 679c916b9d25c5..14f6f1ce263900 100644 --- a/ReactCommon/hermes/inspector/CMakeLists.txt +++ b/ReactCommon/hermes/inspector/CMakeLists.txt @@ -26,7 +26,7 @@ target_link_libraries(hermes-inspector fb fbjni folly_futures - folly_json + folly_runtime glog hermes-engine::libhermes jsi) diff --git a/ReactCommon/jsi/CMakeLists.txt b/ReactCommon/jsi/CMakeLists.txt index d4bf231143ec00..3f2a8c15d3faaa 100644 --- a/ReactCommon/jsi/CMakeLists.txt +++ b/ReactCommon/jsi/CMakeLists.txt @@ -23,7 +23,7 @@ add_library(jsi SHARED ${jsi_SRC}) target_include_directories(jsi PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) target_link_libraries(jsi - folly_json + folly_runtime glog) ################## @@ -36,7 +36,7 @@ add_library(jscruntime STATIC target_include_directories(jscruntime PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) -target_link_libraries(jscruntime folly_json jsc glog) +target_link_libraries(jscruntime folly_runtime jsc glog) # TODO: Remove this flag when ready. # Android has this enabled by default, but the flag is still needed for iOS. diff --git a/ReactCommon/jsiexecutor/CMakeLists.txt b/ReactCommon/jsiexecutor/CMakeLists.txt index 50f922c7217868..68597560a0c69c 100644 --- a/ReactCommon/jsiexecutor/CMakeLists.txt +++ b/ReactCommon/jsiexecutor/CMakeLists.txt @@ -18,6 +18,6 @@ target_include_directories(jsireact PUBLIC .) target_link_libraries(jsireact reactnative reactperflogger - folly_json + folly_runtime glog jsi) diff --git a/ReactCommon/react/debug/CMakeLists.txt b/ReactCommon/react/debug/CMakeLists.txt index f4b205314a9604..c325fcead16bd9 100644 --- a/ReactCommon/react/debug/CMakeLists.txt +++ b/ReactCommon/react/debug/CMakeLists.txt @@ -19,4 +19,4 @@ add_library(react_debug SHARED ${react_debug_SRC}) target_include_directories(react_debug PUBLIC ${REACT_COMMON_DIR}) -target_link_libraries(react_debug log folly_json) +target_link_libraries(react_debug log folly_runtime) diff --git a/ReactCommon/react/nativemodule/core/CMakeLists.txt b/ReactCommon/react/nativemodule/core/CMakeLists.txt index 844e3493a2287c..841ee87087ce0d 100644 --- a/ReactCommon/react/nativemodule/core/CMakeLists.txt +++ b/ReactCommon/react/nativemodule/core/CMakeLists.txt @@ -24,7 +24,7 @@ target_include_directories(react_nativemodule_core target_link_libraries(react_nativemodule_core fbjni - folly_json + folly_runtime jsi react_bridging react_debug diff --git a/ReactCommon/react/renderer/animations/CMakeLists.txt b/ReactCommon/react/renderer/animations/CMakeLists.txt index 9d325d51d3171f..75e3bc4c3632f3 100644 --- a/ReactCommon/react/renderer/animations/CMakeLists.txt +++ b/ReactCommon/react/renderer/animations/CMakeLists.txt @@ -14,8 +14,7 @@ add_library(react_render_animations SHARED ${react_render_animations_SRC}) target_include_directories(react_render_animations PUBLIC ${REACT_COMMON_DIR}) target_link_libraries(react_render_animations - folly_futures - folly_json + folly_runtime glog glog_init jsi diff --git a/ReactCommon/react/renderer/attributedstring/CMakeLists.txt b/ReactCommon/react/renderer/attributedstring/CMakeLists.txt index decca1b6310f8a..03bc7df962d37c 100644 --- a/ReactCommon/react/renderer/attributedstring/CMakeLists.txt +++ b/ReactCommon/react/renderer/attributedstring/CMakeLists.txt @@ -15,8 +15,7 @@ target_include_directories(react_render_attributedstring PUBLIC ${REACT_COMMON_D target_link_libraries(react_render_attributedstring butter - folly_futures - folly_json + folly_runtime glog glog_init react_debug diff --git a/ReactCommon/react/renderer/componentregistry/CMakeLists.txt b/ReactCommon/react/renderer/componentregistry/CMakeLists.txt index 8b924260dfd8d7..23b256112aa1a8 100644 --- a/ReactCommon/react/renderer/componentregistry/CMakeLists.txt +++ b/ReactCommon/react/renderer/componentregistry/CMakeLists.txt @@ -14,8 +14,7 @@ add_library(react_render_componentregistry SHARED ${react_render_componentregist target_include_directories(react_render_componentregistry PUBLIC ${REACT_COMMON_DIR}) target_link_libraries(react_render_componentregistry - folly_futures - folly_json + folly_runtime glog_init jsi react_debug diff --git a/ReactCommon/react/renderer/componentregistry/native/CMakeLists.txt b/ReactCommon/react/renderer/componentregistry/native/CMakeLists.txt index 89c0792c4bfdc3..270c2e4334502a 100644 --- a/ReactCommon/react/renderer/componentregistry/native/CMakeLists.txt +++ b/ReactCommon/react/renderer/componentregistry/native/CMakeLists.txt @@ -14,8 +14,7 @@ add_library(rrc_native SHARED ${rrc_native_SRC}) target_include_directories(rrc_native PUBLIC ${REACT_COMMON_DIR}) target_link_libraries(rrc_native - folly_futures - folly_json + folly_runtime glog_init jsi react_debug diff --git a/ReactCommon/react/renderer/components/image/CMakeLists.txt b/ReactCommon/react/renderer/components/image/CMakeLists.txt index 49b8030a4a1ede..c78c9a26b80440 100644 --- a/ReactCommon/react/renderer/components/image/CMakeLists.txt +++ b/ReactCommon/react/renderer/components/image/CMakeLists.txt @@ -15,7 +15,7 @@ target_include_directories(rrc_image PUBLIC ${REACT_COMMON_DIR}) target_link_libraries(rrc_image glog - folly_json + folly_runtime glog_init jsi react_debug diff --git a/ReactCommon/react/renderer/components/root/CMakeLists.txt b/ReactCommon/react/renderer/components/root/CMakeLists.txt index 2da824a8ece21d..96b43b7498a485 100644 --- a/ReactCommon/react/renderer/components/root/CMakeLists.txt +++ b/ReactCommon/react/renderer/components/root/CMakeLists.txt @@ -14,8 +14,7 @@ add_library(rrc_root SHARED ${rrc_root_SRC}) target_include_directories(rrc_root PUBLIC ${REACT_COMMON_DIR}) target_link_libraries(rrc_root - folly_futures - folly_json + folly_runtime glog glog_init react_debug diff --git a/ReactCommon/react/renderer/components/scrollview/CMakeLists.txt b/ReactCommon/react/renderer/components/scrollview/CMakeLists.txt index 5d64f56ab05788..92927ff967889c 100644 --- a/ReactCommon/react/renderer/components/scrollview/CMakeLists.txt +++ b/ReactCommon/react/renderer/components/scrollview/CMakeLists.txt @@ -15,8 +15,7 @@ target_include_directories(rrc_scrollview PUBLIC ${REACT_COMMON_DIR}) target_link_libraries(rrc_scrollview glog - folly_futures - folly_json + folly_runtime glog_init jsi react_debug diff --git a/ReactCommon/react/renderer/components/text/CMakeLists.txt b/ReactCommon/react/renderer/components/text/CMakeLists.txt index 404c5d429e8329..392d76171b476e 100644 --- a/ReactCommon/react/renderer/components/text/CMakeLists.txt +++ b/ReactCommon/react/renderer/components/text/CMakeLists.txt @@ -15,7 +15,7 @@ target_include_directories(rrc_text PUBLIC ${REACT_COMMON_DIR}) target_link_libraries(rrc_text glog - folly_json + folly_runtime glog_init jsi react_debug diff --git a/ReactCommon/react/renderer/components/textinput/CMakeLists.txt b/ReactCommon/react/renderer/components/textinput/CMakeLists.txt index cd91ccf67ce8d8..863494fc41723d 100644 --- a/ReactCommon/react/renderer/components/textinput/CMakeLists.txt +++ b/ReactCommon/react/renderer/components/textinput/CMakeLists.txt @@ -20,7 +20,7 @@ target_include_directories(rrc_textinput target_link_libraries(rrc_textinput glog - folly_json + folly_runtime glog_init jsi react_debug diff --git a/ReactCommon/react/renderer/components/unimplementedview/CMakeLists.txt b/ReactCommon/react/renderer/components/unimplementedview/CMakeLists.txt index 0093c01eab2f70..7b128501bd812d 100644 --- a/ReactCommon/react/renderer/components/unimplementedview/CMakeLists.txt +++ b/ReactCommon/react/renderer/components/unimplementedview/CMakeLists.txt @@ -15,8 +15,7 @@ target_include_directories(rrc_unimplementedview PUBLIC ${REACT_COMMON_DIR}) target_link_libraries(rrc_unimplementedview glog - folly_futures - folly_json + folly_runtime glog_init jsi react_debug diff --git a/ReactCommon/react/renderer/components/view/Android.mk b/ReactCommon/react/renderer/components/view/Android.mk index 59d3b01ed9ab50..01f14d057ca5cb 100644 --- a/ReactCommon/react/renderer/components/view/Android.mk +++ b/ReactCommon/react/renderer/components/view/Android.mk @@ -24,7 +24,6 @@ LOCAL_STATIC_LIBRARIES := LOCAL_SHARED_LIBRARIES := \ glog \ libfolly_runtime \ - libfolly_futures \ libglog_init \ libjsi \ libreact_debug \ diff --git a/ReactCommon/react/renderer/components/view/CMakeLists.txt b/ReactCommon/react/renderer/components/view/CMakeLists.txt index f11b2077112e7e..6320bd0bdfb033 100644 --- a/ReactCommon/react/renderer/components/view/CMakeLists.txt +++ b/ReactCommon/react/renderer/components/view/CMakeLists.txt @@ -14,8 +14,7 @@ add_library(rrc_view SHARED ${rrc_view_SRC}) target_include_directories(rrc_view PUBLIC ${REACT_COMMON_DIR}) target_link_libraries(rrc_view - folly_futures - folly_json + folly_runtime glog glog_init jsi diff --git a/ReactCommon/react/renderer/core/CMakeLists.txt b/ReactCommon/react/renderer/core/CMakeLists.txt index c63d82f867ac08..890e6e68c8d5f7 100644 --- a/ReactCommon/react/renderer/core/CMakeLists.txt +++ b/ReactCommon/react/renderer/core/CMakeLists.txt @@ -13,8 +13,7 @@ add_library(react_render_core SHARED ${react_render_core_SRC}) target_include_directories(react_render_core PUBLIC ${REACT_COMMON_DIR}) target_link_libraries(react_render_core - folly_futures - folly_json + folly_runtime glog jsi react_debug diff --git a/ReactCommon/react/renderer/debug/CMakeLists.txt b/ReactCommon/react/renderer/debug/CMakeLists.txt index 04bda64b346289..44c5fd4c92dece 100644 --- a/ReactCommon/react/renderer/debug/CMakeLists.txt +++ b/ReactCommon/react/renderer/debug/CMakeLists.txt @@ -12,4 +12,4 @@ file(GLOB react_render_debug_SRC CONFIGURE_DEPENDS *.cpp) add_library(react_render_debug SHARED ${react_render_debug_SRC}) target_include_directories(react_render_debug PUBLIC ${REACT_COMMON_DIR}) -target_link_libraries(react_render_debug folly_json) +target_link_libraries(react_render_debug folly_runtime) diff --git a/ReactCommon/react/renderer/graphics/CMakeLists.txt b/ReactCommon/react/renderer/graphics/CMakeLists.txt index a566f9b1c2f794..a52ce0bfe1fdbd 100644 --- a/ReactCommon/react/renderer/graphics/CMakeLists.txt +++ b/ReactCommon/react/renderer/graphics/CMakeLists.txt @@ -22,4 +22,4 @@ target_include_directories(react_render_graphics ${CMAKE_CURRENT_SOURCE_DIR}/platform/cxx/ ) -target_link_libraries(react_render_graphics glog fb fbjni folly_json react_debug) +target_link_libraries(react_render_graphics glog fb fbjni folly_runtime react_debug) diff --git a/ReactCommon/react/renderer/imagemanager/CMakeLists.txt b/ReactCommon/react/renderer/imagemanager/CMakeLists.txt index a53133c95e22bd..c27b11febcc364 100644 --- a/ReactCommon/react/renderer/imagemanager/CMakeLists.txt +++ b/ReactCommon/react/renderer/imagemanager/CMakeLists.txt @@ -25,7 +25,7 @@ target_include_directories(react_render_imagemanager ) target_link_libraries(react_render_imagemanager - folly_json + folly_runtime react_debug react_render_core react_render_debug diff --git a/ReactCommon/react/renderer/mounting/CMakeLists.txt b/ReactCommon/react/renderer/mounting/CMakeLists.txt index 6b6209a24a3fe6..58b3124362400f 100644 --- a/ReactCommon/react/renderer/mounting/CMakeLists.txt +++ b/ReactCommon/react/renderer/mounting/CMakeLists.txt @@ -16,8 +16,7 @@ target_include_directories(react_render_mounting PUBLIC ${REACT_COMMON_DIR}) target_link_libraries(react_render_mounting butter - folly_futures - folly_json + folly_runtime glog glog_init jsi diff --git a/ReactCommon/react/renderer/scheduler/CMakeLists.txt b/ReactCommon/react/renderer/scheduler/CMakeLists.txt index 260e40cba8b00b..3823b9d3c1e102 100644 --- a/ReactCommon/react/renderer/scheduler/CMakeLists.txt +++ b/ReactCommon/react/renderer/scheduler/CMakeLists.txt @@ -14,8 +14,7 @@ add_library(react_render_scheduler SHARED ${react_render_scheduler_SRC}) target_include_directories(react_render_scheduler PUBLIC ${REACT_COMMON_DIR}) target_link_libraries(react_render_scheduler - folly_futures - folly_json + folly_runtime glog jsi react_config diff --git a/ReactCommon/react/renderer/telemetry/CMakeLists.txt b/ReactCommon/react/renderer/telemetry/CMakeLists.txt index bcbbf0b82f2fec..cad8f9e81cd3c2 100644 --- a/ReactCommon/react/renderer/telemetry/CMakeLists.txt +++ b/ReactCommon/react/renderer/telemetry/CMakeLists.txt @@ -15,8 +15,7 @@ target_include_directories(react_render_telemetry PUBLIC ${REACT_COMMON_DIR}) target_link_libraries(react_render_telemetry butter - folly_futures - folly_json + folly_runtime glog glog_init react_debug diff --git a/ReactCommon/react/renderer/templateprocessor/CMakeLists.txt b/ReactCommon/react/renderer/templateprocessor/CMakeLists.txt index 07d119ceacb34b..2aeaa6d101f478 100644 --- a/ReactCommon/react/renderer/templateprocessor/CMakeLists.txt +++ b/ReactCommon/react/renderer/templateprocessor/CMakeLists.txt @@ -14,8 +14,7 @@ add_library(react_render_templateprocessor SHARED ${react_render_templateprocess target_include_directories(react_render_templateprocessor PUBLIC ${REACT_COMMON_DIR}) target_link_libraries(react_render_templateprocessor - folly_futures - folly_json + folly_runtime glog jsi react_config diff --git a/ReactCommon/react/renderer/textlayoutmanager/CMakeLists.txt b/ReactCommon/react/renderer/textlayoutmanager/CMakeLists.txt index 2098cbe60a8154..cb12805f3c546d 100644 --- a/ReactCommon/react/renderer/textlayoutmanager/CMakeLists.txt +++ b/ReactCommon/react/renderer/textlayoutmanager/CMakeLists.txt @@ -26,8 +26,7 @@ target_link_libraries(react_render_textlayoutmanager glog fb fbjni - folly_futures - folly_json + folly_runtime glog_init mapbufferjni react_debug diff --git a/ReactCommon/react/renderer/uimanager/CMakeLists.txt b/ReactCommon/react/renderer/uimanager/CMakeLists.txt index 42433e50292a20..0d9f7403b05b8c 100644 --- a/ReactCommon/react/renderer/uimanager/CMakeLists.txt +++ b/ReactCommon/react/renderer/uimanager/CMakeLists.txt @@ -15,8 +15,7 @@ target_include_directories(react_render_uimanager PUBLIC ${REACT_COMMON_DIR}) target_link_libraries(react_render_uimanager glog - folly_futures - folly_json + folly_runtime jsi react_debug react_render_componentregistry From b2454f9e669d2972ae1900fc2431b54697c68031 Mon Sep 17 00:00:00 2001 From: Genki Kondo Date: Wed, 16 Mar 2022 10:38:50 -0700 Subject: [PATCH 34/48] Add feature flag for spannable cache Summary: sSpannableCache is a significant user of Java heap memory - up to 0.22MB is retained by sSpannableCache. It turns out sSpannableCache was never hitting as hashCode is different for the same attributedString contents. attributedString.getInt("hash") provides the expected hash code. This indicates removing spannableCache will not affect perf. Will gate just in case though. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D34900414 fbshipit-source-id: 7563cde6ba9dc153072e7aebede99389ce3153e7 --- .../react/config/ReactFeatureFlags.java | 3 +++ .../react/views/text/TextLayoutManager.java | 27 ++++++++++++------- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/config/ReactFeatureFlags.java b/ReactAndroid/src/main/java/com/facebook/react/config/ReactFeatureFlags.java index 0010116c606221..c2924d31025117 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/config/ReactFeatureFlags.java +++ b/ReactAndroid/src/main/java/com/facebook/react/config/ReactFeatureFlags.java @@ -109,4 +109,7 @@ public static boolean doesUseOverflowInset() { * JNI. */ public static boolean enableLargeTextMeasureCache = true; + + /** TODO: T113245006 Delete this flag. Enables caching of spannables for text */ + public static boolean enableSpannableCache = false; } diff --git a/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.java b/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.java index ecf50f5df77990..5c3ec6644d5025 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.java +++ b/ReactAndroid/src/main/java/com/facebook/react/views/text/TextLayoutManager.java @@ -31,6 +31,7 @@ import com.facebook.react.bridge.ReadableNativeMap; import com.facebook.react.bridge.WritableArray; import com.facebook.react.common.build.ReactBuildConfig; +import com.facebook.react.config.ReactFeatureFlags; import com.facebook.react.uimanager.PixelUtil; import com.facebook.react.uimanager.ReactAccessibilityDelegate; import com.facebook.react.uimanager.ReactStylesDiffMap; @@ -197,19 +198,25 @@ public static Spannable getOrCreateSpannableForText( Spannable preparedSpannableText; - synchronized (sSpannableCacheLock) { - preparedSpannableText = sSpannableCache.get((ReadableNativeMap) attributedString); - if (preparedSpannableText != null) { - return preparedSpannableText; + if (ReactFeatureFlags.enableSpannableCache) { + synchronized (sSpannableCacheLock) { + preparedSpannableText = sSpannableCache.get((ReadableNativeMap) attributedString); + if (preparedSpannableText != null) { + return preparedSpannableText; + } } - } - preparedSpannableText = - createSpannableFromAttributedString( - context, attributedString, reactTextViewManagerCallback); + preparedSpannableText = + createSpannableFromAttributedString( + context, attributedString, reactTextViewManagerCallback); - synchronized (sSpannableCacheLock) { - sSpannableCache.put((ReadableNativeMap) attributedString, preparedSpannableText); + synchronized (sSpannableCacheLock) { + sSpannableCache.put((ReadableNativeMap) attributedString, preparedSpannableText); + } + } else { + preparedSpannableText = + createSpannableFromAttributedString( + context, attributedString, reactTextViewManagerCallback); } return preparedSpannableText; From 8200f915982dd47ece6c5586d8a1f9cb58c32689 Mon Sep 17 00:00:00 2001 From: Nicola Corti Date: Wed, 16 Mar 2022 12:24:55 -0700 Subject: [PATCH 35/48] Disable prefab publishing if REACT_NATIVE_HERMES_SKIP_PREFAB is set. (#33439) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/33439 This allows us to toggle the publishing of prefab if the `REACT_NATIVE_HERMES_SKIP_PREFAB` env variable is set. With this we can control how big is the .aar of hermes-engine, reducing the size from ~200Mb right now to 8Mb. Changelog: [Internal] [Changed] - Disable prefab publishing if REACT_NATIVE_HERMES_SKIP_PREFAB is set Reviewed By: ShikaSD Differential Revision: D34929265 fbshipit-source-id: eb710b72ee4e17ac04c2924ffdac7a542928e9f8 --- ReactAndroid/build.gradle | 8 +------- ReactAndroid/hermes-engine/build.gradle | 9 +++++---- gradle.properties | 5 ----- scripts/publish-npm.js | 9 ++++++++- 4 files changed, 14 insertions(+), 17 deletions(-) mode change 100644 => 100755 scripts/publish-npm.js diff --git a/ReactAndroid/build.gradle b/ReactAndroid/build.gradle index 9f5578c1670908..af1b7dfe361934 100644 --- a/ReactAndroid/build.gradle +++ b/ReactAndroid/build.gradle @@ -249,7 +249,6 @@ final def extractNativeDependencies = tasks.register('extractNativeDependencies' task installArchives { dependsOn("publishReleasePublicationToNpmRepository") - dependsOn(":ReactAndroid:hermes-engine:installArchives") } // Creating sources with comments @@ -374,12 +373,7 @@ dependencies { // It's up to the consumer to decide if hermes should be included or not. // Therefore hermes-engine is a compileOnly dependency. - // Moreover, you can toggle where to get the dependency with `buildHermesFromSource`. - if (project.getProperties().getOrDefault("buildHermesFromSource", "false").toBoolean()) { - compileOnly(project(":ReactAndroid:hermes-engine")) - } else { - compileOnly("com.facebook.react:hermes-engine:${VERSION_NAME}") - } + compileOnly(project(":ReactAndroid:hermes-engine")) javadocDeps("com.squareup:javapoet:1.13.0") diff --git a/ReactAndroid/hermes-engine/build.gradle b/ReactAndroid/hermes-engine/build.gradle index 344a3ab21a008b..bc9975c8838bf5 100644 --- a/ReactAndroid/hermes-engine/build.gradle +++ b/ReactAndroid/hermes-engine/build.gradle @@ -29,6 +29,10 @@ if (hermesVersionFile.exists()) { def ndkBuildJobs = Runtime.runtime.availableProcessors().toString() def prefabHeadersDir = new File("$buildDir/prefab-headers") +// By setting REACT_NATIVE_HERMES_SKIP_PREFAB you can skip prefab publishing, to +// reduce the size of the Hermes published .AAR. +def skipPrefabPublishing = System.getenv("REACT_NATIVE_HERMES_SKIP_PREFAB") != null + // We inject the JSI directory used inside the Hermes build with the -DJSI_DIR config. def jsiDir = rootProject.file("ReactCommon/jsi") @@ -171,6 +175,7 @@ android { buildFeatures { prefab true + prefabPublishing !skipPrefabPublishing } dependencies { @@ -194,10 +199,6 @@ android { } } - buildFeatures { - prefabPublishing true - } - prefab { libhermes { headers prefabHeadersDir.absolutePath diff --git a/gradle.properties b/gradle.properties index af6f360e59d4ca..d8559b0b86ab3f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -11,8 +11,3 @@ kotlin_version=1.6.10 # You can also override it from the CLI using # ./gradlew -PreactNativeArchitectures=x86_64 reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64 - -# Use this property if hermes should be built from source or not. -# If set to true, ReactAndroid will depend on :packages:hermes-engine and will build it from source. -# If set to false, ReactAndroid will depend a hermes .aar which should be placed inside ./android folder. -buildHermesFromSource=true diff --git a/scripts/publish-npm.js b/scripts/publish-npm.js old mode 100644 new mode 100755 index b25c5525c2d650..082776561727bc --- a/scripts/publish-npm.js +++ b/scripts/publish-npm.js @@ -31,7 +31,7 @@ * * or otherwise `{major}.{minor}-stable` */ -const {exec, echo, exit, test} = require('shelljs'); +const {exec, echo, exit, test, env} = require('shelljs'); const {parseVersion, isTaggedLatest} = require('./version-utils'); const fs = require('fs'); const os = require('os'); @@ -176,6 +176,13 @@ if (exec('./gradlew :ReactAndroid:installArchives').code) { exit(1); } +// -------- Generating the Hermes Engine Artifacts +env.REACT_NATIVE_HERMES_SKIP_PREFAB = true; +if (exec('./gradlew :ReactAndroid:hermes-engine:installArchives').code) { + echo('Could not generate artifacts'); + exit(1); +} + // undo uncommenting javadoc setting exec('git checkout ReactAndroid/gradle.properties'); From 9527ab1584869d7966c562e8aa7cbf48788156a3 Mon Sep 17 00:00:00 2001 From: Xin Chen Date: Wed, 16 Mar 2022 15:13:53 -0700 Subject: [PATCH 36/48] Add null check for context in redbox surface delegate Summary: The context could be null or is finishing when we create the redbox surface content view. This diff adds the null check and delegate the message in log when context is not available. Changelog: [Android][Fixed] - Adding null check for context in redbox surface delegate Differential Revision: D34930595 fbshipit-source-id: 91508ded7821033abcd893f70bcfe3cc9ee5b5c2 --- .../facebook/react/devsupport/DevSupportManagerBase.java | 5 +++-- .../react/devsupport/RedBoxDialogSurfaceDelegate.java | 9 +++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevSupportManagerBase.java b/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevSupportManagerBase.java index 7b1ba63c521f2f..8424b487de99d6 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevSupportManagerBase.java +++ b/ReactAndroid/src/main/java/com/facebook/react/devsupport/DevSupportManagerBase.java @@ -343,6 +343,9 @@ private void showNewError( new Runnable() { @Override public void run() { + // Keep a copy of the latest error to be shown by the RedBoxSurface + updateLastErrorInfo(message, stack, errorCookie, errorType); + if (mRedBoxSurfaceDelegate == null) { @Nullable SurfaceDelegate redBoxSurfaceDelegate = createSurfaceDelegate("RedBox"); if (redBoxSurfaceDelegate != null) { @@ -361,8 +364,6 @@ public void run() { return; } - // The RedBox surface delegate will always show the latest error - updateLastErrorInfo(message, stack, errorCookie, errorType); mRedBoxSurfaceDelegate.show(); } }); diff --git a/ReactAndroid/src/main/java/com/facebook/react/devsupport/RedBoxDialogSurfaceDelegate.java b/ReactAndroid/src/main/java/com/facebook/react/devsupport/RedBoxDialogSurfaceDelegate.java index 97ef306afa8824..2043dee338132a 100644 --- a/ReactAndroid/src/main/java/com/facebook/react/devsupport/RedBoxDialogSurfaceDelegate.java +++ b/ReactAndroid/src/main/java/com/facebook/react/devsupport/RedBoxDialogSurfaceDelegate.java @@ -42,6 +42,15 @@ public void createContentView(String appKey) { // used here. RedBoxHandler redBoxHandler = mDevSupportManager.getRedBoxHandler(); Activity context = mDevSupportManager.getCurrentActivity(); + if (context == null || context.isFinishing()) { + @Nullable String message = mDevSupportManager.getLastErrorTitle(); + FLog.e( + ReactConstants.TAG, + "Unable to launch redbox because react activity " + + "is not available, here is the error that redbox would've displayed: " + + (message != null ? message : "N/A")); + return; + } // Create a new RedBox when currentActivity get updated mRedBoxContentView = new RedBoxContentView(context); mRedBoxContentView From cd60ffdb62b2183cd24baef3075d56f758cea24a Mon Sep 17 00:00:00 2001 From: Andrei Shikov Date: Wed, 16 Mar 2022 15:30:58 -0700 Subject: [PATCH 37/48] Bump Flipper-Glog to 0.5.0.4 Summary: Updates Flipper-Glog to address failing assertion in `mutex.h` Changelog: [iOS][Updated] - Updated Flipper-Glog to 0.5.0.4 Reviewed By: bvanderhoof Differential Revision: D34935757 fbshipit-source-id: 6e2dc5bf5608eb0d4cd89418fe1e04b8780bca16 --- packages/rn-tester/Podfile.lock | 26 +-- .../RNTesterPods.xcodeproj/project.pbxproj | 152 +++++++++--------- scripts/react_native_pods.rb | 2 +- 3 files changed, 90 insertions(+), 90 deletions(-) diff --git a/packages/rn-tester/Podfile.lock b/packages/rn-tester/Podfile.lock index 233f8977598cb2..aa77620b7c2b00 100644 --- a/packages/rn-tester/Podfile.lock +++ b/packages/rn-tester/Podfile.lock @@ -23,7 +23,7 @@ PODS: - Flipper-Glog - libevent (~> 2.1.12) - OpenSSL-Universal (= 1.1.1100) - - Flipper-Glog (0.5.0.3) + - Flipper-Glog (0.5.0.4) - Flipper-PeerTalk (0.0.4) - Flipper-RSocket (1.4.3): - Flipper-Folly (~> 2.6) @@ -731,7 +731,7 @@ DEPENDENCIES: - Flipper-DoubleConversion (= 3.2.0) - Flipper-Fmt (= 7.1.7) - Flipper-Folly (= 2.6.10) - - Flipper-Glog (= 0.5.0.3) + - Flipper-Glog (= 0.5.0.4) - Flipper-PeerTalk (= 0.0.4) - Flipper-RSocket (= 1.4.3) - FlipperKit (= 0.125.0) @@ -898,7 +898,7 @@ SPEC CHECKSUMS: Flipper-DoubleConversion: 3d3d04a078d4f3a1b6c6916587f159dc11f232c4 Flipper-Fmt: 60cbdd92fc254826e61d669a5d87ef7015396a9b Flipper-Folly: 584845625005ff068a6ebf41f857f468decd26b3 - Flipper-Glog: 7761f5362d23ead28c19afc2dd1d819f00e40df9 + Flipper-Glog: 87bc98ff48de90cb5b0b5114ed3da79d85ee2dd4 Flipper-PeerTalk: 116d8f857dc6ef55c7a5a75ea3ceaafe878aadc9 Flipper-RSocket: d9d9ade67cbecf6ac10730304bf5607266dd2541 FlipperKit: cbdee19bdd4e7f05472a66ce290f1b729ba3cb86 @@ -914,7 +914,7 @@ SPEC CHECKSUMS: React-callinvoker: c5d61e29df57793f0dc10ec2bc01c846f863e51f React-Codegen: c4ae835565487e494740b756ce953d8f635a76df React-Core: 30784d0eacbd709a3a6a5ae7c02c928634a6247e - React-CoreModules: e784fdac1d0293963fc06646aa76cfdcd906a754 + React-CoreModules: 51b1ad5727a4249a596b168439a2578e9dc0d094 React-cxxreact: cfc1663dae1ea52b465bbf021ef7b1527c5dc80c React-Fabric: 30b8fa96a0c56d1c11348f77607464eb87bb3f9f React-graphics: 9a84942b49ea1375ce83844041fa2ba766cfe0b9 @@ -924,17 +924,17 @@ SPEC CHECKSUMS: React-logger: 2009c0280c286a76200d6b7c5fe242fad51ddd7a React-perflogger: fe66bd6d8b17ebcfdf0159bf41fe28d8035ac20c React-RCTActionSheet: 3131a0b9280aa0e51bdf54b3d79aecd8503db62c - React-RCTAnimation: 218e2557f9803c1d8b4fd814b6c54b223ee18cda - React-RCTBlob: f94c621fa9851a5f81da471016ce5d91d29b2c7f - React-RCTFabric: 134127990b95158033ff22db25f5474d4aeecc96 - React-RCTImage: 996407b090e9fa8bb2213b6887676b1541052cb5 - React-RCTLinking: 6fcb5735f35935e0e53dc45e97f77234d7920232 - React-RCTNetwork: 2d51ae6d31c26bbcaab9abd56e523f8010cc57ae - React-RCTPushNotification: c5dfa4ab4da2b5312223334a55b30527218197d4 - React-RCTSettings: 9f897f32b7c4d0bc9a2718b7cb7d4f193889f5e3 + React-RCTAnimation: 938fcdbd56ec129bf02da489725978d2514e4c6d + React-RCTBlob: 5aa3aaaedf02381ff3b2f3ff4926c4652849e0cb + React-RCTFabric: 22135dd0c6db9f52882d08d9ecbc241062c6f8d7 + React-RCTImage: 6d8050f3a4b05d30d5400ef5fd3a234cdf0a893c + React-RCTLinking: c23a7701755a7dd2be14269072d6b4baccf05e65 + React-RCTNetwork: 852ceeef30b0e3306e8ff9aa85ebd8b1d4fafffb + React-RCTPushNotification: df73c64199da24ab93ea0a877f2be14ab1f57f24 + React-RCTSettings: e34c2c120492e21939be1ca8aa72df2782d628ca React-RCTTest: 7cbcd615b1e74ad59c9ad4257e6c323482114173 React-RCTText: e9146b2c0550a83d1335bfe2553760070a2d75c7 - React-RCTVibration: 9a73a3550a0ee184530341f91f9b85ad9cf3465a + React-RCTVibration: 9d4b704673754ed6541075152c522552aebb9237 React-rncore: b6e9b49eb1c7c045b98c77b1f94932e3c0be7cec React-runtimeexecutor: 4b0c6eb341c7d3ceb5e2385cb0fdb9bf701024f3 ReactCommon: f5fd5011a78235afb572a4618bd04a672b41da9d diff --git a/packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj b/packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj index 1f2421d2019bb4..a566e7aa2af0d0 100644 --- a/packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj +++ b/packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj @@ -7,7 +7,7 @@ objects = { /* Begin PBXBuildFile section */ - 0F021603D2C26FA0056F1BD8 /* libPods-RNTesterIntegrationTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C965FA03CA5E5DAD035D156C /* libPods-RNTesterIntegrationTests.a */; }; + 05C2F7DDC87A628A70C2D06C /* libPods-RNTesterIntegrationTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 65B6EA573FF170102920BEF4 /* libPods-RNTesterIntegrationTests.a */; }; 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; 272E6B3F1BEA849E001FCF37 /* UpdatePropertiesExampleView.m in Sources */ = {isa = PBXBuildFile; fileRef = 272E6B3C1BEA849E001FCF37 /* UpdatePropertiesExampleView.m */; }; 27F441EC1BEBE5030039B79C /* FlexibleSizeExampleView.m in Sources */ = {isa = PBXBuildFile; fileRef = 27F441E81BEBE5030039B79C /* FlexibleSizeExampleView.m */; }; @@ -16,9 +16,9 @@ 3D2AFAF51D646CF80089D1A3 /* legacy_image@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 3D2AFAF41D646CF80089D1A3 /* legacy_image@2x.png */; }; 5C60EB1C226440DB0018C04F /* AppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5C60EB1B226440DB0018C04F /* AppDelegate.mm */; }; 5CB07C9B226467E60039471C /* RNTesterTurboModuleProvider.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5CB07C99226467E60039471C /* RNTesterTurboModuleProvider.mm */; }; - 606C582DFD50595CEE33C07F /* libPods-RNTesterUnitTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B3B45782C648174786D3883A /* libPods-RNTesterUnitTests.a */; }; 8145AE06241172D900A3F8DA /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8145AE05241172D900A3F8DA /* LaunchScreen.storyboard */; }; - D7017CD9E6ECFF49B1DE42F1 /* libPods-RNTester.a in Frameworks */ = {isa = PBXBuildFile; fileRef = AA78234A2C4A4512CE754F9A /* libPods-RNTester.a */; }; + D19DB1AC8A1EBBFA0D14DB66 /* libPods-RNTester.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 25B78D39CC03C49968A739B2 /* libPods-RNTester.a */; }; + DCD006323AC907670B0D60A1 /* libPods-RNTesterUnitTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D4E0A9AD185CE086FAC9BD09 /* libPods-RNTesterUnitTests.a */; }; E7C1241A22BEC44B00DA25C0 /* RNTesterIntegrationTests.m in Sources */ = {isa = PBXBuildFile; fileRef = E7C1241922BEC44B00DA25C0 /* RNTesterIntegrationTests.m */; }; E7DB20D122B2BAA6005AC45F /* RCTBundleURLProviderTests.m in Sources */ = {isa = PBXBuildFile; fileRef = E7DB20A922B2BAA3005AC45F /* RCTBundleURLProviderTests.m */; }; E7DB20D222B2BAA6005AC45F /* RCTModuleInitNotificationRaceTests.m in Sources */ = {isa = PBXBuildFile; fileRef = E7DB20AA22B2BAA3005AC45F /* RCTModuleInitNotificationRaceTests.m */; }; @@ -83,25 +83,25 @@ 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = RNTester/AppDelegate.h; sourceTree = ""; }; 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = RNTester/Info.plist; sourceTree = ""; }; 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = RNTester/main.m; sourceTree = ""; }; + 219F884479D3685B92672D22 /* Pods-RNTesterIntegrationTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNTesterIntegrationTests.release.xcconfig"; path = "Target Support Files/Pods-RNTesterIntegrationTests/Pods-RNTesterIntegrationTests.release.xcconfig"; sourceTree = ""; }; + 247CDE6543C07B3CB6A2598F /* Pods-RNTester.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNTester.debug.xcconfig"; path = "Target Support Files/Pods-RNTester/Pods-RNTester.debug.xcconfig"; sourceTree = ""; }; + 25B78D39CC03C49968A739B2 /* libPods-RNTester.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-RNTester.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 272E6B3B1BEA849E001FCF37 /* UpdatePropertiesExampleView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = UpdatePropertiesExampleView.h; path = RNTester/NativeExampleViews/UpdatePropertiesExampleView.h; sourceTree = ""; }; 272E6B3C1BEA849E001FCF37 /* UpdatePropertiesExampleView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = UpdatePropertiesExampleView.m; path = RNTester/NativeExampleViews/UpdatePropertiesExampleView.m; sourceTree = ""; }; 27F441E81BEBE5030039B79C /* FlexibleSizeExampleView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FlexibleSizeExampleView.m; path = RNTester/NativeExampleViews/FlexibleSizeExampleView.m; sourceTree = ""; }; 27F441EA1BEBE5030039B79C /* FlexibleSizeExampleView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FlexibleSizeExampleView.h; path = RNTester/NativeExampleViews/FlexibleSizeExampleView.h; sourceTree = ""; }; 2DDEF00F1F84BF7B00DBDF73 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = RNTester/Images.xcassets; sourceTree = ""; }; 383889D923A7398900D06C3E /* RCTConvert_UIColorTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTConvert_UIColorTests.m; sourceTree = ""; }; - 3CD3706443F2188E09CBF2D2 /* Pods-RNTesterIntegrationTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNTesterIntegrationTests.debug.xcconfig"; path = "Target Support Files/Pods-RNTesterIntegrationTests/Pods-RNTesterIntegrationTests.debug.xcconfig"; sourceTree = ""; }; + 3AC456957EC0E18B006F4CA3 /* Pods-RNTesterUnitTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNTesterUnitTests.debug.xcconfig"; path = "Target Support Files/Pods-RNTesterUnitTests/Pods-RNTesterUnitTests.debug.xcconfig"; sourceTree = ""; }; 3D2AFAF41D646CF80089D1A3 /* legacy_image@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "legacy_image@2x.png"; path = "RNTester/legacy_image@2x.png"; sourceTree = ""; }; - 3DC317D3EE16C63CD9243667 /* Pods-RNTester.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNTester.release.xcconfig"; path = "Target Support Files/Pods-RNTester/Pods-RNTester.release.xcconfig"; sourceTree = ""; }; + 4660B567F95EFA8D6DC14F6C /* Pods-RNTester.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNTester.release.xcconfig"; path = "Target Support Files/Pods-RNTester/Pods-RNTester.release.xcconfig"; sourceTree = ""; }; 5C60EB1B226440DB0018C04F /* AppDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AppDelegate.mm; path = RNTester/AppDelegate.mm; sourceTree = ""; }; 5CB07C99226467E60039471C /* RNTesterTurboModuleProvider.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = RNTesterTurboModuleProvider.mm; path = RNTester/RNTesterTurboModuleProvider.mm; sourceTree = ""; }; 5CB07C9A226467E60039471C /* RNTesterTurboModuleProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = RNTesterTurboModuleProvider.h; path = RNTester/RNTesterTurboModuleProvider.h; sourceTree = ""; }; - 6D3E7ECE8F9BEC26E5786555 /* Pods-RNTester.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNTester.debug.xcconfig"; path = "Target Support Files/Pods-RNTester/Pods-RNTester.debug.xcconfig"; sourceTree = ""; }; + 65B6EA573FF170102920BEF4 /* libPods-RNTesterIntegrationTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-RNTesterIntegrationTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 8145AE05241172D900A3F8DA /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = RNTester/LaunchScreen.storyboard; sourceTree = ""; }; - 8735BC063632C9712E25C7D9 /* Pods-RNTesterUnitTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNTesterUnitTests.release.xcconfig"; path = "Target Support Files/Pods-RNTesterUnitTests/Pods-RNTesterUnitTests.release.xcconfig"; sourceTree = ""; }; - AA78234A2C4A4512CE754F9A /* libPods-RNTester.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-RNTester.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - B3B45782C648174786D3883A /* libPods-RNTesterUnitTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-RNTesterUnitTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; - C38CB0C2095A8FFDE13321E5 /* Pods-RNTesterUnitTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNTesterUnitTests.debug.xcconfig"; path = "Target Support Files/Pods-RNTesterUnitTests/Pods-RNTesterUnitTests.debug.xcconfig"; sourceTree = ""; }; - C965FA03CA5E5DAD035D156C /* libPods-RNTesterIntegrationTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-RNTesterIntegrationTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; + 8A0B7257DD8B2945456B0F61 /* Pods-RNTesterUnitTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNTesterUnitTests.release.xcconfig"; path = "Target Support Files/Pods-RNTesterUnitTests/Pods-RNTesterUnitTests.release.xcconfig"; sourceTree = ""; }; + D4E0A9AD185CE086FAC9BD09 /* libPods-RNTesterUnitTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-RNTesterUnitTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; E771AEEA22B44E3100EA1189 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = RNTester/Info.plist; sourceTree = ""; }; E7C1241922BEC44B00DA25C0 /* RNTesterIntegrationTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNTesterIntegrationTests.m; sourceTree = ""; }; E7DB209F22B2BA84005AC45F /* RNTesterUnitTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = RNTesterUnitTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -175,7 +175,7 @@ E7DB216022B2F3EC005AC45F /* RNTesterSnapshotTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RNTesterSnapshotTests.m; sourceTree = ""; }; E7DB216122B2F3EC005AC45F /* RCTRootViewIntegrationTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTRootViewIntegrationTests.m; sourceTree = ""; }; E7DB218B22B41FCD005AC45F /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = XCTest.framework; sourceTree = DEVELOPER_DIR; }; - E88C98CC10E157202A961408 /* Pods-RNTesterIntegrationTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNTesterIntegrationTests.release.xcconfig"; path = "Target Support Files/Pods-RNTesterIntegrationTests/Pods-RNTesterIntegrationTests.release.xcconfig"; sourceTree = ""; }; + EDF27040BB5969AF2B1103C9 /* Pods-RNTesterIntegrationTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RNTesterIntegrationTests.debug.xcconfig"; path = "Target Support Files/Pods-RNTesterIntegrationTests/Pods-RNTesterIntegrationTests.debug.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -183,7 +183,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - D7017CD9E6ECFF49B1DE42F1 /* libPods-RNTester.a in Frameworks */, + D19DB1AC8A1EBBFA0D14DB66 /* libPods-RNTester.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -193,7 +193,7 @@ files = ( E7DB213122B2C649005AC45F /* JavaScriptCore.framework in Frameworks */, E7DB213222B2C67D005AC45F /* libOCMock.a in Frameworks */, - 606C582DFD50595CEE33C07F /* libPods-RNTesterUnitTests.a in Frameworks */, + DCD006323AC907670B0D60A1 /* libPods-RNTesterUnitTests.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -203,7 +203,7 @@ files = ( E7DB218C22B41FCD005AC45F /* XCTest.framework in Frameworks */, E7DB216722B2F69F005AC45F /* JavaScriptCore.framework in Frameworks */, - 0F021603D2C26FA0056F1BD8 /* libPods-RNTesterIntegrationTests.a in Frameworks */, + 05C2F7DDC87A628A70C2D06C /* libPods-RNTesterIntegrationTests.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -274,9 +274,9 @@ E7DB211822B2BD53005AC45F /* libReact-RCTText.a */, E7DB211A22B2BD53005AC45F /* libReact-RCTVibration.a */, E7DB212222B2BD53005AC45F /* libyoga.a */, - AA78234A2C4A4512CE754F9A /* libPods-RNTester.a */, - C965FA03CA5E5DAD035D156C /* libPods-RNTesterIntegrationTests.a */, - B3B45782C648174786D3883A /* libPods-RNTesterUnitTests.a */, + 25B78D39CC03C49968A739B2 /* libPods-RNTester.a */, + 65B6EA573FF170102920BEF4 /* libPods-RNTesterIntegrationTests.a */, + D4E0A9AD185CE086FAC9BD09 /* libPods-RNTesterUnitTests.a */, ); name = Frameworks; sourceTree = ""; @@ -316,12 +316,12 @@ E23BD6487B06BD71F1A86914 /* Pods */ = { isa = PBXGroup; children = ( - 6D3E7ECE8F9BEC26E5786555 /* Pods-RNTester.debug.xcconfig */, - 3DC317D3EE16C63CD9243667 /* Pods-RNTester.release.xcconfig */, - 3CD3706443F2188E09CBF2D2 /* Pods-RNTesterIntegrationTests.debug.xcconfig */, - E88C98CC10E157202A961408 /* Pods-RNTesterIntegrationTests.release.xcconfig */, - C38CB0C2095A8FFDE13321E5 /* Pods-RNTesterUnitTests.debug.xcconfig */, - 8735BC063632C9712E25C7D9 /* Pods-RNTesterUnitTests.release.xcconfig */, + 247CDE6543C07B3CB6A2598F /* Pods-RNTester.debug.xcconfig */, + 4660B567F95EFA8D6DC14F6C /* Pods-RNTester.release.xcconfig */, + EDF27040BB5969AF2B1103C9 /* Pods-RNTesterIntegrationTests.debug.xcconfig */, + 219F884479D3685B92672D22 /* Pods-RNTesterIntegrationTests.release.xcconfig */, + 3AC456957EC0E18B006F4CA3 /* Pods-RNTesterUnitTests.debug.xcconfig */, + 8A0B7257DD8B2945456B0F61 /* Pods-RNTesterUnitTests.release.xcconfig */, ); path = Pods; sourceTree = ""; @@ -404,14 +404,14 @@ isa = PBXNativeTarget; buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "RNTester" */; buildPhases = ( - 26198F645226F4B3EB853CD1 /* [CP] Check Pods Manifest.lock */, + 161EF0F0977844159431F6A5 /* [CP] Check Pods Manifest.lock */, 13B07F871A680F5B00A75B9A /* Sources */, 13B07F8C1A680F5B00A75B9A /* Frameworks */, 13B07F8E1A680F5B00A75B9A /* Resources */, 68CD48B71D2BCB2C007E06A9 /* Build JS Bundle */, 5CF0FD27207FC6EC00C13D65 /* Start Metro */, - 4C8C07C0E5F2E32A7AAB5757 /* [CP] Embed Pods Frameworks */, - FA8D4E92C71D381C484B8772 /* [CP] Copy Pods Resources */, + 2FCDFB64B37634EC8EC3139B /* [CP] Embed Pods Frameworks */, + A8DE6393E2BB72D8FBBF6C27 /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -426,11 +426,11 @@ isa = PBXNativeTarget; buildConfigurationList = E7DB20A622B2BA84005AC45F /* Build configuration list for PBXNativeTarget "RNTesterUnitTests" */; buildPhases = ( - A2FBDDDD0C26B4EFA3726B6C /* [CP] Check Pods Manifest.lock */, + 4930FC87997EBCAD361CEF12 /* [CP] Check Pods Manifest.lock */, E7DB209B22B2BA84005AC45F /* Sources */, E7DB209C22B2BA84005AC45F /* Frameworks */, E7DB209D22B2BA84005AC45F /* Resources */, - C2DB5D8205AD0B9A884AEA32 /* [CP] Copy Pods Resources */, + 9A596313B3964A4DEB794409 /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -446,11 +446,11 @@ isa = PBXNativeTarget; buildConfigurationList = E7DB215A22B2F332005AC45F /* Build configuration list for PBXNativeTarget "RNTesterIntegrationTests" */; buildPhases = ( - BCB4082E5032C2EB206C860A /* [CP] Check Pods Manifest.lock */, + 6258A17990E8F7801AF1C4FE /* [CP] Check Pods Manifest.lock */, E7DB214F22B2F332005AC45F /* Sources */, E7DB215022B2F332005AC45F /* Frameworks */, E7DB215122B2F332005AC45F /* Resources */, - 205E2BCA6FE5F91C79346A1A /* [CP] Copy Pods Resources */, + 98E057AC8860597818FB485A /* [CP] Copy Pods Resources */, ); buildRules = ( ); @@ -529,24 +529,7 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - 205E2BCA6FE5F91C79346A1A /* [CP] Copy Pods Resources */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-RNTesterIntegrationTests/Pods-RNTesterIntegrationTests-resources-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Copy Pods Resources"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-RNTesterIntegrationTests/Pods-RNTesterIntegrationTests-resources-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-RNTesterIntegrationTests/Pods-RNTesterIntegrationTests-resources.sh\"\n"; - showEnvVarsInLog = 0; - }; - 26198F645226F4B3EB853CD1 /* [CP] Check Pods Manifest.lock */ = { + 161EF0F0977844159431F6A5 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -568,7 +551,7 @@ shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; - 4C8C07C0E5F2E32A7AAB5757 /* [CP] Embed Pods Frameworks */ = { + 2FCDFB64B37634EC8EC3139B /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -585,36 +568,44 @@ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-RNTester/Pods-RNTester-frameworks.sh\"\n"; showEnvVarsInLog = 0; }; - 5CF0FD27207FC6EC00C13D65 /* Start Metro */ = { + 4930FC87997EBCAD361CEF12 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); + inputFileListPaths = ( + ); inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", + ); + name = "[CP] Check Pods Manifest.lock"; + outputFileListPaths = ( ); - name = "Start Metro"; outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-RNTesterUnitTests-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "set -x\n\nexport RCT_METRO_PORT=\"${RCT_METRO_PORT:=8081}\"\necho \"export RCT_METRO_PORT=${RCT_METRO_PORT}\" > \"${SRCROOT}/../../scripts/.packager.env\"\nif [ -z \"${RCT_NO_LAUNCH_PACKAGER+xxx}\" ] ; then\n if nc -w 5 -z localhost ${RCT_METRO_PORT} ; then\n if ! curl -s \"http://localhost:${RCT_METRO_PORT}/status\" | grep -q \"packager-status:running\" ; then\n echo \"Port ${RCT_METRO_PORT} already in use, packager is either not running or not running correctly\"\n exit 2\n fi\n else\n open -n \"$SRCROOT/../../scripts/launchPackager.command\" || echo \"Can't start packager automatically\"\n fi\nfi\n"; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; - 68CD48B71D2BCB2C007E06A9 /* Build JS Bundle */ = { + 5CF0FD27207FC6EC00C13D65 /* Start Metro */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); inputPaths = ( ); - name = "Build JS Bundle"; + name = "Start Metro"; outputPaths = ( ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "set -e\n\nexport NODE_BINARY=node\nexport PROJECT_ROOT=\"$SRCROOT/../../\"\nexport ENTRY_FILE=\"$SRCROOT/js/RNTesterApp.ios.js\"\nexport SOURCEMAP_FILE=../sourcemap.ios.map\n# export FORCE_BUNDLING=true\n\"$SRCROOT/../../scripts/react-native-xcode.sh\"\n"; + shellScript = "set -x\n\nexport RCT_METRO_PORT=\"${RCT_METRO_PORT:=8081}\"\necho \"export RCT_METRO_PORT=${RCT_METRO_PORT}\" > \"${SRCROOT}/../../scripts/.packager.env\"\nif [ -z \"${RCT_NO_LAUNCH_PACKAGER+xxx}\" ] ; then\n if nc -w 5 -z localhost ${RCT_METRO_PORT} ; then\n if ! curl -s \"http://localhost:${RCT_METRO_PORT}/status\" | grep -q \"packager-status:running\" ; then\n echo \"Port ${RCT_METRO_PORT} already in use, packager is either not running or not running correctly\"\n exit 2\n fi\n else\n open -n \"$SRCROOT/../../scripts/launchPackager.command\" || echo \"Can't start packager automatically\"\n fi\nfi\n"; + showEnvVarsInLog = 0; }; - A2FBDDDD0C26B4EFA3726B6C /* [CP] Check Pods Manifest.lock */ = { + 6258A17990E8F7801AF1C4FE /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -629,36 +620,45 @@ outputFileListPaths = ( ); outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-RNTesterUnitTests-checkManifestLockResult.txt", + "$(DERIVED_FILE_DIR)/Pods-RNTesterIntegrationTests-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; - BCB4082E5032C2EB206C860A /* [CP] Check Pods Manifest.lock */ = { + 68CD48B71D2BCB2C007E06A9 /* Build JS Bundle */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( ); - inputFileListPaths = ( - ); inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( ); + name = "Build JS Bundle"; outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-RNTesterIntegrationTests-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; + shellScript = "set -e\n\nexport NODE_BINARY=node\nexport PROJECT_ROOT=\"$SRCROOT/../../\"\nexport ENTRY_FILE=\"$SRCROOT/js/RNTesterApp.ios.js\"\nexport SOURCEMAP_FILE=../sourcemap.ios.map\n# export FORCE_BUNDLING=true\n\"$SRCROOT/../../scripts/react-native-xcode.sh\"\n"; + }; + 98E057AC8860597818FB485A /* [CP] Copy Pods Resources */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-RNTesterIntegrationTests/Pods-RNTesterIntegrationTests-resources-${CONFIGURATION}-input-files.xcfilelist", + ); + name = "[CP] Copy Pods Resources"; + outputFileListPaths = ( + "${PODS_ROOT}/Target Support Files/Pods-RNTesterIntegrationTests/Pods-RNTesterIntegrationTests-resources-${CONFIGURATION}-output-files.xcfilelist", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-RNTesterIntegrationTests/Pods-RNTesterIntegrationTests-resources.sh\"\n"; showEnvVarsInLog = 0; }; - C2DB5D8205AD0B9A884AEA32 /* [CP] Copy Pods Resources */ = { + 9A596313B3964A4DEB794409 /* [CP] Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -675,7 +675,7 @@ shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-RNTesterUnitTests/Pods-RNTesterUnitTests-resources.sh\"\n"; showEnvVarsInLog = 0; }; - FA8D4E92C71D381C484B8772 /* [CP] Copy Pods Resources */ = { + A8DE6393E2BB72D8FBBF6C27 /* [CP] Copy Pods Resources */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -774,7 +774,7 @@ /* Begin XCBuildConfiguration section */ 13B07F941A680F5B00A75B9A /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 6D3E7ECE8F9BEC26E5786555 /* Pods-RNTester.debug.xcconfig */; + baseConfigurationReference = 247CDE6543C07B3CB6A2598F /* Pods-RNTester.debug.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_ENTITLEMENTS = RNTester/RNTester.entitlements; @@ -806,7 +806,7 @@ }; 13B07F951A680F5B00A75B9A /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 3DC317D3EE16C63CD9243667 /* Pods-RNTester.release.xcconfig */; + baseConfigurationReference = 4660B567F95EFA8D6DC14F6C /* Pods-RNTester.release.xcconfig */; buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_ENTITLEMENTS = RNTester/RNTester.entitlements; @@ -999,7 +999,7 @@ }; E7DB20A722B2BA84005AC45F /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = C38CB0C2095A8FFDE13321E5 /* Pods-RNTesterUnitTests.debug.xcconfig */; + baseConfigurationReference = 3AC456957EC0E18B006F4CA3 /* Pods-RNTesterUnitTests.debug.xcconfig */; buildSettings = { CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; @@ -1035,7 +1035,7 @@ }; E7DB20A822B2BA84005AC45F /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 8735BC063632C9712E25C7D9 /* Pods-RNTesterUnitTests.release.xcconfig */; + baseConfigurationReference = 8A0B7257DD8B2945456B0F61 /* Pods-RNTesterUnitTests.release.xcconfig */; buildSettings = { CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; @@ -1071,7 +1071,7 @@ }; E7DB215B22B2F332005AC45F /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 3CD3706443F2188E09CBF2D2 /* Pods-RNTesterIntegrationTests.debug.xcconfig */; + baseConfigurationReference = EDF27040BB5969AF2B1103C9 /* Pods-RNTesterIntegrationTests.debug.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CLANG_ANALYZER_NONNULL = YES; @@ -1109,7 +1109,7 @@ }; E7DB215C22B2F332005AC45F /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = E88C98CC10E157202A961408 /* Pods-RNTesterIntegrationTests.release.xcconfig */; + baseConfigurationReference = 219F884479D3685B92672D22 /* Pods-RNTesterIntegrationTests.release.xcconfig */; buildSettings = { BUNDLE_LOADER = "$(TEST_HOST)"; CLANG_ANALYZER_NONNULL = YES; diff --git a/scripts/react_native_pods.rb b/scripts/react_native_pods.rb index 5170c01f1234d9..9a348ae04a6891 100644 --- a/scripts/react_native_pods.rb +++ b/scripts/react_native_pods.rb @@ -141,7 +141,7 @@ def use_flipper!(versions = {}, configurations: ['Debug']) versions['Flipper-DoubleConversion'] ||= '3.2.0' versions['Flipper-Fmt'] ||= '7.1.7' versions['Flipper-Folly'] ||= '2.6.10' - versions['Flipper-Glog'] ||= '0.5.0.3' + versions['Flipper-Glog'] ||= '0.5.0.4' versions['Flipper-PeerTalk'] ||= '0.0.4' versions['Flipper-RSocket'] ||= '1.4.3' versions['OpenSSL-Universal'] ||= '1.1.1100' From bc53279a56238035b0c4eb044602b11e0c1c2e41 Mon Sep 17 00:00:00 2001 From: Andrei Shikov Date: Wed, 16 Mar 2022 15:30:58 -0700 Subject: [PATCH 38/48] Rename String.h to AString.h in bridging module Summary: String.h conflicts with system headers in cocoapods build, causing build error. Changelog: [Internal] Reviewed By: appden Differential Revision: D34936511 fbshipit-source-id: 4c25f7e755e53dec736ac7ed6217f6cd111d9288 --- ReactCommon/react/bridging/{String.h => AString.h} | 0 ReactCommon/react/bridging/Bridging.h | 2 +- ReactCommon/react/bridging/Object.h | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) rename ReactCommon/react/bridging/{String.h => AString.h} (100%) diff --git a/ReactCommon/react/bridging/String.h b/ReactCommon/react/bridging/AString.h similarity index 100% rename from ReactCommon/react/bridging/String.h rename to ReactCommon/react/bridging/AString.h diff --git a/ReactCommon/react/bridging/Bridging.h b/ReactCommon/react/bridging/Bridging.h index b0ba75c55da212..26cf99b5208302 100644 --- a/ReactCommon/react/bridging/Bridging.h +++ b/ReactCommon/react/bridging/Bridging.h @@ -7,6 +7,7 @@ #pragma once +#include #include #include #include @@ -15,5 +16,4 @@ #include #include #include -#include #include diff --git a/ReactCommon/react/bridging/Object.h b/ReactCommon/react/bridging/Object.h index 48074f3617c844..aefc375470fa2d 100644 --- a/ReactCommon/react/bridging/Object.h +++ b/ReactCommon/react/bridging/Object.h @@ -7,8 +7,8 @@ #pragma once +#include #include -#include #include #include From 9b4bb54fdff89cb9d7f41c17a720aa58d913f652 Mon Sep 17 00:00:00 2001 From: Phillip Pan Date: Wed, 16 Mar 2022 21:03:36 -0700 Subject: [PATCH 39/48] add error logs for nil moduleRegistry Summary: Changelog: [Internal] for the last 6 months or so, we've been getting this task where the moduleRegistry in RCTDeviceInfo is nil. in this change, i add some logs to see what might be setting this to nil. in all honestly, i don't really think this is happening, but it would be good to verify. Reviewed By: sshic Differential Revision: D34908902 fbshipit-source-id: d375285467a87453605ba0fecfc124bc3bff6e63 --- React/CoreModules/RCTDeviceInfo.mm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/React/CoreModules/RCTDeviceInfo.mm b/React/CoreModules/RCTDeviceInfo.mm index b948e8e479b726..c5bc2cdb728559 100644 --- a/React/CoreModules/RCTDeviceInfo.mm +++ b/React/CoreModules/RCTDeviceInfo.mm @@ -69,6 +69,14 @@ - (void)initialize object:nil]; } +- (void)setModuleRegistry:(RCTModuleRegistry *)moduleRegistry +{ + if (!moduleRegistry) { + RCTAssert(false, @"moduleRegistry should not be nil, _moduleRegistry is nil: %d", _moduleRegistry == nil); + } + _moduleRegistry = moduleRegistry; +} + static BOOL RCTIsIPhoneX() { static BOOL isIPhoneX = NO; From 126873f63dd9688ec9b79488a5c3e5e03ce8ef61 Mon Sep 17 00:00:00 2001 From: Phillip Pan Date: Wed, 16 Mar 2022 21:03:36 -0700 Subject: [PATCH 40/48] get rid of weird nil check on CGFloat Summary: Changelog: [Internal] this doesn't really make any sense, first of all CGFloat is a primitive data type so comparing it against nil only will return true if it's 0. but that won't catch cases where CGFloat is uninitialized bc it will be holding junk in memory. the error checking of the value is already handled in the accessibility manager, so just remove it here. Reviewed By: p-sun Differential Revision: D34909365 fbshipit-source-id: 483f9c100433f8533edd784622523c5469c616c2 --- React/CoreModules/RCTDeviceInfo.mm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/React/CoreModules/RCTDeviceInfo.mm b/React/CoreModules/RCTDeviceInfo.mm index c5bc2cdb728559..d5d11e924b80fc 100644 --- a/React/CoreModules/RCTDeviceInfo.mm +++ b/React/CoreModules/RCTDeviceInfo.mm @@ -108,8 +108,9 @@ static BOOL RCTIsIPhoneX() RCTAssertMainQueue(); RCTDimensions dimensions; if (moduleRegistry) { - dimensions = RCTGetDimensions( - ((RCTAccessibilityManager *)[moduleRegistry moduleForName:"AccessibilityManager"]).multiplier ?: 1.0); + RCTAccessibilityManager *accessibilityManager = + (RCTAccessibilityManager *)[moduleRegistry moduleForName:"AccessibilityManager"]; + dimensions = RCTGetDimensions(accessibilityManager ? accessibilityManager.multiplier : 1.0); } else { RCTAssert(false, @"ModuleRegistry must be set to properly init dimensions."); } From 982ca30de079d7e80bd0b50365d58b9048fb628f Mon Sep 17 00:00:00 2001 From: Phillip Pan Date: Wed, 16 Mar 2022 21:08:01 -0700 Subject: [PATCH 41/48] bump iOS and tvOS from 11.0 to 12.4 in cocoapods Summary: Changelog: [iOS][Deprecated] Deprecating support for iOS/tvOS SDK 11.0, 12.4+ is now required allow-large-files Reviewed By: sammy-SC Differential Revision: D34547333 fbshipit-source-id: a24bb09d03939a092de4198efb1aa4a44c69f718 --- .../React-RCTActionSheet.podspec | 2 +- Libraries/Blob/React-RCTBlob.podspec | 2 +- Libraries/FBLazyVector/FBLazyVector.podspec | 2 +- Libraries/Image/React-RCTImage.podspec | 2 +- Libraries/LinkingIOS/React-RCTLinking.podspec | 2 +- .../React-RCTAnimation.podspec | 2 +- Libraries/Network/React-RCTNetwork.podspec | 2 +- .../React-RCTPushNotification.podspec | 2 +- Libraries/RCTRequired/RCTRequired.podspec | 2 +- Libraries/Settings/React-RCTSettings.podspec | 2 +- Libraries/Text/React-RCTText.podspec | 2 +- Libraries/TypeSafety/RCTTypeSafety.podspec | 2 +- .../Vibration/React-RCTVibration.podspec | 2 +- React-Core.podspec | 2 +- React.podspec | 2 +- React/CoreModules/React-CoreModules.podspec | 2 +- .../FBReactNativeSpec.podspec | 2 +- React/React-RCTFabric.podspec | 2 +- ReactCommon/React-Fabric.podspec | 2 +- ReactCommon/React-rncore.podspec | 2 +- ReactCommon/ReactCommon.podspec | 2 +- .../callinvoker/React-callinvoker.podspec | 2 +- ReactCommon/cxxreact/React-cxxreact.podspec | 2 +- ReactCommon/hermes/React-hermes.podspec | 2 +- ReactCommon/jsi/React-jsi.podspec | 2 +- .../jsiexecutor/React-jsiexecutor.podspec | 2 +- .../jsinspector/React-jsinspector.podspec | 2 +- ReactCommon/logger/React-logger.podspec | 2 +- .../react/bridging/React-bridging.podspec | 2 +- .../renderer/graphics/React-graphics.podspec | 2 +- .../reactperflogger/React-perflogger.podspec | 2 +- .../React-runtimeexecutor.podspec | 2 +- ReactCommon/yoga/Yoga.podspec | 2 +- .../MyNativeView.podspec | 2 +- .../ScreenshotManager.podspec | 2 +- packages/rn-tester/Podfile | 2 +- packages/rn-tester/Podfile.lock | 74 +++++++++---------- .../rn-tester/RCTTest/React-RCTTest.podspec | 2 +- template/ios/Podfile | 2 +- third-party-podspecs/DoubleConversion.podspec | 2 +- third-party-podspecs/glog.podspec | 2 +- 41 files changed, 77 insertions(+), 77 deletions(-) diff --git a/Libraries/ActionSheetIOS/React-RCTActionSheet.podspec b/Libraries/ActionSheetIOS/React-RCTActionSheet.podspec index e81353c8b6a97a..a9bd4ca8235d0d 100644 --- a/Libraries/ActionSheetIOS/React-RCTActionSheet.podspec +++ b/Libraries/ActionSheetIOS/React-RCTActionSheet.podspec @@ -24,7 +24,7 @@ Pod::Spec.new do |s| s.documentation_url = "https://reactnative.dev/docs/actionsheetios" s.license = package["license"] s.author = "Facebook, Inc. and its affiliates" - s.platforms = { :ios => "11.0" } + s.platforms = { :ios => "12.4" } s.source = source s.source_files = "*.{m}" s.preserve_paths = "package.json", "LICENSE", "LICENSE-docs" diff --git a/Libraries/Blob/React-RCTBlob.podspec b/Libraries/Blob/React-RCTBlob.podspec index b97a2076fa9c8f..6c8dbb1e3b5264 100644 --- a/Libraries/Blob/React-RCTBlob.podspec +++ b/Libraries/Blob/React-RCTBlob.podspec @@ -26,7 +26,7 @@ Pod::Spec.new do |s| s.homepage = "https://reactnative.dev/" s.license = package["license"] s.author = "Facebook, Inc. and its affiliates" - s.platforms = { :ios => "11.0" } + s.platforms = { :ios => "12.4" } s.compiler_flags = folly_compiler_flags + ' -Wno-nullability-completeness' s.source = source s.source_files = "*.{h,m,mm}" diff --git a/Libraries/FBLazyVector/FBLazyVector.podspec b/Libraries/FBLazyVector/FBLazyVector.podspec index c4e844ece07b5a..41a0f756f0fdb0 100644 --- a/Libraries/FBLazyVector/FBLazyVector.podspec +++ b/Libraries/FBLazyVector/FBLazyVector.podspec @@ -23,7 +23,7 @@ Pod::Spec.new do |s| s.homepage = "https://reactnative.dev/" s.license = package["license"] s.author = "Facebook, Inc. and its affiliates" - s.platforms = { :ios => "11.0" } + s.platforms = { :ios => "12.4" } s.source = source s.source_files = "**/*.{c,h,m,mm,cpp}" s.header_dir = "FBLazyVector" diff --git a/Libraries/Image/React-RCTImage.podspec b/Libraries/Image/React-RCTImage.podspec index 5f62088d5433b1..272db79768b965 100644 --- a/Libraries/Image/React-RCTImage.podspec +++ b/Libraries/Image/React-RCTImage.podspec @@ -27,7 +27,7 @@ Pod::Spec.new do |s| s.documentation_url = "https://reactnative.dev/docs/image" s.license = package["license"] s.author = "Facebook, Inc. and its affiliates" - s.platforms = { :ios => "11.0" } + s.platforms = { :ios => "12.4" } s.compiler_flags = folly_compiler_flags + ' -Wno-nullability-completeness' s.source = source s.source_files = "*.{m,mm}" diff --git a/Libraries/LinkingIOS/React-RCTLinking.podspec b/Libraries/LinkingIOS/React-RCTLinking.podspec index dae0adb3f6d458..068e1aadc72ad2 100644 --- a/Libraries/LinkingIOS/React-RCTLinking.podspec +++ b/Libraries/LinkingIOS/React-RCTLinking.podspec @@ -27,7 +27,7 @@ Pod::Spec.new do |s| s.documentation_url = "https://reactnative.dev/docs/linking" s.license = package["license"] s.author = "Facebook, Inc. and its affiliates" - s.platforms = { :ios => "11.0" } + s.platforms = { :ios => "12.4" } s.compiler_flags = folly_compiler_flags + ' -Wno-nullability-completeness' s.source = source s.source_files = "*.{m,mm}" diff --git a/Libraries/NativeAnimation/React-RCTAnimation.podspec b/Libraries/NativeAnimation/React-RCTAnimation.podspec index f698563b046d28..647dfe22dde95c 100644 --- a/Libraries/NativeAnimation/React-RCTAnimation.podspec +++ b/Libraries/NativeAnimation/React-RCTAnimation.podspec @@ -26,7 +26,7 @@ Pod::Spec.new do |s| s.homepage = "https://reactnative.dev/" s.license = package["license"] s.author = "Facebook, Inc. and its affiliates" - s.platforms = { :ios => "11.0" } + s.platforms = { :ios => "12.4" } s.compiler_flags = folly_compiler_flags + ' -Wno-nullability-completeness' s.source = source s.source_files = "**/*.{h,m,mm}" diff --git a/Libraries/Network/React-RCTNetwork.podspec b/Libraries/Network/React-RCTNetwork.podspec index 0846963ce2f2e4..0a83c886daf70c 100644 --- a/Libraries/Network/React-RCTNetwork.podspec +++ b/Libraries/Network/React-RCTNetwork.podspec @@ -26,7 +26,7 @@ Pod::Spec.new do |s| s.homepage = "https://reactnative.dev/" s.license = package["license"] s.author = "Facebook, Inc. and its affiliates" - s.platforms = { :ios => "11.0" } + s.platforms = { :ios => "12.4" } s.compiler_flags = folly_compiler_flags + ' -Wno-nullability-completeness' s.source = source s.source_files = "*.{m,mm}" diff --git a/Libraries/PushNotificationIOS/React-RCTPushNotification.podspec b/Libraries/PushNotificationIOS/React-RCTPushNotification.podspec index eef04e85bbc229..9b76d8f53ecbb2 100644 --- a/Libraries/PushNotificationIOS/React-RCTPushNotification.podspec +++ b/Libraries/PushNotificationIOS/React-RCTPushNotification.podspec @@ -27,7 +27,7 @@ Pod::Spec.new do |s| s.documentation_url = "https://reactnative.dev/docs/pushnotificationios" s.license = package["license"] s.author = "Facebook, Inc. and its affiliates" - s.platforms = { :ios => "11.0" } + s.platforms = { :ios => "12.4" } s.compiler_flags = folly_compiler_flags + ' -Wno-nullability-completeness' s.source = source s.source_files = "*.{m,mm}" diff --git a/Libraries/RCTRequired/RCTRequired.podspec b/Libraries/RCTRequired/RCTRequired.podspec index 7d657a0b547b15..a0f1a646aeca0d 100644 --- a/Libraries/RCTRequired/RCTRequired.podspec +++ b/Libraries/RCTRequired/RCTRequired.podspec @@ -23,7 +23,7 @@ Pod::Spec.new do |s| s.homepage = "https://reactnative.dev/" s.license = package["license"] s.author = "Facebook, Inc. and its affiliates" - s.platforms = { :ios => "11.0" } + s.platforms = { :ios => "12.4" } s.source = source s.source_files = "**/*.{c,h,m,mm,cpp}" s.header_dir = "RCTRequired" diff --git a/Libraries/Settings/React-RCTSettings.podspec b/Libraries/Settings/React-RCTSettings.podspec index e2698dc4521961..68a9574f4c88cc 100644 --- a/Libraries/Settings/React-RCTSettings.podspec +++ b/Libraries/Settings/React-RCTSettings.podspec @@ -27,7 +27,7 @@ Pod::Spec.new do |s| s.documentation_url = "https://reactnative.dev/docs/settings" s.license = package["license"] s.author = "Facebook, Inc. and its affiliates" - s.platforms = { :ios => "11.0" } + s.platforms = { :ios => "12.4" } s.compiler_flags = folly_compiler_flags + ' -Wno-nullability-completeness' s.source = source s.source_files = "*.{m,mm}" diff --git a/Libraries/Text/React-RCTText.podspec b/Libraries/Text/React-RCTText.podspec index cec2fef17e0394..793a8dbf346149 100644 --- a/Libraries/Text/React-RCTText.podspec +++ b/Libraries/Text/React-RCTText.podspec @@ -24,7 +24,7 @@ Pod::Spec.new do |s| s.documentation_url = "https://reactnative.dev/docs/text" s.license = package["license"] s.author = "Facebook, Inc. and its affiliates" - s.platforms = { :ios => "11.0" } + s.platforms = { :ios => "12.4" } s.source = source s.source_files = "**/*.{h,m}" s.preserve_paths = "package.json", "LICENSE", "LICENSE-docs" diff --git a/Libraries/TypeSafety/RCTTypeSafety.podspec b/Libraries/TypeSafety/RCTTypeSafety.podspec index 987982cec9a502..b5803aa33d90c4 100644 --- a/Libraries/TypeSafety/RCTTypeSafety.podspec +++ b/Libraries/TypeSafety/RCTTypeSafety.podspec @@ -26,7 +26,7 @@ Pod::Spec.new do |s| s.homepage = "https://reactnative.dev/" s.license = package["license"] s.author = "Facebook, Inc. and its affiliates" - s.platforms = { :ios => "11.0" } + s.platforms = { :ios => "12.4" } s.compiler_flags = folly_compiler_flags s.source = source s.source_files = "**/*.{c,h,m,mm,cpp}" diff --git a/Libraries/Vibration/React-RCTVibration.podspec b/Libraries/Vibration/React-RCTVibration.podspec index ff38ddf9cea5c5..2f92a7272ace0f 100644 --- a/Libraries/Vibration/React-RCTVibration.podspec +++ b/Libraries/Vibration/React-RCTVibration.podspec @@ -27,7 +27,7 @@ Pod::Spec.new do |s| s.documentation_url = "https://reactnative.dev/docs/vibration" s.license = package["license"] s.author = "Facebook, Inc. and its affiliates" - s.platforms = { :ios => "11.0" } + s.platforms = { :ios => "12.4" } s.compiler_flags = folly_compiler_flags + ' -Wno-nullability-completeness' s.source = source s.source_files = "*.{m,mm}" diff --git a/React-Core.podspec b/React-Core.podspec index 375bd9e1ea87f5..c250ead38efc2e 100644 --- a/React-Core.podspec +++ b/React-Core.podspec @@ -41,7 +41,7 @@ Pod::Spec.new do |s| s.homepage = "https://reactnative.dev/" s.license = package["license"] s.author = "Facebook, Inc. and its affiliates" - s.platforms = { :ios => "11.0" } + s.platforms = { :ios => "12.4" } s.source = source s.resource_bundle = { "AccessibilityResources" => ["React/AccessibilityResources/*.lproj"]} s.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags diff --git a/React.podspec b/React.podspec index 9c44e3101cac78..a0de5a6359ef13 100644 --- a/React.podspec +++ b/React.podspec @@ -36,7 +36,7 @@ Pod::Spec.new do |s| s.homepage = "https://reactnative.dev/" s.license = package["license"] s.author = "Facebook, Inc. and its affiliates" - s.platforms = { :ios => "11.0" } + s.platforms = { :ios => "12.4" } s.source = source s.preserve_paths = "package.json", "LICENSE", "LICENSE-docs" s.cocoapods_version = ">= 1.10.1" diff --git a/React/CoreModules/React-CoreModules.podspec b/React/CoreModules/React-CoreModules.podspec index bc492d0a1b3673..6ea710a8d93291 100644 --- a/React/CoreModules/React-CoreModules.podspec +++ b/React/CoreModules/React-CoreModules.podspec @@ -26,7 +26,7 @@ Pod::Spec.new do |s| s.homepage = "https://reactnative.dev/" s.license = package["license"] s.author = "Facebook, Inc. and its affiliates" - s.platforms = { :ios => "11.0" } + s.platforms = { :ios => "12.4" } s.compiler_flags = folly_compiler_flags + ' -Wno-nullability-completeness' s.source = source s.source_files = "**/*.{c,m,mm,cpp}" diff --git a/React/FBReactNativeSpec/FBReactNativeSpec.podspec b/React/FBReactNativeSpec/FBReactNativeSpec.podspec index 61c46302c0946d..aa25435f7dd532 100644 --- a/React/FBReactNativeSpec/FBReactNativeSpec.podspec +++ b/React/FBReactNativeSpec/FBReactNativeSpec.podspec @@ -29,7 +29,7 @@ Pod::Spec.new do |s| s.homepage = "https://reactnative.dev/" s.license = package["license"] s.author = "Facebook, Inc. and its affiliates" - s.platforms = { :ios => "11.0" } + s.platforms = { :ios => "12.4" } s.compiler_flags = folly_compiler_flags + ' -Wno-nullability-completeness' s.source = source # This podspec is used to trigger the codegen, and built files are generated in a different location. diff --git a/React/React-RCTFabric.podspec b/React/React-RCTFabric.podspec index 830c7701082abd..22c12070eba5b4 100644 --- a/React/React-RCTFabric.podspec +++ b/React/React-RCTFabric.podspec @@ -28,7 +28,7 @@ Pod::Spec.new do |s| s.homepage = "https://reactnative.dev/" s.license = package["license"] s.author = "Facebook, Inc. and its affiliates" - s.platforms = { :ios => "11.0" } + s.platforms = { :ios => "12.4" } s.source = source s.source_files = "Fabric/**/*.{c,h,m,mm,S,cpp}" s.exclude_files = "**/tests/*", diff --git a/ReactCommon/React-Fabric.podspec b/ReactCommon/React-Fabric.podspec index 096254395cc86c..a27c1b72eb3ada 100644 --- a/ReactCommon/React-Fabric.podspec +++ b/ReactCommon/React-Fabric.podspec @@ -29,7 +29,7 @@ Pod::Spec.new do |s| s.homepage = "https://reactnative.dev/" s.license = package["license"] s.author = "Facebook, Inc. and its affiliates" - s.platforms = { :ios => "11.0" } + s.platforms = { :ios => "12.4" } s.source = source s.source_files = "dummyFile.cpp" s.pod_target_xcconfig = { "USE_HEADERMAP" => "YES", diff --git a/ReactCommon/React-rncore.podspec b/ReactCommon/React-rncore.podspec index 73c6f713a9dbc2..635c80e7d241d5 100644 --- a/ReactCommon/React-rncore.podspec +++ b/ReactCommon/React-rncore.podspec @@ -25,7 +25,7 @@ Pod::Spec.new do |s| s.homepage = "https://reactnative.dev/" s.license = package["license"] s.author = "Facebook, Inc. and its affiliates" - s.platforms = { :ios => "11.0" } + s.platforms = { :ios => "12.4" } s.source = source s.source_files = "dummyFile.cpp" s.pod_target_xcconfig = { "USE_HEADERMAP" => "YES", diff --git a/ReactCommon/ReactCommon.podspec b/ReactCommon/ReactCommon.podspec index 2dffbe2bd71ffd..3ec232132e87c8 100644 --- a/ReactCommon/ReactCommon.podspec +++ b/ReactCommon/ReactCommon.podspec @@ -28,7 +28,7 @@ Pod::Spec.new do |s| s.homepage = "https://reactnative.dev/" s.license = package["license"] s.author = "Facebook, Inc. and its affiliates" - s.platforms = { :ios => "11.0" } + s.platforms = { :ios => "12.4" } s.source = source s.header_dir = "ReactCommon" # Use global header_dir for all subspecs for use_frameworks! compatibility s.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags diff --git a/ReactCommon/callinvoker/React-callinvoker.podspec b/ReactCommon/callinvoker/React-callinvoker.podspec index f6076050d9cc1e..18d39c7869ae85 100644 --- a/ReactCommon/callinvoker/React-callinvoker.podspec +++ b/ReactCommon/callinvoker/React-callinvoker.podspec @@ -27,7 +27,7 @@ Pod::Spec.new do |s| s.homepage = "https://reactnative.dev/" s.license = package["license"] s.author = "Facebook, Inc. and its affiliates" - s.platforms = { :ios => "11.0" } + s.platforms = { :ios => "12.4" } s.source = source s.source_files = "**/*.{cpp,h}" s.header_dir = "ReactCommon" diff --git a/ReactCommon/cxxreact/React-cxxreact.podspec b/ReactCommon/cxxreact/React-cxxreact.podspec index 977d260a8b6f7f..0a47fda0e9cb88 100644 --- a/ReactCommon/cxxreact/React-cxxreact.podspec +++ b/ReactCommon/cxxreact/React-cxxreact.podspec @@ -28,7 +28,7 @@ Pod::Spec.new do |s| s.homepage = "https://reactnative.dev/" s.license = package["license"] s.author = "Facebook, Inc. and its affiliates" - s.platforms = { :ios => "11.0", :tvos => "11.0" } + s.platforms = { :ios => "12.4", :tvos => "12.4" } s.source = source s.source_files = "*.{cpp,h}" s.exclude_files = "SampleCxxModule.*" diff --git a/ReactCommon/hermes/React-hermes.podspec b/ReactCommon/hermes/React-hermes.podspec index 695c6afdc7c5cc..aaf85cabd6c4d6 100644 --- a/ReactCommon/hermes/React-hermes.podspec +++ b/ReactCommon/hermes/React-hermes.podspec @@ -27,7 +27,7 @@ Pod::Spec.new do |s| s.homepage = "https://reactnative.dev/" s.license = package["license"] s.author = "Facebook, Inc. and its affiliates" - s.platforms = { :osx => "10.14", :ios => "11.0" } + s.platforms = { :osx => "10.14", :ios => "12.4" } s.source = source s.source_files = "executor/*.{cpp,h}", "inspector/*.{cpp,h}", diff --git a/ReactCommon/jsi/React-jsi.podspec b/ReactCommon/jsi/React-jsi.podspec index 10c82d199e3523..2ff7f77fc0cfa5 100644 --- a/ReactCommon/jsi/React-jsi.podspec +++ b/ReactCommon/jsi/React-jsi.podspec @@ -27,7 +27,7 @@ Pod::Spec.new do |s| s.homepage = "https://reactnative.dev/" s.license = package["license"] s.author = "Facebook, Inc. and its affiliates" - s.platforms = { :ios => "11.0" } + s.platforms = { :ios => "12.4" } s.source = source s.source_files = "**/*.{cpp,h}" s.exclude_files = "**/test/*" diff --git a/ReactCommon/jsiexecutor/React-jsiexecutor.podspec b/ReactCommon/jsiexecutor/React-jsiexecutor.podspec index 637ac644a0ce78..bbd1779fc876c3 100644 --- a/ReactCommon/jsiexecutor/React-jsiexecutor.podspec +++ b/ReactCommon/jsiexecutor/React-jsiexecutor.podspec @@ -27,7 +27,7 @@ Pod::Spec.new do |s| s.homepage = "https://reactnative.dev/" s.license = package["license"] s.author = "Facebook, Inc. and its affiliates" - s.platforms = { :ios => "11.0" } + s.platforms = { :ios => "12.4" } s.source = source s.source_files = "jsireact/*.{cpp,h}" s.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags diff --git a/ReactCommon/jsinspector/React-jsinspector.podspec b/ReactCommon/jsinspector/React-jsinspector.podspec index a518b68800163c..a1d6f7f2c3c60a 100644 --- a/ReactCommon/jsinspector/React-jsinspector.podspec +++ b/ReactCommon/jsinspector/React-jsinspector.podspec @@ -23,7 +23,7 @@ Pod::Spec.new do |s| s.homepage = "https://reactnative.dev/" s.license = package["license"] s.author = "Facebook, Inc. and its affiliates" - s.platforms = { :ios => "11.0" } + s.platforms = { :ios => "12.4" } s.source = source s.source_files = "*.{cpp,h}" s.header_dir = 'jsinspector' diff --git a/ReactCommon/logger/React-logger.podspec b/ReactCommon/logger/React-logger.podspec index 94faa21cfd97dc..56bb6f1cb5ba17 100644 --- a/ReactCommon/logger/React-logger.podspec +++ b/ReactCommon/logger/React-logger.podspec @@ -28,7 +28,7 @@ Pod::Spec.new do |s| s.homepage = "https://reactnative.dev/" s.license = package["license"] s.author = "Facebook, Inc. and its affiliates" - s.platforms = { :ios => "11.0", :tvos => "11.0" } + s.platforms = { :ios => "12.4", :tvos => "12.4" } s.source = source s.source_files = "*.{cpp,h}" s.exclude_files = "SampleCxxModule.*" diff --git a/ReactCommon/react/bridging/React-bridging.podspec b/ReactCommon/react/bridging/React-bridging.podspec index bf467f7263e58e..99906e6d3cc408 100644 --- a/ReactCommon/react/bridging/React-bridging.podspec +++ b/ReactCommon/react/bridging/React-bridging.podspec @@ -26,7 +26,7 @@ Pod::Spec.new do |s| s.homepage = "https://reactnative.dev/" s.license = package["license"] s.author = "Facebook, Inc. and its affiliates" - s.platforms = { :ios => "11.0" } + s.platforms = { :ios => "12.4" } s.source = source s.source_files = "**/*.{cpp,h}" s.exclude_files = "tests" diff --git a/ReactCommon/react/renderer/graphics/React-graphics.podspec b/ReactCommon/react/renderer/graphics/React-graphics.podspec index e73a974d78d715..6b7f32fb1eae96 100644 --- a/ReactCommon/react/renderer/graphics/React-graphics.podspec +++ b/ReactCommon/react/renderer/graphics/React-graphics.podspec @@ -27,7 +27,7 @@ Pod::Spec.new do |s| s.homepage = "https://reactnative.dev/" s.license = package["license"] s.author = "Facebook, Inc. and its affiliates" - s.platforms = { :ios => "11.0", :tvos => "11.0" } + s.platforms = { :ios => "12.4", :tvos => "12.4" } s.source = source s.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags s.source_files = "**/*.{m,mm,cpp,h}" diff --git a/ReactCommon/reactperflogger/React-perflogger.podspec b/ReactCommon/reactperflogger/React-perflogger.podspec index f1f1650256aa2f..01f2e12beb8879 100644 --- a/ReactCommon/reactperflogger/React-perflogger.podspec +++ b/ReactCommon/reactperflogger/React-perflogger.podspec @@ -27,7 +27,7 @@ Pod::Spec.new do |s| s.homepage = "https://reactnative.dev/" s.license = package["license"] s.author = "Facebook, Inc. and its affiliates" - s.platforms = { :ios => "11.0" } + s.platforms = { :ios => "12.4" } s.source = source s.source_files = "**/*.{cpp,h}" s.header_dir = "reactperflogger" diff --git a/ReactCommon/runtimeexecutor/React-runtimeexecutor.podspec b/ReactCommon/runtimeexecutor/React-runtimeexecutor.podspec index b5a5c126f82fa4..ddafdfda4c9036 100644 --- a/ReactCommon/runtimeexecutor/React-runtimeexecutor.podspec +++ b/ReactCommon/runtimeexecutor/React-runtimeexecutor.podspec @@ -27,7 +27,7 @@ Pod::Spec.new do |s| s.homepage = "https://reactnative.dev/" s.license = package["license"] s.author = "Facebook, Inc. and its affiliates" - s.platforms = { :ios => "11.0" } + s.platforms = { :ios => "12.4" } s.source = source s.source_files = "**/*.{cpp,h}" s.header_dir = "ReactCommon" diff --git a/ReactCommon/yoga/Yoga.podspec b/ReactCommon/yoga/Yoga.podspec index a282034a356110..fe698a99134552 100644 --- a/ReactCommon/yoga/Yoga.podspec +++ b/ReactCommon/yoga/Yoga.podspec @@ -43,7 +43,7 @@ Pod::Spec.new do |spec| ] # Pinning to the same version as React.podspec. - spec.platforms = { :ios => "11.0" } + spec.platforms = { :ios => "12.4" } # Set this environment variable when *not* using the `:path` option to install the pod. # E.g. when publishing this spec to a spec repo. diff --git a/packages/rn-tester/NativeComponentExample/MyNativeView.podspec b/packages/rn-tester/NativeComponentExample/MyNativeView.podspec index d34a33124eba2c..421f3fd3916f25 100644 --- a/packages/rn-tester/NativeComponentExample/MyNativeView.podspec +++ b/packages/rn-tester/NativeComponentExample/MyNativeView.podspec @@ -19,7 +19,7 @@ Pod::Spec.new do |s| s.description = "my-native-view" s.homepage = "https://github.com/sota000/my-native-view.git" s.license = "MIT" - s.platforms = { :ios => "11.0", :tvos => "11.0" } + s.platforms = { :ios => "12.4", :tvos => "12.4" } s.compiler_flags = folly_compiler_flags + ' ' + boost_compiler_flags + ' -Wno-nullability-completeness' s.author = "Facebook, Inc. and its affiliates" s.source = { :git => "https://github.com/facebook/my-native-view.git", :tag => "#{s.version}" } diff --git a/packages/rn-tester/NativeModuleExample/ScreenshotManager.podspec b/packages/rn-tester/NativeModuleExample/ScreenshotManager.podspec index 6399ab175887bf..56ed0819894ed6 100644 --- a/packages/rn-tester/NativeModuleExample/ScreenshotManager.podspec +++ b/packages/rn-tester/NativeModuleExample/ScreenshotManager.podspec @@ -17,7 +17,7 @@ Pod::Spec.new do |s| s.description = "ScreenshotManager" s.homepage = "https://github.com/facebook/react-native.git" s.license = "MIT" - s.platforms = { :ios => "11.0", :tvos => "11.0" } + s.platforms = { :ios => "12.4", :tvos => "12.4" } s.compiler_flags = folly_compiler_flags + ' -Wno-nullability-completeness' s.author = "Facebook, Inc. and its affiliates" s.source = { :git => "https://github.com/facebook/react-native.git", :tag => "#{s.version}" } diff --git a/packages/rn-tester/Podfile b/packages/rn-tester/Podfile index 041804c4a88d59..f6a399269c663a 100644 --- a/packages/rn-tester/Podfile +++ b/packages/rn-tester/Podfile @@ -1,7 +1,7 @@ require_relative '../../scripts/react_native_pods' source 'https://cdn.cocoapods.org/' -platform :ios, '11.0' +platform :ios, '12.4' # Temporary solution to suppress duplicated GUID error. # Can be removed once we move to generate files outside pod install. diff --git a/packages/rn-tester/Podfile.lock b/packages/rn-tester/Podfile.lock index aa77620b7c2b00..b2bfe778a4bb69 100644 --- a/packages/rn-tester/Podfile.lock +++ b/packages/rn-tester/Podfile.lock @@ -890,9 +890,9 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: boost: a7c83b31436843459a1961bfd74b96033dc77234 CocoaAsyncSocket: 065fd1e645c7abab64f7a6a2007a48038fdc6a99 - DoubleConversion: 831926d9b8bf8166fd87886c4abab286c2422662 - FBLazyVector: b81a2b70c72d8b0aefb652cea22c11e9ffd02949 - FBReactNativeSpec: 4343c04fd79251fa1e5f2243b536df24009834f6 + DoubleConversion: 5189b271737e1565bdce30deb4a08d647e3f5f54 + FBLazyVector: 19e408e76fa9258dd32191a50d60c41444f52d29 + FBReactNativeSpec: fc6b3c34276fb05bb3e0f6bccc50e21dd38de5bf Flipper: 26fc4b7382499f1281eb8cb921e5c3ad6de91fe0 Flipper-Boost-iOSX: fd1e2b8cbef7e662a122412d7ac5f5bea715403c Flipper-DoubleConversion: 3d3d04a078d4f3a1b6c6916587f159dc11f232c4 @@ -903,46 +903,46 @@ SPEC CHECKSUMS: Flipper-RSocket: d9d9ade67cbecf6ac10730304bf5607266dd2541 FlipperKit: cbdee19bdd4e7f05472a66ce290f1b729ba3cb86 fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9 - glog: 476ee3e89abb49e07f822b48323c51c57124b572 + glog: 3d02b25ca00c2d456734d0bcff864cbc62f6ae1a libevent: 4049cae6c81cdb3654a443be001fb9bdceff7913 OpenSSL-Universal: ebc357f1e6bc71fa463ccb2fe676756aff50e88c RCT-Folly: 4d8508a426467c48885f1151029bc15fa5d7b3b8 - RCTRequired: af2d6080a4b9ba0885b28ca78879a92066c71cab - RCTTypeSafety: 2d6c5149fd3b8f2ba89987b47169423efb740300 - React: f64c9f6db5428717922a3292ba6a448615a2e143 - React-bridging: a86401f93edb5564d437595060e55306c877462d - React-callinvoker: c5d61e29df57793f0dc10ec2bc01c846f863e51f + RCTRequired: 1c8808cf84569265784a6c33984bbb506ada8c6e + RCTTypeSafety: b9e639380265155a5bbdac4a72be1307f9360fc6 + React: 8d809d414723bb5763093ddec7658066a21ccabc + React-bridging: 1329cdc45834252447f5f4cb8bd19ec78ef0f06e + React-callinvoker: 5f16202ad4e45f0607b1fae0f6955a8f7c87eef1 React-Codegen: c4ae835565487e494740b756ce953d8f635a76df - React-Core: 30784d0eacbd709a3a6a5ae7c02c928634a6247e - React-CoreModules: 51b1ad5727a4249a596b168439a2578e9dc0d094 - React-cxxreact: cfc1663dae1ea52b465bbf021ef7b1527c5dc80c - React-Fabric: 30b8fa96a0c56d1c11348f77607464eb87bb3f9f - React-graphics: 9a84942b49ea1375ce83844041fa2ba766cfe0b9 - React-jsi: c1c0108d86e1378aabf7c9146ed7d12d87c7df85 - React-jsiexecutor: d08ec14edc8f2e19af51550cd1505332eae35c7b - React-jsinspector: 7d223826b0e7a61b3540c21b9eca2603b1d4e823 - React-logger: 2009c0280c286a76200d6b7c5fe242fad51ddd7a - React-perflogger: fe66bd6d8b17ebcfdf0159bf41fe28d8035ac20c - React-RCTActionSheet: 3131a0b9280aa0e51bdf54b3d79aecd8503db62c - React-RCTAnimation: 938fcdbd56ec129bf02da489725978d2514e4c6d - React-RCTBlob: 5aa3aaaedf02381ff3b2f3ff4926c4652849e0cb - React-RCTFabric: 22135dd0c6db9f52882d08d9ecbc241062c6f8d7 - React-RCTImage: 6d8050f3a4b05d30d5400ef5fd3a234cdf0a893c - React-RCTLinking: c23a7701755a7dd2be14269072d6b4baccf05e65 - React-RCTNetwork: 852ceeef30b0e3306e8ff9aa85ebd8b1d4fafffb - React-RCTPushNotification: df73c64199da24ab93ea0a877f2be14ab1f57f24 - React-RCTSettings: e34c2c120492e21939be1ca8aa72df2782d628ca - React-RCTTest: 7cbcd615b1e74ad59c9ad4257e6c323482114173 - React-RCTText: e9146b2c0550a83d1335bfe2553760070a2d75c7 - React-RCTVibration: 9d4b704673754ed6541075152c522552aebb9237 - React-rncore: b6e9b49eb1c7c045b98c77b1f94932e3c0be7cec - React-runtimeexecutor: 4b0c6eb341c7d3ceb5e2385cb0fdb9bf701024f3 - ReactCommon: f5fd5011a78235afb572a4618bd04a672b41da9d - ScreenshotManager: 8a08e488cb533b83ebe069ad6109d9c1df9cea79 + React-Core: 5f17b3eb71cbd4751186525e874010c264435bae + React-CoreModules: 97cfc7d97cca9a3b59e5c2de5d1e6ddb9605f0c8 + React-cxxreact: 6c8298fa64352792a63f358db73f4f24c1317304 + React-Fabric: 7041000207eca7aa25e73731961630623b8f6510 + React-graphics: d4c10577f5e0221d34e65e658e2770842de99d08 + React-jsi: 08fe8a4e9a4a14a215f55ff954bd2fd8812df27b + React-jsiexecutor: 6f90354b81808e2f408426dfae10ed413df2bada + React-jsinspector: 7733dd522d044aef87caa39f3eda77593358a7eb + React-logger: c7960346b021767ed90971aff592a44e3d69f8bb + React-perflogger: c4fdd48988c2d3047186fc1bc1772d634cfca2ea + React-RCTActionSheet: 166fd1df85ac10219466b45d12a5884d3eaceac1 + React-RCTAnimation: 37350855482bcf0737b6bffe083457a3db801dea + React-RCTBlob: 209aa807339da293db61bed648a691101f23f52f + React-RCTFabric: f67635c27e1287ce62f063beccd210d7c4f2af1f + React-RCTImage: a64fe231fe8fb118a227c3bc12189d7a0c087ed0 + React-RCTLinking: 21bb4675c3ec8fe704672ea511e817aeb3bf8370 + React-RCTNetwork: abf43cb960e7b31a7d082143d66d9bd7d0589505 + React-RCTPushNotification: 7f678a88147254ede5d21a1e1e71e8a964dd0051 + React-RCTSettings: da8c43d0c597d29cd509079411bc191f737a5a81 + React-RCTTest: 451f186880271c249a3ff65761f569592a7765e1 + React-RCTText: a861fbf2835299d3cc4189697cddd8bd8602afb9 + React-RCTVibration: 00dbb5e9451af741c77be12978281ded80046f3d + React-rncore: ed4c24b136f613ebbcfc780a33e2bc23021f3eae + React-runtimeexecutor: 97dca9247f4d3cfe0733384b189c6930fbd402b7 + ReactCommon: 4a2e9e61ef59dc6f7b92f05a6b9e37a0013ee854 + ScreenshotManager: 8baf7f62c6b602ba59ea979d9ed294c98ee3019e SocketRocket: fccef3f9c5cedea1353a9ef6ada904fde10d6608 - Yoga: faebdb8710c7e742c6ab99e14ed4270b8da27f1f + Yoga: cdc7a2377fc03a2d44322b7784a2461b4c17da09 YogaKit: f782866e155069a2cca2517aafea43200b01fd5a -PODFILE CHECKSUM: 064c91fbb8ac895e453a791ebaaae5cfe9c8557d +PODFILE CHECKSUM: 0655d9d79b9837da383b58df5ece7f5c0c4f45b0 COCOAPODS: 1.11.2 diff --git a/packages/rn-tester/RCTTest/React-RCTTest.podspec b/packages/rn-tester/RCTTest/React-RCTTest.podspec index df81459e3ac6a6..5beb07225e04ae 100644 --- a/packages/rn-tester/RCTTest/React-RCTTest.podspec +++ b/packages/rn-tester/RCTTest/React-RCTTest.podspec @@ -26,7 +26,7 @@ Pod::Spec.new do |s| s.homepage = "https://reactnative.dev/" s.license = package["license"] s.author = "Facebook, Inc. and its affiliates" - s.platforms = { :ios => "11.0", :tvos => "11.0" } + s.platforms = { :ios => "12.4", :tvos => "12.4" } s.compiler_flags = folly_compiler_flags + ' -Wno-nullability-completeness' s.source = source s.source_files = "**/*.{h,m,mm}" diff --git a/template/ios/Podfile b/template/ios/Podfile index 01506faf7913c7..06a02f936c61a0 100644 --- a/template/ios/Podfile +++ b/template/ios/Podfile @@ -1,7 +1,7 @@ require_relative '../node_modules/react-native/scripts/react_native_pods' require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules' -platform :ios, '11.0' +platform :ios, '12.4' install! 'cocoapods', :deterministic_uuids => false target 'HelloWorld' do diff --git a/third-party-podspecs/DoubleConversion.podspec b/third-party-podspecs/DoubleConversion.podspec index b7549c3a72832f..93ee49f5d1b50a 100644 --- a/third-party-podspecs/DoubleConversion.podspec +++ b/third-party-podspecs/DoubleConversion.podspec @@ -21,6 +21,6 @@ Pod::Spec.new do |spec| spec.user_target_xcconfig = { "HEADER_SEARCH_PATHS" => "\"$(PODS_ROOT)/DoubleConversion\"" } # Pinning to the same version as React.podspec. - spec.platforms = { :ios => "11.0" } + spec.platforms = { :ios => "12.4" } end diff --git a/third-party-podspecs/glog.podspec b/third-party-podspecs/glog.podspec index f5a2086586bad2..64213f95f36fed 100644 --- a/third-party-podspecs/glog.podspec +++ b/third-party-podspecs/glog.podspec @@ -33,6 +33,6 @@ Pod::Spec.new do |spec| "HEADER_SEARCH_PATHS" => "$(PODS_TARGET_SRCROOT)/src" } # Pinning to the same version as React.podspec. - spec.platforms = { :ios => "11.0" } + spec.platforms = { :ios => "12.4" } end From c71e6efbcd2b95faee327d9763d321488120bc5e Mon Sep 17 00:00:00 2001 From: Phillip Pan Date: Wed, 16 Mar 2022 21:08:01 -0700 Subject: [PATCH 42/48] bump iOS and tvOS from 11.0 to 12.4 in pbxproj Summary: Changelog: [iOS][Deprecated] Deprecating support for iOS/tvOS SDK 11.0, 12.4+ is now required Reviewed By: sammy-SC Differential Revision: D34548360 fbshipit-source-id: e1a90fd6c1fc6b680ea6e53b7434fd7f5c3d6ee4 --- packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj | 8 ++++---- template/ios/HelloWorld.xcodeproj/project.pbxproj | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj b/packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj index a566e7aa2af0d0..a562a0e6279601 100644 --- a/packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj +++ b/packages/rn-tester/RNTesterPods.xcodeproj/project.pbxproj @@ -780,7 +780,7 @@ CODE_SIGN_ENTITLEMENTS = RNTester/RNTester.entitlements; DEVELOPMENT_TEAM = ""; INFOPLIST_FILE = "$(SRCROOT)/RNTester/Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.4; LD_RUNPATH_SEARCH_PATHS = ( /usr/lib/swift, "$(inherited)", @@ -813,7 +813,7 @@ DEVELOPMENT_TEAM = ""; EXCLUDED_ARCHS = ""; INFOPLIST_FILE = "$(SRCROOT)/RNTester/Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.4; LD_RUNPATH_SEARCH_PATHS = ( /usr/lib/swift, "$(inherited)", @@ -898,7 +898,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_LABEL = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.4; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; OTHER_CPLUSPLUSFLAGS = ( @@ -975,7 +975,7 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_LABEL = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.4; MTL_ENABLE_DEBUG_INFO = NO; OTHER_CPLUSPLUSFLAGS = ( "$(OTHER_CFLAGS)", diff --git a/template/ios/HelloWorld.xcodeproj/project.pbxproj b/template/ios/HelloWorld.xcodeproj/project.pbxproj index 7dfdffdd84e3ff..8cfb8881a1028d 100644 --- a/template/ios/HelloWorld.xcodeproj/project.pbxproj +++ b/template/ios/HelloWorld.xcodeproj/project.pbxproj @@ -436,7 +436,7 @@ "$(inherited)", ); INFOPLIST_FILE = HelloWorldTests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.4; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -460,7 +460,7 @@ BUNDLE_LOADER = "$(TEST_HOST)"; COPY_PHASE_STRIP = NO; INFOPLIST_FILE = HelloWorldTests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.4; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -576,7 +576,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.4; LD_RUNPATH_SEARCH_PATHS = ( /usr/lib/swift, "$(inherited)", @@ -640,7 +640,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 11.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.4; LD_RUNPATH_SEARCH_PATHS = ( /usr/lib/swift, "$(inherited)", From b2517c3bdccc3f9d935f4ee06f959d6ce8f27bbe Mon Sep 17 00:00:00 2001 From: fortmarek Date: Thu, 17 Mar 2022 03:52:57 -0700 Subject: [PATCH 43/48] Automatic update of `RCT-Folly` (#32659) Summary: When upgrading `react-native`, the version `RCT-Folly` defined [here](https://github.com/facebook/react-native/blob/main/third-party-podspecs/RCT-Folly.podspec) can change. If that happens, if you run `pod install` after `yarn install`, you will get a similar error to this: ``` [!] CocoaPods could not find compatible versions for pod "RCT-Folly": In snapshot (Podfile.lock): RCT-Folly (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`) In Podfile: RCT-Folly (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`) React-RCTNetwork (from `../node_modules/react-native/Libraries/Network`) was resolved to 0.66.3, which depends on RCT-Folly (= 2021.06.28.00-v2) ``` This error occurs because `Cocoapods` does not update pods that point to a local podspec. Locally, you could resolve this issue by running `pod update RCT-Folly --no-repo-update`. On the CI, you have to do a clean checkout (in case you cache the `Pods` folder which we do). All of this makes upgrading `react-native` painful - for the whole community and for us shopify There are other users who have struggled with this, such as [here](https://github.com/facebook/react-native/issues/32423). The suggestion there is to delete `Podfile.lock` which is unnecessary - but it shows that users are confused what to do with this error and is something worth fixing. To mitigate these issues, `react_native_pods.rb` automatically marks `RCT-Folly` as changed in the [detect_changes_with_podfile method](https://github.com/CocoaPods/Core/blob/master/lib/cocoapods-core/lockfile.rb#L289) from `Pod::Lockfile` if the version in `node_modules/react-native/third-party-podspecs/RCT-Folly.podspec` and `Pods/Local Podspecs/RCT-Folly.podspec.json` mismatch. Instead of automatically updating the local podspec (in `Pods/Local Podspecs` directory) we could also: a) integrate `RCT-Folly` as a local pod (such as `React-Core` and others) b) integrate `RCT-Folly` as an external dependency (going through Cocoapods' centralized repository) I don't have enough context on why `RCT-Folly` is bundled the way it is, so I am open to suggestions here. ## Changelog [iOS] [Fixed] - Fix `pod install` when `RCT-Folly` version has been updated. Pull Request resolved: https://github.com/facebook/react-native/pull/32659 Test Plan: I have created a [repository](https://github.com/fortmarek/react-native-upgrade-reproduction) where you can reproduce the issue. You can simply: 1) clone the repo (`git clone https://github.com/fortmarek/react-native-upgrade-reproduction`) 2) Run `yarn install && cd ios && pod install` 3) Change `react-native` version in `package.json` to `0.66.3` 4) Run again `yarn install && pod install` 5) Observe error To test the fix, you can then: 1) copy-paste the `react_native_pods.rb` file from this branch to `react-native-upgrade-reproduction/node_modules/scripts/react_native_pods.rb` 2) run `pod install` again This time, the `pod install` command should succeed. Reviewed By: sota000 Differential Revision: D32720758 Pulled By: cortinico fbshipit-source-id: 940db9c9f0530f896e47b676dec46bc93cea0085 --- scripts/react_native_pods.rb | 52 ++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/scripts/react_native_pods.rb b/scripts/react_native_pods.rb index 9a348ae04a6891..d5c83a0f9d13c6 100644 --- a/scripts/react_native_pods.rb +++ b/scripts/react_native_pods.rb @@ -119,6 +119,15 @@ def use_react_native! (options={}) end pod 'libevent', '~> 2.1.12' end + + pods_to_update = LocalPodspecPatch.pods_to_update(options) + if !pods_to_update.empty? + if Pod::Lockfile.public_instance_methods.include?(:detect_changes_with_podfile) + Pod::Lockfile.prepend(LocalPodspecPatch) + else + Pod::UI.warn "Automatically updating #{pods_to_update.join(", ")} has failed, please run `pod update #{pods_to_update.join(" ")} --no-repo-update` manually to fix the issue." + end + end end def get_default_flags() @@ -696,3 +705,46 @@ def __apply_Xcode_12_5_M1_post_install_workaround(installer) time_header = "#{Pod::Config.instance.installation_root.to_s}/Pods/RCT-Folly/folly/portability/Time.h" `sed -i -e $'s/ && (__IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_10_0)//' #{time_header}` end + +# Monkeypatch of `Pod::Lockfile` to ensure automatic update of dependencies integrated with a local podspec when their version changed. +# This is necessary because local podspec dependencies must be otherwise manually updated. +module LocalPodspecPatch + # Returns local podspecs whose versions differ from the one in the `react-native` package. + def self.pods_to_update(react_native_options) + prefix = react_native_options[:path] ||= "../node_modules/react-native" + @@local_podspecs = Dir.glob("#{prefix}/third-party-podspecs/*").map { |file| File.basename(file, ".podspec") } + @@local_podspecs = @@local_podspecs.select do |podspec_name| + # Read local podspec to determine the cached version + local_podspec_path = File.join( + Dir.pwd, "Pods/Local Podspecs/#{podspec_name}.podspec.json" + ) + + # Local podspec cannot be outdated if it does not exist, yet + next unless File.file?(local_podspec_path) + + local_podspec = File.read(local_podspec_path) + local_podspec_json = JSON.parse(local_podspec) + local_version = local_podspec_json["version"] + + # Read the version from a podspec from the `react-native` package + podspec_path = "#{prefix}/third-party-podspecs/#{podspec_name}.podspec" + current_podspec = Pod::Specification.from_file(podspec_path) + + current_version = current_podspec.version.to_s + current_version != local_version + end + @@local_podspecs + end + + # Patched `detect_changes_with_podfile` method + def detect_changes_with_podfile(podfile) + changes = super(podfile) + @@local_podspecs.each do |local_podspec| + next unless changes[:unchanged].include?(local_podspec) + + changes[:unchanged].delete(local_podspec) + changes[:changed] << local_podspec + end + changes + end +end From 2d64d1d69360161c047c86a026403d8074ba28bb Mon Sep 17 00:00:00 2001 From: Tatiana Kapos Date: Thu, 17 Mar 2022 03:58:57 -0700 Subject: [PATCH 44/48] Fix RawPropsParser for Windows (#33432) Summary: Changes in https://github.com/facebook/react-native/compare/7cece3423...189c2c895 broke build for Windows because of a conversion from size_t to int. Adds a static cast to int to fix the error and restore windows build Error Message ``` ##[error]node_modules\react-native\ReactCommon\react\renderer\core\RawPropsParser.cpp(100,42): Error C2220: the following warning is treated as an error 3>D:\a\_work\1\s\node_modules\react-native\ReactCommon\react\renderer\core\RawPropsParser.cpp(100,42): error C2220: the following warning is treated as an error [D:\a\_work\1\s\vnext\Microsoft.ReactNative\Microsoft.ReactNative.vcxproj] ##[warning]node_modules\react-native\ReactCommon\react\renderer\core\RawPropsParser.cpp(100,42): **Warning C4267: '=': conversion from 'size_t' to 'int', possible loss of data** 3>D:\a\_work\1\s\node_modules\react-native\ReactCommon\react\renderer\core\RawPropsParser.cpp(100,42): warning C4267: '=': conversion from 'size_t' to 'int', possible loss of data [D:\a\_work\1\s\vnext\Microsoft.ReactNative\Microsoft.ReactNative.vcxproj] ``` ## Changelog [General] [Fixed] - Restore Windows build with RawPropsParser.cpp Pull Request resolved: https://github.com/facebook/react-native/pull/33432 Test Plan: Tested locally and changes pass in the react-native-windows pipeline, change is being merged into the main branch of react-native-windows. Reviewed By: philIip Differential Revision: D34907928 Pulled By: javache fbshipit-source-id: 8b76cbef0b637f2d607a8aefd2998322c3245713 --- ReactCommon/react/renderer/core/RawPropsParser.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ReactCommon/react/renderer/core/RawPropsParser.cpp b/ReactCommon/react/renderer/core/RawPropsParser.cpp index 76b0f163dcb4b5..359b9f2f35ddd6 100644 --- a/ReactCommon/react/renderer/core/RawPropsParser.cpp +++ b/ReactCommon/react/renderer/core/RawPropsParser.cpp @@ -97,7 +97,7 @@ void RawPropsParser::preparse(RawProps const &rawProps) const noexcept { rawProps.keyIndexToValueIndex_.resize(keyCount, kRawPropsValueIndexEmpty); // Resetting the cursor, the next increment will give `0`. - rawProps.keyIndexCursor_ = keyCount - 1; + rawProps.keyIndexCursor_ = static_cast(keyCount - 1); switch (rawProps.mode_) { case RawProps::Mode::Empty: From c418bf4c8fe8bf97273e3a64211eaa38d836e0a0 Mon Sep 17 00:00:00 2001 From: Nicola Corti Date: Thu, 17 Mar 2022 05:56:37 -0700 Subject: [PATCH 45/48] Reduce flakyness of `configureNdkBuild*` tasks by setting an Summary: This is a follow up to https://github.com/facebook/react-native/commit/21dd646ecaf4f17cc62f18a4abf2f9cb88a72881 The ABI specific tasks were not involved in this patch, and they're still failing. I'm fixing them. Changelog: [Internal] [Changed] - Reduce flakyness of `configureNdkBuild*` tasks by setting an explicit dependency on prefab - part 2 Reviewed By: ShikaSD Differential Revision: D34960946 fbshipit-source-id: 3e4feb93aa59cbe47142dece1d0246117381179d --- ReactAndroid/build.gradle | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ReactAndroid/build.gradle b/ReactAndroid/build.gradle index af1b7dfe361934..b2cb489be0312e 100644 --- a/ReactAndroid/build.gradle +++ b/ReactAndroid/build.gradle @@ -423,6 +423,10 @@ afterEvaluate { // This can be safely removed once we move to CMake or once AGP supports C++ references on ndk-build. configureNdkBuildDebug.dependsOn(":ReactAndroid:hermes-engine:prefabDebugPackage") configureNdkBuildRelease.dependsOn(":ReactAndroid:hermes-engine:prefabReleasePackage") + reactNativeArchitectures().each { architecture -> + tasks.named("configureNdkBuildDebug[${architecture}]") { dependsOn(":ReactAndroid:hermes-engine:prefabDebugPackage") } + tasks.named("configureNdkBuildRelease[${architecture}]") { dependsOn(":ReactAndroid:hermes-engine:prefabReleasePackage") } + } publishing { publications { From 7d527e0fc870867a9e308fbd91964a5c8046d556 Mon Sep 17 00:00:00 2001 From: Christoph Purrer Date: Thu, 17 Mar 2022 16:24:09 -0700 Subject: [PATCH 46/48] Export bridging header from testlib Summary: Export bridging for testlib BUCK target Changelog: [General][Fixed] - Export bridging for testlib BUCK target Reviewed By: appden Differential Revision: D34866694 fbshipit-source-id: c2dfbdb98d3c32f70192329a8df139f344a847b7 --- ReactCommon/react/bridging/BUCK | 1 + 1 file changed, 1 insertion(+) diff --git a/ReactCommon/react/bridging/BUCK b/ReactCommon/react/bridging/BUCK index d7de59311a018c..937c45ceb8a7a1 100644 --- a/ReactCommon/react/bridging/BUCK +++ b/ReactCommon/react/bridging/BUCK @@ -28,6 +28,7 @@ rn_xplat_cxx_library( platforms = (ANDROID, APPLE, CXX), visibility = ["PUBLIC"], exported_deps = [ + ":bridging", "//xplat/third-party/gmock:gtest", ], ) From 69e8d3d88398b5a9e15eac668a302eba56f71a11 Mon Sep 17 00:00:00 2001 From: Andrei Shikov Date: Thu, 17 Mar 2022 17:08:24 -0700 Subject: [PATCH 47/48] Build Fabric with CMake Summary: More CMake configurations mirroring Android.mk in place. Changelog: [Internal] - Build fabricjni with CMake Reviewed By: cortinico Differential Revision: D34927238 fbshipit-source-id: 929763ec79a7c168e300e065709a49e4b373326a --- .../facebook/react/fabric/jni/CMakeLists.txt | 70 +++++++++++++++++++ .../renderer/components/modal/CMakeLists.txt | 31 ++++++++ .../components/progressbar/CMakeLists.txt | 34 +++++++++ .../renderer/components/slider/CMakeLists.txt | 38 ++++++++++ .../renderer/components/switch/CMakeLists.txt | 44 ++++++++++++ .../components/textinput/CMakeLists.txt | 2 - 6 files changed, 217 insertions(+), 2 deletions(-) create mode 100644 ReactAndroid/src/main/java/com/facebook/react/fabric/jni/CMakeLists.txt create mode 100644 ReactCommon/react/renderer/components/modal/CMakeLists.txt create mode 100644 ReactCommon/react/renderer/components/progressbar/CMakeLists.txt create mode 100644 ReactCommon/react/renderer/components/slider/CMakeLists.txt create mode 100644 ReactCommon/react/renderer/components/switch/CMakeLists.txt diff --git a/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/CMakeLists.txt b/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/CMakeLists.txt new file mode 100644 index 00000000000000..7afd884900a747 --- /dev/null +++ b/ReactAndroid/src/main/java/com/facebook/react/fabric/jni/CMakeLists.txt @@ -0,0 +1,70 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# +# This source code is licensed under the MIT license found in the +# LICENSE file in the root directory of this source tree. + +cmake_minimum_required(VERSION 3.13) + +file(GLOB fabricjni_SRCS CONFIGURE_DEPENDS *.cpp) + +add_library( + fabricjni + SHARED + ${fabricjni_SRCS} +) + +target_include_directories(fabricjni PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) + +target_link_libraries( + fabricjni + butter + fb + fbjni + folly_runtime + glog + glog_init + jsi + mapbufferjni + react_codegen_rncore + react_debug + react_render_animations + react_render_attributedstring + react_render_componentregistry + react_render_core + react_render_debug + react_render_graphics + react_render_imagemanager + react_render_mapbuffer + react_render_mounting + react_render_runtimescheduler + react_render_scheduler + react_render_telemetry + react_render_templateprocessor + react_render_textlayoutmanager + react_render_uimanager + react_utils + react_config + reactnativeutilsjni + rrc_image + rrc_modal + rrc_progressbar + rrc_root + rrc_scrollview + rrc_slider + rrc_switch + rrc_text + rrc_textinput + rrc_unimplementedview + rrc_view + yoga +) + +target_compile_options( + fabricjni + PRIVATE + -DLOG_TAG=\"Fabric\" + -fexceptions + -frtti + -std=c++17 + -Wall +) diff --git a/ReactCommon/react/renderer/components/modal/CMakeLists.txt b/ReactCommon/react/renderer/components/modal/CMakeLists.txt new file mode 100644 index 00000000000000..8f596972539756 --- /dev/null +++ b/ReactCommon/react/renderer/components/modal/CMakeLists.txt @@ -0,0 +1,31 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# +# This source code is licensed under the MIT license found in the +# LICENSE file in the root directory of this source tree. + +cmake_minimum_required(VERSION 3.13) +set(CMAKE_VERBOSE_MAKEFILE on) + +add_compile_options(-fexceptions -frtti -std=c++17 -Wall -DLOG_TAG=\"Fabric\") + +file(GLOB rrc_modal_SRC CONFIGURE_DEPENDS *.cpp) +add_library(rrc_modal STATIC ${rrc_modal_SRC}) + +target_include_directories(rrc_modal PUBLIC ${REACT_COMMON_DIR}) + +target_link_libraries(rrc_modal + glog + folly_runtime + glog_init + react_codegen_rncore + react_render_componentregistry + react_render_core + react_render_debug + react_render_graphics + react_render_imagemanager + react_render_mapbuffer + react_render_uimanager + rrc_image + rrc_view + yoga +) diff --git a/ReactCommon/react/renderer/components/progressbar/CMakeLists.txt b/ReactCommon/react/renderer/components/progressbar/CMakeLists.txt new file mode 100644 index 00000000000000..c1bc726cf9ced2 --- /dev/null +++ b/ReactCommon/react/renderer/components/progressbar/CMakeLists.txt @@ -0,0 +1,34 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# +# This source code is licensed under the MIT license found in the +# LICENSE file in the root directory of this source tree. + +cmake_minimum_required(VERSION 3.13) +set(CMAKE_VERBOSE_MAKEFILE on) + +add_compile_options(-fexceptions -frtti -std=c++17 -Wall -DLOG_TAG=\"Fabric\") + +file(GLOB rrc_progressbar_SRC CONFIGURE_DEPENDS android/react/renderer/components/progressbar/*.cpp) +add_library(rrc_progressbar STATIC ${rrc_progressbar_SRC}) + +target_include_directories(rrc_progressbar + PUBLIC + ${CMAKE_CURRENT_SOURCE_DIR}/android/ +) + +target_link_libraries(rrc_progressbar + glog + fbjni + folly_runtime + glog_init + react_codegen_rncore + react_debug + react_render_componentregistry + react_render_core + react_render_debug + react_render_graphics + react_render_uimanager + reactnativeutilsjni + rrc_view + yoga +) diff --git a/ReactCommon/react/renderer/components/slider/CMakeLists.txt b/ReactCommon/react/renderer/components/slider/CMakeLists.txt new file mode 100644 index 00000000000000..059ece7daded82 --- /dev/null +++ b/ReactCommon/react/renderer/components/slider/CMakeLists.txt @@ -0,0 +1,38 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# +# This source code is licensed under the MIT license found in the +# LICENSE file in the root directory of this source tree. + +cmake_minimum_required(VERSION 3.13) +set(CMAKE_VERBOSE_MAKEFILE on) + +add_compile_options(-fexceptions -frtti -std=c++17 -Wall -DLOG_TAG=\"Fabric\") + +file(GLOB rrc_slider_SRC CONFIGURE_DEPENDS *.cpp platform/android/react/renderer/components/slider/*.cpp) +add_library(rrc_slider STATIC ${rrc_slider_SRC}) + +target_include_directories(rrc_slider + PUBLIC + ${REACT_COMMON_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/platform/android/ +) + +target_link_libraries(rrc_slider + glog + fbjni + folly_runtime + glog_init + react_codegen_rncore + react_debug + react_render_componentregistry + react_render_core + react_render_debug + react_render_graphics + react_render_imagemanager + react_render_mapbuffer + react_render_uimanager + reactnativeutilsjni + rrc_image + rrc_view + yoga +) diff --git a/ReactCommon/react/renderer/components/switch/CMakeLists.txt b/ReactCommon/react/renderer/components/switch/CMakeLists.txt new file mode 100644 index 00000000000000..f4a251343f978c --- /dev/null +++ b/ReactCommon/react/renderer/components/switch/CMakeLists.txt @@ -0,0 +1,44 @@ +# Copyright (c) Meta Platforms, Inc. and affiliates. +# +# This source code is licensed under the MIT license found in the +# LICENSE file in the root directory of this source tree. + +cmake_minimum_required(VERSION 3.13) + +file(GLOB rrc_switch_SRCS CONFIGURE_DEPENDS androidswitch/react/renderer/components/androidswitch/*.cpp) + +add_library( + rrc_switch + STATIC + ${rrc_switch_SRCS} +) + +target_include_directories(rrc_switch PUBLIC androidswitch/) + +target_link_libraries( + rrc_switch + glog + fbjni + folly_runtime + glog_init + react_codegen_rncore + react_debug + react_render_componentregistry + react_render_core + react_render_debug + react_render_graphics + react_render_uimanager + reactnativeutilsjni + rrc_view + yoga +) + +target_compile_options( + rrc_switch + PRIVATE + -DLOG_TAG=\"Fabric\" + -fexceptions + -frtti + -std=c++17 + -Wall +) diff --git a/ReactCommon/react/renderer/components/textinput/CMakeLists.txt b/ReactCommon/react/renderer/components/textinput/CMakeLists.txt index 863494fc41723d..84826c23d3f5ed 100644 --- a/ReactCommon/react/renderer/components/textinput/CMakeLists.txt +++ b/ReactCommon/react/renderer/components/textinput/CMakeLists.txt @@ -14,8 +14,6 @@ add_library(rrc_textinput SHARED ${rrc_textinput_SRC}) target_include_directories(rrc_textinput PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/androidtextinput/ - PRIVATE - ${CMAKE_CURRENT_SOURCE_DIR}/androidtextinput/react/renderer/components/androidtextinput/ ) target_link_libraries(rrc_textinput From 5f2835b14d35681c268dd64d6ec284ea5f053be3 Mon Sep 17 00:00:00 2001 From: Phillip Pan Date: Thu, 17 Mar 2022 17:19:50 -0700 Subject: [PATCH 48/48] bump iOS 11.0 to 12.4 in BUCK Summary: Changelog: [iOS][Deprecated] Deprecating support for iOS/tvOS SDK 11.0, 12.4+ is now required Reviewed By: fkgozali Differential Revision: D34559477 fbshipit-source-id: cc0dc22a4b5158732ee77c224f351634b9a98aed --- tools/build_defs/oss/rn_defs.bzl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/build_defs/oss/rn_defs.bzl b/tools/build_defs/oss/rn_defs.bzl index b713242f0caf43..e67e0cfaeef2ce 100644 --- a/tools/build_defs/oss/rn_defs.bzl +++ b/tools/build_defs/oss/rn_defs.bzl @@ -69,7 +69,7 @@ JNI_TARGET = "//ReactAndroid/src/main/jni/first-party/jni-hack:jni-hack" KEYSTORE_TARGET = "//keystores:debug" # Minimum supported iOS version for RN -REACT_NATIVE_TARGET_IOS_SDK = "11.0" +REACT_NATIVE_TARGET_IOS_SDK = "12.4" def get_apple_inspector_flags(): return []