Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/fabric-example/ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3187,7 +3187,7 @@ SPEC CHECKSUMS:
RNCClipboard: 4b58c780f63676367640f23c8e114e9bd0cf86ac
RNCMaskedView: 5ef8c95cbab95334a32763b72896a7b7d07e6299
RNGestureHandler: f1dd7f92a0faa2868a919ab53bb9d66eb4ebfcf5
RNReanimated: 97ebf4d3c76929b6b0f866cfbd41c49b3a0d2dbf
RNReanimated: bc0382396851aa6acf8c7a1e46095046a0a3824a
RNScreens: 0bbf16c074ae6bb1058a7bf2d1ae017f4306797c
RNSVG: 8c0bbfa480a24b24468f1c76bd852a4aac3178e6
RNWorklets: 991f94e4fa31fc20853e74d5d987426f8580cb0d
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand All @@ -74,17 +74,16 @@ 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.
if (commitOptions.source != ShadowTreeCommitSource::React) {
return newRootShadowNode;
}
}
#endif

// ShadowTree not commited by Reanimated, apply updates from the updates
// registry manager
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include <reanimated/Fabric/updates/UpdatesRegistryManager.h>
#include <reanimated/LayoutAnimations/LayoutAnimationsProxy.h>

#include <cxxreact/ReactNativeVersion.h>
#include <react/renderer/uimanager/UIManagerCommitHook.h>

#include <memory>
Expand Down Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include <reanimated/Fabric/ShadowTreeCloner.h>
#include <reanimated/Fabric/updates/UpdatesRegistryManager.h>

#include <cxxreact/ReactNativeVersion.h>
#include <react/renderer/uimanager/UIManagerMountHook.h>

#include <memory>
Expand All @@ -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:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
#include <reanimated/Fabric/updates/AnimatedPropsRegistry.h>

#include <cxxreact/ReactNativeVersion.h>

#include <utility>

namespace reanimated {

#if REACT_NATIVE_MINOR_VERSION >= 81
#if REACT_NATIVE_VERSION_MINOR >= 81
static inline std::shared_ptr<const ShadowNode> shadowNodeFromValue(
jsi::Runtime &rt,
const jsi::Value &shadowNodeWrapper) {
return Bridging<std::shared_ptr<const ShadowNode>>::fromJs(
rt, shadowNodeWrapper);
}
#endif
#endif // REACT_NATIVE_VERSION_MINOR >= 81

void AnimatedPropsRegistry::update(
jsi::Runtime &rt,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include <fbjni/fbjni.h>
#endif // __ANDROID__

#include <cxxreact/ReactNativeVersion.h>
#include <react/renderer/scheduler/Scheduler.h>
#include <react/renderer/uimanager/UIManagerBinding.h>

Expand All @@ -26,14 +27,14 @@

namespace reanimated {

#if REACT_NATIVE_MINOR_VERSION >= 81
#if REACT_NATIVE_VERSION_MINOR >= 81
static inline std::shared_ptr<const ShadowNode> shadowNodeFromValue(
jsi::Runtime &rt,
const jsi::Value &shadowNodeWrapper) {
return Bridging<std::shared_ptr<const ShadowNode>>::fromJs(
rt, shadowNodeWrapper);
}
#endif
#endif // REACT_NATIVE_VERSION_MINOR >= 81

ReanimatedModuleProxy::ReanimatedModuleProxy(
const std::shared_ptr<WorkletsModuleProxy> &workletsModuleProxy,
Expand Down
4 changes: 2 additions & 2 deletions packages/react-native-reanimated/RNReanimated.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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

Expand Down
6 changes: 1 addition & 5 deletions packages/react-native-reanimated/android/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 0 additions & 8 deletions packages/react-native-reanimated/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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)}",
Expand Down
5 changes: 0 additions & 5 deletions packages/react-native-reanimated/scripts/reanimated_utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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']
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we still need this part of the filer related to looking for the React Native location?

Copy link
Member Author

@tomekzaw tomekzaw Oct 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately yes, we still use config[:react_native_version] in validate-react-native-version.js.

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
Expand Down
6 changes: 1 addition & 5 deletions packages/react-native-worklets/android/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}")

Expand Down
3 changes: 0 additions & 3 deletions packages/react-native-worklets/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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}",
Expand Down
5 changes: 0 additions & 5 deletions packages/react-native-worklets/scripts/worklets_utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
Expand Down
Loading