update RN to 0.70 (untested)
This commit is contained in:
+6
-3
@@ -20,6 +20,7 @@ DerivedData
|
|||||||
*.hmap
|
*.hmap
|
||||||
*.ipa
|
*.ipa
|
||||||
*.xcuserstate
|
*.xcuserstate
|
||||||
|
ios/.xcode.env.local
|
||||||
|
|
||||||
# Android/IntelliJ
|
# Android/IntelliJ
|
||||||
#
|
#
|
||||||
@@ -29,6 +30,7 @@ build/
|
|||||||
local.properties
|
local.properties
|
||||||
*.iml
|
*.iml
|
||||||
*.hprof
|
*.hprof
|
||||||
|
.cxx/
|
||||||
|
|
||||||
# node.js
|
# node.js
|
||||||
#
|
#
|
||||||
@@ -49,9 +51,10 @@ buck-out/
|
|||||||
# For more information about the recommended setup visit:
|
# For more information about the recommended setup visit:
|
||||||
# https://docs.fastlane.tools/best-practices/source-control/
|
# https://docs.fastlane.tools/best-practices/source-control/
|
||||||
|
|
||||||
*/fastlane/report.xml
|
**/fastlane/report.xml
|
||||||
*/fastlane/Preview.html
|
**/fastlane/Preview.html
|
||||||
*/fastlane/screenshots
|
**/fastlane/screenshots
|
||||||
|
**/fastlane/test_output
|
||||||
|
|
||||||
# Bundle artifact
|
# Bundle artifact
|
||||||
*.jsbundle
|
*.jsbundle
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
16
|
||||||
+1
-1
@@ -1 +1 @@
|
|||||||
2.7.4
|
2.7.5
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
source 'https://rubygems.org'
|
source 'https://rubygems.org'
|
||||||
|
|
||||||
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
|
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
|
||||||
ruby '2.7.4'
|
ruby '2.7.5'
|
||||||
|
|
||||||
gem 'cocoapods', '~> 1.11', '>= 1.11.2'
|
gem 'cocoapods', '~> 1.11', '>= 1.11.2'
|
||||||
|
|||||||
+24
-31
@@ -79,7 +79,7 @@ import org.apache.tools.ant.taskdefs.condition.Os
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
project.ext.react = [
|
project.ext.react = [
|
||||||
enableHermes: false, // clean and rebuild if changing
|
enableHermes: true, // clean and rebuild if changing
|
||||||
]
|
]
|
||||||
|
|
||||||
apply from: "../../node_modules/react-native/react.gradle"
|
apply from: "../../node_modules/react-native/react.gradle"
|
||||||
@@ -143,26 +143,14 @@ android {
|
|||||||
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
|
buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
|
||||||
|
|
||||||
if (isNewArchitectureEnabled()) {
|
if (isNewArchitectureEnabled()) {
|
||||||
// We configure the NDK build only if you decide to opt-in for the New Architecture.
|
// We configure the CMake build only if you decide to opt-in for the New Architecture.
|
||||||
externalNativeBuild {
|
externalNativeBuild {
|
||||||
ndkBuild {
|
cmake {
|
||||||
arguments "APP_PLATFORM=android-21",
|
arguments "-DPROJECT_BUILD_DIR=$buildDir",
|
||||||
"APP_STL=c++_shared",
|
"-DREACT_ANDROID_DIR=$rootDir/../node_modules/react-native/ReactAndroid",
|
||||||
"NDK_TOOLCHAIN_VERSION=clang",
|
"-DREACT_ANDROID_BUILD_DIR=$rootDir/../node_modules/react-native/ReactAndroid/build",
|
||||||
"GENERATED_SRC_DIR=$buildDir/generated/source",
|
"-DNODE_MODULES_DIR=$rootDir/../node_modules",
|
||||||
"PROJECT_BUILD_DIR=$buildDir",
|
"-DANDROID_STL=c++_shared"
|
||||||
"REACT_ANDROID_DIR=$rootDir/../node_modules/react-native/ReactAndroid",
|
|
||||||
"REACT_ANDROID_BUILD_DIR=$rootDir/../node_modules/react-native/ReactAndroid/build"
|
|
||||||
cFlags "-Wall", "-Werror", "-fexceptions", "-frtti", "-DWITH_INSPECTOR=1"
|
|
||||||
cppFlags "-std=c++17"
|
|
||||||
// Make sure this target name is the same you specify inside the
|
|
||||||
// src/main/jni/Android.mk file for the `LOCAL_MODULE` variable.
|
|
||||||
targets "app_appmodules"
|
|
||||||
|
|
||||||
// Fix for windows limit on number of character in file paths and in command lines
|
|
||||||
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
|
|
||||||
arguments "NDK_APP_SHORT_COMMANDS=true"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!enableSeparateBuildPerCPUArchitecture) {
|
if (!enableSeparateBuildPerCPUArchitecture) {
|
||||||
@@ -176,8 +164,8 @@ android {
|
|||||||
if (isNewArchitectureEnabled()) {
|
if (isNewArchitectureEnabled()) {
|
||||||
// We configure the NDK build only if you decide to opt-in for the New Architecture.
|
// We configure the NDK build only if you decide to opt-in for the New Architecture.
|
||||||
externalNativeBuild {
|
externalNativeBuild {
|
||||||
ndkBuild {
|
cmake {
|
||||||
path "$projectDir/src/main/jni/Android.mk"
|
path "$projectDir/src/main/jni/CMakeLists.txt"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
def reactAndroidProjectDir = project(':ReactAndroid').projectDir
|
def reactAndroidProjectDir = project(':ReactAndroid').projectDir
|
||||||
@@ -199,15 +187,15 @@ android {
|
|||||||
preReleaseBuild.dependsOn(packageReactNdkReleaseLibs)
|
preReleaseBuild.dependsOn(packageReactNdkReleaseLibs)
|
||||||
|
|
||||||
// Due to a bug inside AGP, we have to explicitly set a dependency
|
// Due to a bug inside AGP, we have to explicitly set a dependency
|
||||||
// between configureNdkBuild* tasks and the preBuild tasks.
|
// between configureCMakeDebug* tasks and the preBuild tasks.
|
||||||
// This can be removed once this is solved: https://issuetracker.google.com/issues/207403732
|
// This can be removed once this is solved: https://issuetracker.google.com/issues/207403732
|
||||||
configureNdkBuildRelease.dependsOn(preReleaseBuild)
|
configureCMakeRelWithDebInfo.dependsOn(preReleaseBuild)
|
||||||
configureNdkBuildDebug.dependsOn(preDebugBuild)
|
configureCMakeDebug.dependsOn(preDebugBuild)
|
||||||
reactNativeArchitectures().each { architecture ->
|
reactNativeArchitectures().each { architecture ->
|
||||||
tasks.findByName("configureNdkBuildDebug[${architecture}]")?.configure {
|
tasks.findByName("configureCMakeDebug[${architecture}]")?.configure {
|
||||||
dependsOn("preDebugBuild")
|
dependsOn("preDebugBuild")
|
||||||
}
|
}
|
||||||
tasks.findByName("configureNdkBuildRelease[${architecture}]")?.configure {
|
tasks.findByName("configureCMakeRelWithDebInfo[${architecture}]")?.configure {
|
||||||
dependsOn("preReleaseBuild")
|
dependsOn("preReleaseBuild")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -282,9 +270,10 @@ dependencies {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (enableHermes) {
|
if (enableHermes) {
|
||||||
def hermesPath = "../../node_modules/hermes-engine/android/";
|
//noinspection GradleDynamicVersion
|
||||||
debugImplementation files(hermesPath + "hermes-debug.aar")
|
implementation("com.facebook.react:hermes-engine:+") { // From node_modules
|
||||||
releaseImplementation files(hermesPath + "hermes-release.aar")
|
exclude group:'com.facebook.fbjni'
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
implementation jscFlavor
|
implementation jscFlavor
|
||||||
}
|
}
|
||||||
@@ -297,7 +286,11 @@ if (isNewArchitectureEnabled()) {
|
|||||||
configurations.all {
|
configurations.all {
|
||||||
resolutionStrategy.dependencySubstitution {
|
resolutionStrategy.dependencySubstitution {
|
||||||
substitute(module("com.facebook.react:react-native"))
|
substitute(module("com.facebook.react:react-native"))
|
||||||
.using(project(":ReactAndroid")).because("On New Architecture we're building React Native from source")
|
.using(project(":ReactAndroid"))
|
||||||
|
.because("On New Architecture we're building React Native from source")
|
||||||
|
substitute(module("com.facebook.react:hermes-engine"))
|
||||||
|
.using(project(":ReactAndroid:hermes-engine"))
|
||||||
|
.because("On New Architecture we're building Hermes from source")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,8 @@ public class MainActivity extends ReactActivity {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the instance of the {@link ReactActivityDelegate}. There the RootView is created and
|
* Returns the instance of the {@link ReactActivityDelegate}. There the RootView is created and
|
||||||
* you can specify the rendered you wish to use (Fabric or the older renderer).
|
* you can specify the renderer you wish to use - the new renderer (Fabric) or the old renderer
|
||||||
|
* (Paper).
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected ReactActivityDelegate createReactActivityDelegate() {
|
protected ReactActivityDelegate createReactActivityDelegate() {
|
||||||
@@ -38,6 +39,13 @@ public class MainActivity extends ReactActivity {
|
|||||||
return reactRootView;
|
return reactRootView;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected boolean isConcurrentRootEnabled() {
|
||||||
|
// If you opted-in for the New Architecture, we enable Concurrent Root (i.e. React 18).
|
||||||
|
// More on this on https://reactjs.org/blog/2022/03/29/react-v18.html
|
||||||
|
return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(null);
|
super.onCreate(null);
|
||||||
|
|||||||
+1
-1
@@ -105,7 +105,7 @@ public class MainApplicationReactNativeHost extends ReactNativeHost {
|
|||||||
return new FabricJSIModuleProvider(
|
return new FabricJSIModuleProvider(
|
||||||
reactApplicationContext,
|
reactApplicationContext,
|
||||||
componentFactory,
|
componentFactory,
|
||||||
new EmptyReactNativeConfig(),
|
ReactNativeConfig.DEFAULT_CONFIG,
|
||||||
viewManagerRegistry);
|
viewManagerRegistry);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,49 +0,0 @@
|
|||||||
THIS_DIR := $(call my-dir)
|
|
||||||
|
|
||||||
include $(REACT_ANDROID_DIR)/Android-prebuilt.mk
|
|
||||||
|
|
||||||
# If you wish to add a custom TurboModule or Fabric component in your app you
|
|
||||||
# will have to include the following autogenerated makefile.
|
|
||||||
# include $(GENERATED_SRC_DIR)/codegen/jni/Android.mk
|
|
||||||
include $(CLEAR_VARS)
|
|
||||||
|
|
||||||
LOCAL_PATH := $(THIS_DIR)
|
|
||||||
|
|
||||||
# You can customize the name of your application .so file here.
|
|
||||||
LOCAL_MODULE := app_appmodules
|
|
||||||
|
|
||||||
LOCAL_C_INCLUDES := $(LOCAL_PATH)
|
|
||||||
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
|
|
||||||
# files from the codegen (placed in $(GENERATED_SRC_DIR)/codegen/jni)
|
|
||||||
#
|
|
||||||
# LOCAL_C_INCLUDES += $(GENERATED_SRC_DIR)/codegen/jni
|
|
||||||
# LOCAL_SRC_FILES += $(wildcard $(GENERATED_SRC_DIR)/codegen/jni/*.cpp)
|
|
||||||
# LOCAL_EXPORT_C_INCLUDES += $(GENERATED_SRC_DIR)/codegen/jni
|
|
||||||
|
|
||||||
# Here you should add any native library you wish to depend on.
|
|
||||||
LOCAL_SHARED_LIBRARIES := \
|
|
||||||
libfabricjni \
|
|
||||||
libfbjni \
|
|
||||||
libfolly_futures \
|
|
||||||
libfolly_json \
|
|
||||||
libglog \
|
|
||||||
libjsi \
|
|
||||||
libreact_codegen_rncore \
|
|
||||||
libreact_debug \
|
|
||||||
libreact_nativemodule_core \
|
|
||||||
libreact_render_componentregistry \
|
|
||||||
libreact_render_core \
|
|
||||||
libreact_render_debug \
|
|
||||||
libreact_render_graphics \
|
|
||||||
librrc_view \
|
|
||||||
libruntimeexecutor \
|
|
||||||
libturbomodulejsijni \
|
|
||||||
libyoga
|
|
||||||
|
|
||||||
LOCAL_CFLAGS := -DLOG_TAG=\"ReactNative\" -fexceptions -frtti -std=c++17 -Wall
|
|
||||||
|
|
||||||
include $(BUILD_SHARED_LIBRARY)
|
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
cmake_minimum_required(VERSION 3.13)
|
||||||
|
# Define the library name here.
|
||||||
|
project(rndiffapp_appmodules)
|
||||||
|
# This file includes all the necessary to let you build your application with the New Architecture.
|
||||||
|
include(${REACT_ANDROID_DIR}/cmake-utils/ReactNative-application.cmake)
|
||||||
@@ -6,7 +6,7 @@ namespace facebook {
|
|||||||
namespace react {
|
namespace react {
|
||||||
|
|
||||||
std::shared_ptr<TurboModule> MainApplicationModuleProvider(
|
std::shared_ptr<TurboModule> MainApplicationModuleProvider(
|
||||||
const std::string moduleName,
|
const std::string &moduleName,
|
||||||
const JavaTurboModule::InitParams ¶ms) {
|
const JavaTurboModule::InitParams ¶ms) {
|
||||||
// Here you can provide your own module provider for TurboModules coming from
|
// Here you can provide your own module provider for TurboModules coming from
|
||||||
// either your application or from external libraries. The approach to follow
|
// either your application or from external libraries. The approach to follow
|
||||||
@@ -17,6 +17,13 @@ std::shared_ptr<TurboModule> MainApplicationModuleProvider(
|
|||||||
// return module;
|
// return module;
|
||||||
// }
|
// }
|
||||||
// return rncore_ModuleProvider(moduleName, params);
|
// return rncore_ModuleProvider(moduleName, params);
|
||||||
|
|
||||||
|
// Module providers autolinked by RN CLI
|
||||||
|
auto rncli_module = rncli_ModuleProvider(moduleName, params);
|
||||||
|
if (rncli_module != nullptr) {
|
||||||
|
return rncli_module;
|
||||||
|
}
|
||||||
|
|
||||||
return rncore_ModuleProvider(moduleName, params);
|
return rncore_ModuleProvider(moduleName, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ namespace facebook {
|
|||||||
namespace react {
|
namespace react {
|
||||||
|
|
||||||
std::shared_ptr<TurboModule> MainApplicationModuleProvider(
|
std::shared_ptr<TurboModule> MainApplicationModuleProvider(
|
||||||
const std::string moduleName,
|
const std::string &moduleName,
|
||||||
const JavaTurboModule::InitParams ¶ms);
|
const JavaTurboModule::InitParams ¶ms);
|
||||||
|
|
||||||
} // namespace react
|
} // namespace react
|
||||||
|
|||||||
@@ -22,21 +22,21 @@ void MainApplicationTurboModuleManagerDelegate::registerNatives() {
|
|||||||
|
|
||||||
std::shared_ptr<TurboModule>
|
std::shared_ptr<TurboModule>
|
||||||
MainApplicationTurboModuleManagerDelegate::getTurboModule(
|
MainApplicationTurboModuleManagerDelegate::getTurboModule(
|
||||||
const std::string name,
|
const std::string &name,
|
||||||
const std::shared_ptr<CallInvoker> jsInvoker) {
|
const std::shared_ptr<CallInvoker> &jsInvoker) {
|
||||||
// Not implemented yet: provide pure-C++ NativeModules here.
|
// Not implemented yet: provide pure-C++ NativeModules here.
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::shared_ptr<TurboModule>
|
std::shared_ptr<TurboModule>
|
||||||
MainApplicationTurboModuleManagerDelegate::getTurboModule(
|
MainApplicationTurboModuleManagerDelegate::getTurboModule(
|
||||||
const std::string name,
|
const std::string &name,
|
||||||
const JavaTurboModule::InitParams ¶ms) {
|
const JavaTurboModule::InitParams ¶ms) {
|
||||||
return MainApplicationModuleProvider(name, params);
|
return MainApplicationModuleProvider(name, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MainApplicationTurboModuleManagerDelegate::canCreateTurboModule(
|
bool MainApplicationTurboModuleManagerDelegate::canCreateTurboModule(
|
||||||
std::string name) {
|
const std::string &name) {
|
||||||
return getTurboModule(name, nullptr) != nullptr ||
|
return getTurboModule(name, nullptr) != nullptr ||
|
||||||
getTurboModule(name, {.moduleName = name}) != nullptr;
|
getTurboModule(name, {.moduleName = name}) != nullptr;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,17 +21,17 @@ class MainApplicationTurboModuleManagerDelegate
|
|||||||
static void registerNatives();
|
static void registerNatives();
|
||||||
|
|
||||||
std::shared_ptr<TurboModule> getTurboModule(
|
std::shared_ptr<TurboModule> getTurboModule(
|
||||||
const std::string name,
|
const std::string &name,
|
||||||
const std::shared_ptr<CallInvoker> jsInvoker) override;
|
const std::shared_ptr<CallInvoker> &jsInvoker) override;
|
||||||
std::shared_ptr<TurboModule> getTurboModule(
|
std::shared_ptr<TurboModule> getTurboModule(
|
||||||
const std::string name,
|
const std::string &name,
|
||||||
const JavaTurboModule::InitParams ¶ms) override;
|
const JavaTurboModule::InitParams ¶ms) override;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test-only method. Allows user to verify whether a TurboModule can be
|
* Test-only method. Allows user to verify whether a TurboModule can be
|
||||||
* created by instances of this class.
|
* created by instances of this class.
|
||||||
*/
|
*/
|
||||||
bool canCreateTurboModule(std::string name);
|
bool canCreateTurboModule(const std::string &name,);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace react
|
} // namespace react
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
#include <fbjni/fbjni.h>
|
#include <fbjni/fbjni.h>
|
||||||
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
#include <react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h>
|
||||||
#include <react/renderer/components/rncore/ComponentDescriptors.h>
|
#include <react/renderer/components/rncore/ComponentDescriptors.h>
|
||||||
|
#include <rncli.h>
|
||||||
|
|
||||||
namespace facebook {
|
namespace facebook {
|
||||||
namespace react {
|
namespace react {
|
||||||
@@ -14,6 +15,9 @@ std::shared_ptr<ComponentDescriptorProviderRegistry const>
|
|||||||
MainComponentsRegistry::sharedProviderRegistry() {
|
MainComponentsRegistry::sharedProviderRegistry() {
|
||||||
auto providerRegistry = CoreComponentsRegistry::sharedProviderRegistry();
|
auto providerRegistry = CoreComponentsRegistry::sharedProviderRegistry();
|
||||||
|
|
||||||
|
// Autolinked providers registered by RN CLI
|
||||||
|
rncli_registerProviders(providerRegistry);
|
||||||
|
|
||||||
// Custom Fabric Components go here. You can register custom
|
// Custom Fabric Components go here. You can register custom
|
||||||
// components coming from your App or from 3rd party libraries here.
|
// components coming from your App or from 3rd party libraries here.
|
||||||
//
|
//
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ buildscript {
|
|||||||
dependencies {
|
dependencies {
|
||||||
classpath('com.android.tools.build:gradle:7.2.1')
|
classpath('com.android.tools.build:gradle:7.2.1')
|
||||||
classpath("com.facebook.react:react-native-gradle-plugin")
|
classpath("com.facebook.react:react-native-gradle-plugin")
|
||||||
classpath("de.undercouch:gradle-download-task:4.1.2")
|
classpath("de.undercouch:gradle-download-task:5.0.1")
|
||||||
// NOTE: Do not place your application dependencies here; they belong
|
// NOTE: Do not place your application dependencies here; they belong
|
||||||
// in the individual module build.gradle files
|
// in the individual module build.gradle files
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-all.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-all.zip
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
|||||||
@@ -6,4 +6,6 @@ includeBuild('../node_modules/react-native-gradle-plugin')
|
|||||||
if (settings.hasProperty("newArchEnabled") && settings.newArchEnabled == "true") {
|
if (settings.hasProperty("newArchEnabled") && settings.newArchEnabled == "true") {
|
||||||
include(":ReactAndroid")
|
include(":ReactAndroid")
|
||||||
project(":ReactAndroid").projectDir = file('../node_modules/react-native/ReactAndroid')
|
project(":ReactAndroid").projectDir = file('../node_modules/react-native/ReactAndroid')
|
||||||
|
include(":ReactAndroid:hermes-engine")
|
||||||
|
project(":ReactAndroid:hermes-engine").projectDir = file('../node_modules/react-native/ReactAndroid/hermes-engine')
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
|
||||||
|
# This `.xcode.env` file is versioned and is used to source the environment
|
||||||
|
# used when running script phases inside Xcode.
|
||||||
|
# To customize your local environment, you can create an `.xcode.env.local`
|
||||||
|
# file that is not versioned.
|
||||||
|
# NODE_BINARY variable contains the PATH to the node executable.
|
||||||
|
#
|
||||||
|
# Customize the NODE_BINARY variable here.
|
||||||
|
# For example, to use nvm with brew, add the following line
|
||||||
|
# . "$(brew --prefix nvm)/nvm.sh" --no-use
|
||||||
|
export NODE_BINARY=$(command -v node)
|
||||||
+12
-9
@@ -13,9 +13,13 @@ target 'app' do
|
|||||||
|
|
||||||
use_react_native!(
|
use_react_native!(
|
||||||
:path => config[:reactNativePath],
|
:path => config[:reactNativePath],
|
||||||
# to enable hermes on iOS, change `false` to `true` and then install pods
|
# Hermes is now enabled by default. Disable by setting this flag to false.
|
||||||
:hermes_enabled => flags[:hermes_enabled],
|
# Upcoming versions of React Native may rely on get_default_flags(), but
|
||||||
|
# we make it explicit here to aid in the React Native upgrade process.
|
||||||
|
:hermes_enabled => true,
|
||||||
:fabric_enabled => flags[:fabric_enabled],
|
:fabric_enabled => flags[:fabric_enabled],
|
||||||
|
|
||||||
|
:flipper_configuration => FlipperConfiguration.enabled,
|
||||||
# An absolute path to your application root.
|
# An absolute path to your application root.
|
||||||
:app_path => "#{Pod::Config.instance.installation_root}/.."
|
:app_path => "#{Pod::Config.instance.installation_root}/.."
|
||||||
)
|
)
|
||||||
@@ -25,14 +29,13 @@ target 'app' do
|
|||||||
# Pods for testing
|
# Pods for testing
|
||||||
end
|
end
|
||||||
|
|
||||||
# Enables Flipper.
|
|
||||||
#
|
|
||||||
# Note that if you have use_frameworks! enabled, Flipper will not work and
|
|
||||||
# you should disable the next line.
|
|
||||||
#use_flipper!()
|
|
||||||
|
|
||||||
post_install do |installer|
|
post_install do |installer|
|
||||||
react_native_post_install(installer)
|
react_native_post_install(
|
||||||
|
installer,
|
||||||
|
# Set `mac_catalyst_enabled` to `true` in order to apply patches
|
||||||
|
# necessary for Mac Catalyst builds
|
||||||
|
:mac_catalyst_enabled => false
|
||||||
|
)
|
||||||
__apply_Xcode_12_5_M1_post_install_workaround(installer)
|
__apply_Xcode_12_5_M1_post_install_workaround(installer)
|
||||||
|
|
||||||
# iOS fix
|
# iOS fix
|
||||||
|
|||||||
@@ -264,7 +264,7 @@
|
|||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
shellPath = /bin/sh;
|
shellPath = /bin/sh;
|
||||||
shellScript = "set -e\n\nexport NODE_BINARY=node\n../node_modules/react-native/scripts/react-native-xcode.sh\n";
|
shellScript = "set -e\n\nWITH_ENVIRONMENT=\"../node_modules/react-native/scripts/xcode/with-environment.sh\"\nREACT_NATIVE_XCODE=\"../node_modules/react-native/scripts/react-native-xcode.sh\"\n\n/bin/sh -c \"$WITH_ENVIRONMENT $REACT_NATIVE_XCODE\"\n";
|
||||||
};
|
};
|
||||||
8DC349844744C81F79F94A1E /* [CP] Copy Pods Resources */ = {
|
8DC349844744C81F79F94A1E /* [CP] Copy Pods Resources */ = {
|
||||||
isa = PBXShellScriptBuildPhase;
|
isa = PBXShellScriptBuildPhase;
|
||||||
@@ -405,7 +405,7 @@
|
|||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
);
|
);
|
||||||
INFOPLIST_FILE = appTests/Info.plist;
|
INFOPLIST_FILE = appTests/Info.plist;
|
||||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
IPHONEOS_DEPLOYMENT_TARGET = 12.4;
|
||||||
LD_RUNPATH_SEARCH_PATHS = (
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
@@ -430,7 +430,7 @@
|
|||||||
BUNDLE_LOADER = "$(TEST_HOST)";
|
BUNDLE_LOADER = "$(TEST_HOST)";
|
||||||
COPY_PHASE_STRIP = NO;
|
COPY_PHASE_STRIP = NO;
|
||||||
INFOPLIST_FILE = appTests/Info.plist;
|
INFOPLIST_FILE = appTests/Info.plist;
|
||||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
IPHONEOS_DEPLOYMENT_TARGET = 12.4;
|
||||||
LD_RUNPATH_SEARCH_PATHS = (
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
@@ -552,7 +552,7 @@
|
|||||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
IPHONEOS_DEPLOYMENT_TARGET = 12.4;
|
||||||
LD_RUNPATH_SEARCH_PATHS = (
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
/usr/lib/swift,
|
/usr/lib/swift,
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
@@ -616,7 +616,7 @@
|
|||||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
|
||||||
GCC_WARN_UNUSED_FUNCTION = YES;
|
GCC_WARN_UNUSED_FUNCTION = YES;
|
||||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||||
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
|
IPHONEOS_DEPLOYMENT_TARGET = 12.4;
|
||||||
LD_RUNPATH_SEARCH_PATHS = (
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
/usr/lib/swift,
|
/usr/lib/swift,
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
|
|||||||
+23
-1
@@ -22,6 +22,8 @@
|
|||||||
|
|
||||||
#import <react/config/ReactNativeConfig.h>
|
#import <react/config/ReactNativeConfig.h>
|
||||||
|
|
||||||
|
static NSString *const kRNConcurrentRoot = @"concurrentRoot";
|
||||||
|
|
||||||
@interface AppDelegate () <RCTCxxBridgeDelegate, RCTTurboModuleManagerDelegate> {
|
@interface AppDelegate () <RCTCxxBridgeDelegate, RCTTurboModuleManagerDelegate> {
|
||||||
RCTTurboModuleManager *_turboModuleManager;
|
RCTTurboModuleManager *_turboModuleManager;
|
||||||
RCTSurfacePresenterBridgeAdapter *_bridgeAdapter;
|
RCTSurfacePresenterBridgeAdapter *_bridgeAdapter;
|
||||||
@@ -47,7 +49,8 @@
|
|||||||
bridge.surfacePresenter = _bridgeAdapter.surfacePresenter;
|
bridge.surfacePresenter = _bridgeAdapter.surfacePresenter;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
UIView *rootView = RCTAppSetupDefaultRootView(bridge, @"xyz.blueskyweb.app", nil);
|
NSDictionary *initProps = [self prepareInitialProps];
|
||||||
|
UIView *rootView = RCTAppSetupDefaultRootView(bridge, @"RnDiffApp", initProps);
|
||||||
|
|
||||||
if (@available(iOS 13.0, *)) {
|
if (@available(iOS 13.0, *)) {
|
||||||
rootView.backgroundColor = [UIColor systemBackgroundColor];
|
rootView.backgroundColor = [UIColor systemBackgroundColor];
|
||||||
@@ -67,6 +70,25 @@
|
|||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// This method controls whether the `concurrentRoot`feature of React18 is turned on or off.
|
||||||
|
///
|
||||||
|
/// @see: https://reactjs.org/blog/2022/03/29/react-v18.html
|
||||||
|
/// @note: This requires to be rendering on Fabric (i.e. on the New Architecture).
|
||||||
|
/// @return: `true` if the `concurrentRoot` feture is enabled. Otherwise, it returns `false`.
|
||||||
|
- (BOOL)concurrentRootEnabled
|
||||||
|
{
|
||||||
|
// Switch this bool to turn on and off the concurrent root
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
- (NSDictionary *)prepareInitialProps
|
||||||
|
{
|
||||||
|
NSMutableDictionary *initProps = [NSMutableDictionary new];
|
||||||
|
#ifdef RCT_NEW_ARCH_ENABLED
|
||||||
|
initProps[kRNConcurrentRoot] = @([self concurrentRootEnabled]);
|
||||||
|
#endif
|
||||||
|
return initProps;
|
||||||
|
}
|
||||||
|
|
||||||
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
|
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge
|
||||||
{
|
{
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
|
|||||||
+4
-4
@@ -29,10 +29,10 @@
|
|||||||
"lru_map": "^0.4.1",
|
"lru_map": "^0.4.1",
|
||||||
"mobx": "^6.6.1",
|
"mobx": "^6.6.1",
|
||||||
"mobx-react-lite": "^3.4.0",
|
"mobx-react-lite": "^3.4.0",
|
||||||
"react": "17.0.2",
|
"react": "18.1.0",
|
||||||
"react-circular-progressbar": "^2.1.0",
|
"react-circular-progressbar": "^2.1.0",
|
||||||
"react-dom": "17.0.2",
|
"react-dom": "17.0.2",
|
||||||
"react-native": "0.68.2",
|
"react-native": "0.70.0",
|
||||||
"react-native-appstate-hook": "^1.0.6",
|
"react-native-appstate-hook": "^1.0.6",
|
||||||
"react-native-gesture-handler": "^2.5.0",
|
"react-native-gesture-handler": "^2.5.0",
|
||||||
"react-native-image-crop-picker": "^0.38.1",
|
"react-native-image-crop-picker": "^0.38.1",
|
||||||
@@ -68,10 +68,10 @@
|
|||||||
"babel-plugin-react-native-web": "^0.17.7",
|
"babel-plugin-react-native-web": "^0.17.7",
|
||||||
"eslint": "^7.32.0",
|
"eslint": "^7.32.0",
|
||||||
"jest": "^26.6.3",
|
"jest": "^26.6.3",
|
||||||
"metro-react-native-babel-preset": "^0.67.0",
|
"metro-react-native-babel-preset": "^0.72.1",
|
||||||
"react-native-dotenv": "^3.3.1",
|
"react-native-dotenv": "^3.3.1",
|
||||||
"react-scripts": "^5.0.1",
|
"react-scripts": "^5.0.1",
|
||||||
"react-test-renderer": "17.0.2",
|
"react-test-renderer": "18.1.0",
|
||||||
"typescript": "^4.4.4"
|
"typescript": "^4.4.4"
|
||||||
},
|
},
|
||||||
"resolutions": {
|
"resolutions": {
|
||||||
|
|||||||
Reference in New Issue
Block a user