From 6add48e9110baf6de6d737760663d9aa5d0482b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20=C5=BBelawski?= Date: Fri, 21 Nov 2025 15:26:35 +0100 Subject: [PATCH 01/12] feat(Worklets): public RNWorklets headers --- apps/fabric-example/ios/Podfile.lock | 62 ++++++++++++++++++- apps/macos-example/macos/Podfile.lock | 52 +++++++++++++++- apps/tvos-example/ios/Podfile.lock | 60 +++++++++++++++++- .../docs/threading/scheduleOnRuntime.mdx | 2 +- .../AnimatedSensor/AnimatedSensorModule.h | 4 +- .../LayoutAnimationsManager.h | 2 +- .../NativeModules/ReanimatedModuleProxy.cpp | 2 +- .../android/CMakeLists.txt | 3 +- .../worklets/{Public => RunLoop}/AsyncQueue.h | 5 +- .../cpp/worklets/RunLoop/AsyncQueueImpl.h | 2 +- .../Common/cpp/worklets/RunLoop/EventLoop.h | 2 +- .../cpp/worklets/SharedItems/Serializable.h | 5 +- .../cpp/worklets/SharedItems/Synchronizable.h | 5 +- .../worklets/WorkletRuntime/WorkletRuntime.h | 7 ++- .../react-native-worklets/RNWorklets.podspec | 16 ++++- .../android/build.gradle | 16 +++++ .../src/runtimes.native.ts | 2 +- packages/react-native-worklets/src/types.ts | 4 +- 18 files changed, 229 insertions(+), 22 deletions(-) rename packages/react-native-worklets/Common/cpp/worklets/{Public => RunLoop}/AsyncQueue.h (69%) diff --git a/apps/fabric-example/ios/Podfile.lock b/apps/fabric-example/ios/Podfile.lock index 6d0908d25d58..837c94061750 100644 --- a/apps/fabric-example/ios/Podfile.lock +++ b/apps/fabric-example/ios/Podfile.lock @@ -2875,6 +2875,8 @@ PODS: - ReactCommon/turbomodule/bridging - ReactCommon/turbomodule/core - RNWorklets/worklets/apple (= 0.7.0-main) + - RNWorklets/worklets/common (= 0.7.0-main) + - RNWorklets/worklets/public (= 0.7.0-main) - SocketRocket - Yoga - RNWorklets/worklets/apple (0.7.0-main): @@ -2906,6 +2908,64 @@ PODS: - ReactCommon/turbomodule/core - SocketRocket - Yoga + - RNWorklets/worklets/common (0.7.0-main): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-hermes + - React-ImageManager + - React-jsi + - React-NativeModulesApple + - React-RCTFabric + - React-renderercss + - React-rendererdebug + - React-utils + - ReactCodegen + - ReactCommon/turbomodule/bridging + - ReactCommon/turbomodule/core + - SocketRocket + - Yoga + - RNWorklets/worklets/public (0.7.0-main): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-hermes + - React-ImageManager + - React-jsi + - React-NativeModulesApple + - React-RCTFabric + - React-renderercss + - React-rendererdebug + - React-utils + - ReactCodegen + - ReactCommon/turbomodule/bridging + - ReactCommon/turbomodule/core + - SocketRocket + - Yoga - SocketRocket (0.7.1) - Yoga (0.0.0) @@ -3261,7 +3321,7 @@ SPEC CHECKSUMS: RNReanimated: 97ebf4d3c76929b6b0f866cfbd41c49b3a0d2dbf RNScreens: 0bbf16c074ae6bb1058a7bf2d1ae017f4306797c RNSVG: 8c0bbfa480a24b24468f1c76bd852a4aac3178e6 - RNWorklets: f54a415f73a3fc653bfe65e599872fdc6bca0477 + RNWorklets: b2ad4ec784199346ed45f0d2eec051401d383c2d SocketRocket: d4aabe649be1e368d1318fdf28a022d714d65748 Yoga: edeb9900b9e5bb5b27b9a6a2d5914e4fe4033c1b diff --git a/apps/macos-example/macos/Podfile.lock b/apps/macos-example/macos/Podfile.lock index fe67bd1fef42..85a8ecc6bde4 100644 --- a/apps/macos-example/macos/Podfile.lock +++ b/apps/macos-example/macos/Podfile.lock @@ -1977,6 +1977,8 @@ PODS: - ReactCommon/turbomodule/bridging - ReactCommon/turbomodule/core - RNWorklets/worklets/apple (= 0.7.0-main) + - RNWorklets/worklets/common (= 0.7.0-main) + - RNWorklets/worklets/public (= 0.7.0-main) - Yoga - RNWorklets/worklets/apple (0.7.0-main): - DoubleConversion @@ -2002,6 +2004,54 @@ PODS: - ReactCommon/turbomodule/bridging - ReactCommon/turbomodule/core - Yoga + - RNWorklets/worklets/common (0.7.0-main): + - DoubleConversion + - glog + - hermes-engine + - RCT-Folly (= 2024.11.18.00) + - RCTRequired + - RCTTypeSafety + - React-Core + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-hermes + - React-ImageManager + - React-jsi + - React-NativeModulesApple + - React-RCTFabric + - React-renderercss + - React-rendererdebug + - React-utils + - ReactCodegen + - ReactCommon/turbomodule/bridging + - ReactCommon/turbomodule/core + - Yoga + - RNWorklets/worklets/public (0.7.0-main): + - DoubleConversion + - glog + - hermes-engine + - RCT-Folly (= 2024.11.18.00) + - RCTRequired + - RCTTypeSafety + - React-Core + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-hermes + - React-ImageManager + - React-jsi + - React-NativeModulesApple + - React-RCTFabric + - React-renderercss + - React-rendererdebug + - React-utils + - ReactCodegen + - ReactCommon/turbomodule/bridging + - ReactCommon/turbomodule/core + - Yoga - SocketRocket (0.7.1) - Yoga (0.0.0) @@ -2322,7 +2372,7 @@ SPEC CHECKSUMS: RNGestureHandler: 0397fea67f39d5a2d17fcf4a028e206f7ba098ba RNReanimated: 152207cf096f2badeef2c552a8f2886accd187e6 RNSVG: 681f8ef5ca50e13cb3c6c88a907ea89b68fee74f - RNWorklets: ee84c4d458ce35f4ed94462a2add070ff4e69edb + RNWorklets: 7cdcdb8dd199bc5d1cd99e42940c47e4442a2670 SocketRocket: 03f7111df1a343b162bf5b06ead333be808e1e0a Yoga: 45ce05cb11db042ba2e5e51a2dfaf0ff63d269f9 diff --git a/apps/tvos-example/ios/Podfile.lock b/apps/tvos-example/ios/Podfile.lock index 4bf4190b204b..7594d92ede21 100644 --- a/apps/tvos-example/ios/Podfile.lock +++ b/apps/tvos-example/ios/Podfile.lock @@ -2397,6 +2397,8 @@ PODS: - ReactCommon/turbomodule/bridging - ReactCommon/turbomodule/core - RNWorklets/worklets/apple (= 0.7.0-main) + - RNWorklets/worklets/common (= 0.7.0-main) + - RNWorklets/worklets/public (= 0.7.0-main) - SocketRocket - Yoga - RNWorklets/worklets/apple (0.7.0-main): @@ -2427,6 +2429,62 @@ PODS: - ReactCommon/turbomodule/core - SocketRocket - Yoga + - RNWorklets/worklets/common (0.7.0-main): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-ImageManager + - React-jsi + - React-NativeModulesApple + - React-RCTFabric + - React-renderercss + - React-rendererdebug + - React-utils + - ReactCodegen + - ReactCommon/turbomodule/bridging + - ReactCommon/turbomodule/core + - SocketRocket + - Yoga + - RNWorklets/worklets/public (0.7.0-main): + - boost + - DoubleConversion + - fast_float + - fmt + - glog + - hermes-engine + - RCT-Folly + - RCT-Folly/Fabric + - RCTRequired + - RCTTypeSafety + - React-Core + - React-debug + - React-Fabric + - React-featureflags + - React-graphics + - React-ImageManager + - React-jsi + - React-NativeModulesApple + - React-RCTFabric + - React-renderercss + - React-rendererdebug + - React-utils + - ReactCodegen + - ReactCommon/turbomodule/bridging + - ReactCommon/turbomodule/core + - SocketRocket + - Yoga - SocketRocket (0.7.1) - Yoga (0.0.0) @@ -2732,7 +2790,7 @@ SPEC CHECKSUMS: ReactCodegen: f4d6e6fd5140eade461ffb5579795197956868c8 ReactCommon: c178596d3ef05508bb6c0f88bfbbc281b5c4222b RNReanimated: cccf8b45cb675080e7c5f3a4f5d0498eff6c62a0 - RNWorklets: 339aa12272b2ff6490d91526e8ced6599f7ef6a3 + RNWorklets: 6aa271764dc8121f468b10c866239ca4c644208b SocketRocket: d4aabe649be1e368d1318fdf28a022d714d65748 Yoga: 0e792f39294e864568930600eeb71135364f777d diff --git a/docs/docs-worklets/docs/threading/scheduleOnRuntime.mdx b/docs/docs-worklets/docs/threading/scheduleOnRuntime.mdx index 9d3b52085ebe..7aada0f8eb83 100644 --- a/docs/docs-worklets/docs/threading/scheduleOnRuntime.mdx +++ b/docs/docs-worklets/docs/threading/scheduleOnRuntime.mdx @@ -48,7 +48,7 @@ Arguments to the function you want to execute on the [Worker Runtime](/docs/fund ## Remarks - The worklet is scheduled on the Worker Runtime's [Async - Queue](https://github.com/software-mansion/react-native-reanimated/blob/main/packages/react-native-worklets/Common/cpp/worklets/Public/AsyncQueue.h) + Queue](https://github.com/software-mansion/react-native-reanimated/blob/main/packages/react-native-worklets/Common/cpp/worklets/RunLoop/AsyncQueue.h) - The worklet cannot be scheduled on the Worker Runtime from [UI Runtime](/docs/fundamentals/glossary#ui-runtime) or another [Worker Runtime](/docs/fundamentals/glossary#worker-runtime), unless the [Bundle Mode](/docs/experimental/bundleMode) is enabled. diff --git a/packages/react-native-reanimated/Common/cpp/reanimated/AnimatedSensor/AnimatedSensorModule.h b/packages/react-native-reanimated/Common/cpp/reanimated/AnimatedSensor/AnimatedSensorModule.h index 2964ac3a16f9..521bbf325b53 100644 --- a/packages/react-native-reanimated/Common/cpp/reanimated/AnimatedSensor/AnimatedSensorModule.h +++ b/packages/react-native-reanimated/Common/cpp/reanimated/AnimatedSensor/AnimatedSensorModule.h @@ -2,8 +2,8 @@ #include -#include -#include +#include +#include #include diff --git a/packages/react-native-reanimated/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsManager.h b/packages/react-native-reanimated/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsManager.h index 16de0b56a16b..c5b5c3065fcf 100644 --- a/packages/react-native-reanimated/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsManager.h +++ b/packages/react-native-reanimated/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsManager.h @@ -2,7 +2,7 @@ #include -#include +#include #include #include 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 454eeb1a4cc0..a3d3271e68aa 100644 --- a/packages/react-native-reanimated/Common/cpp/reanimated/NativeModules/ReanimatedModuleProxy.cpp +++ b/packages/react-native-reanimated/Common/cpp/reanimated/NativeModules/ReanimatedModuleProxy.cpp @@ -5,8 +5,8 @@ #include #include +#include #include -#include #include #ifdef __ANDROID__ diff --git a/packages/react-native-reanimated/android/CMakeLists.txt b/packages/react-native-reanimated/android/CMakeLists.txt index d4731e6c9e5b..9f3220d6315e 100644 --- a/packages/react-native-reanimated/android/CMakeLists.txt +++ b/packages/react-native-reanimated/android/CMakeLists.txt @@ -70,7 +70,8 @@ target_include_directories( "${REACT_NATIVE_DIR}/ReactCommon/jsiexecutor" "${REACT_NATIVE_DIR}/ReactCommon/react/renderer/graphics/platform/cxx" "${REACT_NATIVE_WORKLETS_DIR}/Common/cpp" - "${REACT_NATIVE_WORKLETS_DIR}/android/src/main/cpp") + "${REACT_NATIVE_WORKLETS_DIR}/android/src/main/cpp" + "${REACT_NATIVE_WORKLETS_DIR}/android/build/prefab-headers") set_target_properties(reanimated PROPERTIES LINKER_LANGUAGE CXX) diff --git a/packages/react-native-worklets/Common/cpp/worklets/Public/AsyncQueue.h b/packages/react-native-worklets/Common/cpp/worklets/RunLoop/AsyncQueue.h similarity index 69% rename from packages/react-native-worklets/Common/cpp/worklets/Public/AsyncQueue.h rename to packages/react-native-worklets/Common/cpp/worklets/RunLoop/AsyncQueue.h index 0ec5146437ad..9ddee394f642 100644 --- a/packages/react-native-worklets/Common/cpp/worklets/Public/AsyncQueue.h +++ b/packages/react-native-worklets/Common/cpp/worklets/RunLoop/AsyncQueue.h @@ -1,4 +1,5 @@ -#pragma once +#ifndef RNWORKLETS_ASYNCQUEUE_H +#define RNWORKLETS_ASYNCQUEUE_H #include @@ -12,3 +13,5 @@ class AsyncQueue : public facebook::jsi::NativeState { }; } // namespace worklets + +#endif // RNWORKLETS_ASYNCQUEUE_H diff --git a/packages/react-native-worklets/Common/cpp/worklets/RunLoop/AsyncQueueImpl.h b/packages/react-native-worklets/Common/cpp/worklets/RunLoop/AsyncQueueImpl.h index 30cd0d7a0292..72592049201b 100644 --- a/packages/react-native-worklets/Common/cpp/worklets/RunLoop/AsyncQueueImpl.h +++ b/packages/react-native-worklets/Common/cpp/worklets/RunLoop/AsyncQueueImpl.h @@ -1,7 +1,7 @@ #pragma once #include -#include +#include #include #include diff --git a/packages/react-native-worklets/Common/cpp/worklets/RunLoop/EventLoop.h b/packages/react-native-worklets/Common/cpp/worklets/RunLoop/EventLoop.h index ac3eed1816d1..885bbbe2a8c1 100644 --- a/packages/react-native-worklets/Common/cpp/worklets/RunLoop/EventLoop.h +++ b/packages/react-native-worklets/Common/cpp/worklets/RunLoop/EventLoop.h @@ -1,7 +1,7 @@ #pragma once #include -#include +#include #include #include diff --git a/packages/react-native-worklets/Common/cpp/worklets/SharedItems/Serializable.h b/packages/react-native-worklets/Common/cpp/worklets/SharedItems/Serializable.h index 771b6be96cd9..90b693ae79da 100644 --- a/packages/react-native-worklets/Common/cpp/worklets/SharedItems/Serializable.h +++ b/packages/react-native-worklets/Common/cpp/worklets/SharedItems/Serializable.h @@ -1,4 +1,5 @@ -#pragma once +#ifndef RNWORKLETS_SERIALIZABLE_H +#define RNWORKLETS_SERIALIZABLE_H #include @@ -429,3 +430,5 @@ struct SerializationData { }; } // namespace worklets + +#endif // RNWORKLETS_SERIALIZABLE_H diff --git a/packages/react-native-worklets/Common/cpp/worklets/SharedItems/Synchronizable.h b/packages/react-native-worklets/Common/cpp/worklets/SharedItems/Synchronizable.h index 55e3a56eafb2..b126e0bbb1aa 100644 --- a/packages/react-native-worklets/Common/cpp/worklets/SharedItems/Synchronizable.h +++ b/packages/react-native-worklets/Common/cpp/worklets/SharedItems/Synchronizable.h @@ -1,4 +1,5 @@ -#pragma once +#ifndef RNWORKLETS_SYNCHRONIZABLE_H +#define RNWORKLETS_SYNCHRONIZABLE_H #include #include @@ -55,3 +56,5 @@ jsi::Function getSynchronizableUnpacker(jsi::Runtime &rt); std::shared_ptr extractSynchronizableOrThrow(jsi::Runtime &rt, const jsi::Value &value); }; // namespace worklets + +#endif // RNWORKLETS_SYNCHRONIZABLE_H diff --git a/packages/react-native-worklets/Common/cpp/worklets/WorkletRuntime/WorkletRuntime.h b/packages/react-native-worklets/Common/cpp/worklets/WorkletRuntime/WorkletRuntime.h index 919f0de2e95d..ce5845665c71 100644 --- a/packages/react-native-worklets/Common/cpp/worklets/WorkletRuntime/WorkletRuntime.h +++ b/packages/react-native-worklets/Common/cpp/worklets/WorkletRuntime/WorkletRuntime.h @@ -1,11 +1,12 @@ -#pragma once +#ifndef RNWORKLETS_WORKLETRUNTIME_H +#define RNWORKLETS_WORKLETRUNTIME_H #include #include #include #include -#include +#include #include #include #include @@ -215,3 +216,5 @@ inline jsi::Value runOnRuntimeGuarded(jsi::Runtime &rt, const jsi::Value &functi } } // namespace worklets + +#endif // RNWORKLETS_WORKLETRUNTIME_H diff --git a/packages/react-native-worklets/RNWorklets.podspec b/packages/react-native-worklets/RNWorklets.podspec index fa66aa9ef6f6..44c3e766dd4d 100644 --- a/packages/react-native-worklets/RNWorklets.podspec +++ b/packages/react-native-worklets/RNWorklets.podspec @@ -24,9 +24,11 @@ Pod::Spec.new do |s| s.source = { :git => "https://github.com/software-mansion/react-native-reanimated.git", :tag => "#{s.version}" } s.subspec "worklets" do |ss| - ss.source_files = "Common/cpp/worklets/**/*.{cpp,h}" - ss.header_dir = "worklets" - ss.header_mappings_dir = "Common/cpp/worklets" + ss.subspec "common" do |sss| + sss.source_files = "Common/cpp/worklets/**/*.{h,cpp}" + sss.header_dir = "worklets" + sss.header_mappings_dir = "Common/cpp/worklets" + end ss.subspec "apple" do |sss| # Please be careful with the snakes. @@ -36,6 +38,14 @@ Pod::Spec.new do |s| sss.header_dir = "worklets" sss.header_mappings_dir = "apple/worklets" end + + ss.subspec "public" do |sss| + sss.source_files = + "Common/cpp/worklets/RunLoop/AsyncQueue.h", + "Common/cpp/worklets/WorkletRuntime/WorkletRuntime.h", + "Common/cpp/worklets/SharedItems/Serializable.h", + "Common/cpp/worklets/SharedItems/Synchronizable.h" + end end # Use install_modules_dependencies helper to install the dependencies. diff --git a/packages/react-native-worklets/android/build.gradle b/packages/react-native-worklets/android/build.gradle index 2e5ad454afb1..087c2c7c7d90 100644 --- a/packages/react-native-worklets/android/build.gradle +++ b/packages/react-native-worklets/android/build.gradle @@ -108,6 +108,7 @@ def HERMES_V1_ENABLED = safeAppExtGet("hermesV1Enabled", false) version WORKLETS_VERSION def workletsPrefabHeadersDir = project.file("$buildDir/prefab-headers/worklets") +def RNWorkletsPrefabHeadersDir = project.file("${buildDir}/prefab-headers/RNWorklets") def JS_RUNTIME = { // Override JS runtime with environment variable @@ -172,6 +173,7 @@ android { prefab { worklets { headers workletsPrefabHeadersDir.absolutePath + headers RNWorkletsPrefabHeadersDir.absolutePath } } @@ -315,6 +317,20 @@ task prepareWorkletsHeadersForPrefabs(type: Copy) { from("$projectDir/../Common/cpp") include("worklets/**/*.h") into(workletsPrefabHeadersDir) + + // Pack public headers to RNWorklets headers dir + from("$projectDir/../Common/cpp/worklets/RunLoop/") { + include("AsyncQueue.h") + } + from("$projectDir/../Common/cpp/worklets/WorkletRuntime/") { + include("WorkletRuntime.h") + } + from("$projectDir/../Common/cpp/worklets/SharedItems/") { + include("Serializable.h") + include("Synchronizable.h") + } + into(RNWorkletsPrefabHeadersDir) + } task cleanCmakeCache() { diff --git a/packages/react-native-worklets/src/runtimes.native.ts b/packages/react-native-worklets/src/runtimes.native.ts index 5cd234e89b90..c1cd1dd8c83b 100644 --- a/packages/react-native-worklets/src/runtimes.native.ts +++ b/packages/react-native-worklets/src/runtimes.native.ts @@ -115,7 +115,7 @@ export function createWorkletRuntime( * for more information about the different runtime kinds. * * - The worklet is scheduled on the Worker Runtime's [Async - * Queue](https://github.com/software-mansion/react-native-reanimated/blob/main/packages/react-native-worklets/Common/cpp/worklets/Public/AsyncQueue.h) + * Queue](https://github.com/software-mansion/react-native-reanimated/blob/main/packages/react-native-worklets/Common/cpp/worklets/RunLoop/AsyncQueue.h) * - The function cannot be scheduled on the Worker Runtime from [UI * Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/glossary#ui-runtime) * or another [Worker diff --git a/packages/react-native-worklets/src/types.ts b/packages/react-native-worklets/src/types.ts index 916e175a4a1f..892e47eb10f9 100644 --- a/packages/react-native-worklets/src/types.ts +++ b/packages/react-native-worklets/src/types.ts @@ -130,7 +130,7 @@ export type WorkletRuntimeConfig = { * An optional custom queue to be used for scheduling worklets. * * The queue has to implement the C++ `AsyncQueue` interface from - * ``. + * ``. */ customQueue?: never; } @@ -144,7 +144,7 @@ export type WorkletRuntimeConfig = { * An optional custom queue to be used for scheduling worklets. * * The queue has to implement the C++ `AsyncQueue` interface from - * ``. + * ``. */ customQueue?: object; } From db3b34b84390718bdc1a08fb2aac1527bb0533a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20=C5=BBelawski?= Date: Mon, 24 Nov 2025 20:18:57 +0100 Subject: [PATCH 02/12] chore: wip --- ...-gradle-plugin-npm-0.82.0-10aedc0588.patch | 15 +++ apps/fabric-example/android/gradle.properties | 7 +- package.json | 3 + .../android/CMakeLists.txt | 17 +-- .../android/build.gradle | 15 ++- .../android/fix-prefab.gradle | 51 ++++++++ .../Common/cpp/worklets/RunLoop/AsyncQueue.h | 5 +- .../cpp/worklets/SharedItems/Serializable.h | 5 +- .../cpp/worklets/SharedItems/Synchronizable.h | 5 +- .../worklets/WorkletRuntime/WorkletRuntime.h | 5 +- .../android/CMakeLists.txt | 40 +++++- .../android/build.gradle | 122 ++++++++++++++---- .../android/fix-prefab.gradle | 69 ++++++++++ yarn.lock | 7 + 14 files changed, 308 insertions(+), 58 deletions(-) create mode 100644 .yarn/patches/@react-native-gradle-plugin-npm-0.82.0-10aedc0588.patch create mode 100644 packages/react-native-reanimated/android/fix-prefab.gradle create mode 100644 packages/react-native-worklets/android/fix-prefab.gradle diff --git a/.yarn/patches/@react-native-gradle-plugin-npm-0.82.0-10aedc0588.patch b/.yarn/patches/@react-native-gradle-plugin-npm-0.82.0-10aedc0588.patch new file mode 100644 index 000000000000..4a729e21a42f --- /dev/null +++ b/.yarn/patches/@react-native-gradle-plugin-npm-0.82.0-10aedc0588.patch @@ -0,0 +1,15 @@ +diff --git a/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/ReactPlugin.kt b/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/ReactPlugin.kt +index 890e61c007d5b3e0a9a69d37ef10e8aa3ce5c6b6..91acd7b2930fedb4eca2461ba99287721ca1f38f 100644 +--- a/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/ReactPlugin.kt ++++ b/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/ReactPlugin.kt +@@ -80,7 +80,9 @@ class ReactPlugin : Plugin { + configureRepositories(project) + } + +- configureReactNativeNdk(project, extension) ++ if(!project.gradle.startParameter.taskNames.any { it.contains("clean") }) { ++ configureReactNativeNdk(project, extension) ++ } + configureBuildConfigFieldsForApp(project, extension) + configureDevServerLocation(project) + configureBackwardCompatibilityReactMap(project) diff --git a/apps/fabric-example/android/gradle.properties b/apps/fabric-example/android/gradle.properties index d183897bec8e..dc802ce5753e 100644 --- a/apps/fabric-example/android/gradle.properties +++ b/apps/fabric-example/android/gradle.properties @@ -25,7 +25,8 @@ android.useAndroidX=true # Use this property to specify which architecture you want to build. # You can also override it from the CLI using # ./gradlew -PreactNativeArchitectures=x86_64 -reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64 +# reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64 +reactNativeArchitectures=arm64-v8a # Use this property to enable support to the new architecture. # This will allow you to use TurboModules and the Fabric render in @@ -52,5 +53,5 @@ enableReanimatedProfiling=true # workletsBundleMode=true # https://docs.gradle.org/current/userguide/configuration_cache.html -org.gradle.configuration-cache=true -org.gradle.configuration-cache.problems=fail +# org.gradle.configuration-cache=true +# org.gradle.configuration-cache.problems=fail diff --git a/package.json b/package.json index 141335c03687..81b7447f4021 100644 --- a/package.json +++ b/package.json @@ -70,5 +70,8 @@ "react-native-builder-bob": "0.40.13", "shelljs": "0.10.0", "typescript": "5.8.3" + }, + "resolutions": { + "@react-native/gradle-plugin@npm:0.82.0": "patch:@react-native/gradle-plugin@npm%3A0.82.0#~/.yarn/patches/@react-native-gradle-plugin-npm-0.82.0-10aedc0588.patch" } } diff --git a/packages/react-native-reanimated/android/CMakeLists.txt b/packages/react-native-reanimated/android/CMakeLists.txt index 9f3220d6315e..db5338ada627 100644 --- a/packages/react-native-reanimated/android/CMakeLists.txt +++ b/packages/react-native-reanimated/android/CMakeLists.txt @@ -45,6 +45,7 @@ file(GLOB_RECURSE REANIMATED_ANDROID_CPP_SOURCES CONFIGURE_DEPENDS find_package(fbjni REQUIRED CONFIG) find_package(ReactAndroid REQUIRED CONFIG) +find_package(react-native-worklets REQUIRED CONFIG) add_library(reanimated SHARED ${REANIMATED_COMMON_CPP_SOURCES} ${REANIMATED_ANDROID_CPP_SOURCES}) @@ -71,7 +72,9 @@ target_include_directories( "${REACT_NATIVE_DIR}/ReactCommon/react/renderer/graphics/platform/cxx" "${REACT_NATIVE_WORKLETS_DIR}/Common/cpp" "${REACT_NATIVE_WORKLETS_DIR}/android/src/main/cpp" - "${REACT_NATIVE_WORKLETS_DIR}/android/build/prefab-headers") + # Official public headers of react-native-worklets + # "${BUILD_DIR}/include" +) set_target_properties(reanimated PROPERTIES LINKER_LANGUAGE CXX) @@ -83,12 +86,9 @@ endif() add_library(worklets SHARED IMPORTED) -set_target_properties( - worklets - PROPERTIES - IMPORTED_LOCATION - "${REACT_NATIVE_WORKLETS_DIR}/android/build/intermediates/cmake/${BUILD_TYPE}/obj/${ANDROID_ABI}/libworklets.so" -) +# set_target_properties( worklets PROPERTIES IMPORTED_LOCATION +# "${REACT_NATIVE_WORKLETS_DIR}/android/build/intermediates/cmake/${BUILD_TYPE}/obj/${ANDROID_ABI}/libworklets.so" +# ) set_target_properties(reanimated PROPERTIES LINKER_LANGUAGE CXX) # remove dead code sections @@ -109,4 +109,5 @@ target_link_libraries( ReactAndroid::jsi fbjni::fbjni android - worklets) + react-native-worklets::worklets + react-native-worklets::RNWorklets) diff --git a/packages/react-native-reanimated/android/build.gradle b/packages/react-native-reanimated/android/build.gradle index 86bace765ea9..58f6f9cbbbc4 100644 --- a/packages/react-native-reanimated/android/build.gradle +++ b/packages/react-native-reanimated/android/build.gradle @@ -111,6 +111,8 @@ def getReanimatedStaticFeatureFlags() { return featureFlags.collect { key, value -> "[${key}:${value}]" }.join("") } +// apply from: "./fix-prefab.gradle" + if (isNewArchitectureEnabled()) { apply plugin: "com.facebook.react" } @@ -314,12 +316,13 @@ task prepareReanimatedHeadersForPrefabs(type: Copy) { into(reanimatedPrefabHeadersDir) } -task cleanCmakeCache() { - tasks.getByName("clean").dependsOn(cleanCmakeCache) - doFirst { - delete "${projectDir}/.cxx" - } -} +// tasks.register("cleanCmakeCache", Delete) { +// delete(layout.projectDirectory.dir(".cxx")) +// delete(layout.projectDirectory.dir("build")) +// } +// tasks.named("clean") { +// dependsOn("cleanCmakeCache") +// } repositories { mavenCentral() diff --git a/packages/react-native-reanimated/android/fix-prefab.gradle b/packages/react-native-reanimated/android/fix-prefab.gradle new file mode 100644 index 000000000000..d6c010ef785b --- /dev/null +++ b/packages/react-native-reanimated/android/fix-prefab.gradle @@ -0,0 +1,51 @@ +tasks.configureEach { task -> + // Make sure that we generate our prefab publication file only after having built the native library + // so that not a header publication file, but a full configuration publication will be generated, which + // will include the .so file + + def prefabConfigurePattern = ~/^prefab(.+)ConfigurePackage$/ + def matcher = task.name =~ prefabConfigurePattern + if (matcher.matches()) { + def variantName = matcher[0][1] + task.outputs.upToDateWhen { false } + task.dependsOn("externalNativeBuild${variantName}") + } +} + +afterEvaluate { + def abis = reactNativeArchitectures() + rootProject.allprojects.each { proj -> + if (proj === rootProject) return + + def dependsOnThisLib = proj.configurations.findAll { it.canBeResolved }.any { config -> + config.dependencies.any { dep -> + dep.group == project.group && dep.name == project.name + } + } + if (!dependsOnThisLib && proj != project) return + + if (!proj.plugins.hasPlugin('com.android.application') && !proj.plugins.hasPlugin('com.android.library')) { + return + } + + def variants = proj.android.hasProperty('applicationVariants') ? proj.android.applicationVariants : proj.android.libraryVariants + // Touch the prefab_config.json files to ensure that in ExternalNativeJsonGenerator.kt we will re-trigger the prefab CLI to + // generate a libnameConfig.cmake file that will contain our native library (.so). + // See this condition: https://cs.android.com/android-studio/platform/tools/base/+/mirror-goog-studio-main:build-system/gradle-core/src/main/java/com/android/build/gradle/tasks/ExternalNativeJsonGenerator.kt;l=207-219?q=createPrefabBuildSystemGlue + variants.all { variant -> + def variantName = variant.name + abis.each { abi -> + def searchDir = new File(proj.projectDir, ".cxx/${variantName}") + if (!searchDir.exists()) return + def matches = [] + searchDir.eachDir { randomDir -> + def prefabFile = new File(randomDir, "${abi}/prefab_config.json") + if (prefabFile.exists()) matches << prefabFile + } + matches.each { prefabConfig -> + prefabConfig.setLastModified(System.currentTimeMillis()) + } + } + } + } +} diff --git a/packages/react-native-worklets/Common/cpp/worklets/RunLoop/AsyncQueue.h b/packages/react-native-worklets/Common/cpp/worklets/RunLoop/AsyncQueue.h index 9ddee394f642..0ec5146437ad 100644 --- a/packages/react-native-worklets/Common/cpp/worklets/RunLoop/AsyncQueue.h +++ b/packages/react-native-worklets/Common/cpp/worklets/RunLoop/AsyncQueue.h @@ -1,5 +1,4 @@ -#ifndef RNWORKLETS_ASYNCQUEUE_H -#define RNWORKLETS_ASYNCQUEUE_H +#pragma once #include @@ -13,5 +12,3 @@ class AsyncQueue : public facebook::jsi::NativeState { }; } // namespace worklets - -#endif // RNWORKLETS_ASYNCQUEUE_H diff --git a/packages/react-native-worklets/Common/cpp/worklets/SharedItems/Serializable.h b/packages/react-native-worklets/Common/cpp/worklets/SharedItems/Serializable.h index 90b693ae79da..771b6be96cd9 100644 --- a/packages/react-native-worklets/Common/cpp/worklets/SharedItems/Serializable.h +++ b/packages/react-native-worklets/Common/cpp/worklets/SharedItems/Serializable.h @@ -1,5 +1,4 @@ -#ifndef RNWORKLETS_SERIALIZABLE_H -#define RNWORKLETS_SERIALIZABLE_H +#pragma once #include @@ -430,5 +429,3 @@ struct SerializationData { }; } // namespace worklets - -#endif // RNWORKLETS_SERIALIZABLE_H diff --git a/packages/react-native-worklets/Common/cpp/worklets/SharedItems/Synchronizable.h b/packages/react-native-worklets/Common/cpp/worklets/SharedItems/Synchronizable.h index b126e0bbb1aa..55e3a56eafb2 100644 --- a/packages/react-native-worklets/Common/cpp/worklets/SharedItems/Synchronizable.h +++ b/packages/react-native-worklets/Common/cpp/worklets/SharedItems/Synchronizable.h @@ -1,5 +1,4 @@ -#ifndef RNWORKLETS_SYNCHRONIZABLE_H -#define RNWORKLETS_SYNCHRONIZABLE_H +#pragma once #include #include @@ -56,5 +55,3 @@ jsi::Function getSynchronizableUnpacker(jsi::Runtime &rt); std::shared_ptr extractSynchronizableOrThrow(jsi::Runtime &rt, const jsi::Value &value); }; // namespace worklets - -#endif // RNWORKLETS_SYNCHRONIZABLE_H diff --git a/packages/react-native-worklets/Common/cpp/worklets/WorkletRuntime/WorkletRuntime.h b/packages/react-native-worklets/Common/cpp/worklets/WorkletRuntime/WorkletRuntime.h index ce5845665c71..715c7009fa42 100644 --- a/packages/react-native-worklets/Common/cpp/worklets/WorkletRuntime/WorkletRuntime.h +++ b/packages/react-native-worklets/Common/cpp/worklets/WorkletRuntime/WorkletRuntime.h @@ -1,5 +1,4 @@ -#ifndef RNWORKLETS_WORKLETRUNTIME_H -#define RNWORKLETS_WORKLETRUNTIME_H +#pragma once #include #include @@ -216,5 +215,3 @@ inline jsi::Value runOnRuntimeGuarded(jsi::Runtime &rt, const jsi::Value &functi } } // namespace worklets - -#endif // RNWORKLETS_WORKLETRUNTIME_H diff --git a/packages/react-native-worklets/android/CMakeLists.txt b/packages/react-native-worklets/android/CMakeLists.txt index 7ce60581c4de..6a8a81a8a960 100644 --- a/packages/react-native-worklets/android/CMakeLists.txt +++ b/packages/react-native-worklets/android/CMakeLists.txt @@ -1,5 +1,5 @@ project(Worklets) -cmake_minimum_required(VERSION 3.8) +cmake_minimum_required(VERSION 3.13) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) @@ -60,6 +60,19 @@ endif() add_library(worklets SHARED ${WORKLETS_COMMON_CPP_SOURCES} ${WORKLETS_ANDROID_CPP_SOURCES}) +add_library( + RNWorklets + INTERFACE + "${COMMON_CPP_DIR}/worklets/RunLoop/AsyncQueue.h" + "${COMMON_CPP_DIR}/worklets/WorkletRuntime/WorkletRuntime.h" + "${COMMON_CPP_DIR}/worklets/SharedItems/Serializable.h" + "${COMMON_CPP_DIR}/worklets/SharedItems/Synchronizable.h") + +get_target_property(WORKLETS_TYPE worklets TYPE) +get_target_property(RNWORKLETS_TYPE RNWorklets TYPE) +message(WARNING "worklets library added, type: ${WORKLETS_TYPE}") +message(WARNING "RNWorklets library added, type: ${RNWORKLETS_TYPE}") + if(ReactAndroid_VERSION_MINOR GREATER_EQUAL 80) include( "${REACT_NATIVE_DIR}/ReactCommon/cmake-utils/react-native-flags.cmake") @@ -106,3 +119,28 @@ if(${JS_RUNTIME} STREQUAL "hermes") elseif(${JS_RUNTIME} STREQUAL "jsc") target_link_libraries(worklets ReactAndroid::jsctooling) endif() + +# get_cmake_property(_variableNames VARIABLES) list(SORT _variableNames) +# foreach(_variableName ${_variableNames}) message(WARNING "${_variableName} = +# ${${_variableName}}") endforeach() + +# set(PUBLIC_INCLUDE_DIR "${RNWORKLETS_HEADERS_DIR}") + +# file(MAKE_DIRECTORY "${PUBLIC_INCLUDE_DIR}") + +# # // // Pack public headers to RNWorklets headers dir // # +# from("$projectDir/../Common/cpp/worklets/RunLoop/") { // # +# include("AsyncQueue.h") // } // # +# from("$projectDir/../Common/cpp/worklets/WorkletRuntime/") { // # +# include("WorkletRuntime.h") // } // # +# from("$projectDir/../Common/cpp/worklets/SharedItems/") { // # +# include("Serializable.h") // include("Synchronizable.h") // } + +# file(CREATE_LINK "${COMMON_CPP_DIR}/worklets/RunLoop/AsyncQueue.h" +# "${PUBLIC_INCLUDE_DIR}/AsyncQueue.h" SYMBOLIC) file(CREATE_LINK +# "${COMMON_CPP_DIR}/worklets/WorkletRuntime/WorkletRuntime.h" +# "${PUBLIC_INCLUDE_DIR}/WorkletRuntime.h" SYMBOLIC) file(CREATE_LINK +# "${COMMON_CPP_DIR}/worklets/SharedItems/Serializable.h" +# "${PUBLIC_INCLUDE_DIR}/Serializable.h" SYMBOLIC) file(CREATE_LINK +# "${COMMON_CPP_DIR}/worklets/SharedItems/Synchronizable.h" +# "${PUBLIC_INCLUDE_DIR}/Synchronizable.h" SYMBOLIC) diff --git a/packages/react-native-worklets/android/build.gradle b/packages/react-native-worklets/android/build.gradle index 087c2c7c7d90..aac2668dea09 100644 --- a/packages/react-native-worklets/android/build.gradle +++ b/packages/react-native-worklets/android/build.gradle @@ -1,5 +1,7 @@ import com.android.build.gradle.tasks.ExternalNativeBuildJsonTask import groovy.json.JsonSlurper + +import java.nio.file.Files import java.nio.file.Paths import org.apache.tools.ant.taskdefs.condition.Os @@ -107,8 +109,19 @@ def HERMES_V1_ENABLED = safeAppExtGet("hermesV1Enabled", false) // Set version for prefab version WORKLETS_VERSION -def workletsPrefabHeadersDir = project.file("$buildDir/prefab-headers/worklets") +def workletsPrefabHeadersDir = project.file("${buildDir}/prefab-headers/worklets") +workletsPrefabHeadersDir.mkdirs() def RNWorkletsPrefabHeadersDir = project.file("${buildDir}/prefab-headers/RNWorklets") +RNWorkletsPrefabHeadersDir.mkdirs() +def RNWorkletsPrefabHeadersAPIDir = project.file("${buildDir}/prefab-headers/RNWorklets/RNWorklets") +RNWorkletsPrefabHeadersAPIDir.mkdirs() +// def rootProjectBuildDir = rootProject.hasProperty("buildDir") ? rootProject.buildDir : "${rootProject.projectDir}/build" +// println("Root project build dir: ") +// println(rootProject) +// println(rootProject.hasProperty("buildDir")) +// println(rootProject.buildDir) +// println(rootProjectBuildDir) +// println(rootProject.projectDir) def JS_RUNTIME = { // Override JS runtime with environment variable @@ -151,6 +164,8 @@ apply plugin: "com.android.library" apply plugin: "maven-publish" apply plugin: "de.undercouch.download" +apply from: "./fix-prefab.gradle" + android { compileSdkVersion safeExtGet("compileSdkVersion", 34) @@ -173,7 +188,13 @@ android { prefab { worklets { headers workletsPrefabHeadersDir.absolutePath + headerOnly false + // headers RNWorkletsPrefabHeadersDir.absolutePath + } + RNWorklets { + // headers RNWorkletsHeadersDir.absolutePath headers RNWorkletsPrefabHeadersDir.absolutePath + headerOnly true } } @@ -201,8 +222,10 @@ android { "-DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON", "-DWORKLETS_FEATURE_FLAGS=${WORKLETS_FEATURE_FLAGS}", "-DHERMES_V1_ENABLED=${HERMES_V1_ENABLED}" + // , + // "-DRNWORKLETS_HEADERS_DIR=${toPlatformFileString(RNWorkletsHeadersDir.path)}" abiFilters (*reactNativeArchitectures()) - targets("worklets") + targets("worklets", "RNWorklets") } } @@ -312,34 +335,85 @@ task assertNewArchitectureEnabledTask { preBuild.dependsOn(assertNewArchitectureEnabledTask) -task prepareWorkletsHeadersForPrefabs(type: Copy) { - from("$projectDir/src/main/cpp") - from("$projectDir/../Common/cpp") - include("worklets/**/*.h") - into(workletsPrefabHeadersDir) +//tasks.register('prepareWorkletsHeadersForPrefabs',) { +task prepareWorkletsHeadersForPrefabs { + doFirst { + workletsPrefabHeadersDir.mkdirs() + RNWorkletsPrefabHeadersDir.mkdirs() + RNWorkletsPrefabHeadersAPIDir.mkdirs() + +// inputs.files(fileTree("$projectDir/src/main/cpp") { +// include '**/worklets/**/*.h' +// }) +// inputs.files(fileTree("$projectDir/../Common/cpp") { +// include '**/worklets/**/*.h' +// }) + // inputs.files([ + // file("$projectDir/../Common/cpp/worklets/RunLoop/AsyncQueue.h"), + // file("$projectDir/../Common/cpp/worklets/WorkletRuntime/WorkletRuntime.h"), + // file("$projectDir/../Common/cpp/worklets/SharedItems/Serializable.h"), + // file("$projectDir/../Common/cpp/worklets/SharedItems/Synchronizable.h") + // ]) + + def sourceDir1 = file("$projectDir/src/main/cpp") + def sourceDir2 = file("$projectDir/../Common/cpp") + + [sourceDir1, sourceDir2].each { sourceDir -> + if (sourceDir.exists()) { + sourceDir.eachFileRecurse { sourceFile -> + if (sourceFile.isFile() && sourceFile.path.contains("worklets") && sourceFile.name.endsWith(".h")) { + def relativePath = sourceDir.toPath().relativize(sourceFile.toPath()) + def targetFile = file("${workletsPrefabHeadersDir}/${relativePath}") + + targetFile.parentFile.mkdirs() + + if (targetFile.exists()) { + targetFile.delete() + } + + Files.createSymbolicLink( + targetFile.toPath(), + sourceFile.toPath() + ) + } + } + } + } - // Pack public headers to RNWorklets headers dir - from("$projectDir/../Common/cpp/worklets/RunLoop/") { - include("AsyncQueue.h") - } - from("$projectDir/../Common/cpp/worklets/WorkletRuntime/") { - include("WorkletRuntime.h") - } - from("$projectDir/../Common/cpp/worklets/SharedItems/") { - include("Serializable.h") - include("Synchronizable.h") - } - into(RNWorkletsPrefabHeadersDir) + def sourceFiles = [ + file("$projectDir/../Common/cpp/worklets/RunLoop/AsyncQueue.h"), + file("$projectDir/../Common/cpp/worklets/WorkletRuntime/WorkletRuntime.h"), + file("$projectDir/../Common/cpp/worklets/SharedItems/Serializable.h"), + file("$projectDir/../Common/cpp/worklets/SharedItems/Synchronizable.h") + ] -} + sourceFiles.each { sourceFile -> + def targetFile = file("${RNWorkletsPrefabHeadersAPIDir}/${sourceFile.name}") -task cleanCmakeCache() { - tasks.getByName("clean").dependsOn(cleanCmakeCache) - doFirst { - delete "${projectDir}/.cxx" + targetFile.parentFile.mkdirs() + + if (targetFile.exists()) { + targetFile.delete() + } + + Files.createSymbolicLink( + targetFile.toPath(), + sourceFile.toPath() + ) + } + +// outputs.dir(workletsPrefabHeadersDir) +// outputs.dir(RNWorkletsPrefabHeadersDir) } } +// tasks.register("cleanCmakeCache", Delete) { +// delete(layout.projectDirectory.dir(".cxx")) +// } +// tasks.named("clean") { +// dependsOn("cleanCmakeCache") +// } + repositories { mavenCentral() google() diff --git a/packages/react-native-worklets/android/fix-prefab.gradle b/packages/react-native-worklets/android/fix-prefab.gradle new file mode 100644 index 000000000000..ed5a128f8520 --- /dev/null +++ b/packages/react-native-worklets/android/fix-prefab.gradle @@ -0,0 +1,69 @@ +tasks.configureEach { task -> + // Make sure that we generate our prefab publication file only after having built the native library + // so that not a header publication file, but a full configuration publication will be generated, which + // will include the .so file + + def prefabConfigurePattern = ~/^prefab(.+)ConfigurePackage$/ + def matcher = task.name =~ prefabConfigurePattern + if (matcher.matches()) { + def variantName = matcher[0][1] + task.outputs.upToDateWhen { false } + task.dependsOn("externalNativeBuild${variantName}") + } +} + +afterEvaluate { + def abis = reactNativeArchitectures() + rootProject.allprojects.each { proj -> + + println "Processing project: ${proj.name} 1" + + if (proj === rootProject) return + + println "Processing project: ${proj.name} 2" + + def dependsOnThisLib = proj.configurations.any { config -> + { + if (proj.name == "react-native-reanimated") { + println config.name + println config.dependencies.name + } + return config.dependencies.any { dep -> + dep.group == project.group && dep.name == project.name + } + } + } + + println "Processing project: ${proj.name} dependsOnThisLib = ${dependsOnThisLib}" + + if (!dependsOnThisLib && proj != project) return + + println "Processing project: ${proj.name} 3" + + if (!proj.plugins.hasPlugin('com.android.application') && !proj.plugins.hasPlugin('com.android.library')) { + return + } + + println "Processing project: ${proj.name} 4" + + def variants = proj.android.hasProperty('applicationVariants') ? proj.android.applicationVariants : proj.android.libraryVariants + // Touch the prefab_config.json files to ensure that in ExternalNativeJsonGenerator.kt we will re-trigger the prefab CLI to + // generate a libnameConfig.cmake file that will contain our native library (.so). + // See this condition: https://cs.android.com/android-studio/platform/tools/base/+/mirror-goog-studio-main:build-system/gradle-core/src/main/java/com/android/build/gradle/tasks/ExternalNativeJsonGenerator.kt;l=207-219?q=createPrefabBuildSystemGlue + variants.all { variant -> + def variantName = variant.name + abis.each { abi -> + def searchDir = new File(proj.projectDir, ".cxx/${variantName}") + if (!searchDir.exists()) return + def matches = [] + searchDir.eachDir { randomDir -> + def prefabFile = new File(randomDir, "${abi}/prefab_config.json") + if (prefabFile.exists()) matches << prefabFile + } + matches.each { prefabConfig -> + prefabConfig.setLastModified(System.currentTimeMillis()) + } + } + } + } +} diff --git a/yarn.lock b/yarn.lock index de8b50d70886..d9230ae6768d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6964,6 +6964,13 @@ __metadata: languageName: node linkType: hard +"@react-native/gradle-plugin@patch:@react-native/gradle-plugin@npm%3A0.82.0#~/.yarn/patches/@react-native-gradle-plugin-npm-0.82.0-10aedc0588.patch": + version: 0.82.0 + resolution: "@react-native/gradle-plugin@patch:@react-native/gradle-plugin@npm%3A0.82.0#~/.yarn/patches/@react-native-gradle-plugin-npm-0.82.0-10aedc0588.patch::version=0.82.0&hash=60e1b9" + checksum: 10/493d986f2b23678dacd32a5e20a1c4b94e981b5d1abdf6fd35a9fb195b61900250dabb05d54e64af7e779c5b2e55cb96f431c16db0ba326ae8c0d43c5956616d + languageName: node + linkType: hard + "@react-native/js-polyfills@npm:0.79.6": version: 0.79.6 resolution: "@react-native/js-polyfills@npm:0.79.6" From 27f8807956163dcdf29e3b3cab21cbebeeb3c715 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20=C5=BBelawski?= Date: Mon, 24 Nov 2025 20:31:08 +0100 Subject: [PATCH 03/12] fix: Reanimated failing when using Worklets as a prefab --- ...-gradle-plugin-npm-0.82.0-10aedc0588.patch | 15 ++++++ .../android/build.gradle | 2 + .../android/fix-prefab.gradle | 53 +++++++++++++++++++ 3 files changed, 70 insertions(+) create mode 100644 .yarn/patches/@react-native-gradle-plugin-npm-0.82.0-10aedc0588.patch create mode 100644 packages/react-native-worklets/android/fix-prefab.gradle diff --git a/.yarn/patches/@react-native-gradle-plugin-npm-0.82.0-10aedc0588.patch b/.yarn/patches/@react-native-gradle-plugin-npm-0.82.0-10aedc0588.patch new file mode 100644 index 000000000000..4a729e21a42f --- /dev/null +++ b/.yarn/patches/@react-native-gradle-plugin-npm-0.82.0-10aedc0588.patch @@ -0,0 +1,15 @@ +diff --git a/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/ReactPlugin.kt b/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/ReactPlugin.kt +index 890e61c007d5b3e0a9a69d37ef10e8aa3ce5c6b6..91acd7b2930fedb4eca2461ba99287721ca1f38f 100644 +--- a/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/ReactPlugin.kt ++++ b/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/ReactPlugin.kt +@@ -80,7 +80,9 @@ class ReactPlugin : Plugin { + configureRepositories(project) + } + +- configureReactNativeNdk(project, extension) ++ if(!project.gradle.startParameter.taskNames.any { it.contains("clean") }) { ++ configureReactNativeNdk(project, extension) ++ } + configureBuildConfigFieldsForApp(project, extension) + configureDevServerLocation(project) + configureBackwardCompatibilityReactMap(project) diff --git a/packages/react-native-worklets/android/build.gradle b/packages/react-native-worklets/android/build.gradle index 2e5ad454afb1..61c565b3b26c 100644 --- a/packages/react-native-worklets/android/build.gradle +++ b/packages/react-native-worklets/android/build.gradle @@ -150,6 +150,8 @@ apply plugin: "com.android.library" apply plugin: "maven-publish" apply plugin: "de.undercouch.download" +apply from: "./fix-prefab.gradle" + android { compileSdkVersion safeExtGet("compileSdkVersion", 34) diff --git a/packages/react-native-worklets/android/fix-prefab.gradle b/packages/react-native-worklets/android/fix-prefab.gradle new file mode 100644 index 000000000000..fcf502a0ca48 --- /dev/null +++ b/packages/react-native-worklets/android/fix-prefab.gradle @@ -0,0 +1,53 @@ +tasks.configureEach { task -> + // Make sure that we generate our prefab publication file only after having built the native library + // so that not a header publication file, but a full configuration publication will be generated, which + // will include the .so file + + def prefabConfigurePattern = ~/^prefab(.+)ConfigurePackage$/ + def matcher = task.name =~ prefabConfigurePattern + if (matcher.matches()) { + def variantName = matcher[0][1] + task.outputs.upToDateWhen { false } + task.dependsOn("externalNativeBuild${variantName}") + } +} + +afterEvaluate { + def abis = reactNativeArchitectures() + rootProject.allprojects.each { proj -> + + if (proj === rootProject) return + + def dependsOnThisLib = proj.configurations.any { config -> + config.dependencies.any { dep -> + dep.group == project.group && dep.name == project.name + } + } + + if (!dependsOnThisLib && proj != project) return + + if (!proj.plugins.hasPlugin('com.android.application') && !proj.plugins.hasPlugin('com.android.library')) { + return + } + + def variants = proj.android.hasProperty('applicationVariants') ? proj.android.applicationVariants : proj.android.libraryVariants + // Touch the prefab_config.json files to ensure that in ExternalNativeJsonGenerator.kt we will re-trigger the prefab CLI to + // generate a libnameConfig.cmake file that will contain our native library (.so). + // See this condition: https://cs.android.com/android-studio/platform/tools/base/+/mirror-goog-studio-main:build-system/gradle-core/src/main/java/com/android/build/gradle/tasks/ExternalNativeJsonGenerator.kt;l=207-219?q=createPrefabBuildSystemGlue + variants.all { variant -> + def variantName = variant.name + abis.each { abi -> + def searchDir = new File(proj.projectDir, ".cxx/${variantName}") + if (!searchDir.exists()) return + def matches = [] + searchDir.eachDir { randomDir -> + def prefabFile = new File(randomDir, "${abi}/prefab_config.json") + if (prefabFile.exists()) matches << prefabFile + } + matches.each { prefabConfig -> + prefabConfig.setLastModified(System.currentTimeMillis()) + } + } + } + } +} From 96f41f689f56a67707845cfc36f10e148a5297ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20=C5=BBelawski?= Date: Mon, 24 Nov 2025 20:39:47 +0100 Subject: [PATCH 04/12] chore: add RNGP fix --- package.json | 3 +++ .../android/CMakeLists.txt | 15 +++------------ yarn.lock | 7 +++++++ 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/package.json b/package.json index 141335c03687..81b7447f4021 100644 --- a/package.json +++ b/package.json @@ -70,5 +70,8 @@ "react-native-builder-bob": "0.40.13", "shelljs": "0.10.0", "typescript": "5.8.3" + }, + "resolutions": { + "@react-native/gradle-plugin@npm:0.82.0": "patch:@react-native/gradle-plugin@npm%3A0.82.0#~/.yarn/patches/@react-native-gradle-plugin-npm-0.82.0-10aedc0588.patch" } } diff --git a/packages/react-native-reanimated/android/CMakeLists.txt b/packages/react-native-reanimated/android/CMakeLists.txt index d4731e6c9e5b..3f87cab8570b 100644 --- a/packages/react-native-reanimated/android/CMakeLists.txt +++ b/packages/react-native-reanimated/android/CMakeLists.txt @@ -45,6 +45,7 @@ file(GLOB_RECURSE REANIMATED_ANDROID_CPP_SOURCES CONFIGURE_DEPENDS find_package(fbjni REQUIRED CONFIG) find_package(ReactAndroid REQUIRED CONFIG) +find_package(react-native-worklets REQUIRED CONFIG) add_library(reanimated SHARED ${REANIMATED_COMMON_CPP_SOURCES} ${REANIMATED_ANDROID_CPP_SOURCES}) @@ -69,8 +70,7 @@ target_include_directories( "${REACT_NATIVE_DIR}/ReactCommon/runtimeexecutor" "${REACT_NATIVE_DIR}/ReactCommon/jsiexecutor" "${REACT_NATIVE_DIR}/ReactCommon/react/renderer/graphics/platform/cxx" - "${REACT_NATIVE_WORKLETS_DIR}/Common/cpp" - "${REACT_NATIVE_WORKLETS_DIR}/android/src/main/cpp") +) set_target_properties(reanimated PROPERTIES LINKER_LANGUAGE CXX) @@ -80,15 +80,6 @@ else() set(BUILD_TYPE "release") endif() -add_library(worklets SHARED IMPORTED) - -set_target_properties( - worklets - PROPERTIES - IMPORTED_LOCATION - "${REACT_NATIVE_WORKLETS_DIR}/android/build/intermediates/cmake/${BUILD_TYPE}/obj/${ANDROID_ABI}/libworklets.so" -) - set_target_properties(reanimated PROPERTIES LINKER_LANGUAGE CXX) # remove dead code sections set_target_properties(reanimated PROPERTIES LINK_FLAGS "-Wl,--gc-sections") @@ -108,4 +99,4 @@ target_link_libraries( ReactAndroid::jsi fbjni::fbjni android - worklets) + react-native-worklets::worklets) diff --git a/yarn.lock b/yarn.lock index de8b50d70886..d9230ae6768d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6964,6 +6964,13 @@ __metadata: languageName: node linkType: hard +"@react-native/gradle-plugin@patch:@react-native/gradle-plugin@npm%3A0.82.0#~/.yarn/patches/@react-native-gradle-plugin-npm-0.82.0-10aedc0588.patch": + version: 0.82.0 + resolution: "@react-native/gradle-plugin@patch:@react-native/gradle-plugin@npm%3A0.82.0#~/.yarn/patches/@react-native-gradle-plugin-npm-0.82.0-10aedc0588.patch::version=0.82.0&hash=60e1b9" + checksum: 10/493d986f2b23678dacd32a5e20a1c4b94e981b5d1abdf6fd35a9fb195b61900250dabb05d54e64af7e779c5b2e55cb96f431c16db0ba326ae8c0d43c5956616d + languageName: node + linkType: hard + "@react-native/js-polyfills@npm:0.79.6": version: 0.79.6 resolution: "@react-native/js-polyfills@npm:0.79.6" From 000b063621000dc1492570a96c65641db260864e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20=C5=BBelawski?= Date: Mon, 1 Dec 2025 12:53:45 +0100 Subject: [PATCH 05/12] refactor(Worklets): remove public header dir --- docs/docs-worklets/docs/threading/scheduleOnRuntime.mdx | 2 +- docs/docs-worklets/src/theme/TOCItems/index.js | 1 - .../Common/cpp/worklets/{Public => RunLoop}/AsyncQueue.h | 0 .../Common/cpp/worklets/RunLoop/AsyncQueueImpl.h | 2 +- .../Common/cpp/worklets/RunLoop/EventLoop.h | 2 +- .../Common/cpp/worklets/WorkletRuntime/WorkletRuntime.h | 2 +- packages/react-native-worklets/src/runtimes.native.ts | 2 +- packages/react-native-worklets/src/types.ts | 4 ++-- 8 files changed, 7 insertions(+), 8 deletions(-) rename packages/react-native-worklets/Common/cpp/worklets/{Public => RunLoop}/AsyncQueue.h (100%) diff --git a/docs/docs-worklets/docs/threading/scheduleOnRuntime.mdx b/docs/docs-worklets/docs/threading/scheduleOnRuntime.mdx index 876f391cccc4..9e5bada9f5e5 100644 --- a/docs/docs-worklets/docs/threading/scheduleOnRuntime.mdx +++ b/docs/docs-worklets/docs/threading/scheduleOnRuntime.mdx @@ -48,7 +48,7 @@ Arguments to the function you want to execute on the [Worker Runtime](/docs/fund ## Remarks - The worklet is scheduled on the Worker Runtime's [Async - Queue](https://github.com/software-mansion/react-native-reanimated/blob/main/packages/react-native-worklets/Common/cpp/worklets/Public/AsyncQueue.h) + Queue](https://github.com/software-mansion/react-native-reanimated/blob/main/packages/react-native-worklets/Common/cpp/worklets/RunLoop/AsyncQueue.h) - The worklet cannot be scheduled on the Worker Runtime from [UI Runtime](/docs/fundamentals/runtimeKinds#ui-runtime) or another [Worker Runtime](/docs/fundamentals/runtimeKinds#worker-runtime), unless the [Bundle Mode](/docs/experimental/bundleMode) is enabled. diff --git a/docs/docs-worklets/src/theme/TOCItems/index.js b/docs/docs-worklets/src/theme/TOCItems/index.js index 6ed752415171..4c3538b43bab 100644 --- a/docs/docs-worklets/src/theme/TOCItems/index.js +++ b/docs/docs-worklets/src/theme/TOCItems/index.js @@ -1,6 +1,5 @@ import { TOCItems } from '@swmansion/t-rex-ui'; - export default function TOCItemsWrapper(props) { return ( <> diff --git a/packages/react-native-worklets/Common/cpp/worklets/Public/AsyncQueue.h b/packages/react-native-worklets/Common/cpp/worklets/RunLoop/AsyncQueue.h similarity index 100% rename from packages/react-native-worklets/Common/cpp/worklets/Public/AsyncQueue.h rename to packages/react-native-worklets/Common/cpp/worklets/RunLoop/AsyncQueue.h diff --git a/packages/react-native-worklets/Common/cpp/worklets/RunLoop/AsyncQueueImpl.h b/packages/react-native-worklets/Common/cpp/worklets/RunLoop/AsyncQueueImpl.h index 30cd0d7a0292..72592049201b 100644 --- a/packages/react-native-worklets/Common/cpp/worklets/RunLoop/AsyncQueueImpl.h +++ b/packages/react-native-worklets/Common/cpp/worklets/RunLoop/AsyncQueueImpl.h @@ -1,7 +1,7 @@ #pragma once #include -#include +#include #include #include diff --git a/packages/react-native-worklets/Common/cpp/worklets/RunLoop/EventLoop.h b/packages/react-native-worklets/Common/cpp/worklets/RunLoop/EventLoop.h index ac3eed1816d1..885bbbe2a8c1 100644 --- a/packages/react-native-worklets/Common/cpp/worklets/RunLoop/EventLoop.h +++ b/packages/react-native-worklets/Common/cpp/worklets/RunLoop/EventLoop.h @@ -1,7 +1,7 @@ #pragma once #include -#include +#include #include #include diff --git a/packages/react-native-worklets/Common/cpp/worklets/WorkletRuntime/WorkletRuntime.h b/packages/react-native-worklets/Common/cpp/worklets/WorkletRuntime/WorkletRuntime.h index 919f0de2e95d..715c7009fa42 100644 --- a/packages/react-native-worklets/Common/cpp/worklets/WorkletRuntime/WorkletRuntime.h +++ b/packages/react-native-worklets/Common/cpp/worklets/WorkletRuntime/WorkletRuntime.h @@ -5,7 +5,7 @@ #include #include -#include +#include #include #include #include diff --git a/packages/react-native-worklets/src/runtimes.native.ts b/packages/react-native-worklets/src/runtimes.native.ts index 3443aa6e01b4..bca57ac5c157 100644 --- a/packages/react-native-worklets/src/runtimes.native.ts +++ b/packages/react-native-worklets/src/runtimes.native.ts @@ -115,7 +115,7 @@ export function createWorkletRuntime( * for more information about the different runtime kinds. * * - The worklet is scheduled on the Worker Runtime's [Async - * Queue](https://github.com/software-mansion/react-native-reanimated/blob/main/packages/react-native-worklets/Common/cpp/worklets/Public/AsyncQueue.h) + * Queue](https://github.com/software-mansion/react-native-reanimated/blob/main/packages/react-native-worklets/Common/cpp/worklets/RunLoop/AsyncQueue.h) * - The function cannot be scheduled on the Worker Runtime from [UI * Runtime](https://docs.swmansion.com/react-native-worklets/docs/fundamentals/runtimeKinds#ui-runtime) * or another [Worker diff --git a/packages/react-native-worklets/src/types.ts b/packages/react-native-worklets/src/types.ts index 916e175a4a1f..8a3f4859cbda 100644 --- a/packages/react-native-worklets/src/types.ts +++ b/packages/react-native-worklets/src/types.ts @@ -130,7 +130,7 @@ export type WorkletRuntimeConfig = { * An optional custom queue to be used for scheduling worklets. * * The queue has to implement the C++ `AsyncQueue` interface from - * ``. + * ``. */ customQueue?: never; } @@ -144,7 +144,7 @@ export type WorkletRuntimeConfig = { * An optional custom queue to be used for scheduling worklets. * * The queue has to implement the C++ `AsyncQueue` interface from - * ``. + * ``. */ customQueue?: object; } From 34130d3bba0f425cc7039a54fffa0a88113713b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20=C5=BBelawski?= Date: Mon, 1 Dec 2025 12:59:38 +0100 Subject: [PATCH 06/12] chore: remove unused variable --- packages/react-native-reanimated/android/build.gradle | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/react-native-reanimated/android/build.gradle b/packages/react-native-reanimated/android/build.gradle index 86bace765ea9..c62f275012b1 100644 --- a/packages/react-native-reanimated/android/build.gradle +++ b/packages/react-native-reanimated/android/build.gradle @@ -198,7 +198,6 @@ android { "-DREACT_NATIVE_MINOR_VERSION=${REACT_NATIVE_MINOR_VERSION}", "-DANDROID_TOOLCHAIN=clang", "-DREACT_NATIVE_DIR=${toPlatformFileString(reactNativeRootDir.path)}", - "-DREACT_NATIVE_WORKLETS_DIR=${toPlatformFileString(reactNativeWorkletsRootDir.path)}", "-DIS_REANIMATED_EXAMPLE_APP=${IS_REANIMATED_EXAMPLE_APP}", "-DREANIMATED_PROFILING=${REANIMATED_PROFILING}", "-DREANIMATED_VERSION=${REANIMATED_VERSION}", From 54aa8e89891bc96cc8ba3b788b6233f0d243dd54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20=C5=BBelawski?= Date: Mon, 1 Dec 2025 15:46:51 +0100 Subject: [PATCH 07/12] feat: linking --- apps/fabric-example/android/gradle.properties | 7 +- .../android/build.gradle | 25 ++-- .../android/CMakeLists.txt | 38 ----- .../android/build.gradle | 139 ++++++------------ 4 files changed, 65 insertions(+), 144 deletions(-) diff --git a/apps/fabric-example/android/gradle.properties b/apps/fabric-example/android/gradle.properties index dc802ce5753e..d183897bec8e 100644 --- a/apps/fabric-example/android/gradle.properties +++ b/apps/fabric-example/android/gradle.properties @@ -25,8 +25,7 @@ android.useAndroidX=true # Use this property to specify which architecture you want to build. # You can also override it from the CLI using # ./gradlew -PreactNativeArchitectures=x86_64 -# reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64 -reactNativeArchitectures=arm64-v8a +reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64 # Use this property to enable support to the new architecture. # This will allow you to use TurboModules and the Fabric render in @@ -53,5 +52,5 @@ enableReanimatedProfiling=true # workletsBundleMode=true # https://docs.gradle.org/current/userguide/configuration_cache.html -# org.gradle.configuration-cache=true -# org.gradle.configuration-cache.problems=fail +org.gradle.configuration-cache=true +org.gradle.configuration-cache.problems=fail diff --git a/packages/react-native-reanimated/android/build.gradle b/packages/react-native-reanimated/android/build.gradle index 6e0b3e53c70c..d1385dff4511 100644 --- a/packages/react-native-reanimated/android/build.gradle +++ b/packages/react-native-reanimated/android/build.gradle @@ -111,8 +111,6 @@ def getReanimatedStaticFeatureFlags() { return featureFlags.collect { key, value -> "[${key}:${value}]" }.join("") } -// apply from: "./fix-prefab.gradle" - if (isNewArchitectureEnabled()) { apply plugin: "com.facebook.react" } @@ -315,13 +313,22 @@ task prepareReanimatedHeadersForPrefabs(type: Copy) { into(reanimatedPrefabHeadersDir) } -// tasks.register("cleanCmakeCache", Delete) { -// delete(layout.projectDirectory.dir(".cxx")) -// delete(layout.projectDirectory.dir("build")) -// } -// tasks.named("clean") { -// dependsOn("cleanCmakeCache") -// } +interface FSService { + @Inject FileSystemOperations getFs() +} + +tasks.register('cleanCmakeCache', Delete) { + def fsService = project.objects.newInstance(FSService) + def projectDir = project.projectDir + doFirst { + fsService.fs.delete {"$projectDir/.cxx" + } + } +} + +tasks.named('clean') { + dependsOn cleanCmakeCache +} repositories { mavenCentral() diff --git a/packages/react-native-worklets/android/CMakeLists.txt b/packages/react-native-worklets/android/CMakeLists.txt index 6a8a81a8a960..acd96117cab8 100644 --- a/packages/react-native-worklets/android/CMakeLists.txt +++ b/packages/react-native-worklets/android/CMakeLists.txt @@ -60,19 +60,6 @@ endif() add_library(worklets SHARED ${WORKLETS_COMMON_CPP_SOURCES} ${WORKLETS_ANDROID_CPP_SOURCES}) -add_library( - RNWorklets - INTERFACE - "${COMMON_CPP_DIR}/worklets/RunLoop/AsyncQueue.h" - "${COMMON_CPP_DIR}/worklets/WorkletRuntime/WorkletRuntime.h" - "${COMMON_CPP_DIR}/worklets/SharedItems/Serializable.h" - "${COMMON_CPP_DIR}/worklets/SharedItems/Synchronizable.h") - -get_target_property(WORKLETS_TYPE worklets TYPE) -get_target_property(RNWORKLETS_TYPE RNWorklets TYPE) -message(WARNING "worklets library added, type: ${WORKLETS_TYPE}") -message(WARNING "RNWorklets library added, type: ${RNWORKLETS_TYPE}") - if(ReactAndroid_VERSION_MINOR GREATER_EQUAL 80) include( "${REACT_NATIVE_DIR}/ReactCommon/cmake-utils/react-native-flags.cmake") @@ -119,28 +106,3 @@ if(${JS_RUNTIME} STREQUAL "hermes") elseif(${JS_RUNTIME} STREQUAL "jsc") target_link_libraries(worklets ReactAndroid::jsctooling) endif() - -# get_cmake_property(_variableNames VARIABLES) list(SORT _variableNames) -# foreach(_variableName ${_variableNames}) message(WARNING "${_variableName} = -# ${${_variableName}}") endforeach() - -# set(PUBLIC_INCLUDE_DIR "${RNWORKLETS_HEADERS_DIR}") - -# file(MAKE_DIRECTORY "${PUBLIC_INCLUDE_DIR}") - -# # // // Pack public headers to RNWorklets headers dir // # -# from("$projectDir/../Common/cpp/worklets/RunLoop/") { // # -# include("AsyncQueue.h") // } // # -# from("$projectDir/../Common/cpp/worklets/WorkletRuntime/") { // # -# include("WorkletRuntime.h") // } // # -# from("$projectDir/../Common/cpp/worklets/SharedItems/") { // # -# include("Serializable.h") // include("Synchronizable.h") // } - -# file(CREATE_LINK "${COMMON_CPP_DIR}/worklets/RunLoop/AsyncQueue.h" -# "${PUBLIC_INCLUDE_DIR}/AsyncQueue.h" SYMBOLIC) file(CREATE_LINK -# "${COMMON_CPP_DIR}/worklets/WorkletRuntime/WorkletRuntime.h" -# "${PUBLIC_INCLUDE_DIR}/WorkletRuntime.h" SYMBOLIC) file(CREATE_LINK -# "${COMMON_CPP_DIR}/worklets/SharedItems/Serializable.h" -# "${PUBLIC_INCLUDE_DIR}/Serializable.h" SYMBOLIC) file(CREATE_LINK -# "${COMMON_CPP_DIR}/worklets/SharedItems/Synchronizable.h" -# "${PUBLIC_INCLUDE_DIR}/Synchronizable.h" SYMBOLIC) diff --git a/packages/react-native-worklets/android/build.gradle b/packages/react-native-worklets/android/build.gradle index aac2668dea09..e28f404be351 100644 --- a/packages/react-native-worklets/android/build.gradle +++ b/packages/react-native-worklets/android/build.gradle @@ -1,6 +1,7 @@ import com.android.build.gradle.tasks.ExternalNativeBuildJsonTask import groovy.json.JsonSlurper +import javax.inject.Inject import java.nio.file.Files import java.nio.file.Paths import org.apache.tools.ant.taskdefs.condition.Os @@ -109,19 +110,7 @@ def HERMES_V1_ENABLED = safeAppExtGet("hermesV1Enabled", false) // Set version for prefab version WORKLETS_VERSION -def workletsPrefabHeadersDir = project.file("${buildDir}/prefab-headers/worklets") -workletsPrefabHeadersDir.mkdirs() -def RNWorkletsPrefabHeadersDir = project.file("${buildDir}/prefab-headers/RNWorklets") -RNWorkletsPrefabHeadersDir.mkdirs() -def RNWorkletsPrefabHeadersAPIDir = project.file("${buildDir}/prefab-headers/RNWorklets/RNWorklets") -RNWorkletsPrefabHeadersAPIDir.mkdirs() -// def rootProjectBuildDir = rootProject.hasProperty("buildDir") ? rootProject.buildDir : "${rootProject.projectDir}/build" -// println("Root project build dir: ") -// println(rootProject) -// println(rootProject.hasProperty("buildDir")) -// println(rootProject.buildDir) -// println(rootProjectBuildDir) -// println(rootProject.projectDir) +def workletsPrefabHeadersDir = project.file("$buildDir/prefab-headers/worklets") def JS_RUNTIME = { // Override JS runtime with environment variable @@ -188,13 +177,6 @@ android { prefab { worklets { headers workletsPrefabHeadersDir.absolutePath - headerOnly false - // headers RNWorkletsPrefabHeadersDir.absolutePath - } - RNWorklets { - // headers RNWorkletsHeadersDir.absolutePath - headers RNWorkletsPrefabHeadersDir.absolutePath - headerOnly true } } @@ -222,10 +204,8 @@ android { "-DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON", "-DWORKLETS_FEATURE_FLAGS=${WORKLETS_FEATURE_FLAGS}", "-DHERMES_V1_ENABLED=${HERMES_V1_ENABLED}" - // , - // "-DRNWORKLETS_HEADERS_DIR=${toPlatformFileString(RNWorkletsHeadersDir.path)}" abiFilters (*reactNativeArchitectures()) - targets("worklets", "RNWorklets") + targets("worklets") } } @@ -335,90 +315,65 @@ task assertNewArchitectureEnabledTask { preBuild.dependsOn(assertNewArchitectureEnabledTask) -//tasks.register('prepareWorkletsHeadersForPrefabs',) { -task prepareWorkletsHeadersForPrefabs { - doFirst { - workletsPrefabHeadersDir.mkdirs() - RNWorkletsPrefabHeadersDir.mkdirs() - RNWorkletsPrefabHeadersAPIDir.mkdirs() - -// inputs.files(fileTree("$projectDir/src/main/cpp") { -// include '**/worklets/**/*.h' -// }) -// inputs.files(fileTree("$projectDir/../Common/cpp") { -// include '**/worklets/**/*.h' -// }) - // inputs.files([ - // file("$projectDir/../Common/cpp/worklets/RunLoop/AsyncQueue.h"), - // file("$projectDir/../Common/cpp/worklets/WorkletRuntime/WorkletRuntime.h"), - // file("$projectDir/../Common/cpp/worklets/SharedItems/Serializable.h"), - // file("$projectDir/../Common/cpp/worklets/SharedItems/Synchronizable.h") - // ]) - - def sourceDir1 = file("$projectDir/src/main/cpp") - def sourceDir2 = file("$projectDir/../Common/cpp") - - [sourceDir1, sourceDir2].each { sourceDir -> - if (sourceDir.exists()) { - sourceDir.eachFileRecurse { sourceFile -> - if (sourceFile.isFile() && sourceFile.path.contains("worklets") && sourceFile.name.endsWith(".h")) { - def relativePath = sourceDir.toPath().relativize(sourceFile.toPath()) - def targetFile = file("${workletsPrefabHeadersDir}/${relativePath}") - - targetFile.parentFile.mkdirs() - - if (targetFile.exists()) { - targetFile.delete() - } - - Files.createSymbolicLink( - targetFile.toPath(), - sourceFile.toPath() - ) - } - } - } - } +task prepareWorkletsHeadersForPrefabs(type: Copy) { + from("$projectDir/src/main/cpp") + from("$projectDir/../Common/cpp") + include("worklets/**/*.h") + into(workletsPrefabHeadersDir) +} - def sourceFiles = [ - file("$projectDir/../Common/cpp/worklets/RunLoop/AsyncQueue.h"), - file("$projectDir/../Common/cpp/worklets/WorkletRuntime/WorkletRuntime.h"), - file("$projectDir/../Common/cpp/worklets/SharedItems/Serializable.h"), - file("$projectDir/../Common/cpp/worklets/SharedItems/Synchronizable.h") - ] +def workletsPublicTargetDir = file("${workletsPrefabHeadersDir}/RNWorklets") + +tasks.register('cleanWorkletsHeaders', Delete) { + delete workletsPublicTargetDir +} - sourceFiles.each { sourceFile -> - def targetFile = file("${RNWorkletsPrefabHeadersAPIDir}/${sourceFile.name}") - targetFile.parentFile.mkdirs() +task preparePublicHeadersForPrefabs_experimental { + dependsOn prepareWorkletsHeadersForPrefabs + dependsOn cleanWorkletsHeaders - if (targetFile.exists()) { - targetFile.delete() - } + def links = [ + [file("${workletsPrefabHeadersDir}/worklets/WorkletRuntime/WorkletRuntime.h"), file("${workletsPublicTargetDir}/WorkletRuntime.h")], + [file("${workletsPrefabHeadersDir}/worklets/RunLoop/AsyncQueue.h"), file("${workletsPublicTargetDir}/AsyncQueue.h")], + [file("${workletsPrefabHeadersDir}/worklets/SharedItems/Serializable.h"), file("${workletsPublicTargetDir}/Serializable.h")], + [file("${workletsPrefabHeadersDir}/worklets/SharedItems/Synchronizable.h"), file("${workletsPublicTargetDir}/Synchronizable.h")] + ] - Files.createSymbolicLink( - targetFile.toPath(), - sourceFile.toPath() - ) + doLast { + workletsPublicTargetDir.mkdirs() + + links.each { link -> + Files.createSymbolicLink(link[1].toPath(), link[0].toPath()) } + } +} -// outputs.dir(workletsPrefabHeadersDir) -// outputs.dir(RNWorkletsPrefabHeadersDir) +interface FSService { + @Inject FileSystemOperations getFs() +} + +tasks.register('cleanCmakeCache', Delete) { + def fsService = project.objects.newInstance(FSService) + def projectDir = project.projectDir + doFirst { + fsService.fs.delete {"$projectDir/.cxx" + } } } -// tasks.register("cleanCmakeCache", Delete) { -// delete(layout.projectDirectory.dir(".cxx")) -// } -// tasks.named("clean") { -// dependsOn("cleanCmakeCache") -// } +tasks.named('clean') { + dependsOn cleanCmakeCache +} repositories { mavenCentral() google() } +preBuild.dependsOn(prepareWorkletsHeadersForPrefabs) +preBuild.dependsOn(preparePublicHeadersForPrefabs_experimental) + dependencies { implementation "com.facebook.yoga:proguard-annotations:1.19.0" implementation "androidx.transition:transition:1.1.0" @@ -429,5 +384,3 @@ dependencies { implementation "com.facebook.react:hermes-android" // version substituted by RNGP } } - -preBuild.dependsOn(prepareWorkletsHeadersForPrefabs) From 66d513bbb6eb7edee893606deb313d8503fff9ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20=C5=BBelawski?= Date: Tue, 2 Dec 2025 10:29:11 +0100 Subject: [PATCH 08/12] chore: patch RNGP to enable Android Studio Clean Project --- ...tive-gradle-plugin-npm-0.82.0-10aedc0588.patch | 15 +++++++++++++++ package.json | 3 +++ yarn.lock | 7 +++++++ 3 files changed, 25 insertions(+) create mode 100644 .yarn/patches/@react-native-gradle-plugin-npm-0.82.0-10aedc0588.patch diff --git a/.yarn/patches/@react-native-gradle-plugin-npm-0.82.0-10aedc0588.patch b/.yarn/patches/@react-native-gradle-plugin-npm-0.82.0-10aedc0588.patch new file mode 100644 index 000000000000..4a729e21a42f --- /dev/null +++ b/.yarn/patches/@react-native-gradle-plugin-npm-0.82.0-10aedc0588.patch @@ -0,0 +1,15 @@ +diff --git a/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/ReactPlugin.kt b/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/ReactPlugin.kt +index 890e61c007d5b3e0a9a69d37ef10e8aa3ce5c6b6..91acd7b2930fedb4eca2461ba99287721ca1f38f 100644 +--- a/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/ReactPlugin.kt ++++ b/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/ReactPlugin.kt +@@ -80,7 +80,9 @@ class ReactPlugin : Plugin { + configureRepositories(project) + } + +- configureReactNativeNdk(project, extension) ++ if(!project.gradle.startParameter.taskNames.any { it.contains("clean") }) { ++ configureReactNativeNdk(project, extension) ++ } + configureBuildConfigFieldsForApp(project, extension) + configureDevServerLocation(project) + configureBackwardCompatibilityReactMap(project) diff --git a/package.json b/package.json index 141335c03687..81b7447f4021 100644 --- a/package.json +++ b/package.json @@ -70,5 +70,8 @@ "react-native-builder-bob": "0.40.13", "shelljs": "0.10.0", "typescript": "5.8.3" + }, + "resolutions": { + "@react-native/gradle-plugin@npm:0.82.0": "patch:@react-native/gradle-plugin@npm%3A0.82.0#~/.yarn/patches/@react-native-gradle-plugin-npm-0.82.0-10aedc0588.patch" } } diff --git a/yarn.lock b/yarn.lock index f725c7271b7f..d48461c9f5e3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7072,6 +7072,13 @@ __metadata: languageName: node linkType: hard +"@react-native/gradle-plugin@patch:@react-native/gradle-plugin@npm%3A0.82.0#~/.yarn/patches/@react-native-gradle-plugin-npm-0.82.0-10aedc0588.patch": + version: 0.82.0 + resolution: "@react-native/gradle-plugin@patch:@react-native/gradle-plugin@npm%3A0.82.0#~/.yarn/patches/@react-native-gradle-plugin-npm-0.82.0-10aedc0588.patch::version=0.82.0&hash=60e1b9" + checksum: 10/493d986f2b23678dacd32a5e20a1c4b94e981b5d1abdf6fd35a9fb195b61900250dabb05d54e64af7e779c5b2e55cb96f431c16db0ba326ae8c0d43c5956616d + languageName: node + linkType: hard + "@react-native/js-polyfills@npm:0.79.6": version: 0.79.6 resolution: "@react-native/js-polyfills@npm:0.79.6" From fabca21b8da052b068a57ac89b3635a55744642c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20=C5=BBelawski?= Date: Tue, 2 Dec 2025 10:31:40 +0100 Subject: [PATCH 09/12] fix(Worklets): prefab cache issue for prefab consumers --- .../android/build.gradle | 2 + .../android/fix-prefab.gradle | 53 +++++++++++++++++++ 2 files changed, 55 insertions(+) create mode 100644 packages/react-native-worklets/android/fix-prefab.gradle diff --git a/packages/react-native-worklets/android/build.gradle b/packages/react-native-worklets/android/build.gradle index 2e5ad454afb1..61c565b3b26c 100644 --- a/packages/react-native-worklets/android/build.gradle +++ b/packages/react-native-worklets/android/build.gradle @@ -150,6 +150,8 @@ apply plugin: "com.android.library" apply plugin: "maven-publish" apply plugin: "de.undercouch.download" +apply from: "./fix-prefab.gradle" + android { compileSdkVersion safeExtGet("compileSdkVersion", 34) diff --git a/packages/react-native-worklets/android/fix-prefab.gradle b/packages/react-native-worklets/android/fix-prefab.gradle new file mode 100644 index 000000000000..fcf502a0ca48 --- /dev/null +++ b/packages/react-native-worklets/android/fix-prefab.gradle @@ -0,0 +1,53 @@ +tasks.configureEach { task -> + // Make sure that we generate our prefab publication file only after having built the native library + // so that not a header publication file, but a full configuration publication will be generated, which + // will include the .so file + + def prefabConfigurePattern = ~/^prefab(.+)ConfigurePackage$/ + def matcher = task.name =~ prefabConfigurePattern + if (matcher.matches()) { + def variantName = matcher[0][1] + task.outputs.upToDateWhen { false } + task.dependsOn("externalNativeBuild${variantName}") + } +} + +afterEvaluate { + def abis = reactNativeArchitectures() + rootProject.allprojects.each { proj -> + + if (proj === rootProject) return + + def dependsOnThisLib = proj.configurations.any { config -> + config.dependencies.any { dep -> + dep.group == project.group && dep.name == project.name + } + } + + if (!dependsOnThisLib && proj != project) return + + if (!proj.plugins.hasPlugin('com.android.application') && !proj.plugins.hasPlugin('com.android.library')) { + return + } + + def variants = proj.android.hasProperty('applicationVariants') ? proj.android.applicationVariants : proj.android.libraryVariants + // Touch the prefab_config.json files to ensure that in ExternalNativeJsonGenerator.kt we will re-trigger the prefab CLI to + // generate a libnameConfig.cmake file that will contain our native library (.so). + // See this condition: https://cs.android.com/android-studio/platform/tools/base/+/mirror-goog-studio-main:build-system/gradle-core/src/main/java/com/android/build/gradle/tasks/ExternalNativeJsonGenerator.kt;l=207-219?q=createPrefabBuildSystemGlue + variants.all { variant -> + def variantName = variant.name + abis.each { abi -> + def searchDir = new File(proj.projectDir, ".cxx/${variantName}") + if (!searchDir.exists()) return + def matches = [] + searchDir.eachDir { randomDir -> + def prefabFile = new File(randomDir, "${abi}/prefab_config.json") + if (prefabFile.exists()) matches << prefabFile + } + matches.each { prefabConfig -> + prefabConfig.setLastModified(System.currentTimeMillis()) + } + } + } + } +} From 7750841b9594e37c7845e6cf39741e06241c2efb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20=C5=BBelawski?= Date: Tue, 2 Dec 2025 10:34:18 +0100 Subject: [PATCH 10/12] refactor(Reanimated): use worklets prefab again --- .../android/CMakeLists.txt | 15 +++------------ .../react-native-reanimated/android/build.gradle | 1 - 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/packages/react-native-reanimated/android/CMakeLists.txt b/packages/react-native-reanimated/android/CMakeLists.txt index d4731e6c9e5b..3f87cab8570b 100644 --- a/packages/react-native-reanimated/android/CMakeLists.txt +++ b/packages/react-native-reanimated/android/CMakeLists.txt @@ -45,6 +45,7 @@ file(GLOB_RECURSE REANIMATED_ANDROID_CPP_SOURCES CONFIGURE_DEPENDS find_package(fbjni REQUIRED CONFIG) find_package(ReactAndroid REQUIRED CONFIG) +find_package(react-native-worklets REQUIRED CONFIG) add_library(reanimated SHARED ${REANIMATED_COMMON_CPP_SOURCES} ${REANIMATED_ANDROID_CPP_SOURCES}) @@ -69,8 +70,7 @@ target_include_directories( "${REACT_NATIVE_DIR}/ReactCommon/runtimeexecutor" "${REACT_NATIVE_DIR}/ReactCommon/jsiexecutor" "${REACT_NATIVE_DIR}/ReactCommon/react/renderer/graphics/platform/cxx" - "${REACT_NATIVE_WORKLETS_DIR}/Common/cpp" - "${REACT_NATIVE_WORKLETS_DIR}/android/src/main/cpp") +) set_target_properties(reanimated PROPERTIES LINKER_LANGUAGE CXX) @@ -80,15 +80,6 @@ else() set(BUILD_TYPE "release") endif() -add_library(worklets SHARED IMPORTED) - -set_target_properties( - worklets - PROPERTIES - IMPORTED_LOCATION - "${REACT_NATIVE_WORKLETS_DIR}/android/build/intermediates/cmake/${BUILD_TYPE}/obj/${ANDROID_ABI}/libworklets.so" -) - set_target_properties(reanimated PROPERTIES LINKER_LANGUAGE CXX) # remove dead code sections set_target_properties(reanimated PROPERTIES LINK_FLAGS "-Wl,--gc-sections") @@ -108,4 +99,4 @@ target_link_libraries( ReactAndroid::jsi fbjni::fbjni android - worklets) + react-native-worklets::worklets) diff --git a/packages/react-native-reanimated/android/build.gradle b/packages/react-native-reanimated/android/build.gradle index 86bace765ea9..c62f275012b1 100644 --- a/packages/react-native-reanimated/android/build.gradle +++ b/packages/react-native-reanimated/android/build.gradle @@ -198,7 +198,6 @@ android { "-DREACT_NATIVE_MINOR_VERSION=${REACT_NATIVE_MINOR_VERSION}", "-DANDROID_TOOLCHAIN=clang", "-DREACT_NATIVE_DIR=${toPlatformFileString(reactNativeRootDir.path)}", - "-DREACT_NATIVE_WORKLETS_DIR=${toPlatformFileString(reactNativeWorkletsRootDir.path)}", "-DIS_REANIMATED_EXAMPLE_APP=${IS_REANIMATED_EXAMPLE_APP}", "-DREANIMATED_PROFILING=${REANIMATED_PROFILING}", "-DREANIMATED_VERSION=${REANIMATED_VERSION}", From 78098a469341ff25b0e2a875218dfc87feb01a2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20=C5=BBelawski?= Date: Tue, 2 Dec 2025 10:48:11 +0100 Subject: [PATCH 11/12] chore: cleanup --- .../android/fix-prefab.gradle | 51 ------------------- .../android/CMakeLists.txt | 2 +- 2 files changed, 1 insertion(+), 52 deletions(-) delete mode 100644 packages/react-native-reanimated/android/fix-prefab.gradle diff --git a/packages/react-native-reanimated/android/fix-prefab.gradle b/packages/react-native-reanimated/android/fix-prefab.gradle deleted file mode 100644 index d6c010ef785b..000000000000 --- a/packages/react-native-reanimated/android/fix-prefab.gradle +++ /dev/null @@ -1,51 +0,0 @@ -tasks.configureEach { task -> - // Make sure that we generate our prefab publication file only after having built the native library - // so that not a header publication file, but a full configuration publication will be generated, which - // will include the .so file - - def prefabConfigurePattern = ~/^prefab(.+)ConfigurePackage$/ - def matcher = task.name =~ prefabConfigurePattern - if (matcher.matches()) { - def variantName = matcher[0][1] - task.outputs.upToDateWhen { false } - task.dependsOn("externalNativeBuild${variantName}") - } -} - -afterEvaluate { - def abis = reactNativeArchitectures() - rootProject.allprojects.each { proj -> - if (proj === rootProject) return - - def dependsOnThisLib = proj.configurations.findAll { it.canBeResolved }.any { config -> - config.dependencies.any { dep -> - dep.group == project.group && dep.name == project.name - } - } - if (!dependsOnThisLib && proj != project) return - - if (!proj.plugins.hasPlugin('com.android.application') && !proj.plugins.hasPlugin('com.android.library')) { - return - } - - def variants = proj.android.hasProperty('applicationVariants') ? proj.android.applicationVariants : proj.android.libraryVariants - // Touch the prefab_config.json files to ensure that in ExternalNativeJsonGenerator.kt we will re-trigger the prefab CLI to - // generate a libnameConfig.cmake file that will contain our native library (.so). - // See this condition: https://cs.android.com/android-studio/platform/tools/base/+/mirror-goog-studio-main:build-system/gradle-core/src/main/java/com/android/build/gradle/tasks/ExternalNativeJsonGenerator.kt;l=207-219?q=createPrefabBuildSystemGlue - variants.all { variant -> - def variantName = variant.name - abis.each { abi -> - def searchDir = new File(proj.projectDir, ".cxx/${variantName}") - if (!searchDir.exists()) return - def matches = [] - searchDir.eachDir { randomDir -> - def prefabFile = new File(randomDir, "${abi}/prefab_config.json") - if (prefabFile.exists()) matches << prefabFile - } - matches.each { prefabConfig -> - prefabConfig.setLastModified(System.currentTimeMillis()) - } - } - } - } -} diff --git a/packages/react-native-worklets/android/CMakeLists.txt b/packages/react-native-worklets/android/CMakeLists.txt index acd96117cab8..7ce60581c4de 100644 --- a/packages/react-native-worklets/android/CMakeLists.txt +++ b/packages/react-native-worklets/android/CMakeLists.txt @@ -1,5 +1,5 @@ project(Worklets) -cmake_minimum_required(VERSION 3.13) +cmake_minimum_required(VERSION 3.8) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) From 3fcdc5a2eef57c287e2fb7467775820570b119a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20=C5=BBelawski?= Date: Wed, 3 Dec 2025 21:21:30 +0100 Subject: [PATCH 12/12] chore: wip of fixing prefab issues in all configurations --- apps/common-app/package.json | 21 - apps/fabric-example/android/app/build.gradle | 22 + apps/fabric-example/android/gradle.properties | 3 +- apps/fabric-example/ios/Podfile.lock | 2 +- .../AnimatedSensor/AnimatedSensorModule.h | 2 + .../LayoutAnimationsManager.h | 1 + .../NativeModules/ReanimatedModuleProxy.cpp | 1 + .../android/build.gradle | 61 ++- .../react-native-worklets/RNWorklets.podspec | 3 + .../android/build.gradle | 61 ++- yarn.lock | 443 +----------------- 11 files changed, 141 insertions(+), 479 deletions(-) diff --git a/apps/common-app/package.json b/apps/common-app/package.json index f98375494a2a..bfecef606703 100644 --- a/apps/common-app/package.json +++ b/apps/common-app/package.json @@ -16,32 +16,11 @@ "react-native": "*" }, "dependencies": { - "@fortawesome/fontawesome-svg-core": "6.5.2", - "@fortawesome/free-solid-svg-icons": "6.5.2", - "@fortawesome/react-native-fontawesome": "0.3.2", - "@gorhom/bottom-sheet": "patch:@gorhom/bottom-sheet@npm%3A5.2.6#~/.yarn/patches/@gorhom-bottom-sheet-npm-5.2.6-c24dba2629.patch", - "@gorhom/portal": "1.0.14", - "@react-native-async-storage/async-storage": "2.2.0", - "@react-native-clipboard/clipboard": "1.16.3", - "@react-native-masked-view/masked-view": "0.3.2", - "@react-navigation/bottom-tabs": "7.4.8", - "@react-navigation/drawer": "7.5.9", - "@react-navigation/native": "7.1.18", - "@react-navigation/native-stack": "7.3.27", - "@react-navigation/stack": "7.4.9", - "@shopify/flash-list": "2.1.0", "d3-shape": "3.2.0", "fuse.js": "patch:fuse.js@npm%3A7.1.0#~/.yarn/patches/fuse.js-npm-7.1.0-5dcae892a6.patch", "react": "19.1.1", "react-dom": "19.1.1", - "react-native-gesture-handler": "2.28.0", - "react-native-mmkv": "4.0.0", - "react-native-nitro-modules": "0.31.9", - "react-native-pager-view": "7.0.0", "react-native-reanimated": "workspace:*", - "react-native-safe-area-context": "5.6.1", - "react-native-screens": "4.16.0", - "react-native-svg": "15.14.0", "react-native-worklets": "workspace:*", "react-strict-dom": "0.0.54" }, diff --git a/apps/fabric-example/android/app/build.gradle b/apps/fabric-example/android/app/build.gradle index 88d44c98e12c..67b009b43d78 100644 --- a/apps/fabric-example/android/app/build.gradle +++ b/apps/fabric-example/android/app/build.gradle @@ -107,6 +107,28 @@ android { } } +// interface FSService { +// @Inject FileSystemOperations getFs() +// } + +// tasks.register('cleanCmakeCache', Delete) { +// def fsService = project.objects.newInstance(FSService) +// def projectDir = project.projectDir + +// def buildDir = project.buildDir +// def cxxDir = new File(projectDir, ".cxx") +// doFirst { +// delete "$buildDir" +// delete "${projectDir}/.cxx" +// delete "${projectDir}/../build" +// } +// } + +// tasks.named('clean') { +// dependsOn cleanCmakeCache +// } + + dependencies { // The version of react-native is set by the React Native Gradle Plugin implementation("com.facebook.react:react-android") diff --git a/apps/fabric-example/android/gradle.properties b/apps/fabric-example/android/gradle.properties index d183897bec8e..abe56413b77b 100644 --- a/apps/fabric-example/android/gradle.properties +++ b/apps/fabric-example/android/gradle.properties @@ -25,7 +25,8 @@ android.useAndroidX=true # Use this property to specify which architecture you want to build. # You can also override it from the CLI using # ./gradlew -PreactNativeArchitectures=x86_64 -reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64 +# reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64 +reactNativeArchitectures=arm64-v8a # Use this property to enable support to the new architecture. # This will allow you to use TurboModules and the Fabric render in diff --git a/apps/fabric-example/ios/Podfile.lock b/apps/fabric-example/ios/Podfile.lock index 837c94061750..6ca0fdbc1e95 100644 --- a/apps/fabric-example/ios/Podfile.lock +++ b/apps/fabric-example/ios/Podfile.lock @@ -3321,7 +3321,7 @@ SPEC CHECKSUMS: RNReanimated: 97ebf4d3c76929b6b0f866cfbd41c49b3a0d2dbf RNScreens: 0bbf16c074ae6bb1058a7bf2d1ae017f4306797c RNSVG: 8c0bbfa480a24b24468f1c76bd852a4aac3178e6 - RNWorklets: b2ad4ec784199346ed45f0d2eec051401d383c2d + RNWorklets: 7a90fa0d1722af806025402c038355faa20a41c3 SocketRocket: d4aabe649be1e368d1318fdf28a022d714d65748 Yoga: edeb9900b9e5bb5b27b9a6a2d5914e4fe4033c1b diff --git a/packages/react-native-reanimated/Common/cpp/reanimated/AnimatedSensor/AnimatedSensorModule.h b/packages/react-native-reanimated/Common/cpp/reanimated/AnimatedSensor/AnimatedSensorModule.h index 521bbf325b53..649f3b819a35 100644 --- a/packages/react-native-reanimated/Common/cpp/reanimated/AnimatedSensor/AnimatedSensorModule.h +++ b/packages/react-native-reanimated/Common/cpp/reanimated/AnimatedSensor/AnimatedSensorModule.h @@ -2,6 +2,8 @@ #include +// #include +// #include #include #include diff --git a/packages/react-native-reanimated/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsManager.h b/packages/react-native-reanimated/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsManager.h index c5b5c3065fcf..646b4d5bc378 100644 --- a/packages/react-native-reanimated/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsManager.h +++ b/packages/react-native-reanimated/Common/cpp/reanimated/LayoutAnimations/LayoutAnimationsManager.h @@ -3,6 +3,7 @@ #include #include +// #include #include #include 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 a3d3271e68aa..d34027834db8 100644 --- a/packages/react-native-reanimated/Common/cpp/reanimated/NativeModules/ReanimatedModuleProxy.cpp +++ b/packages/react-native-reanimated/Common/cpp/reanimated/NativeModules/ReanimatedModuleProxy.cpp @@ -7,6 +7,7 @@ #include #include +// #include #include #ifdef __ANDROID__ diff --git a/packages/react-native-reanimated/android/build.gradle b/packages/react-native-reanimated/android/build.gradle index d1385dff4511..0303c29f1f35 100644 --- a/packages/react-native-reanimated/android/build.gradle +++ b/packages/react-native-reanimated/android/build.gradle @@ -317,18 +317,22 @@ interface FSService { @Inject FileSystemOperations getFs() } -tasks.register('cleanCmakeCache', Delete) { - def fsService = project.objects.newInstance(FSService) - def projectDir = project.projectDir - doFirst { - fsService.fs.delete {"$projectDir/.cxx" - } - } -} - -tasks.named('clean') { - dependsOn cleanCmakeCache -} +// def cleanCmakeCacheTask = tasks.register('cleanCmakeCache', Delete) { +// def fsService = project.objects.newInstance(FSService) +// def projectDir = project.projectDir +// doLast { +// println "Cleaning CMake build cache in ${projectDir}" +// fsService.fs.delete { +// delete "${projectDir}/build" +// delete "${projectDir}/.cxx" +// } +// } +// } + +// // Ensure this runs after any externalNativeBuildClean* task +// tasks.matching { it.name.startsWith('externalNativeBuildClean') }.configureEach { +// finalizedBy(cleanCmakeCacheTask) +// } repositories { mavenCentral() @@ -353,13 +357,46 @@ dependencies { } } +// println "Tasks in the project:" +// tasks.each { task -> +// println task.name +// } + preBuild.dependsOn(prepareReanimatedHeadersForPrefabs) if (project != rootProject) { evaluationDependsOn(":react-native-worklets") afterEvaluate { +// def workletsTaskPath = ":react-native-worklets:prepareWorkletsHeadersForPrefabs_v2" + + // 2. Find all tasks that trigger the C++ build (ExternalNativeBuildTask) + // This covers both Debug and Release variants automatically. +// tasks.withType(com.android.build.gradle.tasks.ExternalNativeBuildTask).configureEach { cxxTask -> +// +// // 3. Add the dependency +// // We use the String path to avoid errors if the worklets project hasn't fully configured yet. +// cxxTask.dependsOn(workletsTaskPath) +// } + // 1. Find the target project + // def workletsProject = findProject(":react-native-worklets") + + // if (workletsProject != null) { + // // 2. Find the preBuild task in the target project + // def workletsPreBuildTask = workletsProject.tasks.findByName("preBuild") + + // if (workletsPreBuildTask != null) { + // // 3. Make the current project's preBuild task depend on the target's preBuild + // tasks.getByName("preBuild").dependsOn(workletsPreBuildTask) + // println("[Reanimated] Configured preBuild to depend on :react-native-worklets:preBuild.") + // } else { + // logger.warn("[Reanimated] Could not find 'preBuild' task in ':react-native-worklets'. Dependency not set.") + // } + // } else { + // logger.warn("[Reanimated] Could not find project ':react-native-worklets'. Dependency not set.") + // } tasks.getByName("externalNativeBuildDebug").dependsOn(findProject(":react-native-worklets").tasks.getByName("externalNativeBuildDebug")) tasks.getByName("externalNativeBuildRelease").dependsOn(findProject(":react-native-worklets").tasks.getByName("externalNativeBuildRelease")) + // tasks.getByName("configureCMakeDebug").dependsOn(findProject(":react-native-worklets").tasks.getByName("configureCMakeDebug")) } } diff --git a/packages/react-native-worklets/RNWorklets.podspec b/packages/react-native-worklets/RNWorklets.podspec index 44c3e766dd4d..5c871a6ee57c 100644 --- a/packages/react-native-worklets/RNWorklets.podspec +++ b/packages/react-native-worklets/RNWorklets.podspec @@ -28,6 +28,7 @@ Pod::Spec.new do |s| sss.source_files = "Common/cpp/worklets/**/*.{h,cpp}" sss.header_dir = "worklets" sss.header_mappings_dir = "Common/cpp/worklets" + sss.public_header_files = "**/*.h" end ss.subspec "apple" do |sss| @@ -37,6 +38,7 @@ Pod::Spec.new do |s| sss.source_files = "apple/worklets/**/*.{mm,h,m}" sss.header_dir = "worklets" sss.header_mappings_dir = "apple/worklets" + sss.public_header_files = "**/*.h" end ss.subspec "public" do |sss| @@ -45,6 +47,7 @@ Pod::Spec.new do |s| "Common/cpp/worklets/WorkletRuntime/WorkletRuntime.h", "Common/cpp/worklets/SharedItems/Serializable.h", "Common/cpp/worklets/SharedItems/Synchronizable.h" + sss.public_header_files = "**/*.h" end end diff --git a/packages/react-native-worklets/android/build.gradle b/packages/react-native-worklets/android/build.gradle index e28f404be351..6002ece5c8f4 100644 --- a/packages/react-native-worklets/android/build.gradle +++ b/packages/react-native-worklets/android/build.gradle @@ -353,17 +353,27 @@ interface FSService { @Inject FileSystemOperations getFs() } -tasks.register('cleanCmakeCache', Delete) { +afterEvaluate { + // Make sure that Gradle Sync in Android Studio doesn't complain about + // missing prefab-headers directory for header inclusions + workletsPrefabHeadersDir.mkdirs() +} + +def cleanCmakeCacheTask = tasks.register('cleanCmakeCache', Delete) { def fsService = project.objects.newInstance(FSService) def projectDir = project.projectDir - doFirst { - fsService.fs.delete {"$projectDir/.cxx" + doLast { + println "Cleaning CMake build cache in ${projectDir}" + fsService.fs.delete { + delete "${projectDir}/build" + delete "${projectDir}/.cxx" } } } -tasks.named('clean') { - dependsOn cleanCmakeCache +// Ensure this runs after any externalNativeBuildClean* task +tasks.matching { it.name.startsWith('externalNativeBuildClean') }.configureEach { + finalizedBy(cleanCmakeCacheTask) } repositories { @@ -371,6 +381,47 @@ repositories { google() } +tasks.named('preBuild') { + def projectDir = project.projectDir + def fsService = project.objects.newInstance(FSService) + + // 1. Define the actual copy action inside doFirst + doFirst { + // println("📝 [Worklets] Copying headers for Prefabs...") + + // Ensure the destination exists + // workletsPrefabHeadersDir.mkdirs() + // fsService.fs.delete { + // delete workletsPrefabHeadersDir + // } + + workletsPrefabHeadersDir.mkdirs() + + // Use the project.copy closure to perform file operations + fsService.fs.copy { + from("$projectDir/src/main/cpp") + from("$projectDir/../Common/cpp") + include("worklets/**/*.h") + into(workletsPrefabHeadersDir) + } + } + + // 2. Define the output for incremental builds + // This tells Gradle that if workletsPrefabHeadersDir is unchanged, it can skip running this task. +// outputs.dir(workletsPrefabHeadersDir) + + // 3. Define inputs (optional but recommended for correctness) + // This tells Gradle which files this task uses, so if they change, the task runs again. + inputs.files( + fileTree("$projectDir/src/main/cpp") { + include("worklets/**/*.h") + }, + fileTree("$projectDir/../Common/cpp") { + include("worklets/**/*.h") + } + ).withPropertyName('workletHeaders') +} + preBuild.dependsOn(prepareWorkletsHeadersForPrefabs) preBuild.dependsOn(preparePublicHeadersForPrefabs_experimental) diff --git a/yarn.lock b/yarn.lock index d48461c9f5e3..627090cbb2e7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4327,101 +4327,6 @@ __metadata: languageName: node linkType: hard -"@fortawesome/fontawesome-common-types@npm:6.5.2": - version: 6.5.2 - resolution: "@fortawesome/fontawesome-common-types@npm:6.5.2" - checksum: 10/a918b2dd6566db6878999e1c4523fa8d0fcc3c79f00086b48a36c365e543ac16a2950618f47893a8369d4ee13e454baf1f5108f7238bdf6ec2bea459b6c517ca - languageName: node - linkType: hard - -"@fortawesome/fontawesome-svg-core@npm:6.5.2": - version: 6.5.2 - resolution: "@fortawesome/fontawesome-svg-core@npm:6.5.2" - dependencies: - "@fortawesome/fontawesome-common-types": "npm:6.5.2" - checksum: 10/03cc6d9662f2014e2fbbf47e9678a6a21108edeb78ff551207eeb12404daa8bfa5c6dd30a474d3fca897e856ff4b45d35261bb445fc30994c46d91783722684d - languageName: node - linkType: hard - -"@fortawesome/free-solid-svg-icons@npm:6.5.2": - version: 6.5.2 - resolution: "@fortawesome/free-solid-svg-icons@npm:6.5.2" - dependencies: - "@fortawesome/fontawesome-common-types": "npm:6.5.2" - checksum: 10/2f6dde7eddc8ab9ed09d220c2dad6cb53922842d3f764ea9d393162ba50971b5be8f16e0c9a225ec808d6a2e92769a0d194e7e1ae8f98ccdd53f7a59aee2e31b - languageName: node - linkType: hard - -"@fortawesome/react-native-fontawesome@npm:0.3.2": - version: 0.3.2 - resolution: "@fortawesome/react-native-fontawesome@npm:0.3.2" - dependencies: - humps: "npm:^2.0.1" - prop-types: "npm:^15.7.2" - peerDependencies: - "@fortawesome/fontawesome-svg-core": ~1 || ~6 - react-native: ">= 0.67" - react-native-svg: ">= 11.x" - checksum: 10/2faf60eb38ad234403484d41dc910b634f9e4650c203b303f93c745c4679f53f6cbd45833c93c7a5359f53947335257454992ad9acde8cd47b0acf6b8d9f0e44 - languageName: node - linkType: hard - -"@gorhom/bottom-sheet@npm:5.2.6": - version: 5.2.6 - resolution: "@gorhom/bottom-sheet@npm:5.2.6" - dependencies: - "@gorhom/portal": "npm:1.0.14" - invariant: "npm:^2.2.4" - peerDependencies: - "@types/react": "*" - "@types/react-native": "*" - react: "*" - react-native: "*" - react-native-gesture-handler: ">=2.16.1" - react-native-reanimated: "*" - peerDependenciesMeta: - "@types/react": - optional: true - "@types/react-native": - optional: true - checksum: 10/bca8cf14a7627d2fb2b5e6ed75e5fa79be373ee1d227941e0a3c1b33b3385b04a24353b0c48c00b8aeea72a17a4612eefd31ac1b38ab66f5b3103d3d4eb9fef2 - languageName: node - linkType: hard - -"@gorhom/bottom-sheet@patch:@gorhom/bottom-sheet@npm%3A5.2.6#~/.yarn/patches/@gorhom-bottom-sheet-npm-5.2.6-c24dba2629.patch": - version: 5.2.6 - resolution: "@gorhom/bottom-sheet@patch:@gorhom/bottom-sheet@npm%3A5.2.6#~/.yarn/patches/@gorhom-bottom-sheet-npm-5.2.6-c24dba2629.patch::version=5.2.6&hash=5dd64e" - dependencies: - "@gorhom/portal": "npm:1.0.14" - invariant: "npm:^2.2.4" - peerDependencies: - "@types/react": "*" - "@types/react-native": "*" - react: "*" - react-native: "*" - react-native-gesture-handler: ">=2.16.1" - react-native-reanimated: "*" - peerDependenciesMeta: - "@types/react": - optional: true - "@types/react-native": - optional: true - checksum: 10/6b08b8c621a629759316198a73eb48cb0cb0bcb9a36f12adb0afe204f8bec9d414a5a7ba9daf1cfaaf06c3027bb391c630bc1444d8a5597d4356ded668e1642f - languageName: node - linkType: hard - -"@gorhom/portal@npm:1.0.14": - version: 1.0.14 - resolution: "@gorhom/portal@npm:1.0.14" - dependencies: - nanoid: "npm:^3.3.1" - peerDependencies: - react: "*" - react-native: "*" - checksum: 10/e0fa06be88b850cccdc6a1417a86e5ac21d82e3bfd1cec7eb05eccf7f3b595babe305541f278fdcbde34f3a9db465097dca2c785445c28bafb83b744e235da0c - languageName: node - linkType: hard - "@hapi/address@npm:^5.1.1": version: 5.1.1 resolution: "@hapi/address@npm:5.1.1" @@ -5884,34 +5789,6 @@ __metadata: languageName: node linkType: hard -"@react-native-async-storage/async-storage@npm:2.2.0": - version: 2.2.0 - resolution: "@react-native-async-storage/async-storage@npm:2.2.0" - dependencies: - merge-options: "npm:^3.0.4" - peerDependencies: - react-native: ^0.0.0-0 || >=0.65 <1.0 - checksum: 10/625e42134f0c487acfd4ba9b3ba182e6f6f29581485004cc658850ef024372cdb7381b7399393f4416fda39df2d822e3008427d7671d635a7363f9a65430a2dd - languageName: node - linkType: hard - -"@react-native-clipboard/clipboard@npm:1.16.3": - version: 1.16.3 - resolution: "@react-native-clipboard/clipboard@npm:1.16.3" - peerDependencies: - react: ">= 16.9.0" - react-native: ">= 0.61.5" - react-native-macos: ">= 0.61.0" - react-native-windows: ">= 0.61.0" - peerDependenciesMeta: - react-native-macos: - optional: true - react-native-windows: - optional: true - checksum: 10/87608bee52757af514b4717c42cde330dd61f46d1348dd59b4f478a27d351060c8b433375166d486d3e80d3db41dfcd17be401679cced3951c69857727ecbc96 - languageName: node - linkType: hard - "@react-native-community/cli-clean@npm:20.0.0": version: 20.0.0 resolution: "@react-native-community/cli-clean@npm:20.0.0" @@ -6359,16 +6236,6 @@ __metadata: languageName: node linkType: hard -"@react-native-masked-view/masked-view@npm:0.3.2": - version: 0.3.2 - resolution: "@react-native-masked-view/masked-view@npm:0.3.2" - peerDependencies: - react: ">=16" - react-native: ">=0.57" - checksum: 10/04ffbc01083aa563ca1e2d7ef6759e7b326b8129f5bb1aa5f3142348adab06d5e321a400cf70a5434324dfa906add383f8214640697c48c9e5311b30bfea03d9 - languageName: node - linkType: hard - "@react-native-tvos/virtualized-lists@npm:0.81.1-1": version: 0.81.1-1 resolution: "@react-native-tvos/virtualized-lists@npm:0.81.1-1" @@ -7282,137 +7149,6 @@ __metadata: languageName: node linkType: hard -"@react-navigation/bottom-tabs@npm:7.4.8": - version: 7.4.8 - resolution: "@react-navigation/bottom-tabs@npm:7.4.8" - dependencies: - "@react-navigation/elements": "npm:^2.6.5" - color: "npm:^4.2.3" - peerDependencies: - "@react-navigation/native": ^7.1.18 - react: ">= 18.2.0" - react-native: "*" - react-native-safe-area-context: ">= 4.0.0" - react-native-screens: ">= 4.0.0" - checksum: 10/6b1943cc6a7cd2be35c9e40aee60cfb04e0af50ed93c5d48be6e0c0ad723c486b2c3bf382d8038c4b7d2bfefe6d32037db903e29bdd4fcd5748458f8c8ca5dc2 - languageName: node - linkType: hard - -"@react-navigation/core@npm:^7.12.4": - version: 7.12.4 - resolution: "@react-navigation/core@npm:7.12.4" - dependencies: - "@react-navigation/routers": "npm:^7.5.1" - escape-string-regexp: "npm:^4.0.0" - nanoid: "npm:^3.3.11" - query-string: "npm:^7.1.3" - react-is: "npm:^19.1.0" - use-latest-callback: "npm:^0.2.4" - use-sync-external-store: "npm:^1.5.0" - peerDependencies: - react: ">= 18.2.0" - checksum: 10/6258d645be5d3b29293a7f82a7fbcfbefec93f974b332e7b1c510b4557f772955f227be50d020679d5ea3ba764a34ad3ff3ada531a4b85d9b4395ee02cdc3777 - languageName: node - linkType: hard - -"@react-navigation/drawer@npm:7.5.9": - version: 7.5.9 - resolution: "@react-navigation/drawer@npm:7.5.9" - dependencies: - "@react-navigation/elements": "npm:^2.6.5" - color: "npm:^4.2.3" - react-native-drawer-layout: "npm:^4.1.13" - use-latest-callback: "npm:^0.2.4" - peerDependencies: - "@react-navigation/native": ^7.1.18 - react: ">= 18.2.0" - react-native: "*" - react-native-gesture-handler: ">= 2.0.0" - react-native-reanimated: ">= 2.0.0" - react-native-safe-area-context: ">= 4.0.0" - react-native-screens: ">= 4.0.0" - checksum: 10/2c2a56b67baa762d3824578daf2cb8f0b811a109b493a1a480f85a85c9dd461f51dec9fbeed3649464f160075505a39a63f4ceb2c3358690788e1157b3fc6338 - languageName: node - linkType: hard - -"@react-navigation/elements@npm:^2.6.5": - version: 2.6.5 - resolution: "@react-navigation/elements@npm:2.6.5" - dependencies: - color: "npm:^4.2.3" - use-latest-callback: "npm:^0.2.4" - use-sync-external-store: "npm:^1.5.0" - peerDependencies: - "@react-native-masked-view/masked-view": ">= 0.2.0" - "@react-navigation/native": ^7.1.18 - react: ">= 18.2.0" - react-native: "*" - react-native-safe-area-context: ">= 4.0.0" - peerDependenciesMeta: - "@react-native-masked-view/masked-view": - optional: true - checksum: 10/b939f1dc1981c12379cea7ee26348e29bff94de6f29fefe74e8f1d311662d2235e6d87322c5e27e10a59648b88fa5648cb64c646daf65e94dd2664f060408ed2 - languageName: node - linkType: hard - -"@react-navigation/native-stack@npm:7.3.27": - version: 7.3.27 - resolution: "@react-navigation/native-stack@npm:7.3.27" - dependencies: - "@react-navigation/elements": "npm:^2.6.5" - warn-once: "npm:^0.1.1" - peerDependencies: - "@react-navigation/native": ^7.1.18 - react: ">= 18.2.0" - react-native: "*" - react-native-safe-area-context: ">= 4.0.0" - react-native-screens: ">= 4.0.0" - checksum: 10/89f13700464d8938210471f4c9c4599e0070e7159b0659aef2f78f328684f73f00021e3bccc3b86f6bd83a26f7e91512292dab1e433409b0143bbc80f2f58689 - languageName: node - linkType: hard - -"@react-navigation/native@npm:7.1.18": - version: 7.1.18 - resolution: "@react-navigation/native@npm:7.1.18" - dependencies: - "@react-navigation/core": "npm:^7.12.4" - escape-string-regexp: "npm:^4.0.0" - fast-deep-equal: "npm:^3.1.3" - nanoid: "npm:^3.3.11" - use-latest-callback: "npm:^0.2.4" - peerDependencies: - react: ">= 18.2.0" - react-native: "*" - checksum: 10/b867e9c5164943cd22a3d39d563dd8986b7f012ea9dac6b2df0b0321c42b2c00a1ab3692a372fa31c77a5335f3a78cf6967ee7186fe5322237f8f95035f1f0c5 - languageName: node - linkType: hard - -"@react-navigation/routers@npm:^7.5.1": - version: 7.5.1 - resolution: "@react-navigation/routers@npm:7.5.1" - dependencies: - nanoid: "npm:^3.3.11" - checksum: 10/b2f41b084d9ff69ac934e798fabca149a7d2cfc6ca1899d9ffbb68f8378c02277752e68783c264ea5068be9c8738d0d5112abb177c00c0365cfd2a133d560a8c - languageName: node - linkType: hard - -"@react-navigation/stack@npm:7.4.9": - version: 7.4.9 - resolution: "@react-navigation/stack@npm:7.4.9" - dependencies: - "@react-navigation/elements": "npm:^2.6.5" - color: "npm:^4.2.3" - peerDependencies: - "@react-navigation/native": ^7.1.18 - react: ">= 18.2.0" - react-native: "*" - react-native-gesture-handler: ">= 2.0.0" - react-native-safe-area-context: ">= 4.0.0" - react-native-screens: ">= 4.0.0" - checksum: 10/425441769318cd2d1b5354b24aed5c557d97b52e7305e6c3a55186cc7b3958a85cddeee925b9766026a7a66fc02b1d650fa26619b0edf6d63feef94a923b2be2 - languageName: node - linkType: hard - "@resvg/resvg-wasm@npm:2.4.0": version: 2.4.0 resolution: "@resvg/resvg-wasm@npm:2.4.0" @@ -12707,27 +12443,13 @@ __metadata: "@babel/core": "npm:7.28.4" "@babel/preset-env": "npm:7.28.3" "@babel/runtime": "npm:7.28.4" - "@fortawesome/fontawesome-svg-core": "npm:6.5.2" - "@fortawesome/free-solid-svg-icons": "npm:6.5.2" - "@fortawesome/react-native-fontawesome": "npm:0.3.2" - "@gorhom/bottom-sheet": "patch:@gorhom/bottom-sheet@npm%3A5.2.6#~/.yarn/patches/@gorhom-bottom-sheet-npm-5.2.6-c24dba2629.patch" - "@gorhom/portal": "npm:1.0.14" - "@react-native-async-storage/async-storage": "npm:2.2.0" - "@react-native-clipboard/clipboard": "npm:1.16.3" "@react-native-community/cli": "npm:20.0.0" "@react-native-community/cli-platform-android": "npm:20.0.0" "@react-native-community/cli-platform-ios": "npm:20.0.0" - "@react-native-masked-view/masked-view": "npm:0.3.2" "@react-native/babel-preset": "npm:0.82.0" "@react-native/eslint-config": "npm:0.82.0" "@react-native/metro-config": "npm:0.82.0" "@react-native/typescript-config": "npm:0.82.0" - "@react-navigation/bottom-tabs": "npm:7.4.8" - "@react-navigation/drawer": "npm:7.5.9" - "@react-navigation/native": "npm:7.1.18" - "@react-navigation/native-stack": "npm:7.3.27" - "@react-navigation/stack": "npm:7.4.9" - "@shopify/flash-list": "npm:2.1.0" "@tsconfig/react-native": "npm:3.0.0" "@types/d3-shape": "npm:3.1.7" "@types/jest": "npm:30.0.0" @@ -12742,14 +12464,7 @@ __metadata: react: "npm:19.1.1" react-dom: "npm:19.1.1" react-native: "npm:0.82.0" - react-native-gesture-handler: "npm:2.28.0" - react-native-mmkv: "npm:4.0.0" - react-native-nitro-modules: "npm:0.31.9" - react-native-pager-view: "npm:7.0.0" react-native-reanimated: "workspace:*" - react-native-safe-area-context: "npm:5.6.1" - react-native-screens: "npm:4.16.0" - react-native-svg: "npm:15.14.0" react-native-worklets: "workspace:*" react-strict-dom: "npm:0.0.54" react-test-renderer: "npm:19.1.1" @@ -13987,13 +13702,6 @@ __metadata: languageName: node linkType: hard -"decode-uri-component@npm:^0.2.2": - version: 0.2.2 - resolution: "decode-uri-component@npm:0.2.2" - checksum: 10/17a0e5fa400bf9ea84432226e252aa7b5e72793e16bf80b907c99b46a799aeacc139ec20ea57121e50c7bd875a1a4365928f884e92abf02e21a5a13790a0f33e - languageName: node - linkType: hard - "decompress-response@npm:^6.0.0": version: 6.0.0 resolution: "decompress-response@npm:6.0.0" @@ -16658,13 +16366,6 @@ __metadata: languageName: node linkType: hard -"filter-obj@npm:^1.1.0": - version: 1.1.0 - resolution: "filter-obj@npm:1.1.0" - checksum: 10/9d681939eec2b4b129cb4f307b7e93d954a0657421d4e5357d86093b26d3f4f570909ed43717dcfd62428b3cf8cddd9841b35f9d40d12ac62cfabaa677942593 - languageName: node - linkType: hard - "finalhandler@npm:1.1.2": version: 1.1.2 resolution: "finalhandler@npm:1.1.2" @@ -18163,13 +17864,6 @@ __metadata: languageName: node linkType: hard -"humps@npm:^2.0.1": - version: 2.0.1 - resolution: "humps@npm:2.0.1" - checksum: 10/16e63cba9659c54cdc5d55bc5f50033939e959cfb6a65d2e9aa36a7ac882e70c66fdb5b0cb28fb81a204681a28cc1051eecbed7b70d4ede2435ab13ebaa8ac2d - languageName: node - linkType: hard - "husky@npm:9.1.7": version: 9.1.7 resolution: "husky@npm:9.1.7" @@ -18899,13 +18593,6 @@ __metadata: languageName: node linkType: hard -"is-plain-obj@npm:^2.1.0": - version: 2.1.0 - resolution: "is-plain-obj@npm:2.1.0" - checksum: 10/cec9100678b0a9fe0248a81743041ed990c2d4c99f893d935545cfbc42876cbe86d207f3b895700c690ad2fa520e568c44afc1605044b535a7820c1d40e38daa - languageName: node - linkType: hard - "is-plain-obj@npm:^3.0.0": version: 3.0.0 resolution: "is-plain-obj@npm:3.0.0" @@ -21463,15 +21150,6 @@ __metadata: languageName: node linkType: hard -"merge-options@npm:^3.0.4": - version: 3.0.4 - resolution: "merge-options@npm:3.0.4" - dependencies: - is-plain-obj: "npm:^2.1.0" - checksum: 10/d86ddb3dd6e85d558dbf25dc944f3527b6bacb944db3fdda6e84a3f59c4e4b85231095f58b835758b9a57708342dee0f8de0dffa352974a48221487fe9f4584f - languageName: node - linkType: hard - "merge-stream@npm:^2.0.0": version: 2.0.0 resolution: "merge-stream@npm:2.0.0" @@ -23933,7 +23611,7 @@ __metadata: languageName: node linkType: hard -"nanoid@npm:^3.3.1, nanoid@npm:^3.3.11, nanoid@npm:^3.3.6, nanoid@npm:^3.3.7": +"nanoid@npm:^3.3.11, nanoid@npm:^3.3.6, nanoid@npm:^3.3.7": version: 3.3.11 resolution: "nanoid@npm:3.3.11" bin: @@ -26548,18 +26226,6 @@ __metadata: languageName: node linkType: hard -"query-string@npm:^7.1.3": - version: 7.1.3 - resolution: "query-string@npm:7.1.3" - dependencies: - decode-uri-component: "npm:^0.2.2" - filter-obj: "npm:^1.1.0" - split-on-first: "npm:^1.0.0" - strict-uri-encode: "npm:^2.0.0" - checksum: 10/3b6f2c167e76ca4094c5f1a9eb276efcbb9ebfd8b1a28c413f3c4e4e7d6428c8187bf46c8cbc9f92a229369dd0015de10a7fd712c8cee98d5d84c2ac6140357e - languageName: node - linkType: hard - "queue-microtask@npm:^1.2.2": version: 1.2.3 resolution: "queue-microtask@npm:1.2.3" @@ -26726,15 +26392,6 @@ __metadata: languageName: node linkType: hard -"react-freeze@npm:^1.0.0": - version: 1.0.4 - resolution: "react-freeze@npm:1.0.4" - peerDependencies: - react: ">=17.0.0" - checksum: 10/1dc433319341ec3dca84513c4197ef4f4c8232604d35f83546a8abfb41d9591f934b66aaaa4dc3dc8b1b65f488705a2a48ae6c1d9792660119a9cdedeab4ca8f - languageName: node - linkType: hard - "react-helmet-async@npm:@slorber/react-helmet-async@1.3.0": version: 1.3.0 resolution: "@slorber/react-helmet-async@npm:1.3.0" @@ -26855,20 +26512,6 @@ __metadata: languageName: node linkType: hard -"react-native-drawer-layout@npm:^4.1.13": - version: 4.1.13 - resolution: "react-native-drawer-layout@npm:4.1.13" - dependencies: - use-latest-callback: "npm:^0.2.4" - peerDependencies: - react: ">= 18.2.0" - react-native: "*" - react-native-gesture-handler: ">= 2.0.0" - react-native-reanimated: ">= 2.0.0" - checksum: 10/c008acd68deee5599e5b8795c8995bfd5fcc3631604cd195003fb770b68e9b4f676fb718a51a31e29036e8e6e7a5bcb989df0a2360a4adb83956fdbb7ad8a01c - languageName: node - linkType: hard - "react-native-gesture-handler@npm:2.28.0": version: 2.28.0 resolution: "react-native-gesture-handler@npm:2.28.0" @@ -26890,7 +26533,7 @@ __metadata: languageName: node linkType: hard -"react-native-is-edge-to-edge@npm:1.2.1, react-native-is-edge-to-edge@npm:^1.2.1": +"react-native-is-edge-to-edge@npm:1.2.1": version: 1.2.1 resolution: "react-native-is-edge-to-edge@npm:1.2.1" peerDependencies: @@ -27010,17 +26653,6 @@ __metadata: languageName: node linkType: hard -"react-native-mmkv@npm:4.0.0": - version: 4.0.0 - resolution: "react-native-mmkv@npm:4.0.0" - peerDependencies: - react: "*" - react-native: "*" - react-native-nitro-modules: "*" - checksum: 10/5247b3e19017c4059c997ac79c7e89d33a49c00e2255fb4c5ef8e993fea0ee3aed0b48be9576d154bd098c22099bfd93a70fb071a6c9d865955c97f0aa1a8759 - languageName: node - linkType: hard - "react-native-monorepo-config@npm:^0.1.8": version: 0.1.10 resolution: "react-native-monorepo-config@npm:0.1.10" @@ -27031,26 +26663,6 @@ __metadata: languageName: node linkType: hard -"react-native-nitro-modules@npm:0.31.9": - version: 0.31.9 - resolution: "react-native-nitro-modules@npm:0.31.9" - peerDependencies: - react: "*" - react-native: "*" - checksum: 10/c102391695bae908c9c9eff7475b3fe7204de9595745ded9b7ccff887feba4f752cba54ca87056d1e09397a7d2b10c0a8ac11f0b212680e47af8175b4817fb96 - languageName: node - linkType: hard - -"react-native-pager-view@npm:7.0.0": - version: 7.0.0 - resolution: "react-native-pager-view@npm:7.0.0" - peerDependencies: - react: "*" - react-native: "*" - checksum: 10/652c12ebc9b473d81df99111d2dec0139585742b903dff916a6726156295af27d4bf464b9dcc22c133375dfc253a0653dba9c3cb705c892ba0beb7de8479792e - languageName: node - linkType: hard - "react-native-reanimated-monorepo@workspace:.": version: 0.0.0-use.local resolution: "react-native-reanimated-monorepo@workspace:." @@ -27153,30 +26765,6 @@ __metadata: languageName: unknown linkType: soft -"react-native-safe-area-context@npm:5.6.1": - version: 5.6.1 - resolution: "react-native-safe-area-context@npm:5.6.1" - peerDependencies: - react: "*" - react-native: "*" - checksum: 10/2fc93cf46a6cbad28e5850bef009905c6db44066fb7e6f7bbce52c2ae4b0467c6718e4f572a42f8387c6b37f6d61ebe79980d0c2b5899e23dc19482a7db8417b - languageName: node - linkType: hard - -"react-native-screens@npm:4.16.0": - version: 4.16.0 - resolution: "react-native-screens@npm:4.16.0" - dependencies: - react-freeze: "npm:^1.0.0" - react-native-is-edge-to-edge: "npm:^1.2.1" - warn-once: "npm:^0.1.0" - peerDependencies: - react: "*" - react-native: "*" - checksum: 10/f055d37b3abf96f42c15d61645441995884ed69b2a6b35f63a21abeb147b9df7e084447d2a329a424ee3686d703c25817ea588d3be9e6ebc38e5c653ebe5e05b - languageName: node - linkType: hard - "react-native-svg@npm:15.14.0": version: 15.14.0 resolution: "react-native-svg@npm:15.14.0" @@ -29434,13 +29022,6 @@ __metadata: languageName: node linkType: hard -"split-on-first@npm:^1.0.0": - version: 1.1.0 - resolution: "split-on-first@npm:1.1.0" - checksum: 10/16ff85b54ddcf17f9147210a4022529b343edbcbea4ce977c8f30e38408b8d6e0f25f92cd35b86a524d4797f455e29ab89eb8db787f3c10708e0b47ebf528d30 - languageName: node - linkType: hard - "split@npm:0.3": version: 0.3.3 resolution: "split@npm:0.3.3" @@ -29616,13 +29197,6 @@ __metadata: languageName: node linkType: hard -"strict-uri-encode@npm:^2.0.0": - version: 2.0.0 - resolution: "strict-uri-encode@npm:2.0.0" - checksum: 10/eaac4cf978b6fbd480f1092cab8b233c9b949bcabfc9b598dd79a758f7243c28765ef7639c876fa72940dac687181b35486ea01ff7df3e65ce3848c64822c581 - languageName: node - linkType: hard - "string-argv@npm:^0.3.2": version: 0.3.2 resolution: "string-argv@npm:0.3.2" @@ -31419,16 +30993,7 @@ __metadata: languageName: node linkType: hard -"use-latest-callback@npm:^0.2.4": - version: 0.2.6 - resolution: "use-latest-callback@npm:0.2.6" - peerDependencies: - react: ">=16.8" - checksum: 10/67a245bf91b23ef0d2d2c8a52845da62e006867bd9d93a99ca4d2f859101fcd54c7afd4f5a3b8bb5d24283f516e7e41bd8226250ee39affc33bd1cfd622a5cfb - languageName: node - linkType: hard - -"use-sync-external-store@npm:^1.0.0, use-sync-external-store@npm:^1.4.0, use-sync-external-store@npm:^1.5.0": +"use-sync-external-store@npm:^1.0.0, use-sync-external-store@npm:^1.4.0": version: 1.6.0 resolution: "use-sync-external-store@npm:1.6.0" peerDependencies: @@ -31748,7 +31313,7 @@ __metadata: languageName: node linkType: hard -"warn-once@npm:0.1.1, warn-once@npm:^0.1.0, warn-once@npm:^0.1.1": +"warn-once@npm:0.1.1": version: 0.1.1 resolution: "warn-once@npm:0.1.1" checksum: 10/e6a5a1f5a8dba7744399743d3cfb571db4c3947897875d4962a7c5b1bf2195ab4518c838cb4cea652e71729f21bba2e98dc75686f5fccde0fabbd894e2ed0c0d