From dd2b9f8f94e0463e438a38ee948ca5d23e04a121 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20=C5=BBelawski?= <40713406+tjzel@users.noreply.github.com> Date: Thu, 25 Jul 2024 12:01:49 +0200 Subject: [PATCH] refactor: Split cpp code base (#6329) ## Summary This pull requests defines boundaries in C++ layer between Worklet Runtimes logic and Animations logic. I've only moved files here, more elaborate refactors will come up in the future. ## Test plan - [x] Android builds & runs. - [x] iOS builds & runs. --- .../cpp/{ => Worklets}/Registries/EventHandlerRegistry.cpp | 0 .../cpp/{ => Worklets}/Registries/EventHandlerRegistry.h | 0 .../Registries}/WorkletRuntimeRegistry.cpp | 0 .../Registries}/WorkletRuntimeRegistry.h | 0 .../Common/cpp/{ => Worklets}/SharedItems/Shareables.cpp | 0 .../Common/cpp/{ => Worklets}/SharedItems/Shareables.h | 0 .../Common/cpp/{ => Worklets}/Tools/AsyncQueue.cpp | 0 .../Common/cpp/{ => Worklets}/Tools/AsyncQueue.h | 0 .../Common/cpp/{ => Worklets}/Tools/JSISerializer.cpp | 0 .../Common/cpp/{ => Worklets}/Tools/JSISerializer.h | 0 .../Common/cpp/{ => Worklets}/Tools/JSLogger.cpp | 0 .../Common/cpp/{ => Worklets}/Tools/JSLogger.h | 0 .../Common/cpp/{ => Worklets}/Tools/JSScheduler.cpp | 0 .../Common/cpp/{ => Worklets}/Tools/JSScheduler.h | 0 .../Common/cpp/{ => Worklets}/Tools/ReanimatedJSIUtils.cpp | 0 .../Common/cpp/{ => Worklets}/Tools/ReanimatedJSIUtils.h | 0 .../Common/cpp/{ => Worklets}/Tools/ReanimatedVersion.cpp | 0 .../Common/cpp/{ => Worklets}/Tools/ReanimatedVersion.h | 0 .../Common/cpp/{ => Worklets}/Tools/ThreadSafeQueue.h | 0 .../Common/cpp/{ => Worklets}/Tools/UIScheduler.cpp | 0 .../Common/cpp/{ => Worklets}/Tools/UIScheduler.h | 0 .../cpp/{ => Worklets}/Tools/WorkletEventHandler.cpp | 0 .../Common/cpp/{ => Worklets}/Tools/WorkletEventHandler.h | 0 .../WorkletRuntime}/RNRuntimeDecorator.cpp | 0 .../WorkletRuntime}/RNRuntimeDecorator.h | 0 .../WorkletRuntime}/ReanimatedHermesRuntime.cpp | 0 .../WorkletRuntime}/ReanimatedHermesRuntime.h | 0 .../WorkletRuntime}/ReanimatedRuntime.cpp | 0 .../WorkletRuntime}/ReanimatedRuntime.h | 0 .../WorkletRuntime}/RuntimeInitialization.md | 0 .../WorkletRuntime}/WorkletRuntime.cpp | 0 .../WorkletRuntime}/WorkletRuntime.h | 0 .../WorkletRuntime}/WorkletRuntimeCollector.h | 0 .../WorkletRuntime}/WorkletRuntimeDecorator.cpp | 0 .../WorkletRuntime}/WorkletRuntimeDecorator.h | 0 packages/react-native-reanimated/android/CMakeLists.txt | 7 ++++--- 36 files changed, 4 insertions(+), 3 deletions(-) rename packages/react-native-reanimated/Common/cpp/{ => Worklets}/Registries/EventHandlerRegistry.cpp (100%) rename packages/react-native-reanimated/Common/cpp/{ => Worklets}/Registries/EventHandlerRegistry.h (100%) rename packages/react-native-reanimated/Common/cpp/{ReanimatedRuntime => Worklets/Registries}/WorkletRuntimeRegistry.cpp (100%) rename packages/react-native-reanimated/Common/cpp/{ReanimatedRuntime => Worklets/Registries}/WorkletRuntimeRegistry.h (100%) rename packages/react-native-reanimated/Common/cpp/{ => Worklets}/SharedItems/Shareables.cpp (100%) rename packages/react-native-reanimated/Common/cpp/{ => Worklets}/SharedItems/Shareables.h (100%) rename packages/react-native-reanimated/Common/cpp/{ => Worklets}/Tools/AsyncQueue.cpp (100%) rename packages/react-native-reanimated/Common/cpp/{ => Worklets}/Tools/AsyncQueue.h (100%) rename packages/react-native-reanimated/Common/cpp/{ => Worklets}/Tools/JSISerializer.cpp (100%) rename packages/react-native-reanimated/Common/cpp/{ => Worklets}/Tools/JSISerializer.h (100%) rename packages/react-native-reanimated/Common/cpp/{ => Worklets}/Tools/JSLogger.cpp (100%) rename packages/react-native-reanimated/Common/cpp/{ => Worklets}/Tools/JSLogger.h (100%) rename packages/react-native-reanimated/Common/cpp/{ => Worklets}/Tools/JSScheduler.cpp (100%) rename packages/react-native-reanimated/Common/cpp/{ => Worklets}/Tools/JSScheduler.h (100%) rename packages/react-native-reanimated/Common/cpp/{ => Worklets}/Tools/ReanimatedJSIUtils.cpp (100%) rename packages/react-native-reanimated/Common/cpp/{ => Worklets}/Tools/ReanimatedJSIUtils.h (100%) rename packages/react-native-reanimated/Common/cpp/{ => Worklets}/Tools/ReanimatedVersion.cpp (100%) rename packages/react-native-reanimated/Common/cpp/{ => Worklets}/Tools/ReanimatedVersion.h (100%) rename packages/react-native-reanimated/Common/cpp/{ => Worklets}/Tools/ThreadSafeQueue.h (100%) rename packages/react-native-reanimated/Common/cpp/{ => Worklets}/Tools/UIScheduler.cpp (100%) rename packages/react-native-reanimated/Common/cpp/{ => Worklets}/Tools/UIScheduler.h (100%) rename packages/react-native-reanimated/Common/cpp/{ => Worklets}/Tools/WorkletEventHandler.cpp (100%) rename packages/react-native-reanimated/Common/cpp/{ => Worklets}/Tools/WorkletEventHandler.h (100%) rename packages/react-native-reanimated/Common/cpp/{ReanimatedRuntime => Worklets/WorkletRuntime}/RNRuntimeDecorator.cpp (100%) rename packages/react-native-reanimated/Common/cpp/{ReanimatedRuntime => Worklets/WorkletRuntime}/RNRuntimeDecorator.h (100%) rename packages/react-native-reanimated/Common/cpp/{ReanimatedRuntime => Worklets/WorkletRuntime}/ReanimatedHermesRuntime.cpp (100%) rename packages/react-native-reanimated/Common/cpp/{ReanimatedRuntime => Worklets/WorkletRuntime}/ReanimatedHermesRuntime.h (100%) rename packages/react-native-reanimated/Common/cpp/{ReanimatedRuntime => Worklets/WorkletRuntime}/ReanimatedRuntime.cpp (100%) rename packages/react-native-reanimated/Common/cpp/{ReanimatedRuntime => Worklets/WorkletRuntime}/ReanimatedRuntime.h (100%) rename packages/react-native-reanimated/Common/cpp/{ReanimatedRuntime => Worklets/WorkletRuntime}/RuntimeInitialization.md (100%) rename packages/react-native-reanimated/Common/cpp/{ReanimatedRuntime => Worklets/WorkletRuntime}/WorkletRuntime.cpp (100%) rename packages/react-native-reanimated/Common/cpp/{ReanimatedRuntime => Worklets/WorkletRuntime}/WorkletRuntime.h (100%) rename packages/react-native-reanimated/Common/cpp/{ReanimatedRuntime => Worklets/WorkletRuntime}/WorkletRuntimeCollector.h (100%) rename packages/react-native-reanimated/Common/cpp/{ReanimatedRuntime => Worklets/WorkletRuntime}/WorkletRuntimeDecorator.cpp (100%) rename packages/react-native-reanimated/Common/cpp/{ReanimatedRuntime => Worklets/WorkletRuntime}/WorkletRuntimeDecorator.h (100%) diff --git a/packages/react-native-reanimated/Common/cpp/Registries/EventHandlerRegistry.cpp b/packages/react-native-reanimated/Common/cpp/Worklets/Registries/EventHandlerRegistry.cpp similarity index 100% rename from packages/react-native-reanimated/Common/cpp/Registries/EventHandlerRegistry.cpp rename to packages/react-native-reanimated/Common/cpp/Worklets/Registries/EventHandlerRegistry.cpp diff --git a/packages/react-native-reanimated/Common/cpp/Registries/EventHandlerRegistry.h b/packages/react-native-reanimated/Common/cpp/Worklets/Registries/EventHandlerRegistry.h similarity index 100% rename from packages/react-native-reanimated/Common/cpp/Registries/EventHandlerRegistry.h rename to packages/react-native-reanimated/Common/cpp/Worklets/Registries/EventHandlerRegistry.h diff --git a/packages/react-native-reanimated/Common/cpp/ReanimatedRuntime/WorkletRuntimeRegistry.cpp b/packages/react-native-reanimated/Common/cpp/Worklets/Registries/WorkletRuntimeRegistry.cpp similarity index 100% rename from packages/react-native-reanimated/Common/cpp/ReanimatedRuntime/WorkletRuntimeRegistry.cpp rename to packages/react-native-reanimated/Common/cpp/Worklets/Registries/WorkletRuntimeRegistry.cpp diff --git a/packages/react-native-reanimated/Common/cpp/ReanimatedRuntime/WorkletRuntimeRegistry.h b/packages/react-native-reanimated/Common/cpp/Worklets/Registries/WorkletRuntimeRegistry.h similarity index 100% rename from packages/react-native-reanimated/Common/cpp/ReanimatedRuntime/WorkletRuntimeRegistry.h rename to packages/react-native-reanimated/Common/cpp/Worklets/Registries/WorkletRuntimeRegistry.h diff --git a/packages/react-native-reanimated/Common/cpp/SharedItems/Shareables.cpp b/packages/react-native-reanimated/Common/cpp/Worklets/SharedItems/Shareables.cpp similarity index 100% rename from packages/react-native-reanimated/Common/cpp/SharedItems/Shareables.cpp rename to packages/react-native-reanimated/Common/cpp/Worklets/SharedItems/Shareables.cpp diff --git a/packages/react-native-reanimated/Common/cpp/SharedItems/Shareables.h b/packages/react-native-reanimated/Common/cpp/Worklets/SharedItems/Shareables.h similarity index 100% rename from packages/react-native-reanimated/Common/cpp/SharedItems/Shareables.h rename to packages/react-native-reanimated/Common/cpp/Worklets/SharedItems/Shareables.h diff --git a/packages/react-native-reanimated/Common/cpp/Tools/AsyncQueue.cpp b/packages/react-native-reanimated/Common/cpp/Worklets/Tools/AsyncQueue.cpp similarity index 100% rename from packages/react-native-reanimated/Common/cpp/Tools/AsyncQueue.cpp rename to packages/react-native-reanimated/Common/cpp/Worklets/Tools/AsyncQueue.cpp diff --git a/packages/react-native-reanimated/Common/cpp/Tools/AsyncQueue.h b/packages/react-native-reanimated/Common/cpp/Worklets/Tools/AsyncQueue.h similarity index 100% rename from packages/react-native-reanimated/Common/cpp/Tools/AsyncQueue.h rename to packages/react-native-reanimated/Common/cpp/Worklets/Tools/AsyncQueue.h diff --git a/packages/react-native-reanimated/Common/cpp/Tools/JSISerializer.cpp b/packages/react-native-reanimated/Common/cpp/Worklets/Tools/JSISerializer.cpp similarity index 100% rename from packages/react-native-reanimated/Common/cpp/Tools/JSISerializer.cpp rename to packages/react-native-reanimated/Common/cpp/Worklets/Tools/JSISerializer.cpp diff --git a/packages/react-native-reanimated/Common/cpp/Tools/JSISerializer.h b/packages/react-native-reanimated/Common/cpp/Worklets/Tools/JSISerializer.h similarity index 100% rename from packages/react-native-reanimated/Common/cpp/Tools/JSISerializer.h rename to packages/react-native-reanimated/Common/cpp/Worklets/Tools/JSISerializer.h diff --git a/packages/react-native-reanimated/Common/cpp/Tools/JSLogger.cpp b/packages/react-native-reanimated/Common/cpp/Worklets/Tools/JSLogger.cpp similarity index 100% rename from packages/react-native-reanimated/Common/cpp/Tools/JSLogger.cpp rename to packages/react-native-reanimated/Common/cpp/Worklets/Tools/JSLogger.cpp diff --git a/packages/react-native-reanimated/Common/cpp/Tools/JSLogger.h b/packages/react-native-reanimated/Common/cpp/Worklets/Tools/JSLogger.h similarity index 100% rename from packages/react-native-reanimated/Common/cpp/Tools/JSLogger.h rename to packages/react-native-reanimated/Common/cpp/Worklets/Tools/JSLogger.h diff --git a/packages/react-native-reanimated/Common/cpp/Tools/JSScheduler.cpp b/packages/react-native-reanimated/Common/cpp/Worklets/Tools/JSScheduler.cpp similarity index 100% rename from packages/react-native-reanimated/Common/cpp/Tools/JSScheduler.cpp rename to packages/react-native-reanimated/Common/cpp/Worklets/Tools/JSScheduler.cpp diff --git a/packages/react-native-reanimated/Common/cpp/Tools/JSScheduler.h b/packages/react-native-reanimated/Common/cpp/Worklets/Tools/JSScheduler.h similarity index 100% rename from packages/react-native-reanimated/Common/cpp/Tools/JSScheduler.h rename to packages/react-native-reanimated/Common/cpp/Worklets/Tools/JSScheduler.h diff --git a/packages/react-native-reanimated/Common/cpp/Tools/ReanimatedJSIUtils.cpp b/packages/react-native-reanimated/Common/cpp/Worklets/Tools/ReanimatedJSIUtils.cpp similarity index 100% rename from packages/react-native-reanimated/Common/cpp/Tools/ReanimatedJSIUtils.cpp rename to packages/react-native-reanimated/Common/cpp/Worklets/Tools/ReanimatedJSIUtils.cpp diff --git a/packages/react-native-reanimated/Common/cpp/Tools/ReanimatedJSIUtils.h b/packages/react-native-reanimated/Common/cpp/Worklets/Tools/ReanimatedJSIUtils.h similarity index 100% rename from packages/react-native-reanimated/Common/cpp/Tools/ReanimatedJSIUtils.h rename to packages/react-native-reanimated/Common/cpp/Worklets/Tools/ReanimatedJSIUtils.h diff --git a/packages/react-native-reanimated/Common/cpp/Tools/ReanimatedVersion.cpp b/packages/react-native-reanimated/Common/cpp/Worklets/Tools/ReanimatedVersion.cpp similarity index 100% rename from packages/react-native-reanimated/Common/cpp/Tools/ReanimatedVersion.cpp rename to packages/react-native-reanimated/Common/cpp/Worklets/Tools/ReanimatedVersion.cpp diff --git a/packages/react-native-reanimated/Common/cpp/Tools/ReanimatedVersion.h b/packages/react-native-reanimated/Common/cpp/Worklets/Tools/ReanimatedVersion.h similarity index 100% rename from packages/react-native-reanimated/Common/cpp/Tools/ReanimatedVersion.h rename to packages/react-native-reanimated/Common/cpp/Worklets/Tools/ReanimatedVersion.h diff --git a/packages/react-native-reanimated/Common/cpp/Tools/ThreadSafeQueue.h b/packages/react-native-reanimated/Common/cpp/Worklets/Tools/ThreadSafeQueue.h similarity index 100% rename from packages/react-native-reanimated/Common/cpp/Tools/ThreadSafeQueue.h rename to packages/react-native-reanimated/Common/cpp/Worklets/Tools/ThreadSafeQueue.h diff --git a/packages/react-native-reanimated/Common/cpp/Tools/UIScheduler.cpp b/packages/react-native-reanimated/Common/cpp/Worklets/Tools/UIScheduler.cpp similarity index 100% rename from packages/react-native-reanimated/Common/cpp/Tools/UIScheduler.cpp rename to packages/react-native-reanimated/Common/cpp/Worklets/Tools/UIScheduler.cpp diff --git a/packages/react-native-reanimated/Common/cpp/Tools/UIScheduler.h b/packages/react-native-reanimated/Common/cpp/Worklets/Tools/UIScheduler.h similarity index 100% rename from packages/react-native-reanimated/Common/cpp/Tools/UIScheduler.h rename to packages/react-native-reanimated/Common/cpp/Worklets/Tools/UIScheduler.h diff --git a/packages/react-native-reanimated/Common/cpp/Tools/WorkletEventHandler.cpp b/packages/react-native-reanimated/Common/cpp/Worklets/Tools/WorkletEventHandler.cpp similarity index 100% rename from packages/react-native-reanimated/Common/cpp/Tools/WorkletEventHandler.cpp rename to packages/react-native-reanimated/Common/cpp/Worklets/Tools/WorkletEventHandler.cpp diff --git a/packages/react-native-reanimated/Common/cpp/Tools/WorkletEventHandler.h b/packages/react-native-reanimated/Common/cpp/Worklets/Tools/WorkletEventHandler.h similarity index 100% rename from packages/react-native-reanimated/Common/cpp/Tools/WorkletEventHandler.h rename to packages/react-native-reanimated/Common/cpp/Worklets/Tools/WorkletEventHandler.h diff --git a/packages/react-native-reanimated/Common/cpp/ReanimatedRuntime/RNRuntimeDecorator.cpp b/packages/react-native-reanimated/Common/cpp/Worklets/WorkletRuntime/RNRuntimeDecorator.cpp similarity index 100% rename from packages/react-native-reanimated/Common/cpp/ReanimatedRuntime/RNRuntimeDecorator.cpp rename to packages/react-native-reanimated/Common/cpp/Worklets/WorkletRuntime/RNRuntimeDecorator.cpp diff --git a/packages/react-native-reanimated/Common/cpp/ReanimatedRuntime/RNRuntimeDecorator.h b/packages/react-native-reanimated/Common/cpp/Worklets/WorkletRuntime/RNRuntimeDecorator.h similarity index 100% rename from packages/react-native-reanimated/Common/cpp/ReanimatedRuntime/RNRuntimeDecorator.h rename to packages/react-native-reanimated/Common/cpp/Worklets/WorkletRuntime/RNRuntimeDecorator.h diff --git a/packages/react-native-reanimated/Common/cpp/ReanimatedRuntime/ReanimatedHermesRuntime.cpp b/packages/react-native-reanimated/Common/cpp/Worklets/WorkletRuntime/ReanimatedHermesRuntime.cpp similarity index 100% rename from packages/react-native-reanimated/Common/cpp/ReanimatedRuntime/ReanimatedHermesRuntime.cpp rename to packages/react-native-reanimated/Common/cpp/Worklets/WorkletRuntime/ReanimatedHermesRuntime.cpp diff --git a/packages/react-native-reanimated/Common/cpp/ReanimatedRuntime/ReanimatedHermesRuntime.h b/packages/react-native-reanimated/Common/cpp/Worklets/WorkletRuntime/ReanimatedHermesRuntime.h similarity index 100% rename from packages/react-native-reanimated/Common/cpp/ReanimatedRuntime/ReanimatedHermesRuntime.h rename to packages/react-native-reanimated/Common/cpp/Worklets/WorkletRuntime/ReanimatedHermesRuntime.h diff --git a/packages/react-native-reanimated/Common/cpp/ReanimatedRuntime/ReanimatedRuntime.cpp b/packages/react-native-reanimated/Common/cpp/Worklets/WorkletRuntime/ReanimatedRuntime.cpp similarity index 100% rename from packages/react-native-reanimated/Common/cpp/ReanimatedRuntime/ReanimatedRuntime.cpp rename to packages/react-native-reanimated/Common/cpp/Worklets/WorkletRuntime/ReanimatedRuntime.cpp diff --git a/packages/react-native-reanimated/Common/cpp/ReanimatedRuntime/ReanimatedRuntime.h b/packages/react-native-reanimated/Common/cpp/Worklets/WorkletRuntime/ReanimatedRuntime.h similarity index 100% rename from packages/react-native-reanimated/Common/cpp/ReanimatedRuntime/ReanimatedRuntime.h rename to packages/react-native-reanimated/Common/cpp/Worklets/WorkletRuntime/ReanimatedRuntime.h diff --git a/packages/react-native-reanimated/Common/cpp/ReanimatedRuntime/RuntimeInitialization.md b/packages/react-native-reanimated/Common/cpp/Worklets/WorkletRuntime/RuntimeInitialization.md similarity index 100% rename from packages/react-native-reanimated/Common/cpp/ReanimatedRuntime/RuntimeInitialization.md rename to packages/react-native-reanimated/Common/cpp/Worklets/WorkletRuntime/RuntimeInitialization.md diff --git a/packages/react-native-reanimated/Common/cpp/ReanimatedRuntime/WorkletRuntime.cpp b/packages/react-native-reanimated/Common/cpp/Worklets/WorkletRuntime/WorkletRuntime.cpp similarity index 100% rename from packages/react-native-reanimated/Common/cpp/ReanimatedRuntime/WorkletRuntime.cpp rename to packages/react-native-reanimated/Common/cpp/Worklets/WorkletRuntime/WorkletRuntime.cpp diff --git a/packages/react-native-reanimated/Common/cpp/ReanimatedRuntime/WorkletRuntime.h b/packages/react-native-reanimated/Common/cpp/Worklets/WorkletRuntime/WorkletRuntime.h similarity index 100% rename from packages/react-native-reanimated/Common/cpp/ReanimatedRuntime/WorkletRuntime.h rename to packages/react-native-reanimated/Common/cpp/Worklets/WorkletRuntime/WorkletRuntime.h diff --git a/packages/react-native-reanimated/Common/cpp/ReanimatedRuntime/WorkletRuntimeCollector.h b/packages/react-native-reanimated/Common/cpp/Worklets/WorkletRuntime/WorkletRuntimeCollector.h similarity index 100% rename from packages/react-native-reanimated/Common/cpp/ReanimatedRuntime/WorkletRuntimeCollector.h rename to packages/react-native-reanimated/Common/cpp/Worklets/WorkletRuntime/WorkletRuntimeCollector.h diff --git a/packages/react-native-reanimated/Common/cpp/ReanimatedRuntime/WorkletRuntimeDecorator.cpp b/packages/react-native-reanimated/Common/cpp/Worklets/WorkletRuntime/WorkletRuntimeDecorator.cpp similarity index 100% rename from packages/react-native-reanimated/Common/cpp/ReanimatedRuntime/WorkletRuntimeDecorator.cpp rename to packages/react-native-reanimated/Common/cpp/Worklets/WorkletRuntime/WorkletRuntimeDecorator.cpp diff --git a/packages/react-native-reanimated/Common/cpp/ReanimatedRuntime/WorkletRuntimeDecorator.h b/packages/react-native-reanimated/Common/cpp/Worklets/WorkletRuntime/WorkletRuntimeDecorator.h similarity index 100% rename from packages/react-native-reanimated/Common/cpp/ReanimatedRuntime/WorkletRuntimeDecorator.h rename to packages/react-native-reanimated/Common/cpp/Worklets/WorkletRuntime/WorkletRuntimeDecorator.h diff --git a/packages/react-native-reanimated/android/CMakeLists.txt b/packages/react-native-reanimated/android/CMakeLists.txt index 5f0e27b7661..74185c74ed1 100644 --- a/packages/react-native-reanimated/android/CMakeLists.txt +++ b/packages/react-native-reanimated/android/CMakeLists.txt @@ -66,10 +66,11 @@ target_include_directories( "${COMMON_SRC_DIR}/cpp/hidden_headers" "${COMMON_SRC_DIR}/cpp/LayoutAnimations" "${COMMON_SRC_DIR}/cpp/NativeModules" - "${COMMON_SRC_DIR}/cpp/ReanimatedRuntime" - "${COMMON_SRC_DIR}/cpp/Registries" - "${COMMON_SRC_DIR}/cpp/SharedItems" "${COMMON_SRC_DIR}/cpp/Tools" + "${COMMON_SRC_DIR}/cpp/Worklets/Registries" + "${COMMON_SRC_DIR}/cpp/Worklets/SharedItems" + "${COMMON_SRC_DIR}/cpp/Worklets/Tools" + "${COMMON_SRC_DIR}/cpp/Worklets/WorkletRuntime" "${SRC_DIR}/main/cpp" )