diff --git a/apps/fabric-example/ios/Podfile.lock b/apps/fabric-example/ios/Podfile.lock index adbaf071b8a7..d997e7f01424 100644 --- a/apps/fabric-example/ios/Podfile.lock +++ b/apps/fabric-example/ios/Podfile.lock @@ -3187,7 +3187,7 @@ SPEC CHECKSUMS: RNCClipboard: 4b58c780f63676367640f23c8e114e9bd0cf86ac RNCMaskedView: 5ef8c95cbab95334a32763b72896a7b7d07e6299 RNGestureHandler: f1dd7f92a0faa2868a919ab53bb9d66eb4ebfcf5 - RNReanimated: 97ebf4d3c76929b6b0f866cfbd41c49b3a0d2dbf + RNReanimated: bc0382396851aa6acf8c7a1e46095046a0a3824a RNScreens: 0bbf16c074ae6bb1058a7bf2d1ae017f4306797c RNSVG: 8c0bbfa480a24b24468f1c76bd852a4aac3178e6 RNWorklets: 991f94e4fa31fc20853e74d5d987426f8580cb0d diff --git a/packages/react-native-reanimated/Common/cpp/reanimated/Fabric/ReanimatedCommitHook.cpp b/packages/react-native-reanimated/Common/cpp/reanimated/Fabric/ReanimatedCommitHook.cpp index 1fde84303158..2e7f8eb91dfd 100644 --- a/packages/react-native-reanimated/Common/cpp/reanimated/Fabric/ReanimatedCommitHook.cpp +++ b/packages/react-native-reanimated/Common/cpp/reanimated/Fabric/ReanimatedCommitHook.cpp @@ -53,10 +53,10 @@ RootShadowNode::Unshared ReanimatedCommitHook::shadowTreeWillCommit( ShadowTree const &, RootShadowNode::Shared const &, RootShadowNode::Unshared const &newRootShadowNode -#if REACT_NATIVE_MINOR_VERSION >= 80 +#if REACT_NATIVE_VERSION_MINOR >= 80 , const ShadowTreeCommitOptions &commitOptions -#endif +#endif // REACT_NATIVE_VERSION_MINOR >= 80 ) noexcept { ReanimatedSystraceSection s("ReanimatedCommitHook::shadowTreeWillCommit"); @@ -74,9 +74,9 @@ RootShadowNode::Unshared ReanimatedCommitHook::shadowTreeWillCommit( return newRootShadowNode; } -#if REACT_NATIVE_MINOR_VERSION >= 80 - if constexpr (StaticFeatureFlags::getFlag( - "USE_COMMIT_HOOK_ONLY_FOR_REACT_COMMITS")) { + if constexpr ( + ReactNativeVersion.Minor >= 80 && + StaticFeatureFlags::getFlag("USE_COMMIT_HOOK_ONLY_FOR_REACT_COMMITS")) { // State updates are based on the currently committed ShadowTree, // which means that all animation changes are already included. // Therefore, there's no need to reapply styles from the props map. @@ -84,7 +84,6 @@ RootShadowNode::Unshared ReanimatedCommitHook::shadowTreeWillCommit( return newRootShadowNode; } } -#endif // ShadowTree not commited by Reanimated, apply updates from the updates // registry manager diff --git a/packages/react-native-reanimated/Common/cpp/reanimated/Fabric/ReanimatedCommitHook.h b/packages/react-native-reanimated/Common/cpp/reanimated/Fabric/ReanimatedCommitHook.h index 1ca39bfe716a..28f0f12831cb 100644 --- a/packages/react-native-reanimated/Common/cpp/reanimated/Fabric/ReanimatedCommitHook.h +++ b/packages/react-native-reanimated/Common/cpp/reanimated/Fabric/ReanimatedCommitHook.h @@ -3,6 +3,7 @@ #include #include +#include #include #include @@ -32,10 +33,10 @@ class ReanimatedCommitHook ShadowTree const &shadowTree, RootShadowNode::Shared const &oldRootShadowNode, RootShadowNode::Unshared const &newRootShadowNode -#if REACT_NATIVE_MINOR_VERSION >= 80 +#if REACT_NATIVE_VERSION_MINOR >= 80 , const ShadowTreeCommitOptions &commitOptions -#endif +#endif // REACT_NATIVE_VERSION_MINOR >= 80 ) noexcept override; private: diff --git a/packages/react-native-reanimated/Common/cpp/reanimated/Fabric/ReanimatedMountHook.cpp b/packages/react-native-reanimated/Common/cpp/reanimated/Fabric/ReanimatedMountHook.cpp index 122d5a23f655..2e32d1fc7fe3 100644 --- a/packages/react-native-reanimated/Common/cpp/reanimated/Fabric/ReanimatedMountHook.cpp +++ b/packages/react-native-reanimated/Common/cpp/reanimated/Fabric/ReanimatedMountHook.cpp @@ -20,11 +20,11 @@ ReanimatedMountHook::~ReanimatedMountHook() noexcept { void ReanimatedMountHook::shadowTreeDidMount( const RootShadowNode::Shared &rootShadowNode, -#if REACT_NATIVE_MINOR_VERSION >= 81 +#if REACT_NATIVE_VERSION_MINOR >= 81 HighResTimeStamp #else double -#endif // REACT_NATIVE_MINOR_VERSION >= 81 +#endif // REACT_NATIVE_VERSION_MINOR >= 81 ) noexcept { ReanimatedSystraceSection s("ReanimatedMountHook::shadowTreeDidMount"); diff --git a/packages/react-native-reanimated/Common/cpp/reanimated/Fabric/ReanimatedMountHook.h b/packages/react-native-reanimated/Common/cpp/reanimated/Fabric/ReanimatedMountHook.h index ea077dd745ce..03f021936547 100644 --- a/packages/react-native-reanimated/Common/cpp/reanimated/Fabric/ReanimatedMountHook.h +++ b/packages/react-native-reanimated/Common/cpp/reanimated/Fabric/ReanimatedMountHook.h @@ -3,6 +3,7 @@ #include #include +#include #include #include @@ -21,11 +22,11 @@ class ReanimatedMountHook : public UIManagerMountHook { void shadowTreeDidMount( RootShadowNode::Shared const &rootShadowNode, -#if REACT_NATIVE_MINOR_VERSION >= 81 +#if REACT_NATIVE_VERSION_MINOR >= 81 HighResTimeStamp /*unmountTime*/ #else double /*unmountTime*/ -#endif // REACT_NATIVE_MINOR_VERSION >= 81 +#endif // REACT_NATIVE_VERSION_MINOR >= 81 ) noexcept override; private: diff --git a/packages/react-native-reanimated/Common/cpp/reanimated/Fabric/updates/AnimatedPropsRegistry.cpp b/packages/react-native-reanimated/Common/cpp/reanimated/Fabric/updates/AnimatedPropsRegistry.cpp index 8af8cd85bf54..81f80ddf13b9 100644 --- a/packages/react-native-reanimated/Common/cpp/reanimated/Fabric/updates/AnimatedPropsRegistry.cpp +++ b/packages/react-native-reanimated/Common/cpp/reanimated/Fabric/updates/AnimatedPropsRegistry.cpp @@ -1,17 +1,19 @@ #include +#include + #include namespace reanimated { -#if REACT_NATIVE_MINOR_VERSION >= 81 +#if REACT_NATIVE_VERSION_MINOR >= 81 static inline std::shared_ptr shadowNodeFromValue( jsi::Runtime &rt, const jsi::Value &shadowNodeWrapper) { return Bridging>::fromJs( rt, shadowNodeWrapper); } -#endif +#endif // REACT_NATIVE_VERSION_MINOR >= 81 void AnimatedPropsRegistry::update( jsi::Runtime &rt, diff --git a/packages/react-native-reanimated/Common/cpp/reanimated/NativeModules/ReanimatedModuleProxy.cpp b/packages/react-native-reanimated/Common/cpp/reanimated/NativeModules/ReanimatedModuleProxy.cpp index 218e5362a703..f4d9eec91592 100644 --- a/packages/react-native-reanimated/Common/cpp/reanimated/NativeModules/ReanimatedModuleProxy.cpp +++ b/packages/react-native-reanimated/Common/cpp/reanimated/NativeModules/ReanimatedModuleProxy.cpp @@ -13,6 +13,7 @@ #include #endif // __ANDROID__ +#include #include #include @@ -26,14 +27,14 @@ namespace reanimated { -#if REACT_NATIVE_MINOR_VERSION >= 81 +#if REACT_NATIVE_VERSION_MINOR >= 81 static inline std::shared_ptr shadowNodeFromValue( jsi::Runtime &rt, const jsi::Value &shadowNodeWrapper) { return Bridging>::fromJs( rt, shadowNodeWrapper); } -#endif +#endif // REACT_NATIVE_VERSION_MINOR >= 81 ReanimatedModuleProxy::ReanimatedModuleProxy( const std::shared_ptr &workletsModuleProxy, diff --git a/packages/react-native-reanimated/RNReanimated.podspec b/packages/react-native-reanimated/RNReanimated.podspec index dba0fade5228..e090e5e757d4 100644 --- a/packages/react-native-reanimated/RNReanimated.podspec +++ b/packages/react-native-reanimated/RNReanimated.podspec @@ -10,7 +10,7 @@ assert_new_architecture_enabled($new_arch_enabled) boost_compiler_flags = '-Wno-documentation' example_flag = $config[:is_reanimated_example_app] ? '-DIS_REANIMATED_EXAMPLE_APP' : '' -version_flags = "-DREACT_NATIVE_MINOR_VERSION=#{$config[:react_native_minor_version]} -DREANIMATED_VERSION=#{reanimated_package_json['version']}" +version_flag = "-DREANIMATED_VERSION=#{reanimated_package_json['version']}" ios_min_version = '13.4' # Directory in which data for further processing for clangd will be stored. @@ -84,7 +84,7 @@ Pod::Spec.new do |s| "\"$(PODS_ROOT)/#{$config[:dynamic_frameworks_worklets_dir]}/apple\"", "\"$(PODS_ROOT)/#{$config[:dynamic_frameworks_worklets_dir]}/Common/cpp\"", ].join(' '), - "OTHER_CFLAGS" => "$(inherited) #{example_flag} #{version_flags} #{compilation_metadata_generation_flag} #{feature_flags}", + "OTHER_CFLAGS" => "$(inherited) #{example_flag} #{version_flag} #{compilation_metadata_generation_flag} #{feature_flags}", } s.requires_arc = true diff --git a/packages/react-native-reanimated/android/CMakeLists.txt b/packages/react-native-reanimated/android/CMakeLists.txt index 357a6db7107e..76b1dd7eb3d1 100644 --- a/packages/react-native-reanimated/android/CMakeLists.txt +++ b/packages/react-native-reanimated/android/CMakeLists.txt @@ -11,11 +11,7 @@ set(CMAKE_CXX_STANDARD 20) include("${REACT_NATIVE_DIR}/ReactAndroid/cmake-utils/folly-flags.cmake") add_compile_options(${folly_FLAGS}) -string( - APPEND - CMAKE_CXX_FLAGS - " -DREACT_NATIVE_MINOR_VERSION=${REACT_NATIVE_MINOR_VERSION}\ - -DREANIMATED_VERSION=${REANIMATED_VERSION}\ +string(APPEND CMAKE_CXX_FLAGS " -DREANIMATED_VERSION=${REANIMATED_VERSION}\ -DREANIMATED_FEATURE_FLAGS=\"${REANIMATED_FEATURE_FLAGS}\"") string(APPEND CMAKE_CXX_FLAGS " -fno-omit-frame-pointer -fstack-protector-all") # flags to optimize the binary size diff --git a/packages/react-native-reanimated/android/build.gradle b/packages/react-native-reanimated/android/build.gradle index 86bace765ea9..58adfad74af7 100644 --- a/packages/react-native-reanimated/android/build.gradle +++ b/packages/react-native-reanimated/android/build.gradle @@ -71,11 +71,6 @@ def getReactNativeVersion() { return reactProperties.getProperty("VERSION_NAME") } -def getReactNativeMinorVersion() { - def reactNativeVersion = getReactNativeVersion() - return reactNativeVersion.startsWith("0.0.0-") ? 1000 : reactNativeVersion.split("\\.")[1].toInteger() -} - def getReanimatedVersion() { def inputFile = file(projectDir.path + '/../package.json') def json = new JsonSlurper().parseText(inputFile.text) @@ -118,7 +113,6 @@ if (isNewArchitectureEnabled()) { def packageDir = project.projectDir.parentFile def reactNativeRootDir = resolveReactNativeDirectory() def reactNativeWorkletsRootDir = resolveReactNativeWorkletsDirectory() -def REACT_NATIVE_MINOR_VERSION = getReactNativeMinorVersion() def REACT_NATIVE_VERSION = getReactNativeVersion() def REANIMATED_VERSION = getReanimatedVersion() def IS_NEW_ARCHITECTURE_ENABLED = isNewArchitectureEnabled() @@ -190,12 +184,10 @@ android { buildConfigField("String", "REANIMATED_VERSION_JAVA", "\"${REANIMATED_VERSION}\"") buildConfigField("boolean", "IS_INTERNAL_BUILD", "false") buildConfigField("int", "EXOPACKAGE_FLAGS", "0") - buildConfigField("int", "REACT_NATIVE_MINOR_VERSION", REACT_NATIVE_MINOR_VERSION.toString()) externalNativeBuild { cmake { arguments "-DANDROID_STL=c++_shared", - "-DREACT_NATIVE_MINOR_VERSION=${REACT_NATIVE_MINOR_VERSION}", "-DANDROID_TOOLCHAIN=clang", "-DREACT_NATIVE_DIR=${toPlatformFileString(reactNativeRootDir.path)}", "-DREACT_NATIVE_WORKLETS_DIR=${toPlatformFileString(reactNativeWorkletsRootDir.path)}", diff --git a/packages/react-native-reanimated/scripts/reanimated_utils.rb b/packages/react-native-reanimated/scripts/reanimated_utils.rb index 72bdfce6a5a7..e987ddec6d94 100644 --- a/packages/react-native-reanimated/scripts/reanimated_utils.rb +++ b/packages/react-native-reanimated/scripts/reanimated_utils.rb @@ -10,7 +10,6 @@ def find_config() result = { :is_reanimated_example_app => nil, :react_native_version => nil, - :react_native_minor_version => nil, :is_tvos_target => nil, :react_native_node_modules_dir => nil, :react_native_common_dir => nil, @@ -40,10 +39,6 @@ def find_config() result[:is_reanimated_example_app] = ENV["IS_REANIMATED_EXAMPLE_APP"] != nil result[:is_tvos_target] = react_native_json['name'] == 'react-native-tvos' result[:react_native_version] = react_native_json['version'] - result[:react_native_minor_version] = react_native_json['version'].split('.')[1].to_i - if result[:react_native_minor_version] == 0 # nightly - result[:react_native_minor_version] = 1000 - end result[:react_native_node_modules_dir] = File.expand_path(react_native_node_modules_dir) pods_root = Pod::Config.instance.project_pods_root diff --git a/packages/react-native-worklets/android/CMakeLists.txt b/packages/react-native-worklets/android/CMakeLists.txt index 7ce60581c4de..5b194dff8ad9 100644 --- a/packages/react-native-worklets/android/CMakeLists.txt +++ b/packages/react-native-worklets/android/CMakeLists.txt @@ -11,11 +11,7 @@ set(CMAKE_CXX_STANDARD 20) include("${REACT_NATIVE_DIR}/ReactAndroid/cmake-utils/folly-flags.cmake") add_compile_options(${folly_FLAGS}) -string( - APPEND - CMAKE_CXX_FLAGS - " -DREACT_NATIVE_MINOR_VERSION=${REACT_NATIVE_MINOR_VERSION}\ - -DWORKLETS_VERSION=${WORKLETS_VERSION}\ +string(APPEND CMAKE_CXX_FLAGS " -DWORKLETS_VERSION=${WORKLETS_VERSION}\ -DWORKLETS_FEATURE_FLAGS=\"${WORKLETS_FEATURE_FLAGS}\"\ -DHERMES_V1_ENABLED=${HERMES_V1_ENABLED}") diff --git a/packages/react-native-worklets/android/build.gradle b/packages/react-native-worklets/android/build.gradle index 2e5ad454afb1..9c61a25b24b7 100644 --- a/packages/react-native-worklets/android/build.gradle +++ b/packages/react-native-worklets/android/build.gradle @@ -95,7 +95,6 @@ if (isNewArchitectureEnabled()) { def packageDir = project.projectDir.parentFile def reactNativeRootDir = resolveReactNativeDirectory() -def REACT_NATIVE_MINOR_VERSION = getReactNativeMinorVersion() def REACT_NATIVE_VERSION = getReactNativeVersion() def WORKLETS_VERSION = getWorkletsVersion() def IS_NEW_ARCHITECTURE_ENABLED = isNewArchitectureEnabled() @@ -183,13 +182,11 @@ android { buildConfigField("boolean", "IS_INTERNAL_BUILD", "false") buildConfigField("int", "EXOPACKAGE_FLAGS", "0") - buildConfigField("int", "REACT_NATIVE_MINOR_VERSION", REACT_NATIVE_MINOR_VERSION.toString()) buildConfigField("boolean", "BUNDLE_MODE", BUNDLE_MODE.toString()) externalNativeBuild { cmake { arguments "-DANDROID_STL=c++_shared", - "-DREACT_NATIVE_MINOR_VERSION=${REACT_NATIVE_MINOR_VERSION}", "-DANDROID_TOOLCHAIN=clang", "-DREACT_NATIVE_DIR=${toPlatformFileString(reactNativeRootDir.path)}", "-DJS_RUNTIME=${JS_RUNTIME}", diff --git a/packages/react-native-worklets/scripts/worklets_utils.rb b/packages/react-native-worklets/scripts/worklets_utils.rb index a42a309e29ab..bc5c18bfb0ce 100644 --- a/packages/react-native-worklets/scripts/worklets_utils.rb +++ b/packages/react-native-worklets/scripts/worklets_utils.rb @@ -12,7 +12,6 @@ def worklets_find_config() :is_reanimated_example_app => nil, :is_tvos_target => nil, :react_native_version => nil, - :react_native_minor_version => nil, :react_native_node_modules_dir => nil, :react_native_common_dir => nil, :dynamic_frameworks_worklets_dir => nil, @@ -36,10 +35,6 @@ def worklets_find_config() result[:is_reanimated_example_app] = ENV["IS_REANIMATED_EXAMPLE_APP"] != nil result[:is_tvos_target] = react_native_json['name'] == 'react-native-tvos' result[:react_native_version] = react_native_json['version'] - result[:react_native_minor_version] = react_native_json['version'].split('.')[1].to_i - if result[:react_native_minor_version] == 0 # nightly - result[:react_native_minor_version] = 1000 - end result[:react_native_node_modules_dir] = File.expand_path(react_native_node_modules_dir) pods_root = Pod::Config.instance.project_pods_root